query
stringlengths
10
3.85k
ru_query
stringlengths
9
3.76k
document
stringlengths
17
430k
metadata
dict
negatives
listlengths
97
100
negative_scores
listlengths
97
100
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
listBuiltInCreateRequest creates the ListBuiltIn request.
listBuiltInCreateRequest создает запрос ListBuiltIn.
func (client *PolicyDefinitionsClient) listBuiltInCreateRequest(ctx context.Context, options *PolicyDefinitionsListBuiltInOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Authorization/policyDefinitions" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-06-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() unencodedParams := []string{req.Raw().URL.RawQuery} if options != nil && options.Filter != nil { unencodedParams = append(unencodedParams, "$filter="+*options.Filter) } req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") req.Raw().Header.Set("Accept", "application/json") return req, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *SapMonitorsClient) listCreateRequest(ctx context.Context, options *SapMonitorsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2020-02-07-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *PolicyDefinitionsClient) getBuiltInCreateRequest(ctx context.Context, policyDefinitionName string, options *PolicyDefinitionsGetBuiltInOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}\"\n\tif policyDefinitionName == \"\" {\n\t\treturn nil, errors.New(\"parameter policyDefinitionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{policyDefinitionName}\", url.PathEscape(policyDefinitionName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *BuildServiceClient) listBuildsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientListBuildsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif buildServiceName == \"\" {\n\t\treturn nil, errors.New(\"parameter buildServiceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{buildServiceName}\", url.PathEscape(buildServiceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func CreateGetApplicationListRequest() (request *GetApplicationListRequest) {\n\trequest = &GetApplicationListRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"mse\", \"2019-05-31\", \"GetApplicationList\", \"mse\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, scope string, options *RoleDefinitionsListOptions) (*policy.Request, error) {\n\turlPath := \"/{scope}/providers/Microsoft.Authorization/roleDefinitions\"\n\turlPath = strings.ReplaceAll(urlPath, \"{scope}\", scope)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\treqQP.Set(\"api-version\", \"2018-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *MonitorsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListWarehousePath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"Warehouse\", \"List\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ConnectedEnvironmentsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *RegistrationDefinitionsClient) listCreateRequest(ctx context.Context, scope string, options *RegistrationDefinitionsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions\"\n\turlPath = strings.ReplaceAll(urlPath, \"{scope}\", scope)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-01-01-preview\")\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *WebAppsClient) listCreateRequest(ctx context.Context, options *WebAppsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ChildAvailabilityStatusesClient) listCreateRequest(ctx context.Context, resourceURI string, options *ChildAvailabilityStatusesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses\"\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceUri}\", resourceURI)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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\", \"2017-07-01\")\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, options *IPAllocationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *SQLVirtualMachinesClient) listCreateRequest(ctx context.Context, options *SQLVirtualMachinesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2017-03-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *KustoOperationsClient) listCreateRequest(ctx context.Context, options *KustoOperationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Synapse/kustooperations\"\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *BuildServiceClient) listSupportedBuildpacksCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientListSupportedBuildpacksOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif buildServiceName == \"\" {\n\t\treturn nil, errors.New(\"parameter buildServiceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{buildServiceName}\", url.PathEscape(buildServiceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListResourcePath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"resource\", \"List\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *WebhooksClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *WebhooksClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks\"\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 registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2019-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *VirtualMachineScaleSetsClient) listAllCreateRequest(ctx context.Context, options *VirtualMachineScaleSetsListAllOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, options *VirtualApplianceSKUsListOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus\"\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Telemetry(telemetryInfo)\n\tquery := req.URL.Query()\n\tquery.Set(\"api-version\", \"2020-07-01\")\n\treq.URL.RawQuery = query.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, options *VirtualMachinesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2022-01-10-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *BuildServiceClient) listBuildServicesCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *BuildServiceClientListBuildServicesOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *LocalRulestacksClient) listAppIDsCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListAppIDsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listAppIds\"\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 localRulestackName == \"\" {\n\t\treturn nil, errors.New(\"parameter localRulestackName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{localRulestackName}\", url.PathEscape(localRulestackName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, 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\", \"2022-08-29\")\n\tif options != nil && options.AppIDVersion != nil {\n\t\treqQP.Set(\"appIdVersion\", *options.AppIDVersion)\n\t}\n\tif options != nil && options.AppPrefix != nil {\n\t\treqQP.Set(\"appPrefix\", *options.AppPrefix)\n\t}\n\tif options != nil && options.Skip != nil {\n\t\treqQP.Set(\"skip\", *options.Skip)\n\t}\n\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *FactoriesClient) listCreateRequest(ctx context.Context, options *FactoriesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2018-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewListRequest() *rolespb.ListRequest {\n\tmessage := &rolespb.ListRequest{}\n\treturn message\n}", "func (c *Client) BuildListRequest(ctx context.Context, v any) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListStoragePath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"storage\", \"list\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, options *ManagedClustersClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsLocationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *PolicyDefinitionsClient) listCreateRequest(ctx context.Context, options *PolicyDefinitionsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"$top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\tunencodedParams := []string{req.Raw().URL.RawQuery}\n\tif options != nil && options.Filter != nil {\n\t\tunencodedParams = append(unencodedParams, \"$filter=\"+*options.Filter)\n\t}\n\treq.Raw().URL.RawQuery = strings.Join(unencodedParams, \"&\")\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ClustersClient) listCreateRequest(ctx context.Context, options *ClustersListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func NewListRequest() *todopb.ListRequest {\n\tmessage := &todopb.ListRequest{}\n\treturn message\n}", "func (client *CloudServicesClient) listAllCreateRequest(ctx context.Context, options *CloudServicesClientListAllOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-04\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *SQLResourcesClient) listSQLRoleDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *SQLResourcesClientListSQLRoleDefinitionsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions\"\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 accountName == \"\" {\n\t\treturn nil, errors.New(\"parameter accountName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{accountName}\", url.PathEscape(accountName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-03-15-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesListOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites\"\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\turlPath = strings.ReplaceAll(urlPath, \"{networkVirtualApplianceName}\", url.PathEscape(networkVirtualApplianceName))\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Telemetry(telemetryInfo)\n\tquery := req.URL.Query()\n\tquery.Set(\"api-version\", \"2020-07-01\")\n\treq.URL.RawQuery = query.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsListOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.RecoveryServices/operations\"\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-08-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListRecipePath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"recipe\", \"list\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *WebAppsClient) listWebJobsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListWebJobsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListRecorderPath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"recorder\", \"list\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WorkspacesListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *AlertsClient) listForScopeCreateRequest(ctx context.Context, scope string, options *AlertsClientListForScopeOptions) (*policy.Request, error) {\n\turlPath := \"/{scope}/providers/Microsoft.Authorization/roleManagementAlerts\"\n\turlPath = strings.ReplaceAll(urlPath, \"{scope}\", scope)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MonitorsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) BuildVMListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: VMListSpinRegistryPath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"spin-registry\", \"vm_list\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *ManagedInstancesClient) listCreateRequest(ctx context.Context, options *ManagedInstancesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ReplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *ReplicationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications\"\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *AssociationsClient) listAllCreateRequest(ctx context.Context, scope string, options *AssociationsClientListAllOptions) (*policy.Request, error) {\n\turlPath := \"/{scope}/providers/Microsoft.CustomProviders/associations\"\n\turlPath = strings.ReplaceAll(urlPath, \"{scope}\", scope)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-09-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ApplicationClient) listOperationsCreateRequest(ctx context.Context, options *ApplicationClientListOperationsOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Solutions/operations\"\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, options *RouteTablesListAllOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) NewListRolesRequest(ctx context.Context, path string, resourceType *string) (*http.Request, error) {\n\tscheme := c.Scheme\n\tif scheme == \"\" {\n\t\tscheme = \"http\"\n\t}\n\tu := url.URL{Host: c.Host, Scheme: scheme, Path: path}\n\tvalues := u.Query()\n\tif resourceType != nil {\n\t\tvalues.Set(\"resource_type\", *resourceType)\n\t}\n\tu.RawQuery = values.Encode()\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif c.JWTSigner != nil {\n\t\tc.JWTSigner.Sign(req)\n\t}\n\treturn req, nil\n}", "func (client *FactoriesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *FactoriesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *SQLVirtualMachinesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SQLVirtualMachinesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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\", \"2017-03-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *BuildServiceClient) listSupportedStacksCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientListSupportedStacksOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif buildServiceName == \"\" {\n\t\treturn nil, errors.New(\"parameter buildServiceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{buildServiceName}\", url.PathEscape(buildServiceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func CreateListMcubeNebulaResourcesRequest() (request *ListMcubeNebulaResourcesRequest) {\n\trequest = &ListMcubeNebulaResourcesRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"mPaaS\", \"2020-10-28\", \"ListMcubeNebulaResources\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *GremlinResourcesClient) listGremlinDatabasesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *GremlinResourcesClientListGremlinDatabasesOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases\"\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 accountName == \"\" {\n\t\treturn nil, errors.New(\"parameter accountName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{accountName}\", url.PathEscape(accountName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-10-15\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *DicomServicesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *DicomServicesClientListByWorkspaceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif workspaceName == \"\" {\n\t\treturn nil, errors.New(\"parameter workspaceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{workspaceName}\", url.PathEscape(workspaceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateGetRegionListRequest() (request *GetRegionListRequest) {\n\trequest = &GetRegionListRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"cr\", \"2016-06-07\", \"GetRegionList\", \"/regions\", \"cr\", \"openAPI\")\n\trequest.Method = requests.GET\n\treturn\n}", "func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineScaleSetsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *CustomDomainsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif appName == \"\" {\n\t\treturn nil, errors.New(\"parameter appName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{appName}\", url.PathEscape(appName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-09-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateListAvailableFileSystemTypesRequest() (request *ListAvailableFileSystemTypesRequest) {\n\trequest = &ListAvailableFileSystemTypesRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"EHPC\", \"2018-04-12\", \"ListAvailableFileSystemTypes\", \"ehs\", \"openAPI\")\n\treturn\n}", "func (client *TaskRunsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *TaskRunsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns\"\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 registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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\", \"2019-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ReplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *ReplicationsListOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications\"\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 registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, 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-preview\")\n\treq.URL.RawQuery = reqQP.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *MonitorsClient) listLinkedResourcesCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientListLinkedResourcesOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListBlogPath()}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"blog\", \"list\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func CreateListAlertMessagesRequest() (request *ListAlertMessagesRequest) {\n\trequest = &ListAlertMessagesRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"dataworks-public\", \"2020-05-18\", \"ListAlertMessages\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *RestorableDatabaseAccountsClient) listByLocationCreateRequest(ctx context.Context, location string, options *RestorableDatabaseAccountsListByLocationOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts\"\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 location == \"\" {\n\t\treturn nil, errors.New(\"parameter location cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{location}\", url.PathEscape(location))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, 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-15\")\n\treq.URL.RawQuery = reqQP.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *WebAppsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WebAppsListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.IncludeSlots != nil {\n\t\treqQP.Set(\"includeSlots\", strconv.FormatBool(*options.IncludeSlots))\n\t}\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ConnectedEnvironmentsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ConnectedEnvironmentsClientListBySubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.App/connectedEnvironments\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *VirtualMachinesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-01-10-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *LocalRulestacksClient) listFirewallsCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListFirewallsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listFirewalls\"\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 localRulestackName == \"\" {\n\t\treturn nil, errors.New(\"parameter localRulestackName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{localRulestackName}\", url.PathEscape(localRulestackName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, 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\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, options *VirtualRoutersClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *LocalRulestacksClient) listBySubscriptionCreateRequest(ctx context.Context, options *LocalRulestacksClientListBySubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReservedInstancesListingsInput, error) {\n\tres := &svcsdk.DescribeReservedInstancesListingsInput{}\n\n\tif r.ko.Spec.ReservedInstancesID != nil {\n\t\tres.SetReservedInstancesId(*r.ko.Spec.ReservedInstancesID)\n\t}\n\n\treturn res, nil\n}", "func (client *TablesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *TablesClientListByWorkspaceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables\"\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 workspaceName == \"\" {\n\t\treturn nil, errors.New(\"parameter workspaceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{workspaceName}\", url.PathEscape(workspaceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-08-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func CreateListApplicationLogsRequest() (request *ListApplicationLogsRequest) {\n\trequest = &ListApplicationLogsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"companyreg\", \"2019-05-08\", \"ListApplicationLogs\", \"companyreg\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Context, options *WorkspacesListBySubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Databricks/workspaces\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) ListBuiltInIntents(ctx context.Context, params *ListBuiltInIntentsInput, optFns ...func(*Options)) (*ListBuiltInIntentsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListBuiltInIntentsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListBuiltInIntents\", params, optFns, c.addOperationListBuiltInIntentsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListBuiltInIntentsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "func (client *VirtualMachineScaleSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachineScaleSetsListByLocationOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets\"\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"parameter location cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{location}\", url.PathEscape(location))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *MonitorsClient) listMonitoredResourcesCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientListMonitoredResourcesOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *AlertProcessingRulesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AlertProcessingRulesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-08-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {\n\tu := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListLogPath()}\n\treq, err := http.NewRequest(\"POST\", u.String(), nil)\n\tif err != nil {\n\t\treturn nil, goahttp.ErrInvalidURL(\"log\", \"list\", u.String(), err)\n\t}\n\tif ctx != nil {\n\t\treq = req.WithContext(ctx)\n\t}\n\n\treturn req, nil\n}", "func (client *RestorableDatabaseAccountsClient) listCreateRequest(ctx context.Context, options *RestorableDatabaseAccountsListOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, 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-15\")\n\treq.URL.RawQuery = reqQP.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ActivityLogsClient) listCreateRequest(ctx context.Context, filter string, options *ActivityLogsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2015-04-01\")\n\treqQP.Set(\"$filter\", filter)\n\tif options != nil && options.Select != nil {\n\t\treqQP.Set(\"$select\", *options.Select)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func CreateGetNamespaceListRequest() (request *GetNamespaceListRequest) {\n\trequest = &GetNamespaceListRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"cr\", \"2016-06-07\", \"GetNamespaceList\", \"/namespace\", \"cr\", \"openAPI\")\n\trequest.Method = requests.GET\n\treturn\n}", "func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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-04\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ApplicationTypeVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypeVersionsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions\"\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\tif applicationTypeName == \"\" {\n\t\treturn nil, errors.New(\"parameter applicationTypeName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{applicationTypeName}\", url.PathEscape(applicationTypeName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *DevicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DevicesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *TagRulesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-27\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *WebAppsClient) listNetworkFeaturesCreateRequest(ctx context.Context, resourceGroupName string, name string, view string, options *WebAppsListNetworkFeaturesOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif view == \"\" {\n\t\treturn nil, errors.New(\"parameter view cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{view}\", url.PathEscape(view))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *CompliancesClient) listCreateRequest(ctx context.Context, scope string, options *CompliancesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/{scope}/providers/Microsoft.Security/compliances\"\n\turlPath = strings.ReplaceAll(urlPath, \"{scope}\", scope)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2017-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *WebAppsClient) listFunctionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListFunctionsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *BuildServiceClient) listBuildResultsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *BuildServiceClientListBuildResultsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif buildServiceName == \"\" {\n\t\treturn nil, errors.New(\"parameter buildServiceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{buildServiceName}\", url.PathEscape(buildServiceName))\n\tif buildName == \"\" {\n\t\treturn nil, errors.New(\"parameter buildName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{buildName}\", url.PathEscape(buildName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *MetricAlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MetricAlertsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ApplyUpdatesClient) listCreateRequest(ctx context.Context, options *ApplyUpdatesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/applyUpdates\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *LiveOutputsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveOutputsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs\"\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 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 liveEventName == \"\" {\n\t\treturn nil, errors.New(\"parameter liveEventName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{liveEventName}\", url.PathEscape(liveEventName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ServersClient) listCreateRequest(ctx context.Context, options *ServersClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) {\n\trequest = &ListServerGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Alb\", \"2020-06-16\", \"ListServerGroups\", \"alb\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}" ]
[ "0.60232586", "0.5982126", "0.5869841", "0.5857119", "0.5838637", "0.5705415", "0.56493896", "0.56372064", "0.5619246", "0.5618151", "0.56148225", "0.56142336", "0.5599064", "0.55896854", "0.5574594", "0.55553883", "0.55527395", "0.5521917", "0.5519978", "0.5480475", "0.547694", "0.54728234", "0.5456693", "0.5449977", "0.542701", "0.542654", "0.5426327", "0.54206973", "0.5406934", "0.54034716", "0.5399393", "0.5385655", "0.53846866", "0.536695", "0.53659964", "0.5347355", "0.5346649", "0.5342399", "0.5341838", "0.53331274", "0.5316923", "0.53146154", "0.53143156", "0.5313506", "0.5310865", "0.5304088", "0.5298454", "0.5296025", "0.5289526", "0.5285597", "0.5282052", "0.5281836", "0.52784795", "0.52771777", "0.52771527", "0.5270854", "0.5268224", "0.52659416", "0.52594286", "0.5250464", "0.52498704", "0.5246777", "0.5245892", "0.5242977", "0.5207698", "0.5206456", "0.5200932", "0.51877636", "0.5186897", "0.51800054", "0.5179383", "0.51679116", "0.5164312", "0.5163834", "0.5162378", "0.51564443", "0.51450634", "0.5143636", "0.514067", "0.51404834", "0.5131331", "0.51296234", "0.51206964", "0.5111664", "0.5108215", "0.5094949", "0.5092192", "0.50891334", "0.5086448", "0.508325", "0.5079826", "0.50781304", "0.50716966", "0.5071199", "0.5061336", "0.5060229", "0.5058643", "0.5053994", "0.50525653", "0.5050618" ]
0.7813031
0
listBuiltInHandleResponse handles the ListBuiltIn response.
listBuiltInHandleResponse обрабатывает ответ ListBuiltIn.
func (client *PolicyDefinitionsClient) listBuiltInHandleResponse(resp *http.Response) (PolicyDefinitionsListBuiltInResponse, error) { result := PolicyDefinitionsListBuiltInResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.PolicyDefinitionListResult); err != nil { return PolicyDefinitionsListBuiltInResponse{}, runtime.NewResponseError(err, resp) } return result, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *PolicyDefinitionsClient) getBuiltInHandleResponse(resp *http.Response) (PolicyDefinitionsGetBuiltInResponse, error) {\n\tresult := PolicyDefinitionsGetBuiltInResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PolicyDefinition); err != nil {\n\t\treturn PolicyDefinitionsGetBuiltInResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listHandleResponse(resp *http.Response) (WebAppsListResponse, error) {\n\tresult := WebAppsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil {\n\t\treturn WebAppsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ReplicationsClient) listHandleResponse(resp *azcore.Response) (ReplicationListResultResponse, error) {\n\tvar val *ReplicationListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn ReplicationListResultResponse{}, err\n\t}\n\treturn ReplicationListResultResponse{RawResponse: resp.Response, ReplicationListResult: val}, nil\n}", "func (client *LiveOutputsClient) listHandleResponse(resp *http.Response) (LiveOutputsClientListResponse, error) {\n\tresult := LiveOutputsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.LiveOutputListResult); err != nil {\n\t\treturn LiveOutputsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsListResponse, error) {\n\tresult := VirtualMachineScaleSetVMRunCommandsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil {\n\t\treturn VirtualMachineScaleSetVMRunCommandsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *RoleDefinitionsClient) listHandleResponse(resp *http.Response) (RoleDefinitionsListResponse, error) {\n\tresult := RoleDefinitionsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinitionListResult); err != nil {\n\t\treturn RoleDefinitionsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualApplianceSKUsClient) listHandleResponse(resp *azcore.Response) (NetworkVirtualApplianceSKUListResultResponse, error) {\n\tvar val *NetworkVirtualApplianceSKUListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn NetworkVirtualApplianceSKUListResultResponse{}, err\n\t}\n\treturn NetworkVirtualApplianceSKUListResultResponse{RawResponse: resp.Response, NetworkVirtualApplianceSKUListResult: val}, nil\n}", "func (client *RegistrationDefinitionsClient) listHandleResponse(resp *http.Response) (RegistrationDefinitionsClientListResponse, error) {\n\tresult := RegistrationDefinitionsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RegistrationDefinitionList); err != nil {\n\t\treturn RegistrationDefinitionsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (AvailabilitySetsListResponse, error) {\n\tresult := AvailabilitySetsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil {\n\t\treturn AvailabilitySetsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualApplianceSitesClient) listHandleResponse(resp *azcore.Response) (NetworkVirtualApplianceSiteListResultResponse, error) {\n\tvar val *NetworkVirtualApplianceSiteListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn NetworkVirtualApplianceSiteListResultResponse{}, err\n\t}\n\treturn NetworkVirtualApplianceSiteListResultResponse{RawResponse: resp.Response, NetworkVirtualApplianceSiteListResult: val}, nil\n}", "func (client *AnalysisResultsClient) listHandleResponse(resp *http.Response) (AnalysisResultsClientListResponse, error) {\n\tresult := AnalysisResultsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AnalysisResultListResult); err != nil {\n\t\treturn AnalysisResultsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SQLVirtualMachinesClient) listHandleResponse(resp *http.Response) (SQLVirtualMachinesClientListResponse, error) {\n\tresult := SQLVirtualMachinesClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListResult); err != nil {\n\t\treturn SQLVirtualMachinesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsClientListResponse, error) {\n\tresult := MonitorsClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.MonitorResourceListResponse); err != nil {\n\t\treturn MonitorsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ApplicationTypeVersionsClient) listHandleResponse(resp *http.Response) (ApplicationTypeVersionsClientListResponse, error) {\n\tresult := ApplicationTypeVersionsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ApplicationTypeVersionResourceList); err != nil {\n\t\treturn ApplicationTypeVersionsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *KustoOperationsClient) listHandleResponse(resp *http.Response) (KustoOperationsClientListResponse, error) {\n\tresult := KustoOperationsClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {\n\t\treturn KustoOperationsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *PolicyDefinitionsClient) listHandleResponse(resp *http.Response) (PolicyDefinitionsListResponse, error) {\n\tresult := PolicyDefinitionsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PolicyDefinitionListResult); err != nil {\n\t\treturn PolicyDefinitionsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *WebhooksClient) listHandleResponse(resp *http.Response) (WebhooksClientListResponse, error) {\n\tresult := WebhooksClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WebhookListResult); err != nil {\n\t\treturn WebhooksClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RecordSetsClient) listHandleResponse(resp *azcore.Response) (RecordSetListResultResponse, error) {\n\tvar val *RecordSetListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn RecordSetListResultResponse{}, err\n\t}\n\treturn RecordSetListResultResponse{RawResponse: resp.Response, RecordSetListResult: val}, nil\n}", "func (client *ChildAvailabilityStatusesClient) listHandleResponse(resp *http.Response) (ChildAvailabilityStatusesClientListResponse, error) {\n\tresult := ChildAvailabilityStatusesClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatusListResult); err != nil {\n\t\treturn ChildAvailabilityStatusesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ReplicationsClient) listHandleResponse(resp *http.Response) (ReplicationsClientListResponse, error) {\n\tresult := ReplicationsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ReplicationListResult); err != nil {\n\t\treturn ReplicationsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *LocalRulestacksClient) listAppIDsHandleResponse(resp *http.Response) (LocalRulestacksClientListAppIDsResponse, error) {\n\tresult := LocalRulestacksClientListAppIDsResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListAppIDResponse); err != nil {\n\t\treturn LocalRulestacksClientListAppIDsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *MachineExtensionsClient) listHandleResponse(resp *http.Response) (MachineExtensionsClientListResponse, error) {\n\tresult := MachineExtensionsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.MachineExtensionsListResult); err != nil {\n\t\treturn MachineExtensionsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *CustomDomainsClient) listHandleResponse(resp *http.Response) (CustomDomainsListResponse, error) {\n\tresult := CustomDomainsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.CustomDomainResourceCollection); err != nil {\n\t\treturn CustomDomainsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *BuildServiceClient) listBuildsHandleResponse(resp *http.Response) (BuildServiceClientListBuildsResponse, error) {\n\tresult := BuildServiceClientListBuildsResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.BuildCollection); err != nil {\n\t\treturn BuildServiceClientListBuildsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SapMonitorsClient) listHandleResponse(resp *http.Response) (SapMonitorsClientListResponse, error) {\n\tresult := SapMonitorsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SapMonitorListResult); err != nil {\n\t\treturn SapMonitorsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetsListResponse, error) {\n\tresult := VirtualMachineScaleSetsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil {\n\t\treturn VirtualMachineScaleSetsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAllocationsClientListResponse, error) {\n\tresult := IPAllocationsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil {\n\t\treturn IPAllocationsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (VirtualMachinesClientListResponse, error) {\n\tresult := VirtualMachinesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachinesList); err != nil {\n\t\treturn VirtualMachinesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listWebJobsHandleResponse(resp *http.Response) (WebAppsListWebJobsResponse, error) {\n\tresult := WebAppsListWebJobsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WebJobCollection); err != nil {\n\t\treturn WebAppsListWebJobsResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (ManagedClustersClientListResponse, error) {\n\tresult := ManagedClustersClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterListResult); err != nil {\n\t\treturn ManagedClustersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedInstancesClient) listHandleResponse(resp *http.Response) (ManagedInstancesClientListResponse, error) {\n\tresult := ManagedInstancesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceListResult); err != nil {\n\t\treturn ManagedInstancesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *BuildServiceClient) listSupportedBuildpacksHandleResponse(resp *http.Response) (BuildServiceClientListSupportedBuildpacksResponse, error) {\n\tresult := BuildServiceClientListSupportedBuildpacksResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SupportedBuildpacksCollection); err != nil {\n\t\treturn BuildServiceClientListSupportedBuildpacksResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualNetworkLinksClient) listHandleResponse(resp *http.Response) (VirtualNetworkLinksListResponse, error) {\n\tresult := VirtualNetworkLinksListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkLinkListResult); err != nil {\n\t\treturn VirtualNetworkLinksListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listByResourceGroupHandleResponse(resp *http.Response) (WebAppsListByResourceGroupResponse, error) {\n\tresult := WebAppsListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil {\n\t\treturn WebAppsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineScaleSetsClient) listAllHandleResponse(resp *http.Response) (VirtualMachineScaleSetsListAllResponse, error) {\n\tresult := VirtualMachineScaleSetsListAllResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListWithLinkResult); err != nil {\n\t\treturn VirtualMachineScaleSetsListAllResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *SQLResourcesClient) listSQLUserDefinedFunctionsHandleResponse(resp *http.Response) (SQLResourcesClientListSQLUserDefinedFunctionsResponse, error) {\n\tresult := SQLResourcesClientListSQLUserDefinedFunctionsResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SQLUserDefinedFunctionListResult); err != nil {\n\t\treturn SQLResourcesClientListSQLUserDefinedFunctionsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listProcessesHandleResponse(resp *http.Response) (WebAppsListProcessesResponse, error) {\n\tresult := WebAppsListProcessesResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfoCollection); err != nil {\n\t\treturn WebAppsListProcessesResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ExpressRoutePortsLocationsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortsLocationsClientListResponse, error) {\n\tresult := ExpressRoutePortsLocationsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortsLocationListResult); err != nil {\n\t\treturn ExpressRoutePortsLocationsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *TaskRunsClient) listHandleResponse(resp *http.Response) (TaskRunsClientListResponse, error) {\n\tresult := TaskRunsClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.TaskRunListResult); err != nil {\n\t\treturn TaskRunsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *AgentsClient) listHandleResponse(resp *http.Response) (AgentsClientListResponse, error) {\n\tresult := AgentsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AgentList); err != nil {\n\t\treturn AgentsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsListResponse, error) {\n\tresult := OperationsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClientDiscoveryResponse); err != nil {\n\t\treturn OperationsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *OutputsClient) listByStreamingJobHandleResponse(resp *http.Response) (OutputsClientListByStreamingJobResponse, error) {\n\tresult := OutputsClientListByStreamingJobResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.OutputListResult); err != nil {\n\t\treturn OutputsClientListByStreamingJobResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *FirewallRulesClient) listHandleResponse(resp *http.Response) (FirewallRulesClientListResponse, error) {\n\tresult := FirewallRulesClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.FirewallRuleListResult); err != nil {\n\t\treturn FirewallRulesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ReplicationProtectionContainersClient) listHandleResponse(resp *http.Response) (ReplicationProtectionContainersClientListResponse, error) {\n\tresult := ReplicationProtectionContainersClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ProtectionContainerCollection); err != nil {\n\t\treturn ReplicationProtectionContainersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersClientListResponse, error) {\n\tresult := ServersClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ServerListResult); err != nil {\n\t\treturn ServersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ScriptExecutionsClient) listHandleResponse(resp *http.Response) (ScriptExecutionsClientListResponse, error) {\n\tresult := ScriptExecutionsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ScriptExecutionsList); err != nil {\n\t\treturn ScriptExecutionsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *OutputsClient) listByStreamingJobHandleResponse(resp *http.Response) (OutputsListByStreamingJobResponse, error) {\n\tresult := OutputsListByStreamingJobResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.OutputListResult); err != nil {\n\t\treturn OutputsListByStreamingJobResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VendorNetworkFunctionsClient) listHandleResponse(resp *http.Response) (VendorNetworkFunctionsClientListResponse, error) {\n\tresult := VendorNetworkFunctionsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VendorNetworkFunctionListResult); err != nil {\n\t\treturn VendorNetworkFunctionsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersClientListResponse, error) {\n\tresult := ClustersClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil {\n\t\treturn ClustersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *CloudServiceRoleInstancesClient) listHandleResponse(resp *azcore.Response) (RoleInstanceListResultResponse, error) {\n\tvar val *RoleInstanceListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn RoleInstanceListResultResponse{}, err\n\t}\n\treturn RoleInstanceListResultResponse{RawResponse: resp.Response, RoleInstanceListResult: val}, nil\n}", "func (client *ApplicationClient) listOperationsHandleResponse(resp *http.Response) (ApplicationClientListOperationsResponse, error) {\n\tresult := ApplicationClientListOperationsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {\n\t\treturn ApplicationClientListOperationsResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersListResponse, error) {\n\tresult := ClustersListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil {\n\t\treturn ClustersListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *SubscriptionClient) listHandleResponse(resp *http.Response) (SubscriptionClientListResponse, error) {\n\tresult := SubscriptionClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SubscriptionCollection); err != nil {\n\t\treturn SubscriptionClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ContainerGroupsClient) listHandleResponse(resp *http.Response) (ContainerGroupsClientListResponse, error) {\n\tresult := ContainerGroupsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ContainerGroupListResult); err != nil {\n\t\treturn ContainerGroupsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *Client) listHandleResponse(resp *http.Response) (ClientListResponse, error) {\n\tresult := ClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ChangeResourceListResult); err != nil {\n\t\treturn ClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *FactoriesClient) listHandleResponse(resp *http.Response) (FactoriesClientListResponse, error) {\n\tresult := FactoriesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.FactoryListResponse); err != nil {\n\t\treturn FactoriesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ReplicationvCentersClient) listHandleResponse(resp *http.Response) (ReplicationvCentersClientListResponse, error) {\n\tresult := ReplicationvCentersClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VCenterCollection); err != nil {\n\t\treturn ReplicationvCentersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteTablesListResponse, error) {\n\tresult := RouteTablesListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RouteTableListResult); err != nil {\n\t\treturn RouteTablesListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listTriggeredWebJobsHandleResponse(resp *http.Response) (WebAppsListTriggeredWebJobsResponse, error) {\n\tresult := WebAppsListTriggeredWebJobsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.TriggeredWebJobCollection); err != nil {\n\t\treturn WebAppsListTriggeredWebJobsResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (VirtualRoutersClientListResponse, error) {\n\tresult := VirtualRoutersClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterListResult); err != nil {\n\t\treturn VirtualRoutersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *CustomAssessmentAutomationsClient) listByResourceGroupHandleResponse(resp *http.Response) (CustomAssessmentAutomationsListByResourceGroupResponse, error) {\n\tresult := CustomAssessmentAutomationsListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.CustomAssessmentAutomationsListResult); err != nil {\n\t\treturn CustomAssessmentAutomationsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineImageTemplatesClient) listRunOutputsHandleResponse(resp *http.Response) (VirtualMachineImageTemplatesClientListRunOutputsResponse, error) {\n\tresult := VirtualMachineImageTemplatesClientListRunOutputsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RunOutputCollection); err != nil {\n\t\treturn VirtualMachineImageTemplatesClientListRunOutputsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listFunctionsHandleResponse(resp *http.Response) (WebAppsListFunctionsResponse, error) {\n\tresult := WebAppsListFunctionsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.FunctionEnvelopeCollection); err != nil {\n\t\treturn WebAppsListFunctionsResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *BuildServiceClient) listSupportedStacksHandleResponse(resp *http.Response) (BuildServiceClientListSupportedStacksResponse, error) {\n\tresult := BuildServiceClientListSupportedStacksResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SupportedStacksCollection); err != nil {\n\t\treturn BuildServiceClientListSupportedStacksResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ApplyUpdatesClient) listHandleResponse(resp *http.Response) (ApplyUpdatesClientListResponse, error) {\n\tresult := ApplyUpdatesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListApplyUpdate); err != nil {\n\t\treturn ApplyUpdatesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *JobExecutionsClient) listByAgentHandleResponse(resp *http.Response) (JobExecutionsClientListByAgentResponse, error) {\n\tresult := JobExecutionsClientListByAgentResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.JobExecutionListResult); err != nil {\n\t\treturn JobExecutionsClientListByAgentResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SQLVirtualMachinesClient) listByResourceGroupHandleResponse(resp *http.Response) (SQLVirtualMachinesClientListByResourceGroupResponse, error) {\n\tresult := SQLVirtualMachinesClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListResult); err != nil {\n\t\treturn SQLVirtualMachinesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listProcessModulesHandleResponse(resp *http.Response) (WebAppsListProcessModulesResponse, error) {\n\tresult := WebAppsListProcessModulesResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfoCollection); err != nil {\n\t\treturn WebAppsListProcessModulesResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *TagRulesClient) listHandleResponse(resp *http.Response) (TagRulesClientListResponse, error) {\n\tresult := TagRulesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.TagRuleListResult); err != nil {\n\t\treturn TagRulesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RouteTablesClient) listAllHandleResponse(resp *http.Response) (RouteTablesListAllResponse, error) {\n\tresult := RouteTablesListAllResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RouteTableListResult); err != nil {\n\t\treturn RouteTablesListAllResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Response) (MonitorsClientListByResourceGroupResponse, error) {\n\tresult := MonitorsClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.MonitorResourceListResponse); err != nil {\n\t\treturn MonitorsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Response) (ServersClientListByResourceGroupResponse, error) {\n\tresult := ServersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ServerListResult); err != nil {\n\t\treturn ServersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ActivityLogsClient) listHandleResponse(resp *http.Response) (ActivityLogsClientListResponse, error) {\n\tresult := ActivityLogsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.EventDataCollection); err != nil {\n\t\treturn ActivityLogsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineImagesEdgeZoneClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListResponse, error) {\n\tresult := VirtualMachineImagesEdgeZoneClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {\n\t\treturn VirtualMachineImagesEdgeZoneClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SQLResourcesClient) listSQLRoleDefinitionsHandleResponse(resp *http.Response) (SQLResourcesClientListSQLRoleDefinitionsResponse, error) {\n\tresult := SQLResourcesClientListSQLRoleDefinitionsResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SQLRoleDefinitionListResult); err != nil {\n\t\treturn SQLResourcesClientListSQLRoleDefinitionsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RecordSetsClient) listByTypeHandleResponse(resp *azcore.Response) (RecordSetListResultResponse, error) {\n\tvar val *RecordSetListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn RecordSetListResultResponse{}, err\n\t}\n\treturn RecordSetListResultResponse{RawResponse: resp.Response, RecordSetListResult: val}, nil\n}", "func (client *CompliancesClient) listHandleResponse(resp *http.Response) (CompliancesClientListResponse, error) {\n\tresult := CompliancesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ComplianceList); err != nil {\n\t\treturn CompliancesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RecommendationsClient) listHandleResponse(resp *http.Response) (RecommendationsListResponse, error) {\n\tresult := RecommendationsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil {\n\t\treturn RecommendationsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineImageTemplatesClient) listHandleResponse(resp *http.Response) (VirtualMachineImageTemplatesClientListResponse, error) {\n\tresult := VirtualMachineImageTemplatesClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ImageTemplateListResult); err != nil {\n\t\treturn VirtualMachineImageTemplatesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Response) (DevicesClientListByResourceGroupResponse, error) {\n\tresult := DevicesClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DeviceListResult); err != nil {\n\t\treturn DevicesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *DefenderSettingsClient) listHandleResponse(resp *http.Response) (DefenderSettingsClientListResponse, error) {\n\tresult := DefenderSettingsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DefenderSettingsList); err != nil {\n\t\treturn DefenderSettingsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RedisClient) listByResourceGroupHandleResponse(resp *http.Response) (RedisListByResourceGroupResponse, error) {\n\tresult := RedisListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RedisListResult); err != nil {\n\t\treturn RedisListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listWebJobsSlotHandleResponse(resp *http.Response) (WebAppsListWebJobsSlotResponse, error) {\n\tresult := WebAppsListWebJobsSlotResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WebJobCollection); err != nil {\n\t\treturn WebAppsListWebJobsSlotResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listMetadataHandleResponse(resp *http.Response) (WebAppsListMetadataResponse, error) {\n\tresult := WebAppsListMetadataResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil {\n\t\treturn WebAppsListMetadataResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *CloudServicesClient) listHandleResponse(resp *http.Response) (CloudServicesClientListResponse, error) {\n\tresult := CloudServicesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil {\n\t\treturn CloudServicesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClustersClientListByResourceGroupResponse, error) {\n\tresult := ManagedClustersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterListResult); err != nil {\n\t\treturn ManagedClustersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *azcore.Response) (VirtualNetworkTapListResultResponse, error) {\n\tvar val *VirtualNetworkTapListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn VirtualNetworkTapListResultResponse{}, err\n\t}\n\treturn VirtualNetworkTapListResultResponse{RawResponse: resp.Response, VirtualNetworkTapListResult: val}, nil\n}", "func (client *BuildServiceClient) listBuildResultsHandleResponse(resp *http.Response) (BuildServiceClientListBuildResultsResponse, error) {\n\tresult := BuildServiceClientListBuildResultsResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.BuildResultCollection); err != nil {\n\t\treturn BuildServiceClientListBuildResultsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ClustersClientListByResourceGroupResponse, error) {\n\tresult := ClustersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil {\n\t\treturn ClustersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Response) (WorkspacesListByResourceGroupResponse, error) {\n\tresult := WorkspacesListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceListResult); err != nil {\n\t\treturn WorkspacesListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *TablesClient) listByWorkspaceHandleResponse(resp *http.Response) (TablesClientListByWorkspaceResponse, error) {\n\tresult := TablesClientListByWorkspaceResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.TablesListResult); err != nil {\n\t\treturn TablesClientListByWorkspaceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *FactoriesClient) listByResourceGroupHandleResponse(resp *http.Response) (FactoriesClientListByResourceGroupResponse, error) {\n\tresult := FactoriesClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.FactoryListResponse); err != nil {\n\t\treturn FactoriesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ClustersListByResourceGroupResponse, error) {\n\tresult := ClustersListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil {\n\t\treturn ClustersListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsClientListResponse, error) {\n\tresult := AccountsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil {\n\t\treturn AccountsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedInstancesClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedInstancesClientListByResourceGroupResponse, error) {\n\tresult := ManagedInstancesClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceListResult); err != nil {\n\t\treturn ManagedInstancesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *PolicyDefinitionsClient) listByManagementGroupHandleResponse(resp *http.Response) (PolicyDefinitionsListByManagementGroupResponse, error) {\n\tresult := PolicyDefinitionsListByManagementGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PolicyDefinitionListResult); err != nil {\n\t\treturn PolicyDefinitionsListByManagementGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *RecommendationsClient) listHandleResponse(resp *http.Response) (RecommendationsClientListResponse, error) {\n\tresult := RecommendationsClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil {\n\t\treturn RecommendationsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *BuildServiceClient) listBuildServicesHandleResponse(resp *http.Response) (BuildServiceClientListBuildServicesResponse, error) {\n\tresult := BuildServiceClientListBuildServicesResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.BuildServiceCollection); err != nil {\n\t\treturn BuildServiceClientListBuildServicesResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *FileServicesClient) listHandleResponse(resp *azcore.Response) (FileServiceItemsResponse, error) {\n\tvar val *FileServiceItems\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn FileServiceItemsResponse{}, err\n\t}\n\treturn FileServiceItemsResponse{RawResponse: resp.Response, FileServiceItems: val}, nil\n}", "func (client *IPAllocationsClient) listByResourceGroupHandleResponse(resp *http.Response) (IPAllocationsClientListByResourceGroupResponse, error) {\n\tresult := IPAllocationsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil {\n\t\treturn IPAllocationsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}" ]
[ "0.7082903", "0.65406626", "0.6517782", "0.6450229", "0.6407186", "0.6368368", "0.6320369", "0.626896", "0.62285346", "0.6223435", "0.6213455", "0.62095153", "0.61994046", "0.617806", "0.6167983", "0.6167837", "0.6165637", "0.6164217", "0.6158206", "0.61385083", "0.6090056", "0.6078462", "0.6072821", "0.60237056", "0.6017464", "0.6001595", "0.5975038", "0.5960289", "0.59422505", "0.59361863", "0.592639", "0.592028", "0.5916019", "0.59119767", "0.5893246", "0.5877771", "0.5869159", "0.5868357", "0.5867682", "0.58650106", "0.58632493", "0.58578235", "0.5857489", "0.5828229", "0.58272356", "0.5816861", "0.58163357", "0.5815506", "0.5812888", "0.5812069", "0.58032197", "0.58030283", "0.57948226", "0.5785845", "0.577627", "0.57685775", "0.5765737", "0.57613456", "0.57539445", "0.574249", "0.573961", "0.57341635", "0.5728227", "0.5726798", "0.57266325", "0.57235986", "0.57187265", "0.57162124", "0.56988835", "0.56934255", "0.5691408", "0.56862575", "0.568147", "0.5678593", "0.5673003", "0.5664103", "0.5662639", "0.56430733", "0.5640552", "0.563833", "0.5637361", "0.5636317", "0.56338286", "0.5631075", "0.56310207", "0.5628609", "0.56202894", "0.56132126", "0.56074286", "0.5604131", "0.5598924", "0.5598117", "0.5591202", "0.5587291", "0.5585898", "0.5584386", "0.5574499", "0.5572008", "0.55681145", "0.5563129" ]
0.85405135
0
listByManagementGroupCreateRequest creates the ListByManagementGroup request.
listByManagementGroupCreateRequest создает запрос ListByManagementGroup.
func (client *PolicyDefinitionsClient) listByManagementGroupCreateRequest(ctx context.Context, managementGroupID string, options *PolicyDefinitionsListByManagementGroupOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions" if managementGroupID == "" { return nil, errors.New("parameter managementGroupID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-06-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() unencodedParams := []string{req.Raw().URL.RawQuery} if options != nil && options.Filter != nil { unencodedParams = append(unencodedParams, "$filter="+*options.Filter) } req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") req.Raw().Header.Set("Accept", "application/json") return req, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MonitorsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ManagedInstancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedInstancesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ContainerGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerGroupsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *DevicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DevicesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *AvailabilityGroupListenersClient) listByGroupCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *AvailabilityGroupListenersClientListByGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners\"\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 sqlVirtualMachineGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter sqlVirtualMachineGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{sqlVirtualMachineGroupName}\", url.PathEscape(sqlVirtualMachineGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *DiskEncryptionSetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskEncryptionSetsListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *CustomAssessmentAutomationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CustomAssessmentAutomationsListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *VirtualMachinesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-01-10-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *PolicyDefinitionsClient) getAtManagementGroupCreateRequest(ctx context.Context, policyDefinitionName string, managementGroupID string, options *PolicyDefinitionsGetAtManagementGroupOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}\"\n\tif policyDefinitionName == \"\" {\n\t\treturn nil, errors.New(\"parameter policyDefinitionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{policyDefinitionName}\", url.PathEscape(policyDefinitionName))\n\tif managementGroupID == \"\" {\n\t\treturn nil, errors.New(\"parameter managementGroupID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managementGroupId}\", url.PathEscape(managementGroupID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *SQLVirtualMachinesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SQLVirtualMachinesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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\", \"2017-03-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ServersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *MetricAlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MetricAlertsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "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}", "func (client *HardwareComponentGroupsClient) listByDeviceCreateRequest(ctx context.Context, deviceName string, resourceGroupName string, managerName string, options *HardwareComponentGroupsClientListByDeviceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups\"\n\turlPath = strings.ReplaceAll(urlPath, \"{deviceName}\", deviceName)\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", client.subscriptionID)\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", resourceGroupName)\n\turlPath = strings.ReplaceAll(urlPath, \"{managerName}\", managerName)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2017-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client UsageDetailsClient) ListByManagementGroup(ctx context.Context, managementGroupID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultPage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/UsageDetailsClient.ListByManagementGroup\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.udlr.Response.Response != nil {\n\t\t\t\tsc = result.udlr.Response.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: top,\n\t\t\tConstraints: []validation.Constraint{{Target: \"top\", Name: validation.Null, Rule: false,\n\t\t\t\tChain: []validation.Constraint{{Target: \"top\", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil},\n\t\t\t\t\t{Target: \"top\", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},\n\t\t\t\t}}}}}); err != nil {\n\t\treturn result, validation.NewError(\"consumption.UsageDetailsClient\", \"ListByManagementGroup\", err.Error())\n\t}\n\n\tresult.fn = client.listByManagementGroupNextResults\n\treq, err := client.ListByManagementGroupPreparer(ctx, managementGroupID, expand, filter, skiptoken, top, apply)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListByManagementGroup\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListByManagementGroupSender(req)\n\tif err != nil {\n\t\tresult.udlr.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListByManagementGroup\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.udlr, err = client.ListByManagementGroupResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListByManagementGroup\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ConnectedEnvironmentsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostsListByHostGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts\"\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 hostGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter hostGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{hostGroupName}\", url.PathEscape(hostGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *RedisClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *RedisListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-12-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WorkspacesListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *SyncGroupsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *SyncGroupsClientListByDatabaseOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups\"\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\tif databaseName == \"\" {\n\t\treturn nil, errors.New(\"parameter databaseName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{databaseName}\", url.PathEscape(databaseName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client UsageDetailsClient) ListByManagementGroupPreparer(ctx context.Context, managementGroupID string, expand string, filter string, skiptoken string, top *int32, apply string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"managementGroupId\": autorest.Encode(\"path\", managementGroupID),\n\t}\n\n\tconst APIVersion = \"2018-06-30\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\tif len(expand) > 0 {\n\t\tqueryParameters[\"$expand\"] = autorest.Encode(\"query\", expand)\n\t}\n\tif len(filter) > 0 {\n\t\tqueryParameters[\"$filter\"] = autorest.Encode(\"query\", filter)\n\t}\n\tif len(skiptoken) > 0 {\n\t\tqueryParameters[\"$skiptoken\"] = autorest.Encode(\"query\", skiptoken)\n\t}\n\tif top != nil {\n\t\tqueryParameters[\"$top\"] = autorest.Encode(\"query\", *top)\n\t}\n\tif len(apply) > 0 {\n\t\tqueryParameters[\"$apply\"] = autorest.Encode(\"query\", apply)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/usageDetails\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (client *AlertProcessingRulesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AlertProcessingRulesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-08-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *CapacitiesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CapacitiesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-01-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CassandraClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-03-15-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkTapsListByResourceGroupOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps\"\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Telemetry(telemetryInfo)\n\tquery := req.URL.Query()\n\tquery.Set(\"api-version\", \"2020-07-01\")\n\treq.URL.RawQuery = query.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroup string, options *ServersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.FluidRelay/fluidRelayServers\"\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 resourceGroup == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroup cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroup}\", url.PathEscape(resourceGroup))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *SQLVirtualMachinesClient) listBySQLVMGroupCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *SQLVirtualMachinesClientListBySQLVMGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/sqlVirtualMachines\"\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 sqlVirtualMachineGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter sqlVirtualMachineGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{sqlVirtualMachineGroupName}\", url.PathEscape(sqlVirtualMachineGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2017-03-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateListExperimentGroupsRequest() (request *ListExperimentGroupsRequest) {\n\trequest = &ListExperimentGroupsRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"PaiRecService\", \"2022-12-13\", \"ListExperimentGroups\", \"/api/v1/experimentgroups\", \"\", \"\")\n\trequest.Method = requests.GET\n\treturn\n}", "func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostsListByHostGroupOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts\"\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\turlPath = strings.ReplaceAll(urlPath, \"{hostGroupName}\", url.PathEscape(hostGroupName))\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Telemetry(telemetryInfo)\n\tquery := req.URL.Query()\n\tquery.Set(\"api-version\", \"2020-06-01\")\n\treq.URL.RawQuery = query.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *DataCollectionEndpointsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DataCollectionEndpointsListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *IotSecuritySolutionClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IotSecuritySolutionClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2019-08-01\")\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *GroupClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *GroupListByServiceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups\"\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 serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"$top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\tif options != nil && options.Skip != nil {\n\t\treqQP.Set(\"$skip\", strconv.FormatInt(int64(*options.Skip), 10))\n\t}\n\treqQP.Set(\"api-version\", \"2021-08-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *DataCollectionEndpointsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DataCollectionEndpointsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *CertificateOrdersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CertificateOrdersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-09-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ContainerGroupsClient) listCreateRequest(ctx context.Context, options *ContainerGroupsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AccountsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *FactoriesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *FactoriesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *VirtualMachineImageTemplatesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineImageTemplatesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-10-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *WebAppsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WebAppsListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.IncludeSlots != nil {\n\t\treqQP.Set(\"includeSlots\", strconv.FormatBool(*options.IncludeSlots))\n\t}\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *PolicyDefinitionsClient) createOrUpdateAtManagementGroupCreateRequest(ctx context.Context, policyDefinitionName string, managementGroupID string, parameters PolicyDefinition, options *PolicyDefinitionsCreateOrUpdateAtManagementGroupOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}\"\n\tif policyDefinitionName == \"\" {\n\t\treturn nil, errors.New(\"parameter policyDefinitionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{policyDefinitionName}\", url.PathEscape(policyDefinitionName))\n\tif managementGroupID == \"\" {\n\t\treturn nil, errors.New(\"parameter managementGroupID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managementGroupId}\", url.PathEscape(managementGroupID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, parameters)\n}", "func (client *CapacityReservationsClient) listByCapacityReservationGroupCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsListByCapacityReservationGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations\"\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 capacityReservationGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter capacityReservationGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{capacityReservationGroupName}\", url.PathEscape(capacityReservationGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) {\n\trequest = &ListServerGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Alb\", \"2020-06-16\", \"ListServerGroups\", \"alb\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *SpatialAnchorsAccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SpatialAnchorsAccountsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ClustersClient) listCreateRequest(ctx context.Context, options *ClustersClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2\"\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func CreateListManagedPrivateSpacesRequest() (request *ListManagedPrivateSpacesRequest) {\n\trequest = &ListManagedPrivateSpacesRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"SmartHosting\", \"2020-08-01\", \"ListManagedPrivateSpaces\", \"smarthosting\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *PolicyDefinitionsClient) deleteAtManagementGroupCreateRequest(ctx context.Context, policyDefinitionName string, managementGroupID string, options *PolicyDefinitionsDeleteAtManagementGroupOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}\"\n\tif policyDefinitionName == \"\" {\n\t\treturn nil, errors.New(\"parameter policyDefinitionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{policyDefinitionName}\", url.PathEscape(policyDefinitionName))\n\tif managementGroupID == \"\" {\n\t\treturn nil, errors.New(\"parameter managementGroupID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managementGroupId}\", url.PathEscape(managementGroupID))\n\treq, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups\"\n\tif privateEndpointName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateEndpointName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateEndpointName}\", url.PathEscape(privateEndpointName))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "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}", "func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineScaleSetsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateDescribeScalingGroupsRequest() (request *DescribeScalingGroupsRequest) {\n\trequest = &DescribeScalingGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Ess\", \"2014-08-28\", \"DescribeScalingGroups\", \"ess\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/azure/compute/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/compute/azure/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (client *SyncGroupsClient) listLogsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParam SyncGroupsType, options *SyncGroupsClientListLogsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs\"\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\tif databaseName == \"\" {\n\t\treturn nil, errors.New(\"parameter databaseName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{databaseName}\", url.PathEscape(databaseName))\n\tif syncGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter syncGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{syncGroupName}\", url.PathEscape(syncGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"startTime\", startTime)\n\treqQP.Set(\"endTime\", endTime)\n\treqQP.Set(\"type\", string(typeParam))\n\tif options != nil && options.ContinuationToken != nil {\n\t\treqQP.Set(\"continuationToken\", *options.ContinuationToken)\n\t}\n\treqQP.Set(\"api-version\", \"2020-11-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client UsageDetailsClient) ListForBillingPeriodByManagementGroupPreparer(ctx context.Context, managementGroupID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"billingPeriodName\": autorest.Encode(\"path\", billingPeriodName),\n\t\t\"managementGroupId\": autorest.Encode(\"path\", managementGroupID),\n\t}\n\n\tconst APIVersion = \"2018-06-30\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\tif len(expand) > 0 {\n\t\tqueryParameters[\"$expand\"] = autorest.Encode(\"query\", expand)\n\t}\n\tif len(filter) > 0 {\n\t\tqueryParameters[\"$filter\"] = autorest.Encode(\"query\", filter)\n\t}\n\tif len(apply) > 0 {\n\t\tqueryParameters[\"$apply\"] = autorest.Encode(\"query\", apply)\n\t}\n\tif len(skiptoken) > 0 {\n\t\tqueryParameters[\"$skiptoken\"] = autorest.Encode(\"query\", skiptoken)\n\t}\n\tif top != nil {\n\t\tqueryParameters[\"$top\"] = autorest.Encode(\"query\", *top)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (client *PeeringPoliciesClient) listByManagedNetworkCreateRequest(ctx context.Context, resourceGroupName string, managedNetworkName string, options *PeeringPoliciesClientListByManagedNetworkOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetwork/managedNetworks/{managedNetworkName}/managedNetworkPeeringPolicies\"\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 managedNetworkName == \"\" {\n\t\treturn nil, errors.New(\"parameter managedNetworkName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managedNetworkName}\", url.PathEscape(managedNetworkName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2019-06-01-preview\")\n\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"$top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\tif options != nil && options.Skiptoken != nil {\n\t\treqQP.Set(\"$skiptoken\", *options.Skiptoken)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *AgentPoolsClient) listByKubernetesClusterCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *AgentPoolsClientListByKubernetesClusterOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools\"\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 kubernetesClusterName == \"\" {\n\t\treturn nil, errors.New(\"parameter kubernetesClusterName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{kubernetesClusterName}\", url.PathEscape(kubernetesClusterName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-07-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *KpiClient) listByHubCreateRequest(ctx context.Context, resourceGroupName string, hubName string, options *KpiClientListByHubOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/kpi\"\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 hubName == \"\" {\n\t\treturn nil, errors.New(\"parameter hubName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{hubName}\", url.PathEscape(hubName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2017-04-26\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client UsageDetailsClient) ListForBillingPeriodByManagementGroup(ctx context.Context, managementGroupID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultPage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/UsageDetailsClient.ListForBillingPeriodByManagementGroup\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.udlr.Response.Response != nil {\n\t\t\t\tsc = result.udlr.Response.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: top,\n\t\t\tConstraints: []validation.Constraint{{Target: \"top\", Name: validation.Null, Rule: false,\n\t\t\t\tChain: []validation.Constraint{{Target: \"top\", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil},\n\t\t\t\t\t{Target: \"top\", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},\n\t\t\t\t}}}}}); err != nil {\n\t\treturn result, validation.NewError(\"consumption.UsageDetailsClient\", \"ListForBillingPeriodByManagementGroup\", err.Error())\n\t}\n\n\tresult.fn = client.listForBillingPeriodByManagementGroupNextResults\n\treq, err := client.ListForBillingPeriodByManagementGroupPreparer(ctx, managementGroupID, billingPeriodName, expand, filter, apply, skiptoken, top)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListForBillingPeriodByManagementGroup\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListForBillingPeriodByManagementGroupSender(req)\n\tif err != nil {\n\t\tresult.udlr.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListForBillingPeriodByManagementGroup\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.udlr, err = client.ListForBillingPeriodByManagementGroupResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListForBillingPeriodByManagementGroup\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, options *ManagedClustersClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *SchemaRegistryClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *SchemaRegistryClientListByNamespaceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups\"\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 namespaceName == \"\" {\n\t\treturn nil, errors.New(\"parameter namespaceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{namespaceName}\", url.PathEscape(namespaceName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2022-10-01-preview\")\n\tif options != nil && options.Skip != nil {\n\t\treqQP.Set(\"$skip\", strconv.FormatInt(int64(*options.Skip), 10))\n\t}\n\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"$top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *MonitorsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *RegistrationDefinitionsClient) listCreateRequest(ctx context.Context, scope string, options *RegistrationDefinitionsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions\"\n\turlPath = strings.ReplaceAll(urlPath, \"{scope}\", scope)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-01-01-preview\")\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ManagedInstancesClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListByManagedInstanceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries\"\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 managedInstanceName == \"\" {\n\t\treturn nil, errors.New(\"parameter managedInstanceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managedInstanceName}\", url.PathEscape(managedInstanceName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.NumberOfQueries != nil {\n\t\treqQP.Set(\"numberOfQueries\", strconv.FormatInt(int64(*options.NumberOfQueries), 10))\n\t}\n\tif options != nil && options.Databases != nil {\n\t\treqQP.Set(\"databases\", *options.Databases)\n\t}\n\tif options != nil && options.StartTime != nil {\n\t\treqQP.Set(\"startTime\", *options.StartTime)\n\t}\n\tif options != nil && options.EndTime != nil {\n\t\treqQP.Set(\"endTime\", *options.EndTime)\n\t}\n\tif options != nil && options.Interval != nil {\n\t\treqQP.Set(\"interval\", string(*options.Interval))\n\t}\n\tif options != nil && options.AggregationFunction != nil {\n\t\treqQP.Set(\"aggregationFunction\", string(*options.AggregationFunction))\n\t}\n\tif options != nil && options.ObservationMetric != nil {\n\t\treqQP.Set(\"observationMetric\", string(*options.ObservationMetric))\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ManagedDatabasesClient) listByInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedDatabasesClientListByInstanceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases\"\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 managedInstanceName == \"\" {\n\t\treturn nil, errors.New(\"parameter managedInstanceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managedInstanceName}\", url.PathEscape(managedInstanceName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func CreateCreateMonitorGroupRequest() (request *CreateMonitorGroupRequest) {\n\trequest = &CreateMonitorGroupRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Cms\", \"2019-01-01\", \"CreateMonitorGroup\", \"cms\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func CreateCreateMonitorGroupByResourceGroupIdRequest() (request *CreateMonitorGroupByResourceGroupIdRequest) {\n\trequest = &CreateMonitorGroupByResourceGroupIdRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Cms\", \"2019-01-01\", \"CreateMonitorGroupByResourceGroupId\", \"cms\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client UsageDetailsClient) ListForBillingPeriodByManagementGroupSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req,\n\t\tautorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "func (client *MonitorsClient) listHostsCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientListHostsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ManagedInstancesClient) listCreateRequest(ctx context.Context, options *ManagedInstancesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *TagRulesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-27\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewListCmd(f *cmdutil.Factory) *ListCmd {\n\tccmd := &ListCmd{\n\t\tfactory: f,\n\t}\n\tcmd := &cobra.Command{\n\t\tUse: \"list\",\n\t\tShort: \"List smart group collection\",\n\t\tLong: `Get a collection of smart groups based on filter parameters`,\n\t\tExample: heredoc.Doc(`\n\t\t\t$ c8y smartgroups list\n\t\t\tGet a list of smart groups\n\n\t\t\t$ c8y smartgroups list --name \"myText*\"\n\t\t\tGet a list of smart groups with the names starting with 'myText'\n\n\t\t\t$ c8y smartgroups list --name \"myText*\" | c8y devices list\n\t\t\tGet a list of smart groups with their names starting with \"myText\", then get the devices from the smart groups\n `),\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn nil\n\t\t},\n\t\tRunE: ccmd.RunE,\n\t}\n\n\tcmd.SilenceUsage = true\n\n\tcmd.Flags().String(\"name\", \"\", \"Filter by name\")\n\tcmd.Flags().String(\"fragmentType\", \"\", \"Filter by fragment type\")\n\tcmd.Flags().String(\"owner\", \"\", \"Filter by owner\")\n\tcmd.Flags().String(\"deviceQuery\", \"\", \"Filter by device query\")\n\tcmd.Flags().String(\"query\", \"\", \"Additional query filter (accepts pipeline)\")\n\tcmd.Flags().String(\"queryTemplate\", \"\", \"String template to be used when applying the given query. Use %s to reference the query/pipeline input\")\n\tcmd.Flags().String(\"orderBy\", \"name\", \"Order by. e.g. _id asc or name asc or creationTime.date desc\")\n\tcmd.Flags().Bool(\"onlyInvisible\", false, \"Only include invisible smart groups\")\n\tcmd.Flags().Bool(\"onlyVisible\", false, \"Only include visible smart groups\")\n\tcmd.Flags().Bool(\"withParents\", false, \"Include a flat list of all parents and grandparents of the given object\")\n\n\tflags.WithOptions(\n\t\tcmd,\n\t\tflags.WithExtendedPipelineSupport(\"query\", \"query\", false, \"c8y_DeviceQueryString\"),\n\t)\n\n\t// Required flags\n\tccmd.SubCommand = subcommand.NewSubCommand(cmd)\n\n\treturn ccmd\n}", "func (client *ManagementAssociationsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ManagementAssociationsListBySubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementAssociations\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2015-11-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *MonitorsClient) listAPIKeysCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientListAPIKeysOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateDeleteCorpGroupRequest() (request *DeleteCorpGroupRequest) {\n\trequest = &DeleteCorpGroupRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Vcs\", \"2020-05-15\", \"DeleteCorpGroup\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func CreateGroup(params types.ContextParams, clientSet apimachinery.ClientSetInterface, groupItems []metadata.Group) []Group {\n\tresults := make([]Group, 0)\n\tfor _, grp := range groupItems {\n\n\t\tresults = append(results, &group{\n\t\t\tgrp: grp,\n\t\t\tparams: params,\n\t\t\tclientSet: clientSet,\n\t\t})\n\t}\n\n\treturn results\n}", "func (client *RedisClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, name string, options *RedisListKeysOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listKeys\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-12-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AvailabilitySetsListBySubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-07-01\")\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *MonitorsClient) listMonitoredResourcesCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientListMonitoredResourcesOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources\"\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 monitorName == \"\" {\n\t\treturn nil, errors.New(\"parameter monitorName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{monitorName}\", url.PathEscape(monitorName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ClustersClient) listCreateRequest(ctx context.Context, options *ClustersListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *SapMonitorsClient) listCreateRequest(ctx context.Context, options *SapMonitorsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2020-02-07-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (c *UMemClient) NewCreateUMemcacheGroupRequest() *CreateUMemcacheGroupRequest {\n\treq := &CreateUMemcacheGroupRequest{}\n\n\t// setup request with client config\n\tc.Client.SetupRequest(req)\n\n\t// setup retryable with default retry policy (retry for non-create action and common error)\n\treq.SetRetryable(false)\n\treturn req\n}", "func CreateCreateApplicationGroupRequest() (request *CreateApplicationGroupRequest) {\n\trequest = &CreateApplicationGroupRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"oos\", \"2019-06-01\", \"CreateApplicationGroup\", \"oos\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, 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-04\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *DicomServicesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *DicomServicesClientListByWorkspaceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif workspaceName == \"\" {\n\t\treturn nil, errors.New(\"parameter workspaceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{workspaceName}\", url.PathEscape(workspaceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ReplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *ReplicationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications\"\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *KustoOperationsClient) listCreateRequest(ctx context.Context, options *KustoOperationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Synapse/kustooperations\"\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *DevicesClient) listRegistrationKeyCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientListRegistrationKeyOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/devices/{deviceName}/listRegistrationKey\"\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 deviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter deviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{deviceName}\", url.PathEscape(deviceName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterMonitoringUserCredentialsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential\"\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 resourceName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceName}\", url.PathEscape(resourceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, 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\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *WorkflowsClient) listByStorageSyncServiceCreateRequest(ctx context.Context, resourceGroupName string, storageSyncServiceName string, options *WorkflowsClientListByStorageSyncServiceOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows\"\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 storageSyncServiceName == \"\" {\n\t\treturn nil, errors.New(\"parameter storageSyncServiceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{storageSyncServiceName}\", url.PathEscape(storageSyncServiceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-09-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroupDatabaseCreateRequest(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, options *LongTermRetentionManagedInstanceBackupsListByResourceGroupDatabaseOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups\"\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 locationName == \"\" {\n\t\treturn nil, errors.New(\"parameter locationName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{locationName}\", url.PathEscape(locationName))\n\tif managedInstanceName == \"\" {\n\t\treturn nil, errors.New(\"parameter managedInstanceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managedInstanceName}\", url.PathEscape(managedInstanceName))\n\tif databaseName == \"\" {\n\t\treturn nil, errors.New(\"parameter databaseName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{databaseName}\", url.PathEscape(databaseName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.OnlyLatestPerDatabase != nil {\n\t\treqQP.Set(\"onlyLatestPerDatabase\", strconv.FormatBool(*options.OnlyLatestPerDatabase))\n\t}\n\tif options != nil && options.DatabaseState != nil {\n\t\treqQP.Set(\"databaseState\", string(*options.DatabaseState))\n\t}\n\treqQP.Set(\"api-version\", \"2020-11-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *RecordSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, privateZoneName string, options *RecordSetsListOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/ALL\"\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 privateZoneName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateZoneName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateZoneName}\", url.PathEscape(privateZoneName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodGet, 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\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"$top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\tif options != nil && options.Recordsetnamesuffix != nil {\n\t\treqQP.Set(\"$recordsetnamesuffix\", *options.Recordsetnamesuffix)\n\t}\n\treqQP.Set(\"api-version\", \"2020-06-01\")\n\treq.URL.RawQuery = reqQP.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func CreateDescribeContainerGroupMetricRequest() (request *DescribeContainerGroupMetricRequest) {\n\trequest = &DescribeContainerGroupMetricRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Eci\", \"2018-08-08\", \"DescribeContainerGroupMetric\", \"eci\", \"openAPI\")\n\treturn\n}" ]
[ "0.69496083", "0.6796391", "0.67800164", "0.67291677", "0.6685094", "0.65846455", "0.65812635", "0.6464833", "0.64444846", "0.64438474", "0.6417571", "0.6413473", "0.6367035", "0.6345273", "0.6328532", "0.6325075", "0.63092667", "0.6294302", "0.6265202", "0.6218708", "0.62121326", "0.61779267", "0.6159489", "0.61585087", "0.6141909", "0.6141015", "0.6134294", "0.6133518", "0.61290765", "0.6117258", "0.6116931", "0.61121714", "0.6100779", "0.6088963", "0.6086512", "0.6065806", "0.6063861", "0.6050626", "0.6049295", "0.60322016", "0.6028864", "0.59935635", "0.5909858", "0.5892871", "0.58404547", "0.58390075", "0.5838152", "0.5836992", "0.5817903", "0.5776243", "0.571107", "0.56981635", "0.56693554", "0.56627107", "0.5629798", "0.5610828", "0.5542878", "0.54183555", "0.54072577", "0.5387532", "0.53609294", "0.5336984", "0.5300042", "0.5275028", "0.5237035", "0.5234658", "0.52239335", "0.52175343", "0.52085775", "0.51974654", "0.5178501", "0.51559615", "0.5152492", "0.51495236", "0.5123344", "0.5111615", "0.50889766", "0.5083543", "0.5080035", "0.50710946", "0.5070843", "0.50666684", "0.5050772", "0.5041552", "0.5029419", "0.5022239", "0.50211686", "0.50165427", "0.5014785", "0.50112116", "0.5006811", "0.4999826", "0.4992793", "0.49797168", "0.49795702", "0.49787295", "0.4977172", "0.4971931", "0.49700576", "0.49593434" ]
0.78612286
0
listByManagementGroupHandleResponse handles the ListByManagementGroup response.
listByManagementGroupHandleResponse обрабатывает ответ ListByManagementGroup.
func (client *PolicyDefinitionsClient) listByManagementGroupHandleResponse(resp *http.Response) (PolicyDefinitionsListByManagementGroupResponse, error) { result := PolicyDefinitionsListByManagementGroupResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.PolicyDefinitionListResult); err != nil { return PolicyDefinitionsListByManagementGroupResponse{}, runtime.NewResponseError(err, resp) } return result, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "func (client *ManagedInstancesClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedInstancesClientListByResourceGroupResponse, error) {\n\tresult := ManagedInstancesClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceListResult); err != nil {\n\t\treturn ManagedInstancesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SQLVirtualMachinesClient) listBySQLVMGroupHandleResponse(resp *http.Response) (SQLVirtualMachinesClientListBySQLVMGroupResponse, error) {\n\tresult := SQLVirtualMachinesClientListBySQLVMGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListResult); err != nil {\n\t\treturn SQLVirtualMachinesClientListBySQLVMGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Response) (MonitorsClientListByResourceGroupResponse, error) {\n\tresult := MonitorsClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.MonitorResourceListResponse); err != nil {\n\t\treturn MonitorsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *RedisClient) listByResourceGroupHandleResponse(resp *http.Response) (RedisListByResourceGroupResponse, error) {\n\tresult := RedisListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.RedisListResult); err != nil {\n\t\treturn RedisListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClustersClientListByResourceGroupResponse, error) {\n\tresult := ManagedClustersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterListResult); err != nil {\n\t\treturn ManagedClustersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *azcore.Response) (DedicatedHostListResultResponse, error) {\n\tvar val *DedicatedHostListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn DedicatedHostListResultResponse{}, err\n\t}\n\treturn DedicatedHostListResultResponse{RawResponse: resp.Response, DedicatedHostListResult: val}, nil\n}", "func (client *GroupClient) listByServiceHandleResponse(resp *http.Response) (GroupListByServiceResponse, error) {\n\tresult := GroupListByServiceResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.GroupCollection); err != nil {\n\t\treturn GroupListByServiceResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ContainerGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (ContainerGroupsClientListByResourceGroupResponse, error) {\n\tresult := ContainerGroupsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ContainerGroupListResult); err != nil {\n\t\treturn ContainerGroupsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *http.Response) (DedicatedHostsListByHostGroupResponse, error) {\n\tresult := DedicatedHostsListByHostGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostListResult); err != nil {\n\t\treturn DedicatedHostsListByHostGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ClustersListByResourceGroupResponse, error) {\n\tresult := ClustersListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil {\n\t\treturn ClustersListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *CustomAssessmentAutomationsClient) listByResourceGroupHandleResponse(resp *http.Response) (CustomAssessmentAutomationsListByResourceGroupResponse, error) {\n\tresult := CustomAssessmentAutomationsListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.CustomAssessmentAutomationsListResult); err != nil {\n\t\treturn CustomAssessmentAutomationsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Response) (DevicesClientListByResourceGroupResponse, error) {\n\tresult := DevicesClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DeviceListResult); err != nil {\n\t\treturn DevicesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SQLVirtualMachinesClient) listByResourceGroupHandleResponse(resp *http.Response) (SQLVirtualMachinesClientListByResourceGroupResponse, error) {\n\tresult := SQLVirtualMachinesClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListResult); err != nil {\n\t\treturn SQLVirtualMachinesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ClustersClientListByResourceGroupResponse, error) {\n\tresult := ClustersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil {\n\t\treturn ClustersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Response) (ServersClientListByResourceGroupResponse, error) {\n\tresult := ServersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ServerListResult); err != nil {\n\t\treturn ServersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualRoutersClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualRoutersClientListByResourceGroupResponse, error) {\n\tresult := VirtualRoutersClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterListResult); err != nil {\n\t\treturn VirtualRoutersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SyncGroupsClient) listByDatabaseHandleResponse(resp *http.Response) (SyncGroupsClientListByDatabaseResponse, error) {\n\tresult := SyncGroupsClientListByDatabaseResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SyncGroupListResult); err != nil {\n\t\treturn SyncGroupsClientListByDatabaseResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Response) (WorkspacesListByResourceGroupResponse, error) {\n\tresult := WorkspacesListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceListResult); err != nil {\n\t\treturn WorkspacesListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *DiskEncryptionSetsClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskEncryptionSetsListByResourceGroupResponse, error) {\n\tresult := DiskEncryptionSetsListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil {\n\t\treturn DiskEncryptionSetsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *HardwareComponentGroupsClient) listByDeviceHandleResponse(resp *http.Response) (HardwareComponentGroupsClientListByDeviceResponse, error) {\n\tresult := HardwareComponentGroupsClientListByDeviceResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.HardwareComponentGroupList); err != nil {\n\t\treturn HardwareComponentGroupsClientListByDeviceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *AvailabilityGroupListenersClient) listByGroupHandleResponse(resp *http.Response) (AvailabilityGroupListenersClientListByGroupResponse, error) {\n\tresult := AvailabilityGroupListenersClientListByGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityGroupListenerListResult); err != nil {\n\t\treturn AvailabilityGroupListenersClientListByGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *CassandraClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (CassandraClustersClientListByResourceGroupResponse, error) {\n\tresult := CassandraClustersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ListClusters); err != nil {\n\t\treturn CassandraClustersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachinesClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualMachinesClientListByResourceGroupResponse, error) {\n\tresult := VirtualMachinesClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachinesList); err != nil {\n\t\treturn VirtualMachinesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "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}", "func (client *MetricAlertsClient) listByResourceGroupHandleResponse(resp *http.Response) (MetricAlertsClientListByResourceGroupResponse, error) {\n\tresult := MetricAlertsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.MetricAlertResourceCollection); err != nil {\n\t\treturn MetricAlertsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ContainerGroupsClient) listHandleResponse(resp *http.Response) (ContainerGroupsClientListResponse, error) {\n\tresult := ContainerGroupsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ContainerGroupListResult); err != nil {\n\t\treturn ContainerGroupsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client AccountClient) ListByResourceGroupResponder(resp *http.Response) (result AccountResourceDescriptionList, err error) {\n err = autorest.Respond(\n resp,\n azure.WithErrorUnlessStatusCode(http.StatusOK),\n autorest.ByUnmarshallingJSON(&result),\n autorest.ByClosing())\n result.Response = autorest.Response{Response: resp}\n return\n }", "func (client *LocalRulestacksClient) listByResourceGroupHandleResponse(resp *http.Response) (LocalRulestacksClientListByResourceGroupResponse, error) {\n\tresult := LocalRulestacksClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.LocalRulestackResourceListResult); err != nil {\n\t\treturn LocalRulestacksClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Response) (ServersClientListByResourceGroupResponse, error) {\n\tresult := ServersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ServerList); err != nil {\n\t\treturn ServersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualNetworkTapsClient) listByResourceGroupHandleResponse(resp *azcore.Response) (VirtualNetworkTapListResultResponse, error) {\n\tvar val *VirtualNetworkTapListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn VirtualNetworkTapListResultResponse{}, err\n\t}\n\treturn VirtualNetworkTapListResultResponse{RawResponse: resp.Response, VirtualNetworkTapListResult: val}, nil\n}", "func (client *CapacityReservationsClient) listByCapacityReservationGroupHandleResponse(resp *http.Response) (CapacityReservationsListByCapacityReservationGroupResponse, error) {\n\tresult := CapacityReservationsListByCapacityReservationGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationListResult); err != nil {\n\t\treturn CapacityReservationsListByCapacityReservationGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client DataControllersClient) ListInGroupResponder(resp *http.Response) (result PageOfDataControllerResource, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (client IotHubResourceClient) ListByResourceGroupResponder(resp *http.Response) (result IotHubDescriptionListResult, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (client UsageDetailsClient) ListForBillingPeriodByManagementGroupResponder(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}", "func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Response) (AccountsClientListByResourceGroupResponse, error) {\n\tresult := AccountsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil {\n\t\treturn AccountsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WebAppsClient) listByResourceGroupHandleResponse(resp *http.Response) (WebAppsListByResourceGroupResponse, error) {\n\tresult := WebAppsListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil {\n\t\treturn WebAppsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineImageTemplatesClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualMachineImageTemplatesClientListByResourceGroupResponse, error) {\n\tresult := VirtualMachineImageTemplatesClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ImageTemplateListResult); err != nil {\n\t\treturn VirtualMachineImageTemplatesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *CapacitiesClient) listByResourceGroupHandleResponse(resp *http.Response) (CapacitiesClientListByResourceGroupResponse, error) {\n\tresult := CapacitiesClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DedicatedCapacities); err != nil {\n\t\treturn CapacitiesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *DataCollectionEndpointsClient) listByResourceGroupHandleResponse(resp *http.Response) (DataCollectionEndpointsListByResourceGroupResponse, error) {\n\tresult := DataCollectionEndpointsListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DataCollectionEndpointResourceListResult); err != nil {\n\t\treturn DataCollectionEndpointsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *AlertProcessingRulesClient) listByResourceGroupHandleResponse(resp *http.Response) (AlertProcessingRulesClientListByResourceGroupResponse, error) {\n\tresult := AlertProcessingRulesClientListByResourceGroupResponse{RawResponse: resp}\n\tif val := resp.Header.Get(\"x-ms-request-id\"); val != \"\" {\n\t\tresult.XMSRequestID = &val\n\t}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AlertProcessingRulesList); err != nil {\n\t\treturn AlertProcessingRulesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ConnectedEnvironmentsClient) listByResourceGroupHandleResponse(resp *http.Response) (ConnectedEnvironmentsClientListByResourceGroupResponse, error) {\n\tresult := ConnectedEnvironmentsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ConnectedEnvironmentCollection); err != nil {\n\t\treturn ConnectedEnvironmentsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client CloudEndpointsClient) ListBySyncGroupResponder(resp *http.Response) (result CloudEndpointArray, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (client *IPAllocationsClient) listByResourceGroupHandleResponse(resp *http.Response) (IPAllocationsClientListByResourceGroupResponse, error) {\n\tresult := IPAllocationsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil {\n\t\treturn IPAllocationsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client Client) ListByResourceGroupResponder(resp *http.Response) (result ListResult, 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}", "func (client *DataCollectionEndpointsClient) listByResourceGroupHandleResponse(resp *http.Response) (DataCollectionEndpointsClientListByResourceGroupResponse, error) {\n\tresult := DataCollectionEndpointsClientListByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DataCollectionEndpointResourceListResult); err != nil {\n\t\treturn DataCollectionEndpointsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *IotSecuritySolutionClient) listByResourceGroupHandleResponse(resp *http.Response) (IotSecuritySolutionClientListByResourceGroupResponse, error) {\n\tresult := IotSecuritySolutionClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.IoTSecuritySolutionsList); err != nil {\n\t\treturn IotSecuritySolutionClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client WorkloadNetworksClient) ListVMGroupsResponder(resp *http.Response) (result WorkloadNetworkVMGroupsList, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (client UsageDetailsClient) ListByManagementGroup(ctx context.Context, managementGroupID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultPage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/UsageDetailsClient.ListByManagementGroup\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.udlr.Response.Response != nil {\n\t\t\t\tsc = result.udlr.Response.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: top,\n\t\t\tConstraints: []validation.Constraint{{Target: \"top\", Name: validation.Null, Rule: false,\n\t\t\t\tChain: []validation.Constraint{{Target: \"top\", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil},\n\t\t\t\t\t{Target: \"top\", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},\n\t\t\t\t}}}}}); err != nil {\n\t\treturn result, validation.NewError(\"consumption.UsageDetailsClient\", \"ListByManagementGroup\", err.Error())\n\t}\n\n\tresult.fn = client.listByManagementGroupNextResults\n\treq, err := client.ListByManagementGroupPreparer(ctx, managementGroupID, expand, filter, skiptoken, top, apply)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListByManagementGroup\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListByManagementGroupSender(req)\n\tif err != nil {\n\t\tresult.udlr.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListByManagementGroup\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.udlr, err = client.ListByManagementGroupResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"consumption.UsageDetailsClient\", \"ListByManagementGroup\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "func (client *PolicyDefinitionsClient) getAtManagementGroupHandleResponse(resp *http.Response) (PolicyDefinitionsGetAtManagementGroupResponse, error) {\n\tresult := PolicyDefinitionsGetAtManagementGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PolicyDefinition); err != nil {\n\t\treturn PolicyDefinitionsGetAtManagementGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *SchemaRegistryClient) listByNamespaceHandleResponse(resp *http.Response) (SchemaRegistryClientListByNamespaceResponse, error) {\n\tresult := SchemaRegistryClientListByNamespaceResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SchemaGroupListResult); err != nil {\n\t\treturn SchemaRegistryClientListByNamespaceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *CertificateOrdersClient) listByResourceGroupHandleResponse(resp *http.Response) (CertificateOrdersClientListByResourceGroupResponse, error) {\n\tresult := CertificateOrdersClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.CertificateOrderCollection); err != nil {\n\t\treturn CertificateOrdersClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SpatialAnchorsAccountsClient) listByResourceGroupHandleResponse(resp *http.Response) (SpatialAnchorsAccountsClientListByResourceGroupResponse, error) {\n\tresult := SpatialAnchorsAccountsClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SpatialAnchorsAccountPage); err != nil {\n\t\treturn SpatialAnchorsAccountsClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *PrivateDNSZoneGroupsClient) listHandleResponse(resp *http.Response) (PrivateDNSZoneGroupsClientListResponse, error) {\n\tresult := PrivateDNSZoneGroupsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PrivateDNSZoneGroupListResult); err != nil {\n\t\treturn PrivateDNSZoneGroupsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *FactoriesClient) listByResourceGroupHandleResponse(resp *http.Response) (FactoriesClientListByResourceGroupResponse, error) {\n\tresult := FactoriesClientListByResourceGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.FactoryListResponse); err != nil {\n\t\treturn FactoriesClientListByResourceGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client LabClient) ListByResourceGroupResponder(resp *http.Response) (result ResponseWithContinuationLab, 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}", "func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroupDatabaseHandleResponse(resp *http.Response) (LongTermRetentionManagedInstanceBackupsListByResourceGroupDatabaseResponse, error) {\n\tresult := LongTermRetentionManagedInstanceBackupsListByResourceGroupDatabaseResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceLongTermRetentionBackupListResult); err != nil {\n\t\treturn LongTermRetentionManagedInstanceBackupsListByResourceGroupDatabaseResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client PolicyStatesClient) ListQueryResultsForManagementGroupResponder(resp *http.Response) (result PolicyStatesQueryResults, 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}", "func (client *AFDOriginsClient) listByOriginGroupHandleResponse(resp *http.Response) (AFDOriginsClientListByOriginGroupResponse, error) {\n\tresult := AFDOriginsClientListByOriginGroupResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AFDOriginListResult); err != nil {\n\t\treturn AFDOriginsClientListByOriginGroupResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedInstancesClient) listByManagedInstanceHandleResponse(resp *http.Response) (ManagedInstancesClientListByManagedInstanceResponse, error) {\n\tresult := ManagedInstancesClientListByManagedInstanceResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.TopQueriesListResult); err != nil {\n\t\treturn ManagedInstancesClientListByManagedInstanceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *PeeringPoliciesClient) listByManagedNetworkHandleResponse(resp *http.Response) (PeeringPoliciesClientListByManagedNetworkResponse, error) {\n\tresult := PeeringPoliciesClientListByManagedNetworkResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PeeringPolicyListResult); err != nil {\n\t\treturn PeeringPoliciesClientListByManagedNetworkResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client UsageDetailsClient) ListByManagementGroupComplete(ctx context.Context, managementGroupID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultIterator, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/UsageDetailsClient.ListByManagementGroup\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response().Response.Response != nil {\n\t\t\t\tsc = result.page.Response().Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tresult.page, err = client.ListByManagementGroup(ctx, managementGroupID, expand, filter, skiptoken, top, apply)\n\treturn\n}", "func (client *ReplicationProtectionContainersClient) listByReplicationFabricsHandleResponse(resp *http.Response) (ReplicationProtectionContainersClientListByReplicationFabricsResponse, error) {\n\tresult := ReplicationProtectionContainersClientListByReplicationFabricsResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ProtectionContainerCollection); err != nil {\n\t\treturn ReplicationProtectionContainersClientListByReplicationFabricsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client IotHubResourceClient) ListEventHubConsumerGroupsResponder(resp *http.Response) (result EventHubConsumerGroupsListResult, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroupInstanceHandleResponse(resp *http.Response) (LongTermRetentionManagedInstanceBackupsListByResourceGroupInstanceResponse, error) {\n\tresult := LongTermRetentionManagedInstanceBackupsListByResourceGroupInstanceResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceLongTermRetentionBackupListResult); err != nil {\n\t\treturn LongTermRetentionManagedInstanceBackupsListByResourceGroupInstanceResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client FirewallPolicyRuleGroupsClient) ListResponder(resp *http.Response) (result FirewallPolicyRuleGroupListResult, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (client *PermissionBindingsClient) listByNamespaceHandleResponse(resp *http.Response) (PermissionBindingsClientListByNamespaceResponse, error) {\n\tresult := PermissionBindingsClientListByNamespaceResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.PermissionBindingsListResult); err != nil {\n\t\treturn PermissionBindingsClientListByNamespaceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *SyncGroupsClient) listLogsHandleResponse(resp *http.Response) (SyncGroupsClientListLogsResponse, error) {\n\tresult := SyncGroupsClientListLogsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SyncGroupLogListResult); err != nil {\n\t\treturn SyncGroupsClientListLogsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *KpiClient) listByHubHandleResponse(resp *http.Response) (KpiClientListByHubResponse, error) {\n\tresult := KpiClientListByHubResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.KpiListResult); err != nil {\n\t\treturn KpiClientListByHubResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedInstancesClient) listByInstancePoolHandleResponse(resp *http.Response) (ManagedInstancesClientListByInstancePoolResponse, error) {\n\tresult := ManagedInstancesClientListByInstancePoolResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceListResult); err != nil {\n\t\treturn ManagedInstancesClientListByInstancePoolResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *WorkflowsClient) listByStorageSyncServiceHandleResponse(resp *http.Response) (WorkflowsClientListByStorageSyncServiceResponse, error) {\n\tresult := WorkflowsClientListByStorageSyncServiceResponse{}\n\tif val := resp.Header.Get(\"x-ms-request-id\"); val != \"\" {\n\t\tresult.XMSRequestID = &val\n\t}\n\tif val := resp.Header.Get(\"x-ms-correlation-request-id\"); val != \"\" {\n\t\tresult.XMSCorrelationRequestID = &val\n\t}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.WorkflowArray); err != nil {\n\t\treturn WorkflowsClientListByStorageSyncServiceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsClientListResponse, error) {\n\tresult := MonitorsClientListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.MonitorResourceListResponse); err != nil {\n\t\treturn MonitorsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ReplicationProtectionContainersClient) listHandleResponse(resp *http.Response) (ReplicationProtectionContainersClientListResponse, error) {\n\tresult := ReplicationProtectionContainersClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ProtectionContainerCollection); err != nil {\n\t\treturn ReplicationProtectionContainersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client DataControllersClient) ListInGroup(ctx context.Context, resourceGroupName string) (result PageOfDataControllerResourcePage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/DataControllersClient.ListInGroup\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.podcr.Response.Response != nil {\n\t\t\t\tsc = result.podcr.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tresult.fn = client.listInGroupNextResults\n\treq, err := client.ListInGroupPreparer(ctx, resourceGroupName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"azuredata.DataControllersClient\", \"ListInGroup\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListInGroupSender(req)\n\tif err != nil {\n\t\tresult.podcr.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"azuredata.DataControllersClient\", \"ListInGroup\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.podcr, err = client.ListInGroupResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"azuredata.DataControllersClient\", \"ListInGroup\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\tif result.podcr.hasNextLink() && result.podcr.IsEmpty() {\n\t\terr = result.NextWithContext(ctx)\n\t\treturn\n\t}\n\n\treturn\n}", "func (client *SyncGroupsClient) listSyncDatabaseIDsHandleResponse(resp *http.Response) (SyncGroupsClientListSyncDatabaseIDsResponse, error) {\n\tresult := SyncGroupsClientListSyncDatabaseIDsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SyncDatabaseIDListResult); err != nil {\n\t\treturn SyncGroupsClientListSyncDatabaseIDsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedDatabasesClient) listByInstanceHandleResponse(resp *http.Response) (ManagedDatabasesClientListByInstanceResponse, error) {\n\tresult := ManagedDatabasesClientListByInstanceResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseListResult); err != nil {\n\t\treturn ManagedDatabasesClientListByInstanceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetsListResponse, error) {\n\tresult := VirtualMachineScaleSetsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil {\n\t\treturn VirtualMachineScaleSetsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client PolicyStatesClient) ListQueryResultsForManagementGroupSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req,\n\t\tautorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "func handleGetGroups(c *Context, w http.ResponseWriter, r *http.Request) {\n\tpaging, err := parsePaging(r.URL)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse paging parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\twithInstallationCount, err := parseBool(r.URL, model.ShowInstallationCountQueryParameter, false)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse request parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tfilter := &model.GroupFilter{\n\t\tPaging: paging,\n\t\tWithInstallationCount: withInstallationCount,\n\t}\n\n\tgroups, err := c.Store.GetGroupDTOs(filter)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to query groups\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif groups == nil {\n\t\tgroups = []*model.GroupDTO{}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\toutputJSON(c, w, groups)\n}", "func (client *GroupMgmtClient) List(path string) (interface{}, error) {\n\tlistResp, err := client.ListFromParams(path, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn listResp, nil\n}", "func (client *LongTermRetentionManagedInstanceBackupsClient) getByResourceGroupHandleResponse(resp *http.Response) (LongTermRetentionManagedInstanceBackupsGetByResourceGroupResponse, error) {\n\tresult := LongTermRetentionManagedInstanceBackupsGetByResourceGroupResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceLongTermRetentionBackup); err != nil {\n\t\treturn LongTermRetentionManagedInstanceBackupsGetByResourceGroupResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *GalleryImagesClient) listByGalleryHandleResponse(resp *http.Response) (GalleryImagesClientListByGalleryResponse, error) {\n\tresult := GalleryImagesClientListByGalleryResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageList); err != nil {\n\t\treturn GalleryImagesClientListByGalleryResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *DicomServicesClient) listByWorkspaceHandleResponse(resp *http.Response) (DicomServicesClientListByWorkspaceResponse, error) {\n\tresult := DicomServicesClientListByWorkspaceResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.DicomServiceCollection); err != nil {\n\t\treturn DicomServicesClientListByWorkspaceResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ReplicationvCentersClient) listByReplicationFabricsHandleResponse(resp *http.Response) (ReplicationvCentersClientListByReplicationFabricsResponse, error) {\n\tresult := ReplicationvCentersClientListByReplicationFabricsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VCenterCollection); err != nil {\n\t\treturn ReplicationvCentersClientListByReplicationFabricsResponse{}, err\n\t}\n\treturn result, nil\n}", "func (c *GroupController) List(ctx *app.ListGroupContext) error {\n\t// GroupController_List: start_implement\n\n\tdataStore := &dal.DataStore{}\n\tdataStore.GetSession()\n\t// Close the session\n\tdefer dataStore.Close()\n\tdc := dal.NewDalGroup(dataStore)\n\n\tgroups, err := dc.FetchAll()\n\n\tif err != nil {\n\t\tctx.ResponseData.Service.LogError(\"InternalServerError\", \"req_id\", middleware.ContextRequestID(ctx), \"ctrl\", \"Group\", \"action\", \"List\", ctx.RequestData.Request.Method, ctx.RequestData.Request.URL, \"databaseError\", err.Error())\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tres := make(app.GwentapiGroupCollection, len(*groups))\n\n\tlastModified := time.Time{}\n\tfor i, group := range *groups {\n\t\tg, _ := factory.CreateGroup(&group)\n\n\t\tif lastModified.Before(group.Last_Modified) {\n\t\t\tlastModified = group.Last_Modified\n\t\t}\n\n\t\tres[i] = g\n\t}\n\n\t// GroupController_List: end_implement\n\thelpers.LastModified(ctx.ResponseData, lastModified)\n\tif ctx.IfModifiedSince != nil {\n\t\tif !helpers.IsModified(*ctx.IfModifiedSince, lastModified) {\n\t\t\treturn ctx.NotModified()\n\t\t}\n\t}\n\treturn ctx.OK(res)\n}", "func (client *SapMonitorsClient) listHandleResponse(resp *http.Response) (SapMonitorsClientListResponse, error) {\n\tresult := SapMonitorsClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SapMonitorListResult); err != nil {\n\t\treturn SapMonitorsClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/compute/azure/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (client *RecordSetsClient) listHandleResponse(resp *azcore.Response) (RecordSetListResultResponse, error) {\n\tvar val *RecordSetListResult\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn RecordSetListResultResponse{}, err\n\t}\n\treturn RecordSetListResultResponse{RawResponse: resp.Response, RecordSetListResult: val}, nil\n}", "func (client IdentityClient) ListDynamicGroups(ctx context.Context, request ListDynamicGroupsRequest) (response ListDynamicGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listDynamicGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListDynamicGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListDynamicGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListDynamicGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListDynamicGroupsResponse\")\n\t}\n\treturn\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/azure/compute/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (client DataControllersClient) ListInGroupSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, azure.DoRetryWithRegistration(client.Client))\n}", "func (client IdentityClient) listDynamicGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/dynamicGroups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListDynamicGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func (c *Console) List(group string) (err error) {\n\t_, err = fmt.Fprintf(c.conn, \"%v\\n\", toJSON([]string{\"list\", group}))\n\tif err == nil {\n\t\terr = <-c.Waiter\n\t}\n\treturn\n}", "func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsListResponse, error) {\n\tresult := VirtualMachineScaleSetVMRunCommandsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil {\n\t\treturn VirtualMachineScaleSetVMRunCommandsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *SyncGroupsClient) listHubSchemasHandleResponse(resp *http.Response) (SyncGroupsClientListHubSchemasResponse, error) {\n\tresult := SyncGroupsClientListHubSchemasResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.SyncFullSchemaPropertiesListResult); err != nil {\n\t\treturn SyncGroupsClientListHubSchemasResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (ManagedClustersClientListResponse, error) {\n\tresult := ManagedClustersClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterListResult); err != nil {\n\t\treturn ManagedClustersClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func (client *ManagedInstancesClient) listHandleResponse(resp *http.Response) (ManagedInstancesClientListResponse, error) {\n\tresult := ManagedInstancesClientListResponse{}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceListResult); err != nil {\n\t\treturn ManagedInstancesClientListResponse{}, err\n\t}\n\treturn result, nil\n}", "func List(c messagebird.Client, options *messagebird.PaginationRequest) (*Groups, error) {\n\tgroupList := &Groups{}\n\tif err := c.Request(groupList, http.MethodGet, path+\"?\"+options.QueryParams(), nil); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groupList, nil\n}", "func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (AvailabilitySetsListResponse, error) {\n\tresult := AvailabilitySetsListResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil {\n\t\treturn AvailabilitySetsListResponse{}, runtime.NewResponseError(err, resp)\n\t}\n\treturn result, nil\n}", "func (client *GalleryImageVersionsClient) listByGalleryImageHandleResponse(resp *azcore.Response) (GalleryImageVersionListResponse, error) {\n\tvar val *GalleryImageVersionList\n\tif err := resp.UnmarshalAsJSON(&val); err != nil {\n\t\treturn GalleryImageVersionListResponse{}, err\n\t}\n\treturn GalleryImageVersionListResponse{RawResponse: resp.Response, GalleryImageVersionList: val}, nil\n}" ]
[ "0.7555561", "0.70824856", "0.70370066", "0.70273715", "0.7022419", "0.70222783", "0.70171577", "0.6928565", "0.6868567", "0.6856361", "0.6823024", "0.6822074", "0.68173724", "0.6772575", "0.677189", "0.67256725", "0.67240644", "0.67218256", "0.6714559", "0.67127115", "0.6708223", "0.66908777", "0.6687579", "0.66784835", "0.6672505", "0.66629374", "0.6636304", "0.66255164", "0.6620682", "0.6620363", "0.66161877", "0.6613272", "0.66020626", "0.6545836", "0.65427524", "0.65222245", "0.6521667", "0.652135", "0.65189075", "0.6517604", "0.65159607", "0.6498094", "0.64969933", "0.64955544", "0.6483556", "0.6482563", "0.6478493", "0.6472962", "0.64690405", "0.64225835", "0.6411927", "0.64091724", "0.6380853", "0.63379073", "0.62817556", "0.6260271", "0.6184453", "0.61503977", "0.6103927", "0.60424834", "0.6015009", "0.6011624", "0.60011196", "0.59753925", "0.59326655", "0.592703", "0.58493847", "0.58215153", "0.57955366", "0.5792208", "0.57914877", "0.57738245", "0.5760144", "0.5748455", "0.5731226", "0.5725642", "0.5688913", "0.5686198", "0.56794214", "0.567926", "0.56763154", "0.5673888", "0.5672037", "0.56335247", "0.56227857", "0.5612983", "0.56021714", "0.56000686", "0.5598056", "0.55749774", "0.5569196", "0.556728", "0.5565844", "0.5560484", "0.55519915", "0.55475044", "0.5538871", "0.5527458", "0.5520178", "0.55006224" ]
0.8073399
0
startLiveReloadServer initializes a livereload to notify the browser of changes to code that does not need a recompile.
startLiveReloadServer инициализирует livereload для уведомления браузера о изменениях в коде, которые не требуют пересборки.
func startLiveReloadServer(tpls *template.Template, cfg *env.Config, staticAssets *static.Files) error { if cfg.IsProduction { return nil } log.Info("Initializing livereload") paths := []string{ "assets", "templates", } tmplFn := func(name string) (bool, error) { templates, err := initTemplates(cfg, staticAssets) if err != nil { return false, err } *tpls = *templates return true, nil } mappings := livereload.ReloadMapping{ ".css": nil, ".js": nil, ".tmpl": tmplFn, } _, err := livereload.ListenAndServe(livereload.DefaultPort, paths, mappings) return err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func reload(l net.Listener, httpServer *http.Server) error {\n\tconst errLoc = \"main.reload()\"\n\n\t// Making duplicate for socket descriptor\n\t// to use them in child process.\n\tfile, err := (l.(*net.TCPListener)).File()\n\tif err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"%s: failed to get file of listener, reason -> %s\",\n\t\t\terrLoc, err.Error(),\n\t\t)\n\t}\n\tfd, err := syscall.Dup(int(file.Fd()))\n\tfile.Close()\n\tif err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"%s: failed to dup(2) listener, reason -> %s\", errLoc, err.Error(),\n\t\t)\n\t}\n\tif err := os.Setenv(envVarName, fmt.Sprint(fd)); err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"%s: failed to write fd into environment variable, reason -> %s\",\n\t\t\terrLoc, err.Error(),\n\t\t)\n\t}\n\n\t// Unlock PID file to start normally child process.\n\tdaemon.UnlockPidFile()\n\n\t// Start child process.\n\tcmd := exec.Command(daemon.AppPath)\n\tif err := cmd.Start(); err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"%s: failed to start child process, reason -> %s\",\n\t\t\terrLoc, err.Error(),\n\t\t)\n\t}\n\n\tselect {\n\t// Waiting for notification from child process that it starts successfully.\n\t// In real application it's better to move generation of chan for this case\n\t// before calling cmd.Start() to be sure to catch signal in any case.\n\tcase <-func() <-chan os.Signal {\n\t\tsig := make(chan os.Signal)\n\t\tsignal.Notify(sig, syscall.SIGUSR1)\n\t\treturn sig\n\t}():\n\t// If child process stopped without sending signal.\n\tcase <-func() chan struct{} {\n\t\tch := make(chan struct{}, 1)\n\t\tgo func() {\n\t\t\tcmd.Wait()\n\t\t\tch <- struct{}{}\n\t\t}()\n\t\treturn ch\n\t}():\n\t\terr = fmt.Errorf(\"%s: child process stopped unexpectably\", errLoc)\n\t// Timeout for waiting signal from child process.\n\tcase <-time.After(10 * time.Second):\n\t\terr = fmt.Errorf(\n\t\t\t\"%s: child process is not responding, closing by timeout\", errLoc,\n\t\t)\n\t}\n\n\t// Dealing with keep-alive connections.\n\thttpServer.SetKeepAlivesEnabled(false)\n\ttime.Sleep(100 * time.Millisecond)\n\n\t// Close current listener (stop server in fact).\n\tl.Close()\n\treturn err\n}", "func startServer() {\n\tapi, err := gobroem.NewAPI(options.db)\n\tif err != nil {\n\t\tlog.Fatal(\"can not open db\", err)\n\t}\n\n\thttp.ListenAndServe(\n\t\tfmt.Sprintf(\"%s:%d\", options.host, options.port),\n\t\tapi.Handler(\"/\", \"/static/\"),\n\t)\n}", "func StartWebserver() {\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n}", "func RunServer(host string, port int) {\n\thandleWebsocket()\n\thandlePublicFiles()\n\n\tlogger.Println(fmt.Sprintf(\"server started at http://:%d/\", port))\n\tlog.Fatal(http.ListenAndServe(fmt.Sprintf(\":%d\", port), nil))\n}", "func InitializeServer(host string) (server *network.WebServer) {\n\trand.Seed(time.Now().UTC().UnixNano())\n\t// Make sure folders exist that we want:\n\tif err := ensureBindDirs(); err != nil {\n\t\tLog.Error(\"Failed to have home working dir to put the files into at ~/Desktop/bind, err: \", err)\n\t} else {\n\t\tLog.Info(\"bind dirs ensured!\")\n\t}\n\tif os.Args[0] != \"d\" { //development mode\n\t\tgin.SetMode(gin.ReleaseMode)\n\t}\n\tr := gin.New()\n\tr.LoadHTMLGlob(\"public/tmpl/*.html\")\n\tr.StaticFS(\"/videos\", http.Dir(basePath+\"/videos\"))\n\tr.StaticFS(\"/frames\", http.Dir(basePath+\"/frames\"))\n\tr.Static(\"/public\", \"./public\")\n\tr.GET(\"/\", getIndex)\n\tr.POST(\"/g\", postIndex)\n\tr.GET(\"/g\", getIndex)\n\tr.GET(\"/about\", getAbout)\n\tr.GET(\"/jobs\", getJobs)\n\tr.GET(\"/code\", getCode)\n\tmel = melody.New() // melody middleware\n\n\t// websocket route\n\tr.GET(\"/ws\",func(ctx *gin.Context){\n\t\t// handle request with Melody\n\t\tmel.HandleRequest(ctx.Writer,ctx.Request)\n\t})\n\n\t// Melody message handler\n\tmel.HandleMessage(func(ses *melody.Session,msg []byte){\n\t\t// broadcast message to connected sockets\n\t\tmel.Broadcast(msg)\n\t})\n\n\n\tr.GET(\"/openframes\", func(c *gin.Context) {\n\t\topen.Run(basePath + \"/frames\")\n\t})\n\tr.GET(\"/openvideos\", func(c *gin.Context) {\n\t\topen.Run(basePath + \"/videos\")\n\t})\n\tr.GET(\"/openlogs\", func(c *gin.Context) {\n\t\topen.Run(basePath + \"/logs\")\n\t})\n\tr.GET(\"/toggleClipYt\", func(c *gin.Context) {\n\t\topen.Run(basePath + \"/logs\")\n\t})\n\t// go requests(mel)\n\t// go jobUpdates(mel)\n\n\treturn network.InitializeWebServer(r, host)\n}", "func startServer(jsonarticle interface{}) {\n\te := echo.New()\n\t// e.Use(livereload.LiveReload())\n\n\te.GET(\"/scrape\", func(f echo.Context) error {\n\t\treturn f.JSON(http.StatusOK, jsonarticle)\n\t})\n\n\te.Logger.Fatal(e.Start(\":5000\"))\n\n}", "func runServer() {\n\t// listen and serve on 0.0.0.0:8080 (for windows \"localhost:8080\")\n\tlog.Fatalln(router.Run(fmt.Sprintf(\":%s\", env.AppPort)))\n}", "func (server *Server) runServer() {\n\tserver.G.Go(func() error {\n\t\tserver.API.log.Info(\"running server %v\", server.config.Server.ListenAddr)\n\t\treturn http.ListenAndServe(server.config.Server.ListenAddr, server.Server.Handler)\n\t})\n}", "func (s *Server) StartServer() error {\n\tvar err error\n\ts.core, err = core.NewCore()\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.r = mux.NewRouter()\n\ts.r.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.ServeFile(w, r, \"web_files/test.html\")\n\t})\n\ts.r.HandleFunc(\"/home\", s.core.HomeHandler)\n\ts.r.HandleFunc(\"/register\", s.core.RegisterHandler)\n\ts.r.HandleFunc(\"/login\", s.core.LoginHandler)\n\ts.r.HandleFunc(\"/test\", s.core.TestHandler)\n\ts.r.HandleFunc(\"/key/new/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcore.NewKey(w, r, &s.state)\n\t})\n\ts.r.HandleFunc(\"/key/aes/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcore.ImportAESKey(w, r, &s.state)\n\t})\n\ts.r.HandleFunc(\"/off/1234\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Write([]byte(\"shutdown\"))\n\t\ts.degradation <- 0\n\t})\n\ts.r.HandleFunc(\"/hello\", notImplemented)\n\thttp.Handle(\"/\", s.r)\n\tlog.Fatal(http.ListenAndServe(s.core.Config.Server.Port, handlers.CORS(handlers.AllowedHeaders([]string{\"X-Requested-With\", \"Content-Type\", \"Authorization\"}), handlers.AllowedMethods([]string{\"GET\", \"POST\", \"PUT\", \"HEAD\", \"OPTIONS\"}), handlers.AllowedOrigins([]string{\"*\"}))(s.r)))\n\treturn nil\n}", "func StartServer() {\n\tif server == nil {\n\t\tGetInstance()\n\t}\n\n\tlog.Println(\"starting server on http://localhost\" + defaultPort)\n\tserver.Run(defaultPort)\n}", "func startServer(t *testing.T, server *http.Server) {\n\tgo func() {\n\t\terr := server.ListenAndServe()\n\t\tif !errors.Is(err, http.ErrServerClosed) {\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t}()\n}", "func StartServer(lc fx.Lifecycle, cfg infrastructure.Configuration, logger *zap.Logger, mux *mux.Router,\n\tgw ControllersGatewayFx) {\n\tprefix := NewVersioning(cfg)\n\trouteControllers(prefix, mux, gw)\n\tlogServer(cfg, logger, prefix)\n\tstartServer(lc, cfg, mux)\n}", "func (scu *SSH) ReloadHTTPServer() error {\n\tdefer scu.Client.Close()\n\tsession, err := scu.Client.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Reload the scu\n\tif err := session.Run(scu.Config.RestartCMD); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func startServer(port string, handler http.Handler) {\n\terr := http.ListenAndServe(port, handler)\n\tif err != nil {\n\t\tlogger.Fatal(\"ListenAndServe: \", err)\n\t}\n}", "func RunServer(configFile string) {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGTERM)\n\tserver, err := NewServer(configFile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Info(\"Gohan no jikan desuyo (It's time for dinner!)\")\n\tlog.Info(\"Build version: %s\", version.Build.Version)\n\tlog.Info(\"Build timestamp: %s\", version.Build.Timestamp)\n\tlog.Info(\"Build host: %s\", version.Build.Host)\n\tlog.Info(\"Starting Gohan Server...\")\n\taddress := server.address\n\tif strings.HasPrefix(address, \":\") {\n\t\taddress = \"localhost\" + address\n\t}\n\tprotocol := \"http\"\n\tif server.tls != nil {\n\t\tprotocol = \"https\"\n\t}\n\tlog.Info(\" API Server %s://%s/\", protocol, address)\n\tlog.Info(\" Web UI %s://%s/webui/\", protocol, address)\n\tgo func() {\n\t\tfor range c {\n\t\t\tlog.Info(\"Stopping the server...\")\n\t\t\tlog.Info(\"Tearing down...\")\n\t\t\tlog.Info(\"Stopping server...\")\n\t\t\tserver.Stop()\n\t\t}\n\t}()\n\tserver.running = true\n\tserver.masterCtx, server.masterCtxCancel = context.WithCancel(context.Background())\n\n\tserver.startSyncProcesses()\n\n\tstartCRONProcess(server)\n\tmetrics.StartMetricsProcess()\n\terr = server.Start()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "func (s *Server) Reload(paths []string) {\n\tcmd := cmdCSS\n\tfor _, path := range paths {\n\t\tif !strings.HasSuffix(path, \".css\") {\n\t\t\tcmd = cmdPage\n\t\t}\n\t}\n\ts.logger.SayAs(\"debug\", \"livereload %s, files changed: %s\", cmd, paths)\n\ts.broadcast <- cmd\n}", "func BlobServerStart() {\n\thttp.Handle(\n\t\t\"/b/\",\n\t\thttp.StripPrefix(\n\t\t\t\"/b/\",\n\t\t\thttp.FileServer(http.Dir(\"bin/blobs\")),\n\t\t),\n\t)\n\thttp.Handle(\n\t\t\"/t/\",\n\t\thttp.StripPrefix(\n\t\t\t\"/t/\",\n\t\t\thttp.FileServer(http.Dir(\"bin/tags\")),\n\t\t),\n\t)\n\thttp.Handle(\n\t\t\"/c/\",\n\t\thttp.StripPrefix(\"/c/\",\n\t\t\thttp.FileServer(http.Dir(\"bin/commits\")),\n\t\t),\n\t)\n\thttp.ListenAndServe(\":8080\", nil)\n\tfmt.Println(\"Listening on :8080\")\n}", "func StartServer(apiKey string) {\n\t// http.ListenAndServe(\":8080\", http.FileServer(http.Dir(\"./public\")))\n\tr := httprouter.New()\n\tr.GET(\"/\", HomeHandler)\n\tr.GET(\"/assets/css/:stylesheet\", CSSAssetHandler)\n\tr.GET(\"/assets/js/:script\", JSAssetHandler)\n\n\tapi.BootstrapAPI(&r, apiKey)\n\n\thttp.ListenAndServe(\":8080\", r)\n}", "func (s *Server) Serve() error {\n\tloadTemplate()\n\thttp.HandleFunc(\"/watch\", s.watchChanges)\n\thttp.HandleFunc(\"/\", s.home)\n\treturn http.ListenAndServe(\":5152\", nil)\n}", "func startServer(t testing.TB, h jsonrpc2.Handler) net.Listener {\n\tlistener, err := net.Listen(\"tcp\", bindAddr)\n\tif err != nil {\n\t\tt.Fatal(\"Listen:\", err)\n\t}\n\tgo func() {\n\t\tif err := serve(context.Background(), listener, h); err != nil && !strings.Contains(err.Error(), \"use of closed network connection\") {\n\t\t\tt.Fatal(\"jsonrpc2.Serve:\", err)\n\t\t}\n\t}()\n\treturn listener\n}", "func StartServer() {\n\tfmt.Println(\"Server is started at 8082\")\n\thttp.ListenAndServe(\":8082\", r)\n}", "func StartListening() {\n\thttp.HandleFunc(\"/health\", GenerateHandler(\"^/health$\", HealthHandler))\n\thttp.HandleFunc(\"/static/\", GenerateHandler(\"^/(static/(js/|css/|media/)[a-zA-Z0-9._]*)$\", FileHandler))\n\thttp.HandleFunc(\"/audits/\", GenerateHandler(\"^/(static/[a-zA-Z0-9._-]*)$\", FileHandler))\n\thttp.HandleFunc(\"/api/\", GenerateHandler(\"^/api/(get/(all|inventory|host))$\", APIHandler))\n\thttp.HandleFunc(\"/\", GenerateHandler(\"^/(.*)$\", FileHandler))\n\ta := fmt.Sprintf(\"%s:%s\", config.Host, config.Port)\n\tlogger.Infof(\"Start listening \\\"%s\\\"...\", a)\n\tlogger.Fatale(http.ListenAndServe(a, nil), \"Server crashed !\")\n}", "func StartServer(config configuration.Config) {\n\tConfig = config\n\n\tportStr := strconv.FormatInt(config.ServerPort, 10)\n\tserverAddrStr := config.ServerAddress + \":\" + portStr\n\thttp.HandleFunc(\"/webhook\", hookHandler)\n\n\tlog.Printf(\"Listening at %s for inncomming webhook\", serverAddrStr)\n\tlog.Fatal(http.ListenAndServe(serverAddrStr, nil))\n}", "func StartServer(config_path string) *HTMLServer {\n\n\tconfig.getConf(config_path)\n\n\tgo submitor.BuildImage(config.Marker.ImageName)\n\n\tvar i handlers.HandlerFunc\n\ti = &handlers.Handler{config.ServerConfig.TemplatePath, config.Marker, config.Labs}\n\n\tstore, rate := initalize_redis(&config.Redis)\n\tmiddleware := stdlib.NewMiddleware(limiter.New(*store, *rate))\n\n\trouter := mux.NewRouter()\n\n\trouter.Handle(\"/\", middleware.Handler(http.HandlerFunc(i.HandleIndex)))\n\trouter.HandleFunc(\"/upload\", i.Upload)\n\trouter.PathPrefix(\"/js/\").Handler(http.StripPrefix(\"/js/\", http.FileServer(http.Dir(\"./templates/js/\"))))\n\trouter.PathPrefix(\"/css/\").Handler(http.StripPrefix(\"/css/\", http.FileServer(http.Dir(\"./templates/css/\"))))\n\n\thtmlServer := HTMLServer{\n\t\tserver: &http.Server{\n\t\t\tAddr: config.ServerConfig.Host + \":\" + config.ServerConfig.ServerPort,\n\t\t\tHandler: router,\n\t\t\tReadTimeout: time.Second * time.Duration(config.ServerConfig.ReadTimeout),\n\t\t\tWriteTimeout: time.Second * time.Duration(config.ServerConfig.WriteTimeout),\n\t\t\tMaxHeaderBytes: 1 << 20,\n\t\t\t//ErrorLog: ,\n\t\t},\n\t}\n\n\thtmlServer.wg.Add(1)\n\n\tgo func() {\n\t\tlog.Info(\"HTMLServer : Service started : Host=\", config.ServerConfig.Host, \":\", config.ServerConfig.ServerPort)\n\t\terr := htmlServer.server.ListenAndServe()\n\t\tif err != nil {\n\t\t\tlog.Info(\"HTTP server failed to start \", err)\n\t\t}\n\t\thtmlServer.wg.Done()\n\t}()\n\n\treturn &htmlServer\n\n}", "func Serverstart() {\n\n\t//defer connection to database until all db operations are completed\n\tdefer dbmap.Db.Close()\n\trouter := Router()\n\trouter.Run(\":9000\")\n}", "func StartServer() {\n\t// Initialize\n\tinitialize()\n\n\t// Centralized middleware for error handling\n\tr := middleware.NewRecovery()\n\tm := middleware.With(http.HandlerFunc(omikujiHandler), r)\n\thttp.Handle(\"/omikuji\", m)\n\tif err := http.ListenAndServe(\":8080\", nil); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "func (s *Server) startDevServer() (cleanup func()) {\n\troot := gitRootDir()\n\twebClientPath := filepath.Join(root, \"client\", \"web\")\n\n\tyarn := filepath.Join(root, \"tool\", \"yarn\")\n\tnode := filepath.Join(root, \"tool\", \"node\")\n\tvite := filepath.Join(webClientPath, \"node_modules\", \".bin\", \"vite\")\n\n\tlog.Printf(\"installing JavaScript deps using %s... (might take ~30s)\", yarn)\n\tout, err := exec.Command(yarn, \"--non-interactive\", \"-s\", \"--cwd\", webClientPath, \"install\").CombinedOutput()\n\tif err != nil {\n\t\tlog.Fatalf(\"error running tailscale web's yarn install: %v, %s\", err, out)\n\t}\n\tlog.Printf(\"starting JavaScript dev server...\")\n\tcmd := exec.Command(node, vite)\n\tcmd.Dir = webClientPath\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\tif err := cmd.Start(); err != nil {\n\t\tlog.Fatalf(\"Starting JS dev server: %v\", err)\n\t}\n\tlog.Printf(\"JavaScript dev server running as pid %d\", cmd.Process.Pid)\n\treturn func() {\n\t\tcmd.Process.Signal(os.Interrupt)\n\t\terr := cmd.Wait()\n\t\tlog.Printf(\"JavaScript dev server exited: %v\", err)\n\t}\n}", "func (s *Server) starDebugServer() {\n\tglog.GLog.Infof(\"start debug server on %v\", s.conf.DebugServer)\n\tif err := http.ListenAndServe(s.conf.DebugServer, nil); err != nil {\n\t\tglog.GLog.Fatalln(err)\n\t}\n}", "func (ws *WebServer) Start() {\n\tlog.Logger.Info(\"Launching webserver\")\n\tlastRun := &run.Result{}\n\n\ttemplate, err := sysutil.CreateTemplate(serverTemplatePath)\n\tif err != nil {\n\t\tws.Errors <- err\n\t\treturn\n\t}\n\n\tm := mux.NewRouter()\n\taddStatusEndpoints(m)\n\tstatusPageHandler := &StatusPageHandler{\n\t\ttemplate,\n\t\tlastRun,\n\t\tws.Clock,\n\t}\n\thttp.Handle(\"/\", statusPageHandler)\n\tm.PathPrefix(\"/static/\").Handler(http.StripPrefix(\"/static/\", http.FileServer(http.Dir(\"/static\"))))\n\tforceRunHandler := &ForceRunHandler{\n\t\tws.RunQueue,\n\t}\n\tm.PathPrefix(\"/api/v1/forceRun\").Handler(forceRunHandler)\n\tm.PathPrefix(\"/\").Handler(statusPageHandler)\n\n\tgo func() {\n\t\tfor result := range ws.RunResults {\n\t\t\t*lastRun = result\n\t\t}\n\t}()\n\n\terr = http.ListenAndServe(fmt.Sprintf(\":%v\", ws.ListenPort), m)\n\tws.Errors <- err\n}", "func startServer() {\n\t// index file\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.Redirect(w, r, \"/static/\", http.StatusFound)\n\t}) //设置访问的路由\n\n\t// static file\n\thttp.HandleFunc(\"/static/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.ServeFile(w, r, r.URL.Path[1:])\n\t})\n\n\t// other logic handlers\n\thttp.HandleFunc(\"/rank\", rank)\n\thttp.HandleFunc(\"/top\", top)\n\t//\thttp.HandleFunc(\"/update\", update)\n\n\terr := http.ListenAndServe(\":9090\", nil) //设置监听的端口\n\tif err != nil {\n\t\tlog.Fatal(\"ListenAndServe: \", err)\n\t}\n}", "func initialiseServer() {\n\tport := \":8090\"\n\tlog.Printf(\"Starting HTTP server at http://localhost:%s\", port)\n\n\t// Attach request handlers\n\thttp.HandleFunc(\"/api/v1/vehicles\", liveDataRequestHandler)\n\thttp.HandleFunc(\"/health\", healthEndpoint)\n\thttp.HandleFunc(\"/\", healthEndpoint)\n\n\t// Start HTTP server\n\tlog.Fatal(http.ListenAndServe(port, nil))\n}", "func StartServer(flightsDB *flightsdb.FlightsDB) {\n\tdb = flightsDB\n\tapp := fiber.New()\n\tapp.Settings.ErrorHandler = ErrorHandler\n\tAddMiddleware(app)\n\tAddRoutes(app)\n\tapp.Listen(8080)\n}", "func startWsServer(listen_addr string) {\n\t//hub = newHub()\n\tgo hub.Run()\n\n\t//http.HandleFunc(\"/\", cmdHandler)\n\thttp.HandleFunc(\"/upgrade\", func(w http.ResponseWriter, r *http.Request) {\n\t\tserveWs(hub, w, r)\n\t})\n\terr := http.ListenAndServe(listen_addr, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not listen to %s: %s\", listen_addr, err)\n\t}\n}", "func (s *Refresh) StartBackgroundRefresh() {\n\tgo s.FindServerStateAdded()\n}", "func updServer() {\n\t// starts a udp listener (connection) on port \"udpPort\"\n\t// remember connections are resources and need to be closed (aka 'freed') if opened ;)\n\t// use a \"for loop\" to continuously \"handle\" incoming messages (i.e use \"handleMessage\")\n\t// if there's an error when starting server, log.Fatal ;)\n}", "func (srv *Server) StartServer() {\n\thttp.HandleFunc(\"/\", srv.rpcHandler)\n\tlog.Fatal(http.ListenAndServe(srv.addr, nil))\n}", "func (s *Server) OnStart(ctx context.Context) error { s.run(ctx); return nil }", "func StartServer(tlsCertFile, tlsKeyFile string) error {\n\tlogger := &log.Std{Debug: true}\n\n\tmutator := mutating.MutatorFunc(sidecarInjectMutator)\n\n\tconfig := mutating.WebhookConfig{\n\t\tName: \"fluentdSidecarInjector\",\n\t\tObj: &corev1.Pod{},\n\t}\n\twebhook, err := mutating.NewWebhook(config, mutator, nil, nil, logger)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create webhook: %s\", err)\n\t}\n\n\thandler, err := webhookhttp.HandlerFor(webhook)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create webhook handler: %s\", err)\n\t}\n\n\tlogger.Infof(\"Listing on :8080\")\n\terr = http.ListenAndServeTLS(\":8080\", tlsCertFile, tlsKeyFile, handler)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to start server: %s\", err)\n\t}\n\n\treturn nil\n\n}", "func (m *MetaNode) startServer() (err error) {\n\t// initialize and start the server.\n\tm.httpStopC = make(chan uint8)\n\tln, err := net.Listen(\"tcp\", \":\"+m.listen)\n\tif err != nil {\n\t\treturn\n\t}\n\tgo func(stopC chan uint8) {\n\t\tdefer ln.Close()\n\t\tfor {\n\t\t\tconn, err := ln.Accept()\n\t\t\tselect {\n\t\t\tcase <-stopC:\n\t\t\t\treturn\n\t\t\tdefault:\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo m.serveConn(conn, stopC)\n\t\t}\n\t}(m.httpStopC)\n\tlog.LogInfof(\"start server over...\")\n\treturn\n}", "func RunServer() {\n\tserverMutex.Lock()\n\tdefer serverMutex.Unlock()\n\tif serverStarted {\n\t\treturn\n\t}\n\n\terr := initialiseServer()\n\tif err != nil {\n\t\tlog.Panicln(\"server:\", err)\n\t}\n\tlog.Println(\"server: Server starting at\", config.Address)\n\tserverStarted = true\n\tgo func() {\n\t\terr = server.ListenAndServe()\n\t\tif err != http.ErrServerClosed {\n\t\t\tlog.Println(\"server:\", err)\n\t\t}\n\t}()\n}", "func StartServer() {\n\thandlePesquisa()\n\n\tlog.Info.Println(\"WebServer started...\")\n\thttp.ListenAndServe(\":8080\", httpLogger.WriteLog(http.DefaultServeMux, os.Stdout))\n}", "func StartServer() {\n\tvar wait time.Duration\n\tflag.DurationVar(&wait, \"graceful-timeout\", time.Second*15, \"the duration for which the server gracefully wait for existing connections to finish - e.g. 15s or 1m\")\n\tflag.Parse()\n\n\tr := mux.NewRouter()\n\troutes.RegisterRouter(r)\n\t//check db before staring web\n\tdb.STRG.Migrator()\n\tport := os.Getenv(\"PORT\")\n\taddress := \":\" + port\n\tsrv := &http.Server{\n\t\tAddr: address,\n\t\tWriteTimeout: time.Second * 15,\n\t\tReadTimeout: time.Second * 15,\n\t\tIdleTimeout: time.Second * 60,\n\t\tHandler: r, // Pass our instance of gorilla/mux in.\n\t}\n\n\tfmt.Println(\"Starting Server\")\n\tgo func() {\n\t\tif err := srv.ListenAndServe(); err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t}()\n\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, os.Interrupt)\n\t<-c\n\tctx, cancel := context.WithTimeout(context.Background(), wait)\n\tdefer cancel()\n\tsrv.Shutdown(ctx)\n\tlog.Println(\"shutting down\")\n\tos.Exit(0)\n}", "func startServerMode() {\n\t// Create or open log directory\n\tf, err := os.OpenFile(WORKDIR+`/server.log`, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tl(err.Error(), true, true)\n\t}\n\tdefer f.Close()\n\tlog.SetOutput(f)\n\tl(\"Starting server...\", false, true)\n\tvar listener net.Listener\n\tif appConfig.Tls {\n\t\tcert, err := tls.LoadX509KeyPair(WORKDIR+\"/cert.pem\", WORKDIR+\"/key.pem\")\n\t\tcheckErr(\"Unable to import TLS certificates\", err, true)\n\t\tconfig := tls.Config{Certificates: []tls.Certificate{cert}}\n\t\tnow := time.Now()\n\t\tconfig.Time = func() time.Time { return now }\n\t\tconfig.Rand = rand.Reader\n\t\tlistener, err = tls.Listen(\"tcp\", appConfig.Server.Address+\":\"+appConfig.Server.Port, &config)\n\t\tcheckErr(\"Unable to create TLS listener\", err, false)\n\t} else {\n\t\tvar err error\n\t\tlistener, err = net.Listen(\"tcp\", appConfig.Server.Address+\":\"+appConfig.Server.Port)\n\t\tcheckErr(\"Unable to create listener\", err, true)\n\t}\n\tgo server.start()\n\tif len(appConfig.Api.Port) > 0 {\n\t\tgo startHttpServer()\n\t}\n\tfor {\n\t\tconnection, err := listener.Accept()\n\t\tcheckErr(\"Unable to accept incoming connection\", err, true)\n\t\tclient := &Client{socket: connection, data: make(chan Job)}\n\t\tserver.register <- client\n\t\tgo server.receive(client)\n\t\tgo server.send(client)\n\t}\n}", "func (server *Server) Start() {\n\tmux := http.NewServeMux()\n\n\tfileServer := server.attachStaticFileServer(mux)\n\tserver.attachSystemJSRewriteHandler(mux)\n\tserver.attachCustomHandlers(mux)\n\n\tif server.hub != nil {\n\t\t// add HMR support\n\t\tserver.attachIndexInjectionListener(mux, fileServer)\n\t\tserver.attachWebSocketListeners(mux, server.hub)\n\t\tgo server.hub.run()\n\t}\n\n\tserver.srv = &http.Server{\n\t\tAddr: makeServerAddress(server.port),\n\t\tHandler: mux,\n\t}\n\n\tif err := server.srv.ListenAndServe(); err != nil {\n\t\tpanic(err)\n\t}\n}", "func RunServer() {\n\tgo func() {\n\t\tcounter := 5\n\t\tfor CurrentServer == nil {\n\t\t\tutils.Sugar.Warn(\"Server was not created waiting for a one second\")\n\t\t\ttime.Sleep(1 * time.Second)\n\t\t\tcounter = counter - 1\n\t\t\tif counter <= 0 {\n\t\t\t\tutils.Sugar.Error(\"Server was not created in time\")\n\t\t\t\tstopChan <- syscall.SIGINT\n\t\t\t}\n\t\t}\n\n\t\trunning = true\n\t\terr := CurrentServer.ListenAndServe()\n\t\tif err != nil {\n\t\t\tif err == http.ErrServerClosed {\n\t\t\t\tutils.Sugar.Info(\"Server was closed\")\n\t\t\t} else {\n\t\t\t\tutils.Sugar.Error(\"Error while running server: \", err)\n\t\t\t}\n\t\t}\n\t\trunning = false\n\t}()\n\tutils.Sugar.Info(\"Server started\")\n}", "func RunServer() {\n\tapp := applicationContext{\n\t\tconfig: config.LoadConfig(),\n\t\ttrackerLevel: RATIOLESS,\n\t}\n\n\tmux := http.NewServeMux()\n\n\tmux.HandleFunc(\"/announce\", app.requestHandler)\n\tmux.HandleFunc(\"/scrape\", scrapeHandler)\n\thttp.ListenAndServe(\":3000\", mux)\n}", "func (s *TodoServer) StartServer() error {\n\treturn s.httpServer.ListenAndServe()\n}", "func startServer(socketPath string) error {\n\tlogrus.Debugf(\"Starting server...\")\n\n\tif config.path == \"\" {\n\t\tpath, err := os.MkdirTemp(\"\", \"test_volume_plugin\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"getting directory for plugin: %w\", err)\n\t\t}\n\t\tconfig.path = path\n\t} else {\n\t\tpathStat, err := os.Stat(config.path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to access requested plugin state directory: %w\", err)\n\t\t}\n\t\tif !pathStat.IsDir() {\n\t\t\treturn fmt.Errorf(\"cannot use %v as plugin state dir as it is not a directory\", config.path)\n\t\t}\n\t}\n\n\thandle := makeDirDriver(config.path)\n\tlogrus.Infof(\"Using %s for volume path\", config.path)\n\n\tserver := volume.NewHandler(handle)\n\tif err := server.ServeUnix(socketPath, 0); err != nil {\n\t\treturn fmt.Errorf(\"starting server: %w\", err)\n\t}\n\treturn nil\n}", "func RunServer(server *ophttp.Server) {\n\thttp.Handle(\"/greeting\", http.HandlerFunc(GreetingHandler))\n\tserver.Start()\n}", "func (w *Webserver) Start() error {\n\n\t// listenAndServe the server\n\tgo func() {\n\t\tw.logger.Infof(\"Http server listening at %d!\", w.config.Port)\n\t\terr := w.listenAndServe()\n\t\tif err != nil && err != http.ErrServerClosed {\n\t\t\tw.logger.Errorw(fmt.Sprintf(\"webserver listening at port [%v] stopped\", w.config.Port), \"error\", err.Error())\n\t\t}\n\t}()\n\n\treturn nil\n}", "func StartServer(router *mux.Router) error {\n\trouter.Handle(\"/ws\", websocket.Handler(socketHandler))\n\treturn nil\n}", "func StartWebServer(pubSub *pubsub.PubSub) {\n\t// setup web server\n\te := echo.New()\n\te.HideBanner = true\n\te.Use(middleware.Logger())\n\n\t// disable CORS on the web server if desired\n\tdisableCORS = viper.GetBool(\"server_settings.disablecors\")\n\tif disableCORS {\n\t\tlogger.Warn(\"Running in disabled CORS mode. This is very dangerous! Be careful!\")\n\t\te.Use(middleware.CORSWithConfig(middleware.CORSConfig{\n\t\t\tAllowOrigins: []string{\"*\"},\n\t\t\tAllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept},\n\t\t}))\n\t}\n\n\tc, _ := handlers.NewContainer()\n\n\t// GetLogstationName - Get Logstation Name\n\te.GET(\"/settings/logstation-name\", c.GetLogstationName)\n\n\t// GetSettingsSyntax - Get Syntax Colors\n\te.GET(\"/settings/syntax\", c.GetSettingsSyntax)\n\n\t// package up the built web files and serve them to the clients\n\tfsys, err := fs.Sub(webServerFiles, \"web/dist\")\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"error loading the web files into the server. error msg: %s\", err))\n\t}\n\tfileHandler := http.FileServer(http.FS(fsys))\n\te.GET(\"/*\", echo.WrapHandler(fileHandler))\n\n\t// pass message broker channel into websocket handler\n\twsHandlerChan := func(c echo.Context) error {\n\t\treturn WebSocketHandler(c, pubSub)\n\t}\n\te.GET(\"/ws\", wsHandlerChan)\n\n\t// start the web server\n\te.Logger.Fatal(e.Start(viper.GetString(\"server_settings.webserveraddress\") + \":\" + viper.GetString(\"server_settings.webserverport\")))\n}", "func startServer(wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\n\tlistener, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%d\", MyHandle.Host, MyHandle.Port))\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to startServer: %v\", err)\n\t}\n\n\tgrpcServer := grpc.NewServer()\n\tapi.RegisterGoChatServer(grpcServer, &chatServer{})\n\n\terr = grpcServer.Serve(listener)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t}\n}", "func (a *Api) serveLiveStatic(res http.ResponseWriter, req *http.Request) {\n\tdata, err := ioutil.ReadFile(\"livecrowdin.html\")\n\tif err != nil {\n\t\tlog.Printf(\"templates - failure to read index.html\")\n\t}\n\tres.Header().Set(\"content-type\", \"text/html\")\n\tres.WriteHeader(200)\n\tres.Write(data)\n\treturn\n}", "func main() {\n\twebserver.ServerStart()\n\twebserver.ServerRequest()\n}", "func startHTTPListener() {\n\thttp.ListenAndServe(\":\"+GetConfig().Port, nil)\n}", "func StartServer(s *server.ScrapeServer) {\n\thttp.HandleFunc(\"/\", s.Handle())\n\thttp.ListenAndServe(\":8080\", nil)\n}", "func (s *Subscriber) StartHTTPServer() error {\n\treturn s.server.ListenAndServe()\n}", "func (h *Server) Run() {\n\n\th.g.StartServer()\n}", "func Start() {\n\twebServer.Engine.Run(\":\" + strconv.Itoa(cfg.Read().App.WebServerPort))\n}", "func (app App) StartServer() {\n\tr := mux.NewRouter().StrictSlash(false)\n\tr.HandleFunc(\"/top/{location}\", app.topContributorsHandler)\n\tr.NotFoundHandler = http.HandlerFunc(usage)\n\tsrv := &http.Server{\n\t\tHandler: r,\n\t\tAddr: app.listenAddr,\n\t\tWriteTimeout: 60 * time.Second,\n\t\tReadTimeout: 60 * time.Second,\n\t}\n\tlogrus.Fatal(srv.ListenAndServe())\n}", "func startServer() error {\n\n\tc, err := config()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// checking if a router is defined\n\tif cfgRouter == nil {\n\t\treturn ErrNoRouterConfig\n\t}\n\n\t// HTTPS Server\n\tcfgServer := http.Server{}\n\tcfgServer.Addr = fmt.Sprint(\":\", c.Server.HTTPPort)\n\n\t//TODO write own cors middleware\n\tcorsManager := cors.New(cors.Options{\n\t\tAllowCredentials: true,\n\t\tAllowedOrigins: []string{\"http://localhost:8080\"},\n\t\tAllowedMethods: []string{\"GET\", \"POST\", \"PUT\", \"DELETE\"},\n\t\tAllowedHeaders: []string{\"Authorization\", \"Origin\", \"Cache-Control\", \"Accept\", \"Content-Type\", \"X-Requested-With\"},\n\t\tDebug: true,\n\t})\n\n\t//\tcfgRouter.Handler()\n\tcfgServer.Handler = corsManager.Handler(cfgRouter.Handler())\n\t//cfgServer.Handler = cfgRouter.Handler()\n\n\terr = cfgServer.ListenAndServe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer cfgServer.Close()\n\n\treturn nil\n}", "func startHTTPServer(ch chan<- bool) {\n\tserver := http.Server{\n\t\tAddr: \":80\",\n\t}\n\tlog.Println(\"HTTP server started (listening on port 80).\")\n\tlog.Println(\"HTTP server stopped with error:\", server.ListenAndServe())\n\tch <- true\n}", "func main() {\n\tserver.StartUp(false)\n}", "func StartServer(port int) {\n\thttp.Handle(\"/\", http.FileServer(http.Dir(\"./static\")))\n\terr := http.ListenAndServe(fmt.Sprintf(\":%v\", port), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "func StartHttpServer(srv *http.Server) error {\n\thttp.HandleFunc(\"/new\", newServer)\n\terr := srv.ListenAndServe()\n\treturn err\n}", "func (rst *REST) LiveMessage(w http.ResponseWriter, r *http.Request) {\n\thttp.ServeFile(w, r, \"live.html\")\n}", "func startServer(dataSlice []string) {\n\te := echo.New()\n\n\te.GET(\"/\", func(f echo.Context) error {\n\t\treturn f.JSON(http.StatusOK, dataSlice)\n\t})\n\n\tfmt.Println(\"Server running: http://localhost:8000\")\n\te.Logger.Fatal(e.Start(\":8000\"))\n}", "func StartAPIServer(rfs *fs.RootFileSystem) {\n\tfilesys = rfs\n\thttp.Handle(\"/\", APIHandler{})\n\tserveString := fmt.Sprintf(\":%d\", config.PORT)\n\tfmt.Printf(\"Serving on %s\\n\", serveString)\n\thttp.ListenAndServe(serveString, nil)\n}", "func StartServer() error {\n\tlistenPort := flag.Int(\"listen-port\", 3000, \"REST API server listen port\")\n\tlistenIP := flag.String(\"listen-address\", \"0.0.0.0\", \"REST API server listen ip address\")\n\tgeolitedb := flag.String(\"geolite2-db\", \"\", \"Geolite mmdb database file. If not defined, localization info based on IP will be disabled\")\n\tgeocitystatedb := flag.String(\"city-state-db\", \"\", \"City->State database file in CSV format 'country-code,city,state'. If defined, input '_ip_state' will be calculated according to '_ip_city'.\")\n\tlogLevel := flag.String(\"log-level\", \"info\", \"debug, info, warning or error\")\n\tflag.Parse()\n\n\tswitch *logLevel {\n\tcase \"debug\":\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t\tbreak\n\tcase \"warning\":\n\t\tlogrus.SetLevel(logrus.WarnLevel)\n\t\tbreak\n\tcase \"error\":\n\t\tlogrus.SetLevel(logrus.ErrorLevel)\n\t\tbreak\n\tdefault:\n\t\tlogrus.SetLevel(logrus.InfoLevel)\n\t}\n\n\tprometheus.MustRegister(rulesProcessingHist)\n\tprometheus.MustRegister(groupRuleCount)\n\n\tgf := *geolitedb\n\tif gf == \"\" {\n\t\tlogrus.Infof(\"Geolite database file not found. Localization capabilities based on IP will be disabled\")\n\t} else {\n\t\tlogrus.Debugf(\"Loading GeoIP2 database %s\", gf)\n\t\tgdb, err := geoip2.Open(gf)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgeodb = gdb\n\t\tdefer geodb.Close()\n\t\tlogrus.Infof(\"GeoIP2 database loaded\")\n\n\t\tcs := *geocitystatedb\n\t\tif cs == \"\" {\n\t\t\tlogrus.Infof(\"City State csv file not defined. _ip_state input won't be available\")\n\t\t} else {\n\t\t\tlogrus.Debugf(\"Loading City State CSV file %s\", cs)\n\t\t\tcsvFile, err := os.Open(cs)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treader := csv.NewReader(bufio.NewReader(csvFile))\n\t\t\tfor {\n\t\t\t\tline, err := reader.Read()\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak\n\t\t\t\t} else if err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcountry := strings.ToLower(line[0])\n\t\t\t\tcity := strings.ToLower(line[1])\n\t\t\t\tstate := line[2]\n\t\t\t\tcm, exists := cityState[country]\n\t\t\t\tif !exists {\n\t\t\t\t\tcm = make(map[string]string)\n\t\t\t\t\tcityState[country] = cm\n\t\t\t\t}\n\t\t\t\tcm[city] = state\n\t\t\t}\n\t\t\tlogrus.Infof(\"City State CSV loaded\")\n\t\t}\n\t}\n\n\trouter := mux.NewRouter()\n\trouter.HandleFunc(\"/rules/{groupName}\", handleRuleGroup).Methods(\"POST\")\n\trouter.Handle(\"/metrics\", promhttp.Handler())\n\tlisten := fmt.Sprintf(\"%s:%d\", *listenIP, *listenPort)\n\tlogrus.Infof(\"Listening at %s\", listen)\n\terr := http.ListenAndServe(listen, router)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (c *Config) Start() error {\n\t//c.mux = http.NewServeMux()\n\ts := newServer(c)\n\ts.indexTemplate = template.Must(template.ParseFiles(c.indexTemplatePath))\n\ts.callTemplate = template.Must(template.New(\"callDetails.html\").Funcs(template.FuncMap{\n\t\t\"displaySendCounts\": func(cd []counts.CommDataT, leadRank int, callID int) string {\n\t\t\tfor _, data := range cd {\n\t\t\t\tif data.LeadRank == leadRank {\n\t\t\t\t\treturn strings.Join(cd[leadRank].CallData[callID].SendData.RawCounts, \"<br />\")\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"Call not found\"\n\t\t},\n\t\t\"displayRecvCounts\": func(cd []counts.CommDataT, leadRank int, callID int) string {\n\t\t\tfor _, data := range cd {\n\t\t\t\tif data.LeadRank == leadRank {\n\t\t\t\t\treturn strings.Join(cd[leadRank].CallData[callID].RecvData.RawCounts, \"<br />\")\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"Call not found\"\n\t\t},\n\t\t\"displayCallPlot\": func(leadRank int, callID int) string {\n\t\t\treturn fmt.Sprintf(\"profiler_rank%d_call%d.png\", leadRank, callID)\n\t\t}}).ParseFiles(c.callTemplatePath))\n\ts.callsTemplate = template.Must(template.ParseFiles(c.callsTemplatePath))\n\ts.patternsTemplate = template.Must(template.ParseFiles(c.patternsTemplatePath))\n\ts.heatmapTemplate = template.Must(template.New(\"heatmapDetails.html\").Funcs(template.FuncMap{\n\t\t\"displayHeatmap\": func(patternID int) string {\n\t\t\treturn fmt.Sprintf(\"%d_task3.png\", patternID)\n\t\t}}).ParseFiles(c.heatmapTemplatePath))\n\ts.heatmapsTemplate = template.Must(template.ParseFiles(c.heatmapsTemplatePath))\n\ts.stopTemplate = template.Must(template.ParseFiles(c.stopTemplatePath))\n\n\tc.srv = &http.Server{\n\t\tAddr: fmt.Sprintf(\":%d\", c.Port),\n\t\tHandler: s,\n\t}\n\n\tgo func(c *Config) {\n\t\tdefer c.wg.Done()\n\t\tc.srv.ListenAndServe()\n\t\tfmt.Println(\"HTTP server is now terminated\")\n\t}(c)\n\n\treturn nil\n}", "func (s *Server) Start() {\n\tif s.URL != \"\" {\n\t\tpanic(\"Server already started\")\n\t}\n\ts.URL = s.Listener.Addr().String()\n\ts.goServe()\n\tif *serve != \"\" {\n\t\tfmt.Fprintln(os.Stderr, \"grpctest: serving on\", s.URL) // nolint: gas\n\t\tselect {}\n\t}\n}", "func main() {\n\tservice.StartWebServer(\"8081\")\n}", "func startLocalServer() {\n\tsURL, err := config.LocalServerIP()\n\tif err != nil {\n\t\tfmt.Println(xerrors.InternalError)\n\t\tlogrus.Fatalf(\"retrieving internal server IP: %v\", err)\n\t}\n\terr = server.Serve(sURL)\n\tif err != nil {\n\t\tfmt.Println(xerrors.InternalError)\n\t\tlogrus.Fatalf(\"starting local server: %v\", err)\n\t}\n}", "func StartHTTPServer() chan struct{} {\n\thttpDone := make(chan struct{}, 1)\n\tgo func() {\n\t\tcfg := struct {\n\t\t\tHTTPListenPort string `mapstructure:\"httpListenPort\"`\n\t\t}{}\n\t\tapplyConfig(\"\", &cfg)\n\n\t\tloginfof(\"Starting http listen server on :%s\", cfg.HTTPListenPort)\n\t\tif err := http.ListenAndServe(\":\"+cfg.HTTPListenPort, nil); err != nil {\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\thttpDone <- struct{}{}\n\t}()\n\treturn httpDone\n}", "func StartServer() {\n\tr := gin.Default()\n\n\tcorsCfg := cors.DefaultConfig()\n\tcorsCfg.AllowOrigins = []string{\"http://localhost:1234\"}\n\tr.Use(cors.New(corsCfg))\n\n\tapi := r.Group(\"/api\")\n\t{\n\t\tapi.Any(\"/graphql\", graphQL)\n\t\tapi.GET(\"/players\", players)\n\t\tapi.GET(\"/player_datas\", playerDatas)\n\t}\n\n\tport := os.Getenv(\"PORT\")\n\tif len(port) == 0 {\n\t\tport = \"8080\"\n\t}\n\tr.Run(fmt.Sprintf(\":%s\", port))\n}", "func (srv *Server) Serve() (err error) {\n\tsrv.state = StateRunning\n\tdefer func() { srv.state = StateTerminate }()\n\n\t// 主动重启导致的错误为ErrReloadClose\n\tif err = srv.serve(); err != nil && err != ErrReloadClose {\n\t\tlog.Println(syscall.Getpid(), \"Server.Serve() error:\", err)\n\t\treturn err\n\t}\n\n\tlog.Println(syscall.Getpid(), srv.ln.Addr(), \"Listener closed.\")\n\t// wait for Shutdown to return\n\treturn <-srv.terminalChan\n}", "func (m *manager) start() error {\n\tw := newWatcher(m)\n\tw.start()\n\n\tgo m.test(fsnotify.Event{Name: \":start:\"})\n\n\t// watch files\n\tgo func() {\n\t\tlogrus.Info(\"watching files...\")\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase event := <-w.Events:\n\t\t\t\tif event.Op != fsnotify.Chmod {\n\t\t\t\t\tgo m.test(event)\n\t\t\t\t}\n\t\t\t\tw.Remove(event.Name)\n\t\t\t\tw.Add(event.Name)\n\t\t\tcase <-m.context.Done():\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase err := <-w.Errors:\n\t\t\t\tlogrus.Error(err)\n\t\t\tcase <-m.context.Done():\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}()\n\n\tfor {\n\t\t_, err := os.Stat(\"test-coverage/index.html\")\n\t\tif err != nil {\n\t\t\ttime.Sleep(1 * time.Second)\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\texec.Command(\"live-server\", \"test-coverage\").Run()\n\treturn nil\n}", "func (c *Client) run() error {\n\tsignal.Notify(c.sigkil, os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP)\n\tc.setReloadSignals()\n\n\tif c.newCon {\n\t\t_, _ = c.Config.Write(c.Flags.ConfigFile)\n\t\t_ = ui.OpenFile(c.Flags.ConfigFile)\n\t\t_, _ = ui.Warning(Title, \"A new configuration file was created @ \"+\n\t\t\tc.Flags.ConfigFile+\" - it should open in a text editor. \"+\n\t\t\t\"Please edit the file and reload this application using the tray menu.\")\n\t}\n\n\tif c.Config.AutoUpdate != \"\" {\n\t\tgo c.AutoWatchUpdate()\n\t}\n\n\tswitch ui.HasGUI() {\n\tcase true:\n\t\tc.startTray() // This starts the web server.\n\t\treturn nil // startTray() calls os.Exit()\n\tdefault:\n\t\tc.StartWebServer()\n\t\treturn c.Exit()\n\t}\n}", "func StartServer(fn func (conn net.Conn)) {\n\tlistener, err := net.Listen(\"tcp\", \"localhost:8081\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor {\n\t\tconn, err := listener.Accept()\n\t\tif err != nil {\n\t\t\tlog.Print(err) // For ex.: connection failed\n\t\t\tcontinue\n\t\t}\n\t\tgo fn(conn)\n\t}\n}", "func (l *LanguageServer) Start() error {\n\thttp.HandleFunc(\"/v1/statements\", l.statementHandler)\n\thttp.HandleFunc(\"/v1/inspect\", l.inspectHandler)\n\thttp.HandleFunc(\"/v1/notes\", l.notesPageHandler)\n\thttp.HandleFunc(\"/v1/pianoroll\", l.pianorollImageHandler)\n\thttp.HandleFunc(\"/version\", l.versionHandler)\n\treturn http.ListenAndServe(l.address, nil)\n}", "func ServerStart(port string) (string, error) {\n\n\t// List of view handlers\n\thandlerStrings = append(handlerStrings, \"/\", \"/blockchain/view/<ID>\", \"/garage/view/<ID>\", \"serviceevent/add/\", \"/vehicle/view/<ID>\")\n\n\thttp.HandleFunc(\"/\", defaultHandler) // Each call to \"/\" will invoke defaultHandler\n\thttp.HandleFunc(\"/blockchain/view/\", blockchainViewHandler)\n\thttp.HandleFunc(\"/garage/view/\", garageViewHandler)\n\thttp.HandleFunc(\"/serviceevent/add/\", writeServiceEventHandler)\n\thttp.HandleFunc(\"/vehicle/view/\", vehicleViewHandler)\n\n\t//log.Fatal(http.ListenAndServe(\"localhost:\"+port, nil))\n\treturn \"Started on: \" + port, http.ListenAndServe(\"localhost:\"+port, nil)\n\n}", "func (app *App) StartServer() {\n\t// Try connect to mongoDB\n\tapp.db = &mdb.Database{MongoURL: app.MongoURL, DBName: app.DBName}\n\tapp.db.CreateConnection()\n\tfmt.Println(\"Connected to mongoDB\")\n\n\t// Create handlers\n\tapp.infoHandler = NewInfoHandler()\n\tapp.trackHandler = track.NewTrackHandler(app.db)\n\tapp.tickerHandler = ticker.NewTickerHandler(app.TickerLimit, app.db)\n\tapp.webhookHandler = webhook.NewWebhookHandler(app.db)\n\tapp.adminHandler = admin.NewAdminHandler(app.db)\n\n\t// Registers a callback so that when a new track is registered, the webhook handler will check\n\t// if any webhooks should be triggered\n\tapp.trackHandler.SetTrackRegisterCallback(app.webhookHandler.CheckInvokeWebhooks)\n\n\t// Instantiate router, and configure the handlers and paths\n\tr := router.NewRouter()\n\tapp.configureRoutes(r)\n\tapp.configureValidators(r)\n\n\t// Start listen\n\tfmt.Printf(\"Server listening on port %s\\n\", app.ListenPort)\n\tif err := http.ListenAndServe(\":\"+app.ListenPort, r); err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n}", "func (ws *WebServer) Start() error {\n\tif ws.server != nil {\n\t\treturn fmt.Errorf(\"WebServer already running\")\n\t}\n\n\tlog.Logger(\"webserver\").Info(\"Launching\")\n\n\ttemplatePath := ws.TemplatePath\n\tif templatePath == \"\" {\n\t\ttemplatePath = defaultServerTemplatePath\n\t}\n\ttemplate, err := createTemplate(templatePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tm := mux.NewRouter()\n\taddStatusEndpoints(m)\n\tstatusPageHandler := &StatusPageHandler{\n\t\tws.Authenticator,\n\t\tws.Clock,\n\t\tws.DiffURLFormat,\n\t\tws.KubeClient,\n\t\ttemplate,\n\t\tws.StatusTimeout,\n\t}\n\tforceRunHandler := &ForceRunHandler{\n\t\tws.Authenticator,\n\t\tws.KubeClient,\n\t\tws.RunQueue,\n\t}\n\tm.PathPrefix(\"/static/\").Handler(http.StripPrefix(\"/static/\", http.FileServer(http.Dir(\"static\"))))\n\tm.PathPrefix(\"/api/v1/forceRun\").Handler(forceRunHandler)\n\tm.PathPrefix(\"/\").Handler(statusPageHandler)\n\n\tws.server = &http.Server{\n\t\tAddr: fmt.Sprintf(\":%v\", ws.ListenPort),\n\t\tHandler: m,\n\t\tErrorLog: log.Logger(\"http.Server\").StandardLogger(nil),\n\t}\n\n\tgo func() {\n\t\tif err = ws.server.ListenAndServe(); err != nil {\n\t\t\tif !errors.Is(err, http.ErrServerClosed) {\n\t\t\t\tlog.Logger(\"webserver\").Error(\"Shutdown\", \"error\", err)\n\t\t\t}\n\t\t\tlog.Logger(\"webserver\").Info(\"Shutdown\")\n\t\t}\n\t}()\n\n\treturn nil\n}", "func (config Config) RunHTTPServer() {\n\t// Set up a channel to listen to for interrupt signals\n\tvar runChan = make(chan os.Signal, 1)\n\n\t// Set up a context to allow for graceful server shutdowns in the event\n\t// of an OS interrupt (defers the cancel just in case)\n\tctx, cancel := context.WithTimeout(\n\t\tcontext.Background(),\n\t\tconfig.PilotLight.Server.Timeout.Server,\n\t)\n\tdefer cancel()\n\n\t// Create install-config.yaml file\n\tPreflightSetup(config)\n\n\t// Define server options\n\tserver := &http.Server{\n\t\tAddr: config.PilotLight.Server.Host + \":\" + config.PilotLight.Server.Port,\n\t\tHandler: NewRouter(config.PilotLight.Server.Path),\n\t\tReadTimeout: config.PilotLight.Server.Timeout.Read * time.Second,\n\t\tWriteTimeout: config.PilotLight.Server.Timeout.Write * time.Second,\n\t\tIdleTimeout: config.PilotLight.Server.Timeout.Idle * time.Second,\n\t}\n\n\t// Only listen on IPV4\n\tl, err := net.Listen(\"tcp4\", config.PilotLight.Server.Host+\":\"+config.PilotLight.Server.Port)\n\tcheck(err)\n\n\t// Handle ctrl+c/ctrl+x interrupt\n\tsignal.Notify(runChan, os.Interrupt, syscall.SIGTSTP)\n\n\t// Alert the user that the server is starting\n\tlog.Printf(\"Server is starting on %s\\n\", server.Addr)\n\n\t// Run the server on a new goroutine\n\tgo func() {\n\t\t//if err := server.ListenAndServe(); err != nil {\n\t\tif err := server.Serve(l); err != nil {\n\t\t\tif err == http.ErrServerClosed {\n\t\t\t\t// Normal interrupt operation, ignore\n\t\t\t} else {\n\t\t\t\tlog.Fatalf(\"Server failed to start due to err: %v\", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Block on this channel listeninf for those previously defined syscalls assign\n\t// to variable so we can let the user know why the server is shutting down\n\tinterrupt := <-runChan\n\n\t// If we get one of the pre-prescribed syscalls, gracefully terminate the server\n\t// while alerting the user\n\tlog.Printf(\"Server is shutting down due to %+v\\n\", interrupt)\n\tif err := server.Shutdown(ctx); err != nil {\n\t\tlog.Fatalf(\"Server was unable to gracefully shutdown due to err: %+v\", err)\n\t}\n}", "func (c *Carnegie) Start() error {\n\tif c.Started {\n\t\treturn nil\n\t}\n\tc.Started = true\n\tgo c.updateCacheLoop()\n\tif certFile, keyFile := c.Config.GetString(\"cert\"), c.Config.GetString(\"key\"); certFile != \"\" && keyFile != \"\" {\n\t\tgo c.Server.ListenAndServeTLS(certFile, keyFile)\n\t}\n\treturn c.Server.ListenAndServe()\n}", "func Run() {\n\tlog.Println(\"Starting simple webserver.\")\n\thttp.HandleFunc(\"/Packagename2Id\", createHandler(cache.C.Packagename2Id))\n\thttp.HandleFunc(\"/Id2Packagename\", createHandler(cache.C.Id2Packagename))\n\thttp.HandleFunc(\"/Updates\", createHandler(cache.C.Updates))\n\thttp.HandleFunc(\"/UpdatesIndex\", createHandler(cache.C.UpdatesIndex))\n\thttp.HandleFunc(\"/Evr2Id\", createHandler(cache.C.Evr2Id))\n\thttp.HandleFunc(\"/Id2Evr\", createHandler(cache.C.Id2Evr))\n\thttp.HandleFunc(\"/Id2Arch\", createHandler(cache.C.Id2Arch))\n\thttp.HandleFunc(\"/Arch2Id\", createHandler(cache.C.Arch2Id))\n\thttp.HandleFunc(\"/ArchCompat\", createHandler(cache.C.ArchCompat))\n\thttp.HandleFunc(\"/PackageDetails\", createHandler(cache.C.PackageDetails))\n\thttp.HandleFunc(\"/Nevra2PkgId\", createHandler(cache.C.Nevra2PkgId))\n\thttp.HandleFunc(\"/RepoDetails\", createHandler(cache.C.RepoDetails))\n\thttp.HandleFunc(\"/RepoLabel2Ids\", createHandler(cache.C.RepoLabel2Ids))\n\thttp.HandleFunc(\"/ProductId2RepoIds\", createHandler(cache.C.ProductId2RepoIds))\n\thttp.HandleFunc(\"/PkgId2RepoIds\", createHandler(cache.C.PkgId2RepoIds))\n\thttp.HandleFunc(\"/ErrataId2Name\", createHandler(cache.C.ErrataId2Name))\n\thttp.HandleFunc(\"/PkgId2ErrataIds\", createHandler(cache.C.PkgId2ErrataIds))\n\thttp.HandleFunc(\"/ErrataId2RepoIds\", createHandler(cache.C.ErrataId2RepoIds))\n\thttp.HandleFunc(\"/CveDetail\", createHandler(cache.C.CveDetail))\n\thttp.HandleFunc(\"/PkgErrata2Module\", createHandler(cache.C.PkgErrata2Module))\n\thttp.HandleFunc(\"/ModuleName2Ids\", createHandler(cache.C.ModuleName2Ids))\n\thttp.HandleFunc(\"/DbChange\", createHandler(cache.C.DbChange))\n\thttp.HandleFunc(\"/ErrataDetail\", createHandler(cache.C.ErrataDetail))\n\thttp.HandleFunc(\"/SrcPkgId2PkgId\", createHandler(cache.C.SrcPkgId2PkgId))\n\thttp.HandleFunc(\"/String\", createHandler(cache.C.String))\n\n\thttp.HandleFunc(\"/gc\", func(w http.ResponseWriter, r *http.Request) {\n\t\truntime.GC()\n\t\tw.WriteHeader(http.StatusOK)\n\t\tutils.PrintMemUsage()\n\t\treturn\n\t})\n\n err := http.ListenAndServe(\":8080\", nil)\n if err != nil {\n \tprint(err)\n\t}\n}", "func (app *App) Listen(serverURL string) {\n\terr := app.htmlTemplates.parseFolder(app.settings.ViewsPath, app.settings.ViewExtension)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thttp.ListenAndServe(serverURL, app.craterRequestHandler)\n}", "func startHTTPServer(app *AppContext) *http.Server {\n\n\tsrv := &http.Server{\n\t\tAddr: \":\" + app.configFile.loggerPort,\n\t\tReadTimeout: 10 * time.Second,\n\t\tWriteTimeout: 10 * time.Second,\n\t}\n\tgo func() {\n\t\tif err := srv.ListenAndServe(); err != nil {\n\t\t\tlog.Debugf(\"Httpserver: ListenAndServe(): %s\", err)\n\t\t}\n\t}()\n\tlog.Debugf(\"HTTP Server started, listening on :%s\", app.configFile.loggerPort)\n\treturn srv // returning reference so caller can call Shutdown()\n}", "func StartServer(cleanUpChan chan int){\n\tGrpcServer = &Server{\n CleanUpChan:cleanUpChan ,\n\t GrpcServer: grpc.NewServer(),\n\t}\n\tregisterGrpcServices(GrpcServer.GrpcServer)\n\tif err := GrpcServer.GrpcServer.Serve(getListner(port)); err != nil {\n\t\tpanic(err)\n\t}\n}", "func (s *Server) Start() {\n\tlog.Println(\"Starting webhook receiver on port 8080...\")\n\terr := http.ListenAndServe(\":8080\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"Couldn't start server: %s\", err)\n\t}\n}", "func (r *RuntimeServer) Start(errchan chan error) {\n\tgo func() {\n\t\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%d\", r.conf.HostIP, r.conf.ServerPort))\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"failed to listen: %v\", err)\n\t\t\terrchan <- err\n\t\t}\n\t\tif err := r.server.Serve(lis); err != nil {\n\t\t\terrchan <- err\n\t\t}\n\t}()\n\tif err := r.registServer(); err != nil {\n\t\terrchan <- err\n\t}\n\tlogrus.Infof(\"runtime server start success\")\n}", "func (f *Frontend) Start() error {\n\n\tlistenAddr := fmt.Sprintf(\"%s:%d\", f.cfg.Host, f.cfg.Port)\n\toriginalListener, err := net.Listen(\"tcp\", listenAddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsl, err := stoppableListener.New(originalListener)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tserver := http.Server{Handler: context.ClearHandler(f.router)}\n\n\tstop := make(chan os.Signal)\n\tsignal.Notify(stop, syscall.SIGINT)\n\tvar wg sync.WaitGroup\n\tgo func() {\n\t\twg.Add(1)\n\t\tdefer wg.Done()\n\t\tserver.Serve(sl)\n\t}()\n\n\tf.log.Println(\"Start serving HTTP requests at \", listenAddr)\n\tselect {\n\tcase signal := <-stop:\n\t\tf.log.Println(\"Got signal: \", signal)\n\t}\n\tf.log.Println(\"Stopping listener\")\n\tsl.Stop()\n\tf.log.Println(\"Waiting on server\")\n\twg.Wait()\n\n\treturn nil\n}", "func StartServer(port int) {\n\twsHandler := clientWebsocketHandler{upgrader: defaultUpgrader}\n\n\trouter := mux.NewRouter()\n\trouter.Handle(\"/client_ws\", wsHandler)\n\trouter.Handle(\"/d/{downloadId}\", downloadHandler{})\n\n\taddr := fmt.Sprintf(\":%d\", port)\n\thttp.ListenAndServe(addr, router)\n}", "func (pv *SCFilePV) StartHTTPServer() error {\n\tpv.Logger.Info(\"Starting HTTP server...\")\n\n\tvar errCh chan error\n\tgo func() {\n\t\thttp.HandleFunc(\"/status\", pv.statusHandler)\n\t\tif err := pv.HTTP.ListenAndServe(); err != nil {\n\t\t\terrCh <- err\n\t\t}\n\t}()\n\tselect {\n\tcase <-time.After(100 * time.Millisecond):\n\t\treturn nil\n\tcase err := <-errCh:\n\t\treturn err\n\t}\n}", "func (s *server) Run() error {\n\ts.logger.Info(\"starting http server\", logger.String(\"addr\", s.server.Addr))\n\ts.server.Handler = s.gin\n\t// Open listener.\n\ttrackedListener, err := conntrack.NewTrackedListener(\"tcp\", s.addr, s.r)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.server.Serve(trackedListener)\n}", "func main() {\n\thttp.ListenAndServe(\"127.0.0.1:8080\", NewServer())\n}", "func (s *Serverus) StartServerus() {\n\tif err := s.server.Serve(s.lis); err != nil {\n\t\tlog.Fatalf(\"Failed to serve %v\", err)\n\t}\n}", "func runServer(port string, router http.Handler) error {\n\tfmt.Printf(\"Running on localhost:%v\\n\", port)\n\n\terr := http.ListenAndServe(\":\"+port, router)\n\n\tif err.Error() == usedPortError(port) {\n\t\tfmt.Printf(\"Port %v is busy\\n\\n\", port)\n\t\tnewPort, err := prompNewPort()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Println(newPort)\n\t\treturn runServer(strings.TrimSpace(newPort), router)\n\t}\n\treturn err\n}", "func Start(addr string) {\n\tf = NewServer()\n\thttp.HandleFunc(\"/bayeux\", serveWs)\n\thttp.HandleFunc(\"/\", serveOther)\n\n\t// serve static assets workaround\n\t//http.Handle(\"/file/\", http.StripPrefix(\"/file\", http.FileServer(http.Dir(\"/Users/paul/go/src/github.com/pcrawfor/fayego/runner\"))))\n\n\terr := http.ListenAndServe(addr, nil)\n\tif err != nil {\n\t\tfmt.Println(\"Fatal error \", err.Error())\n\t\tos.Exit(1)\n\t}\n}" ]
[ "0.5976077", "0.59226185", "0.5880268", "0.5784931", "0.57804745", "0.57739013", "0.5734538", "0.5710085", "0.56784874", "0.5660749", "0.562987", "0.56220937", "0.56210876", "0.56204873", "0.56059647", "0.56023747", "0.5602115", "0.5571002", "0.5558408", "0.5542132", "0.55389893", "0.5533808", "0.5518656", "0.5488205", "0.5484353", "0.5467971", "0.54656345", "0.5464551", "0.546174", "0.5454712", "0.5435035", "0.54329604", "0.5431742", "0.5427014", "0.5426542", "0.54217637", "0.5415198", "0.54083836", "0.5403654", "0.54011774", "0.53963375", "0.5390292", "0.5380227", "0.5379064", "0.53735596", "0.5371406", "0.5369213", "0.53616536", "0.5358877", "0.53588283", "0.5330198", "0.5328178", "0.5321187", "0.53206825", "0.53082514", "0.53029734", "0.5302901", "0.529721", "0.5296831", "0.52943873", "0.5291389", "0.5290783", "0.5287163", "0.52847207", "0.52718574", "0.52714187", "0.5264927", "0.52637124", "0.5255944", "0.5245638", "0.5245539", "0.5232582", "0.52199286", "0.5216387", "0.5207527", "0.5203551", "0.51947796", "0.51898867", "0.518394", "0.5180755", "0.51771706", "0.5176168", "0.5174184", "0.51673675", "0.5161645", "0.51605994", "0.51597947", "0.5154374", "0.5152881", "0.5151321", "0.51500946", "0.51471764", "0.5144946", "0.51380163", "0.5135193", "0.51342005", "0.5128733", "0.512656", "0.5124723", "0.51168406" ]
0.85250896
0
CreateFooterView creates a footer area for the application
CreateFooterView создает область подвала для приложения
func CreateFooterView(g *gocui.Gui) error { viewName := "footer" if footer, err := g.SetView(viewName, maxX/6+1, maxY-maxY/4, maxX-1, maxY-1); err != nil { if err != gocui.ErrUnknownView { return err } footer.Wrap = true footer.Title = "Top HeadLines" footer.SelBgColor = gocui.ColorGreen footer.SelFgColor = gocui.ColorRed fmt.Fprintln(footer, Country, Source, Category) } views = append(views, viewName) return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tui *TUI) drawFooter() {\n\tmin := int(tui.trackDuration.Minutes())\n\tsecs := int(tui.trackDuration.Seconds()) % 60\n\tvar title string\n\tif tui.currentTrack != nil {\n\t\ttitle = tui.currentTrack.Title\n\t}\n\ttui.footer.Clear()\n\tfmt.Fprintf(tui.footer, \"%02d:%02d / %s\", min, secs, title)\n\ttui.app.Draw()\n}", "func (cc conciergeCat) viewFooter() string {\n\treturn termenv.String(\"\\n ↑/↓: Navigate • q: Quit\\n\").Foreground(term.Color(\"241\")).String()\n}", "func footer() (*template.Template, error) {\n\ttpl := `<footer class=\"pt-2 border-top\">\n <div class=\"d-flex justify-content-center\">\n <h5><small class=\"text-muted\">&copy; 2018-%d The Soteria DAG developers</small></h5>\n </div>\n</footer>`\n\n\tt := template.New(\"footer\")\n\treturn t.Parse(fmt.Sprintf(tpl, time.Now().Year()))\n}", "func drawFooter(s tcell.Screen, content string) {\n\tcontent = \"FLShell v2.0 | Image File: \" + *imagepath + \" | \" + content\n\tcolourRow(s, footerStyle, windowHeight-1)\n\tputln(s, footerStyle, content, windowHeight-1)\n}", "func (b *Bill) makeFooter() func() {\n\treturn func() {\n\t\tb.pdf.Ln(10)\n\t\tb.darkDrawColor()\n\t\tb.pdf.Line(8, 280, 200, 280)\n\t\tb.pdf.SetXY(8.0, 285)\n\t\tb.darkText()\n\t\tb.pdf.Cell(143, 0, b.config.Business.Name)\n\t\tb.lightText()\n\t\tb.pdf.Cell(40, 0, \"Generated: \"+time.Now().UTC().Format(\"2006-01-02 15:04:05\"))\n\t}\n}", "func AddFooter(page *onthefly.Page, footerText, footerTextColor, footerColor string, elapsed time.Duration) (*onthefly.Tag, error) {\n\tbody, err := page.GetTag(\"body\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdiv := body.AddNewTag(\"div\")\n\tdiv.AddAttrib(\"id\", \"notice\")\n\tdiv.AddStyle(\"position\", \"fixed\")\n\tdiv.AddStyle(\"bottom\", \"0\")\n\tdiv.AddStyle(\"left\", \"0\")\n\tdiv.AddStyle(\"width\", \"100%\")\n\tdiv.AddStyle(\"display\", \"block\")\n\tdiv.AddStyle(\"padding\", \"0\")\n\tdiv.AddStyle(\"margin\", \"0\")\n\tdiv.AddStyle(\"background-color\", footerColor)\n\tdiv.AddStyle(\"font-size\", \"0.6em\")\n\tdiv.AddStyle(\"text-align\", \"right\")\n\tdiv.AddStyle(\"box-shadow\", \"1px -2px 3px rgba(0,0,0, .5)\")\n\n\tinnerdiv := div.AddNewTag(\"div\")\n\tinnerdiv.AddAttrib(\"id\", \"innernotice\")\n\tinnerdiv.AddStyle(\"padding\", \"0 2em 0 0\")\n\tinnerdiv.AddStyle(\"margin\", \"0\")\n\tinnerdiv.AddStyle(\"color\", footerTextColor)\n\tinnerdiv.AddContent(\"Generated in \" + elapsed.String() + \" | \" + footerText)\n\n\treturn div, nil\n}", "func Footer_(children ...HTML) HTML {\n return Footer(nil, children...)\n}", "func (r *txtRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) {}", "func Footer(attrs []htmlgo.Attribute, children ...HTML) HTML {\n\treturn &htmlgo.Tree{Tag: \"footer\", Attributes: attrs, Children: children}\n}", "func (r *roffRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) {\n}", "func (r *ChromaRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) {}", "func ToolbarFooter(append ...bool) vecty.Markup {\n\treturn AddClass(toolbarFooter, append...)\n}", "func (v Binary) Footer(cursor, width int, baseStyle lipgloss.Style) string {\n\treturn baseStyle.Render(fmt.Sprintf(\"%d / %d bytes (%d bytes per row)\", cursor*dataWidth(width), v.size, dataWidth(width)))\n}", "func Footer() string {\n\treturn \"```\\n\\n</details>\"\n}", "func (s Spec) FooterLocation() panel.Point {\n\treturn panel.Point{X: s.Width() / 2, Y: s.MountingHoleBottomY()}\n}", "func (dao *blockDAO) Footer(h hash.Hash256) (*block.Footer, error) {\n\treturn dao.footer(h)\n}", "func (f *DynamicDiskBlockFactory) GetFooterRange() *common.IndexRange {\n\treturn common.NewIndexRangeFromLength(f.GetBlockCount()*f.GetBlockSize(), vhdcore.VhdFooterSize)\n}", "func printLogbookFooter(pdf *gofpdf.Fpdf, logbookOwner string, totalPage logbookTotalRecord, totalPrevious logbookTotalRecord, totalTime logbookTotalRecord) {\n\n\tprintTotal := func(totalName string, total logbookTotalRecord) {\n\t\tpdf.SetFillColor(217, 217, 217)\n\t\tpdf.SetFont(\"LiberationSansNarrow-Bold\", \"\", 8)\n\n\t\tpdf.SetX(leftMargin)\n\n\t\tif totalName == \"TOTAL THIS PAGE\" {\n\t\t\tpdf.CellFormat(w4[0], footerRowHeight, \"\", \"LTR\", 0, \"\", true, 0, \"\")\n\t\t} else if totalName == \"TOTAL FROM PREVIOUS PAGES\" {\n\t\t\tpdf.CellFormat(w4[0], footerRowHeight, \"\", \"LR\", 0, \"\", true, 0, \"\")\n\t\t} else {\n\t\t\tpdf.CellFormat(w4[0], footerRowHeight, \"\", \"LBR\", 0, \"\", true, 0, \"\")\n\t\t}\n\t\tpdf.CellFormat(w4[1], footerRowHeight, totalName, \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[2], footerRowHeight, total.time.se.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[3], footerRowHeight, total.time.me.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[4], footerRowHeight, total.time.mcc.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[5], footerRowHeight, total.time.total.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[6], footerRowHeight, \"\", \"1\", 0, \"\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[7], footerRowHeight, fmt.Sprintf(\"%d\", total.landings.day), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[8], footerRowHeight, fmt.Sprintf(\"%d\", total.landings.night), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[9], footerRowHeight, total.time.night.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[10], footerRowHeight, total.time.ifr.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[11], footerRowHeight, total.time.pic.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[12], footerRowHeight, total.time.copilot.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[13], footerRowHeight, total.time.dual.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[14], footerRowHeight, total.time.instructor.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[15], footerRowHeight, \"\", \"1\", 0, \"\", true, 0, \"\")\n\t\tpdf.CellFormat(w4[16], footerRowHeight, total.sim.time.GetTime(true), \"1\", 0, \"C\", true, 0, \"\")\n\n\t\tpdf.SetFont(\"LiberationSansNarrow-Regular\", \"\", 6)\n\t\tif totalName == \"TOTAL THIS PAGE\" {\n\t\t\tpdf.CellFormat(w4[17], footerRowHeight, \"I certify that the entries in this log are true.\", \"LTR\", 0, \"C\", true, 0, \"\")\n\t\t} else if totalName == \"TOTAL FROM PREVIOUS PAGES\" {\n\t\t\tpdf.CellFormat(w4[17], footerRowHeight, \"\", \"LR\", 0, \"\", true, 0, \"\")\n\t\t} else {\n\t\t\tpdf.CellFormat(w4[17], footerRowHeight, logbookOwner, \"LBR\", 0, \"C\", true, 0, \"\")\n\t\t}\n\n\t\tpdf.Ln(-1)\n\t}\n\n\tprintTotal(\"TOTAL THIS PAGE\", totalPage)\n\tprintTotal(\"TOTAL FROM PREVIOUS PAGES\", totalPrevious)\n\tprintTotal(\"TOTAL TIME\", totalTime)\n\n}", "func footer_handler() string {\n\ttpl, err := gtpl.Open(\"templates/overall.html\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn \"\"\n\t}\n\n\ttpl.Parse(\"footer\")\n\treturn tpl.Out()\n}", "func showTodosFooter() {\n\tdoc.QuerySelector(\"#footer\").SetAttribute(\"style\", \"display: block;\")\n}", "func ExamplePdfMaroto_RegisterFooter() {\n\t// For register footer you need to call method RegisterFooter\n\t// that receives a closure.\n\t// In this closure you are free to set any components you want to compose\n\t// your footer.\n\t// In this example there is a signature and a text with right align.\n\t// It is important to remember that it is recommended to create Row's and\n\t// Col's if necessary.\n\t// You have to register the footer immediately after the Maroto\n\t// All footers will be rendered at the bottom of all pages\n\n\tm := pdf.NewMaroto(consts.Portrait, consts.A4)\n\n\tm.RegisterFooter(func() {\n\t\tm.Row(10, func() {\n\t\t\tm.Col(6, func() {\n\t\t\t\tm.Signature(\"lorem ipsum dolor\")\n\t\t\t})\n\t\t\tm.Col(6, func() {\n\t\t\t\tm.Text(time.Now().Format(\"02-January-2006\"), props.Text{Align: consts.Right})\n\t\t\t})\n\t\t})\n\t})\n\n\t// Do more things or not and save...\n}", "func SerializeFooter(footer *Footer) []byte {\n\tbuffer := make([]byte, vhdcore.VhdFooterSize)\n\twriter := writer.NewVhdWriterFromByteSlice(buffer)\n\n\twriter.WriteBytes(0, footer.Cookie.Data)\n\twriter.WriteUInt32(8, uint32(footer.Features))\n\twriter.WriteUInt32(12, uint32(footer.FileFormatVersion))\n\twriter.WriteInt64(16, footer.HeaderOffset)\n\twriter.WriteTimeStamp(24, footer.TimeStamp)\n\tcreatorApp := make([]byte, 4)\n\tcopy(creatorApp, footer.CreatorApplication)\n\twriter.WriteBytes(28, creatorApp)\n\twriter.WriteUInt32(32, uint32(footer.CreatorVersion))\n\twriter.WriteUInt32(36, uint32(footer.CreatorHostOsType))\n\twriter.WriteInt64(40, footer.PhysicalSize)\n\twriter.WriteInt64(48, footer.VirtualSize)\n\t// + DiskGeometry\n\twriter.WriteUInt16(56, footer.DiskGeometry.Cylinder)\n\twriter.WriteByte(58, footer.DiskGeometry.Heads)\n\twriter.WriteByte(59, footer.DiskGeometry.Sectors)\n\t// - DiskGeometry\n\twriter.WriteUInt32(60, uint32(footer.DiskType))\n\twriter.WriteBytes(68, footer.UniqueID.ToByteSlice())\n\twriter.WriteBoolean(84, footer.SavedState)\n\twriter.WriteBytes(85, footer.Reserved)\n\t// + Checksum\n\t//\n\t// Checksum is one’s complement of the sum of all the bytes in the footer without the\n\t// checksum field.\n\tcheckSum := uint32(0)\n\tfor i := int(0); i < int(vhdcore.VhdFooterSize); i++ {\n\t\tif i < vhdcore.VhdFooterChecksumOffset || i >= vhdcore.VhdFooterChecksumOffset+4 {\n\t\t\tcheckSum += uint32(buffer[i])\n\t\t}\n\t}\n\n\twriter.WriteUInt32(64, ^checkSum)\n\t// - Checksum\n\n\treturn buffer\n}", "func PrintFooter() {\n\tfmt.Println(\"***********************************************\")\n}", "func FooterProperty(fk FooterKey) Option {\n\treturn func(p *PasetoMiddleware) {\n\t\tp.FooterProperty = fk\n\t}\n}", "func putfooter(w io.Writer, r *http.Request) {\n\ttFooter.Execute(w, nil)\n}", "func recordFooter() error {\n\treturn recordMessage(session.Kind_FOOTER, &session.Entry{\n\t\tKind: session.Kind_FOOTER,\n\t\tMsg: &session.Entry_Footer{\n\t\t\tFooter: &session.Footer{},\n\t\t},\n\t})\n}", "func testFooter(t *testing.T) {\n\tlogging.Info(fmt.Sprintf(\"=============== Ending test [%s] ===============\", t.Name()))\n}", "func (footer Footer) Render() vdom.VNode {\n\tif len(footer.Todos) < 1 {\n\t\treturn nil\n\t}\n\titemsLeft := 0\n\tfor _, todo := range footer.Todos {\n\t\tif !todo.Completed {\n\t\t\titemsLeft++\n\t\t}\n\t}\n\titemsLeftText := \" items left\"\n\tif itemsLeft == 1 {\n\t\titemsLeftText = \" item left\"\n\t}\n\treturn &vdom.VElement{\n\t\tTagName: \"footer\",\n\t\tProps: map[string]interface{}{\n\t\t\t\"className\": \"footer\",\n\t\t},\n\t\tChildren: []vdom.VNode{\n\t\t\t&vdom.VElement{\n\t\t\t\tTagName: \"span\",\n\t\t\t\tProps: map[string]interface{}{\n\t\t\t\t\t\"className\": \"todo-count\",\n\t\t\t\t},\n\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t&vdom.VElement{\n\t\t\t\t\t\tTagName: \"strong\",\n\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\tvdom.VText(strconv.Itoa(itemsLeft)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tvdom.VText(itemsLeftText),\n\t\t\t\t},\n\t\t\t},\n\t\t\t&vdom.VElement{\n\t\t\t\tTagName: \"ul\",\n\t\t\t\tProps: map[string]interface{}{\n\t\t\t\t\t\"className\": \"filters\",\n\t\t\t\t},\n\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t&vdom.VElement{\n\t\t\t\t\t\tTagName: \"li\",\n\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\t&vdom.VElement{\n\t\t\t\t\t\t\t\tTagName: \"a\",\n\t\t\t\t\t\t\t\tProps: map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"href\": \"\",\n\t\t\t\t\t\t\t\t\t\"className\": footer.getFilterClasses(\"\"),\n\t\t\t\t\t\t\t\t\t\"onclick\": footer.changeFilter,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\t\t\tvdom.VText(\"All\"),\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\t&vdom.VElement{\n\t\t\t\t\t\tTagName: \"li\",\n\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\t&vdom.VElement{\n\t\t\t\t\t\t\t\tTagName: \"a\",\n\t\t\t\t\t\t\t\tProps: map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"href\": \"active\",\n\t\t\t\t\t\t\t\t\t\"className\": footer.getFilterClasses(\"active\"),\n\t\t\t\t\t\t\t\t\t\"onclick\": footer.changeFilter,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\t\t\tvdom.VText(\"Active\"),\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\t&vdom.VElement{\n\t\t\t\t\t\tTagName: \"li\",\n\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\t&vdom.VElement{\n\t\t\t\t\t\t\t\tTagName: \"a\",\n\t\t\t\t\t\t\t\tProps: map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"href\": \"completed\",\n\t\t\t\t\t\t\t\t\t\"className\": footer.getFilterClasses(\"completed\"),\n\t\t\t\t\t\t\t\t\t\"onclick\": footer.changeFilter,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\t\t\t\t\tvdom.VText(\"Completed\"),\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\t&vdom.VElement{\n\t\t\t\tTagName: \"button\",\n\t\t\t\tProps: map[string]interface{}{\n\t\t\t\t\t\"className\": \"clear-completed\",\n\t\t\t\t\t\"onclick\": footer.clearCompleted,\n\t\t\t\t},\n\t\t\t\tChildren: []vdom.VNode{\n\t\t\t\t\tvdom.VText(\"Clear completed\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func newFooterTest(t *testing.T) {\n\n\tresult := newFooter(1, 15, 1, 1).List\n\texpected := []string{\"1\", \"2\", \"...\", \"15\"}\n\tfor i := 0; i < len(expected); i++ {\n\t\tif result[i] != expected[i] {\n\t\t\tt.Error()\n\t\t}\n\t}\n\n}", "func (s *BasePlSqlParserListener) ExitCreate_view(ctx *Create_viewContext) {}", "func (f *Footer) Close() error {\n\tf.DecRef()\n\treturn nil\n}", "func Tfoot_(children ...HTML) HTML {\n return Tfoot(nil, children...)\n}", "func CreateVoucherLedgerAmountView(db *sql.DB) {\n\n\tcreateVoucherLedgerAmountViewStr := `\n\tCREATE VIEW voucher_ledger_amount AS\n\tSELECT \n\t\tvla.'Account Code'\n\t\t,vla.'Account Free'\n\t\t,SUM(vla.Amount) 'Amount'\n\tFROM\n\t(SELECT \n\t\t62002 'Account Code'\n\t\t,NULL 'Account Free'\n\t\t,ipc_final.voucher 'Amount'\n\tFROM ipc_final\n\tUNION ALL\n\tSELECT \n\t\t62002 'Account Code'\n\t\t,NULL 'Account Free'\n\t\t,ipt_final.voucher 'Amount'\n\tFROM ipt_final) vla\n\tGROUP BY vla.'Account Code', vla.'Account Free'\n\t`\n\n\tcreateVoucherLedgerAmountView, err := db.Prepare(createVoucherLedgerAmountViewStr)\n\tcheckError(err)\n\tcreateVoucherLedgerAmountView.Exec()\n\n}", "func FprintFooter(file *os.File) {\n\tfmt.Fprintf(file,\n\t\t\"%s\\n\\n\"+\n\t\t\t\"</body>\\n\"+\n\t\t\t\"</html>\\n\",\n\t\tFooter)\n}", "func CreateIptPaidPriceLedgerAmountView(db *sql.DB) {\n\n\tcreateIptPaidPriceLedgerAmountViewStr := `\n\tCREATE VIEW ipt_paid_price_ledger_amount AS\n\tSELECT \n\t\tipt_final.ledger 'Account Code'\n\t\t,ipt_final.subledger 'Account Free'\n\t\t,ipt_final.paid_price 'Amount'\n\tFROM ipt_final\n\tWHERE ipt_final.ledger IN(` + ledgerBookedAtSubledgerLevel + `)\n\tGROUP BY ipt_final.ledger, ipt_final.subledger\n\t`\n\n\tcreateIptPaidPriceLedgerAmountView, err := db.Prepare(createIptPaidPriceLedgerAmountViewStr)\n\tcheckError(err)\n\tcreateIptPaidPriceLedgerAmountView.Exec()\n\n}", "func (t *trs80) writeFooter() {\n\tf := t.pb.Footer\n\tt.writeIntLn(f.Version)\n\tt.writeIntLn(f.Adventure)\n\tt.writeIntLn(f.Magic)\n}", "func CreateIpcPaidPriceLedgerAmountView(db *sql.DB) {\n\n\tcreateIpcPaidPriceLedgerAmountViewStr := `\n\tCREATE VIEW ipc_paid_price_ledger_amount AS\n\tSELECT \n\t\tipc_final.ledger 'Account Code'\n\t\t,ipc_final.subledger 'Account Free'\n\t\t,ipc_final.paid_price 'Amount'\n\tFROM ipc_final\n\tWHERE ipc_final.ledger IN(` + ledgerBookedAtSubledgerLevel + `)\n\tGROUP BY ipc_final.ledger, ipc_final.subledger\n\t`\n\n\tcreateIpcPaidPriceLedgerAmountView, err := db.Prepare(createIpcPaidPriceLedgerAmountViewStr)\n\tcheckError(err)\n\tcreateIpcPaidPriceLedgerAmountView.Exec()\n\n}", "func Tfoot(attrs []htmlgo.Attribute, children ...HTML) HTML {\n\treturn &htmlgo.Tree{Tag: \"tfoot\", Attributes: attrs, Children: children}\n}", "func WriteHTMLPageFooter(w io.Writer) {\n\tif err := footerTemplate.Execute(w, nil); err != nil {\n\t\tlog.Printf(\"zpages: executing template: %v\", err)\n\t}\n}", "func CreateCommissionVatLedgerAmountView(db *sql.DB) {\n\n\tcreateCommissionVatLedgerAmountViewStr := `\n\tCREATE VIEW commission_vat_ledger_amount AS\n\tSELECT \n\tcf.'Account Code'\n\t,cf.'Account Free'\n\t,SUM(cf.Amount) 'Amount'\n\tFROM \n\t(SELECT \n\t\t32021 'Account Code'\n\t\t,NULL 'Account Free'\n\t\t,commission_final.commission_vat 'Amount'\n\tFROM commission_final) cf\n\tGROUP BY cf.'Account Code', cf.'Account Free'\n\t`\n\n\tcreateCommissionVatLedgerAmountView, err := db.Prepare(createCommissionVatLedgerAmountViewStr)\n\tcheckError(err)\n\tcreateCommissionVatLedgerAmountView.Exec()\n\n}", "func (fd *FileDecryptionProperties) FooterKey() string { return fd.footerKey }", "func (fe *FileEncryptionProperties) FooterKey() string { return fe.footerKey }", "func CreateTotalLedgerAmountView(db *sql.DB) {\n\n\t// ipc_paid_price_ledger_amount: in R, no filter is used here...\n\t// which makes me think filtering by ledgerBookedAtSubledgerLevel is useless in the original ipc_paid_price_ledger_amount...\n\t// yes, I think in R it is only useful for the commission booking which is bullshit and you changed here so now no need of filter probably\n\tcreateTotalLedgerAmountViewStr := `\n\tCREATE VIEW total_ledger_amount AS\n\tSELECT \n\ttotal.'Account Code'\n\t,total.'Account Free'\n\t,SUM(total.Amount*-1) 'Amount' -- (-1) because total + sum of amounts should = 0\n\n\tFROM (\n\n\t-- ipc_voucher_ledger_amount\n\tSELECT\n\t\t31002 'Account Code'\n\t\t,ipc_final.beneficiary_code 'Account Free'\n\t\t,ipc_final.voucher 'Amount'\n\tFROM ipc_final\n\n\tUNION ALL\n\n\t-- ipt_voucher_ledger_amount\n\tSELECT \n\t\t31002 'Account Code'\n\t\t,ipt_final.beneficiary_code 'Account Free'\n\t\t,ipt_final.voucher 'Amount'\n\tFROM ipt_final\n\n\tUNION ALL\n\n\t-- ipc_paid_price_ledger_amount\n\tSELECT \n\t\t31002 'Account Code'\n\t\t,ipc_final.beneficiary_code 'Account Free'\n\t\t,ipc_final.paid_price 'Amount'\n\tFROM ipc_final\n\n\tUNION ALL\n\n\t-- ipt_paid_price_ledger_amount\n\tSELECT \n\t\t31002 'Account Code'\n\t\t,ipt_final.beneficiary_code 'Account Free'\n\t\t,ipt_final.paid_price 'Amount'\n\tFROM ipt_final\n\n\tUNION ALL\n\n\t-- commission_vat_ledger_amount\n\tSELECT \n\t\t31002 'Account Code'\n\t\t,commission_final.beneficiary_code 'Account Free'\n\t\t,commission_final.commission_vat 'Amount'\n\tFROM commission_final\n\n\tUNION ALL\n\n\t-- commission_revenue_ledger_amount\n\tSELECT \n\t\t31002 'Account Code'\n\t\t,commission_final.beneficiary_code 'Account Free'\n\t\t,commission_final.commission_revenue 'Amount'\n\tFROM commission_final\t\n\t\n\t) total\n\n\tGROUP BY total.'Account Code', total.'Account Free'\n\t`\n\n\tcreateTotalLedgerAmountView, err := db.Prepare(createTotalLedgerAmountViewStr)\n\tcheckError(err)\n\tcreateTotalLedgerAmountView.Exec()\n}", "func (me TxsdPresentationAttributesGraphicsDisplay) IsTableFooterGroup() bool {\n\treturn me.String() == \"table-footer-group\"\n}", "func (s *SVG) footer() string {\n\treturn \"</svg>\"\n}", "func (e *DiscordWebhookEmbed) SetFooter(text string, icon string) {\n\te.Footer.IconURL = icon\n\te.Footer.Text = text\n}", "func (this *MarkupConfluence) tableFooter() string {\n\treturn \"\\n\"\n}", "func (s *BasePlSqlParserListener) ExitCreate_materialized_view(ctx *Create_materialized_viewContext) {\n}", "func NewCreateResponseBody(res *warehouseviews.WarehouseView) *CreateResponseBody {\n\tbody := &CreateResponseBody{\n\t\tID: *res.ID,\n\t\tName: *res.Name,\n\t\tCode: *res.Code,\n\t\tAddress: *res.Address,\n\t\tType: *res.Type,\n\t}\n\tif res.Founder != nil {\n\t\tbody.Founder = marshalWarehouseviewsFounderViewToFounderResponseBody(res.Founder)\n\t}\n\treturn body\n}", "func (s *BasePlSqlParserListener) ExitCreate_materialized_view_log(ctx *Create_materialized_view_logContext) {\n}", "func ReadFooter(options *StoreOptions, file File) (*Footer, error) {\n\tfinfo, err := file.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfref := &FileRef{file: file, refs: 1}\n\n\t// To avoid an EOF while reading, start scanning the footer from\n\t// the last byte. This is under the assumption that the footer is\n\t// at least 2 bytes long.\n\tf, err := ScanFooter(options, fref, finfo.Name(), finfo.Size()-1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfref.DecRef() // ScanFooter added its own ref-counts on success.\n\n\treturn f, err\n}", "func (xs *Sheet) SetFooter(footer string, margin float64) int {\n\ttmp, _, _ := xs.xb.lib.NewProc(\"xlSheetSetFooterW\").\n\t\tCall(xs.self, S(footer), F(margin))\n\treturn int(tmp)\n}", "func (fe *FileEncryptionProperties) FooterKeyMetadata() string { return fe.footerKeyMetadata }", "func templatesLayoutFooterHtml() (*asset, error) {\n\tpath := filepath.Join(rootDir, \"templates/layout/footer.html\")\n\tname := \"templates/layout/footer.html\"\n\tbytes, err := bindataRead(path, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Error reading asset info %s at %s: %v\", name, path, err)\n\t}\n\n\ta := &asset{bytes: bytes, info: fi}\n\treturn a, err\n}", "func (c *ColumnBase) FooterAttributes(ctx context.Context, row int, col int) html5tag.Attributes {\n\tif len(c.footerAttributes) < row+1 {\n\t\t// extend the attributes\n\t\tc.footerAttributes = append(c.footerAttributes, make([]html5tag.Attributes, row-len(c.footerAttributes)+1)...)\n\t}\n\tif c.footerAttributes[row] == nil {\n\t\tc.footerAttributes[row] = html5tag.NewAttributes()\n\t}\n\treturn c.footerAttributes[row]\n}", "func ScanFooter(options *StoreOptions, fref *FileRef, fileName string,\n\tpos int64) (*Footer, error) {\n\tfooterBeg := make([]byte, footerBegLen)\n\n\t// Align pos to the start of a page (floor).\n\tpos = pageAlignFloor(pos)\n\n\tfor {\n\t\tfor { // Scan for StoreMagicBeg, which may be a potential footer.\n\t\t\tif pos <= 0 {\n\t\t\t\treturn nil, ErrNoValidFooter\n\t\t\t}\n\n\t\t\tn, err := fref.file.ReadAt(footerBeg, pos)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif n == footerBegLen &&\n\t\t\t\tbytes.Equal(StoreMagicBeg, footerBeg[:lenMagicBeg]) &&\n\t\t\t\tbytes.Equal(StoreMagicBeg, footerBeg[lenMagicBeg:2*lenMagicBeg]) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Move pos back by page size.\n\t\t\tpos -= int64(StorePageSize)\n\t\t}\n\n\t\t// Read and check the potential footer.\n\t\tfooterBegBuf := bytes.NewBuffer(footerBeg[2*lenMagicBeg:])\n\n\t\tvar version uint32\n\t\tif err := binary.Read(footerBegBuf, StoreEndian, &version); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif version != StoreVersion {\n\t\t\treturn nil, fmt.Errorf(\"store: version mismatch, \"+\n\t\t\t\t\"current: %v != found: %v\", StoreVersion, version)\n\t\t}\n\n\t\tvar length uint32\n\t\tif err := binary.Read(footerBegBuf, StoreEndian, &length); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tdata := make([]byte, int64(length)-int64(footerBegLen))\n\n\t\tn, err := fref.file.ReadAt(data, pos+int64(footerBegLen))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif n == len(data) &&\n\t\t\tbytes.Equal(StoreMagicEnd, data[n-lenMagicEnd*2:n-lenMagicEnd]) &&\n\t\t\tbytes.Equal(StoreMagicEnd, data[n-lenMagicEnd:]) {\n\n\t\t\tcontent := int(length) - footerBegLen - footerEndLen\n\t\t\tb := bytes.NewBuffer(data[content:])\n\n\t\t\tvar offset int64\n\t\t\tif err = binary.Read(b, StoreEndian, &offset); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif offset != pos {\n\t\t\t\treturn nil, fmt.Errorf(\"store: offset mismatch, \"+\n\t\t\t\t\t\"wanted: %v != found: %v\", offset, pos)\n\t\t\t}\n\n\t\t\tvar length1 uint32\n\t\t\tif err = binary.Read(b, StoreEndian, &length1); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif length1 != length {\n\t\t\t\treturn nil, fmt.Errorf(\"store: length mismatch, \"+\n\t\t\t\t\t\"wanted: %v != found: %v\", length1, length)\n\t\t\t}\n\n\t\t\tf := &Footer{refs: 1, fileName: fileName, filePos: offset}\n\n\t\t\terr = json.Unmarshal(data[:content], f)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// json.Unmarshal would have just loaded the map.\n\t\t\t// We now need to load each segment into the map.\n\t\t\t// Also recursively load child footer segment stacks.\n\t\t\terr = f.loadSegments(options, fref)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn f, nil\n\t\t}\n\t\t// Else, invalid footer - StoreMagicEnd missing and/or file\n\t\t// pos out of bounds.\n\n\t\t// Footer was invalid, so keep scanning.\n\t\tpos -= int64(StorePageSize)\n\t}\n}", "func printFooter(w io.Writer, info *athena.QueryExecution) {\n\tstats := info.Statistics\n\trunTimeMs := aws.Int64Value(stats.EngineExecutionTimeInMillis)\n\tscannedBytes := aws.Int64Value(stats.DataScannedInBytes)\n\tloc := aws.StringValue(info.ResultConfiguration.OutputLocation)\n\tlog.Printf(\"EngineExecutionTimeInMillis: %d milliseconds\\n\", runTimeMs)\n\tlog.Printf(\"DataScannedInBytes: %d bytes\\n\", scannedBytes)\n\tlog.Printf(\"OutputLocation: %s\\n\", loc)\n\tfmt.Fprintf(w, \"Run time: %.2f seconds | Data scanned: %s\\nLocation: %s\\n\",\n\t\tfloat64(runTimeMs)/1000, FormatBytes(scannedBytes), loc)\n}", "func Tfoot(props *TfootProps, children ...Element) *TfootElem {\n\trProps := &_TfootProps{\n\t\tBasicHTMLElement: newBasicHTMLElement(),\n\t}\n\n\tif props != nil {\n\t\tprops.assign(rProps)\n\t}\n\n\treturn &TfootElem{\n\t\tElement: createElement(\"tfoot\", rProps, children...),\n\t}\n}", "func BottomPrimaryLayout(topView, bottomView string) func(*gocui.Gui) error {\n\treturn func(g *gocui.Gui) error {\n\t\t// ensure both of our target view exist\n\t\tbottom, err := g.View(bottomView)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = g.View(topView)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// check the size of the top view and make sure it's reasonable\n\t\tmaxX, maxY := g.Size()\n\t\t_, bottomHeight := bottom.Size()\n\t\tif bottomHeight > maxY/2 {\n\t\t\tbottomHeight = maxY / 2\n\t\t}\n\n\t\t// configure the position and size of the bottom view\n\t\tbottomPosY := maxY - bottomHeight - 2\n\t\tif _, err = g.SetView(bottomView, 0, bottomPosY, maxX-1, maxY-1); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// configure the position and size of the top view\n\t\ttopHeight := bottomPosY - 1\n\t\tif _, err = g.SetView(topView, 0, 0, maxX-1, topHeight); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n}", "func (w *Writer) Close() error {\n\tw.finishPublicSection()\n\thb := w.headerBytes()\n\n\tbuf := bytes.NewBuffer(hb)\n\tw.Stats.Footer = Footer{\n\t\tRefIndexOffset: w.Stats.BlockStats[BlockTypeRef].IndexOffset,\n\t\tObjOffset: w.Stats.BlockStats[BlockTypeObj].Offset,\n\t\tObjIndexOffset: w.Stats.BlockStats[BlockTypeObj].IndexOffset,\n\t\tLogOffset: w.Stats.BlockStats[BlockTypeLog].Offset,\n\t\tLogIndexOffset: w.Stats.BlockStats[BlockTypeLog].IndexOffset,\n\t}\n\n\tf := w.Stats.Footer\n\tf.ObjOffset = f.ObjOffset<<5 | uint64(w.Stats.ObjectIDLen)\n\n\tif err := binary.Write(buf, binary.BigEndian, &f); err != nil {\n\t\treturn err\n\t}\n\n\th := crc32.NewIEEE()\n\th.Write(buf.Bytes())\n\tcrc := h.Sum32()\n\n\tbinary.Write(buf, binary.BigEndian, crc)\n\n\tw.paddedWriter.pendingPadding = 0\n\tn, err := w.paddedWriter.Write(buf.Bytes(), 0)\n\tif n != footerSize {\n\t\tlog.Panicf(\"footer size %d\", n)\n\t}\n\treturn err\n}", "func (logMainView *LogMainView) HSplit() {\n\tlogMainView.rootFlex.SetDirection(tview.FlexRow)\n\tv := logMainView.addView()\n\tlogMainView.app.SetFocus(v)\n\tlogMainView.views = append(logMainView.views, v)\n}", "func NewView() *View {\n\tvar v = View{}\n\n\tv.Goal = widgets.NewParagraph()\n\tv.Goal.Title = \"Your goal\"\n\tv.Goal.SetRect(0, 0, 65, 3)\n\n\tv.Location = widgets.NewParagraph()\n\tv.Location.Title = \"Location\"\n\tv.Location.SetRect(0, 3, 38, 23)\n\n\tv.SkillsBar = widgets.NewTable()\n\tv.SkillsBar.Title = \"Skill bar\"\n\tv.SkillsBar.Rows = [][]string{{\"\"}}\n\tv.SkillsBar.SetRect(0, 23, 65, 30)\n\n\tv.CombatLog = widgets.NewParagraph()\n\tv.CombatLog.Title = \"Combat log\"\n\tv.CombatLog.SetRect(0, 30, 65, 37)\n\n\tv.Hero = widgets.NewTable()\n\tv.Hero.Title = \"My hero\"\n\tv.Hero.Rows = [][]string{{\"\"}}\n\tv.Hero.SetRect(40, 3, 65, 14)\n\n\tv.Monster = widgets.NewTable()\n\tv.Monster.Title = \"\"\n\tv.Monster.Rows = [][]string{{\"\"}}\n\tv.Monster.SetRect(40, 14, 65, 23)\n\n\tui.Render(v.All()...)\n\n\treturn &v\n}", "func (p *Builder) writeProgramFooter(forXDP bool) {\n\t// Fall through here if there's no match. Also used when we hit an error or if policy rejects packet.\n\tp.b.LabelNextInsn(\"deny\")\n\n\t// Store the policy result in the state for the next program to see.\n\tp.b.MovImm32(R1, int32(state.PolicyDeny))\n\tp.b.Store32(R9, R1, stateOffPolResult)\n\n\t// Execute the tail call to drop program\n\tp.b.Mov64(R1, R6) // First arg is the context.\n\tp.b.LoadMapFD(R2, uint32(p.jumpMapFD)) // Second arg is the map.\n\tif p.useJmps {\n\t\tp.b.AddComment(fmt.Sprintf(\"Deny jump to %d\", p.denyJmp))\n\t\tp.b.MovImm32(R3, int32(p.denyJmp)) // Third arg is the index (rather than a pointer to the index).\n\t} else {\n\t\tp.b.Load32(R3, R6, skbCb1) // Third arg is the index from skb->cb[1]).\n\t}\n\tp.b.Call(HelperTailCall)\n\n\t// Fall through if tail call fails.\n\tp.b.LabelNextInsn(\"exit\")\n\tif forXDP {\n\t\tp.b.MovImm64(R0, 1 /* XDP_DROP */)\n\t} else {\n\t\tp.b.MovImm64(R0, 2 /* TC_ACT_SHOT */)\n\t}\n\tp.b.Exit()\n\n\tif forXDP {\n\t\tp.b.LabelNextInsn(\"xdp_pass\")\n\t\tp.b.MovImm64(R0, 2 /* XDP_PASS */)\n\t\tp.b.Exit()\n\t}\n\n\tif p.b.TargetIsUsed(\"allow\") {\n\t\tp.b.LabelNextInsn(\"allow\")\n\t\t// Store the policy result in the state for the next program to see.\n\t\tp.b.MovImm32(R1, int32(state.PolicyAllow))\n\t\tp.b.Store32(R9, R1, stateOffPolResult)\n\t\t// Execute the tail call.\n\t\tp.b.Mov64(R1, R6) // First arg is the context.\n\t\tp.b.LoadMapFD(R2, uint32(p.jumpMapFD)) // Second arg is the map.\n\t\tif p.useJmps {\n\t\t\tp.b.AddComment(fmt.Sprintf(\"Allow jump to %d\", p.allowJmp))\n\t\t\tp.b.MovImm32(R3, int32(p.allowJmp)) // Third arg is the index (rather than a pointer to the index).\n\t\t} else {\n\t\t\tp.b.Load32(R3, R6, skbCb0) // Third arg is the index from skb->cb[0]).\n\t\t}\n\t\tp.b.Call(HelperTailCall)\n\n\t\t// Fall through if tail call fails.\n\t\tp.b.MovImm32(R1, state.PolicyTailCallFailed)\n\t\tp.b.Store32(R9, R1, stateOffPolResult)\n\t\tif forXDP {\n\t\t\tp.b.MovImm64(R0, 1 /* XDP_DROP */)\n\t\t} else {\n\t\t\tp.b.MovImm64(R0, 2 /* TC_ACT_SHOT */)\n\t\t}\n\t\tp.b.Exit()\n\t}\n}", "func (pg *AppOverviewPage) Layout(gtx layout.Context) layout.Dimensions {\n\tpageContent := []func(gtx C) D{\n\t\tfunc(gtx C) D {\n\t\t\tif len(pg.mixerWallets) == 0 {\n\t\t\t\treturn D{}\n\t\t\t}\n\n\t\t\treturn components.MixerInfoLayout(gtx, pg.Load, true, pg.toMixer.Layout, func(gtx C) D {\n\t\t\t\treturn pg.listMixer.Layout(gtx, len(pg.mixerWallets), func(gtx C, i int) D {\n\t\t\t\t\treturn layout.Inset{Bottom: values.MarginPadding5}.Layout(gtx, func(gtx C) D {\n\t\t\t\t\t\taccounts, _ := pg.mixerWallets[i].GetAccountsRaw()\n\t\t\t\t\t\tvar unmixedBalance string\n\t\t\t\t\t\tfor _, acct := range accounts.Acc {\n\t\t\t\t\t\t\tif acct.Number == pg.mixerWallets[i].UnmixedAccountNumber() {\n\t\t\t\t\t\t\t\tunmixedBalance = dcrutil.Amount(acct.TotalBalance).String()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn components.MixerInfoContentWrapper(gtx, pg.Load, func(gtx C) D {\n\t\t\t\t\t\t\treturn layout.Flex{Axis: layout.Vertical}.Layout(gtx,\n\t\t\t\t\t\t\t\tlayout.Rigid(func(gtx C) D {\n\t\t\t\t\t\t\t\t\ttxt := pg.Theme.Label(values.TextSize14, pg.mixerWallets[i].Name)\n\t\t\t\t\t\t\t\t\ttxt.Font.Weight = text.Medium\n\n\t\t\t\t\t\t\t\t\treturn layout.Inset{Bottom: values.MarginPadding10}.Layout(gtx, txt.Layout)\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tlayout.Rigid(func(gtx C) D {\n\t\t\t\t\t\t\t\t\treturn layout.Flex{Spacing: layout.SpaceBetween, Alignment: layout.Middle}.Layout(gtx,\n\t\t\t\t\t\t\t\t\t\tlayout.Rigid(func(gtx C) D {\n\t\t\t\t\t\t\t\t\t\t\tt := pg.Theme.Label(values.TextSize14, values.String(values.StrUnmixedBalance))\n\t\t\t\t\t\t\t\t\t\t\tt.Color = pg.Theme.Color.GrayText2\n\t\t\t\t\t\t\t\t\t\t\treturn t.Layout(gtx)\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tlayout.Rigid(func(gtx C) D {\n\t\t\t\t\t\t\t\t\t\t\treturn components.LayoutBalanceSize(gtx, pg.Load, unmixedBalance, values.TextSize20)\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t\tfunc(gtx C) D {\n\t\t\t// allow the recentTransactionsSection to extend the entire width of the display area.\n\t\t\tgtx.Constraints.Min.X = gtx.Constraints.Max.X\n\t\t\treturn pg.recentTransactionsSection(gtx)\n\t\t},\n\t\tfunc(gtx C) D {\n\t\t\tif pg.WL.MultiWallet.ReadBoolConfigValueForKey(load.FetchProposalConfigKey, false) && len(pg.proposalItems) != 0 {\n\t\t\t\treturn pg.recentProposalsSection(gtx)\n\t\t\t}\n\t\t\treturn D{}\n\t\t},\n\t\tfunc(gtx C) D {\n\t\t\treturn pg.syncStatusSection(gtx)\n\t\t},\n\t}\n\n\tif pg.WL.MultiWallet.IsSyncing() || pg.WL.MultiWallet.IsRescanning() || pg.WL.MultiWallet.Politeia.IsSyncing() {\n\t\t// Will refresh the overview page every 2 seconds while\n\t\t// sync is active. When sync/rescan is started or ended,\n\t\t// sync is considered inactive and no refresh occurs. A\n\t\t// sync state change listener is used to refresh the display\n\t\t// when the sync state changes.\n\t\top.InvalidateOp{At: gtx.Now.Add(2 * time.Second)}.Add(gtx.Ops)\n\t}\n\n\treturn components.UniformPadding(gtx, func(gtx C) D {\n\t\treturn pg.Theme.List(pg.scrollContainer).Layout(gtx, len(pageContent), func(gtx C, i int) D {\n\t\t\tm := values.MarginPadding5\n\t\t\tif i == len(pageContent) {\n\t\t\t\t// remove padding after the last item\n\t\t\t\tm = values.MarginPadding0\n\t\t\t}\n\t\t\treturn layout.Inset{\n\t\t\t\tRight: values.MarginPadding2,\n\t\t\t\tBottom: m,\n\t\t\t}.Layout(gtx, pageContent[i])\n\t\t})\n\t})\n}", "func WithFooterKeyID(key string) EncryptOption {\n\tif !utf8.ValidString(key) {\n\t\tpanic(\"parquet: footer key id should be UTF8 encoded\")\n\t}\n\treturn WithFooterKeyMetadata(key)\n}", "func (e *Exporter) ExportView(vd *view.Data) {\n\te.bundler.Add(vd, 1)\n}", "func newBarLayout(bar *bar) barLayout {\n\treturn barLayout{bar, false, fyne.NewPos(0, 0)}\n}", "func (pg *walletPage) Layout(gtx layout.Context) layout.Dimensions {\n\tcommon := pg.common\n\tif *pg.refreshPage {\n\t\tcommon.refreshWindow()\n\t\t*pg.refreshPage = false\n\t}\n\n\tif common.info.LoadedWallets == 0 {\n\t\treturn common.Layout(gtx, func(gtx C) D {\n\t\t\treturn common.UniformPadding(gtx, func(gtx C) D {\n\t\t\t\treturn layout.Center.Layout(gtx, func(gtx C) D {\n\t\t\t\t\treturn common.theme.H3(values.String(values.StrNoWalletLoaded)).Layout(gtx)\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}\n\n\tfor index := 0; index < common.info.LoadedWallets; index++ {\n\t\tif common.info.Wallets[index].IsWatchingOnly {\n\t\t\tif _, ok := pg.watchOnlyWalletMoreButtons[index]; !ok {\n\t\t\t\tpg.watchOnlyWalletMoreButtons[index] = decredmaterial.IconButton{\n\t\t\t\t\tIconButtonStyle: material.IconButtonStyle{\n\t\t\t\t\t\tButton: new(widget.Clickable),\n\t\t\t\t\t\tIcon: common.icons.navigationMore,\n\t\t\t\t\t\tSize: values.MarginPadding25,\n\t\t\t\t\t\tBackground: color.NRGBA{},\n\t\t\t\t\t\tColor: common.theme.Color.Text,\n\t\t\t\t\t\tInset: layout.UniformInset(values.MarginPadding0),\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif _, ok := pg.collapsibles[index]; !ok {\n\t\t\t\taddAcctBtn := common.theme.IconButton(new(widget.Clickable), common.icons.contentAdd)\n\t\t\t\taddAcctBtn.Inset = layout.UniformInset(values.MarginPadding0)\n\t\t\t\taddAcctBtn.Size = values.MarginPadding25\n\t\t\t\taddAcctBtn.Background = color.NRGBA{}\n\t\t\t\taddAcctBtn.Color = common.theme.Color.Text\n\n\t\t\t\tbackupBtn := common.theme.PlainIconButton(new(widget.Clickable), common.icons.navigationArrowForward)\n\t\t\t\tbackupBtn.Color = common.theme.Color.Surface\n\t\t\t\tbackupBtn.Inset = layout.UniformInset(values.MarginPadding0)\n\t\t\t\tbackupBtn.Size = values.MarginPadding20\n\n\t\t\t\tpg.collapsibles[index] = collapsible{\n\t\t\t\t\tcollapsible: pg.theme.CollapsibleWithOption(),\n\t\t\t\t\taddAcctBtn: addAcctBtn,\n\t\t\t\t\tbackupAcctBtn: backupBtn,\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\tpageContent := []func(gtx C) D{\n\t\tfunc(gtx C) D {\n\t\t\treturn pg.walletSection(gtx, common)\n\t\t},\n\t\tfunc(gtx C) D {\n\t\t\treturn pg.watchOnlyWalletSection(gtx, common)\n\t\t},\n\t}\n\n\tbody := func(gtx C) D {\n\t\treturn layout.Stack{Alignment: layout.SE}.Layout(gtx,\n\t\t\tlayout.Expanded(func(gtx C) D {\n\t\t\t\treturn pg.container.Layout(gtx, len(pageContent), func(gtx C, i int) D {\n\t\t\t\t\tdims := layout.UniformInset(values.MarginPadding5).Layout(gtx, pageContent[i])\n\t\t\t\t\tif pg.isAddWalletMenuOpen || pg.openPopupIndex != -1 {\n\t\t\t\t\t\tdims.Size.Y += 60\n\t\t\t\t\t}\n\t\t\t\t\treturn dims\n\t\t\t\t})\n\t\t\t}),\n\t\t\tlayout.Stacked(func(gtx C) D {\n\t\t\t\treturn pg.layoutAddWalletSection(gtx, common)\n\t\t\t}),\n\t\t)\n\t}\n\n\treturn common.Layout(gtx, func(gtx C) D {\n\t\treturn layout.Stack{}.Layout(gtx,\n\t\t\tlayout.Expanded(func(gtx C) D {\n\t\t\t\treturn common.UniformPadding(gtx, body)\n\t\t\t}),\n\t\t\tlayout.Expanded(func(gtx C) D {\n\t\t\t\tif pg.isAddWalletMenuOpen || pg.openPopupIndex != -1 {\n\t\t\t\t\thalfHeight := gtx.Constraints.Max.Y / 2\n\t\t\t\t\treturn pg.container.Layout(gtx, len(pg.backdrops), func(gtx C, i int) D {\n\t\t\t\t\t\tgtx.Constraints.Min.Y = halfHeight\n\t\t\t\t\t\treturn pg.backdrops[i].Layout(gtx)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn D{}\n\t\t\t}),\n\t\t)\n\t})\n}", "func (s *BasemumpsListener) ExitView_(ctx *View_Context) {}", "func drawBottomBanner(ctx *gg.Context, text string) {\n\tx := float64(ctx.Width()) / 2\n\ty := float64(ctx.Height()) - IMAGE_MARGIN\n\tdrawText(ctx, text, x, y, 0.5, 1.0, BOTTOM_TEXT_DIVISOR)\n}", "func CreateCommissionRevenueLedgerAmountView(db *sql.DB) {\n\n\tcreateCommissionRevenueLedgerAmountViewStr := `\n\tCREATE VIEW commission_revenue_ledger_amount AS\n\tSELECT \n\tcr.'Account Code'\n\t,cr.'Account Free'\n\t,SUM(cr.'Amount') 'Amount'\n\tFROM \n\t(SELECT \n\t\t62001 'Account Code'\n\t\t,commission_final.beneficiary_code 'Account Free'\n\t\t,commission_final.commission_revenue 'Amount'\n\tFROM commission_final) cr\n\tGROUP BY cr.'Account Code', cr.'Account Free'\n\t`\n\n\tcreateCommissionRevenueLedgerAmountView, err := db.Prepare(createCommissionRevenueLedgerAmountViewStr)\n\tcheckError(err)\n\tcreateCommissionRevenueLedgerAmountView.Exec()\n\n}", "func (s *BasePlSqlParserListener) ExitCreate_package_body(ctx *Create_package_bodyContext) {}", "func (*View) Close() error { return nil }", "func (s *BaseSyslParserListener) ExitView(ctx *ViewContext) {}", "func NewWeather(closeTapped func()) (view fyne.CanvasObject, viewModel *Weather) {\n\tw := Weather{}\n\tw.city = widget.NewLabel(\"City\")\n\tw.city.Alignment = fyne.TextAlignCenter\n\tw.city.TextStyle.Bold = true\n\n\tw.currentTemperature = widget.NewLabel(\"Current Temperature\")\n\tw.currentTemperature.Alignment = fyne.TextAlignCenter\n\n\tw.clock = widget.NewLabel(\"Clock\")\n\tw.clock.TextStyle.Bold = true\n\n\tw.lastUpdate = widget.NewLabel(\"Last update\")\n\tw.lastUpdate.Alignment = fyne.TextAlignCenter\n\n\tw.background = &canvas.Image{FillMode: canvas.ImageFillStretch}\n\tw.today = newForecast()\n\tw.tomorrow = newForecast()\n\tw.afterTomorrow = newForecast()\n\n\theader := container.New(layout.NewHBoxLayout(),\n\t\tlayout.NewSpacer(),\n\t\tcontainer.New(layout.NewVBoxLayout(),\n\t\t\tw.city,\n\t\t\tw.currentTemperature,\n\t\t),\n\t\tcontainer.NewVBox(),\n\t\tlayout.NewSpacer(),\n\t)\n\tfooter := container.New(layout.NewHBoxLayout(),\n\t\twidget.NewButton(assets.GetLabel(assets.Close), closeTapped),\n\t\tlayout.NewSpacer(),\n\t\tw.clock,\n\t)\n\tcenter := container.New(layout.NewVBoxLayout(),\n\t\tcontainer.New(layout.NewGridLayout(3),\n\t\t\tw.today.layout,\n\t\t\tw.tomorrow.layout,\n\t\t\tw.afterTomorrow.layout,\n\t\t),\n\t\tw.lastUpdate,\n\t)\n\tw.view = container.New(layout.NewMaxLayout(),\n\t\tw.background,\n\t\tcontainer.New(layout.NewVBoxLayout(),\n\t\t\theader,\n\t\t\tlayout.NewSpacer(),\n\t\t\tcenter,\n\t\t\tlayout.NewSpacer(),\n\t\t\tfooter,\n\t\t),\n\t)\n\n\tw.today.header.SetText(assets.GetLabel(assets.Today))\n\tw.tomorrow.header.SetText(assets.GetLabel(assets.Tomorrow))\n\tw.afterTomorrow.header.SetText(assets.GetLabel(assets.AfterTomorrow))\n\tdefaultBackground, _ := assets.GetBackgroundImage(weather.ConditionClear)\n\tw.SetBackground(defaultBackground)\n\n\treturn w.view, &w\n}", "func WithFooterKey(key string) FileDecryptionOption {\n\treturn func(cfg *fileDecryptConfig) {\n\t\tif key != \"\" {\n\t\t\tcfg.footerKey = key\n\t\t}\n\t}\n}", "func (s *BasePlSqlParserListener) ExitCreate_function_body(ctx *Create_function_bodyContext) {}", "func (p *Packer) Close() error {\n\tp.writeFooter()\n\treturn p.outFile.Close()\n}", "func NewBorderLayout(top, bottom, left, right fyne.CanvasObject) fyne.Layout {\n\treturn &borderLayout{top, bottom, left, right}\n}", "func (c *ColumnBase) SetFooterTexter(s CellTexter) ColumnI {\n\tc.footerTexter = s\n\treturn c.this()\n}", "func (f *Footer) Length() uint64 {\n\tjBuf, err := json.Marshal(f)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tfooterLen := footerBegLen + len(jBuf) + footerEndLen\n\treturn uint64(footerLen)\n}", "func (s *SimPDF) BottomLine(style models.Styles) {\n\tif style.Border.Width.Bottom > 0 {\n\t\ts.DrawBottomLine(style)\n\t}\n}", "func (jsonExporter *JSONExportOutput) WriteFooter() error {\n\tif jsonExporter.ArrayOutput {\n\t\t_, err := jsonExporter.Out.Write([]byte{json.ArrayEnd, '\\n'})\n\t\t// TODO check # bytes written?\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif jsonExporter.PrettyOutput {\n\t\tif _, err := jsonExporter.Out.Write([]byte(\"\\n\")); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func finalizer(a *CasbinMenuAdapter) {\n}", "func WithFooterKeyMetadata(keyMeta string) EncryptOption {\n\treturn func(cfg *configEncrypt) {\n\t\tif keyMeta != \"\" {\n\t\t\tcfg.keyMetadata = keyMeta\n\t\t}\n\t}\n}", "func (b *Builder) WriteFinalTabstop() {\n\tfmt.Fprint(&b.sb, \"$0\")\n}", "func (ct *Cointop) layout(g *gocui.Gui) error {\n\tmaxX, maxY := ct.size()\n\tchartHeight := 10\n\ttopOffset := 0\n\n\tif v, err := g.SetView(ct.marketbarviewname, 0, topOffset, maxX, 2); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.marketbarview = v\n\t\tct.marketbarview.Frame = false\n\t\tct.marketbarview.BgColor = gocui.ColorBlack\n\t\tct.marketbarview.FgColor = gocui.ColorWhite\n\t\tgo func() {\n\t\t\tct.updateMarketbar()\n\t\t\t_, found := ct.cache.Get(ct.marketbarviewname)\n\t\t\tif found {\n\t\t\t\tct.cache.Delete(ct.marketbarviewname)\n\t\t\t\tct.updateMarketbar()\n\t\t\t}\n\t\t}()\n\t}\n\n\ttopOffset = topOffset + 1\n\tif v, err := g.SetView(ct.chartviewname, 0, topOffset, maxX, topOffset+chartHeight); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.chartview = v\n\t\tct.chartview.Frame = false\n\t\tgo func() {\n\t\t\tct.updateChart()\n\t\t\tcachekey := strings.ToLower(fmt.Sprintf(\"%s_%s\", \"globaldata\", strings.Replace(ct.selectedchartrange, \" \", \"\", -1)))\n\t\t\t_, found := ct.cache.Get(cachekey)\n\t\t\tif found {\n\t\t\t\tct.cache.Delete(cachekey)\n\t\t\t\tct.updateChart()\n\t\t\t}\n\t\t}()\n\t}\n\n\ttopOffset = topOffset + chartHeight\n\tif v, err := g.SetView(ct.headerviewname, 0, topOffset, ct.maxtablewidth, topOffset+2); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.headersview = v\n\t\tct.headersview.Frame = false\n\t\tct.headersview.FgColor = gocui.ColorBlack\n\t\tct.headersview.BgColor = gocui.ColorGreen\n\t\tgo ct.updateHeaders()\n\t}\n\n\ttopOffset = topOffset + 1\n\tif v, err := g.SetView(ct.tableviewname, 0, topOffset, ct.maxtablewidth, maxY-1); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.tableview = v\n\t\tct.tableview.Frame = false\n\t\tct.tableview.Highlight = true\n\t\tct.tableview.SelBgColor = gocui.ColorCyan\n\t\tct.tableview.SelFgColor = gocui.ColorBlack\n\t\tgo func() {\n\t\t\tct.updateCoins()\n\t\t\tct.updateTable()\n\t\t\t_, found := ct.cache.Get(\"allcoinsmap\")\n\t\t\tif found {\n\t\t\t\tct.cache.Delete(\"allcoinsmap\")\n\t\t\t\tct.updateCoins()\n\t\t\t\tct.updateTable()\n\t\t\t}\n\t\t}()\n\t}\n\n\tif v, err := g.SetView(ct.statusbarviewname, 0, maxY-2, ct.maxtablewidth, maxY); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.statusbarview = v\n\t\tct.statusbarview.Frame = false\n\t\tct.statusbarview.BgColor = gocui.ColorCyan\n\t\tct.statusbarview.FgColor = gocui.ColorBlack\n\t\tgo ct.updateStatusbar(\"\")\n\t}\n\n\tif v, err := g.SetView(ct.searchfieldviewname, 0, maxY-2, ct.maxtablewidth, maxY); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.searchfield = v\n\t\tct.searchfield.Editable = true\n\t\tct.searchfield.Wrap = true\n\t\tct.searchfield.Frame = false\n\t\tct.searchfield.FgColor = gocui.ColorWhite\n\t}\n\n\tif v, err := g.SetView(ct.helpviewname, 1, 1, ct.maxtablewidth-2, maxY-1); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.helpview = v\n\t\tct.helpview.Frame = false\n\t\tct.helpview.BgColor = gocui.ColorBlack\n\t\tct.helpview.FgColor = gocui.ColorWhite\n\t}\n\n\tif v, err := g.SetView(ct.convertmenuviewname, 1, 1, ct.maxtablewidth-2, maxY-1); err != nil {\n\t\tif err != gocui.ErrUnknownView {\n\t\t\treturn err\n\t\t}\n\t\tct.convertmenuview = v\n\t\tct.convertmenuview.Frame = false\n\t\tct.convertmenuview.BgColor = gocui.ColorBlack\n\t\tct.convertmenuview.FgColor = gocui.ColorWhite\n\n\t\t// run only once on init.\n\t\t// this bit of code should be at the bottom\n\t\tct.g = g\n\t\tg.SetViewOnBottom(ct.searchfieldviewname) // hide\n\t\tg.SetViewOnBottom(ct.helpviewname) // hide\n\t\tg.SetViewOnBottom(ct.convertmenuviewname) // hide\n\t\tct.setActiveView(ct.tableviewname)\n\t\tct.intervalFetchData()\n\t}\n\n\treturn nil\n}", "func (h *Header) CreateRenderer() fyne.WidgetRenderer {\n\th.ExtendBaseWidget(h)\n\tobjects := []fyne.CanvasObject{}\n\tstyle := fyne.TextStyle{\n\t\tBold: true,\n\t}\n\tfor _, label := range h.labels {\n\t\tobj := canvas.NewText(label, h.color)\n\t\tobj.Alignment = fyne.TextAlignTrailing\n\t\tobj.TextStyle = style\n\t\tobjects = append(objects, obj)\n\t}\n\t// add 5 space margin on right side\n\tmargin := canvas.NewText(\" \", h.color)\n\tobjects = append(objects, margin)\n\n\treturn &headerRenderer{objects, margin, h}\n}", "func NewFinalizer(\n\tlifelines []*dsl.Statement,\n\tspacer *Spacing,\n\tnoGoZones []nogozone.NoGoZone,\n\tboxes map[*dsl.Statement]*BoxTracker,\n\tsizer sizer.Sizer) *Finalizer {\n\treturn &Finalizer{\n\t\tlifelines: lifelines,\n\t\tspacer: spacer,\n\t\tnoGoZones: noGoZones,\n\t\tboxes: boxes,\n\t}\n}", "func (s *BasePlSqlParserListener) ExitCreate_procedure_body(ctx *Create_procedure_bodyContext) {}", "func (p PageMarginFooter) setPageMargins(pm *xlsxPageMargins) {\n\tpm.Footer = float64(p)\n}", "func (c *ColumnBase) DrawFooterCell(ctx context.Context, row int, col int, count int, w io.Writer) {\n\tif c.isHidden {\n\t\treturn\n\t}\n\tcellHtml := c.this().FooterCellHtml(ctx, row, col)\n\n\ta := c.this().FooterAttributes(ctx, row, col)\n\ttag := \"td\"\n\tif c.asHeader {\n\t\ttag = \"th\"\n\t}\n\tpage.WriteString(w, html5tag.RenderTag(tag, a, cellHtml))\n\treturn\n}", "func (s *BasePlSqlParserListener) ExitDrop_view(ctx *Drop_viewContext) {}", "func (pg *BackupInstructionsPage) Layout(gtx layout.Context) layout.Dimensions {\n\tsp := components.SubPage{\n\t\tLoad: pg.Load,\n\t\tTitle: \"Keep in mind\",\n\t\tWalletName: pg.wallet.Name,\n\t\tBackButton: pg.backButton,\n\t\tBack: func() {\n\t\t\tpromptToExit(pg.Load, pg.ParentNavigator(), pg.ParentWindow())\n\t\t},\n\t\tBody: func(gtx C) D {\n\t\t\treturn pg.infoList.Layout(gtx, len(pg.checkBoxes), func(gtx C, i int) D {\n\t\t\t\treturn layout.Inset{Bottom: values.MarginPadding20}.Layout(gtx, pg.checkBoxes[i].Layout)\n\t\t\t})\n\t\t},\n\t}\n\n\tpg.viewSeedBtn.SetEnabled(pg.verifyCheckBoxes())\n\n\tlayout := func(gtx C) D {\n\t\treturn sp.Layout(pg.ParentWindow(), gtx)\n\t}\n\treturn container(gtx, *pg.Theme, layout, \"\", pg.viewSeedBtn)\n}", "func (fe *FileEncryptionProperties) EncryptedFooter() bool { return fe.encryptedFooter }", "func AddView(name string) {\n\tfmt.Println()\n\tviewName := ViewName(name)\n\tcontents := fmt.Sprintf(viewTemplate, TemplateFilename(name), viewName, ClassName(name), viewName)\n\tWriteFile(ViewFilename(name), contents, false);\n\tWriteFile(SassFilename(name), \"\", false);\n\tWriteFile(TemplateFilename(name), \"\", false);\n\tAddLinkTag(name);\n\tfmt.Println()\n}", "func PrintInventoryFooter(inventory Inventory) {\n\tfmt.Print(\"\\n\")\n}", "func (w *Window) createLayout(parent widgets.QWidget_ITF) {\n\t// Create the window layout, which will act as the layout for the underlying QMainWindow's\n\t// central widget's layout.\n\tw.windowLayout = widgets.NewQHBoxLayout2(parent)\n\tw.windowLayout.SetContentsMargins(7, 7, 7, 7)\n\n\tw.leftLayout = widgets.NewQHBoxLayout2(w.windowLayout.Widget())\n\tw.leftLayout.SetAlign(core.Qt__AlignLeft)\n\n\tw.rightLayout = widgets.NewQHBoxLayout2(w.windowLayout.Widget())\n\tw.rightLayout.SetAlign(core.Qt__AlignRight)\n\n\t// Add the left and right layout widgets, providing them equal, but positive stretch so they\n\t// meet in the middle of the window by default.\n\tw.windowLayout.AddLayout(w.leftLayout, 1)\n\tw.windowLayout.AddLayout(w.rightLayout, 1)\n}", "func (pc *programCode) createExit(val string) {\n\tcode := \"\"\n\tcode += \"\\tmov rax, 60\\t; exit program\\n\\tmov rdi, \" + val + \"\\n\\tsyscall\\n\"\n\tpc.funcCode[0] += code\n\t// Appends this code snippet to the first\n\t// level of indentation e.g. main-function\n}", "func WithPlaintextFooter() EncryptOption {\n\treturn func(cfg *configEncrypt) {\n\t\tcfg.encryptFooter = false\n\t}\n}" ]
[ "0.5952441", "0.59190524", "0.5908554", "0.5871804", "0.5760129", "0.5682298", "0.5645047", "0.5610753", "0.55848986", "0.5469786", "0.5427311", "0.5382227", "0.53675103", "0.52462083", "0.5153982", "0.51538026", "0.50929487", "0.50820076", "0.50206304", "0.49679133", "0.49436456", "0.49209014", "0.48864862", "0.48553577", "0.48407155", "0.47390142", "0.47284496", "0.47167328", "0.46925583", "0.4653475", "0.46404764", "0.46205172", "0.45975983", "0.45943388", "0.45905933", "0.45719278", "0.4554478", "0.45395035", "0.4535094", "0.44723135", "0.4450707", "0.44478992", "0.44362006", "0.4432142", "0.43430954", "0.43416944", "0.43207842", "0.4266734", "0.4234295", "0.4232986", "0.41843253", "0.4168687", "0.41662073", "0.41581497", "0.41396856", "0.41320178", "0.41140932", "0.41045114", "0.4082768", "0.40439087", "0.40250736", "0.40048137", "0.39912707", "0.398669", "0.39811626", "0.3980784", "0.3967945", "0.396188", "0.39582127", "0.39436418", "0.3941169", "0.39325383", "0.39269218", "0.39246613", "0.39232156", "0.39214316", "0.39132345", "0.39034587", "0.38932085", "0.38735366", "0.3871565", "0.3863391", "0.38574934", "0.38457927", "0.38368735", "0.3836217", "0.3823117", "0.38199922", "0.38077167", "0.38061365", "0.38011158", "0.37731716", "0.3769025", "0.37495616", "0.37464425", "0.37310863", "0.37139463", "0.37101558", "0.3699647", "0.3696425" ]
0.81811273
0
WithProxyConfig returns a proxy config functional option
WithProxyConfig возвращает функциональный параметр конфигурации прокси
func WithProxyConfig(cfg config.Proxy) GRPCOption { return func(h *GRPCHandler) { h.proxyCfg = cfg } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithProxyUrl(proxyURL string) configurer {\n\treturn func(conf *config) {\n\t\tconf.proxyURL = proxyURL\n\t}\n}", "func (o MustGatherSpecOutput) ProxyConfig() MustGatherSpecProxyConfigPtrOutput {\n\treturn o.ApplyT(func(v MustGatherSpec) *MustGatherSpecProxyConfig { return v.ProxyConfig }).(MustGatherSpecProxyConfigPtrOutput)\n}", "func Proxy(addr string) Option {\n\treturn func(o *Options) {\n\t\to.Proxy = addr\n\t}\n}", "func WithProxy(proxyURL string) (Option, error) {\n\tu, err := url.Parse(proxyURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse proxy url %q: %s\", proxyURL, err)\n\t}\n\n\treturn func(c *Client) {\n\t\ttransport := http.DefaultTransport.(*http.Transport).Clone()\n\t\tif c.client.Transport != nil {\n\t\t\ttransport = c.client.Transport.(*http.Transport).Clone()\n\t\t}\n\n\t\ttransport.Proxy = http.ProxyURL(u)\n\n\t\tc.client.Transport = transport\n\t}, nil\n}", "func WithProxy(proxyURL string) (Option, error) {\n\tu, err := url.Parse(proxyURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse proxy url %q: %s\", proxyURL, err)\n\t}\n\n\treturn func(c *Client) {\n\t\tvar transport *http.Transport = LazyCreateNewTransport(c)\n\t\ttransport.Proxy = http.ProxyURL(u)\n\t\tc.client.Transport = transport\n\t}, nil\n}", "func WithProxy(p proxy.BackwardProxy) Option {\n\treturn Option{F: func(o *internal_server.Options, di *utils.Slice) {\n\t\to.Once.OnceOrPanic()\n\t\tdi.Push(fmt.Sprintf(\"WithProxy(%T)\", p))\n\n\t\tif o.Proxy != nil {\n\t\t\tpanic(fmt.Errorf(\"reassignment of Proxy is not allowed: %T -> %T\", o.Proxy, p))\n\t\t}\n\t\to.Proxy = p\n\t}}\n}", "func WithProxy() func(*engine.Spec) {\n\tenviron := map[string]string{}\n\tif value := getenv(\"no_proxy\"); value != \"\" {\n\t\tenviron[\"no_proxy\"] = value\n\t\tenviron[\"NO_PROXY\"] = value\n\t}\n\tif value := getenv(\"http_proxy\"); value != \"\" {\n\t\tenviron[\"http_proxy\"] = value\n\t\tenviron[\"HTTP_PROXY\"] = value\n\t}\n\tif value := getenv(\"https_proxy\"); value != \"\" {\n\t\tenviron[\"https_proxy\"] = value\n\t\tenviron[\"HTTPS_PROXY\"] = value\n\t}\n\treturn WithEnviron(environ)\n}", "func (o MustGatherSpecPtrOutput) ProxyConfig() MustGatherSpecProxyConfigPtrOutput {\n\treturn o.ApplyT(func(v *MustGatherSpec) *MustGatherSpecProxyConfig {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.ProxyConfig\n\t}).(MustGatherSpecProxyConfigPtrOutput)\n}", "func WithHTTPProxy(proxy string) ClientOption {\n\treturn withHTTPProxy{proxy}\n}", "func (c Capabilities) Proxy(p ProxyConfig) Capabilities {\n\tc[\"proxy\"] = p\n\treturn c\n}", "func NewProxy(c *ProxyConfig) (proxy.Proxy, error) {\n\tif c == nil {\n\t\treturn nil, errors.New(\"config should be provided\")\n\t}\n\n\tif err := c.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Yeah, not a good practice at all but I guess it's fine for now.\n\tkafkaproxy.ActualDefaultRequestHandler.RequestKeyHandlers.Set(protocol.RequestAPIKeyProduce, NewProduceRequestHandler(c.MessageHandlers...))\n\n\tif c.BrokersMapping == nil {\n\t\treturn nil, errors.New(\"Brokers mapping is required\")\n\t}\n\n\tif c.Debug {\n\t\t_ = server.Server.Flags().Set(\"log-level\", \"debug\")\n\t}\n\n\tfor _, v := range c.ExtraConfig {\n\t\tf := strings.Split(v, \"=\")\n\t\t_ = server.Server.Flags().Set(f[0], f[1])\n\t}\n\n\tfor _, v := range c.BrokersMapping {\n\t\t_ = server.Server.Flags().Set(\"bootstrap-server-mapping\", v)\n\t}\n\n\tfor _, v := range c.DialAddressMapping {\n\t\t_ = server.Server.Flags().Set(\"dial-address-mapping\", v)\n\t}\n\n\treturn func(_ context.Context) error {\n\t\treturn server.Server.Execute()\n\t}, nil\n}", "func newProxyConfig(config PodConfig) interface{} {\n\tswitch config.ProxyType {\n\tcase NoopProxyType:\n\t\treturn nil\n\tcase CCProxyType:\n\t\tvar ccConfig CCProxyConfig\n\t\terr := mapstructure.Decode(config.ProxyConfig, &ccConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn ccConfig\n\tdefault:\n\t\treturn nil\n\t}\n}", "func NewProxyConfig(brokersMapping []string, opts ...ProxyOption) (*ProxyConfig, error) {\n\tc := &ProxyConfig{BrokersMapping: brokersMapping}\n\tfor _, opt := range opts {\n\t\tif err := opt(c); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn c, c.Validate()\n}", "func ConfigureProxyDialer() error {\n\t// load proxy configuration for tests\n\tvar cert tls.Certificate\n\troots := x509.NewCertPool()\n\n\tsecretsPath := \"secrets\"\n\tif _, err := os.Stat(path.Join(secretsPath, \"proxy-client.pem\")); os.IsNotExist(err) {\n\t\tsecretsPath = \"../../secrets\"\n\t}\n\tcert, err := tls.LoadX509KeyPair(path.Join(secretsPath, \"proxy-client.pem\"), path.Join(secretsPath, \"proxy-client.key\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tca, err := ioutil.ReadFile(path.Join(secretsPath, \"proxy-ca.pem\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ok := roots.AppendCertsFromPEM(ca); !ok {\n\t\treturn fmt.Errorf(\"error configuring proxy\")\n\t}\n\n\troundtrippers.PrivateEndpointDialHook = func(location string) func(context.Context, string, string) (net.Conn, error) {\n\t\treturn func(ctx context.Context, network, address string) (net.Conn, error) {\n\t\t\tproxyEnvName := \"PROXYURL_\" + strings.ToUpper(location)\n\t\t\tproxyURL := os.Getenv(proxyEnvName)\n\t\t\tif proxyURL == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"%s not set\", proxyEnvName)\n\t\t\t}\n\n\t\t\tc, err := tls.Dial(\"tcp\", proxyURL, &tls.Config{\n\t\t\t\tRootCAs: roots,\n\t\t\t\tCertificates: []tls.Certificate{cert},\n\t\t\t\tServerName: \"proxy-server\",\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tr := bufio.NewReader(c)\n\n\t\t\treq, err := http.NewRequest(http.MethodConnect, \"\", nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treq.Host = address\n\n\t\t\terr = req.Write(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tresp, err := http.ReadResponse(r, req)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusOK {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected status code %d\", resp.StatusCode)\n\t\t\t}\n\n\t\t\treturn &conn{Conn: c, r: r}, nil\n\t\t}\n\t}\n\n\treturn nil\n}", "func (s *HTTPServer) AgentConnectProxyConfig(resp http.ResponseWriter, req *http.Request) (interface{}, error) {\n\t// Get the proxy ID. Note that this is the ID of a proxy's service instance.\n\tid := strings.TrimPrefix(req.URL.Path, \"/v1/agent/connect/proxy/\")\n\n\t// Maybe block\n\tvar queryOpts structs.QueryOptions\n\tif parseWait(resp, req, &queryOpts) {\n\t\t// parseWait returns an error itself\n\t\treturn nil, nil\n\t}\n\n\t// Parse the token - don't resolve a proxy token to a real token\n\t// that will be done with a call to verifyProxyToken later along with\n\t// other security relevant checks.\n\tvar token string\n\ts.parseTokenWithoutResolvingProxyToken(req, &token)\n\n\t// Parse hash specially since it's only this endpoint that uses it currently.\n\t// Eventually this should happen in parseWait and end up in QueryOptions but I\n\t// didn't want to make very general changes right away.\n\thash := req.URL.Query().Get(\"hash\")\n\n\treturn s.agentLocalBlockingQuery(resp, hash, &queryOpts,\n\t\tfunc(ws memdb.WatchSet) (string, interface{}, error) {\n\t\t\t// Retrieve the proxy specified\n\t\t\tproxy := s.agent.State.Proxy(id)\n\t\t\tif proxy == nil {\n\t\t\t\tresp.WriteHeader(http.StatusNotFound)\n\t\t\t\tfmt.Fprintf(resp, \"unknown proxy service ID: %s\", id)\n\t\t\t\treturn \"\", nil, nil\n\t\t\t}\n\n\t\t\t// Lookup the target service as a convenience\n\t\t\ttarget := s.agent.State.Service(proxy.Proxy.TargetServiceID)\n\t\t\tif target == nil {\n\t\t\t\t// Not found since this endpoint is only useful for agent-managed proxies so\n\t\t\t\t// service missing means the service was deregistered racily with this call.\n\t\t\t\tresp.WriteHeader(http.StatusNotFound)\n\t\t\t\tfmt.Fprintf(resp, \"unknown target service ID: %s\", proxy.Proxy.TargetServiceID)\n\t\t\t\treturn \"\", nil, nil\n\t\t\t}\n\n\t\t\t// Validate the ACL token - because this endpoint uses data local to a single\n\t\t\t// agent, this function is responsible for all enforcement regarding\n\t\t\t// protection of the configuration. verifyProxyToken will match the proxies\n\t\t\t// token to the correct service or in the case of being provide a real ACL\n\t\t\t// token it will ensure that the requester has ServiceWrite privileges\n\t\t\t// for this service.\n\t\t\t_, isProxyToken, err := s.agent.verifyProxyToken(token, target.Service, id)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\n\t\t\t// Watch the proxy for changes\n\t\t\tws.Add(proxy.WatchCh)\n\n\t\t\thash, err := hashstructure.Hash(proxy.Proxy, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tcontentHash := fmt.Sprintf(\"%x\", hash)\n\n\t\t\t// Set defaults\n\t\t\tconfig, err := s.agent.applyProxyConfigDefaults(proxy.Proxy)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\n\t\t\t// Only merge in telemetry config from agent if the requested is\n\t\t\t// authorized with a proxy token. This prevents us leaking potentially\n\t\t\t// sensitive config like Circonus API token via a public endpoint. Proxy\n\t\t\t// tokens are only ever generated in-memory and passed via ENV to a child\n\t\t\t// proxy process so potential for abuse here seems small. This endpoint in\n\t\t\t// general is only useful for managed proxies now so it should _always_ be\n\t\t\t// true that auth is via a proxy token but inconvenient for testing if we\n\t\t\t// lock it down so strictly.\n\t\t\tif isProxyToken {\n\t\t\t\t// Add telemetry config. Copy the global config so we can customize the\n\t\t\t\t// prefix.\n\t\t\t\ttelemetryCfg := s.agent.config.Telemetry\n\t\t\t\ttelemetryCfg.MetricsPrefix = telemetryCfg.MetricsPrefix + \".proxy.\" + target.ID\n\n\t\t\t\t// First see if the user has specified telemetry\n\t\t\t\tif userRaw, ok := config[\"telemetry\"]; ok {\n\t\t\t\t\t// User specified domething, see if it is compatible with agent\n\t\t\t\t\t// telemetry config:\n\t\t\t\t\tvar uCfg lib.TelemetryConfig\n\t\t\t\t\tdec, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{\n\t\t\t\t\t\tResult: &uCfg,\n\t\t\t\t\t\t// Make sure that if the user passes something that isn't just a\n\t\t\t\t\t\t// simple override of a valid TelemetryConfig that we fail so that we\n\t\t\t\t\t\t// don't clobber their custom config.\n\t\t\t\t\t\tErrorUnused: true,\n\t\t\t\t\t})\n\t\t\t\t\tif err == nil {\n\t\t\t\t\t\tif err = dec.Decode(userRaw); err == nil {\n\t\t\t\t\t\t\t// It did decode! Merge any unspecified fields from agent config.\n\t\t\t\t\t\t\tuCfg.MergeDefaults(&telemetryCfg)\n\t\t\t\t\t\t\tconfig[\"telemetry\"] = uCfg\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Failed to decode, just keep user's config[\"telemetry\"] verbatim\n\t\t\t\t\t// with no agent merge.\n\t\t\t\t} else {\n\t\t\t\t\t// Add agent telemetry config.\n\t\t\t\t\tconfig[\"telemetry\"] = telemetryCfg\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treply := &api.ConnectProxyConfig{\n\t\t\t\tProxyServiceID: proxy.Proxy.ProxyService.ID,\n\t\t\t\tTargetServiceID: target.ID,\n\t\t\t\tTargetServiceName: target.Service,\n\t\t\t\tContentHash: contentHash,\n\t\t\t\tExecMode: api.ProxyExecMode(proxy.Proxy.ExecMode.String()),\n\t\t\t\tCommand: proxy.Proxy.Command,\n\t\t\t\tConfig: config,\n\t\t\t\tUpstreams: proxy.Proxy.Upstreams.ToAPI(),\n\t\t\t}\n\t\t\treturn contentHash, reply, nil\n\t\t})\n}", "func (optr *Operator) getProxyConfig() (*httpproxy.Config, error) {\n\tproxy, err := optr.proxyLister.Get(\"cluster\")\n\n\tif apierrors.IsNotFound(err) {\n\t\treturn nil, nil\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &httpproxy.Config{\n\t\tHTTPProxy: proxy.Status.HTTPProxy,\n\t\tHTTPSProxy: proxy.Status.HTTPSProxy,\n\t\tNoProxy: proxy.Status.NoProxy,\n\t}, nil\n}", "func WithPROXYHeaderGetter(proxyHeaderGetter PROXYHeaderGetter) DialProxyOption {\n\treturn func(cfg *dialProxyConfig) {\n\t\tcfg.proxyHeaderGetter = proxyHeaderGetter\n\t}\n}", "func WithProxy(ctx context.Context, addrs ...string) context.Context {\n\tif md, ok := metadata.FromContext(ctx); ok {\n\t\tmd[proxyKey] = append(md[proxyKey], addrs...)\n\t\treturn ctx\n\t}\n\treturn metadata.NewContext(ctx, metadata.MD{proxyKey: addrs})\n}", "func Proxy(options ...Option) http.RoundTripper {\n\tp := &proxy{\n\t\tnext: http.DefaultTransport,\n\t\tscheme: \"http\",\n\t\tresolver: resolve.ResolverFunc(resolve.DNSSRV),\n\t\tpoolReporter: nil,\n\t\tfactory: pool.RoundRobin,\n\t\tregistry: nil,\n\t}\n\tp.setOptions(options...)\n\tp.registry = newRegistry(p.resolver, p.poolReporter, p.factory)\n\treturn p\n}", "func NewProxyConfig(configMap *ProxyConfigMap, k8sUtils k8sutils.UtilsInterface) (*ProxyConfig, error) {\n\tvar proxyConfig ProxyConfig\n\terr := proxyConfig.ParseConfig(*configMap, k8sUtils)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &proxyConfig, nil\n}", "func WithProxyClient(pc server.ProxyClient) Opt {\n\treturn func(fwdr *TCPForwarder) {\n\t\tfwdr.C = pc\n\t}\n}", "func NewProxyFromConfig(cfg *config.ProxyConfig, hc HealthChecker) (*Proxy, []error) {\n\terrs := config.ValidateConfig(cfg)\n\tif errs != nil {\n\t\treturn nil, errs\n\t}\n\n\tp := &Proxy{\n\t\tconfig: *cfg,\n\t\thealthChecker: hc,\n\t}\n\n\tp.reverseProxy = make(map[string]*httputil.ReverseProxy)\n\tfor _, service := range p.config.Proxy.Services {\n\t\tp.reverseProxy[service.Domain] = NewRandomBackendReverseProxy(service.Hosts)\n\t}\n\n\treturn p, nil\n}", "func LookupProxyConfig(ctx *pulumi.Context, args *LookupProxyConfigArgs, opts ...pulumi.InvokeOption) (*LookupProxyConfigResult, error) {\n\topts = internal.PkgInvokeDefaultOpts(opts)\n\tvar rv LookupProxyConfigResult\n\terr := ctx.Invoke(\"google-native:beyondcorp/v1alpha:getProxyConfig\", args, &rv, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rv, nil\n}", "func TelemetryHarvesterWithProxy(proxyURL *url.URL) TelemetryHarvesterOpt {\n\treturn func(cfg *telemetry.Config) {\n\t\trt := cfg.Client.Transport\n\t\tif rt == nil {\n\t\t\trt = http.DefaultTransport\n\t\t}\n\n\t\tt, ok := rt.(*http.Transport)\n\t\tif !ok {\n\t\t\tlogrus.Warning(\n\t\t\t\t\"telemetry emitter couldn't be configured with proxy, \",\n\t\t\t\t\"client transport is not an http.Transport, \",\n\t\t\t\t\"continuing without proxy support\",\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tt = t.Clone()\n\t\tt.Proxy = http.ProxyURL(proxyURL)\n\t\tcfg.Client.Transport = http.RoundTripper(t)\n\t\treturn\n\t}\n}", "func TelemetryHarvesterWithProxy(proxyURL *url.URL) TelemetryHarvesterOpt {\n\treturn func(cfg *telemetry.Config) {\n\t\trt := cfg.Client.Transport\n\t\tif rt == nil {\n\t\t\trt = http.DefaultTransport\n\t\t}\n\n\t\tt, ok := rt.(*http.Transport)\n\t\tif !ok {\n\t\t\tlogrus.Warning(\n\t\t\t\t\"telemetry emitter couldn't be configured with proxy, \",\n\t\t\t\t\"client transport is not an http.Transport, \",\n\t\t\t\t\"continuing without proxy support\",\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tt = t.Clone()\n\t\tt.Proxy = http.ProxyURL(proxyURL)\n\t\tcfg.Client.Transport = http.RoundTripper(t)\n\t\treturn\n\t}\n}", "func WithExtra(extra []string) ProxyOption {\n\treturn func(c *ProxyConfig) error {\n\t\tc.ExtraConfig = extra\n\t\treturn nil\n\t}\n}", "func WithProxy(ctx context.Context, proxy *Proxy) context.Context {\n\tif proxy == nil {\n\t\tpanic(\"nil proxy\")\n\t}\n\treturn context.WithValue(ctx, proxyContextKey{}, proxy)\n}", "func WithConfig(cfg Config) Option {\n\treturn optionFunc(func(c *config) {\n\t\tc.addr = cfg.Host + \":\" + strconv.FormatUint(uint64(cfg.Port), 10)\n\t})\n}", "func withSingleProxyPort(t *testing.T) testOptionsFunc {\n\tt.Helper()\n\t// enable proxy single port mode\n\treturn func(options *testOptions) {\n\t\toptions.instanceConfigFuncs = append(options.instanceConfigFuncs, func(cfg *helpers.InstanceConfig) {\n\t\t\tcfg.Listeners = helpers.SingleProxyPortSetup(t, &cfg.Fds)\n\t\t})\n\t\toptions.serviceConfigFuncs = append(options.serviceConfigFuncs, func(cfg *servicecfg.Config) {\n\t\t\tcfg.Auth.NetworkingConfig.SetProxyListenerMode(types.ProxyListenerMode_Multiplex)\n\t\t})\n\t}\n}", "func (e *Environment) PassThruProxyConfig() {\n\tif e.Map == nil {\n\t\treturn\n\t}\n\n\tfor _, key := range proxyEnv {\n\t\tvalue, ok := e.Map[key]\n\t\tif ok {\n\t\t e.AddIfMissing(fmt.Sprintf(\"%s%s\", public, key), value)\n\t\t}\n\t}\n}", "func (o TaskDefinitionOutput) ProxyConfiguration() TaskDefinitionProxyConfigurationPtrOutput {\n\treturn o.ApplyT(func(v *TaskDefinition) TaskDefinitionProxyConfigurationPtrOutput { return v.ProxyConfiguration }).(TaskDefinitionProxyConfigurationPtrOutput)\n}", "func (c *Config) GetProxyURL() string {\n\treturn c.ProxyURL\n}", "func (c *ThreeScaleClient) GetProxyConfig(svcId string, env string, version string) (ProxyConfigElement, error) {\n\tendpoint := fmt.Sprintf(proxyConfigGet, svcId, env, version)\n\treturn c.getProxyConfig(endpoint)\n}", "func GetProxyTransportFunc(p *config.Proxy) func(*http.Request) (*url.URL, error) {\n\treturn func(r *http.Request) (*url.URL, error) {\n\t\t// check no_proxy list first\n\t\tfor _, host := range p.NoProxy {\n\t\t\tif r.URL.Host == host {\n\t\t\t\tlog.Debugf(\"URL match no_proxy list item '%s': not using any proxy\", host)\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t}\n\n\t\t// check proxy by scheme\n\t\tconfProxy := \"\"\n\t\tif r.URL.Scheme == \"http\" {\n\t\t\tconfProxy = p.HTTP\n\t\t} else if r.URL.Scheme == \"https\" {\n\t\t\tconfProxy = p.HTTPS\n\t\t} else {\n\t\t\tlog.Warnf(\"Proxy configuration do not support scheme '%s'\", r.URL.Scheme)\n\t\t}\n\n\t\tif confProxy != \"\" {\n\t\t\tproxyURL, err := url.Parse(confProxy)\n\t\t\tif err != nil {\n\t\t\t\terr := fmt.Errorf(\"Could not parse the proxy URL for scheme %s from configuration: %s\", r.URL.Scheme, err)\n\t\t\t\tlog.Error(err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tuserInfo := \"\"\n\t\t\tif proxyURL.User != nil {\n\t\t\t\tif _, isSet := proxyURL.User.Password(); isSet {\n\t\t\t\t\tuserInfo = \"*****:*****@\"\n\t\t\t\t} else {\n\t\t\t\t\tuserInfo = \"*****@\"\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlog.Debugf(\"Using proxy %s://%s%s for URL '%s'\", proxyURL.Scheme, userInfo, proxyURL.Host, SanitizeURL(r.URL.String()))\n\t\t\treturn proxyURL, nil\n\t\t}\n\n\t\t// no proxy set for this request\n\t\treturn nil, nil\n\t}\n}", "func WithConfig(config core.ConfigProvider) ConfigOption {\n\treturn func(gw *Gateway) error {\n\t\tvar err error\n\t\tsdk, err := fabsdk.New(config)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tgw.sdk = sdk\n\n\t\tconfigBackend, err := config()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(configBackend) != 1 {\n\t\t\treturn errors.New(\"invalid config file\")\n\t\t}\n\n\t\tcfg := configBackend[0]\n\t\tgw.cfg = cfg\n\n\t\tvalue, ok := cfg.Lookup(\"client.organization\")\n\t\tif !ok {\n\t\t\treturn errors.New(\"No client organization defined in the config\")\n\t\t}\n\t\tgw.org = value.(string)\n\n\t\treturn nil\n\t}\n}", "func kubeProxyConfiguration(pluginDefaults map[string]operv1.ProxyArgumentList, conf *operv1.NetworkSpec, pluginOverrides map[string]operv1.ProxyArgumentList) (string, error) {\n\tp := conf.KubeProxyConfig\n\n\targs := map[string]operv1.ProxyArgumentList{}\n\targs[\"bind-address\"] = []string{p.BindAddress}\n\tif len(conf.ClusterNetwork) == 1 {\n\t\targs[\"cluster-cidr\"] = []string{conf.ClusterNetwork[0].CIDR}\n\t}\n\targs[\"iptables-sync-period\"] = []string{p.IptablesSyncPeriod}\n\n\targs = k8sutil.MergeKubeProxyArguments(args, pluginDefaults)\n\targs = k8sutil.MergeKubeProxyArguments(args, p.ProxyArguments)\n\targs = k8sutil.MergeKubeProxyArguments(args, pluginOverrides)\n\n\treturn k8sutil.GenerateKubeProxyConfiguration(args)\n}", "func (c *Config) UpdateProxy(pc ProxyConfig) {\n\tif pc.AllowLan != nil {\n\t\tc.general.AllowLan = *pc.AllowLan\n\t}\n\n\tc.general.Port = *or(pc.Port, &c.general.Port)\n\tif c.general.Port != 0 && (pc.AllowLan != nil || pc.Port != nil) {\n\t\tc.event <- &Event{Type: \"http-addr\", Payload: genAddr(c.general.Port, c.general.AllowLan)}\n\t}\n\n\tc.general.SocksPort = *or(pc.SocksPort, &c.general.SocksPort)\n\tif c.general.SocksPort != 0 && (pc.AllowLan != nil || pc.SocksPort != nil) {\n\t\tc.event <- &Event{Type: \"socks-addr\", Payload: genAddr(c.general.SocksPort, c.general.AllowLan)}\n\t}\n\n\tc.general.RedirPort = *or(pc.RedirPort, &c.general.RedirPort)\n\tif c.general.RedirPort != 0 && (pc.AllowLan != nil || pc.RedirPort != nil) {\n\t\tc.event <- &Event{Type: \"redir-addr\", Payload: genAddr(c.general.RedirPort, c.general.AllowLan)}\n\t}\n}", "func (o MustGatherSpecProxyConfigOutput) HttpProxy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v MustGatherSpecProxyConfig) *string { return v.HttpProxy }).(pulumi.StringPtrOutput)\n}", "func (c *minecraftConn) config() *config.Config {\n\treturn c.proxy.config\n}", "func (c *GlobalConfig) ProxyString() *gw.StringValue {\n\tif c.V1.Proxy == nil {\n\t\treturn nil\n\t}\n\n\tproxy := c.V1.Proxy\n\tif proxy.Host == nil {\n\t\treturn nil\n\t}\n\n\tb := strings.Builder{}\n\t// NOTE: from testing, it appears that Rust (hab) requires \"http://\" to be\n\t// at the head of the proxy URLs\n\tb.WriteString(\"http://\") // nolint: errcheck\n\n\tif proxy.User != nil {\n\t\tauthPart := fmt.Sprintf(\"%s:%s\", proxy.User.Value, proxy.Password.Value)\n\t\tb.WriteString(url.PathEscape(authPart)) // nolint: errcheck\n\t\tb.WriteString(\"@\") // nolint: errcheck\n\t}\n\n\thostPortPart := fmt.Sprintf(\"%s:%d\", proxy.Host.Value, proxy.Port.Value)\n\tb.WriteString(hostPortPart) // nolint: errcheck\n\treturn w.String(b.String())\n}", "func NewProxy(opts ProxyOpts) Proxy {\n\treturn &proxy{\n\t\tappClientFn: opts.AppClientFn,\n\t\tappID: opts.AppID,\n\t\tconnectionFactory: opts.ConnectionFactory,\n\t\tacl: opts.ACL,\n\t\tresiliency: opts.Resiliency,\n\t\tmaxRequestBodySize: opts.MaxRequestBodySize,\n\t}\n}", "func NewProxy(logger *zap.Logger, config *Config, krb5cl *client.Client) *Proxy {\n\tfp := httputil.NewForwardingProxy()\n\tfp.ErrorHandler = httpErrorHandler\n\n\tp := &Proxy{\n\t\tlogger: logger,\n\t\tconfig: config,\n\t\tkrb5cl: krb5cl,\n\t\thttpProxy: fp,\n\t}\n\n\tp.httpProxy.ErrorLog = zap.NewStdLog(logger)\n\tp.server = &http.Server{\n\t\tAddr: config.Addr.String(),\n\t\tHandler: p,\n\t\t// Disable HTTP/2.\n\t\tTLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),\n\t\t// Timeouts\n\t\tReadTimeout: config.Timeouts.Server.ReadTimeout,\n\t\tReadHeaderTimeout: config.Timeouts.Server.ReadHeaderTimeout,\n\t\tWriteTimeout: config.Timeouts.Server.WriteTimeout,\n\t\tIdleTimeout: config.Timeouts.Server.IdleTimeout,\n\t}\n\n\treturn p\n}", "func With(opt ...ConfigOpt) DoFunc {\n\tvar (\n\t\tdialer = &net.Dialer{\n\t\t\tLocalAddr: &net.TCPAddr{IP: net.IPv4zero},\n\t\t\tKeepAlive: 30 * time.Second,\n\t\t\tTimeout: 5 * time.Second,\n\t\t}\n\t\ttransport = &http.Transport{\n\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\tDial: dialer.Dial,\n\t\t\tResponseHeaderTimeout: 5 * time.Second,\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: false},\n\t\t\tTLSHandshakeTimeout: 5 * time.Second,\n\t\t}\n\t\tconfig = &Config{\n\t\t\tdialer: dialer,\n\t\t\ttransport: transport,\n\t\t\tclient: &http.Client{Transport: transport},\n\t\t}\n\t)\n\tfor _, o := range opt {\n\t\tif o != nil {\n\t\t\to(config)\n\t\t}\n\t}\n\treturn config.client.Do\n}", "func WithListen(listen string) Option {\n\treturn func(p *proxy) {\n\t\tp.listen = listen\n\t}\n}", "func getProxyURL() (bool, *url.URL) {\n\t// Grab the list of HTTP proxies from the configuration\n\tlog.Debug(\"Attempting to use one of the proxies defined in the configuration file\")\n\thttpProxyStringMap := viper.GetStringMap(\"HTTPProxies\")\n\n\t// This will be set to the URL to use or remain nil\n\tvar proxyURL *url.URL\n\n\t// Try each proxy and use it if it's available\n\tfor proxyAlias, httpProxy := range httpProxyStringMap {\n\t\tproxyURLString := httpProxy.(map[string]interface{})[\"proxyurl\"]\n\t\tif proxyURLString == nil {\n\t\t\tlog.Warnf(\"The proxy entry %s needs a ProxyURL in the configuration file: %s\", proxyAlias, httpProxy)\n\t\t\tcontinue\n\t\t}\n\n\t\tlog.Debugf(\"Checking access to proxy: %s\", proxyURLString)\n\n\t\tvar parseError error\n\t\tproxyURL, parseError = url.Parse(proxyURLString.(string))\n\t\tif parseError != nil {\n\t\t\tlog.Debugf(\"Skipping proxy URL that couldn't be parsed: %s\", parseError)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Get the proxy hostname\n\t\tproxyHost := proxyURL.Hostname()\n\n\t\t// Try looking up the hostname IP\n\t\tlog.Debugf(\"Looking up IP address for: %s\", proxyHost)\n\t\t_, lookupError := net.LookupHost(proxyHost)\n\t\tif lookupError != nil {\n\t\t\tlog.Debugf(\"Skipping proxy because the IP lookup failed: %s\", proxyHost)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Get the proxy hostname\n\t\tproxyPort := proxyURL.Port()\n\n\t\t// Try connecting to the proxy port\n\t\tlog.Debugf(\"Attempting to connect to %s on port %s\", proxyHost, proxyPort)\n\t\tconnection, dialError := net.Dial(\"tcp\", proxyHost+\":\"+proxyPort)\n\t\tif dialError != nil {\n\t\t\tlog.Debugf(\"Unable to connect to proxy %s on port %s\", proxyHost, proxyPort)\n\t\t\tcontinue\n\t\t}\n\t\terr := connection.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Unable to close connection to proxy host: %s\", err)\n\t\t}\n\n\t\t// Set the no proxy based on this config... this may be futile, need more research\n\t\tnoProxy := httpProxy.(map[string]interface{})[\"noproxy\"]\n\t\tif noProxy != nil {\n\t\t\tlog.Debugf(\"Setting NO_PROXY to %s\", noProxy)\n\t\t\terr := os.Setenv(\"NO_PROXY\", noProxy.(string))\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"Unable to set NO_PROXY environment variable: %s\", err)\n\t\t\t}\n\t\t}\n\n\t\t// If we made it this far, the proxy is usable\n\t\tlog.Infof(\"Found a working proxy from the configuration file: %s on port %s\", proxyHost, proxyPort)\n\t\treturn true, proxyURL\n\t}\n\n\treturn false, proxyURL\n}", "func (c *ThreeScaleClient) ListProxyConfig(svcId string, env string) (ProxyConfigList, error) {\n\tvar pc ProxyConfigList\n\n\tendpoint := fmt.Sprintf(proxyConfigList, svcId, env)\n\treq, err := c.buildGetReq(endpoint)\n\tif err != nil {\n\t\treturn pc, httpReqError\n\t}\n\treq.Header.Set(\"Accept\", \"application/json\")\n\n\tvalues := url.Values{}\n\treq.URL.RawQuery = values.Encode()\n\n\tresp, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn pc, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\terr = handleJsonResp(resp, http.StatusOK, &pc)\n\treturn pc, err\n}", "func expandProxyOption(ctx context.Context, tconn *chrome.TestConn) error {\n\tapp := ossettings.New(tconn)\n\tif err := app.WaitUntilExists(ossettings.ShowProxySettingsTab)(ctx); err != nil {\n\t\treturn errors.Wrap(err, \"failed to find 'Shared networks' toggle button\")\n\t}\n\n\tif err := uiauto.Combine(\"expand 'Proxy' section\",\n\t\tapp.LeftClick(ossettings.ShowProxySettingsTab),\n\t\tapp.WaitForLocation(ossettings.SharedNetworksToggleButton),\n\t)(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tif toggleInfo, err := app.Info(ctx, ossettings.SharedNetworksToggleButton); err != nil {\n\t\treturn errors.Wrap(err, \"failed to get toggle button info\")\n\t} else if toggleInfo.Checked == checked.True {\n\t\ttesting.ContextLog(ctx, \"'Allow proxies for shared networks' is already turned on\")\n\t\treturn nil\n\t}\n\n\treturn uiauto.Combine(\"turn on 'Allow proxies for shared networks' option\",\n\t\tapp.LeftClick(ossettings.SharedNetworksToggleButton),\n\t\tapp.LeftClick(ossettings.ConfirmButton),\n\t)(ctx)\n}", "func WithConfig(cfg Config) Opt {\n\treturn func(t *Tortoise) {\n\t\tt.cfg = cfg\n\t}\n}", "func OptConfig(cfg Config) Option {\n\treturn func(p *Profanity) {\n\t\tp.Config = cfg\n\t}\n}", "func (proxyConfig *ProxyConfig) ParseConfig(proxyConfigMap ProxyConfigMap, k8sUtils k8sutils.UtilsInterface) error {\n\tproxyMode := proxyConfigMap.Mode\n\tproxyConfig.Mode = proxyMode\n\tproxyConfig.Port = proxyConfigMap.Port\n\tfmt.Printf(\"ConfigMap: %v\\n\", proxyConfigMap)\n\tif proxyMode == Linked {\n\t\tconfig := proxyConfigMap.LinkConfig\n\t\tif config == nil {\n\t\t\treturn fmt.Errorf(\"proxy mode is specified as Linked but unable to parse config\")\n\t\t}\n\t\tif config.Primary.URL == \"\" {\n\t\t\treturn fmt.Errorf(\"must provide Primary url\")\n\t\t}\n\t\tprimaryURL, err := url.Parse(config.Primary.URL)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tprimaryManagementServer := ManagementServer{\n\t\t\tURL: *primaryURL,\n\t\t\tSkipCertificateValidation: config.Primary.SkipCertificateValidation,\n\t\t\tLimits: config.Primary.Limits,\n\t\t}\n\t\tif config.Primary.CertSecret != \"\" {\n\t\t\tprimaryCertFile, err := k8sUtils.GetCertFileFromSecretName(config.Primary.CertSecret)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tprimaryManagementServer.CertFile = primaryCertFile\n\t\t\tprimaryManagementServer.CertSecret = config.Primary.CertSecret\n\t\t}\n\t\tlinkedProxyConfig := LinkedProxyConfig{\n\t\t\tPrimary: &primaryManagementServer,\n\t\t}\n\t\tif config.Backup.URL != \"\" {\n\t\t\tbackupURL, err := url.Parse(config.Backup.URL)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbackupManagementServer := ManagementServer{\n\t\t\t\tURL: *backupURL,\n\t\t\t\tSkipCertificateValidation: config.Backup.SkipCertificateValidation,\n\t\t\t\tLimits: config.Backup.Limits,\n\t\t\t}\n\t\t\tif config.Backup.CertSecret != \"\" {\n\t\t\t\tbackupCertFile, err := k8sUtils.GetCertFileFromSecretName(config.Backup.CertSecret)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tbackupManagementServer.CertFile = backupCertFile\n\t\t\t\tbackupManagementServer.CertSecret = config.Backup.CertSecret\n\t\t\t}\n\t\t\tlinkedProxyConfig.Backup = &backupManagementServer\n\t\t}\n\t\tproxyConfig.LinkProxyConfig = &linkedProxyConfig\n\t} else if proxyMode == StandAlone {\n\t\tconfig := proxyConfigMap.StandAloneConfig\n\t\tif config == nil {\n\t\t\treturn fmt.Errorf(\"proxy mode is specified as StandAlone but unable to parse config\")\n\t\t}\n\t\tvar proxy StandAloneProxyConfig\n\t\tproxy.managedArrays = make(map[string]*StorageArray)\n\t\tproxy.managementServers = make(map[url.URL]*ManagementServer)\n\t\tproxy.proxyCredentials = make(map[string]*ProxyUser)\n\t\tstorageArrayIdentifiers := make(map[url.URL][]string)\n\t\tipAddresses := make([]string, 0)\n\t\tfor _, mgmtServer := range config.ManagementServerConfig {\n\t\t\tipAddresses = append(ipAddresses, mgmtServer.URL)\n\t\t}\n\t\tfor _, array := range config.StorageArrayConfig {\n\t\t\tif array.PrimaryURL == \"\" {\n\t\t\t\treturn fmt.Errorf(\"primary URL not configured for array: %s\", array.StorageArrayID)\n\t\t\t}\n\t\t\tif !utils.IsStringInSlice(ipAddresses, array.PrimaryURL) {\n\t\t\t\treturn fmt.Errorf(\"primary URL: %s for array: %s not present among management URL addresses\",\n\t\t\t\t\tarray.PrimaryURL, array)\n\t\t\t}\n\t\t\tif array.BackupURL != \"\" {\n\t\t\t\tif !utils.IsStringInSlice(ipAddresses, array.BackupURL) {\n\t\t\t\t\treturn fmt.Errorf(\"backup URL: %s for array: %s is not in the list of management URL addresses. Ignoring it\",\n\t\t\t\t\t\tarray.BackupURL, array)\n\t\t\t\t}\n\t\t\t}\n\t\t\tprimaryURL, err := url.Parse(array.PrimaryURL)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbackupURL := &url.URL{}\n\t\t\tif array.BackupURL != \"\" {\n\t\t\t\tbackupURL, err = url.Parse(array.BackupURL)\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\tproxy.managedArrays[array.StorageArrayID] = &StorageArray{\n\t\t\t\tStorageArrayIdentifier: array.StorageArrayID,\n\t\t\t\tPrimaryURL: *primaryURL,\n\t\t\t\tSecondaryURL: *backupURL,\n\t\t\t}\n\t\t\t// adding Primary and Backup URl to storageArrayIdentifier, later to be used in management server\n\t\t\tif _, ok := storageArrayIdentifiers[*primaryURL]; ok {\n\t\t\t\tstorageArrayIdentifiers[*primaryURL] = append(storageArrayIdentifiers[*primaryURL], array.StorageArrayID)\n\t\t\t} else {\n\t\t\t\tstorageArrayIdentifiers[*primaryURL] = []string{array.StorageArrayID}\n\t\t\t}\n\t\t\tif _, ok := storageArrayIdentifiers[*backupURL]; ok {\n\t\t\t\tstorageArrayIdentifiers[*backupURL] = append(storageArrayIdentifiers[*backupURL], array.StorageArrayID)\n\t\t\t} else {\n\t\t\t\tstorageArrayIdentifiers[*backupURL] = []string{array.StorageArrayID}\n\t\t\t}\n\n\t\t\t// Reading proxy credentials for the array\n\t\t\tif len(array.ProxyCredentialSecrets) > 0 {\n\t\t\t\tproxy.managedArrays[array.StorageArrayID].ProxyCredentialSecrets = make(map[string]ProxyCredentialSecret)\n\t\t\t\tfor _, secret := range array.ProxyCredentialSecrets {\n\t\t\t\t\tproxyCredentials, err := k8sUtils.GetCredentialsFromSecretName(secret)\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\tproxyCredentialSecret := &ProxyCredentialSecret{\n\t\t\t\t\t\tCredentials: *proxyCredentials,\n\t\t\t\t\t\tCredentialSecret: secret,\n\t\t\t\t\t}\n\t\t\t\t\tproxy.managedArrays[array.StorageArrayID].ProxyCredentialSecrets[secret] = *proxyCredentialSecret\n\t\t\t\t\tproxy.updateProxyCredentials(*proxyCredentials, array.StorageArrayID)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor _, managementServer := range config.ManagementServerConfig {\n\t\t\tvar arrayCredentials common.Credentials\n\t\t\tif managementServer.ArrayCredentialSecret != \"\" {\n\t\t\t\tcredentials, err := k8sUtils.GetCredentialsFromSecretName(managementServer.ArrayCredentialSecret)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tarrayCredentials = *credentials\n\t\t\t}\n\t\t\tmgmtURL, err := url.Parse(managementServer.URL)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tvar certFile string\n\t\t\tif managementServer.CertSecret != \"\" {\n\t\t\t\tcertFile, err = k8sUtils.GetCertFileFromSecretName(managementServer.CertSecret)\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\tproxy.managementServers[*mgmtURL] = &ManagementServer{\n\t\t\t\tURL: *mgmtURL,\n\t\t\t\tStorageArrayIdentifiers: storageArrayIdentifiers[*mgmtURL],\n\t\t\t\tSkipCertificateValidation: managementServer.SkipCertificateValidation,\n\t\t\t\tCertFile: certFile,\n\t\t\t\tCertSecret: managementServer.CertSecret,\n\t\t\t\tCredentials: arrayCredentials,\n\t\t\t\tCredentialSecret: managementServer.ArrayCredentialSecret,\n\t\t\t\tLimits: managementServer.Limits,\n\t\t\t}\n\t\t}\n\t\tproxyConfig.StandAloneProxyConfig = &proxy\n\t} else {\n\t\treturn fmt.Errorf(\"unknown proxy mode: %s specified\", string(proxyMode))\n\t}\n\tif proxyConfig.LinkProxyConfig == nil && proxyConfig.StandAloneProxyConfig == nil {\n\t\treturn fmt.Errorf(\"no configuration provided for the proxy\")\n\t}\n\treturn nil\n}", "func WithConfig(c *Config) OptionFunc {\n\treturn func(b *Bot) {\n\t\tb.conf = c\n\t}\n}", "func NewProxy(opts ...ProxyOption) (*Proxy, error) {\n\tvar err error\n\tp := Proxy{\n\t\tHeaders: http.Header{},\n\t}\n\tfor _, opt := range opts {\n\t\tif err = opt(&p); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &p, nil\n}", "func newReverseProxy(cfg *model.Config) *httputil.ReverseProxy {\n\tdirector := func(req *http.Request) {}\n\treturn &httputil.ReverseProxy{\n\t\tDirector: director,\n\t\tTransport: &http.Transport{\n\t\t\t// Proxy: func(req *http.Request) (*url.URL, error) {\n\t\t\t// \treturn http.ProxyFromEnvironment(req)\n\t\t\t// },\n\t\t\tDial: func(network, addr string) (net.Conn, error) {\n\n\t\t\t\tmaxTries := 3\n\t\t\t\twaitFor := time.Millisecond * time.Duration(1000)\n\n\t\t\t\tvar err error\n\t\t\t\tvar conn net.Conn\n\t\t\t\tfor tries := 0; tries < maxTries; tries++ {\n\n\t\t\t\t\tconn, err = (&net.Dialer{\n\t\t\t\t\t\tTimeout: 30 * time.Second,\n\t\t\t\t\t\tKeepAlive: 30 * time.Second,\n\t\t\t\t\t}).Dial(network, addr)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogrus.Warnf(\"Dial failed, retrying (%s)\", err.Error())\n\t\t\t\t\t\ttime.Sleep(waitFor)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\treturn conn, err\n\t\t\t},\n\t\t\t// TLSHandshakeTimeout: 10 * time.Second,\n\t\t},\n\t}\n}", "func Proxy(proxy func(*http.Request) (*url.URL, error)) func(*Attacker) {\n\treturn func(a *Attacker) {\n\t\ttr := a.client.Transport.(*http.Transport)\n\t\ttr.Proxy = proxy\n\t}\n}", "func (p *Proxy) Config(conf ConfData) {\n\tp.configMutex.Lock()\n\tif conf.DestAddr.String() != p.destAddr.String() {\n\t\tp.connMutex.Lock()\n\t\tp.destAddr = conf.DestAddr\n\t\tp.connMutex.Unlock()\n\t}\n\tp.configMutex.Unlock()\n}", "func SetProxy(p string, verifyssl bool) {\n\tif p != \"\" && p != \"none\" {\n\t\tproxyUrl, _ := url.Parse(p)\n\t\tclient = &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyUrl), TLSClientConfig: &tls.Config{InsecureSkipVerify: verifyssl}}}\n\t} else {\n\t\tclient = &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: verifyssl}}}\n\t}\n}", "func (p *Proxier) WithProxyDB(proxyDB proxy.ProxyDB) *Proxier {\n\tp.proxyDB = proxyDB\n\treturn p\n}", "func (m *MockProxyClient) ProxyFlowConfig(ctx context.Context, in *ProxyFlowConfigRequestMsg, opts ...grpc.CallOption) (*ProxyResponseMsg, error) {\n\tvarargs := []interface{}{ctx, in}\n\tfor _, a := range opts {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"ProxyFlowConfig\", varargs...)\n\tret0, _ := ret[0].(*ProxyResponseMsg)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func OptionEnableProxyProtocol(enabled bool, subnet string) Option {\n\treturn func(cfg *gwconfig) {\n\t\tcfg.proxyProtocolEnabled = enabled\n\t\tcfg.proxyProtocolSubnet = subnet\n\t}\n}", "func newProxy(config *Config) (*oauthProxy, error) {\n\t// create the service logger\n\tlog, err := createLogger(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Info(\"starting the service\", zap.String(\"prog\", prog), zap.String(\"author\", author), zap.String(\"version\", version))\n\tsvc := &oauthProxy{\n\t\tconfig: config,\n\t\tlog: log,\n\t\tmetricsHandler: prometheus.Handler(),\n\t}\n\n\t// parse the upstream endpoint\n\tif svc.endpoint, err = url.Parse(config.Upstream); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// initialize the store if any\n\tif config.StoreURL != \"\" {\n\t\tif svc.store, err = createStorage(config.StoreURL); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// initialize the openid client\n\tif !config.SkipTokenVerification {\n\t\tif svc.client, svc.idp, svc.idpClient, err = svc.newOpenIDClient(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tlog.Warn(\"TESTING ONLY CONFIG - the verification of the token have been disabled\")\n\t}\n\n\tif config.ClientID == \"\" && config.ClientSecret == \"\" {\n\t\tlog.Warn(\"client credentials are not set, depending on provider (confidential|public) you might be unable to auth\")\n\t}\n\n\t// are we running in forwarding mode?\n\tif config.EnableForwarding {\n\t\tif err := svc.createForwardingProxy(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif err := svc.createReverseProxy(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn svc, nil\n}", "func (p *proxySettings) buildProxySettings(proxyListenerMode types.ProxyListenerMode) *webclient.ProxySettings {\n\tproxySettings := webclient.ProxySettings{\n\t\tTLSRoutingEnabled: proxyListenerMode == types.ProxyListenerMode_Multiplex,\n\t\tAssistEnabled: p.cfg.Proxy.AssistAPIKey != \"\",\n\t\tKube: webclient.KubeProxySettings{\n\t\t\tEnabled: p.cfg.Proxy.Kube.Enabled,\n\t\t},\n\t\tSSH: webclient.SSHProxySettings{\n\t\t\tListenAddr: p.proxySSHAddr.String(),\n\t\t\tTunnelListenAddr: p.cfg.Proxy.ReverseTunnelListenAddr.String(),\n\t\t\tWebListenAddr: p.cfg.Proxy.WebAddr.String(),\n\t\t},\n\t}\n\n\tp.setProxyPublicAddressesSettings(&proxySettings)\n\n\tif !p.cfg.Proxy.MySQLAddr.IsEmpty() {\n\t\tproxySettings.DB.MySQLListenAddr = p.cfg.Proxy.MySQLAddr.String()\n\t}\n\n\tif !p.cfg.Proxy.PostgresAddr.IsEmpty() {\n\t\tproxySettings.DB.PostgresListenAddr = p.cfg.Proxy.PostgresAddr.String()\n\t}\n\n\tif !p.cfg.Proxy.MongoAddr.IsEmpty() {\n\t\tproxySettings.DB.MongoListenAddr = p.cfg.Proxy.MongoAddr.String()\n\t}\n\n\tif p.cfg.Proxy.Kube.Enabled {\n\t\tproxySettings.Kube.ListenAddr = p.cfg.Proxy.Kube.ListenAddr.String()\n\t}\n\treturn &proxySettings\n}", "func (a *Agent) applyProxyConfigDefaults(p *structs.ConnectManagedProxy) (map[string]interface{}, error) {\n\tif p == nil || p.ProxyService == nil {\n\t\t// Should never happen but protect from panic\n\t\treturn nil, fmt.Errorf(\"invalid proxy state\")\n\t}\n\n\t// Lookup the target service\n\ttarget := a.State.Service(p.TargetServiceID)\n\tif target == nil {\n\t\t// Can happen during deregistration race between proxy and scheduler.\n\t\treturn nil, fmt.Errorf(\"unknown target service ID: %s\", p.TargetServiceID)\n\t}\n\n\t// Merge globals defaults\n\tconfig := make(map[string]interface{})\n\tfor k, v := range a.config.ConnectProxyDefaultConfig {\n\t\tif _, ok := config[k]; !ok {\n\t\t\tconfig[k] = v\n\t\t}\n\t}\n\n\t// Copy config from the proxy\n\tfor k, v := range p.Config {\n\t\tconfig[k] = v\n\t}\n\n\t// Set defaults for anything that is still not specified but required.\n\t// Note that these are not included in the content hash. Since we expect\n\t// them to be static in general but some like the default target service\n\t// port might not be. In that edge case services can set that explicitly\n\t// when they re-register which will be caught though.\n\tif _, ok := config[\"bind_port\"]; !ok {\n\t\tconfig[\"bind_port\"] = p.ProxyService.Port\n\t}\n\tif _, ok := config[\"bind_address\"]; !ok {\n\t\t// Default to binding to the same address the agent is configured to\n\t\t// bind to.\n\t\tconfig[\"bind_address\"] = a.config.BindAddr.String()\n\t}\n\tif _, ok := config[\"local_service_address\"]; !ok {\n\t\t// Default to localhost and the port the service registered with\n\t\tconfig[\"local_service_address\"] = fmt.Sprintf(\"127.0.0.1:%d\", target.Port)\n\t}\n\n\t// Basic type conversions for expected types.\n\tif raw, ok := config[\"bind_port\"]; ok {\n\t\tswitch v := raw.(type) {\n\t\tcase float64:\n\t\t\t// Common since HCL/JSON parse as float64\n\t\t\tconfig[\"bind_port\"] = int(v)\n\n\t\t\t// NOTE(mitchellh): No default case since errors and validation\n\t\t\t// are handled by the ServiceDefinition.Validate function.\n\t\t}\n\t}\n\n\treturn config, nil\n}", "func (d *Dialer) DialProxyContext(ctx context.Context) (net.Conn, error) {\n\treturn d.DialContext(ctx, \"tcp\", \"\")\n}", "func InjectConfig(readOrigin func() ([]byte, error),\n\twriteInjected func([]byte) error,\n\tproxyURL string) (origin *config.Config, injected *config.Config, err error) {\n\tcfgData, err := readOrigin()\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"read origin file failed\")\n\t}\n\n\torigin = &config.Config{}\n\tinjected = &config.Config{}\n\tif err := yaml.Unmarshal(cfgData, &origin); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif err := yaml.Unmarshal(cfgData, &injected); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tfor _, job := range injected.ScrapeConfigs {\n\t\tif job.Params == nil {\n\t\t\tjob.Params = map[string][]string{}\n\t\t}\n\t\tjob.Params[jobNameFormName] = []string{job.JobName}\n\n\t\tu, _ := url.Parse(proxyURL)\n\t\tjob.HTTPClientConfig.ProxyURL = config_util.URL{\n\t\t\tURL: u,\n\t\t}\n\t\tjob.Scheme = \"http\"\n\t}\n\n\tgen, err := yaml.Marshal(&injected)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"marshal config failed\")\n\t}\n\n\tif err := writeInjected(gen); err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"write file failed\")\n\t}\n\n\treturn origin, injected, nil\n}", "func TransportWithProxyTarget(t *http.Transport, fixedProxyUrl string, fixedProxyTarget string) *http.Transport {\n\tt.Proxy = ProxyFuncWithTargetOrDefault(fixedProxyUrl, fixedProxyTarget, t.Proxy)\n\treturn t\n}", "func (f CoolProxy) ProxyMode() types.ProxyMode {\n\treturn types.MasterProxy\n}", "func (cfg *BaseProxyConf) decorate(prefix string, name string, section *ini.Section) error {\n\t// proxy_name\n\tcfg.ProxyName = prefix + name\n\n\t// metas_xxx\n\tcfg.Metas = GetMapWithoutPrefix(section.KeysHash(), \"meta_\")\n\n\t// bandwidth_limit\n\tif bandwidth, err := section.GetKey(\"bandwidth_limit\"); err == nil {\n\t\tcfg.BandwidthLimit, err = NewBandwidthQuantity(bandwidth.String())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// plugin_xxx\n\tcfg.LocalSvrConf.PluginParams = GetMapByPrefix(section.KeysHash(), \"plugin_\")\n\n\t// custom logic code\n\tif cfg.HealthCheckType == \"tcp\" && cfg.Plugin == \"\" {\n\t\tcfg.HealthCheckAddr = cfg.LocalIP + fmt.Sprintf(\":%d\", cfg.LocalPort)\n\t}\n\n\tif cfg.HealthCheckType == \"http\" && cfg.Plugin == \"\" && cfg.HealthCheckURL != \"\" {\n\t\ts := \"http://\" + net.JoinHostPort(cfg.LocalIP, strconv.Itoa(cfg.LocalPort))\n\t\tif !strings.HasPrefix(cfg.HealthCheckURL, \"/\") {\n\t\t\ts += \"/\"\n\t\t}\n\t\tcfg.HealthCheckURL = s + cfg.HealthCheckURL\n\t}\n\n\treturn nil\n}", "func proxy(w http.ResponseWriter, r *http.Request) {\n\tproxy := httputil.NewSingleHostReverseProxy(&serverConfig.ProxyURL)\n\tproxy.ServeHTTP(w, r)\n}", "func (o KubernetesClusterHttpProxyConfigOutput) HttpProxy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v KubernetesClusterHttpProxyConfig) *string { return v.HttpProxy }).(pulumi.StringPtrOutput)\n}", "func (o MustGatherSpecProxyConfigPtrOutput) HttpProxy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *MustGatherSpecProxyConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.HttpProxy\n\t}).(pulumi.StringPtrOutput)\n}", "func (c *ThreeScaleClient) PromoteProxyConfig(svcId string, env string, version string, toEnv string) (ProxyConfigElement, error) {\n\tvar pe ProxyConfigElement\n\tendpoint := fmt.Sprintf(proxyConfigPromote, svcId, env, version)\n\n\tvalues := url.Values{}\n\tvalues.Add(\"to\", toEnv)\n\n\tbody := strings.NewReader(values.Encode())\n\treq, err := c.buildPostReq(endpoint, body)\n\tif err != nil {\n\t\treturn pe, httpReqError\n\t}\n\n\tresp, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn pe, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\terr = handleJsonResp(resp, http.StatusCreated, &pe)\n\treturn pe, err\n}", "func Proxy(c *gin.Context) {\n\tc.Request.RequestURI = \"\"\n\tnewURLString := fmt.Sprintf(\"http://%s%s?%s\", os.Getenv(\"GUARTZ_HOST\"), c.Request.URL.Path, c.Request.URL.RawQuery)\n\tnewURL, err := url.Parse(newURLString)\n\n\tc.Request.URL = newURL\n\tclient := http.Client{}\n\tresp, err := client.Do(c.Request)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, \"\")\n\t\treturn\n\t}\n\tjsonDataFromHTTP, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, \"\")\n\t\treturn\n\t}\n\tc.Header(\"Content-Type\", \"application/json\")\n\tc.Writer.WriteHeader(resp.StatusCode)\n\tc.Writer.Write(jsonDataFromHTTP)\n}", "func NewProxy() *ProxyBuilder {\n\treturn &ProxyBuilder{}\n}", "func (p *proxySettings) buildProxySettingsV2(proxyListenerMode types.ProxyListenerMode) *webclient.ProxySettings {\n\tmultiplexAddr := p.cfg.Proxy.WebAddr.String()\n\tsettings := p.buildProxySettings(proxyListenerMode)\n\tif proxyListenerMode == types.ProxyListenerMode_Multiplex {\n\t\tsettings.SSH.ListenAddr = multiplexAddr\n\t\tsettings.SSH.TunnelListenAddr = multiplexAddr\n\t\tsettings.SSH.WebListenAddr = multiplexAddr\n\t\tsettings.Kube.ListenAddr = multiplexAddr\n\t\tsettings.DB.MySQLListenAddr = multiplexAddr\n\t\tsettings.DB.PostgresListenAddr = multiplexAddr\n\t}\n\treturn settings\n}", "func NewProxy(c *Config) (p Proxy, err error) {\n\n\tproxyPaths := []string{\"go-mlbam-proxy\", \"go-mlbam-proxy/go-mlbam-proxy\", \"/usr/local/bin/go-mlbam-proxy\"}\n\tfor _, path := range proxyPaths {\n\t\tif p.path, err = exec.LookPath(path); err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif p.path == \"\" {\n\t\terr = errors.New(\"unable to find go-mlbam-proxy in path\")\n\t\treturn\n\t}\n\n\tp.domain = c.Proxy.Domain\n\tp.sourceDomains = c.Proxy.SourceDomains\n\tp.port = \"9876\"\n\n\tp.cmd = exec.Command(p.path, \"-d\", p.domain, \"-p\", p.port, \"-s\", p.sourceDomains)\n\tp.cmd.Env = os.Environ()\n\n\tlog.WithFields(log.Fields{\n\t\t\"path\": p.path,\n\t\t\"domain\": p.domain,\n\t\t\"sourceDomains\": p.sourceDomains,\n\t\t\"port\": p.port,\n\t}).Debug(\"NewProxy\")\n\n\treturn\n}", "func GetConf() ProxyConf {\n\treturn getConf()\n}", "func WithLogger(logger Logger) Option {\n\treturn func(p *proxy) {\n\t\tp.logger = logger\n\t}\n}", "func WrapRoundTripper(f func(http.RoundTripper) http.RoundTripper) ConfigOpt {\n\treturn func(c *Config) {\n\t\tif f != nil {\n\t\t\tif rt := f(c.client.Transport); rt != nil {\n\t\t\t\tc.client.Transport = rt\n\t\t\t}\n\t\t}\n\t}\n}", "func NewProxy(opts ...options.Option) proxy.Proxy {\n\tp := new(Proxy)\n\tp.Links = map[string]client.Client{}\n\tp.Options = options.NewOptions(opts...)\n\tp.Options.Init(options.WithString(\"mucp\"))\n\n\t// get endpoint\n\tep, ok := p.Options.Values().Get(\"proxy.endpoint\")\n\tif ok {\n\t\tp.Endpoint = ep.(string)\n\t}\n\n\t// get client\n\tc, ok := p.Options.Values().Get(\"proxy.client\")\n\tif ok {\n\t\tp.Client = c.(client.Client)\n\t}\n\n\t// set the default client\n\tif p.Client == nil {\n\t\tp.Client = mucp.NewClient()\n\t}\n\n\t// get client\n\tlinks, ok := p.Options.Values().Get(\"proxy.links\")\n\tif ok {\n\t\tp.Links = links.(map[string]client.Client)\n\t}\n\n\t// get router\n\tr, ok := p.Options.Values().Get(\"proxy.router\")\n\tif ok {\n\t\tp.Router = r.(router.Router)\n\t}\n\n\t// create default router and start it\n\tif p.Router == nil {\n\t\tp.Router = router.DefaultRouter\n\t}\n\n\t// routes cache\n\tp.Routes = make(map[string]map[uint64]router.Route)\n\n\tgo func() {\n\t\t// continuously attempt to watch routes\n\t\tfor {\n\t\t\t// watch the routes\n\t\t\tp.watchRoutes()\n\t\t\t// in case of failure just wait a second\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\t// TODO: speed up refreshing of metrics\n\t\t// without this ticking effort e.g stream\n\t\tt := time.NewTicker(time.Second * 10)\n\t\tdefer t.Stop()\n\n\t\t// we must refresh route metrics since they do not trigger new events\n\t\tfor range t.C {\n\t\t\t// refresh route metrics\n\t\t\tp.refreshMetrics()\n\t\t}\n\t}()\n\n\treturn p\n}", "func DefaultProxyConf(proxyType string) ProxyConf {\n\tconf := NewConfByType(proxyType)\n\tif conf != nil {\n\t\tconf.SetDefaultValues()\n\t}\n\treturn conf\n}", "func (vaultInjector *VaultInjector) proxyMode(annotations map[string]string) (string, error) {\n\tproxyPort := annotations[vaultInjector.VaultInjectorAnnotationsFQ[vaultInjectorAnnotationProxyPortKey]]\n\n\tif proxyPort == \"\" { // Default port\n\t\tproxyPort = vaultProxyDefaultPort\n\t}\n\n\tproxyConfig := strings.Replace(vaultInjector.ProxyConfig, vaultProxyPortPlaceholder, proxyPort, -1)\n\n\treturn proxyConfig, nil\n}", "func (F *Frisby) SetProxy(url string) *Frisby {\n\tF.Req.Proxy = url\n\treturn F\n}", "func GetConfig() ProxyConfig {\n\tonce.Do(InitConfig)\n\treturn conf\n}", "func wrapConfigFn(cf *CLIConf) func(c *rest.Config) *rest.Config {\n\treturn func(c *rest.Config) *rest.Config {\n\t\tc.Wrap(\n\t\t\tfunc(rt http.RoundTripper) http.RoundTripper {\n\t\t\t\tif cf.SampleTraces {\n\t\t\t\t\t// If the user wants to sample traces, wrap the transport with a trace\n\t\t\t\t\t// transport.\n\t\t\t\t\treturn tracehttp.NewTransport(rt)\n\t\t\t\t}\n\t\t\t\treturn rt\n\t\t\t},\n\t\t)\n\t\treturn c\n\t}\n}", "func WithConfig(config string) func(*Client) error {\n\treturn func(c *Client) error {\n\t\tc.config = config\n\t\treturn nil\n\t}\n}", "func CreateProxyClient(config ProxyConfig) (ProxyClient, error) {\n\tswitch config.Protocol {\n\tcase \"direct\":\n\t\tif config.Transport != nil {\n\t\t\treturn nil, errors.New(\n\t\t\t\t\"'direct' protocol should not have any transport setting\")\n\t\t}\n\t\tif len(config.Settings) > 0 {\n\t\t\treturn nil, errors.New(\n\t\t\t\t\"'direct' protocol should not have any extra setting\")\n\t\t}\n\t\treturn DirectTCPClient{}, nil\n\n\tcase \"http\":\n\t\tif config.Transport != nil {\n\t\t\treturn nil, errors.New(\n\t\t\t\t\"'http' protocol should not have any transport setting\")\n\t\t}\n\t\taddr, ok := config.Settings[\"address\"]\n\t\tif !ok || len(config.Settings) != 1 {\n\t\t\treturn nil, errors.New(\n\t\t\t\t\"'http' protocol should have one and only one\" +\n\t\t\t\t\t\" extra setting 'address'\")\n\t\t}\n\t\tif addrStr, ok := addr.(string); ok {\n\t\t\treturn HTTPTunnelClient{addrStr}, nil\n\t\t}\n\t\treturn nil, errors.New(\"a valid 'address' must be supplied\")\n\n\tcase \"socks5\":\n\t\treturn NewSOCKS5Client(config)\n\n\tdefault:\n\t\treturn nil, errors.New(\"unknown proxy protocol: \" + config.Protocol)\n\t}\n}", "func (c Client) WithConfig(conf *Config) Client {\n\tif conf.DefaultHeaders != nil {\n\t\tc.headers = conf.DefaultHeaders\n\t}\n\tif conf.DefaultQueryParams != nil {\n\t\tc.queryParams = conf.DefaultQueryParams\n\t}\n\tc.baseURL = conf.BaseURL\n\n\treturn c\n}", "func New(cfg config.Proxy, bp httputil.BufferPool, prov service.Authorizationd) http.Handler {\n\tscheme := \"http\"\n\tif cfg.Scheme != \"\" {\n\t\tscheme = cfg.Scheme\n\t}\n\n\thost := fmt.Sprintf(\"%s:%d\", cfg.Host, cfg.Port)\n\n\treturn &httputil.ReverseProxy{\n\t\tBufferPool: bp,\n\t\tDirector: func(r *http.Request) {\n\t\t\tu := *r.URL\n\t\t\tu.Scheme = scheme\n\t\t\tu.Host = host\n\t\t\treq, err := http.NewRequest(r.Method, u.String(), r.Body)\n\t\t\tif err != nil {\n\t\t\t\tglg.Error(errors.Wrap(err, \"NewRequest returned error\"))\n\t\t\t\tr.URL.Scheme = scheme\n\t\t\t\treturn\n\t\t\t}\n\t\t\treq.Header = r.Header\n\t\t\treq.TLS = r.TLS\n\t\t\tif cfg.PreserveHost {\n\t\t\t\treq.Host = r.Host\n\t\t\t\tglg.Debugf(\"proxy.PreserveHost enabled, forward host header: %s\\n\", req.Host)\n\t\t\t}\n\t\t\tif cfg.ForceContentLength {\n\t\t\t\treq.ContentLength = r.ContentLength\n\t\t\t\treq.TransferEncoding = r.TransferEncoding\n\t\t\t\tglg.Debugf(\"proxy.ForceContentLength enabled, forward content-length header: %d\\n\", req.ContentLength)\n\t\t\t}\n\n\t\t\t*r = *req\n\t\t},\n\t\tTransport: &transport{\n\t\t\tprov: prov,\n\t\t\tRoundTripper: transportFromCfg(cfg.Transport),\n\t\t\tcfg: cfg,\n\t\t},\n\t\tErrorHandler: handleError,\n\t}\n}", "func WithAddr(addr string) Option {\n\treturn func(c *gatewayClient) {\n\t\tif len(addr) != 0 {\n\t\t\tc.addr = addr\n\t\t}\n\t}\n}", "func WithAddr(addr string) Option {\n\treturn func(c *config) {\n\t\tc.ListenAddr = addr\n\t\tc.LinkAddr = addr\n\t}\n}", "func WithLogger(logger *zap.Logger) Option {\n\treturn func(p *proxy) {\n\t\tp.logger = logger\n\t}\n}", "func ConfigureReverseProxy(S *server.SimpleServer, Client *client.SimpleClient, logger *log.Logger, RouteMatcher ReverseProxyRouterFunc, PathPrefix string) *server.SimpleServer {\n\n\t// If No server is provided, create a default HTTP Server.\n\tvar err error\n\tif S == nil {\n\t\tS = server.NewServerHTTP()\n\t}\n\n\t// Assert a non-empty path prefix to proxy on\n\tif PathPrefix == \"\" {\n\t\tPathPrefix = \"/\"\n\t}\n\n\t// If there's no logger provided, use the one from the server\n\tif logger == nil {\n\t\tlogger = S.Logger()\n\t}\n\n\t// If no client is given, attempt to create one, using any TLS resources the potential server had.\n\tif Client == nil {\n\t\tClient, err = client.NewClientHTTPS(S.TLSBundle())\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tClient.SetLogger(logger)\n\t}\n\n\tS.AddSubrouter(\n\t\tS.Router(),\n\t\tPathPrefix,\n\t\tserver.NewSimpleHandler(\n\t\t\tDoReverseProxy(\n\t\t\t\tClient,\n\t\t\t\tRouteMatcher,\n\t\t\t\tlogger,\n\t\t\t),\n\t\t\tPathPrefix,\n\t\t),\n\t)\n\n\treturn S\n}", "func createProxy(client client.Client) error {\n\tproxy := &configv1.Proxy{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"cluster\",\n\t\t},\n\t}\n\treturn client.Default().CRClient().Create(context.TODO(), proxy)\n}", "func NewProxy(\n\ttenant *clients.Tenant, wit clients.WIT, idler clients.IdlerService,\n\tstorageService storage.Store,\n\tconfig configuration.Configuration,\n\tclusters map[string]string) (Proxy, error) {\n\n\tp := Proxy{\n\t\tTenantCache: cache.New(30*time.Minute, 40*time.Minute),\n\t\tProxyCache: cache.New(15*time.Minute, 10*time.Minute),\n\t\tvisitLock: &sync.Mutex{},\n\t\ttenant: tenant,\n\t\twit: wit,\n\t\tidler: idler,\n\t\tbufferCheckSleep: 30 * time.Second,\n\t\tredirect: config.GetRedirectURL(),\n\t\tresponseTimeout: config.GetGatewayTimeout(),\n\t\tauthURL: config.GetAuthURL(),\n\t\tstorageService: storageService,\n\t\tindexPath: config.GetIndexPath(),\n\t\tmaxRequestRetry: config.GetMaxRequestRetry(),\n\t\tclusters: clusters,\n\t}\n\n\t//Initialize metrics\n\tRecorder.Initialize()\n\n\t//Spawn a routine to process buffered requests\n\tgo func() {\n\t\tp.ProcessBuffer()\n\t}()\n\treturn p, nil\n}", "func (o MustGatherSpecProxyConfigOutput) NoProxy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v MustGatherSpecProxyConfig) *string { return v.NoProxy }).(pulumi.StringPtrOutput)\n}", "func WrapConfig(hfn http.HandlerFunc, cfg *config.APICfg, brk brokers.Broker, str stores.Store, mgr *oldPush.Manager, c push.Client) http.HandlerFunc {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\tnStr := str.Clone()\n\t\tdefer nStr.Close()\n\t\tgorillaContext.Set(r, \"brk\", brk)\n\t\tgorillaContext.Set(r, \"str\", nStr)\n\t\tgorillaContext.Set(r, \"mgr\", mgr)\n\t\tgorillaContext.Set(r, \"apsc\", c)\n\t\tgorillaContext.Set(r, \"auth_resource\", cfg.ResAuth)\n\t\tgorillaContext.Set(r, \"auth_service_token\", cfg.ServiceToken)\n\t\tgorillaContext.Set(r, \"push_worker_token\", cfg.PushWorkerToken)\n\t\tgorillaContext.Set(r, \"push_enabled\", cfg.PushEnabled)\n\t\thfn.ServeHTTP(w, r)\n\n\t})\n}", "func (v *Verifier) Proxy(proxyURI string) *Verifier {\n\tv.proxyURI = proxyURI\n\treturn v\n}", "func (c *services) ProxyGet(scheme, name, port, path string, params map[string]string) rest.ResponseWrapper {\n\trequest := c.client.Get().\n\t\tPrefix(\"proxy\").\n\t\tNamespace(c.ns).\n\t\tResource(\"services\").\n\t\tName(net.JoinSchemeNamePort(scheme, name, port)).\n\t\tSuffix(path)\n\tfor k, v := range params {\n\t\trequest = request.Param(k, v)\n\t}\n\treturn request\n}", "func WithConfig(config Config) Option {\n\treturn func(d *D) {\n\t\td.config = config\n\t}\n}", "func (f Function) Proxy() ProxyFunc {\n\treturn func(args ...cty.Value) (cty.Value, error) {\n\t\treturn f.Call(args)\n\t}\n}" ]
[ "0.7345297", "0.7208164", "0.71902514", "0.71116483", "0.7076825", "0.69628906", "0.6940307", "0.69159514", "0.6877981", "0.67587405", "0.65878874", "0.6566005", "0.64126563", "0.6381108", "0.6376971", "0.63682663", "0.63555306", "0.6329982", "0.62516534", "0.6219726", "0.6211791", "0.61199754", "0.611863", "0.61041814", "0.61041814", "0.6088134", "0.6067136", "0.6052557", "0.6047807", "0.6027084", "0.60230714", "0.5935426", "0.5866358", "0.5864655", "0.5846325", "0.5837703", "0.5828808", "0.58060277", "0.5776764", "0.5773886", "0.5711876", "0.57116073", "0.57112455", "0.56908286", "0.56842715", "0.56688344", "0.5666933", "0.56572366", "0.5654574", "0.5651097", "0.56446433", "0.5623931", "0.5620989", "0.5609446", "0.55964816", "0.55895984", "0.558689", "0.5577544", "0.5575825", "0.55748457", "0.5570804", "0.5559173", "0.55495876", "0.55464035", "0.553438", "0.5523503", "0.5521388", "0.5501502", "0.549842", "0.5481555", "0.5441999", "0.54365116", "0.5423758", "0.54046", "0.5401908", "0.5392471", "0.5391947", "0.5382508", "0.5380778", "0.53702044", "0.5365428", "0.5363899", "0.5362292", "0.5344058", "0.5341475", "0.53379387", "0.5333963", "0.53217787", "0.5307933", "0.53001845", "0.5297336", "0.52963847", "0.5282929", "0.52721304", "0.5270326", "0.526657", "0.5262595", "0.52557623", "0.5253395", "0.5251889" ]
0.7866575
0
WithRoleTokenConfig returns a role token config functional option
WithRoleTokenConfig возвращает функциональную опцию конфигурации токена роли
func WithRoleTokenConfig(cfg config.RoleToken) GRPCOption { return func(h *GRPCHandler) { h.roleCfg = cfg } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *handler) RoleToken(w http.ResponseWriter, r *http.Request) error {\n\tdefer flushAndClose(r.Body)\n\n\tvar data model.RoleRequest\n\terr := json.NewDecoder(r.Body).Decode(&data)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttok, err := h.role(r.Context(), data.Domain, data.Role, data.ProxyForPrincipal, data.MinExpiry, data.MaxExpiry)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tw.Header().Set(\"Content-type\", \"application/json; charset=utf-8\")\n\treturn json.NewEncoder(w).Encode(tok)\n}", "func WithToken(t string) OptionFunc {\n\treturn func(b *Bot) {\n\t\tb.conf.Token = t\n\t}\n}", "func AssumeRoleTokenProvider(provider func() (string, error)) SessionOption {\n\treturn func(options *session.Options) {\n\t\toptions.AssumeRoleTokenProvider = provider\n\t}\n}", "func TokenConfig(globalConfig *viper.Viper) (*token.Config, error) {\n\tsub := subconfig(globalConfig, tokenConfigKey)\n\treturn token.Initialize(sub)\n}", "func WithToken(token string) {\n\tcfg.token = token\n\tcfg.Password = \"\"\n\tcfg.UserName = \"\"\n}", "func WithTokenFile(roleARN, path string) Option {\n\treturn func(s *DynamoDB) {\n\t\ts.roleARN = roleARN\n\t\ts.tokenFile = path\n\t}\n}", "func withRole(node *Role) roleOption {\n\treturn func(m *RoleMutation) {\n\t\tm.oldValue = func(context.Context) (*Role, error) {\n\t\t\treturn node, nil\n\t\t}\n\t\tm.id = &node.ID\n\t}\n}", "func withRole(node *Role) roleOption {\n\treturn func(m *RoleMutation) {\n\t\tm.oldValue = func(context.Context) (*Role, error) {\n\t\t\treturn node, nil\n\t\t}\n\t\tm.id = &node.ID\n\t}\n}", "func withRole(node *Role) roleOption {\n\treturn func(m *RoleMutation) {\n\t\tm.oldValue = func(context.Context) (*Role, error) {\n\t\t\treturn node, nil\n\t\t}\n\t\tm.id = &node.ID\n\t}\n}", "func (h *handler) RoleTokenProxy(w http.ResponseWriter, r *http.Request) error {\n\tdefer flushAndClose(r.Body)\n\n\trole := r.Header.Get(\"Athenz-Role\")\n\tdomain := r.Header.Get(\"Athenz-Domain\")\n\tprincipal := r.Header.Get(\"Athenz-Proxy-Principal\")\n\ttok, err := h.role(r.Context(), domain, role, principal, 0, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tr.Header.Set(h.cfg.RoleAuthHeader, tok.Token)\n\th.proxy.ServeHTTP(w, r)\n\treturn nil\n}", "func (c VaultConfig) GetToken() string {\n\treturn c.Token\n}", "func TokenOption(token string) Option {\n\treturn func(opts *options) {\n\t\topts.Token = token\n\t}\n}", "func (c Config) WithToken(token string) Config {\n\tc.Token = token\n\treturn c\n}", "func WithToken(with string) wrapping.Option {\n\treturn func() interface{} {\n\t\treturn OptionFunc(func(o *options) error {\n\t\t\to.withToken = with\n\t\t\treturn nil\n\t\t})\n\t}\n}", "func WithAdminToken(token string) TestContextOpt {\n\treturn func(tstContext *testContext) {\n\t\ttstContext.save.Globals.CachedToken = token\n\t}\n}", "func (a *authorizer) VerifyRoleToken(ctx context.Context, tok, act, res string) error {\n\treturn a.verify(ctx, token, tok, act, res)\n}", "func (cfg Config) GetToken() (token string) {\n\treturn cfg.Token\n}", "func WithToken(value string) OptFn {\n\treturn func(o *Opt) {\n\t\to.token = value\n\t}\n}", "func (c *configuration) Token(restConfig *RestConfig) Token {\n\tif restConfig != nil {\n\t\treturn Token(restConfig.Config.BearerToken)\n\t}\n\treturn \"\"\n}", "func MatchRoleToConfig(poolRole string, ec2Configs []rancherEc2.AWSEC2Config) *rancherEc2.AWSEC2Config {\n\tfor _, config := range ec2Configs {\n\t\thasMatch := false\n\t\tfor _, configRole := range config.Roles {\n\t\t\tif strings.Contains(poolRole, configRole) {\n\t\t\t\thasMatch = true\n\t\t\t}\n\t\t}\n\t\tif hasMatch {\n\t\t\treturn &config\n\t\t}\n\t}\n\treturn nil\n}", "func WithToken(s string) Option {\n\treturn func(o *options) {\n\t\to.token = s\n\t}\n}", "func WithToken(t Token) Option {\n\treturn option.New(optkeyToken, t)\n}", "func WithAccesToken(token string) ConfigOption {\n\treturn func(c *Config) {\n\t\tc.accessToken = token\n\t}\n}", "func WithRoleChangedListener(l RoleChangedListener) Option {\n\treturn func(o *config) {\n\t\to.RoleChanged = l\n\t}\n}", "func (conf *ConfigType) Role() Role {\n\treturn conf.role\n}", "func WithToken(val string) Option {\n\treturn func(m *metrics) {\n\t\tm.token = val\n\t}\n}", "func GetToken(ctx *pulumi.Context) string {\n\treturn config.Get(ctx, \"aws:token\")\n}", "func TokenRealm(tokenRealmString string) (*url.URL, error) {\n\tif len(tokenRealmString) == 0 {\n\t\t// If not specified, default to \"/openshift/token\", auto-detecting the scheme and host\n\t\treturn &url.URL{Path: defaultTokenPath}, nil\n\t}\n\n\ttokenRealm, err := url.Parse(tokenRealmString)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing URL in %s config option: %v\", tokenRealmKey, err)\n\t}\n\tif len(tokenRealm.RawQuery) > 0 || len(tokenRealm.Fragment) > 0 {\n\t\treturn nil, fmt.Errorf(\"%s config option may not contain query parameters or a fragment\", tokenRealmKey)\n\t}\n\tif len(tokenRealm.Path) > 0 {\n\t\treturn nil, fmt.Errorf(\"%s config option may not contain a path (%q was specified)\", tokenRealmKey, tokenRealm.Path)\n\t}\n\n\t// pin to \"/openshift/token\"\n\ttokenRealm.Path = defaultTokenPath\n\n\treturn tokenRealm, nil\n}", "func (a *Config) GetRole(c echo.Context) string {\n\treqToken := c.Request().Header.Get(\"Authorization\")\n\tsplitToken := strings.Split(reqToken, \"Bearer\")\n\tif len(splitToken) != 2 {\n\t\treturn \"\"\n\t}\n\treqToken = strings.TrimSpace(splitToken[1])\n\treturn a.Source.GetRoleByToken(reqToken)\n}", "func CreateWithToken(serverURL, clusterName, userName string, caCert []byte, token string) *clientcmdapi.Config {\n\tconfig := CreateBasic(serverURL, clusterName, userName, caCert)\n\tconfig.AuthInfos[userName] = &clientcmdapi.AuthInfo{\n\t\tToken: token,\n\t}\n\treturn config\n}", "func withRoleID(id int) roleOption {\n\treturn func(m *RoleMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Role\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Role, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Role.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "func withRoleID(id int) roleOption {\n\treturn func(m *RoleMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Role\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Role, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Role.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "func withRoleID(id int) roleOption {\n\treturn func(m *RoleMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Role\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Role, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Role.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "func jiraTokenFromConfig(config cfg.Config) (*oauth1.Token, bool) {\n\ttoken := config.GetConfigString(\"jira-token\")\n\tif token == \"\" {\n\t\treturn nil, false\n\t}\n\n\tsecret := config.GetConfigString(\"jira-secret\")\n\tif secret == \"\" {\n\t\treturn nil, false\n\t}\n\n\treturn &oauth1.Token{\n\t\tToken: token,\n\t\tTokenSecret: secret,\n\t}, true\n}", "func (m *SDSConfig) GetToken() *types.Struct {\n\tif m != nil {\n\t\treturn m.Token\n\t}\n\treturn nil\n}", "func Token(t string) Option {\n\treturn func(o *Options) {\n\t\to.Token = t\n\t}\n}", "func WithSecurityToken(securityToken string) configurer {\n\treturn func(conf *config) {\n\t\tfor _, sp := range conf.securityProviders {\n\t\t\tif bsp, ok := sp.(*BasicSecurityProvider); ok {\n\t\t\t\tsh := bsp.getSecurity()\n\t\t\t\tbsp.refresh(sh.ak, sh.sk, securityToken)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}", "func getUserTokenAuth(ctx context.Context, config Config, endpoints *Endpoints) Config {\n\tauthConfig := &oauth2.Config{\n\t\tClientID: \"cf\",\n\t\tScopes: []string{\"\"},\n\t\tEndpoint: oauth2.Endpoint{\n\t\t\tAuthURL: endpoints.Links.AuthEndpoint.URL + \"/oauth/auth\",\n\t\t\tTokenURL: endpoints.Links.TokenEndpoint.URL + \"/oauth/token\",\n\t\t},\n\t}\n\n\t// Token is expected to have no \"bearer\" prefix\n\ttoken := &oauth2.Token{\n\t\tAccessToken: config.Token,\n\t\tTokenType: \"Bearer\"}\n\n\tconfig.TokenSource = authConfig.TokenSource(ctx, token)\n\tconfig.HttpClient = oauth2.NewClient(ctx, config.TokenSource)\n\n\treturn config\n}", "func ConfigTokenKeyResolver(config *config.Configuration) TokenKeyResolver {\n\treturn func(token *jwt.Token) (interface{}, error) {\n\t\tb := config.Security.JWTSecret\n\t\treturn b, nil\n\t}\n}", "func NewConfigWithToken(token string) oauth2.TokenSource {\n\treturn oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: token},\n\t)\n}", "func JWTConfig() echo.MiddlewareFunc {\n\treturn middleware.JWTWithConfig(middleware.JWTConfig{\n\t\tClaims: &dtos.ClaimsDto{},\n\t\tSigningKey: []byte(tokenSecret),\n\t\t// ErrorHandler: func(e error) error {\n\t\t// \treturn dtos.APIResult{\n\t\t// \t\tErrorCode: http.StatusUnauthorized,\n\t\t// \t\tMessage: e.Error(),\n\t\t// \t}\n\t\t// },\n\t})\n}", "func (p *TempCredentialsProvider) getCredsWithRole() (credentials.Value, error) {\n\tlog.Println(\"Getting credentials with AssumeRole\")\n\n\tif p.config.RoleARN == \"\" {\n\t\treturn credentials.Value{}, errors.New(\"No role defined\")\n\t}\n\n\trole, err := p.assumeRoleFromCreds(p.masterCreds, true)\n\tif err != nil {\n\t\treturn credentials.Value{}, err\n\t}\n\n\tp.SetExpiration(*role.Expiration, DefaultExpirationWindow)\n\n\tlog.Printf(\"Using role %s, expires in %s\", formatKeyForDisplay(*role.AccessKeyId), time.Until(*role.Expiration).String())\n\treturn credentials.Value{\n\t\tAccessKeyID: *role.AccessKeyId,\n\t\tSecretAccessKey: *role.SecretAccessKey,\n\t\tSessionToken: *role.SessionToken,\n\t}, nil\n}", "func InstanceRole(role string) RequestOptionFunc {\n\treturn func(body *RequestBody) error {\n\t\tbody.Role = role\n\t\treturn nil\n\t}\n}", "func parseTokenConfig(config []byte) (*TokenGenerator, error) {\n\tvar parsedConfig *TokenGenerator\n\n\terr := json.Unmarshal(config, &parsedConfig)\n\n\treturn parsedConfig, err\n}", "func WithAccount(name string) TokenOption {\n return func(t *tokenOpts) {\n t.account = name\n }\n}", "func (m *VpnConfiguration) GetRole()(*string) {\n val, err := m.GetBackingStore().Get(\"role\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func exchangeToken(config *oauth2.Config, code string) (*oauth2.Token, error) {\n\t// Use the custom HTTP client when requesting a token.\n\t//httpClient := &http.Client{Timeout: 2 * time.Second}\n\t//ctx := context.Background()\n\t//context.WithValue(ctx, oauth2.HTTPClient, httpClient)\n\ttok, err := config.Exchange(context.TODO(), code)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"Unable to retrieve token\")\n\t}\n\treturn tok, nil\n}", "func (o BuildStrategySpecBuildStepsSecurityContextSeLinuxOptionsOutput) Role() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v BuildStrategySpecBuildStepsSecurityContextSeLinuxOptions) *string { return v.Role }).(pulumi.StringPtrOutput)\n}", "func WithWebhookSecurityToken(token string) WebhookOption {\n\treturn func(webhook *Webhook) {\n\t\twebhook.securityToken = token\n\t}\n}", "func (p *SQLResourcesClientDeleteSQLRoleDefinitionPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func WithVaultTokenSecretRef() InstallOsmOpt {\n\treturn func(opts *InstallOSMOpts) {\n\t\topts.SetOverrides = []string{\n\t\t\t\"osm.vault.secret.name=osm-vault-token\",\n\t\t\t\"osm.vault.secret.key=vault_token\",\n\t\t}\n\t}\n}", "func (o ClusterBuildStrategySpecBuildStepsSecurityContextSeLinuxOptionsOutput) Role() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ClusterBuildStrategySpecBuildStepsSecurityContextSeLinuxOptions) *string { return v.Role }).(pulumi.StringPtrOutput)\n}", "func (o BucketReplicationConfigOutput) Token() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *BucketReplicationConfig) pulumi.StringPtrOutput { return v.Token }).(pulumi.StringPtrOutput)\n}", "func (p *SQLResourcesClientCreateUpdateSQLRoleDefinitionPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func winrmConfig(state multistep.StateBag) (*communicator.WinRMConfig, error) {\n\tconfig := state.Get(\"config\").(*Config)\n\tpassword := state.Get(\"winrm_password\").(string)\n\n\treturn &communicator.WinRMConfig{\n\t\tUsername: config.Comm.WinRMUser,\n\t\tPassword: password,\n\t}, nil\n}", "func (m *SDSConfig) GetToken() map[string]interface{} {\n\tif m != nil {\n\t\treturn m.Token\n\t}\n\treturn nil\n}", "func (m *SDSConfig) GetToken() map[string]interface{} {\n\tif m != nil {\n\t\treturn m.Token\n\t}\n\treturn nil\n}", "func (m *SDSConfig) GetToken() map[string]interface{} {\n\tif m != nil {\n\t\treturn m.Token\n\t}\n\treturn nil\n}", "func (m *SDSConfig) GetToken() map[string]interface{} {\n\tif m != nil {\n\t\treturn m.Token\n\t}\n\treturn nil\n}", "func (m *SDSConfig) GetToken() map[string]interface{} {\n\tif m != nil {\n\t\treturn m.Token\n\t}\n\treturn nil\n}", "func exchangeToken(config *oauth2.Config, code string) (*oauth2.Token, error) {\n\ttok, err := config.Exchange(oauth2.NoContext, code)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to retrieve token %v\", err)\n\t}\n\treturn tok, nil\n}", "func WebhookTokenAuthenticator() *WebhookTokenAuthenticatorApplyConfiguration {\n\treturn &WebhookTokenAuthenticatorApplyConfiguration{}\n}", "func WithAuthToken(f func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\ttokenR := context.Get(r, repos.TokenR).(repos.TokenRepo)\n\t\tuserR := context.Get(r, repos.UserR).(repos.UserIdGetter)\n\t\tvar token string\n\t\tif r.Method == \"POST\" || r.Method == \"PUT\" {\n\t\t\ttoken = r.FormValue(\"token\")\n\t\t}\n\t\tif r.Method == \"GET\" {\n\t\t\tparams := r.URL.Query()\n\t\t\tif len(params[\"token\"]) == 0 {\n\t\t\t\tRespond(w, r, http.StatusUnauthorized, &ErrorDescriptor{Error: \"Send a token\", ErrorCode: 100})\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttoken = params[\"token\"][0]\n\t\t}\n\t\tlog.Printf(\"[INFOS] Token from user : %v \", token)\n\t\tid, err := tokenR.GetUserWithToken(token)\n\t\tu, err := userR.GetUserById(id)\n\t\tif err != nil {\n\t\t\t//context.Clear(r)\n\t\t\tlog.Print(\"[INFOS] [ERROR] Token submitted is invalid\")\n\t\t\tRespond(w, r, http.StatusUnauthorized, &ErrorDescriptor{Error: \"Invalid token \", ErrorCode: 100})\n\t\t\treturn\n\t\t}\n\t\tlog.Printf(\"[INFOS] User ID : %v \", u.ID)\n\t\tcontext.Set(r, \"user\", u)\n\t\tf(w, r)\n\t}\n}", "func (p *SQLResourcesDeleteSQLRoleDefinitionPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (p *SQLResourcesCreateUpdateSQLRoleDefinitionPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (i *integrationTest) withServiceAccountRole(sa string, inlinePolicy bool) *integrationTest {\n\trole := truncate.TruncateString(sa+\".sa.\"+i.clusterName, truncate.TruncateStringOptions{MaxLength: iam.MaxLengthIAMRoleName, AlwaysAddHash: false})\n\ti.expectServiceAccountRolePolicies = append(i.expectServiceAccountRolePolicies, fmt.Sprintf(\"aws_iam_role_%s_policy\", role))\n\tif inlinePolicy {\n\t\ti.expectServiceAccountRolePolicies = append(i.expectServiceAccountRolePolicies, fmt.Sprintf(\"aws_iam_role_policy_%s_policy\", role))\n\t}\n\treturn i\n}", "func grpcGetServiceConfigWithOauthToken(sa *string, ctx context.Context) (*serviceconfig.Service, error) {\n\t//scope := sm.CloudPlatformScope\n\tserverAddr := \"servicemanagement.googleapis.com\"\n\tserverAddrWithPort := \"servicemanagement.googleapis.com:443\"\n\tgetServiceConfigProtoReq := smp.GetServiceConfigRequest{\n\t\tServiceName: serviceName,\n\t}\n\tpool, _ := x509.SystemCertPool()\n\t// error handling omitted\n\tcreds := credentials.NewClientTLSFromCert(pool, serverAddrWithPort)\n\tcreds.OverrideServerName(serverAddr)\n\t//perRPC, _ := grpcOauth.NewServiceAccountFromFile(*sa, scope)\n\tbearerToken := \"Bearer ya29.c.ElrSBZKqpjJDEyFjqpfWF1s62FplR8at1Lvt2NDxFKShwNzJr6x2T0YK6ycldNv_ZlA4aNxBjL1jmZdBmjvf6733o8G9sCsxDWHWNgy9Wewz7Fz_Jo7bSaz0psc\"\n\n\t//md := metadata.Pairs(\"Authorization\", bearerToken)\n\t//cos := grpc.HeaderCallOption{\n\t//\tHeaderAddr: &md,\n\t//}\n\n\tperRPC := customJwt{\n\t\ttoken: bearerToken,\n\t}\n\n\tconn, _ := grpc.Dial(\n\t\tserverAddrWithPort,\n\t\tgrpc.WithPerRPCCredentials(&perRPC),\n\t\tgrpc.WithTransportCredentials(creds),\n\t)\n\t//grpc.Header()\n\tgscp, err := smp.NewServiceManagerClient(conn).GetServiceConfig(ctx, &getServiceConfigProtoReq)\n\tif err != nil {\n\t\tfmt.Println(\"Error while making grpc call: \", err)\n\t}\n\tfmt.Println(\"grpc call get name : \", gscp.GetName())\n\treturn gscp, err\n}", "func WithToken(ctx context.Context, token string) context.Context {\n\tif token != \"\" {\n\t\treturn rpc.WithOutgoingHeader(ctx, authenticationHeader, authenticationTokenPrefix+token)\n\t}\n\treturn ctx\n}", "func (c *configuration) Role(clientSet ClientSet) *Role {\n\tif clientSet != nil {\n\t\treturn NewRole(clientSet)\n\t}\n\treturn nil\n\n}", "func (c *Client) GetTokenSupplyWithConfig(ctx context.Context, mintAddr string, cfg rpc.GetTokenSupplyConfig) (uint64, uint8, error) {\n\tres, err := c.RpcClient.GetTokenSupplyWithConfig(ctx, mintAddr, cfg)\n\terr = checkRpcResult(res.GeneralResponse, err)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tbalance, err := strconv.ParseUint(res.Result.Value.Amount, 10, 64)\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"failed to cast token amount, err: %v\", err)\n\t}\n\treturn balance, res.Result.Value.Decimals, nil\n}", "func CreateConfigServiceToken(host string, verifyTLS bool, apiKey string, project string, config string, name string, expireAt time.Time, access string) (models.ConfigServiceToken, Error) {\n\tpostBody := map[string]interface{}{\"name\": name}\n\tif !expireAt.IsZero() {\n\t\tpostBody[\"expire_at\"] = expireAt.Unix()\n\t}\n\tpostBody[\"access\"] = access\n\n\tbody, err := json.Marshal(postBody)\n\tif err != nil {\n\t\treturn models.ConfigServiceToken{}, Error{Err: err, Message: \"Invalid service token info\"}\n\t}\n\n\tvar params []queryParam\n\tparams = append(params, queryParam{Key: \"project\", Value: project})\n\tparams = append(params, queryParam{Key: \"config\", Value: config})\n\n\turl, err := generateURL(host, \"/v3/configs/config/tokens\", params)\n\tif err != nil {\n\t\treturn models.ConfigServiceToken{}, Error{Err: err, Message: \"Unable to generate url\"}\n\t}\n\n\tstatusCode, _, response, err := PostRequest(url, verifyTLS, apiKeyHeader(apiKey), body)\n\tif err != nil {\n\t\treturn models.ConfigServiceToken{}, Error{Err: err, Message: \"Unable to create service token\", Code: statusCode}\n\t}\n\n\tvar result map[string]interface{}\n\terr = json.Unmarshal(response, &result)\n\tif err != nil {\n\t\treturn models.ConfigServiceToken{}, Error{Err: err, Message: \"Unable to parse API response\", Code: statusCode}\n\t}\n\n\ttokenResult, ok := result[\"token\"].(map[string]interface{})\n\tif !ok {\n\t\treturn models.ConfigServiceToken{}, Error{Err: fmt.Errorf(\"Unexpected type for token result in ConfigServiceToken, expected map[string]interface{}, got %T\", result[\"token\"]), Message: \"Unable to parse API response\", Code: statusCode}\n\t}\n\tinfo := models.ParseConfigServiceToken(tokenResult)\n\treturn info, Error{}\n}", "func HasRole(role string, token *jwt.Token) bool {\n\tfor _, r := range Roles(token) {\n\t\tif r == role {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func Roles(token *jwt.Token) []string {\n\treturn oauth.Roles(token)\n}", "func NewToken(id int, role string) (string, error) {\n\ttoken := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{\n\t\t\"role\": role,\n\t\t\"userID\": id,\n\t\t\"nbf\": time.Now().Unix(),\n\t\t\"iat\": time.Now().Unix(),\n\t\t\"exp\": time.Now().Local().Add(time.Hour*time.Duration(JWT_EXP_HOUR) + time.Minute*time.Duration(JWT_EXP_MIN) + time.Second*time.Duration(JWT_EXP_SEC)).Unix(),\n\t})\n\t// Sign and get the complete encoded token as a string using the secret\n\tsToken, err := token.SignedString([]byte(JWT_SECRET))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn sToken, nil\n}", "func (p *SQLResourcesClientDeleteSQLRoleAssignmentPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (p *SQLResourcesClientCreateUpdateSQLRoleAssignmentPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func Token(val string) Argument {\n\treturn func(request *requests.Request) error {\n\t\trequest.AddArgument(\"token\", val)\n\t\treturn nil\n\t}\n}", "func UpdateConfigToken(token string) error {\n\n\t// Reauthenticate against Vault and update in-memory config\n\tvc.SetToken(token)\n\tvc.Auth()\n\tcfg.Token = token\n\n\tpath, err := GetConfigPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcontent, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttoken_found := false\n\n\tlines := strings.Split(string(content), \"\\n\")\n\n\tfor i, line := range lines {\n\t\tif strings.HasPrefix(line, \"token:\") {\n\t\t\tlines[i] = \"token: \" + token\n\t\t\ttoken_found = true\n\t\t}\n\t}\n\n\tif !token_found {\n\t\tlines = append(lines, \"token: \"+token)\n\n\t}\n\n\toutput := strings.Join(lines, \"\\n\")\n\terr = ioutil.WriteFile(path, []byte(output), 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func Token(c *cli.Context) {\n\tconfigPath := c.GlobalString(\"config\")\n\n\tconfig, err := parseConfig(configPath)\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error parsing the config : %s\", err)\n\t\treturn\n\t}\n\n\tfmt.Print(string(authtoken.Token(config.HTTP.Login, config.HTTP.Password, config.HTTP.Salt)))\n}", "func (c *ConfigurationFile) GetRole() string {\n\treturn c.CurrentRole\n}", "func desiredRole(name string, contour *operatorv1alpha1.Contour) *rbacv1.Role {\n\trole := &rbacv1.Role{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Role\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: contour.Spec.Namespace.Name,\n\t\t\tName: name,\n\t\t},\n\t}\n\tgroupAll := []string{\"\"}\n\tverbCU := []string{\"create\", \"update\"}\n\tsecret := rbacv1.PolicyRule{\n\t\tVerbs: verbCU,\n\t\tAPIGroups: groupAll,\n\t\tResources: []string{\"secrets\"},\n\t}\n\trole.Rules = []rbacv1.PolicyRule{secret}\n\trole.Labels = map[string]string{\n\t\toperatorv1alpha1.OwningContourNameLabel: contour.Name,\n\t\toperatorv1alpha1.OwningContourNsLabel: contour.Namespace,\n\t}\n\treturn role\n}", "func withUserRole(t *testing.T, name string, spec types.RoleSpecV6) testOptionsFunc {\n\tt.Helper()\n\t// Create a new role with full access to all databases.\n\trole, err := types.NewRole(name, spec)\n\trequire.NoError(t, err)\n\treturn func(options *testOptions) {\n\t\toptions.userRoles = append(options.userRoles, role)\n\t}\n}", "func (p *SQLResourcesDeleteSQLRoleAssignmentPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (w *AWS) SessionToken(account, role, sessName string) string {\n\tctx := w.Ctx\n\tif account != \"\" {\n\t\tctx.Account = AccountID(account)\n\t}\n\tif sessName == \"\" {\n\t\tsessName = role\n\t}\n\treturn string(ctx.New(\"sts\", \"assumed-role/\", role, \"/\", sessName))\n}", "func (p *ManagedClustersCreateOrUpdatePoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (p *SQLResourcesCreateUpdateSQLRoleAssignmentPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (wh *AccountWarehouse) MintTokenWithTTL(ctx context.Context, params *ResourceParams) (*clouds.AwsResourceTokenResult, error) {\n\tsess, err := createSession()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif params.Ttl > params.MaxKeyTtl {\n\t\treturn nil, fmt.Errorf(\"given ttl [%s] is greater than max ttl [%s]\", params.Ttl, params.MaxKeyTtl)\n\t}\n\n\t// FIXME load in constructor function?\n\tsvcUserArn, err := wh.loadSvcUserArn(sess)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprincSpec := &principalSpec{\n\t\tdamPrincipalArn: svcUserArn,\n\t\tparams: params,\n\t}\n\n\tif params.Ttl > TemporaryCredMaxTtl {\n\t\tprincSpec.pType = userType\n\t} else {\n\t\tprincSpec.pType = roleType\n\t}\n\n\tvar polSpec *policySpec\n\tswitch params.ServiceTemplate.ServiceName {\n\tcase S3ItemFormat:\n\t\tbucket, ok := params.Vars[\"bucket\"]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no bucket specified\")\n\t\t}\n\t\trSpec := &resourceSpec{\n\t\t\tid: bucket,\n\t\t\tarn: fmt.Sprintf(\"arn:aws:s3:::%s/*\", bucket),\n\t\t\trType: bucketType,\n\t\t}\n\t\tpolSpec = &policySpec{\n\t\t\tprincipal: princSpec,\n\t\t\trSpecs: []*resourceSpec{rSpec},\n\t\t\tparams: params,\n\t\t}\n\tcase RedshiftItemFormat:\n\t\tclusterArn, ok := params.Vars[\"cluster\"]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no cluster specified\")\n\t\t}\n\t\tclusterSpec := &resourceSpec{\n\t\t\trType: otherRType,\n\t\t\tarn: clusterArn,\n\t\t\tid: extractClusterName(clusterArn),\n\t\t}\n\t\tdbuser := convertToAwsSafeIdentifier(params.UserId)\n\t\tuserSpec := &resourceSpec{\n\t\t\trType: otherRType,\n\t\t\tarn: calculateUserArn(clusterArn, dbuser),\n\t\t\tid: dbuser,\n\t\t}\n\t\tgroup, ok := params.Vars[\"group\"]\n\t\tvar rSpecs []*resourceSpec\n\t\tif ok {\n\t\t\trSpecs = []*resourceSpec{\n\t\t\t\tclusterSpec,\n\t\t\t\tuserSpec,\n\t\t\t\t{\n\t\t\t\t\trType: otherRType,\n\t\t\t\t\tarn: group,\n\t\t\t\t\tid: extractDBGroupName(group),\n\t\t\t\t},\n\t\t\t}\n\t\t} else {\n\t\t\trSpecs = []*resourceSpec{clusterSpec,userSpec}\n\t\t}\n\n\t\tpolSpec = &policySpec{\n\t\t\tprincipal: princSpec,\n\t\t\trSpecs: rSpecs,\n\t\t\tparams: params,\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized item format [%s] for AWS target adapter\", params.ServiceTemplate.ServiceName)\n\t}\n\n\tprincipalArn, err := ensurePrincipal(sess, princSpec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = ensurePolicy(sess, polSpec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn wh.ensureTokenResult(sess, principalArn, princSpec)\n}", "func (o BuildStrategySpecBuildStepsSecurityContextSeLinuxOptionsPtrOutput) Role() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *BuildStrategySpecBuildStepsSecurityContextSeLinuxOptions) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Role\n\t}).(pulumi.StringPtrOutput)\n}", "func (o AuthBackendRoleOutput) TokenTtl() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v *AuthBackendRole) pulumi.IntPtrOutput { return v.TokenTtl }).(pulumi.IntPtrOutput)\n}", "func RoleAuth(allowedRole string) gin.HandlerFunc {\n\t/*\n\t\tI am aware that this function or way is not scalable.\n\t\tIf this program has more than 2 roles, and several roles can access a request,\n\t\tit won't be able to check multiple roles.\n\t\tI might have the solution, but will do it if scaling is really required.\n\t*/\n\treturn func(c *gin.Context) {\n\t\tvar user models.User\n\t\tuserID, err := strconv.Atoi(c.Request.Header.Get(\"userID\"))\n\t\tif err != nil {\n\t\t\tc.JSON(http.StatusUnauthorized, gin.H{\"error\": err.Error()})\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tuserRole, err := user.GetUserRoleByID(userID)\n\t\tif err != nil {\n\t\t\tc.JSON(http.StatusUnauthorized, gin.H{\"error\": err.Error()})\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tif userRole != allowedRole {\n\t\t\tc.JSON(http.StatusUnauthorized, gin.H{\"error\": \"User is unauthorized to use this request.\"})\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tc.Next()\n\t}\n}", "func (c *Config) Role() int {\n\trole := c.Get(\"role\", \"follower\")\n\tswitch role {\n\tcase \"follower\":\n\t\treturn FOLLOWER\n\tcase \"leader\":\n\t\treturn LEADER\n\tdefault:\n\t\tlog.Panic(\"Invalid role: %s.\", role)\n\t}\n\treturn LEADER\n}", "func (o ClusterBuildStrategySpecBuildStepsSecurityContextSeLinuxOptionsPtrOutput) Role() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterBuildStrategySpecBuildStepsSecurityContextSeLinuxOptions) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Role\n\t}).(pulumi.StringPtrOutput)\n}", "func (workflow *pipelineWorkflow) pipelineToken(namespace string, tokenProvider func(bool) string, stackWaiter common.StackWaiter, params map[string]string) Executor {\n\treturn func() error {\n\t\tpipelineStackName := common.CreateStackName(namespace, common.StackTypePipeline, workflow.serviceName)\n\t\tpipelineStack := stackWaiter.AwaitFinalStatus(pipelineStackName)\n\t\tif workflow.pipelineConfig.Source.Provider == \"GitHub\" {\n\t\t\tparams[\"GitHubToken\"] = tokenProvider(pipelineStack == nil)\n\t\t}\n\t\treturn nil\n\t}\n}", "func WithRegistryServiceToken(serviceToken string) RegistryOption {\n\treturn func(o *registryOptions) { o.ServiceToken = serviceToken }\n}", "func (cfg *Config) SetToken(token string) {\n\tcfg.Token = token\n}", "func NamespaceWithTokenProvider(provider auth.TokenProvider) NamespaceOption {\n\treturn func(ns *Namespace) error {\n\t\tns.TokenProvider = provider\n\t\treturn nil\n\t}\n}", "func (o BucketReplicationConfigOutput) Role() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *BucketReplicationConfig) pulumi.StringOutput { return v.Role }).(pulumi.StringOutput)\n}", "func (p *ManagedClustersRunCommandPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func (p *CassandraClustersInvokeCommandPoller) ResumeToken() (string, error) {\n\treturn p.pt.ResumeToken()\n}", "func WithBearerToken(tok string) Option {\n\treturn func(opts *backendOptions) {\n\t\topts.bearerToken = tok\n\t}\n}" ]
[ "0.65500444", "0.6109445", "0.6060574", "0.5755772", "0.55504984", "0.5467545", "0.53978205", "0.53978205", "0.53978205", "0.5376566", "0.5308736", "0.5294586", "0.5285593", "0.52821636", "0.5274694", "0.52643675", "0.52467155", "0.51788664", "0.51758593", "0.5169364", "0.5164233", "0.5151515", "0.5142084", "0.5129196", "0.5127573", "0.5122581", "0.5110335", "0.5067846", "0.5052936", "0.50446373", "0.5004616", "0.5004616", "0.5004616", "0.49904737", "0.49724412", "0.49676013", "0.49645072", "0.49563572", "0.49477673", "0.49395123", "0.49386796", "0.4910788", "0.49039215", "0.4899813", "0.48884478", "0.48797986", "0.48662397", "0.4822583", "0.4818729", "0.47842252", "0.47842002", "0.47773448", "0.47763076", "0.47728503", "0.47658545", "0.47635928", "0.47635928", "0.47635928", "0.47635928", "0.47635928", "0.47608775", "0.47565466", "0.47533765", "0.47386616", "0.47367108", "0.4726273", "0.47238836", "0.4720535", "0.47133946", "0.47128886", "0.470667", "0.46927372", "0.46846107", "0.46800944", "0.4662495", "0.46496662", "0.4632899", "0.4632745", "0.4629959", "0.46252942", "0.4624123", "0.4620742", "0.46184355", "0.46168727", "0.46166828", "0.4614928", "0.4613741", "0.46090057", "0.45954958", "0.4589786", "0.45881295", "0.45829794", "0.45791775", "0.45632732", "0.456314", "0.45616817", "0.45539135", "0.45497206", "0.4535157", "0.45345095" ]
0.7468508
0
Gets the defender chance after accounting for modifiers
Получает шанс защитника с учетом модификаторов
func (c *Conflict) GetModDefenderChance() int32 { // TODO: Return modifier defender chance return c.BaseChance() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getDamage(attacker *pet, defender pet) (float64) {\n\tif doesCrit(attacker) {\n\t\treturn 2*(attacker.EffectiveATK * (100.00/(defender.EffectiveDEF + 100.00)))\n\t}\n\t\n\treturn attacker.EffectiveATK * (100.00/(defender.EffectiveDEF + 100.00))\n}", "func (c *Conflict) GetModAttackerChance() int32 {\n\t// TODO: Return modified attacker chance\n\treturn c.BaseChance()\n}", "func (g Gun)calculateDamage(bodyPart BodyArmor,attacker *Character, defender *Character)float64{\n\tcalibreIdx := getCalibreIdxFromCalibre(g.Calibre)\n\tdmgModifier := BODY_DAMAGE_MODIFIERS[bodyPart]\n\tdistance := calculateDistance(attacker.Location,defender.Location,attacker.isIndoor())\n\tdistanceModifier := math.Pow(CALIBRE_DAMAGE_FALLOFF[calibreIdx],distance/BULLET_DROPOFF_DISTANCE)\n\tbaseDamage := g.MaxDamage\n\tarmorDurability := defender.Armor[bodyPart].Durability/100\n\tbulletproofModifier := (100-defender.Armor[bodyPart].Bulletproof*(armorDurability))/100\n\tbulletAppropriateModifier := math.Abs(g.LoadedMagazine.ArmorPiercing-bulletproofModifier*100)/100\n\tbulletproofModifier = bulletproofModifier+bulletAppropriateModifier*BULLETPROOF_APPROPRIATE_MODIFIER\n\tdamage := baseDamage*dmgModifier*distanceModifier*bulletproofModifier\n\tdamage = pickRandomVariedAround(damage,DAMAGE_RANDOMNESS)\n\tif damage<0{\n\t\tdamage = 0\n\t}\n\tif LOG_MODE>=1{\n\t\tfmt.Printf(\"%s did %f damage to %s\\n\",attacker.Name,damage,defender.Name)\n\t}\n\tif LOG_MODE==DEBUG{\n\t\tfmt.Printf(\"Body part damage modifier: %f\\n\",dmgModifier)\n\t\tfmt.Printf(\"Distance: %f\\n\",distance)\n\t\tfmt.Printf(\"Distance modifier: %f\\n\",distanceModifier)\n\t\tfmt.Printf(\"Base damage: %f\\n\",baseDamage)\n\t\tfmt.Printf(\"Armor durability: %f\\n\",armorDurability)\n\t\tfmt.Printf(\"Bulletproof modifier: %f\\n\",bulletproofModifier)\n\t\tfmt.Printf(\"Bullet appropriate modifier: %f\\n\",bulletAppropriateModifier)\n\t}\n\n\treturn damage\n}", "func (m *Monster) BaseDamage() int {\n\tswitch m.id {\n\tcase Bat: // bats deal a base of 1 always\n\t\treturn 1\n\tdefault:\n\t\td := m.Info.Dmg\n\t\tif d < 1 {\n\t\t\td++\n\t\t} else {\n\t\t\td += rand.Intn(d)\n\t\t}\n\t\td += m.Info.Lvl\n\t\treturn d\n\t}\n}", "func chance(line *base.Line) {\n\tstr := line.Args[1]\n\tvar chance float64\n\n\tif strings.HasSuffix(str, \"%\") {\n\t\t// Handle 'chance of that is \\d+%'\n\t\tif i, err := strconv.Atoi(str[:len(str)-1]); err != nil {\n\t\t\tbot.ReplyN(line, \"'%s' didn't look like a % chance to me.\", str)\n\t\t\treturn\n\t\t} else {\n\t\t\tchance = float64(i) / 100\n\t\t}\n\t} else {\n\t\t// Assume the chance is a floating point number.\n\t\tif c, err := strconv.ParseFloat(str, 64); err != nil {\n\t\t\tbot.ReplyN(line, \"'%s' didn't look like a chance to me.\", str)\n\t\t\treturn\n\t\t} else {\n\t\t\tchance = c\n\t\t}\n\t}\n\n\t// Make sure the chance we've parsed lies in (0.0,1.0]\n\tif chance > 1.0 || chance <= 0.0 {\n\t\tbot.ReplyN(line, \"'%s' was outside possible chance ranges.\", str)\n\t\treturn\n\t}\n\n\t// Retrieve last seen ObjectId, replace with \"\"\n\tls := LastSeen(line.Args[0], \"\")\n\t// ok, we're good to update the chance.\n\tif fact := fc.GetById(ls); fact != nil {\n\t\t// Store the old chance, update with the new\n\t\told := fact.Chance\n\t\tfact.Chance = chance\n\t\t// Update the Modified field\n\t\tfact.Modify(line.Storable())\n\t\t// And store the new factoid data\n\t\tif err := fc.Update(bson.M{\"_id\": ls}, fact); err == nil {\n\t\t\tbot.ReplyN(line, \"'%s' was at %.0f%% chance, now is at %.0f%%.\",\n\t\t\t\tfact.Key, old*100, chance*100)\n\t\t} else {\n\t\t\tbot.ReplyN(line, \"I failed to replace '%s': %s\", fact.Key, err)\n\t\t}\n\t} else {\n\t\tbot.ReplyN(line, \"Whatever that was, I've already forgotten it.\")\n\t}\n}", "func (d *Decoder) Probability() int32 {\n\treturn pocketsphinx.GetProb(d.dec)\n}", "func (d *Degradater) RandomPercent() int {\n\treturn defaultSafeRander.Intn(101)\n}", "func doesHit(attacker *pet, defender pet) (bool){\n\tchanceToHit := float64(attacker.EffectiveACC) - defender.EffectiveEVA\n\t\n\tif float64(rand.Intn(100)) < chanceToHit {\n\t\treturn true\n\t}\n\t\n\t//fmt.Println(attacker.PetUser.Username, \" miss!\")\n\tattacker.MissCount++\n\treturn false\n}", "func GetProbability(l uint) float64 {\n\treturn 1.0 / math.Pow(2.0, float64(l))\n}", "func (c *Cell) ApplyChance(total uint64) {\n\tif total < c.count {\n\t\treturn\n\t}\n\tc.chance = (float64(c.count) / float64(total)) * 100.0\n}", "func (c *Creature) DetermineHealingRate() *Attribute {\n\n\thealingRate := &Attribute{\n\t\tName: \"Healing Rate\",\n\t\tMax: 21,\n\t}\n\n\tcon := c.Statistics[\"CON\"]\n\n\tcon.UpdateStatistic()\n\ttCon := con.Total\n\n\tswitch {\n\tcase tCon < 7:\n\t\thealingRate.Base = 1\n\tcase tCon < 13:\n\t\thealingRate.Base = 2\n\tcase tCon < 19:\n\t\thealingRate.Base = 3\n\tcase tCon > 18:\n\t\thealingRate.Base = ((tCon - 18) / 6) + 3\n\t}\n\thealingRate.Total = healingRate.Base + healingRate.Value\n\treturn healingRate\n}", "func (e *Explosion) MaxDamage() float64 {\n\treturn 100 + e.Strength*10\n}", "func (e Enemy) Damage() int {\n\treturn 10 * e.Level\n}", "func (c *Chance) Gender() string {\n\tif c.Bool() {\n\t\treturn \"male\"\n\t} else {\n\t\treturn \"female\"\n\t}\n}", "func boostChance(data *BoostCheckData) (int, []string) {\n\treasons := make([]string, 0)\n\tchance := 0\n\n\t// get region with highest winrate\n\thighestWr := 0\n\tvar highestWrRegion string\n\tfor region, wr := range data.Winrates {\n\t\tif wr > highestWr {\n\t\t\thighestWr = wr\n\t\t\thighestWrRegion = region\n\t\t}\n\t}\n\n\twrOnMostPlayedServer := data.Winrates[data.MostPlayedServer]\n\twrDiff := float64(highestWr - wrOnMostPlayedServer)\n\tchance = int(math.Min(wrDiff*3, 99.0))\n\twrDifference := \"Winrate on most played region (\" + data.MostPlayedServer + \", \" + strconv.Itoa(wrOnMostPlayedServer) + \"%) was \" + strconv.FormatFloat(wrDiff, 'f', 1, 64) + \" less than the highest winrate (\" + highestWrRegion + \", \" + strconv.Itoa(highestWr) + \"%)\"\n\treasons = append(reasons, wrDifference)\n\n\treturn chance, reasons\n}", "func (c *Creature) DetermineDamageBonus() *Attribute {\n\n\tdamageBonus := &Attribute{\n\t\tName: \"Damage Bonus\",\n\t\tMax: 21,\n\t\tDice: 1,\n\t}\n\n\tstr := c.Statistics[\"STR\"]\n\tsiz := c.Statistics[\"SIZ\"]\n\n\tstr.UpdateStatistic()\n\tsiz.UpdateStatistic()\n\n\tdb := siz.Total + str.Total\n\n\tswitch {\n\tcase db < 13:\n\t\tdamageBonus.Base = -4\n\t\tdamageBonus.Text = \"-1D4\"\n\tcase db < 25:\n\t\tdamageBonus.Base = 0\n\t\tdamageBonus.Text = \"-\"\n\tcase db < 33:\n\t\tdamageBonus.Base = 4\n\t\tdamageBonus.Text = \"+1D4\"\n\tcase db < 41:\n\t\tdamageBonus.Base = 6\n\t\tdamageBonus.Text = \"+1D6\"\n\tcase db < 57:\n\t\tdamageBonus.Base = 6\n\t\tdamageBonus.Dice = 2\n\t\tdamageBonus.Text = \"+2D6\"\n\tcase db > 56:\n\t\tdamageBonus.Base = 6\n\t\tdamageBonus.Dice = ((db - 56) / 16) + 2\n\t\tdamageBonus.Text = fmt.Sprintf(\"+%dD%d\",\n\t\t\tdamageBonus.Dice,\n\t\t\tdamageBonus.Base,\n\t\t)\n\t}\n\n\treturn damageBonus\n}", "func (f *Faker) Gender() string { return gender(f.Rand) }", "func Gender() string { return gender(globalFaker.Rand) }", "func (g *AllergyGenerator) randomReaction() string {\n\treturn g.reactions[rand.Intn(len(g.reactions))]\n}", "func DoDamage(a *Agent, d *Agent, odds int) string {\n\n\tvar damage int\n\tvar textOut string\n\n\t// Damage and max damage if it's a critical\n\tif Roll(1, 100) > a.TotalCritical() {\n\t\tdamage = Roll(2, a.TotalDamage())\n\t} else {\n\t\tdamage = a.TotalDamage()\n\t\ttextOut = fmt.Sprintf(CyanU(\"Critical\") + \" \")\n\t}\n\n\t// If damage is greater than the damage resist then subtract\n\tif damage > d.TotalResist() {\n\t\tdamage = damage - d.TotalResist()\n\t\t//if unlocked, damage = damage - TotalResist()\n\t\td.AdjHealth(0 - damage)\n\t\ttextOut = textOut + fmt.Sprintf(\"for %s damage. \", Red(strconv.Itoa(damage)))\n\t\ttextOut = textOut + fmt.Sprintf(\"%s's health = %s.\\n\", d.Name, Red(strconv.Itoa(d.Health.Val)))\n\t\t//else don't adjust\n\t} else {\n\t\tdamage = 0\n\t\ttextOut = textOut + fmt.Sprintf(\"%s! for %s damage. \", YellowU(\"Resist\"), Red(strconv.Itoa(damage)))\n\t\ttextOut = textOut + fmt.Sprintf(\"%s's health = %s.\\n\", d.Name, Red(strconv.Itoa(d.Health.Val)))\n\t}\n\n\t// Experience Reward\n\t// if this is a dead monster\n\t// Monster agents don't have a save file set\n\tif d.File == \"\" && d.Dead == true {\n\n\t\t// reverse the percentage\n\t\tmods := 100 - odds\n\n\t\tpercentage := float32(mods) * .01\n\n\t\t// reduce the drop by the reverse percentage\n\t\texp := float32(d.ExpDrop()) * percentage\n\n\t\t// int to float conversion rounds down towards zero by dropping\n\t\t// everything after the decimal point. So I add 1 to the exp here\n\t\t// so the player never gets 0 exp reward\n\t\texp++\n\n\t\t// exp is a float32 so do math with exp as an int\n\t\ta.Exp = a.Exp + int(exp)\n\n\t\ttextOut = textOut + fmt.Sprintf(Green(\"\\nYou gain %d experience.\\n\"), int(exp))\n\t\ta.Save()\n\t}\n\td.Save()\n\treturn textOut\n}", "func combat(health, damage float64) float64 {\n\tif math.Floor(damage) == 100.0 {\n\t\treturn 0\n\t}\n\n\thealth = health * damage / 100.0\n\tif health < 1.1 {\n\t\treturn 0\n\t}\n\n\treturn health\n}", "func weapon(char core.Character, c *core.Core, r int, param map[string]int) {\n\n\texpiry := 0\n\tper := 0.03 + 0.01*float64(r)\n\tstacks := 0\n\ticd := 0\n\n\tc.Events.Subscribe(core.OnDamage, func(args ...interface{}) bool {\n\n\t\tds := args[1].(*core.Snapshot)\n\n\t\tif ds.ActorIndex != char.CharIndex() {\n\t\t\treturn false\n\t\t}\n\t\tif ds.AttackTag != core.AttackTagNormal && ds.AttackTag != core.AttackTagExtra {\n\t\t\treturn false\n\t\t}\n\t\tif icd > c.F {\n\t\t\treturn false\n\t\t}\n\t\ticd = c.F + 18\n\t\tif expiry < c.F {\n\t\t\tstacks = 0\n\t\t}\n\t\tstacks++\n\t\tif stacks > 4 {\n\t\t\tstacks = 4\n\t\t}\n\t\texpiry = c.F + 360\n\t\treturn false\n\t}, fmt.Sprintf(\"prototype-rancour-%v\", char.Name()))\n\n\tval := make([]float64, core.EndStatType)\n\tchar.AddMod(core.CharStatMod{\n\t\tKey: \"prototype\",\n\t\tExpiry: -1,\n\t\tAmount: func(a core.AttackTag) ([]float64, bool) {\n\t\t\tif expiry < c.F {\n\t\t\t\tstacks = 0\n\t\t\t\treturn nil, false\n\t\t\t}\n\t\t\tval[core.ATKP] = per * float64(stacks)\n\t\t\tval[core.DEFP] = per * float64(stacks)\n\t\t\treturn val, true\n\t\t},\n\t})\n\n}", "func RandomMob(witch *Enemy, ghoul *Enemy, slime *Enemy, goblin *Enemy, gator *Enemy) *Enemy {\n roll := RandomNumber(5)\n mob := ghoul\n if roll == 3 {\n mob = witch\n } else if roll == 2 {\n mob = ghoul\n } else if roll == 1 {\n mob = slime\n } else if roll == 4 {\n mob = goblin\n } else if roll == 5 {\n mob = gator\n }\n mob.Health = mob.MaxHealth\n return mob\n}", "func (s *SoundGroup) MaxAudibleBehavior(behavior *C.FMOD_SOUNDGROUP_BEHAVIOR) error {\n\t//FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);\n\treturn ErrNoImpl\n}", "func (t *SBF) Probability() float64 {\n return t.probability\n}", "func rnd() float64 {\n\tss := *g_seed\n\tss += ss\n\tss ^= 1\n\tif int32(ss) < 0 {\n\t\tss ^= 0x88888eef\n\t}\n\t*g_seed = ss\n\treturn float64(*g_seed%95) / float64(95)\n}", "func rnd() float64 {\n\tss := *g_seed\n\tss += ss\n\tss ^= 1\n\tif int32(ss) < 0 {\n\t\tss ^= 0x88888eef\n\t}\n\t*g_seed = ss\n\treturn float64(*g_seed%95) / float64(95)\n}", "func randomGender() string {\n\trand.Seed(time.Now().UnixNano())\n\tcoinFlip := rand.Intn(2)\n\tif coinFlip > 0 {\n\t\treturn \"female\"\n\t}\n\treturn \"male\"\n\n}", "func (q *Question) Probability(a *Option) float32 {\n\ttotalCount := 0\n\n\tfor _, o := range q.Options {\n\t\ttotalCount += o.ResultCount\n\t}\n\n\tlogrus.WithField(\"total_count\", totalCount).Debug(\"Total Results\")\n\n\tif totalCount <= 0 {\n\t\treturn 0\n\t}\n\n\treturn (float32(a.ResultCount) / float32(totalCount)) * 100\n}", "func (f *Faker) PronounPossessive() string { return pronounPossessive(f.Rand) }", "func PronounPossessive() string { return pronounPossessive(globalFaker.Rand) }", "func (model *Way) normalProbability(cor Coordinate) float64 {\n\tvar NormalMean float64\n\tvar NormalDeviation float64 = 20 //Amount of expected GPS error\n\tprojection := model.FindProjection(cor)\n\tdistanceMeter := projection.Distance * float64(distanceMeterFactor)\n\t//Normal distribution formula\n\tprobability := 1 / (math.Sqrt(2*math.Pi) * NormalDeviation) * math.Exp(-(math.Pow(distanceMeter-NormalMean, 2) / (2 * math.Pow(NormalDeviation, 2))))\n\treturn probability\n}", "func Bonus(e *Employee, percent int) int {\n\treturn e.Salary * percent / 100\n}", "func GetBronzeBaseDefensePower() int {\n\treturn BronzeBaseDefensePower\n}", "func (s *ClampDirectionOffset) Restitution() float64 {\n\treturn s.restitution\n}", "func DuckReturnProb(a float64, t float64) float64 {\n\treturn (a*math.Exp(-t) +\n\t\t(4-3*a)*math.Exp(-2*t) +\n\t\t(2*a-4)*math.Exp(-4*t))\n}", "func (GuitarBass) DiezelHerbertAmplifier(){}", "func (list *SkipList) randLevel() int {\n\tvar level int = 1\n\tfor ((rand.Int63()>>32)&0xffff < DefaultProbability) && (level < list.maxLevel) {\n\t\tlevel++\n\t}\n\treturn level\n}", "func DefuseScore(g *Game, p *Player) (c *ScoreCard) {\n\n\tc = new(ScoreCard)\n\tc.Player = p\n\n\tif p.Dead {\n\t\tc.Score = 0\n\t\treturn\n\t}\n\n\tc.Score = uint64(p.Duration / time.Second)\n\n\t// The player that defused the bomb gets 5 minutes bonus!\n\tif p.Defused {\n\t\tc.Score = c.Score + 60*5\n\t}\n\n\treturn\n}", "func (prices *pricesVal) PriceChance(price int) float64 {\n\tswitch {\n\tcase price == prices.maxPrice:\n\t\treturn prices.maxChance\n\tcase price == prices.guaranteedPrice:\n\t\treturn prices.minChance\n\tdefault:\n\t\treturn prices.midChance\n\t}\n}", "func (g Gun)attack(bodyPart BodyArmor,attacker *Character,defender *Character){\n\tif g.LoadedMagazine.Rounds==0{\n\t\t//need to reload!\n\t\treturn\n\t}\n\thitChance := g.estimateHitChance(bodyPart,attacker,defender)\n\troll := r1.Float64()\n\tif roll<=hitChance{\n\t\tdamage := g.calculateDamage(bodyPart,attacker,defender)\n\t\tg.LoadedMagazine.Rounds--\n\t\tdefender.Health-=damage\n\t}else{\n\t\tif LOG_MODE>=1{\n\t\t\tfmt.Printf(\"Missed shot with %f probability\\n\",hitChance)\n\t\t}\n\t}\n}", "func (we WeightedElement) GetProbability() float64 {\n\treturn we.Probability\n}", "func (b BaseDefender) GetWeaponPower(researches Researches) int64 {\n\treturn int64(float64(b.WeaponPower) * (1 + float64(researches.WeaponsTechnology)*0.1))\n}", "func (p *Player) MobAttack(e *Enemy, l *Log){\n fmt.Printf(\"The %s is attempting to attack\", e.Name)\n TypedText(\"...\", 300)\n roll := RandomNumber(20)\n if roll > p.Armor {\n damage := RandomNumber(e.Attack)\n p.Health -= damage\n fmt.Printf(\"The attack lands and %s takes %d damage! ♥:%d \\n\", p.Name, damage, p.Health)\n\t} else {\n fmt.Printf(\"%s managed to defend the attack!\\n\", p.Name)\n }\n}", "func (b *Being) RandomizeGender() {\n\tb.Gender = b.Species.GetGenders()[randomizer.Intn(len(b.Species.GetGenders()))]\n}", "func (difficulty *Difficulty) Backoff() float64 {\n\tdifficulty.Lock()\n\tdefer difficulty.Unlock()\n\n\tswitch {\n\tcase difficulty.modifier < 1:\n\t\tdifficulty.modifier = 1\n\tcase difficulty.modifier > 19:\n\t\tdifficulty.modifier = 19\n\tdefault:\n\t\tdifficulty.modifier += 1\n\t}\n\n\t// return difficulty.internalSetPdiff(difficulty.pdiff * math.Log10(10-0.5*float64(difficulty.modifier)))\n\n\t// disble backoff\n\treturn difficulty.pdiff\n}", "func (n *NormalProposer) Propose() float64 {\n\treturn n.Random()\n}", "func randomEnergy() float64 {\n\treturn math.Round(rand.Float64() * 100)\n}", "func (c *Creature) DetermineDexStrikeRank() *Attribute {\n\n\tdexSR := &Attribute{\n\t\tName: \"DEX Strike Rank\",\n\t\tMax: 5,\n\t}\n\n\tdex := c.Statistics[\"DEX\"]\n\n\tdex.UpdateStatistic()\n\n\tswitch {\n\tcase dex.Total < 6:\n\t\tdexSR.Base = 5\n\tcase dex.Total < 9:\n\t\tdexSR.Base = 4\n\tcase dex.Total < 13:\n\t\tdexSR.Base = 3\n\tcase dex.Total < 16:\n\t\tdexSR.Base = 2\n\tcase dex.Total < 19:\n\t\tdexSR.Base = 1\n\tcase dex.Total > 18:\n\t\tdexSR.Base = 0\n\t}\n\treturn dexSR\n}", "func (a Energy) RandomGain(rnd *rand.Rand) Energy {\n\tgreatest := geom.Vector3(a).Greatest()\n\tif rnd.Float64() > greatest {\n\t\treturn Energy{}\n\t}\n\treturn a.Amplified(1 / greatest)\n}", "func (f *Faker) Pronoun() string { return pronoun(f.Rand) }", "func poissonDelay(uniformRnd float64, rate float64) float64 {\n\treturn -math.Log(1.0-uniformRnd) / rate\n}", "func (m *Monster) Damage(dmg int) (int, bool) {\n\tif dmg >= m.Info.Hitpoints { // check if damage would drop hp to 0\n\t\tdealt := m.Info.Hitpoints\n\t\tm.Info.Hitpoints = 0\n\t\treturn dealt, true\n\t}\n\n\t// Deal damage\n\tm.Info.Hitpoints -= dmg\n\treturn dmg, false\n}", "func (p *Player) Gender() gender.Gender {\n\treturn p.gender\n}", "func (n *BetaProposer) Propose() float64 {\n\treturn n.Random()\n}", "func (m *em) breedRandom() {\n\t// Do nothing if there are no creatures.\n\tif len(m.creatures) == 0 {\n\t\treturn\n\t}\n\n\t// Get two random indices which are not the same.\n\tix1 := rand.Intn(len(m.creatures))\n\tix2 := ix1\n\tfor ix2 == ix1 && len(m.creatures) > 1 {\n\t\tix2 = rand.Intn(len(m.creatures))\n\t}\n\n\t// Ensure they are in order.\n\t// This allows us to break out of the creature loop early.\n\tif ix2 < ix1 {\n\t\tix1, ix2 = ix2, ix1\n\t}\n\n\t// Resolve indices into creatures.\n\t// Because of the random nature of iterating over a map,\n\t// A particular index will not map to the same creature\n\t// each time. However we don't really care, so long as\n\t// it's random, and we get 2 different creatures to breed.\n\tvar mother, father *creature.Creature\n\tii := 0\n\tfor c, _ := range m.creatures {\n\t\tswitch ii {\n\t\tcase ix1:\n\t\t\tmother = c.(*creature.Creature)\n\t\tcase ix2:\n\t\t\tfather = c.(*creature.Creature)\n\t\t\tbreak\n\t\t}\n\t\tii++\n\t}\n\n\t// Breed the creatures.\n\tchild := mother.Breed(father)\n\n\tm.creatures[child] = struct{}{}\n}", "func (jobImpl *JobImpl) Damage() int64 {\n\treturn jobImpl.damageImpl\n}", "func (d *Detector) FailureProbability(now ...int64) float64 {\n\td.mu.RLock()\n\tdefer d.mu.RUnlock()\n\n\tif d.inited == 0 {\n\t\treturn 0\n\t}\n\n\tvar tt int64\n\tif len(now) == 0 {\n\t\ttt = time.Now().Sub(time.Unix(0, 0)).Milliseconds()\n\t} else {\n\t\ttt = now[0]\n\t}\n\n\tvar (\n\t\tt = float64(tt-d.freshness) * d.factor\n\t\tcount float64\n\t\ttotal = min(d.nextIndex, d.mask+1)\n\t)\n\n\tfor i := uint64(0); i < total; i++ {\n\t\tif d.samples[i] <= t {\n\t\t\tcount++\n\t\t}\n\t}\n\n\treturn count / float64(max(1, total))\n}", "func weildWeapon() (string, int) {\n\tlottery := random(1, 5)\n\tvar weapon string\n\tvar weapondie int\n\tswitch lottery {\n\tcase 1:\n\t\tweapon = \"fist\"\n\t\tweapondie = 3\n\tcase 2:\n\t\tweapon = \"dagger\"\n\t\tweapondie = 4\n\tcase 3:\n\t\tweapon = \"short sword\"\n\t\tweapondie = 6\n\tcase 4:\n\t\tweapon = \"longsword\"\n\t\tweapondie = 8\n\tcase 5:\n\t\tweapon = \"greataxe\"\n\t\tweapondie = 12 // At this case, the Greataxe will deal random damage from 1 point to 12 points, a 12-side die.\n\t}\n\treturn weapon, weapondie\n}", "func (f *Faker) PronounRelative() string { return pronounRelative(f.Rand) }", "func GenerateNPC() *NPC {\n\tnpc := NPC{}\n\n\trand.Seed(time.Now().UTC().UnixNano())\n\n\tnpc.genderIsFemale = rand.Int()%2 == 0\n\tnpc.GenName()\n\tnpc.age = lists.Ages[rand.Int()%len(lists.Ages)]\n\tnpc.race = lists.Races[rand.Int()%len(lists.Races)]\n\tnpc.nation = lists.Nations[rand.Int()%len(lists.Nations)]\n\tnpc.voice = lists.Voices[rand.Int()%len(lists.Voices)]\n\tnpc.character = lists.Characters[rand.Int()%len(lists.Characters)]\n\tnpc.GenAspect()\n\tnpc.GenStats()\n\n\treturn &npc\n}", "func (b *Body) Stats() menu.LevelStats {\n\tcleared := 0.0\n\ttotal := 0.0\n\tfor _, col := range b.infectionPattern {\n\t\tfor _, o := range col {\n\t\t\tif b.graph[o].DiseaseLevel() <= 0 {\n\t\t\t\tcleared++\n\t\t\t}\n\t\t\ttotal++\n\t\t}\n\t}\n\tcleared /= total\n\treturn menu.LevelStats{\n\t\tScore: -1,\n\t\tTime: time.Now().Sub(b.startTime).Nanoseconds(),\n\t\tCleared: cleared,\n\t\tLevel: b.level,\n\t}\n}", "func (m *ChatMessage) GetImportance()(*ChatMessageImportance) {\n return m.importance\n}", "func (n *LogNormalProposer) Propose() float64 {\n\treturn n.Random()\n}", "func (f *Faker) PronounDemonstrative() string { return pronounDemonstrative(f.Rand) }", "func Random() (string, Gender) {\n\tn := r.Int31n(200)\n\treturn All[n], n%2 == 0\n}", "func (n *ExponentialProposer) Propose() float64 {\n\treturn n.Random()\n}", "func RandomMale() string {\n\treturn Males[r.Int31n(100)]\n}", "func gandalf(lastGame game) bool {\n\tif lastGame.Statistics.TotalSpellDamage*100/lastGame.Statistics.TotalDamageDone > 50 {\n\t\treturn true\n\t}\n\treturn false\n}", "func (b *Brain) RandomAction() int {\r\n\tif b.RandomActionDistribution == nil {\r\n\t\treturn b.Rand.Intn(b.NumActions)\r\n\t}\r\n\r\n\t// okay, lets do some fancier sampling:\r\n\tp := b.Rand.Float64()\r\n\tcumprob := 0.0\r\n\r\n\tfor k := 0; k < b.NumActions; k++ {\r\n\t\tcumprob += b.RandomActionDistribution[k]\r\n\r\n\t\tif p < cumprob {\r\n\t\t\treturn k\r\n\t\t}\r\n\t}\r\n\r\n\t// rounding error\r\n\treturn b.NumActions - 1\r\n}", "func (o *InlineObject871) GetProbability() AnyOfobject {\n\tif o == nil || o.Probability == nil {\n\t\tvar ret AnyOfobject\n\t\treturn ret\n\t}\n\treturn *o.Probability\n}", "func weightedRand(max int, talentCo float64) float64 {\n\tnum := posWeightedRand(max)\n\n\tif rand.Float64() > talentCo {\n\t\treturn num - (2 * num)\n\t}\n\n\treturn num\n}", "func (self *PhysicsP2) Restitution() int{\n return self.Object.Get(\"restitution\").Int()\n}", "func GetDifficulty(p float64) uint {\n\treturn uint(math.Ceil(math.Log2(1.0 / p)))\n}", "func (b Backoff) jitter() float64 {\n\n\t// jitter is a random value on [0.0, 1.0), so subtract 0.5 and multiply by\n\t// 2 to move it to the interval [-1.0, 1.0), which is more suitable for\n\t// jitter, as we want equal probabilities on either side of the basic\n\t// exponential backoff.\n\treturn b.Jitter * (rand.Float64() - 0.5) * 2\n}", "func weapon(char core.Character, c *core.Core, r int, param map[string]int) {\n\tdmg := 0.16 + float64(r)*0.04\n\n\tc.Events.Subscribe(core.OnAttackWillLand, func(args ...interface{}) bool {\n\t\tds := args[1].(*core.Snapshot)\n\t\tt := args[0].(core.Target)\n\t\tif ds.ActorIndex != char.CharIndex() {\n\t\t\treturn false\n\t\t}\n\t\t// if t.AuraType() == def.Hydro {\n\t\t// \tds.Stats[def.DmgP] += dmg\n\t\t// \tc.Log.Debugw(\"dragonbane\", \"frame\", c.F, \"event\", def.LogCalc, \"final dmg%\", ds.Stats[def.DmgP])\n\t\t// }\n\t\tif t.AuraContains(core.Hydro, core.Pyro) {\n\t\t\tds.Stats[core.DmgP] += dmg\n\t\t\tc.Log.Debugw(\"dragonbane\", \"frame\", c.F, \"event\", core.LogCalc, \"final dmg%\", ds.Stats[core.DmgP])\n\t\t}\n\t\treturn false\n\t}, fmt.Sprintf(\"dragonbane-%v\", char.Name()))\n\n}", "func (p *Player) BossBattle(e *Enemy, l *Log, item *Item, d *Death) int {\n t := time.Now()\n fmt.Printf(\"%s has encountered a strong foe!\\n\\nName:%s\\n♥:%d\\nAtk:%d\\nDef:%d \\n\\nIt doesn't seem to notice. Want to come back another time[1] or fight[2]? \", p.Name, e.Name, e.Health, e.Attack, e.Armor)\n var choice int\n fmt.Scanln(&choice)\n var first bool\n switch choice {\n case 1:\n sucessString := fmt.Sprintf(\"%s snuck away from a %s without it noticing.\", p.Name, e.Name)\n l.AddAction(t.Format(\"3:04:05 \") + sucessString)\n default:\n TypedText(\"You failed to select one of the options given to you.\\n\", 50)\n TypedText(\"You're just going to have to fight it\", 50)\n TypedText(\"...\\n\", 200)\n fallthrough\n case 2:\n var simulate int\n fmt.Printf(\"Would you like to view battle[1] or simulate[2]? \")\n fmt.Scanln(&simulate)\n switch simulate {\n case 1:\n userI := RandomNumber(20)\n compI := RandomNumber(20)\n fmt.Printf(\"Rolling for initiative\")\n TypedText(\"...\", 300)\n fmt.Printf(\"%s rolled a %d\\n\", p.Name, userI)\n fmt.Printf(\"The %s rolled a %d\\n\", e.Name, compI)\n if compI > userI {\n fmt.Printf(\"The %s rolled higher, they will attack first.\\n\", e.Name)\n } else {\n fmt.Printf(\"%s rolled higher, %s will attack first.\\n\", p.Name, p.Name)\n first = true\n }\n for p.Health > 0 && e.Health > 0 {\n if first == true {\n p.UserAttack(e, l)\n time.Sleep(2500 * time.Millisecond)\n if e.Health > 0 {\n p.MobAttack(e, l)\n time.Sleep(2500 * time.Millisecond)\n } else {\n break\n }\n } else {\n p.MobAttack(e, l)\n time.Sleep(2500 * time.Millisecond)\n if p.Health > 0 {\n p.UserAttack(e, l)\n } else {\n break\n }\n }\n }\n default:\n TypedText(\"Since you didn't enter a valid selection the battle will be simulated.\", 50)\n fallthrough\n case 2:\n userI := RandomNumber(20)\n compI := RandomNumber(20)\n fmt.Printf(\"Rolling for initiative\")\n fmt.Printf(\".\")\n fmt.Printf(\".\")\n fmt.Printf(\".\\n\")\n fmt.Printf(\"%s rolled a %d\\n\", p.Name, userI)\n fmt.Printf(\"The %s rolled a %d\\n\", e.Name, compI)\n if compI > userI {\n fmt.Printf(\"The %s rolled higher, they will attack first.\\n\", e.Name)\n } else {\n fmt.Printf(\"%s rolled higher, %s will attack first.\\n\", p.Name, p.Name)\n first = true\n }\n for p.Health > 0 && e.Health > 0 {\n if first == true {\n p.UserAttack(e, l)\n if e.Health > 0 {\n p.MobAttack(e, l)\n } else {\n break\n }\n } else {\n p.MobAttack(e, l)\n if p.Health > 0 {\n p.UserAttack(e, l)\n } else {\n break\n }\n }\n }\n } \n }\n if p.Health <= 0 {\n d.Death()\n } else if e.Health <= 0 && p.Health >= 0 {\n winString := fmt.Sprintf(\"%s successfully defeated a %s!\", p.Name, e.Name)\n l.AddAction(t.Format(\"3:04:05 \")+winString)\n fmt.Printf(\"The %s dropped gold.\", e.Name)\n p.Gold += e.Gold\n lootRoll := RandomNumber(100)\n if lootRoll <= 25 {\n loot := RandomItem(p, item)\n fmt.Printf(\"The %s dropped loot [%s].\", e.Name, loot)\n itemString := fmt.Sprintf(\"%s obtained a %s and %d gold from a %s.\", p.Name, loot, e.Gold, e.Name)\n l.AddAction(t.Format(\"3:04:05 \")+itemString)\n } else {\n goldString := fmt.Sprintf(\"%s gained %d gold from a %s.\", p.Name, e.Gold, e.Name)\n l.AddAction(t.Format(\"3:04:05 \")+goldString)\n }\n if p.Key == false {\n fmt.Printf(\"The %s dropped a giant key.\", e.Name)\n l.AddAction(t.Format(\"3:04:05 \")+p.Name+\" found a giant key.\")\n p.Key = true\n }\n fmt.Printf(\"\\nPosting results\")\n TypedText(\"...\", 300)\n }\n return choice\n}", "func (g *Deal) outcome() [PLAYERS] int {\n\treturn g.state.goal(g.players)\n}", "func (g GumbelRight) Prob(x float64) float64 {\n\treturn math.Exp(g.LogProb(x))\n}", "func PronounDemonstrative() string { return pronounDemonstrative(globalFaker.Rand) }", "func (b *OGame) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error) {\n\treturn b.WithPriority(taskRunner.Normal).GetDefense(celestialID, options...)\n}", "func noConflictProbability(slots, eventSlots, events int64) float64 {\n\t// can't have a conflict without events\n\tif events <= 0 {\n\t\treturn 1\n\t}\n\n\t// no more free slots, we definitely have a conflict\n\tif slots <= 0 {\n\t\treturn 0\n\t}\n\n\n\tn := float64(slots)\n\teT := float64(eventSlots)\n\te := float64(events)\n\treturn math.Pow((n - eT) / n, e - float64(1)) * noConflictProbability(slots - eventSlots, eventSlots, events - 1)\n}", "func (m *SalaryMutation) Bonus() (r float64, exists bool) {\n\tv := m._Bonus\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "func (b BaseDefender) GetShieldPower(researches Researches) int64 {\n\treturn int64(float64(b.ShieldPower) * (1 + float64(researches.ShieldingTechnology)*0.1))\n}", "func (p Piece) Damage() int {\n\treturn p.damage\n}", "func (n *GammaProposer) Propose() float64 {\n\treturn n.Random()\n}", "func (e Exponential) Rand() float64 {\n\tvar rnd float64\n\tif e.Src == nil {\n\t\trnd = rand.ExpFloat64()\n\t} else {\n\t\trnd = rand.New(e.Src).ExpFloat64()\n\t}\n\treturn rnd / e.Rate\n}", "func (baseAccountReputation BaseAccountReputation) GetRating() int64 { return 100 }", "func (obj *Facility) GenerateAdvance() int {\n\tadvance := obj.Interval\n\tif obj.Modificator > 0 {\n\t\tadvance += utils.GetRandom(-obj.Modificator, obj.Modificator)\n\t}\n\treturn advance\n}", "func probability(word string) float64 {\n\treturn float64(wordFreq[word]) / float64(wordTotal)\n}", "func (ant *Ant) getProbability() []float64 {\n\tp := make([]float64, 0)\n\tvar sum float64\n\tfor i, l := range ant.visited[ant.position] {\n\t\tif l != 0 {\n\t\t\td := math.Pow((float64(1)/float64(l)), ant.env.alpha) * math.Pow(ant.env.pheromon[ant.position][i], ant.env.betta)\n\t\t\tp = append(p, d)\n\t\t\tsum += d\n\t\t} else {\n\t\t\tp = append(p, 0)\n\t\t}\n\t}\n\tfor _, l := range p {\n\t\tl = l / sum\n\t}\n\treturn p\n}", "func def_guard(bt *yboter,b *game.Board, r *game.Robot) game.Action {\n\tnearby_count := count_enermies_adj(b,r)\n\tswitch {\n\t\tcase (bt.self_prevHP[r.ID] - r.Health > 15):\n\t\t\tif r.Health >= nearby_count*10 {\n\t\t\t\treturn game.Action{Kind: game.Guard}\n\t\t\t}\n\t}\n return game.Action{Kind: game.Wait}\n}", "func (player *Player) GetSkillAdjust(maxAdjust int) int {\n\trand.Seed(time.Now().UnixNano())\n\tmaxSkilllevel := math.Min(4, float64(player.SkillLevel))\n\tlargestOffset := math.Min(5-maxSkilllevel, float64(maxAdjust))\n\tlargestOffset = math.Max(largestOffset, 0)\n\treturn rand.Intn(int(largestOffset))\n}", "func RandomFood() rune {\n\temoji := []rune{\n\t\t'R', // Favourite dish, extra points!!!\n\t\t'👿',\n\t\t'🍍',\n\t\t'🍑',\n\t\t'🍇',\n\t\t'🍏',\n\t\t'🍌',\n\t\t'🍫',\n\t\t'🍭',\n\t\t'🍕',\n\t\t'🍩',\n\t\t'🍗',\n\t\t'🍖',\n\t\t'🍬',\n\t\t'🍤',\n\t\t'🍪',\n\t\t'S', // You do not want to eat the skull\n\t}\n\n\trand.Seed(time.Now().UnixNano())\n\n\treturn emoji[rand.Intn(len(emoji))]\n}", "func (g *Game) getSpareBonus(rollIndex int) int {\n\treturn g.rolls[rollIndex+2]\n}", "func (*Modifier) Descriptor() ([]byte, []int) {\n\treturn file_FillerGame_proto_rawDescGZIP(), []int{6}\n}", "func doesCrit(attacker *pet) (bool) {\n\tcritRand := float64(rand.Intn(100))\n\t\n\tif critRand < attacker.EffectiveCRI {\n\t\t//fmt.Println(attacker.PetUser.Username, \" rolled a\", critRand, \" crit!\")\n\t\tattacker.CritCount++\n\t\treturn true\n\t}\n\t\n\treturn false\n\t\n}", "func (u Uniform) Rand() float64 {\n\treturn rand.Float64()*(u.Max-u.Min) + u.Min\n}", "func GetReward(a Action, feedback Action) float64 {\n\tif a == feedback {\n\t\treturn 1\n\t}\n\treturn -1\n}", "func PronounReflective() string { return pronounReflective(globalFaker.Rand) }" ]
[ "0.6194889", "0.61754656", "0.61005557", "0.5939384", "0.5802302", "0.5753514", "0.5746806", "0.54749453", "0.54497707", "0.54424155", "0.5411699", "0.5332017", "0.53062475", "0.5304713", "0.5244101", "0.52316695", "0.5213608", "0.5160024", "0.51429135", "0.51058805", "0.5092784", "0.50700694", "0.504548", "0.50270003", "0.5016573", "0.501293", "0.501293", "0.4997118", "0.49211985", "0.49058512", "0.49024987", "0.49010783", "0.48994538", "0.48978147", "0.48868895", "0.48692095", "0.48570213", "0.48445344", "0.48397794", "0.4836708", "0.4827345", "0.4819298", "0.48146203", "0.48134777", "0.47888654", "0.4782919", "0.47799775", "0.4768897", "0.47606418", "0.4760067", "0.47530943", "0.47501495", "0.4742268", "0.47369936", "0.4736104", "0.4726622", "0.47265443", "0.469431", "0.46936807", "0.46925497", "0.4688263", "0.46821815", "0.46803886", "0.4661155", "0.46540493", "0.46443135", "0.46396583", "0.46381614", "0.46363962", "0.46292657", "0.46269763", "0.46207958", "0.4620653", "0.46169996", "0.46066177", "0.46053967", "0.46014908", "0.4597888", "0.45973983", "0.45956412", "0.4589991", "0.4581464", "0.45718783", "0.4568697", "0.4568649", "0.45666203", "0.4565859", "0.4564297", "0.45635986", "0.45631155", "0.45532474", "0.4548743", "0.45433933", "0.4540085", "0.4536816", "0.4522471", "0.45169845", "0.45158377", "0.4511514", "0.45113477" ]
0.7181684
0
Creates a new civil war
Создаёт новый гражданский войн
func (s *State) NewCivilWar(target pb.ProvinceId) bool { // TODO: Error return if s.IsAtWar(target) || s.IsSiteOfConflict(target) { return false } c := &Conflict{ name: "Civil War", // TODO length: 0, attackers: Faction{ rebels: *(s.Get(target).Dissidents()), progress: 0, }, defenders: Faction{ members: []pb.ProvinceId{target}, progress: 0, }, goal: s.Settings().GetConflictGoal(pb.ConflictType_CIVIL_WAR), base_chance: s.Settings().GetConflictBaseChance(pb.ConflictType_CIVIL_WAR), locations: []pb.ProvinceId{target}, conflict_type: pb.ConflictType_CIVIL_WAR, } s.Conflicts[target] = c return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *State) NewColonialWar(target pb.ProvinceId) bool { // TODO: Error return\n\tif s.IsAtWar(target) || s.IsSiteOfConflict(target) || s.Get(target).Occupier() != pb.ProvinceId_NONE {\n\t\treturn false\n\t}\n\tc := &Conflict{\n\t\tname: \"Colonial War\", // TODO\n\t\tlength: 0,\n\t\tattackers: Faction{\n\t\t\t// Dissidents\n\t\t\tprogress: 0,\n\t\t},\n\t\tdefenders: Faction{\n\t\t\tmembers: []pb.ProvinceId{s.Get(target).Occupier()},\n\t\t\tprogress: 0,\n\t\t},\n\t\tgoal: s.Settings().GetConflictGoal(pb.ConflictType_COLONIAL_WAR),\n\t\tbase_chance: s.Settings().GetConflictBaseChance(pb.ConflictType_COLONIAL_WAR),\n\t\tlocations: []pb.ProvinceId{target},\n\t\tconflict_type: pb.ConflictType_COLONIAL_WAR,\n\t}\n\ts.Conflicts[target] = c\n\treturn true\n}", "func (s *State) NewConventionalWar(defenders []pb.ProvinceId, attackers []pb.ProvinceId, locations []pb.ProvinceId) bool { // TODO: Error return\n\tfor _, d := range defenders {\n\t\tif s.IsAtWar(d) || s.IsSiteOfConflict(d) {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor _, a := range attackers {\n\t\tif s.IsAtWar(a) || s.IsSiteOfConflict(a) {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor _, l := range locations {\n\t\tif s.IsAtWar(l) || s.IsSiteOfConflict(l) {\n\t\t\treturn false\n\t\t}\n\t}\n\t// TODO: Logic for joining wars?\n\tc := &Conflict{\n\t\tname: \"War!\", // TODO\n\t\tlength: 0,\n\t\tattackers: Faction{\n\t\t\tmembers: attackers,\n\t\t\tprogress: 0,\n\t\t},\n\t\tdefenders: Faction{\n\t\t\tmembers: defenders,\n\t\t\tprogress: 0,\n\t\t},\n\t\tgoal: s.Settings().GetConflictGoal(pb.ConflictType_CONVENTIONAL_WAR),\n\t\tbase_chance: s.Settings().GetConflictBaseChance(pb.ConflictType_CONVENTIONAL_WAR),\n\t\tlocations: locations,\n\t\tconflict_type: pb.ConflictType_CONVENTIONAL_WAR,\n\t}\n\t// For now it maps only to the first location\n\ts.Conflicts[locations[0]] = c\n\treturn true\n}", "func (wds *WeaponAISystem) New(w *ecs.World) {\n\n}", "func createWorld() {\n\tspace = chipmunk.NewSpace()\n\tspace.Gravity = vect.Vect{0, -900}\n\n\tstaticBody := chipmunk.NewBodyStatic()\n\tstaticLines = []*chipmunk.Shape{\n\t\tchipmunk.NewSegment(vect.Vect{0, -600}, vect.Vect{800.0, -600}, 0),\n\t\tchipmunk.NewSegment(vect.Vect{0, -600}, vect.Vect{0, 0}, 0),\n\t\tchipmunk.NewSegment(vect.Vect{800, -600}, vect.Vect{800.0, 0}, 0),\n\t}\n\tfor _, segment := range staticLines {\n\t\t// segment.SetElasticity(0.6)\n\t\tstaticBody.AddShape(segment)\n\t}\n\tspace.AddBody(staticBody)\n}", "func createTeam(w http.ResponseWriter, r *http.Request) {\n\tteam := models.NewTeam(\"\")\n\tskue.Create(view, team, w, r)\n}", "func (w *RandomWorld) CreateRandomCarnivore() *GoWorld.Being {\n\t// Create an empty being\n\tbeing := &GoWorld.Being{ID: uuid.New()}\n\tbeing.Type = \"Carnivore\"\n\n\t// Give the being the basic necessities\n\tbeing.Hunger = hungerRange.randomFloat()\n\tbeing.Thirst = thirstRange.randomFloat()\n\tbeing.WantsChild = wantsChildRange.randomFloat()\n\n\t// Shape the being\n\tbeing.LifeExpectancy = lifeExpectancyRange.randomFloat()\n\tbeing.VisionRange = visionRange.randomFloat()\n\tbeing.Speed = speedRange.randomFloat()\n\tbeing.Durability = durabilityRange.randomFloat()\n\tbeing.Stress = stressRange.randomFloat()\n\tbeing.Size = sizeRange.randomFloat()\n\tbeing.Gender = randomGender()\n\tbeing.Fertility = fertilityRange.randomFloat()\n\tbeing.MutationRate = mutationRange.randomFloat()\n\n\t// Pick a random (valid) position and check which habitat it is\n\tw.ThrowBeing(being)\n\n\treturn being\n}", "func CreateBattle(LeaderID string, BattleName string) (*Battle, error) {\n\tnewID, _ := uuid.NewUUID()\n\tid := newID.String()\n\n\tvar b = &Battle{\n\t\tBattleID: id,\n\t\tLeaderID: LeaderID,\n\t\tBattleName: BattleName,\n\t\tWarriors: make([]*Warrior, 0),\n\t\tPlans: make([]*Plan, 0),\n\t\tVotingLocked: true,\n\t\tActivePlanID: \"\",\n\t}\n\n\te := db.QueryRow(`INSERT INTO battles (id, leader_id, name) VALUES ($1, $2, $3) RETURNING id`, id, LeaderID, BattleName).Scan(&b.BattleID)\n\tif e != nil {\n\t\tlog.Println(e)\n\t\treturn nil, errors.New(\"Error Creating Battle\")\n\t}\n\n\treturn b, nil\n}", "func CreateWarrior(WarriorName string) (*Warrior, error) {\n\tnewID, _ := uuid.NewUUID()\n\tid := newID.String()\n\n\tvar WarriorID string\n\te := db.QueryRow(`INSERT INTO warriors (id, name) VALUES ($1, $2) RETURNING id`, id, WarriorName).Scan(&WarriorID)\n\tif e != nil {\n\t\tlog.Println(e)\n\t\treturn nil, errors.New(\"Unable to create new warrior\")\n\t}\n\n\treturn &Warrior{WarriorID: WarriorID, WarriorName: WarriorName}, nil\n}", "func makeNewGame(name string, playerNames []string) *Game {\n\tvar g = new(Game)\n\tid, err := uuid.GenUUID()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tg.ID = id\n\tg.Name = name\n\tg.Messages.Capacity = 500\n\tg.Phase = Development\n\tGames[g.ID] = g\n\tg.addMessage(fmt.Sprintf(\"Created game %s...\", g.Name))\n\tg.loadLocos()\n\tg.prepareLocos()\n\tg.initPlayers(playerNames)\n\tg.determineTurnOrder()\n\n\treturn g\n}", "func (w *RandomWorld) CreateCarnivores(quantity int) {\n\t// Initialize each being to a random one\n\tfor i := 0; i < quantity; i++ {\n\t\t// Create random being and place it into the map\n\t\tb := w.CreateRandomCarnivore()\n\t\tw.BeingList[b.ID.String()] = b\n\t}\n}", "func CreateWare(c *server.Context) error {\n\tvar (\n\t\terr error\n\t\taddReq ware.Ware\n\t\tconn orm.Connection\n\t)\n\n\tisAdmin := c.Request().Context().Value(\"user\").(jwtgo.MapClaims)[util.IsAdmin].(bool)\n\tif !isAdmin {\n\t\tlogger.Error(\"You don't have access\")\n\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrToken, nil)\n\t}\n\n\terr = c.JSONBody(&addReq)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrInvalidParam, nil)\n\t}\n\n\terr = c.Validate(addReq)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrInvalidParam, nil)\n\t}\n\n\tif len(addReq.Avatar) > 0 {\n\t\taddReq.Avatar, err = util.SavePicture(addReq.Avatar, \"ware/\")\n\t\tif err != nil {\n\t\t\tlogger.Error(err)\n\t\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrInternalServerError, nil)\n\t\t}\n\t}\n\tif len(addReq.Image) > 0 {\n\t\taddReq.Image, err = util.SavePicture(addReq.Image, \"ware/\")\n\t\tif err != nil {\n\t\t\tlogger.Error(err)\n\t\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrInternalServerError, nil)\n\t\t}\n\t}\n\tif len(addReq.DetailPic) > 0 {\n\t\taddReq.DetailPic, err = util.SavePicture(addReq.DetailPic, \"wareIntro/\")\n\t\tif err != nil {\n\t\t\tlogger.Error(err)\n\t\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrInternalServerError, nil)\n\t\t}\n\t}\n\n\tconn, err = mysql.Pool.Get()\n\tdefer mysql.Pool.Release(conn)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrMysql, nil)\n\t}\n\n\terr = ware.Service.CreateWare(conn, &addReq)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\tif (len(addReq.Avatar) > 0 && !util.DeletePicture(addReq.Avatar)) ||\n\t\t\t(len(addReq.Image) > 0 && !util.DeletePicture(addReq.Image)) ||\n\t\t\t(len(addReq.DetailPic) > 0 && !util.DeletePicture(addReq.DetailPic)) {\n\t\t\tlogger.Error(errors.New(\"create ware failed and delete it's pictures go wrong, please delete picture manually\"))\n\t\t}\n\t\treturn core.WriteStatusAndDataJSON(c, constants.ErrMysql, nil)\n\t}\n\n\tlogger.Info(\"create ware\", addReq.Name, \"success\")\n\treturn core.WriteStatusAndDataJSON(c, constants.ErrSucceed, nil)\n}", "func (planetDeliveryRest *PlanetDeliveryRest) Create(w http.ResponseWriter, r *http.Request) {\n\tvar planet entity.Planet\n\n\terr := json.NewDecoder(r.Body).Decode(&planet)\n\tif err != nil {\n\t\tError(w, \"Failed to decode JSON\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tplanetToInsert := *entity.NewPlanet(planet.Name, planet.Climate, planet.Terrain)\n\n\tnewPlanet, err := planetDeliveryRest.planetUsecase.Create(r.Context(), planetToInsert)\n\tif err != nil {\n\t\tError(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tJSON(w, newPlanet, http.StatusCreated)\n}", "func (s WashingtonPostScraper) CreateNewWashingtonPostScraper() *WashingtonPostScraper {\n\tc := colly.NewCollector()\n\t// c := colly.NewCollector(colly.Debugger(&debug.LogDebugger{}))\n\tc.UserAgent = s.UserAgent()\n\tc.IgnoreRobotsTxt = false\n\n\t// Adding this wait so AJAX can load, might need to look at https://github.com/chromedp/chromedp in the future\n\tc.Limit(&colly.LimitRule{\n\t\tDelay: 5 * time.Second,\n\t})\n\n\tscraper := WashingtonPostScraper{\n\t\tcollector: c,\n\t}\n\treturn &scraper\n}", "func CreateProject(w http.ResponseWriter, r *http.Request) {\n\t// Get incoming data, content n' stuff\n\t// Pass those data and create em'\n\t// Return new project and response\n}", "func New() *WarmerImpl {\n\treturn &WarmerImpl{}\n}", "func (c *CaptainClient) CreateFormation(name string, flightID, CPU, RAM, disk int, baseName, domain string, targetCount int, preflightPlaybook string) (Formation, error) {\n\tresult, err := c.restPOST(\"formation\", map[string]interface{}{\n\t\t\"FlightID\": flightID,\n\t\t\"Name\": name,\n\t\t\"CPU\": CPU,\n\t\t\"RAM\": RAM,\n\t\t\"Disk\": disk,\n\t\t\"BaseName\": baseName,\n\t\t\"Domain\": domain,\n\t\t\"TargetCount\": targetCount,\n\t\t\"PreflightPlaybook\": preflightPlaybook,\n\t})\n\tif err != nil {\n\t\treturn Formation{}, fmt.Errorf(\"unable to create Formation:\\n%w\", err)\n\t}\n\tvar formation Formation\n\terr = json.Unmarshal(result, &formation)\n\tif err != nil {\n\t\treturn Formation{}, fmt.Errorf(\"unable to format response as Formation:\\n%w\", err)\n\t}\n\treturn formation, nil\n}", "func NewWorldCup(w http.ResponseWriter, r *http.Request, u *mdl.User) error {\n\tc := appengine.NewContext(r)\n\tdesc := \"New World Cup Handler:\"\n\n\tif r.Method == \"POST\" {\n\t\ttournament, err := mdl.CreateWorldCup2018(c, u.Id)\n\t\tif err != nil {\n\t\t\tlog.Errorf(c, \"%s error when trying to create a tournament: %v\", desc, err)\n\t\t\treturn &helpers.InternalServerError{Err: errors.New(helpers.ErrorCodeTournamentCannotCreate)}\n\t\t}\n\n\t\treturn templateshlp.RenderJSON(w, c, tournament)\n\t}\n\treturn &helpers.BadRequest{Err: errors.New(helpers.ErrorCodeNotSupported)}\n}", "func Generate(categoryName string, area geography.Area, originCulture culture.Culture) (Town, error) {\n\tvar newProducers []profession.Profession\n\tvar producers []profession.Profession\n\tvar newResources []resource.Resource\n\n\ttown := Town{}\n\n\tif categoryName == \"random\" {\n\t\ttownCategory, err := getRandomWeightedCategory()\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(townGenerationError, err)\n\t\t\treturn Town{}, err\n\t\t}\n\t\ttown.Category = townCategory\n\t} else {\n\t\ttown.Category = getCategoryByName(categoryName)\n\t}\n\n\ttown.Geography = area\n\ttown.Culture = originCulture\n\n\tname, err := town.Culture.Language.RandomTownName()\n\tif err != nil {\n\t\terr = fmt.Errorf(townGenerationError, err)\n\t\treturn Town{}, err\n\t}\n\ttown.Name = name\n\n\ttown.Population = generateRandomPopulation(town.Category)\n\n\ttown.BuildingStyle = town.Culture.BuildingStyle\n\n\tmayor, err := town.generateMayor()\n\tif err != nil {\n\t\terr = fmt.Errorf(townGenerationError, err)\n\t\treturn Town{}, err\n\t}\n\ttown.Mayor = mayor\n\n\tresources := area.GetResources()\n\n\tfor i := 0; i < town.Category.ProductionIterations; i++ {\n\t\tnewProducers, err = getProducers(town.Population, resources)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(townGenerationError, err)\n\t\t\treturn Town{}, err\n\t\t}\n\t\tnewResources, err = goods.Produce(newProducers, resources)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(townGenerationError, err)\n\t\t\treturn Town{}, err\n\t\t}\n\t\tresources = append(resources, newResources...)\n\t\tproducers = append(producers, newProducers...)\n\t}\n\n\ttown.Resources = resources\n\ttown.NotableProducers = producers\n\n\ttown.Exports = town.generateRandomExports()\n\timports, err := town.generateRandomImports()\n\tif err != nil {\n\t\terr = fmt.Errorf(townGenerationError, err)\n\t\treturn Town{}, err\n\t}\n\ttown.Imports = imports\n\n\treturn town, nil\n}", "func (w *RandomWorld) CreateRandomFlyer() *GoWorld.Being {\n\t// Create an empty being\n\tbeing := &GoWorld.Being{ID: uuid.New()}\n\tbeing.Type = \"Flying\"\n\n\t// Give the being the basic necessities\n\tbeing.Hunger = hungerRange.randomFloat()\n\tbeing.Thirst = thirstRange.randomFloat()\n\tbeing.WantsChild = wantsChildRange.randomFloat()\n\n\t// Shape the being\n\tbeing.LifeExpectancy = lifeExpectancyRange.randomFloat()\n\tbeing.VisionRange = visionRange.randomFloat()\n\tbeing.Speed = speedRange.randomFloat()\n\tbeing.Durability = durabilityRange.randomFloat()\n\tbeing.Stress = stressRange.randomFloat()\n\tbeing.Size = sizeRange.randomFloat()\n\tbeing.Gender = randomGender()\n\tbeing.Fertility = fertilityRange.randomFloat()\n\tbeing.MutationRate = mutationRange.randomFloat()\n\n\t// Flying beings 'feel' home in the forest, but can spawn anywhere\n\t// Create some random coordinates within the world limits\n\trX := rand.Intn(w.Width)\n\trY := rand.Intn(w.Height)\n\toverflow := 0\n\t// If no being present at location set it as the spawn point\n\tfor w.TerrainSpots[rX][rY].Being != uuid.Nil {\n\t\trX = rand.Intn(w.Width)\n\t\trY = rand.Intn(w.Height)\n\t\t// Recover somehow if we look for a location for too long\n\t\toverflow++\n\t\tif overflow > 100000 {\n\t\t\t// Todo handle the infinite loop a little nicer than panicking\n\t\t\tpanic(\"error placing flying being: tried 100k random spots and all occupied\")\n\t\t}\n\t}\n\tbeing.Position.X = rX\n\tbeing.Position.Y = rY\n\tbeing.Habitat = Surfaces[2].ID\n\n\treturn being\n}", "func createPokemon(n string, d int, c bool, cp villains) pokemon {\n\tnewPokemon := pokemon{n, d, c, cp}\n\treturn newPokemon\n}", "func Create(logger *zap.SugaredLogger, tfDir, bucket, attackTag string) error {\n\terr := InitIfNeeded(logger, tfDir, bucket, attackTag)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogger.Info(\"Running terraform plan\")\n\t_, err = Terraform(tfDir, \"plan\", bucket)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogger.Info(\"Running terraform apply\")\n\t_, err = Terraform(tfDir, \"apply\", bucket)\n\treturn err\n}", "func NewTrainCar() TrainCar {\n c := TrainCar{name: \"TrainCar\", vehicle: \"TrainCar\", speed: 30, capacity: 30, railway: \"CNR\"}\n return c\n}", "func CreateNewSchool(c echo.Context) error {\n\n\tdb, ok := c.Get(\"db\").(*gorm.DB)\n\n\tif !ok {\n\t\treturn c.NoContent(http.StatusInternalServerError)\n\t}\n\n\tvar modelview view.CreateNewSchoolModelView\n\n\tc.Bind(&modelview)\n\n\tcanteens := make([]canteen.Canteen, len(modelview.Canteens))\n\n\tfor index := range modelview.Canteens {\n\n\t\tlocation := canteen.Location{}\n\n\t\tlocation.Latitude = modelview.Canteens[index].Location.Latitude\n\n\t\tlocation.Longitude = modelview.Canteens[index].Location.Longitude\n\n\t\tcanteen, cerr := canteen.New(modelview.Canteens[index].Name, location)\n\t\tif cerr != nil {\n\n\t\t\tmodelview := customerrorview.UsingFieldErrorToErrorMessageModelView(*cerr)\n\n\t\t\treturn c.JSON(http.StatusBadRequest, modelview)\n\t\t}\n\t\tcanteens[index] = canteen\n\t}\n\n\tschool, serr := model.New(modelview.Acronym, modelview.Name, canteens)\n\n\tif serr != nil {\n\n\t\tmodelview := customerrorview.UsingFieldErrorToErrorMessageModelView(*serr)\n\n\t\treturn c.JSON(http.StatusBadRequest, modelview)\n\t}\n\n\tvar existingSchool model.School\n\n\t// Finds if school with same acronym already exists\n\n\terr := db.Where(map[string]interface{}{\"acronym\": modelview.Acronym}).First(&existingSchool).Error\n\n\tif err == nil {\n\n\t\tcerr := customerrormodel.FieldError{Field: \"acronym\", Model: \"school\", Explanation: \"a school with the same acronym already exists\"}\n\n\t\tmodelview := customerrorview.UsingFieldErrorToErrorMessageModelView(cerr)\n\n\t\treturn c.JSON(http.StatusBadRequest, modelview)\n\t}\n\n\t// Creates school\n\tdb.Create(&school)\n\n\tmodelviewres := view.ToGetDetailedSchoolInformationModelView(school)\n\n\treturn c.JSON(http.StatusCreated, modelviewres)\n\n}", "func MakeWorley(shaderpath string) Worley {\n\tcomputeshader, err := shader.MakeCompute(shaderpath + \"/noise/worley.comp\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t//create random seed\n\trandomdata := createRandom(1024 * 1024 * 4)\n\tnoisetexture, err := texture.MakeFromData(randomdata, 1024, 1024, gl.RGBA32F, gl.RGBA)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn Worley{\n\t\tcomputeshader: computeshader,\n\t\tnoisetexture: noisetexture,\n\n\t\twidth: 1024,\n\t\theight: 1024,\n\t\tresolution: 32,\n\t\toctaves: 1,\n\t\tradius: 40.0,\n\t\tradiusscale: 1,\n\n\t\tbrightness: 1.0,\n\t\tcontrast: 1.0,\n\t}\n}", "func (ff *fftag) Create(eng vu.Eng, s *vu.State) {\n\trand.Seed(time.Now().UTC().UnixNano())\n\n\t// create the overlay\n\tff.top = eng.Root().NewPov()\n\tview := ff.top.NewView()\n\tview.SetUI()\n\tff.cam = view.Cam()\n\tff.mmap = ff.top.NewPov().SetScale(10, 10, 0)\n\tff.mmap.SetLocation(30, 30, 0)\n\n\t// populate the map\n\tff.msize = 69\n\tff.plan = grid.New(grid.ROOMS_SKIRMISH)\n\tff.plan.Generate(ff.msize, ff.msize)\n\twidth, height := ff.plan.Size()\n\tfor x := 0; x < width; x++ {\n\t\tfor y := 0; y < height; y++ {\n\t\t\tif ff.plan.IsOpen(x, y) {\n\t\t\t\tblock := ff.mmap.NewPov()\n\t\t\t\tblock.SetLocation(float64(x), float64(y), 0)\n\t\t\t\tblock.NewModel(\"uv\").LoadMesh(\"icon\").AddTex(\"wall\")\n\t\t\t\tff.spots = append(ff.spots, ff.id(x, y))\n\t\t\t}\n\t\t}\n\t}\n\n\t// populate chasers and a goal.\n\tnumChasers := 30\n\tfor cnt := 0; cnt < numChasers; cnt++ {\n\t\tchaser := ff.mmap.NewPov()\n\t\tchaser.NewModel(\"uv\").LoadMesh(\"icon\").AddTex(\"token\")\n\t\tff.chasers = append(ff.chasers, chaser)\n\t}\n\tff.goal = ff.mmap.NewPov()\n\tff.goal.NewModel(\"uv\").LoadMesh(\"icon\").AddTex(\"goal\")\n\tff.flow = grid.NewFlow(ff.plan) // flow field for the given plan.\n\tff.resetLocations()\n\n\t// set non default engine state.\n\teng.SetColor(0.15, 0.15, 0.15, 1)\n\tff.resize(s.W, s.H)\n}", "func (c *SpaceClient) Create(ctx context.Context, r *resource.SpaceCreate) (*resource.Space, error) {\n\tvar space resource.Space\n\t_, err := c.client.post(ctx, \"/v3/spaces\", r, &space)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &space, nil\n}", "func createPlayer(fname, lname, pos string) *Athelete {\n\n\tplayer1 := &Athelete{\n\n\t\tFirstname: fname,\n\t\tLastname: lname,\n\t\tLMType: \"player\",\n\t\tTeamName: \"Free Agent\",\n\t\tEligible: &Eligible{\n\t\t\tReason: \"\",\n\t\t\tSlips: make([]*Slip, 10, 30),\n\t\t\tLMActive: true,\n\t\t\tReturnDate: 0,\n\t\t},\n\t\tAtti: Attributes{\n\t\t\tPosition: pos,\n\t\t},\n\t}\n\n\treturn player1\n}", "func createHyperShiftVPC() (*HyperShiftVPC, error) {\n\tctx := context.Background()\n\n\tvar vpc HyperShiftVPC\n\tworkingDir := viper.GetString(config.ReportDir)\n\n\ttf, err := terraform.New(workingDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer func() {\n\t\t_ = tf.Uninstall(ctx)\n\t}()\n\n\tlog.Println(\"Creating ROSA HyperShift aws vpc\")\n\n\terr = copyFile(\"terraform/setup-vpc.tf\", fmt.Sprintf(\"%s/setup-vpc.tf\", workingDir))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = tf.Init(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = callAndSetAWSSession(func() error {\n\t\terr := tf.Plan(\n\t\t\tctx,\n\t\t\ttfexec.Var(fmt.Sprintf(\"aws_region=%s\", viper.GetString(config.AWSRegion))),\n\t\t\ttfexec.Var(fmt.Sprintf(\"cluster_name=%s\", viper.GetString(config.Cluster.Name))),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = tf.Apply(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput, err := tf.Output(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvpc.PrivateSubnet = strings.ReplaceAll(string(output[\"cluster-private-subnet\"].Value), \"\\\"\", \"\")\n\tvpc.PublicSubnet = strings.ReplaceAll(string(output[\"cluster-public-subnet\"].Value), \"\\\"\", \"\")\n\tvpc.NodePrivateSubnet = strings.ReplaceAll(string(output[\"node-private-subnet\"].Value), \"\\\"\", \"\")\n\n\tlog.Println(\"ROSA HyperShift aws vpc created!\")\n\n\treturn &vpc, nil\n}", "func CreateDeploy(w http.ResponseWriter, r *http.Request) {\n\tdeploy := models.Deploy{}\n\terr := json.NewDecoder(r.Body).Decode(&deploy)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Todo validate requirement id\n\n\terr = models.InsertDeploy(deploy)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tw.WriteHeader(200)\n\terr = json.NewEncoder(w).Encode(deploy)\n\tif err != nil {\n\t\tpanic(error(err))\n\t}\n}", "func Create(w http.ResponseWriter, r *http.Request) {\n\tc := flight.Context(w, r)\n\tnow := time.Now()\n\n\tv := c.View.New(\"code/create\")\n\tv.Vars[\"curdate\"] = now.Format(\"2006-01-02\")\n\t//c.Repopulate(v.Vars, \"name\")\n\tv.Render(w, r)\n}", "func newPlane(mk, mdl string) *plane {\n\tp := &plane{}\n\tp.make = mk\n\tp.model = mdl\n\treturn p\n}", "func createPlayer(w http.ResponseWriter, r *http.Request) {\n\tplayer := models.NewPlayer(\"\")\n\tskue.Create(view, player, w, r)\n}", "func CreateResidence(o *entities.Player, x float64, y float64) (*entities.Residence, error) {\n\tif o.Level != entities.Admin {\n\t\treturn nil, fmt.Errorf(\"no permission\")\n\t}\n\n\tr := Model.NewResidence(x, y)\n\tr.Name = \"NoName\"\n\n\tStartRouting()\n\tAddOpLog(\"CreateResidence\", o, r)\n\treturn r, nil\n}", "func Create(engine *leader.Leader, port int) *http.Server {\n\tgame.InitGames()\n\tlgger := logger.Init(\"BattleSnake Web\", true, false, ioutil.Discard)\n\tvar host string\n\tif os.Getenv(\"ENV\") == \"dev\" {\n\t\thost = \"localhost\"\n\t} else {\n\t\thost = \"\"\n\t}\n\treturn &http.Server{\n\t\tAddr: fmt.Sprintf(\"%s:%d\", host, port),\n\t\tHandler: web.NewRouter(engine, lgger),\n\t\tReadTimeout: time.Duration(500) * time.Millisecond, // TODO remove hardcoding\n\t\tWriteTimeout: time.Duration(500) * time.Millisecond, // TODO remove hardcoding\n\t}\n}", "func NewProgramControl()(*ProgramControl) {\n m := &ProgramControl{\n Entity: *NewEntity(),\n }\n return m\n}", "func (d *Database) CreateBattle(LeaderID string, BattleName string, PointValuesAllowed []string, Plans []*model.Plan, AutoFinishVoting bool, PointAverageRounding string) (*model.Battle, error) {\n\tvar pointValuesJSON, _ = json.Marshal(PointValuesAllowed)\n\n\tvar b = &model.Battle{\n\t\tName: BattleName,\n\t\tUsers: make([]*model.BattleUser, 0),\n\t\tPlans: make([]*model.Plan, 0),\n\t\tVotingLocked: true,\n\t\tPointValuesAllowed: PointValuesAllowed,\n\t\tAutoFinishVoting: AutoFinishVoting,\n\t\tLeaders: make([]string, 0),\n\t}\n\tb.Leaders = append(b.Leaders, LeaderID)\n\n\te := d.db.QueryRow(\n\t\t`SELECT battleId FROM create_battle($1, $2, $3, $4, $5);`,\n\t\tLeaderID,\n\t\tBattleName,\n\t\tstring(pointValuesJSON),\n\t\tAutoFinishVoting,\n\t\tPointAverageRounding,\n\t).Scan(&b.Id)\n\tif e != nil {\n\t\tlog.Println(e)\n\t\treturn nil, errors.New(\"error creating battle\")\n\t}\n\n\tfor _, plan := range Plans {\n\t\tplan.Votes = make([]*model.Vote, 0)\n\n\t\te := d.db.QueryRow(\n\t\t\t`INSERT INTO plans (battle_id, name, type, reference_id, link, description, acceptance_criteria) VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING id`,\n\t\t\tb.Id,\n\t\t\tplan.Name,\n\t\t\tplan.Type,\n\t\t\tplan.ReferenceId,\n\t\t\tplan.Link,\n\t\t\tplan.Description,\n\t\t\tplan.AcceptanceCriteria,\n\t\t).Scan(&plan.Id)\n\t\tif e != nil {\n\t\t\tlog.Println(e)\n\t\t}\n\t}\n\n\tb.Plans = Plans\n\n\treturn b, nil\n}", "func (s *workspaces) Create(ctx context.Context, organization string, options WorkspaceCreateOptions) (*Workspace, error) {\n\tif !validStringID(&organization) {\n\t\treturn nil, ErrInvalidOrg\n\t}\n\tif err := options.valid(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tu := fmt.Sprintf(\"organizations/%s/workspaces\", url.QueryEscape(organization))\n\treq, err := s.client.NewRequest(\"POST\", u, &options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tw := &Workspace{}\n\terr = req.Do(ctx, w)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn w, nil\n}", "func (w *RandomWorld) CreateRandomFish() *GoWorld.Being {\n\t// Create an empty being\n\tbeing := &GoWorld.Being{ID: uuid.New()}\n\tbeing.Type = \"Water\"\n\n\t// Give the being the basic necessities\n\tbeing.Hunger = hungerRange.randomFloat()\n\tbeing.Thirst = thirstRange.randomFloat()\n\tbeing.WantsChild = wantsChildRange.randomFloat()\n\n\t// Shape the being\n\tbeing.LifeExpectancy = lifeExpectancyRange.randomFloat()\n\tbeing.VisionRange = visionRange.randomFloat()\n\tbeing.Speed = speedRange.randomFloat()\n\tbeing.Durability = durabilityRange.randomFloat()\n\tbeing.Stress = stressRange.randomFloat()\n\tbeing.Size = sizeRange.randomFloat()\n\tbeing.Gender = randomGender()\n\tbeing.Fertility = fertilityRange.randomFloat()\n\tbeing.MutationRate = mutationRange.randomFloat()\n\n\t// Water beings should spawn in water\n\trX := rand.Intn(w.Width)\n\trY := rand.Intn(w.Height)\n\toverflow := 0\n\t// If no being present at location set it as the spawn point\n\tfor w.TerrainSpots[rX][rY].Surface.CommonName != \"Water\" && w.TerrainSpots[rX][rY].Being == uuid.Nil {\n\t\trX = rand.Intn(w.Width)\n\t\trY = rand.Intn(w.Height)\n\t\t// Recover somehow if we look for a location for too long\n\t\toverflow++\n\t\tif overflow > 100000 {\n\t\t\t// Todo handle the infinite loop a little nicer than panicking\n\t\t\tpanic(\"error placing water being: tried 100k random spots and all occupied / not water\")\n\t\t}\n\t}\n\tbeing.Position.X = rX\n\tbeing.Position.Y = rY\n\t// Should always be water ID\n\tbeing.Habitat = w.TerrainSpots[rX][rY].Surface.ID\n\n\treturn being\n}", "func Create (w http.ResponseWriter, r *http.Request) {\n\t/* This is an SBC */\n\tif CREATED == false {\n\t\t/* Move the checking of ID up first to confirm this is allowed */\n\t\t/* Do most of start. Just don't download because that would be downloading from self */\n\t\t/* Get address and ID */\n\t\t/* Get port number and set that to ID */\n\t\t/* Save localhost as Addr */\n\t\tsplitHostPort := strings.Split(r.Host, \":\")\n\t\ti, err := strconv.ParseInt(splitHostPort[1], 10, 32)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(500)\n\t\t\tpanic(err)\n\t\t}\n\t\t/* ID is now port number. Address is now correct Address */\n\t\tID = int32(i)\n\t\tSELF_ADDR = r.Host\n\t\t/* Check if ID is allowed in ALLOWED_IDs */\n\t\tif _, ok := ALLOWED_IDS[ID]; ok {\n\t\t\tnewBlockChain := data.NewBlockChain()\n\n\t\t\tmpt1 := p1.MerklePatriciaTrie{}\n\t\t\tmpt1.Initial()\n\t\t\tmpt1.Insert(\"1\", \"Origin\")\n\n\t\t\tmpt2 := p1.MerklePatriciaTrie{}\n\t\t\tmpt2.Initial()\n\t\t\tmpt2.Insert(\"1\", \"Decoy1\")\n\n\t\t\tmpt3 := p1.MerklePatriciaTrie{}\n\t\t\tmpt3.Initial()\n\t\t\tmpt3.Insert(\"1\", \"Decoy2\")\n\n\t\t\tmpt4 := p1.MerklePatriciaTrie{}\n\t\t\tmpt4.Initial()\n\t\t\tmpt4.Insert(\"1\", \"Decoy3\")\n\n\t\t\thexPubKey := hexutil.Encode(signature_p.PUBLIC_KEY)\n\t\t\tnewBlockChain.GenBlock(mpt1, hexPubKey)\n\t\t\tnewBlockChain.GenBlock(mpt2, hexPubKey)\n\t\t\tnewBlockChain.GenBlock(mpt3, hexPubKey)\n\t\t\tnewBlockChain.GenBlock(mpt4, hexPubKey)\n\t\t\t/* Set Global variable SBC to be this new blockchain */\n\t\t\tSBC = newBlockChain\n\t\t\t/* Generate Multiple Blocks Initially */\n\t\t\t\t\n\t\t\tblockChainJson, _ := SBC.BlockChainToJson()\n\t\t\t/* Write this to the server */\n\t\t\tw.Write([]byte(blockChainJson))\n\n\t\t\t/* Need to instantiate the peer list */\n\t\t\tPeers = data.NewPeerList(ID, 32)\n\t\t\tBALLOT = ReadDataFromBallot()\n\t\t\tCREATED = true\n\t\t}\n\t}\n}", "func newResources(clusterID, clusterVPCID string, publicAccessFW publicAccessFirewall, gclient *godo.Client) *resources {\n\treturn &resources{\n\t\tclusterID: clusterID,\n\t\tclusterVPCID: clusterVPCID,\n\t\tfirewall: publicAccessFW,\n\n\t\tgclient: gclient,\n\t}\n}", "func newScenario(name string) *Instruction {\n\treturn &Instruction{\n\t\tType: ScenarioInst,\n\t\tName: name,\n\t\tVersion: &Version{},\n\t}\n}", "func New(w http.ResponseWriter, r *http.Request) {\r\n\ttmpl.ExecuteTemplate(w, \"New\", nil)\r\n}", "func New(w http.ResponseWriter, r *http.Request) {\r\n\ttmpl.ExecuteTemplate(w, \"New\", nil)\r\n}", "func CreateGame(w http.ResponseWriter, r *http.Request) {\n\t//----------------------------------------------------------------------------\n\t// Initialize an empty Game model\n\t//----------------------------------------------------------------------------\n\tdata := model.Game{}\n\t\n\t//----------------------------------------------------------------------------\n\t// Parse the body into a Game model structure\n\t//----------------------------------------------------------------------------\n\tutils.ParseBody(r, data)\n\n\t//----------------------------------------------------------------------------\n\t// Delegate to the Game data access object to create\n\t//----------------------------------------------------------------------------\n\trequestResult := GameDAO.CreateGame( data )\n\t\n\t//----------------------------------------------------------------------------\n\t// Marshal the model into a JSON object\n\t//----------------------------------------------------------------------------\n\tres,_ := json.Marshal(requestResult)\n\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(res)\n}", "func (v ToursResource) Create(c buffalo.Context) error {\n\t// Allocate an empty Tour\n\ttour := &models.Tour{}\n\n\t// Bind tour to the html form elements\n\tif err := c.Bind(tour); err != nil {\n\t\treturn err\n\t}\n\n\t// Get the DB connection from the context\n\ttx, ok := c.Value(\"tx\").(*pop.Connection)\n\tif !ok {\n\t\treturn errors.New(\"no transaction found\")\n\t}\n\n\t// Validate the data from the html form\n\tverrs, err := tx.ValidateAndCreate(tour)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif verrs.HasAny() {\n\t\t// Make the errors available inside the html template\n\t\tc.Set(\"errors\", verrs)\n\n\t\t// Render again the new.html template that the user can\n\t\t// correct the input.\n\t\treturn c.Render(422, r.Auto(c, tour))\n\t}\n\n\t// If there are no errors set a success message\n\tc.Flash().Add(\"success\", T.Translate(c, \"tour.created.success\"))\n\t// and redirect to the tours index page\n\treturn c.Render(201, r.Auto(c, tour))\n}", "func createRace(w http.ResponseWriter, r *http.Request) {\n core_module.SetHeaders(&w)\n\n var race DndRace\n decoder := json.NewDecoder(r.Body)\n err := decoder.Decode(&race)\n\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n json.NewEncoder(w).Encode(&core_module.CoreException{\n Message: \"Could not decode!\",\n })\n log.Println(err)\n return\n }\n\n _, err = core_module.Db.Model(&race).Insert()\n if err != nil {\n w.WriteHeader(http.StatusInternalServerError)\n json.NewEncoder(w).Encode(&core_module.CoreException{\n Message: \"Could not insert into database!\",\n })\n log.Println(err)\n return\n }\n\n w.WriteHeader(http.StatusAccepted)\n}", "func CreateProject(w http.ResponseWriter, r *http.Request) {\n\tvar p models.Project\n\n\tu := mw.GetUser(r.Context())\n\tif u == nil || !u.IsAdmin {\n\t\tw.WriteHeader(403)\n\t\tw.Write(apiError(\"you must be logged in as a system administrator to create a project\"))\n\t\treturn\n\t}\n\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&p)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tw.Write(apiError(\"invalid body\"))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\terr = Store.Projects().New(&p)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tw.Write(apiError(err.Error()))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tsendJSON(w, p)\n}", "func doCreate(constructor func() base.IGameObject2D, isActive *bool) base.IGameObject2D {\r\n\tobj := constructor()\r\n\tobj.Obj().SetIGameObject2D(obj)\r\n\tapp.registerChannel <- resourceAccessRequest{\r\n\t\tpayload: obj,\r\n\t\tisActive: isActive,\r\n\t}\r\n\treturn obj\r\n}", "func createCat() *Cat {\n\treturn NewCat(\"Mike\")\n}", "func NewWorld(serverUrl string, apiVersion string) *World {\n\treturn &World{\n\t\tserverUrl: serverUrl,\n\t\tapiVersion: apiVersion,\n\t}\n}", "func NewWorkspace(volume, containerName, imageName string) {\n CreateReadOnlyLayer(imageName)\n CreateWriteLayer(containerName)\n CreateMountPoint(containerName, imageName)\n if volume == \"\" {\n return\n }\n volumeURLs := strings.Split(volume, \":\")\n if len(volumeURLs) != 2 || volumeURLs[0] == \"\" || volumeURLs[1] == \"\" {\n log.Warn(\"Volume argument input is not correct.\")\n return\n }\n MountVolume(containerName, volumeURLs)\n log.Infof(\"Mount volume %q\", volumeURLs)\n}", "func CreateRogue(name string) *rogue {\n\tr := &rogue{\n\t\tname: name,\n\t\tmaxhp: 50 + Rolld(10),\n\t\tdex: 5 + Rolld(6),\n\t}\n\tr.ap += 10 + r.dex\n\tr.armor += Rolld(6) + r.dex\n\tr.hp = r.maxhp\n\treturn r\n}", "func (s *Server) NewWorld(addr string, initTrucks int32) (err error) {\n\tworldId, err := s.sim.NewWorld(addr, initTrucks)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = db.WithTx(s.db, func(tx *sql.Tx) (err error) {\n\t\tdb.DestroySchema(tx)\n\t\terr = db.InitSchema(tx)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = db.SetMeta(tx, \"world_id\", strconv.FormatInt(worldId, 10))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = s.initTrucks(tx, initTrucks)\n\t\treturn\n\t})\n\tif err != nil {\n\t\treturn\n\t}\n\tlog.Println(\"created world\", worldId)\n\treturn\n}", "func New(w http.ResponseWriter, r *http.Request) {\n\tgetTemplates().ExecuteTemplate(w, \"New\", nil)\n}", "func (u *App) Create(c echo.Context, req *Create) (*model.Course, error) {\n\tif err := u.rbac.EnforceRole(c, model.AdminRole); err != nil {\n\t\treturn nil, err\n\t}\n\n\tid, err := util.GenerateUUID()\n\tif err = zaplog.ZLog(err); err != nil {\n\t\treturn nil, err\n\t}\n\n\tschoolName := \"\"\n\tvar school model.Organization\n\tif err := u.db.Model(&model.Organization{}).Where(\"uuid = ?\", req.School).First(&school).Error; err == nil {\n\t\tschoolName = school.Name\n\t}\n\n\tcourse := model.Course{\n\t\tBase: model.Base{ID: id},\n\t\tName: req.Name,\n\t\tSchool: req.School,\n\t\tSchoolName: schoolName,\n\t\tDepartment: req.Department,\n\t\tDomain: req.Domain,\n\t\tCluster: req.Cluster,\n\t\tType: req.Type,\n\t\tLevel: req.Level,\n\t}\n\n\tvar domain model.CourseDomain\n\tif err := u.db.Model(&model.CourseDomain{}).Where(\"uuid = ?\", req.Domain).First(&domain).Error; err == nil {\n\t\tcourse.DomainName = domain.Name\n\t\tfor _, cluster := range domain.Clusters {\n\t\t\tif course.Cluster == cluster.ID {\n\t\t\t\tcourse.ClusterName = cluster.Name\n\t\t\t}\n\t\t}\n\t}\n\n\treturn u.udb.Create(u.db, course)\n}", "func (sh *Shift) Create() error {\n\tvalidator := validatorimpl.NewDefaultValidator()\n\terrs := validator.Verify(sh)\n\tif len(errs) != 0 {\n\t\treturn fmt.Errorf(\"Save the shift failed due to content errors: %v\", errs)\n\t}\n\tshiftRepo := repoimpl.GetShiftRepo()\n\tfindCtx, findCancel := utils.GetDefaultCtx()\n\tdefer findCancel()\n\trst := shiftRepo.FindOne(findCtx, bson.M{\"projectId\": sh.ProjectID})\n\tif rst.Err() == nil {\n\t\treturn DuplicateShiftError{}\n\t}\n\tctxInsert, cancelInsert := utils.GetDefaultCtx()\n\tdefer cancelInsert()\n\t_, err := shiftRepo.InsertOne(ctxInsert, sh)\n\treturn err\n}", "func newcomputer(brand string) *computer {\n\treturn &computer{brand: brand}\n}", "func (p *Provider) CreateSpace(name string, projectID int, clusterID *int) (int, error) {\n\t// Response struct\n\tresponse := struct {\n\t\tCreateSpace *struct {\n\t\t\tSpaceID int\n\t\t} `json:\"manager_createSpace\"`\n\t}{}\n\n\t// Do the request\n\terr := p.GrapqhlRequest(`\n\t\tmutation($spaceName: String!, $clusterID: Int, $projectID: Int!) {\n\t\t\tmanager_createSpace(spaceName: $spaceName, clusterID: $clusterID, projectID: $projectID) {\n\t\t\t\tSpaceID\n\t\t\t}\n\t\t}\n\t`, map[string]interface{}{\n\t\t\"spaceName\": name,\n\t\t\"projectID\": projectID,\n\t\t\"clusterID\": clusterID,\n\t}, &response)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// Check result\n\tif response.CreateSpace == nil {\n\t\treturn 0, errors.New(\"Couldn't create project: returned answer is null\")\n\t}\n\n\treturn response.CreateSpace.SpaceID, nil\n}", "func (l *LifeSystem) New(w *ecs.World) {\n\tl.world = w\n\tl.isFirstTime = true\n}", "func createLobby(maxRounds int, startingTeam int, team1Name string, team2Name string) Lobby {\n\n\t// Firstly generate uuids\n\tlobbyUUID := generateUUID()\n\tteam1UIDGenerated := generateUUID()\n\tteam2UIDGenerated := generateUUID()\n\n\tlobby := Lobby{\n\t\tLobbyUID: lobbyUUID,\n\t\tTeam1UID: team1UIDGenerated,\n\t\tTeam1Name: team1Name,\n\t\tTeam2Name: team2Name,\n\t\tTeam2UID: team2UIDGenerated,\n\t\tTeam1link: fmt.Sprintf(`/pv/%v/%v`, lobbyUUID, team1UIDGenerated),\n\t\tTeam2link: fmt.Sprintf(`/pv/%v/%v`, lobbyUUID, team2UIDGenerated),\n\t\tMaxRounds: maxRounds,\n\t\tEnabled: false,\n\t\tStartingTeam: startingTeam,\n\t}\n\n\t// By default whenever a new lobby is generated then a game on nagrand is added.\n\t// With the exception of there being a potential different map for single play.\n\tif maxRounds != 1 {\n\t\tlobby.createDefaultGame(startingTeam)\n\t}\n\n\tif maxRounds == 1 {\n\t\tlobby.createGame(startingTeam, 1)\n\t}\n\n\treturn lobby\n\n}", "func createBooking(w http.ResponseWriter, r *http.Request) {\n\treqBody, _ := ioutil.ReadAll(r.Body)\n\tvar bookingRequest BookingRequest\n\terr := json.Unmarshal(reqBody, &bookingRequest)\n\tif err != nil {\n\t\terr = errorResponse(w, InvalidJSON, http.StatusBadRequest)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\n\tdate, err := time.Parse(layoutISO, bookingRequest.Date)\n\tif err != nil {\n\t\terr = errorResponse(w, InvalidDate, http.StatusBadRequest)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\n\tclass, err := findClassReference(bookingRequest.ClassName, date)\n\tif err != nil {\n\t\terr = errorResponse(w, ClassDoesNotExists, http.StatusNotFound)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\tbookingRequest.Id = createID()\n\tclass.addBooking(Booking{bookingRequest.MemberName, bookingRequest.Id})\n\tw.WriteHeader(http.StatusCreated)\n\terr = json.NewEncoder(w).Encode(bookingRequest)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}", "func NewSpace(t *testing.T, awaitilities wait.Awaitilities, opts ...SpaceOption) *toolchainv1alpha1.Space {\n\tnamePrefix := strings.ToLower(t.Name())\n\t// Remove all invalid characters\n\tnamePrefix = notAllowedChars.ReplaceAllString(namePrefix, \"\")\n\n\t// Trim if the length exceeds 40 chars (63 is the max)\n\tif len(namePrefix) > 40 {\n\t\tnamePrefix = namePrefix[0:40]\n\t}\n\n\tspace := &toolchainv1alpha1.Space{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: awaitilities.Host().Namespace,\n\t\t\tGenerateName: namePrefix + \"-\",\n\t\t},\n\t}\n\tfor _, apply := range opts {\n\t\tapply(space)\n\t}\n\treturn space\n}", "func WorkloadNew(homeDirectory string, org string) {\n\n\t// Verify that env vars are set properly and determine the working directory.\n\tdir, err := VerifyEnvironment(homeDirectory, false, false, \"\")\n\tif err != nil {\n\t\tcliutils.Fatal(cliutils.CLI_INPUT_ERROR, \"'%v %v' %v\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND, err)\n\t}\n\n\tif org == \"\" && os.Getenv(DEVTOOL_HZN_ORG) == \"\" {\n\t\tcliutils.Fatal(cliutils.CLI_INPUT_ERROR, \"'%v %v' must specify either --org or set the %v environment variable.\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND, DEVTOOL_HZN_ORG)\n\t}\n\n\t// Create the working directory.\n\tif err := CreateWorkingDir(dir); err != nil {\n\t\tcliutils.Fatal(cliutils.CLI_INPUT_ERROR, \"'%v %v' %v\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND, err)\n\t}\n\n\t// If there are any horizon metadata files already in the directory then we wont create any files.\n\tcmd := fmt.Sprintf(\"%v %v\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND)\n\tFileNotExist(dir, cmd, USERINPUT_FILE, UserInputExists)\n\tFileNotExist(dir, cmd, WORKLOAD_DEFINITION_FILE, WorkloadDefinitionExists)\n\t//FileNotExist(dir, cmd, DEPENDENCIES_FILE, DependenciesExists)\n\n\tif org == \"\" {\n\t\torg = os.Getenv(DEVTOOL_HZN_ORG)\n\t}\n\n\t// Create the metadata files.\n\tif err := CreateUserInputs(dir, true, false, org); err != nil {\n\t\tcliutils.Fatal(cliutils.CLI_GENERAL_ERROR, \"'%v %v' %v\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND, err)\n\t} else if err := CreateWorkloadDefinition(dir, org); err != nil {\n\t\tcliutils.Fatal(cliutils.CLI_GENERAL_ERROR, \"'%v %v' %v\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND, err)\n\t}\n\t// } else if err := CreateDependencies(dir); err != nil {\n\t// \tcliutils.Fatal(cliutils.CLI_GENERAL_ERROR, \"'%v %v' %v\", WORKLOAD_COMMAND, WORKLOAD_CREATION_COMMAND, err)\n\t// }\n\n\tfmt.Printf(\"Created horizon metadata files in %v. Edit these files to define and configure your new %v.\\n\", dir, WORKLOAD_COMMAND)\n\n}", "func newPerson(name string,class string, nationality string ) *Person {\n\treturn &Person{name: name,job: class, nationality: nationality}\n\n}", "func CreateIstanbulPolicy(toolchainID string, policyName string) error {\n\turl := getGateService() + \"/api/v5/toolchainids/\" + toolchainID + \"/policies\"\n\n\t// prepare the payload\n\trule := map[string]interface{}{\n\t\t\"name\": \"testcoveragepercentage\",\n\t\t\"format\": \"istanbul\",\n\t\t\"stage\": \"code\",\n\t\t\"codeCoverage\": 100,\n\t}\n\n\trules := [1]map[string]interface{}{rule}\n\n\tpayload := map[string]interface{}{\n\t\t\"name\": policyName,\n\t\t\"rules\": rules,\n\t}\n\n\t//fmt.Printf(\"%+v\", payload)\n\tbytesRepresentation, marshalerr := json.Marshal(payload)\n\tif marshalerr != nil {\n\t\treturn errors.New(\"Failed to json.Marshal the payload Error: \" + marshalerr.Error())\n\t}\n\n\tstatusCode, body, reqerr := httpRequest(\"POST\", url, bytes.NewBuffer(bytesRepresentation))\n\tif reqerr != nil {\n\t\treturn errors.New(\"Failed to create istanbul policy Error: \" + reqerr.Error())\n\t}\n\tif statusCode != 201 {\n\t\treturn errors.New(\"Failed to create istanbul policy \" + fmt.Sprintf(\"statusCode %v\", statusCode) + \" Error: \" + fmt.Sprintf(\"body: %v\", body))\n\t}\n\treturn nil\n}", "func CreateWorkload(pce PCE, workload Workload) (Workload, APIResponse, error) {\n\tvar newWL Workload\n\tvar api APIResponse\n\tvar err error\n\n\t// Build the API URL\n\tapiURL, err := url.Parse(\"https://\" + pceSanitization(pce.FQDN) + \":\" + strconv.Itoa(pce.Port) + \"/api/v2/orgs/\" + strconv.Itoa(pce.Org) + \"/workloads\")\n\tif err != nil {\n\t\treturn newWL, api, fmt.Errorf(\"create workload - %s\", err)\n\t}\n\n\t// Call the API\n\tworkloadJSON, err := json.Marshal(workload)\n\tif err != nil {\n\t\treturn newWL, api, fmt.Errorf(\"create workload - %s\", err)\n\t}\n\tapi, err = apicall(\"POST\", apiURL.String(), pce, workloadJSON, false)\n\tif err != nil {\n\t\treturn newWL, api, fmt.Errorf(\"create workload - %s\", err)\n\t}\n\n\t// Marshal JSON\n\tjson.Unmarshal([]byte(api.RespBody), &newWL)\n\n\treturn newWL, api, nil\n}", "func (obj *MovieTypeController) CreateNewMovieType(c *fiber.Ctx) error {\n\tmoveTypeRequest := new(request.MovieTypeRequest)\n\n\tif err := c.BodyParser(moveTypeRequest); err != nil {\n\t\treturn util.ResponseError(err.Error(), nil)\n\t}\n\n\tmoveType := model.MovieType{\n\t\tName: moveTypeRequest.Name,\n\t\tSlug: moveTypeRequest.Slug,\n\t\tStatus: moveTypeRequest.Status,\n\t}\n\n\tif _, err := obj.movieTypeRepository.SaveMovieType(moveType); err != nil {\n\t\treturn util.ResponseError(err.Error(), nil)\n\t}\n\n\treturn util.ResponseSuccess(\"Thành công\", nil)\n}", "func doCreate(enviro env.Project, appJson, rootDir, appName, vendorDir, constraints string) error {\n\tfmt.Printf(\"Creating initial project structure, this might take a few seconds ... \\n\")\n\tdescriptor, err := ParseAppDescriptor(appJson)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif appName != \"\" {\n\t\t// override the application name\n\n\t\taltJson := strings.Replace(appJson, `\"`+descriptor.Name+`\"`, `\"`+appName+`\"`, 1)\n\t\taltDescriptor, err := ParseAppDescriptor(altJson)\n\n\t\t//see if we can get away with simple replace so we don't reorder the existing json\n\t\tif err == nil && altDescriptor.Name == appName {\n\t\t\tappJson = altJson\n\t\t} else {\n\t\t\t//simple replace didn't work so we have to unmarshal & re-marshal the supplied json\n\t\t\tvar appObj map[string]interface{}\n\t\t\terr := json.Unmarshal([]byte(appJson), &appObj)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tappObj[\"name\"] = appName\n\n\t\t\tupdApp, err := json.MarshalIndent(appObj, \"\", \" \")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tappJson = string(updApp)\n\t\t}\n\n\t\tdescriptor.Name = appName\n\t} else {\n\t\tappName = descriptor.Name\n\t\trootDir = filepath.Join(rootDir, appName)\n\t}\n\n\terr = enviro.Init(rootDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = enviro.Create(false, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = fgutil.CreateFileFromString(filepath.Join(rootDir, \"flogo.json\"), appJson)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// create initial structure\n\tappDir := filepath.Join(enviro.GetSourceDir(), descriptor.Name)\n\tos.MkdirAll(appDir, os.ModePerm)\n\n\t// Validate structure\n\terr = enviro.Open()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create the dep manager\n\tdepManager := &dep.DepManager{Env: enviro}\n\n\t// Initialize the dep manager\n\terr = depManager.Init()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create initial files\n\tdeps, err := config.ExtractAllDependencies(appJson)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcreateMainGoFile(appDir, \"\")\n\tcreateImportsGoFile(appDir, deps)\n\n\t// Add constraints\n\tif len(constraints) > 0 {\n\t\tnewConstraints := []string{\"-add\"}\n\t\tnewConstraints = append(newConstraints, strings.Split(constraints, \",\")...)\n\t\terr = depManager.Ensure(newConstraints...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tensureArgs := []string{}\n\n\tif len(vendorDir) > 0 {\n\t\t// Copy vendor directory\n\t\tfgutil.CopyDir(vendorDir, enviro.GetVendorDir())\n\t\t// Do not touch vendor folder when ensuring\n\t\tensureArgs = append(ensureArgs, \"-no-vendor\")\n\t}\n\n\t// Sync up\n\terr = depManager.Ensure(ensureArgs...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func Create (appName string) {\n\n checkGopath ()\n checkContainer (appName)\n\n app := Application { Name: appName }\n\n app.createContainer ()\n\n err := app.copyFileTree (\n GOPATH + slash + applicationTemplatesPath,\n GOPATH_SRC + app.Name,\n )\n\n if err != nil {\n log.Fatal (err)\n }\n}", "func (c *Controller) Create(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\ttoken := r.FormValue(\"token\")\n\tmaxPlayers := r.FormValue(\"maxPlayers\")\n\tname := r.FormValue(\"name\")\n\tservice, err := createDSTService(token, maxPlayers, name)\n\tif c.CheckError(err, http.StatusBadRequest, w) {\n\t\treturn\n\t}\n\tc.SendJSON(\n\t\tw,\n\t\tr,\n\t\tservice,\n\t\thttp.StatusOK,\n\t)\n}", "func NewPlane(name string, client sleepwalker.RESTClient) Plane {\n\tdesc := \"airstrike.NewPlane\"\n\tlog.WithFields(map[string]interface{}{\n\t\t\"name\": name,\n\t\t\"client\": client,\n\t}).Debug(desc)\n\treturn Plane{Name: name, Client: client}\n}", "func create_site() {\n\n\tcreate_dirs()\n\tcreate_theme_files()\n}", "func New(width int, visualization string, zeitpunkte []time.Time) (slm sunlightmap) {\n\tslm = sunlightmap{}\n\tslm.Width = width - width%2\n\tslm.Height = slm.Width / 2\n\tslm.visualization = visualization\n\tslm.DaylightImageFilename = \"world_mine_day_solarized_720-360.png\"\n\tslm.NighttimeImageFilename = \"world_mine_night_solarized_720-360.png\"\n\tslm.zeitpunkte = zeitpunkte //[]time.Time{time.Date(2017, 10, 24, 17, 30, 0, 0, time.UTC)}\n\treturn\n}", "func createClass(w http.ResponseWriter, r *http.Request) {\n\treqBody, _ := ioutil.ReadAll(r.Body)\n\n\tvar classRequest ClassRequest\n\terr := json.Unmarshal(reqBody, &classRequest)\n\tif err != nil {\n\t\terr = errorResponse(w, InvalidJSON, http.StatusBadRequest)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\n\tvar classes []Class\n\tstartDate, err := time.Parse(layoutISO, classRequest.StartDate)\n\tif err != nil {\n\t\terr = errorResponse(w, InvalidDate, http.StatusBadRequest)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\tendDate, err := time.Parse(layoutISO, classRequest.EndDate)\n\tif err != nil {\n\t\terr = errorResponse(w, InvalidDate, http.StatusBadRequest)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\n\tfor days := 0; days <= int(endDate.Sub(startDate).Hours()/24); days++ {\n\t\tclass := Class{\n\t\t\tId: createID(),\n\t\t\tName: classRequest.Name,\n\t\t\tDate: startDate.Add(time.Hour * 24 * time.Duration(days)),\n\t\t\tCapacity: classRequest.Capacity,\n\t\t}\n\t\tclasses = append(classes, class)\n\t}\n\tDBClasses = append(DBClasses, classes...)\n\n\tw.WriteHeader(http.StatusCreated)\n\terr = json.NewEncoder(w).Encode(classes)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n}", "func (w *RandomWorld) CreateFlyers(quantity int) {\n\t// Initialize each being to a random one\n\tfor i := 0; i < quantity; i++ {\n\t\t// Create random being and place it into the map\n\t\tb := w.CreateRandomFlyer()\n\t\tw.BeingList[b.ID.String()] = b\n\t}\n}", "func (router *router) createProject(request *restful.Request, response *restful.Response) {\n\tproject := &model.Project{}\n\tcreatedProject, err := router.projectManager.CreateProject(project)\n\tif err != nil {\n\t\tlog.Fatalf(\"create Project failed,err msg%s\", err)\n\t}\n\tresponse.WriteHeaderAndEntity(http.StatusCreated, createdProject)\n}", "func (s *API) CreateDatabase(req *CreateDatabaseRequest, opts ...scw.RequestOption) (*Database, 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.InstanceID) == \"\" {\n\t\treturn nil, errors.New(\"field InstanceID cannot be empty in request\")\n\t}\n\n\tscwReq := &scw.ScalewayRequest{\n\t\tMethod: \"POST\",\n\t\tPath: \"/rdb/v1/regions/\" + fmt.Sprint(req.Region) + \"/instances/\" + fmt.Sprint(req.InstanceID) + \"/databases\",\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 Database\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}", "func CreateRelease(res http.ResponseWriter, req *http.Request) {\n\tres.Header().Set(\"Content-Type\", \"application/json\")\n\tc := Release{\"relid\", \"http://ispw:8080/ispw/ispw/releases/relid\"}\n\toutgoingJSON, err := json.Marshal(c)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\thttp.Error(res, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tres.WriteHeader(http.StatusCreated)\n\tfmt.Fprint(res, string(outgoingJSON))\n}", "func NewWeather(closeTapped func()) (view fyne.CanvasObject, viewModel *Weather) {\n\tw := Weather{}\n\tw.city = widget.NewLabel(\"City\")\n\tw.city.Alignment = fyne.TextAlignCenter\n\tw.city.TextStyle.Bold = true\n\n\tw.currentTemperature = widget.NewLabel(\"Current Temperature\")\n\tw.currentTemperature.Alignment = fyne.TextAlignCenter\n\n\tw.clock = widget.NewLabel(\"Clock\")\n\tw.clock.TextStyle.Bold = true\n\n\tw.lastUpdate = widget.NewLabel(\"Last update\")\n\tw.lastUpdate.Alignment = fyne.TextAlignCenter\n\n\tw.background = &canvas.Image{FillMode: canvas.ImageFillStretch}\n\tw.today = newForecast()\n\tw.tomorrow = newForecast()\n\tw.afterTomorrow = newForecast()\n\n\theader := container.New(layout.NewHBoxLayout(),\n\t\tlayout.NewSpacer(),\n\t\tcontainer.New(layout.NewVBoxLayout(),\n\t\t\tw.city,\n\t\t\tw.currentTemperature,\n\t\t),\n\t\tcontainer.NewVBox(),\n\t\tlayout.NewSpacer(),\n\t)\n\tfooter := container.New(layout.NewHBoxLayout(),\n\t\twidget.NewButton(assets.GetLabel(assets.Close), closeTapped),\n\t\tlayout.NewSpacer(),\n\t\tw.clock,\n\t)\n\tcenter := container.New(layout.NewVBoxLayout(),\n\t\tcontainer.New(layout.NewGridLayout(3),\n\t\t\tw.today.layout,\n\t\t\tw.tomorrow.layout,\n\t\t\tw.afterTomorrow.layout,\n\t\t),\n\t\tw.lastUpdate,\n\t)\n\tw.view = container.New(layout.NewMaxLayout(),\n\t\tw.background,\n\t\tcontainer.New(layout.NewVBoxLayout(),\n\t\t\theader,\n\t\t\tlayout.NewSpacer(),\n\t\t\tcenter,\n\t\t\tlayout.NewSpacer(),\n\t\t\tfooter,\n\t\t),\n\t)\n\n\tw.today.header.SetText(assets.GetLabel(assets.Today))\n\tw.tomorrow.header.SetText(assets.GetLabel(assets.Tomorrow))\n\tw.afterTomorrow.header.SetText(assets.GetLabel(assets.AfterTomorrow))\n\tdefaultBackground, _ := assets.GetBackgroundImage(weather.ConditionClear)\n\tw.SetBackground(defaultBackground)\n\n\treturn w.view, &w\n}", "func New() *World {\n\treturn &World{}\n}", "func (v ProspectsResource) Create(c buffalo.Context) error {\n\t// Allocate an empty Prospect\n\tprospect := &models.Prospect{}\n\n\t// Bind prospect to the html form elements\n\tif err := c.Bind(prospect); err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\t// Get the DB connection from the context\n\ttx := c.Value(\"tx\").(*pop.Connection)\n\n\t// Validate the data from the html form\n\tverrs, err := tx.ValidateAndCreate(prospect)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\tif verrs.HasAny() {\n\t\t// Make prospect available inside the html template\n\t\tc.Set(\"prospect\", prospect)\n\n\t\t// Make the errors available inside the html template\n\t\tc.Set(\"errors\", verrs)\n\n\t\t// Render again the new.html template that the user can\n\t\t// correct the input.\n\t\treturn c.Render(422, r.HTML(\"prospects/new.html\"))\n\t}\n\n\t// If there are no errors set a success message\n\tc.Flash().Add(\"success\", \"Prospect was created successfully\")\n\n\t// and redirect to the prospects index page\n\treturn c.Redirect(302, \"/prospects/%s\", prospect.ID)\n}", "func newBoard(x, y, w, h int) *Board {\n\treturn &Board{\n\t\tDimension: Dimension{\n\t\t\tx,\n\t\t\ty,\n\t\t\tw,\n\t\t\th,\n\t\t},\n\t}\n}", "func CreateTrade(w http.ResponseWriter, r *http.Request) {\n\tdata := &TradeRequest{}\n\tif err := render.Bind(r, data); err != nil {\n\t\trender.Render(w, r, ErrInvalidRequest(err))\n\t\treturn\n\t}\n\n\t// request auth is from initiator\n\t_, claims, _ := jwtauth.FromContext(r.Context())\n\ttrade, err := NewTrade(data, claims[\"userID\"].(string))\n\tif err != nil {\n\t\trender.Render(w, r, ErrInvalidRequest(err))\n\t\treturn\n\t}\n\n\tschID, err := primitive.ObjectIDFromHex(data.ScheduleID)\n\tif err != nil {\n\t\trender.Render(w, r, ErrServer(err))\n\t\treturn\n\t}\n\tif err = mh.InsertTrade(trade, schID); err != nil {\n\t\trender.Render(w, r, ErrServer(err))\n\t\treturn\n\t}\n\trender.Status(r, http.StatusCreated)\n\trender.Render(w, r, NewTradeResponse(*trade))\n}", "func NewWorld() *World {\n\treturn &World{\n\t\tCities: make(map[CityName]*City),\n\t\tRoads: make(map[CityName][]*Road),\n\t}\n}", "func (c *DetaClient) NewProgram(r *NewProgramRequest) (*NewProgramResponse, error) {\n\ti := &requestInput{\n\t\tPath: fmt.Sprintf(\"/%s/\", \"programs\"),\n\t\tMethod: \"POST\",\n\t\tNeedsAuth: true,\n\t\tBody: *r,\n\t}\n\n\to, err := c.request(i)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif o.Status != 200 {\n\t\tmsg := o.Error.Message\n\t\tif msg == \"\" {\n\t\t\tmsg = o.Error.Errors[0]\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to create new program: %v\", msg)\n\t}\n\n\tvar resp NewProgramResponse\n\terr = json.Unmarshal(o.Body, &resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create new program: %v\", err)\n\t}\n\treturn &resp, nil\n}", "func New(ctx context.Context, t *testing.T, cfg Config) *Hospital {\n\tt.Helper()\n\treturn WithTime(ctx, t, cfg, now)\n}", "func newGame(renderer *sdl.Renderer) (*Game, error) {\n\tground, err := ground.NewGrounds(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttrex, err := trex.NewTrex(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcactus, err := cactus.NewCactus(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclouds, err := clouds.NewClouds(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Game{\n\t\trenderer: renderer,\n\t\tground: ground,\n\t\ttrex: trex,\n\t\tcactus: cactus,\n\t\tclouds: clouds,\n\t}, nil\n}", "func (u *Usecase) CreateDrone(w http.ResponseWriter, r *http.Request) (interface{}, error) {\n\tdrone := &models.Drone{}\n\tjson.NewDecoder(r.Body).Decode(drone)\n\n\tlog.Println(\"drone \", drone)\n\n\t//check if drone is already created\n\tif _, ok := models.DronesMap[drone.ID]; ok {\n\t\treturn nil, models.CreateAppError(\"drone already exist\", http.StatusConflict)\n\t}\n\n\t//check if sector exists\n\tif _, ok := models.SectorsMap[drone.SectorID]; !ok {\n\t\treturn nil, models.CreateAppError(\"sector doesn't exist\", http.StatusBadRequest)\n\t}\n\n\tmodels.DroneIDCounter++\n\t//set drone ID\n\tdrone.ID = models.DroneIDCounter\n\n\tif drone.Type == \"\" {\n\t\tdrone.Type = \"v1\"\n\t}\n\n\tsector := models.SectorsMap[drone.SectorID]\n\tsector.DroneList = append(sector.DroneList, drone)\n\n\t//insert in global map\n\tmodels.DronesMap[drone.ID] = drone\n\n\treturn drone, nil\n}", "func (c *PlanetClient) Create() *PlanetCreate {\n\tmutation := newPlanetMutation(c.config, OpCreate)\n\treturn &PlanetCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "func NewReserve(appPath, name string) *Reserve {\n\tdbPath := appPath + \"data/\"\n\tos.MkdirAll(dbPath, 0755)\n\treturn &Reserve{\n\t\tname: name,\n\t\tpath: dbPath + name + \".json\",\n\t}\n}", "func (repo GymRepository) CreateGym(gym models.GymProfile) models.GymProfile {\n\trepo.db.Create(&gym)\n\treturn gym\n}", "func (esc *ExtendedSimpleContract) Create(ctx utils.CustomTransactionContextInterface, key string) error {\n\texisting := ctx.GetCallData()\n\n\tif existing != nil {\n\t\treturn fmt.Errorf(\"Cannot create world state pair with key %s. Already exists\", key)\n\t}\n\n\terr := ctx.GetStub().PutState(key, []byte(\"Initialised\"))\n\n\tif err != nil {\n\t\treturn errors.New(\"Unable to interact with world state\")\n\t}\n\n\treturn nil\n}", "func NewProgram(lessons []*LessonPgm) *Program {\n\treturn &Program{base.WildCardLabel, lessons}\n}", "func createPerson(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"CREATE HIT\")\n\tstmt, err := db.Prepare(\"INSERT INTO Persons(pAge, pName) VALUES (?,?)\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tvar per Person\n\tjson.Unmarshal(body, &per)\n\tage := per.Age\n\tname := per.Name\n\t_, err = stmt.Exec(age, name)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Fprintf(w, \"New person was created\")\n}", "func (app *application) createBoard(w http.ResponseWriter, r *http.Request) {\n\tplayerID := app.session.GetInt(r, \"authenticatedPlayerID\")\n\t// POST /create/board\n\terr := r.ParseForm()\n\tif err != nil {\n\t\tapp.clientError(w, http.StatusBadRequest)\n\t\treturn\n\t}\n\t\n\t// Create a new forms.Form struct containing the POSTed data\n\t// - Use the validation methods to check the content\n\tform := forms.New(r.PostForm)\n\tform.Required(\"boardName\")\n\tform.MaxLength(\"boardName\", 35)\n\n\t// Before returning to the caller, let's check the validity of the ship coordinates\n\t// - If anything is amiss, we can send those errors back as well\n\tvar carrier []string\n\tcInd := 0\n\tvar battleship []string\n\tbInd := 0\n\tvar cruiser []string\n\trInd := 0\n\tvar submarine []string\n\tsInd := 0\n\tvar destroyer []string\n\tdInd := 0\n\t// Loop through the POSTed data, checking for their values\n\t// - Add coordinates to a given ship's array\n for row := 1; row < 11; row++ {\n\t\trowStr := strconv.Itoa(row)\n \t\tfor _, col := range \"ABCDEFGHIJ\" {\n\t\t\tcolStr := string(col)\n\t\t\tshipXY := form.Get(\"shipXY\"+rowStr+colStr)\n\t\t\tif shipXY != \"\" {\n\t\t\t\t// Only I, the program, should be permitted to update this as a player enters a game\n\t\t\t\t//battleID := r.URL.Query().Get(\"battleID\")\n\t\t\t\t// playerID should be gotten from somewhere else\n\t\t\t\t//playerID = r.PostForm(\"playerID\")\n\n\t\t\t\t// Upper the values to simplify testing\n\t\t\t\t// - Build the slices containing the submitted coordinates\n\t\t\t\tswitch strings.ToUpper(shipXY) {\n\t\t\t\tcase \"C\":\n\t\t\t\t\tcarrier = append(carrier, rowStr+\",\"+colStr)\n\t\t\t\t\tcInd += 1\n\t\t\t\tcase \"B\":\n\t\t\t\t\tbattleship = append(battleship, rowStr+\",\"+colStr)\n\t\t\t\t\tbInd += 1\n\t\t\t\tcase \"R\":\n\t\t\t\t\tcruiser = append(cruiser, rowStr+\",\"+colStr)\n\t\t\t\t\trInd += 1\n\t\t\t\tcase \"S\":\n\t\t\t\t\tsubmarine = append(submarine, rowStr+\",\"+colStr)\n\t\t\t\t\tsInd += 1\n\t\t\t\tcase \"D\":\n\t\t\t\t\tdestroyer = append(destroyer, rowStr+\",\"+colStr)\n\t\t\t\t\tdInd += 1\n\t\t\t\tdefault:\n\t\t\t\t\t// Add this to Form's error object?\n\t\t\t\t\t// - I don't think it helps to tell the user this info\n\t\t\t\t\t// unless they're struggling to build the board\n\t\t\t\t\tfmt.Println(\"Unsupported character:\", shipXY)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Test our numbers, update .Valid property of our Form object\n\tform.RequiredNumberOfItems(\"carrier\", 5, cInd)\n\tform.RequiredNumberOfItems(\"battleship\", 4, bInd)\n\tform.RequiredNumberOfItems(\"cruiser\", 3, rInd)\n\tform.RequiredNumberOfItems(\"submarine\", 3, sInd)\n\tform.RequiredNumberOfItems(\"destroyer\", 2, dInd)\n\n\tform.ValidNumberOfItems(carrier, \"carrier\")\n\tform.ValidNumberOfItems(battleship, \"battleship\")\n\tform.ValidNumberOfItems(cruiser, \"cruiser\")\n\tform.ValidNumberOfItems(submarine, \"submarine\")\n\tform.ValidNumberOfItems(destroyer, \"destroyer\")\n\n\t// If our validation has failed anywhere along the way\n\t// - Take the user back to their board\n\tif !form.Valid() {\n\t\t// helper\n\t\tapp.renderBoard(w, r, \"create.board.page.tmpl\", &templateDataBoard{Form: form})\n\t\treturn\n\t}\n\n\t// If we've made it to here, then we have a good set of coordinates for a ship\n\t// - We have a boardID, playerID, shipName, and a bunch of coordinates\n\n\t// Create a new board, return boardID\n\tboardID, _ := app.boards.Create(playerID, form.Get(\"boardName\"))\n\n\t// Carrier\n\t_, err = app.boards.Insert(playerID, boardID, \"carrier\", carrier)\n\tif err != nil {\n\t\tapp.serverError(w, err)\n\t\treturn\n\t}\n\n\t// Battleship\n\t_, err = app.boards.Insert(playerID, boardID, \"battleship\", battleship)\n\tif err != nil {\n\t\tapp.serverError(w, err)\n\t\treturn\n\t}\n\n\t// Cruiser\n\t_, err = app.boards.Insert(playerID, boardID, \"cruiser\", cruiser)\n\tif err != nil {\n\t\tapp.serverError(w, err)\n\t\treturn\n\t}\n\n\t// Submarine\n\t_, err = app.boards.Insert(playerID, boardID, \"submarine\", submarine)\n\tif err != nil {\n\t\tapp.serverError(w, err)\n\t\treturn\n\t}\n\n\t// Destroyer\n\t_, err = app.boards.Insert(playerID, boardID, \"destroyer\", destroyer)\n\tif err != nil {\n\t\tapp.serverError(w, err)\n\t\treturn\n\t}\n\n\t// Add status message to session data; create new if one doesn't exist\n\tapp.session.Put(r, \"flash\", \"Board successfully created!\")\n\t// Send user back to list of boards\n\thttp.Redirect(w, r, \"/board/list\", http.StatusSeeOther)\n}", "func NewLife(w, h int) *Life {\n\ta := NewField(w, h)\n\t// choose random boundary as 0.619 as life.awk\n\tboundary := 0.619\n\tfor i := 0; i < a.w; i++ {\n\t\tfor j := 0; j < a.h; j++ {\n\t\t\ta.Set(i, j, rand.Float64() < boundary)\n\t\t}\n\t}\n\treturn &Life{\n\t\ta: a,\n\t\tb: NewField(w, h),\n\t\tw: w, h: h,\n\t}\n}", "func Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tfmt.Fprint(w, \"Welcome!\\n\")\n}", "func (c *Client) ClanWar(tag string) (war CurrentWar, err error) {\n\tvar b []byte\n\tpath := \"/clans/%23\" + strings.ToUpper(tag) + \"/currentwar\"\n\tif b, err = c.get(path, map[string][]string{}); err == nil {\n\t\terr = json.Unmarshal(b, &war)\n\t}\n\treturn\n}", "func createIceCream(w http.ResponseWriter, r *http.Request) {\r\n\tw.Header().Set(\"Content-Type\", \"application/json\")\r\n\tvar IceCream IceCream\r\n\t_ = json.NewDecoder(r.Body).Decode(&IceCream)\r\n\tIceCream.FlavourId = genNextId()\r\n\tflavours = append(flavours, IceCream)\r\n\tjson.NewEncoder(w).Encode(IceCream)\r\n}", "func New() {\n\ttypeOfProject()\n}" ]
[ "0.63012815", "0.6095818", "0.6035038", "0.57367706", "0.5401127", "0.5373335", "0.53593504", "0.5359165", "0.53430766", "0.5266468", "0.5165891", "0.5091316", "0.5086812", "0.5075339", "0.5065485", "0.5056614", "0.50516707", "0.50405157", "0.50387293", "0.5027701", "0.5026452", "0.50095874", "0.50076663", "0.5003414", "0.5002449", "0.4951717", "0.4941419", "0.49342835", "0.49127913", "0.49066472", "0.49042675", "0.48940054", "0.48722026", "0.4869868", "0.48540223", "0.48318344", "0.48290372", "0.48219573", "0.48207065", "0.48192993", "0.48189056", "0.48044366", "0.48044366", "0.48001587", "0.47922173", "0.47911018", "0.47749028", "0.47746268", "0.47527862", "0.47479832", "0.4746739", "0.47450224", "0.47435954", "0.4730639", "0.47226387", "0.47206506", "0.4715225", "0.47030997", "0.47002557", "0.4695669", "0.4693703", "0.46906847", "0.46885228", "0.46767715", "0.4676189", "0.46737328", "0.4672926", "0.46611145", "0.4660093", "0.46517426", "0.46492377", "0.4649211", "0.46464846", "0.4639458", "0.46384427", "0.46357584", "0.46264365", "0.46260536", "0.46245608", "0.4622086", "0.46215636", "0.45970324", "0.4591735", "0.45857188", "0.458398", "0.45837477", "0.45805496", "0.45748353", "0.4574259", "0.45733583", "0.4566901", "0.45635688", "0.4557349", "0.45550913", "0.4537385", "0.45361787", "0.45360982", "0.45343405", "0.45342785", "0.45337138" ]
0.70646715
0
NewDialog is a helper to spawn a new bit of game dialog
NewDialog — это вспомогательный класс для создания нового фрагмента игрового диалога
func NewDialog(text string, fontSize float32) { rl.DrawRectangleRec( rl.NewRectangle(0, 0, float32(rl.GetScreenWidth()), float32(rl.GetScreenHeight()/5)), rl.Black, ) rl.DrawRectangleLinesEx( rl.NewRectangle(0, 0, float32(rl.GetScreenWidth()), float32(rl.GetScreenHeight()/5)), 4, rl.White, ) rl.DrawTextRecEx( rl.GetFontDefault(), text, rl.NewRectangle(20, 20, float32(rl.GetScreenWidth()), float32(rl.GetScreenHeight()/5)), fontSize, 1, true, rl.RayWhite, 0, int32(rl.GetScreenWidth()), rl.White, rl.Black, ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewDialog(text string) *Dialog {\n\treturn &Dialog{\n\t\tStyleName: \"Default\",\n\t\tStart: \"0:00:00.00\", End: \"0:00:05.00\",\n\t\tText: text}\n}", "func NewDialog(input TL) (d *Dialog) {\n\td = new(Dialog)\n\tif dialog, ok := input.(TL_dialog); ok {\n\t\tswitch pt := dialog.Peer.(type) {\n\t\tcase TL_peerChat:\n\t\t\td.Type = DIALOG_TYPE_CHAT\n\t\t\td.PeerID = pt.Chat_id\n\t\tcase TL_peerUser:\n\t\t\td.Type = DIALOG_TYPE_USER\n\t\t\td.PeerID = pt.User_id\n\t\tcase TL_peerChannel:\n\t\t\td.Type = DIALOG_TYPE_CHANNEL\n\t\t\td.PeerID = pt.Channel_id\n\t\tdefault:\n\t\t\treturn nil\n\t\t}\n\t\td.Pts = dialog.Pts\n\t\td.TopMessageID = dialog.Top_message\n\t\td.UnreadCount = dialog.Unread_count\n\n\t\treturn d\n\t}\n\treturn nil\n\n}", "func NewDialog(text string) *writer.Dialog {\n\treturn writer.NewDialog(text)\n}", "func NewDialog() *Dialog {\n\treturn &Dialog{}\n}", "func (d Client) CreateDialog(name string, filename string, data io.Reader) (string, error) {\n\treturn d.createOrUpdateDialog(\"\", name, filename, data)\n}", "func newDialogFromNative(obj unsafe.Pointer) interface{} {\n\td := &Dialog{}\n\td.object = C.to_GtkDialog(obj)\n\n\tif gobject.IsObjectFloating(d) {\n\t\tgobject.RefSink(d)\n\t} else {\n\t\tgobject.Ref(d)\n\t}\n\td.Window = newWindowFromNative(obj).(*Window)\n\tdialogFinalizer(d)\n\n\treturn d\n}", "func (dialog *Dialog) NewSubdialog() *Dialog {\n\treturn &Dialog{\n\t\tdepth: dialog.depth,\n\t\tisSub: true,\n\t}\n}", "func NewModalDialog(idd uintptr, parent win.HWND, dialogConfig *DialogConfig, cb ModalDialogCallBack) int {\n\tif dialogConfig == nil {\n\t\tdialogConfig = &DialogConfig{}\n\t}\n\tdlg := &Dialog{\n\t\titems: make(map[win.HWND]Widget),\n\t\tiddMap: make(map[uintptr]Widget),\n\t\tconfig: dialogConfig,\n\t\tcb: cb,\n\t}\n\tdlg.idd = idd\n\treturn win.DialogBoxParam(hInstance, win.MAKEINTRESOURCE(idd), parent, syscall.NewCallback(dlg.dialogWndProc), 0)\n}", "func Dialog(props *DialogProps, children ...Element) *DialogElem {\n\trProps := &_DialogProps{\n\t\tBasicHTMLElement: newBasicHTMLElement(),\n\t}\n\n\tif props != nil {\n\t\tprops.assign(rProps)\n\t}\n\n\treturn &DialogElem{\n\t\tElement: createElement(\"dialog\", rProps, children...),\n\t}\n}", "func (s *Script) AddDialog(d *Dialog) {\n\tif d.Text != \"\" {\n\t\ts.Dialog = append(s.Dialog, d)\n\t}\n}", "func makeNewGame(name string, playerNames []string) *Game {\n\tvar g = new(Game)\n\tid, err := uuid.GenUUID()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tg.ID = id\n\tg.Name = name\n\tg.Messages.Capacity = 500\n\tg.Phase = Development\n\tGames[g.ID] = g\n\tg.addMessage(fmt.Sprintf(\"Created game %s...\", g.Name))\n\tg.loadLocos()\n\tg.prepareLocos()\n\tg.initPlayers(playerNames)\n\tg.determineTurnOrder()\n\n\treturn g\n}", "func newMessageDialogFromNative(obj unsafe.Pointer) interface{} {\n\td := &MessageDialog{}\n\td.object = C.to_GtkMessageDialog(obj)\n\n\tif gobject.IsObjectFloating(d) {\n\t\tgobject.RefSink(d)\n\t} else {\n\t\tgobject.Ref(d)\n\t}\n\td.Dialog = newDialogFromNative(obj).(*Dialog)\n\tmessageDialogFinalizer(d)\n\treturn d\n}", "func newGameHandle(w http.ResponseWriter, r *http.Request) {\n\t// Use non-blocking send\n\tselect {\n\tcase model.NewGameCh <- 1:\n\tdefault:\n\t}\n}", "func (d *driver) newGame() func() {\n\tg := game{d}\n\tg.player.Start(g.sender)\n\treturn g.forward\n}", "func WindowNew(t WindowType) *Window {\n\tid := Candy().Guify(\"gtk_window_new\", t).String()\n\treturn NewWindow(Candy(), id)\n}", "func (fx *Script) Add(dialog interface{}) {\n\n\tswitch dlg := dialog.(type) {\n\tcase Line:\n\t\td := NewDialog(dlg.Text)\n\t\td.Layer = dlg.Layer\n\t\td.Start = asstime.MStoSSA(dlg.StartTime + fx.Shift)\n\t\td.End = asstime.MStoSSA(dlg.EndTime + fx.Shift)\n\t\td.StyleName = dlg.StyleName\n\t\td.Actor = dlg.Actor\n\t\td.Effect = dlg.Effect\n\t\td.Tags = dlg.Tags\n\t\td.Comment = dlg.Comment\n\t\tfx.scriptOut.AddDialog(d)\n\tcase Syl:\n\t\td := NewDialog(dlg.Text)\n\t\td.Layer = dlg.Layer\n\t\td.Start = asstime.MStoSSA(dlg.StartTime + fx.Shift)\n\t\td.End = asstime.MStoSSA(dlg.EndTime + fx.Shift)\n\t\td.StyleName = dlg.StyleName\n\t\td.Actor = dlg.Actor\n\t\td.Effect = dlg.Effect\n\t\td.Tags = dlg.Tags\n\t\td.Comment = dlg.Comment\n\t\tfx.scriptOut.AddDialog(d)\n\tcase Char:\n\t\td := NewDialog(dlg.Text)\n\t\td.Layer = dlg.Layer\n\t\td.Start = asstime.MStoSSA(dlg.StartTime + fx.Shift)\n\t\td.End = asstime.MStoSSA(dlg.EndTime + fx.Shift)\n\t\td.StyleName = dlg.StyleName\n\t\td.Actor = dlg.Actor\n\t\td.Effect = dlg.Effect\n\t\td.Tags = dlg.Tags\n\t\td.Comment = dlg.Comment\n\t\tfx.scriptOut.AddDialog(d)\n\tdefault:\n\t\tfmt.Println(\"Not admitted object\")\n\t}\n\n}", "func DialogBox(\n\thInstance HINSTANCE,\n\tTemplateName string,\n\thWndParent HWND,\n\tlpDialogFunc DLGPROC,\n) INT_PTR {\n\tvar ret, _, _ = userDialogBoxParamW.Call(\n\t\tuintptr(hInstance),\n\t\tUintptrFromString(&TemplateName),\n\t\tuintptr(hWndParent),\n\t\tuintptr(lpDialogFunc),\n\t\t0,\n\t)\n\treturn INT_PTR(ret)\n}", "func newGame() *guessingGame {\n\treturn &guessingGame{\n\t\tnum: rand.Intn(10) + 1,\n\t}\n}", "func (c Client) newGameRequest() {\n\terr := c.Encoder.Encode(messages.PlayerReq{Action: game.NewGame})\n\tif err != nil {\n\t\tfmt.Fprintf(c.Output, \"unexpected error: %v \\n\", err)\n\t}\n\n\tvar resp messages.GameStateResp\n\terr = c.decodeResponse(&resp)\n\tif err != nil {\n\t\tfmt.Fprintf(c.Output, \"unexpected error: %s \\n\", err)\n\t}\n\n\tif resp.Error != nil {\n\t\tfmt.Fprintln(c.Output, resp.Error)\n\t} else {\n\t\tfmt.Fprintf(c.Output, \"Guess the hero: %s \\n\", resp.State.WordToGuess)\n\t\tfmt.Fprintln(c.Output, drawing.Display[len(resp.State.CharsTried)])\n\t\tfmt.Fprintf(c.Output, \"Characters tried: %s \\n\", strings.Join(resp.State.CharsTried, \" - \"))\n\t}\n}", "func (game *Game) StartNewGame() {\n\tgame.field = startField\n\tgame.finished = false\n\tgame.turn = \"x\"\n\tgame.winRow = zeroRow\n\tgame.winner = \"\"\n}", "func NewDialogData(\n\tdynamo *awsutils.DynamoRequest,\n\tenvironmentName,\n\torganization,\n\tdialogRepo ,\n\tdialogFolder ,\n\tdialogCatalog ,\n\tdialogTable ,\n\taliasFolder ,\n\tlearnMoreRepo ,\n\tlearnMoreFolder ,\n\tbuildBranch ,\n\tcultivationBranch ,\n\tmasterBranch string,\n) (rv DialogData) {\n\tif dynamo == nil ||\n\t\tenvironmentName == \"\" ||\n\t\torganization == \"\" ||\n\t\tdialogRepo == \"\" ||\n\t\tdialogFolder == \"\" ||\n\t\tdialogCatalog == \"\" ||\n\t\tdialogTable == \"\" ||\n\t\taliasFolder == \"\" ||\n\t\tlearnMoreRepo == \"\" ||\n\t\tlearnMoreFolder == \"\" ||\n\t\tbuildBranch == \"\" ||\n\t\tcultivationBranch == \"\" ||\n\t\tmasterBranch == \"\"\t{\n\t\tpanic(\"cannot have empty initialization values\")\n\t}\n\n\trv.EnvironmentName = environmentName\n\trv.Organization = organization\n\trv.DialogRepo = dialogRepo\n\trv.DialogFolder = dialogFolder\n\trv.DialogCatalog = dialogCatalog\n\trv.DialogTable = environmentName+dialogTable\n\trv.AliasFolder = aliasFolder\n\trv.LearnMoreRepo = learnMoreRepo\n\trv.LearnMoreFolder = learnMoreFolder\n\trv.BuildBranch = buildBranch\n\trv.CultivationBranch = cultivationBranch\n\trv.MasterBranch = masterBranch\n\trv.Modified = false\n\trv.BuildID = core_utils_go.Uuid()\n\trv.dialogIDs = make(map[string]bool)\n\trv.dynamo = dynamo\n\treturn rv\n}", "func newGame() *game {\n\trand.Seed(time.Now().UTC().UnixNano())\n\tg := &game{}\n\tg.State = \"lobby\"\n\tg.StateTime = time.Now()\n\tg.Name = \"MafiosoGame\"\n\tg.Winner = \"\"\n\tg.Players = make([]*player, 0)\n\tif g.Id != \"\" {\n\t\tgameList[g.Id] = g\n\t}\n\treturn g\n}", "func handleNewCommand() {\n\tneoCliRoot := os.Getenv(\"GOPATH\") + \"/src/github.com/ivpusic/neo/cmd/neo\"\n\n\tif len(*templateName) == 0 {\n\t\tlogger.Info(\"Creating Neo project\")\n\t\trunCmd(neoCliRoot+\"/scripts/neo-template\", []string{*projectName})\n\n\t} else {\n\t\tswitch *templateName {\n\t\tcase \"angular\":\n\t\t\tlogger.Info(\"Creating Neo Angular project\")\n\t\t\trunCmd(neoCliRoot+\"/scripts/angular-template\", []string{*projectName})\n\t\tcase \"html\":\n\t\t\tlogger.Info(\"Creating Neo HTML project\")\n\t\t\trunCmd(neoCliRoot+\"/scripts/neo-html-template\", []string{*projectName})\n\t\tdefault:\n\t\t\tlogger.Errorf(\"Unkonown template %s!\", *projectName)\n\t\t}\n\t}\n}", "func (d MessagesDialogs) construct() MessagesDialogsClass { return &d }", "func (me TxsdShow) IsNew() bool { return me == \"new\" }", "func (t *tbfe) MessageDialog(msg string) {\n\tlog4go.Info(msg)\n}", "func (t *tbfe) MessageDialog(msg string) {\n\tlog4go.Info(msg)\n}", "func (d MessagesDialogsNotModified) construct() MessagesDialogsClass { return &d }", "func (d *Dialog) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"Dialog(\")\n\tbuilder.WriteString(fmt.Sprintf(\"id=%v\", d.ID))\n\tbuilder.WriteString(\", create_time=\")\n\tbuilder.WriteString(d.CreateTime.Format(time.ANSIC))\n\tbuilder.WriteString(\", update_time=\")\n\tbuilder.WriteString(d.UpdateTime.Format(time.ANSIC))\n\tbuilder.WriteString(\", meta=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", d.Meta))\n\tbuilder.WriteByte(')')\n\treturn builder.String()\n}", "func newGame(width, height int) *Game {\n\treturn &Game{\n\t\tw: width,\n\t\th: height,\n\t}\n}", "func (d DialogPeer) construct() DialogPeerClass { return &d }", "func (o *EditorPlugin) GetScriptCreateDialog() ScriptCreateDialogImplementer {\n\t//log.Println(\"Calling EditorPlugin.GetScriptCreateDialog()\")\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(\"EditorPlugin\", \"get_script_create_dialog\")\n\n\t// Call the parent method.\n\t// ScriptCreateDialog\n\tretPtr := gdnative.NewEmptyObject()\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 := newScriptCreateDialogFromPointer(retPtr)\n\n\t// Check to see if we already have an instance of this object in our Go instance registry.\n\tif instance, ok := InstanceRegistry.Get(ret.GetBaseObject().ID()); ok {\n\t\treturn instance.(ScriptCreateDialogImplementer)\n\t}\n\n\t// Check to see what kind of class this is and create it. This is generally used with\n\t// GetNode().\n\tclassName := ret.GetClass()\n\tif className != \"ScriptCreateDialog\" {\n\t\tactualRet := getActualClass(className, ret.GetBaseObject())\n\t\treturn actualRet.(ScriptCreateDialogImplementer)\n\t}\n\n\treturn &ret\n}", "func newGLWindow(opts *oswin.NewWindowOptions) (*glfw.Window, error) {\n\t_, _, tool, fullscreen := oswin.WindowFlagsToBool(opts.Flags)\n\tglfw.DefaultWindowHints()\n\tglfw.WindowHint(glfw.Resizable, glfw.True)\n\tglfw.WindowHint(glfw.Visible, glfw.True) // needed to position\n\tglfw.WindowHint(glfw.Focused, glfw.True)\n\tglfw.WindowHint(glfw.ContextVersionMajor, 4) // 4.1 is max supported on macos\n\tglfw.WindowHint(glfw.ContextVersionMinor, 1)\n\tglfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)\n\tglfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True)\n\tglfw.WindowHint(glfw.Samples, 0) // don't do multisampling for main window -- only in sub-render\n\tif glosDebug {\n\t\tglfw.WindowHint(glfw.OpenGLDebugContext, glfw.True)\n\t}\n\n\t// todo: glfw.Samples -- multisampling\n\tif fullscreen {\n\t\tglfw.WindowHint(glfw.Maximized, glfw.True)\n\t}\n\tif tool {\n\t\tglfw.WindowHint(glfw.Decorated, glfw.False)\n\t} else {\n\t\tglfw.WindowHint(glfw.Decorated, glfw.True)\n\t}\n\t// todo: glfw.Floating for always-on-top -- could set for modal\n\twin, err := glfw.CreateWindow(opts.Size.X, opts.Size.Y, opts.GetTitle(), nil, nil)\n\tif err != nil {\n\t\treturn win, err\n\t}\n\twin.SetPos(opts.Pos.X, opts.Pos.Y)\n\treturn win, err\n}", "func newGame(renderer *sdl.Renderer) (*Game, error) {\n\tground, err := ground.NewGrounds(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttrex, err := trex.NewTrex(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcactus, err := cactus.NewCactus(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclouds, err := clouds.NewClouds(renderer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Game{\n\t\trenderer: renderer,\n\t\tground: ground,\n\t\ttrex: trex,\n\t\tcactus: cactus,\n\t\tclouds: clouds,\n\t}, nil\n}", "func InputDialog(opt ...interface{}) string {\n b, _ := gtk.BuilderNewFromFile(\"glade/input-dialog.glade\")\n d := GetDialog(b, \"input_dialog\")\n entry := GetEntry(b, \"input_entry\")\n\n for i, v := range(opt) {\n if i % 2 == 0 {\n key := v.(string)\n switch key {\n case \"title\":\n d.SetTitle(opt[i+1].(string))\n case \"label\":\n l := GetLabel(b,\"input_label\")\n l.SetText(opt[i+1].(string))\n case \"password-mask\":\n entry.SetInvisibleChar(opt[i+1].(rune))\n entry.SetVisibility(false)\n case \"default\":\n entry.SetText(opt[i+1].(string))\n }\n }\n }\n\n output := \"\"\n entry.Connect(\"activate\", func (o *gtk.Entry) { d.Response(gtk.RESPONSE_OK) } )\n btok := GetButton(b, \"bt_ok\")\n btok.Connect(\"clicked\", func (b *gtk.Button) { d.Response(gtk.RESPONSE_OK) } )\n\n btcancel := GetButton(b, \"bt_cancel\")\n btcancel.Connect(\"clicked\", func (b *gtk.Button) { d.Response(gtk.RESPONSE_CANCEL) } )\n\n code := d.Run()\n if code == gtk.RESPONSE_OK {\n output, _ = entry.GetText()\n }\n\n d.Destroy()\n return output\n}", "func createBookListDialog(controls *ControlList, conf *cf.Config) {\n\tcontrols.bookListWindow = ui.AddWindow(0, 0, 12, 7, \"Book list\")\n\tcontrols.bookListWindow.SetPack(ui.Vertical)\n\tcontrols.bookListWindow.SetModal(true)\n\n\tcontrols.bookTable = ui.CreateTableView(controls.bookListWindow, minWidth, minHeight, 1)\n\tcontrols.bookInfoDetail = ui.CreateLabel(controls.bookListWindow, 1, 1, \"\", ui.Fixed)\n\tui.ActivateControl(controls.bookListWindow, controls.bookTable)\n\tcontrols.bookTable.SetShowLines(true)\n\tcontrols.bookTable.SetShowRowNumber(true)\n\tcontrols.bookListWindow.SetMaximized(true)\n\n\tcontrols.bookTable.SetRowCount(len(conf.DbDriver.FilteredBooks()))\n\tcontrols.bookListWindow.SetTitle(fmt.Sprintf(\"Book list [%s]\", conf.DbDriver.Filter()))\n\n\tcols := []ui.Column{\n\t\tui.Column{Title: \"Author\", Width: 16, Alignment: ui.AlignLeft},\n\t\tui.Column{Title: \"Title\", Width: 25, Alignment: ui.AlignLeft},\n\t\tui.Column{Title: \"Done\", Width: 4, Alignment: ui.AlignRight},\n\t\tui.Column{Title: \"Sequence\", Width: 8, Alignment: ui.AlignLeft},\n\t\tui.Column{Title: \"Genre\", Width: 8, Alignment: ui.AlignLeft},\n\t\tui.Column{Title: \"Added\", Width: 20, Alignment: ui.AlignLeft},\n\t\tui.Column{Title: \"Completed\", Width: 20, Alignment: ui.AlignLeft},\n\t\tui.Column{Title: \"FilePath\", Width: 100, Alignment: ui.AlignLeft},\n\t}\n\tcontrols.bookTable.SetColumns(cols)\n\n\t// override OnKeyDown to support incremental search and\n\t// opening selected book by pressing Enter\n\t// Escape closes the dialog without doing anything\n\tcontrols.bookListWindow.OnKeyDown(func(ev ui.Event, data interface {}) bool {\n\t\tif ev.Ch != 0 {\n\t\t\tfilter := conf.DbDriver.Filter() + string(ev.Ch)\n\t\t\tconf.DbDriver.SetFilter(filter)\n\n\t\t\tcontrols.bookTable.SetRowCount(len(conf.DbDriver.FilteredBooks()))\n\t\t\tcontrols.bookListWindow.SetTitle(fmt.Sprintf(\"Book list [%s]\", filter))\n\t\t\treturn true\n\t\t}\n\n\t\tswitch ev.Key {\n\t\tcase term.KeyBackspace:\n\t\t\tfilter := conf.DbDriver.Filter()\n\t\t\tif filter != \"\" {\n\t\t\t\tfilter = xs.Slice(filter, 0, xs.Len(filter)-1)\n\t\t\t\tconf.DbDriver.SetFilter(filter)\n\n\t\t\t\tcontrols.bookTable.SetRowCount(len(conf.DbDriver.FilteredBooks()))\n\t\t\t\tcontrols.bookListWindow.SetTitle(fmt.Sprintf(\"Book list [%s]\", filter))\n\t\t\t}\n\t\t\treturn true\n\t\tcase term.KeyEsc:\n\t\t\tgo ui.PutEvent(ui.Event{Type: ui.EventCloseWindow})\n\t\t\treturn true\n\t\tcase term.KeyEnter:\n\t\t\trow := controls.bookTable.SelectedRow()\n\t\t\tif row != -1 {\n\t\t\t\tbook := conf.DbDriver.FilteredBooks()[row]\n\t\t\t\tif book.FilePath != conf.LastFile {\n\t\t\t\t\tcloseBook(conf)\n\t\t\t\t\tloadBook(controls, conf)\n\t\t\t\t}\n\t\t\t}\n\t\t\tgo ui.PutEvent(ui.Event{Type: ui.EventCloseWindow})\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}, nil)\n\n\t// without overriding this function TableView shows empty values\n\tcontrols.bookTable.OnDrawCell(func(info *ui.ColumnDrawInfo) {\n\t\tfiltered := conf.DbDriver.FilteredBooks()\n\t\tif info.Row >= len(filtered) {\n\t\t\treturn\n\t\t}\n\t\tbook := filtered[info.Row]\n\t\tinfo.Text = getBookColumnText(book, info.Col)\n\t})\n\n\t// override onSelect to display full cell text in a 'statusbar' - the\n\t// widget at the bottom of the dialog\n\tcontrols.bookTable.OnSelectCell(func(col, row int) {\n\t\tif col == -1 || row == -1 {\n\t\t\treturn\n\t\t}\n\t\tfiltered := conf.DbDriver.FilteredBooks()\n\t\tbook := filtered[row]\n\t\tcontrols.bookInfoDetail.SetTitle(getBookColumnText(book, col))\n\t})\n\n\t// override it to do custom sorting and delete a book from library\n\tcontrols.bookTable.OnAction(func(ev ui.TableEvent) {\n\t\tfiltered := conf.DbDriver.FilteredBooks()\n\t\tif ev.Action == ui.TableActionDelete {\n\t\t\tif ev.Row == -1 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbook := filtered[ev.Row]\n\t\t\tcontrols.bookListWindow.SetModal(false)\n\t\t\tcontrols.askLabel.SetTitle(fmt.Sprintf(\"Information about book <c:bright green>'%s'<c:> will be removed from the library. Continue?\", book.Title))\n\t\t\tcontrols.askWindow.SetModal(true)\n\t\t\tcontrols.askWindow.SetVisible(true)\n\t\t\tui.ActivateControl(controls.askWindow, controls.askCancel)\n\n\t\t\tcontrols.askRemove.OnClick(func(evBtn ui.Event) {\n\t\t\t\tconf.DbDriver.DeleteBookByIndex(ev.Row)\n\t\t\t\tcontrols.bookTable.SetRowCount(controls.bookTable.RowCount() - 1)\n\n\t\t\t\tcontrols.askWindow.SetModal(false)\n\t\t\t\tcontrols.askWindow.SetVisible(false)\n\t\t\t\tui.ActivateControl(controls.bookListWindow, controls.bookTable)\n\t\t\t})\n\n\t\t\treturn\n\t\t}\n\n\t\tif ev.Action != ui.TableActionSort {\n\t\t\treturn\n\t\t}\n\n\t\tif ev.Col == -1 {\n\t\t\treturn\n\t\t}\n\t\tfields := []string{\n\t\t\tcommon.FIELD_AUTHOR,\n\t\t\tcommon.FIELD_TITLE,\n\t\t\tcommon.FIELD_PERCENT,\n\t\t\t\"\",\n\t\t\tcommon.FIELD_GENRE,\n\t\t\tcommon.FIELD_ADDED,\n\t\t\tcommon.FIELD_COMPLETED,\n\t\t}\n\n\t\tif ev.Sort == ui.SortNone || ev.Col >= len(fields) {\n\t\t\tconf.DbDriver.SetSortMode(common.FIELD_AUTHOR, true)\n\t\t\treturn\n\t\t}\n\n\t\tfield := fields[ev.Col]\n\t\tif field == \"\" {\n\t\t\tconf.DbDriver.SetSortMode(common.FIELD_AUTHOR, ev.Sort == ui.SortAsc)\n\t\t} else {\n\t\t\tconf.DbDriver.SetSortMode(field, ev.Sort == ui.SortAsc)\n\t\t}\n\t})\n}", "func newGLWindow(opts *oswin.NewWindowOptions, sc *oswin.Screen) (*glfw.Window, error) {\n\t_, _, tool, fullscreen := oswin.WindowFlagsToBool(opts.Flags)\n\tglfw.DefaultWindowHints()\n\tglfw.WindowHint(glfw.Resizable, glfw.True)\n\tglfw.WindowHint(glfw.Visible, glfw.False) // needed to position\n\tglfw.WindowHint(glfw.Focused, glfw.True)\n\t// glfw.WindowHint(glfw.ScaleToMonitor, glfw.True)\n\tglfw.WindowHint(glfw.ContextVersionMajor, glosGlMajor)\n\tglfw.WindowHint(glfw.ContextVersionMinor, glosGlMinor)\n\tglfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)\n\tglfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True)\n\tglfw.WindowHint(glfw.Samples, 0) // don't do multisampling for main window -- only in sub-render\n\tif glosDebug {\n\t\tglfw.WindowHint(glfw.OpenGLDebugContext, glfw.True)\n\t}\n\n\t// todo: glfw.Samples -- multisampling\n\tif fullscreen {\n\t\tglfw.WindowHint(glfw.Maximized, glfw.True)\n\t}\n\tif tool {\n\t\tglfw.WindowHint(glfw.Decorated, glfw.False)\n\t} else {\n\t\tglfw.WindowHint(glfw.Decorated, glfw.True)\n\t}\n\t// todo: glfw.Floating for always-on-top -- could set for modal\n\tsz := opts.Size // note: this is already in standard window size units!\n\twin, err := glfw.CreateWindow(sz.X, sz.Y, opts.GetTitle(), nil, theApp.shareWin)\n\tif err != nil {\n\t\treturn win, err\n\t}\n\twin.SetPos(opts.Pos.X, opts.Pos.Y)\n\treturn win, err\n}", "func (me TxsdShow) IsNew() bool { return me.String() == \"new\" }", "func newWindow(width, height int) (wdeWindow wde.Window, err error) {\n\tw := &sdlWindow{}\n\twdeWindow = w\n\tsdlWrap.Size <- &geom.Coord{float64(width), float64(height)}\n\tw.Surface = <-sdlWrap.Surface\n\tw.events = make(chan interface{}, 16)\n\tgo w.poolSdl()\n\n\tif w.Surface == nil {\n\t\terr = sdlError(sdl.GetError())\n\t\treturn\n\t}\n\n\treturn\n}", "func FrameNew(label string) *Frame {\n\tid := Candy().Guify(\"gtk_frame_new\", label).String()\n\treturn NewFrame(Candy(), id)\n}", "func (b *App) NewWindow(url, title string) error {\n\tlog.Println(\"=== gallium.NewWindow ===\")\n\tcerr := newCerr()\n\tdefer cerr.free()\n\tC.GalliumCreateWindow(C.CString(url), C.CString(title), &cerr.c)\n\treturn nil\n}", "func createComponentWindow(sX, sY, sW, sH float32) *gui.Window {\n\t// create a window for operating on the component file\n\tcomponentWindow := uiman.NewWindow(\"Component\", sX, sY, sW, sH, func(wnd *gui.Window) {\n\t\tloadComponent, _ := wnd.Button(\"componentFileLoadButton\", \"Load\")\n\t\tsaveComponent, _ := wnd.Button(\"componentFileSaveButton\", \"Save\")\n\t\twnd.Editbox(\"componentFileEditbox\", &flagComponentFile)\n\t\tif saveComponent {\n\t\t\terr := doSaveComponent(&theComponent, flagComponentFile)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"Failed to save the component.\\n%v\\n\", err)\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"Saved the component file: %s\\n\", flagComponentFile)\n\t\t\t}\n\t\t}\n\n\t\tif loadComponent {\n\t\t\t// remove all existing mesh windows\n\t\t\tcloseAllMeshWindows()\n\t\t\t// load the component file again and create mesh windows / renderables\n\t\t\tdoLoadComponentFile(flagComponentFile)\n\t\t}\n\n\t\twnd.Separator()\n\t\twnd.RequestItemWidthMin(textWidth)\n\t\twnd.Text(\"Name\")\n\t\twnd.Editbox(\"componentNameEditbox\", &theComponent.Name)\n\n\t\t// do the user interface for mesh windows\n\t\twnd.Separator()\n\t\twnd.RequestItemWidthMin(textWidth)\n\t\twnd.Text(\"Meshes:\")\n\t\taddMesh, _ := wnd.Button(\"componentFileAddMeshButton\", \"Add Mesh\")\n\t\tif addMesh {\n\t\t\tdoAddMesh()\n\t\t}\n\n\t\tmeshesThatSurvive := theComponent.Meshes[:0]\n\t\tfor compMeshIndex, compMesh := range theComponent.Meshes {\n\t\t\twnd.StartRow()\n\t\t\twnd.RequestItemWidthMin(textWidth)\n\t\t\twnd.Text(fmt.Sprintf(\"%s\", compMesh.Name))\n\t\t\tshowMeshWnd, _ := wnd.Button(fmt.Sprintf(\"buttonShowMesh%d\", compMeshIndex), \"Show\")\n\t\t\thideMeshWnd, _ := wnd.Button(fmt.Sprintf(\"buttonHideMesh%d\", compMeshIndex), \"Hide\")\n\t\t\tdeleteMesh, _ := wnd.Button(fmt.Sprintf(\"buttonDeleteMesh%d\", compMeshIndex), \"Delete\")\n\t\t\tif showMeshWnd {\n\t\t\t\tdoShowMeshWindow(compMesh)\n\t\t\t}\n\t\t\tif hideMeshWnd || deleteMesh {\n\t\t\t\tdoHideMeshWindow(compMesh)\n\t\t\t}\n\t\t\tif !deleteMesh {\n\t\t\t\tmeshesThatSurvive = append(meshesThatSurvive, compMesh)\n\t\t\t} else {\n\t\t\t\tdoDeleteMesh(compMesh.Name)\n\t\t\t}\n\n\t\t}\n\t\t// FIXME: not Destroying renderables for meshes that don't survive\n\t\ttheComponent.Meshes = meshesThatSurvive\n\n\t\t// do the user interface for colliders\n\t\twnd.Separator()\n\t\twnd.RequestItemWidthMin(textWidth)\n\t\twnd.Text(\"Colliders: \")\n\t\taddNewCollider, _ := wnd.Button(\"buttonAddCollider\", \"Add Collider\")\n\t\tif addNewCollider {\n\t\t\tdoAddCollider(&theComponent)\n\t\t}\n\n\t\tcollidersThatSurvive := theComponent.Collisions[:0]\n\t\tvisibleCollidersThatSurvive := visibleColliders[:0]\n\t\tfor colliderIndex, collider := range theComponent.Collisions {\n\t\t\twnd.StartRow()\n\t\t\twnd.RequestItemWidthMin(textWidth)\n\t\t\twnd.Text(fmt.Sprintf(\"Collider %d:\", colliderIndex))\n\n\t\t\tdelCollider, _ := wnd.Button(fmt.Sprintf(\"buttonDeleteCollider%d\", colliderIndex), \"X\")\n\t\t\tprevColliderType, _ := wnd.Button(fmt.Sprintf(\"buttonPrevColliderType%d\", colliderIndex), \"<\")\n\t\t\tnextColliderType, _ := wnd.Button(fmt.Sprintf(\"buttonNextColliderType%d\", colliderIndex), \">\")\n\n\t\t\tif !delCollider {\n\t\t\t\tcollidersThatSurvive = append(collidersThatSurvive, collider)\n\n\t\t\t\tif prevColliderType {\n\t\t\t\t\tdoPrevColliderType(collider)\n\t\t\t\t}\n\t\t\t\tif nextColliderType {\n\t\t\t\t\tdoNextColliderType(collider)\n\t\t\t\t}\n\n\t\t\t\tswitch collider.Type {\n\t\t\t\tcase component.ColliderTypeAABB:\n\t\t\t\t\twnd.Text(\"Axis Aligned Bounding Box\")\n\t\t\t\t\twnd.StartRow()\n\t\t\t\t\twnd.Space(textWidth)\n\t\t\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\t\t\twnd.Text(\"Min\")\n\t\t\t\t\tguiAddDragSliderVec3(wnd, width4Col, \"ColliderMin\", colliderIndex, 0.01, &collider.Min)\n\n\t\t\t\t\twnd.StartRow()\n\t\t\t\t\twnd.Space(textWidth)\n\t\t\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\t\t\twnd.Text(\"Max\")\n\t\t\t\t\tguiAddDragSliderVec3(wnd, width4Col, \"ColliderMax\", colliderIndex, 0.01, &collider.Max)\n\n\t\t\t\tcase component.ColliderTypeSphere:\n\t\t\t\t\twnd.Text(\"Sphere\")\n\t\t\t\t\twnd.StartRow()\n\t\t\t\t\twnd.Space(textWidth)\n\t\t\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\t\t\twnd.Text(\"Offset\")\n\t\t\t\t\tguiAddDragSliderVec3(wnd, width4Col, \"ColliderOffset\", colliderIndex, 0.01, &collider.Offset)\n\n\t\t\t\t\twnd.StartRow()\n\t\t\t\t\twnd.Space(textWidth)\n\t\t\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\t\t\twnd.Text(\"Radius\")\n\t\t\t\t\twnd.DragSliderFloat(fmt.Sprintf(\"ColliderRadius%d\", colliderIndex), 0.01, &collider.Radius)\n\t\t\t\tdefault:\n\t\t\t\t\twnd.Text(fmt.Sprintf(\"Unknown collider (%d)!\", collider.Type))\n\t\t\t\t}\n\n\t\t\t\t// see if we need to update the renderable if it exists already\n\t\t\t\tvisibleColliders = doUpdateVisibleCollider(visibleColliders, collider, colliderIndex)\n\t\t\t\tvisibleCollidersThatSurvive = append(visibleCollidersThatSurvive, visibleColliders[colliderIndex])\n\t\t\t}\n\t\t}\n\t\ttheComponent.Collisions = collidersThatSurvive\n\t\tvisibleColliders = visibleCollidersThatSurvive\n\n\t\twnd.Separator()\n\t\twnd.RequestItemWidthMin(textWidth)\n\t\twnd.Text(\"Child Components:\")\n\t\taddChildComponent, _ := wnd.Button(\"addChildComponent\", \"Add Child\")\n\t\tif addChildComponent {\n\t\t\tdoAddChildReference(&theComponent)\n\t\t}\n\n\t\tchildRefsThatSurvive := theComponent.ChildReferences[:0]\n\t\tfor childRefIndex, childRef := range theComponent.ChildReferences {\n\t\t\twnd.StartRow()\n\t\t\twnd.RequestItemWidthMin(textWidth)\n\t\t\twnd.Text(\"File:\")\n\t\t\tremoveReference, _ := wnd.Button(fmt.Sprintf(\"childRefRemove%d\", childRefIndex), \"X\")\n\t\t\tloadChildReference, _ := wnd.Button(fmt.Sprintf(\"childRefLoad%d\", childRefIndex), \"L\")\n\t\t\twnd.Editbox(fmt.Sprintf(\"childRefFileEditbox%d\", childRefIndex), &childRef.File)\n\n\t\t\twnd.StartRow()\n\t\t\twnd.Space(textWidth)\n\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\twnd.Text(\"Offset\")\n\t\t\tguiAddDragSliderVec3(wnd, width4Col, \"childRefLocation\", childRefIndex, 0.01, &childRef.Location)\n\n\t\t\twnd.StartRow()\n\t\t\twnd.Space(textWidth)\n\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\twnd.Text(\"Scale\")\n\t\t\tguiAddDragSliderVec3(wnd, width4Col, \"childRefScale\", childRefIndex, 0.01, &childRef.Scale)\n\n\t\t\twnd.StartRow()\n\t\t\twnd.Space(textWidth)\n\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\twnd.Text(\"Rot Axis\")\n\t\t\tguiAddDragSliderVec3(wnd, width4Col, \"childRefRotAxis\", childRefIndex, 0.01, &childRef.RotationAxis)\n\n\t\t\twnd.StartRow()\n\t\t\twnd.Space(textWidth)\n\t\t\twnd.RequestItemWidthMin(width4Col)\n\t\t\twnd.Text(\"Rot Deg\")\n\t\t\twnd.DragSliderFloat(fmt.Sprintf(\"childRefRotDeg%d\", childRefIndex), 0.1, &childRef.RotationDegrees)\n\n\t\t\tif !removeReference {\n\t\t\t\tchildRefsThatSurvive = append(childRefsThatSurvive, childRef)\n\t\t\t}\n\t\t\tif loadChildReference {\n\t\t\t\tvar err error\n\t\t\t\tchildComponents, err = doLoadChildComponent(childComponents, childRef)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Failed to load child component.\\n%v\\n\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttheComponent.ChildReferences = childRefsThatSurvive\n\n\t\t// remove any visible child components that no longer have a reference\n\t\tchildComponents = removeStaleChildComponents(childComponents, &theComponent, childRefFilenames)\n\t})\n\treturn componentWindow\n}", "func NewGame() *G {\n\t/* Fill in this Function */\n\treturn &G{}\n}", "func (gui *Gui) createConfirmationPanel(g *gocui.Gui, currentView *gocui.View, title, prompt string, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error {\n\treturn gui.createPopupPanel(g, currentView, title, prompt, handleConfirm, handleClose)\n}", "func newWindow(X *xgbutil.XUtil, color uint32) *xwindow.Window {\n\twin, err := xwindow.Generate(X)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\terr = win.CreateChecked(X.RootWin(), 0, 0, 400, 400,\n\t\txproto.CwBackPixel|xproto.CwEventMask,\n\t\tcolor, xproto.EventMaskPointerMotion)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\twin.Map()\n\treturn win\n}", "func (s *service) NewGame(word string) Game {\n\treturn *NewGame(word)\n}", "func (lob *Lobby) createGame(startingTeam int, round int) {\n\n\tnewGame := Game{\n\t\tGameUid: shortuuid.New(),\n\t\tStartingTeam: startingTeam,\n\t\tCurrentRound: round,\n\t\tTeam1Ready: false,\n\t\tTeam2Ready: false,\n\t\tGameState: created,\n\t\tTeam1UID: lob.Team1UID,\n\t\tTeam2UID: lob.Team2UID,\n\t}\n\n\tlob.Games = append(lob.Games, newGame)\n\n}", "func (s *BasemumpsListener) EnterNew_(ctx *New_Context) {}", "func newCreateCmd() *cobra.Command {\n\tcreateCmd := cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: `Create a new verless object`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Help()\n\t\t},\n\t}\n\n\tcreateCmd.AddCommand(newCreateProjectCmd())\n\tcreateCmd.AddCommand(newCreateThemeCmd())\n\tcreateCmd.AddCommand(newCreateFile())\n\n\treturn &createCmd\n}", "func newButton(eng vu.Engine, parent vu.Part, size int, icon string, action vu.Reaction) *button {\n\tbtn := &button{}\n\tbtn.model = parent.AddPart()\n\tbtn.action = action\n\tbtn.w, btn.h = size, size\n\n\t// create the button icon.\n\tbtn.icon = btn.model.AddPart()\n\tbtn.icon.SetFacade(\"icon\", \"uv\").SetMaterial(\"half\")\n\tbtn.icon.SetTexture(icon, 0)\n\tbtn.icon.SetScale(float64(btn.w/2), float64(btn.h/2), 1)\n\n\t// create a hilite that is only shown on mouse over.\n\tbtn.hilite = btn.model.AddPart()\n\tbtn.hilite.SetFacade(\"square\", \"flat\").SetMaterial(\"tblue\")\n\tbtn.hilite.SetScale(float64(btn.w/2.0), float64(btn.h/2.0), 1)\n\tbtn.hilite.SetVisible(false)\n\treturn btn\n}", "func CreateForm(window *glfw.Window, font Font, screen Screen) Form {\n\treturn Form{window, []Button{}, []Text{}, font, screen, true}\n}", "func CreateMainWindow() {\n\n\tvBox := tui.NewVBox()\n\tvBox.SetSizePolicy(tui.Minimum, tui.Minimum)\n\tSidebar := tui.NewVBox()\n\tSidebar.SetSizePolicy(tui.Minimum, tui.Minimum)\n\n\tfor _, cmd := range strings.Split(libs.Cmds, \",\") {\n\t\tSidebar.Append(tui.NewLabel(wordwrap.WrapString(cmd, 50)))\n\t}\n\n\tSidebar.SetBorder(true)\n\tSidebar.Prepend(tui.NewLabel(\"***COMMANDS***\"))\n\n\tInput.SetFocused(true)\n\tInput.SetSizePolicy(tui.Expanding, tui.Maximum)\n\n\tinputBox := tui.NewHBox(Input)\n\tinputBox.SetBorder(true)\n\tinputBox.SetSizePolicy(tui.Expanding, tui.Maximum)\n\n\thistoryScroll := tui.NewScrollArea(History)\n\thistoryScroll.SetAutoscrollToBottom(true)\n\thistoryBox := tui.NewVBox(historyScroll)\n\thistoryBox.SetBorder(true)\n\n\tchat := tui.NewVBox(historyBox, inputBox)\n\tchat.SetSizePolicy(tui.Expanding, tui.Expanding)\n\n\t// create root window and add all windows\n\troot := tui.NewHBox(Sidebar, chat)\n\tui, err := tui.New(root)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tui.SetKeybinding(\"Esc\", func() { ui.Quit() })\n\n\tInput.OnSubmit(func(e *tui.Entry) {\n\t\t// this is just to see what command given\n\t\tuserCommand := e.Text()\n\t\tif userCommand == \"\" {\n\t\t\tHistory.Append(tui.NewLabel(\"that is not acceptable command\"))\n\t\t\tHistory.Append(tui.NewLabel(libs.PrintHelp()))\n\t\t} else {\n\t\t\tHistory.Append(tui.NewHBox(\n\t\t\t\ttui.NewLabel(\"Your Command: \" + userCommand),\n\t\t\t))\n\t\t\tHistory.Append(tui.NewHBox(tui.NewLabel(\"\")))\n\n\t\t\tif strings.HasPrefix(userCommand, \"\\\\\") {\n\t\t\t\t// then this is command ..\n\t\t\t\tswitch userCommand {\n\t\t\t\tcase \"\\\\help\":\n\t\t\t\t\tHistory.Append(tui.NewLabel(libs.PrintHelp()))\n\t\t\t\tcase \"\\\\monitor\":\n\t\t\t\t\tHistory.Append(tui.NewLabel(\"Switching to MONITOR mode for device \" + DeviceName))\n\t\t\t\t\tChangeToMonitorMode()\n\t\t\t\tcase \"\\\\managed\":\n\t\t\t\t\tHistory.Append(tui.NewLabel(\"Switching to MANAGED mode for device \" + DeviceName))\n\t\t\t\t\tChangeToManagedMode()\n\t\t\t\tcase \"\\\\exit\":\n\t\t\t\t\tHistory.Append(tui.NewHBox(tui.NewLabel(\"quitting...\")))\n\t\t\t\t\ttime.Sleep(1000 * time.Millisecond)\n\t\t\t\t\t// os.Exit(0)\n\n\t\t\t\t}\n\t\t\t} else if strings.Contains(userCommand, \":\") {\n\t\t\t\t// then this is declaration\n\t\t\t\tcmdSplit := strings.Split(userCommand, \":\")\n\t\t\t\tif cmdSplit[1] == \"\" {\n\t\t\t\t\tHistory.Append(tui.NewLabel(\"that is not acceptable command\"))\n\t\t\t\t\tHistory.Append(tui.NewLabel(libs.PrintHelp()))\n\t\t\t\t} else {\n\t\t\t\t\tswitch cmdSplit[0] {\n\t\t\t\t\tcase \"device\":\n\t\t\t\t\t\tSetDeviceName(cmdSplit[1])\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tHistory.Append(tui.NewLabel(\"there is no such declaration or command\"))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tHistory.Append(tui.NewHBox(tui.NewLabel(userCommand + \" is not command or a declaration\")))\n\t\t\t}\n\t\t}\n\t\tInput.SetText(\"\")\n\t})\n\n\tif err := ui.Run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "func DialogButton() page.EventI {\n\te := &page.Event{JsEvent: DialogButtonEvent}\n\te.ActionValue(javascript.JsCode(\"ui\"))\n\treturn e\n}", "func (client *ClientRPC) CreateGame(name string, hostPassword string) bool {\n\t// Tell relay to host game\n\tsuccess := false\n\tdata := GameData{\n\t\tName: name,\n\t\tPassword: hostPassword,\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\terr := client.relay.Call(\"ServerRPCMethods.NewGame\", data, &success)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err == rpc.ErrShutdown {\n\t\t\tif !client.connect() {\n\t\t\t\tlog.Printf(\"ClientRPC: Lost connection to relay and are unable to reconnect\")\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tlog.Printf(\"ClientRPC: Lost connection to relay but was able to reconnect\")\n\t\t} else {\n\t\t\tlog.Printf(\"ClientRPC error: %v\", err)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn success\n}", "func newGUIComputedQuestion(question interfaces.Question, expr interfaces.Expr, varID interfaces.VarID) *GUIComputedQuestion {\n\tguiQuestion := createDisabledGUIQuestion(question)\n\treturn &GUIComputedQuestion{GUIQuestion: guiQuestion, Expr: expr, VarID: varID}\n}", "func (a *MockApp) NewWindow(title string) fyne.Window {\n\targs := a.Called(title)\n\treturn args.Get(0).(fyne.Window)\n}", "func (b *WindowDialogFactory) CreateButton() Button {\n\treturn &WindowButton{}\n}", "func (lob *Lobby) createDefaultGame(startingTeam int) {\n\n\tnewGame := Game{\n\t\tGameUid: shortuuid.New(),\n\t\tStartingTeam: startingTeam,\n\t\tCurrentRound: 1,\n\t\tTeam1Ready: false,\n\t\tTeam2Ready: false,\n\t\tGameState: selectedMap,\n\t\tTeam1UID: lob.Team1UID,\n\t\tTeam2UID: lob.Team2UID,\n\t\tGameMap: nagrand,\n\t}\n\n\tlob.Games = append(lob.Games, newGame)\n\n}", "func newGUIInputQuestion(question interfaces.Question, callback func(interfaces.Expr, error)) *GUIInputQuestion {\n\treturn &GUIInputQuestion{GUIQuestion: createEnabledGUIQuestion(question, callback)}\n}", "func BindNewButton(idd uintptr, dlg *Dialog) (*Button, error) {\n\tb := NewButton(idd)\n\terr := dlg.BindWidgets(b)\n\treturn b, err\n}", "func NewWindow() *Window {\n\tfile := ui.NewFileWithName(\":/widget.ui\")\n\tloader := ui.NewUiLoader()\n\twidget := loader.Load(file)\n\n\t// Init main window\n\twindow := ui.NewMainWindow()\n\twindow.SetCentralWidget(widget)\n\twindow.SetWindowTitle(\"DFSS Demonstrator v\" + dfss.Version)\n\n\tw := &Window{\n\t\tQMainWindow: window,\n\t\tscene: &Scene{},\n\t}\n\tw.InstallEventFilter(w)\n\n\t// Load dynamic elements from driver\n\tw.logField = ui.NewTextEditFromDriver(widget.FindChild(\"logField\"))\n\tw.graphics = ui.NewGraphicsViewFromDriver(widget.FindChild(\"graphicsView\"))\n\tw.progress = ui.NewLabelFromDriver(widget.FindChild(\"progressLabel\"))\n\n\tw.playButton = ui.NewPushButtonFromDriver(widget.FindChild(\"playButton\"))\n\tw.stopButton = ui.NewPushButtonFromDriver(widget.FindChild(\"stopButton\"))\n\tw.replayButton = ui.NewPushButtonFromDriver(widget.FindChild(\"replayButton\"))\n\n\tw.quantumField = ui.NewSpinBoxFromDriver(widget.FindChild(\"quantumField\"))\n\tw.speedSlider = ui.NewSliderFromDriver(widget.FindChild(\"speedSlider\"))\n\n\t// Load pixmaps\n\tw.pixmaps = map[string]*ui.QPixmap{\n\t\t\"ttp\": ui.NewPixmapWithFilenameFormatFlags(\":/images/server_key.png\", \"\", ui.Qt_AutoColor),\n\t\t\"platform\": ui.NewPixmapWithFilenameFormatFlags(\":/images/server_connect.png\", \"\", ui.Qt_AutoColor),\n\t}\n\n\t// Load icons\n\tw.addIcons()\n\n\t// Add actions\n\tw.addActions()\n\tw.initScene()\n\tw.initTimer()\n\n\tw.StatusBar().ShowMessage(\"Ready\")\n\tw.PrintQuantumInformation()\n\treturn w\n}", "func (c Threads) ShowNew() revel.Result {\n return c.Render()\n}", "func DialogInfo(body string) {\n\tif currentWindow == nil {\n\t\treturn\n\t}\n\n\t(*currentWindow).Dispatch(func() {\n\t\t(*currentWindow).Dialog(webview.DialogTypeAlert, webview.DialogFlagInfo,\n\t\t\t\"DTransfer\", body)\n\t})\n}", "func newGame() Game {\n\t//Create a starting board state\n\tboard := [8][8]int{}\n\n\tboard[3][3] = 1\n\tboard[3][4] = -1\n\tboard[4][3] = -1\n\tboard[4][4] = 1\n\n\t//Initialize game stats\n\tw := 2\n\tb := 2\n\toutcome := 0\n\tturn := -1\n\n\t//Create a game struct\n\tgame := Game{board, w, b, outcome, turn, []Cell{}, []Cell{}, []Cell{}}\n\n\t//Fill placed slice\n\tgame.placed = append(game.placed, Cell{3, 3})\n\tgame.placed = append(game.placed, Cell{3, 4})\n\tgame.placed = append(game.placed, Cell{4, 3})\n\tgame.placed = append(game.placed, Cell{4, 4})\n\n\t//Fill other slices\n\tgame.findAdjacents()\n\tgame.findValidMoves()\n\n\treturn game\n}", "func CreatePrompt(db *sql.DB) *Prompt {\n\tp := &Prompt{\n\t\tdb: db,\n\t}\n\treturn p\n}", "func (d DialogPeerFolder) construct() DialogPeerClass { return &d }", "func (t *Table) NewGame() {\n\tfor _, p := range t.players {\n\t\tp.ResetPassedTo()\n\t\tp.ResetPassedFrom()\n\t\tp.ResetTricks()\n\t\tp.ResetScore()\n\t}\n\tt.trick = make([]*card.Card, len(t.players))\n\tt.NewRound()\n\tt.dir = direction.Right\n}", "func CreateGame(options Options) Game {\n\tgame := Game{}\n\tgame.deck = deck.NewDeck()\n\tgame.deck.AddDecks(options.NumberOfDecks - 1)\n\tgame.deck.Shuffle()\n\tfor i := 0; i < options.NumberOfAI; i++ {\n\t\tgame.players = append(game.players, createAIPlayer())\n\t}\n\tfor i := 0; i < options.NumberOfHumans; i++ {\n\t\tgame.players = append(game.players, createHumanPlayer())\n\t}\n\tgame.dealer = createDealer()\n\tgame.numberOfHands = options.NumberOfHands\n\tgame.numberOfDecks = options.NumberOfDecks\n\tgame.blackjackPayout = options.BlackjackPayout\n\treturn game\n}", "func dialogue(conn net.Conn) {\n\tdefer conn.Close()\n\tprocessor := process.Processor{Conn: conn}\n\tprocessor.MainProcess()\n}", "func (g *GameController) NewGame(user *models.User, name string,\n\tmaxPlayers int, password string) (string, error) {\n\tif g.db.GamesDAO.IsPlayerInActiveGame(user.ID) {\n\t\tlog.Debugf(\"User %v (%v) already participating in a game\\n\", user.Username, user.ID.Hex())\n\t\treturn \"\", ErrAlreadyInGame\n\t}\n\tgame, err := g.db.GamesDAO.CreateGame(user, name, maxPlayers, password)\n\tif err != nil {\n\t\treturn \"\", ErrCreateGame\n\t}\n\n\tg.registerActiveGame(game)\n\n\treturn game.ID.Hex(), nil\n}", "func (match *Match) NewGame(shuffle bool) error {\n\tmatch.deck = buildDeck(shuffle)\n\terr := match.deal()\n\tmatch.playerOneLed = match.dealerPlayerOne\n\tmatch.buildMeldSlices()\n\treturn err\n}", "func CreateSingleplayer(g *gocui.Gui) error {\n\ttext, err := game.ChooseText()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstate := game.NewState(text)\n\n\tw, h := g.Size()\n\n\tstatsFrameWi := widgets.NewCollection(\"singleplayer-stats\", \"STATS\", false, 0, 0, w/5, h)\n\n\tstatWis := []*widgets.Text{\n\t\twidgets.NewText(\"singleplayer-stats-wpm\", \"wpm: 0 \", false, false, 2, 1),\n\t\twidgets.NewText(\"singleplayer-stats-time\", \"time: 0s \", false, false, 2, 2),\n\t}\n\n\ttextFrameWi := widgets.NewCollection(\"singleplayer-text\", \"\", false, w/5+1, 0, 4*w/5, 5*h/6+1)\n\n\tpoints := organiseText(state.Words, 4*w/5-2)\n\tvar textWis []*widgets.Text\n\tfor i, p := range points {\n\t\ttextWis = append(textWis, widgets.NewText(\"singleplayer-text-\"+strconv.Itoa(i), state.Words[i], false, false, w/5+1+p.x, p.y))\n\t}\n\n\tvar inputWi *widgets.Input\n\tinputWi = widgets.NewInput(\"singleplayer-input\", true, false, w/5+1, h-h/6, w-w/5-1, h/6, func(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) bool {\n\t\tif key == gocui.KeyEnter || len(v.Buffer()) == 0 && ch == 0 {\n\t\t\treturn false\n\t\t}\n\n\t\tif state.StartTime.IsZero() {\n\t\t\tstate.Start()\n\t\t\tgo func() {\n\t\t\t\tticker := time.NewTicker(100 * time.Millisecond)\n\t\t\t\tfor {\n\t\t\t\t\t<-ticker.C\n\t\t\t\t\tif state.CurrWord == len(state.Words) {\n\t\t\t\t\t\tticker.Stop()\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tg.Update(func(g *gocui.Gui) error {\n\t\t\t\t\t\terr := statWis[1].ChangeText(\n\t\t\t\t\t\t\tfmt.Sprintf(\"time: %.02fs\", time.Since(state.StartTime).Seconds()),\n\t\t\t\t\t\t)(g)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\terr = statWis[0].ChangeText(\n\t\t\t\t\t\t\tfmt.Sprintf(\"wpm: %.0f\", state.Wpm()),\n\t\t\t\t\t\t)(g)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\n\t\tgocui.DefaultEditor.Edit(v, key, ch, mod)\n\n\t\tb := v.Buffer()[:len(v.Buffer())-1]\n\n\t\tif ch != 0 && (len(b) > len(state.Words[state.CurrWord]) || rune(state.Words[state.CurrWord][len(b)-1]) != ch) {\n\t\t\tstate.IncError()\n\t\t}\n\n\t\tansiWord := state.PaintDiff(b)\n\n\t\tg.Update(textWis[state.CurrWord].ChangeText(ansiWord))\n\n\t\tif b == state.Words[state.CurrWord] {\n\t\t\tstate.NextWord()\n\t\t\tif state.CurrWord == len(state.Words) {\n\t\t\t\tstate.End()\n\t\t\t}\n\t\t\tg.Update(inputWi.ChangeText(\"\"))\n\t\t}\n\n\t\treturn false\n\t})\n\n\tvar wis []gocui.Manager\n\twis = append(wis, statsFrameWi)\n\tfor _, stat := range statWis {\n\t\twis = append(wis, stat)\n\t}\n\twis = append(wis, textFrameWi)\n\tfor _, text := range textWis {\n\t\twis = append(wis, text)\n\t}\n\twis = append(wis, inputWi)\n\n\tg.SetManager(wis...)\n\n\tif err := keybindings(g, CreateWelcome); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (s *BasemumpsListener) ExitNew_(ctx *New_Context) {}", "func newCreateProjectCmd() *cobra.Command {\n\tvar (\n\t\toptions core.CreateProjectOptions\n\t)\n\n\tcreateProjectCmd := cobra.Command{\n\t\tUse: \"project NAME\",\n\t\tShort: `Create a new verless project`,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tpath := args[0]\n\t\t\treturn core.CreateProject(path, options)\n\t\t},\n\t}\n\n\tcreateProjectCmd.Flags().BoolVar(&options.Overwrite, \"overwrite\",\n\t\tfalse, `overwrite the directory if it already exists`)\n\n\treturn &createProjectCmd\n}", "func NewForm1(owner vcl.IComponent) (root *TForm1) {\n vcl.CreateResForm(owner, &root)\n return\n}", "func (b *BoardInfo) NewGame() error {\n\tsg := SnakeGame{\n\t\tBoardInfo: *b,\n\t\tCurrentRound: 1,\n\t\tScore: 0,\n\t\tGameOver: false,\n\t}\n\n\t// Set food position\n\tsg.SetFood(sg.BoardInfo.FoodPos)\n\n\t// Set snake head position\n\tsg.SetSnake()\n\n\tif err := sg.SetGameState(); err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Printf(\"Created new cli-snake game with board size of %v rows and %v colums.\\n\", b.Size.Rows, b.Size.Columns)\n\n\tsg.RenderBoard()\n\n\treturn nil\n}", "func OpenDialog(triggerID string) error {\n\ttoken := os.Getenv(\"SLACK_BOT_USER_OAUTH_ACCESS_TOKEN\")\n\n\td, err := getRepoCreateDialog()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\n\tdString, err := json.Marshal(&d)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\n\todr := &OpenDialogRequest{\n\t\tTriggerID: triggerID,\n\t\tDialog: string(dString),\n\t}\n\n\tpayload, err := json.Marshal(odr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\n\turl := \"https://slack.com/api/dialog.open\"\n\treq, err := http.NewRequest(\"POST\", url, strings.NewReader(string(payload)))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/json; charset=utf-8\")\n\treq.Header.Add(\"Authorization\", fmt.Sprintf(\"Bearer %s\", token))\n\n\tclient := http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\tdefer resp.Body.Close()\n\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\n\thasErrors, errMsg, err := ContainsErrors(string(b))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] %s\", err.Error())\n\t}\n\tif hasErrors {\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\treturn nil\n}", "func NewContext(window interfaces.Window) *Context {\n\tsett := settings.GetSettings()\n\timgui.SetAssertHandler(nil)\n\tcontext := &Context{\n\t\timguiContext: imgui.CreateContext(nil),\n\t\twindow: window,\n\n\t\tisFrame: false,\n\n\t\tviewControls: dialogs.NewViewControls(),\n\t\tviewModels: dialogs.NewViewModels(),\n\t\tviewOptions: dialogs.NewViewOptions(),\n\n\t\tcomponentLog: components.NewComponentLog(),\n\t\tcomponentIDE: components.NewComponentIDE(),\n\t\tcomponentImport: components.NewComponentImport(),\n\t\tcomponentExport: components.NewComponentExport(),\n\t\tcomponentFileSaver: components.NewComponentFileSaver(),\n\t\tcomponentShadertoy: components.NewComponentShadertoy(window),\n\t}\n\n\tcontext.GuiVars.showModels = true\n\tcontext.GuiVars.showControls = true\n\tcontext.GuiVars.showOptions = false\n\n\tcontext.GuiVars.showLog = sett.App.ShowLog\n\n\tcontext.GuiVars.showOpenDialog = false\n\tcontext.GuiVars.showSaveDialog = false\n\n\tcontext.GuiVars.showDemoWindow = false\n\tcontext.GuiVars.showAboutImGui = false\n\tcontext.GuiVars.showAboutKuplung = false\n\tcontext.GuiVars.showMetrics = false\n\n\tcontext.GuiVars.showParsing = false\n\n\tcontext.GuiVars.ParsingPercentage = 0.0\n\n\tcontext.GuiVars.showImageSave = false\n\tcontext.GuiVars.showRendererUI = false\n\n\tcontext.GuiVars.showImporterFile = false\n\tcontext.GuiVars.showExporterFile = false\n\tcontext.GuiVars.dialogImportType = types.ImportExportFormatUNDEFINED\n\tcontext.GuiVars.dialogExportType = types.ImportExportFormatUNDEFINED\n\n\tcontext.GuiVars.showKuplungIDE = false\n\tcontext.GuiVars.showScreenshotWindow = false\n\tcontext.GuiVars.showSceneStats = false\n\tcontext.GuiVars.showSVS = false\n\tcontext.GuiVars.showShadertoy = false\n\n\tcontext.GuiVars.recentFiles = nil\n\tcontext.GuiVars.recentFilesImported = nil\n\tcontext.GuiVars.showRecentFileImportedDoesntExists = false\n\n\terr := context.createDeviceObjects()\n\tif err != nil {\n\t\tcontext.Destroy()\n\t\tcontext = nil\n\t\tsettings.LogError(\"[gui context] Error initialized ImGui Context: %v\", err)\n\t}\n\n\tcontext.setKeyMapping()\n\n\ttrigger.On(types.ActionParsingShow, func() {\n\t\tcontext.GuiVars.showParsing = true\n\t})\n\ttrigger.On(types.ActionParsingHide, func() {\n\t\tcontext.GuiVars.showParsing = false\n\t})\n\n\ttrigger.On(types.ActionFileImportAddToRecentFiles, context.recentFilesAddImported)\n\n\treturn context\n}", "func CreateUnknownMenu() {\n\tFirstOrCreateMenu(&UnknownMenu)\n}", "func NewResultWin(c Color) Result {\n\tif c == White {\n\t\treturn WhiteWin\n\t} else if c == Black {\n\t\treturn BlackWin\n\t}\n\treturn Draw\n}", "func newScene(win wde.Window, e *Engine) *scene {\n\ts := &scene{\n\t\twin: win,\n\t\te: e,\n\t}\n\n\treturn s\n}", "func (d MessagesDialogsSlice) construct() MessagesDialogsClass { return &d }", "func NewGame(game Game_Detail) bool {\n\torm := get_DBFront()\n\terr := orm.SetTable(\"game\").Save(&game)\n\tif !check_err(err) {\n\t\tLog(Log_Struct{\"error\", \"DB_Error_Line_423\", err})\n\t\treturn false\n\t}\n\treturn true\n}", "func NewUi(w *app.Window) *Ui {\n\tu := Ui{\n\t\tw: w,\n\t\tth: material.NewTheme(gofont.Collection()),\n\t\tga: engine.NewGame(),\n\t}\n\tu.th.TextSize = unit.Dp(topMenuPx / 5)\n\tu.ga.ScaleOffset(WidthPx)\n\tu.nameEditor = &widget.Editor{\n\t\tSingleLine: true,\n\t\tSubmit: true,\n\t}\n\tu.menuBtn.pressed = true\n\tu.titleScreen = true\n\treturn &u\n}", "func newCard() string {\n\treturn \"Five of Diamonds\"\n}", "func newCard() string {\n\treturn \"Five of Diamonds\"\n}", "func NewCheckmate(winner Colour) Outcome { return Outcome{Winner: winner, Reason: checkmate} }", "func ShowDevelopingEvent(s *discordgo.Session, m *discordgo.MessageCreate, channel string, newEvent developingEvent) {\n\tmessage := \"\"\n\n\t// Get channel\n\tc, err := s.Channel(channel)\n\tif err != nil {\n\t\ts.ChannelMessageSend(channel, \"EventsBot had trouble obtaining the channel information :no_mouth:\")\n\t\treturn\n\t}\n\n\t// Get guild variables\n\tgv, ok := guildVarsMap[c.GuildID]\n\tif !ok {\n\t\ts.ChannelMessageSend(channel, \"EventsBot had trouble obtaining the guild information :no_mouth:\")\n\t\treturn\n\t}\n\n\t// Get time zone\n\ttzInfo := \"\"\n\teventLocation := defaultLocation\n\n\tif newEvent.Event.TimeZone != \"\" {\n\t\ttz, ok := gv.tzByAbbr[newEvent.Event.TimeZone]\n\t\tif !ok {\n\t\t\ts.ChannelMessageSend(channel, \"EventsBot had trouble interpreting the time zone information of this event. Are we anywhere near a worm hole perhaps? :no_mouth:\")\n\t\t\treturn\n\t\t}\n\t\ttzInfo = tz.Abbrev\n\t\teventLocation, _ = time.LoadLocation(tz.Location)\n\t} else {\n\t\tif len(gv.timezones) == 1 {\n\t\t\ttz := gv.timezones[0]\n\t\t\ttzInfo = tz.Abbrev\n\t\t\tnewEvent.Event.TimeZone = tz.Abbrev\n\t\t\teventLocation, _ = time.LoadLocation(tz.Location)\n\t\t}\n\t}\n\n\t// Construct message\n\tmessage = \"NEW EVENT\"\n\tmessage = fmt.Sprintf(\"%s\\r\\n**Creator:** %s\", message, newEvent.Event.Creator.Mention())\n\tmessage = fmt.Sprintf(\"%s\\r\\n**Name:** %s\", message, newEvent.Event.Name)\n\tif newEvent.State >= stateNew {\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n**Date:** %s\", message, newEvent.Event.DateTime.In(eventLocation).Format(\"Mon 2 Jan 2006\"))\n\t}\n\tif newEvent.State >= stateTime {\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n**Time:** %s\", message, newEvent.Event.DateTime.In(eventLocation).Format(\"15:04\"))\n\t}\n\tif newEvent.State > stateTimeZone { // note that this is >, not >= as we want to display the time zone only after it has been selected\n\t\tif newEvent.Event.TimeZone != \"\" {\n\t\t\tmessage = fmt.Sprintf(\"%s (%s)\", message, tzInfo)\n\t\t}\n\t}\n\tif newEvent.State >= stateDuration {\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n**Duration:** %d\", message, newEvent.Event.Duration)\n\t}\n\tif newEvent.State >= stateTeamSize {\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n**Team Size:** %d\", message, newEvent.Event.TeamSize)\n\t}\n\tif newEvent.State >= stateDone {\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\nDoes the above appear correct?\", message)\n\t}\n\n\t// Add appliccable reaction legend\n\tswitch newEvent.State {\n\tcase stateNew:\n\t\tfallthrough\n\tcase stateDate:\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\n⏫ = Increase date by 1 month\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n🔼 = Increase date by 1 day\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n🔽 = Decrease date by 1 day\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n⏬ = Decrease date by 1 month\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n👍 = Continue\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n❌ = Cancel\", message)\n\tcase stateTime:\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\n⏪ = Decrease time by 1 hour\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n◀ = Decrease time by 10 minutes\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n▶ = Increase time by 10 minutes\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n⏩ = Increase time by 1 hour\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n👍 = Continue\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n❌ = Cancel\", message)\n\tcase stateTimeZone:\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\n Specify time zone\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n❌ = Cancel\", message)\n\tcase stateDuration:\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\n :one: - :nine: Specify duration (in hours)\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n❌ = Cancel\", message)\n\tcase stateTeamSize:\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\nSpecify team size:\", message)\n\t\tif newEvent.Event.TeamSize < 10 {\n\t\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\n :one: - :nine: = 1 - 9\", message)\n\t\t\tmessage = fmt.Sprintf(\"%s\\r\\n ▶ = More than 9\", message)\n\t\t} else {\n\t\t\tmessage = fmt.Sprintf(\"%s\\r\\n\\r\\n :zero: - :nine: = %d0 - %d9\", message, newEvent.Event.TeamSize/10, newEvent.Event.TeamSize/10)\n\t\t\tmessage = fmt.Sprintf(\"%s\\r\\n ◀ = Less than %d0\", message, newEvent.Event.TeamSize/10)\n\t\t\tmessage = fmt.Sprintf(\"%s\\r\\n ▶ = More than %d9\", message, newEvent.Event.TeamSize/10)\n\t\t}\n\t\t//message = fmt.Sprintf(\"%s\\r\\n👍 = Continue\", message)\n\t\tmessage = fmt.Sprintf(\"%s\\r\\n❌ = Cancel\", message)\n\tcase stateDone:\n\t\tEditEvent(s, m, channel, newEvent.MessageID, \"\")\n\t\treturn\n\t\t// message = fmt.Sprintf(\"%s\\r\\n✅ = OK\", message)\n\t\t// message = fmt.Sprintf(\"%s\\r\\n❌ = Cancel\", message)\n\t\t// message = fmt.Sprintf(\"%s\\r\\n🗓 = Back to Date\", message)\n\t\t// message = fmt.Sprintf(\"%s\\r\\n🕑 = Back to Time\", message)\n\t\t// message = fmt.Sprintf(\"%s\\r\\n🌍 = Back to Time Zone\", message)\n\t\t// message = fmt.Sprintf(\"%s\\r\\n⏳ = Back to Duration\", message)\n\t\t// message = fmt.Sprintf(\"%s\\r\\n👬 = Back to Team Size\", message)\n\tdefault:\n\t}\n\n\t// Post or update message\n\tif newEvent.State == stateNew {\n\t\tnewMsg, _ := s.ChannelMessageSend(channel, message)\n\t\tnewEvent.MessageID = newMsg.ID\n\t\tgv.escrowEvents[newMsg.ID] = newEvent\n\t} else {\n\t\ts.ChannelMessageEdit(channel, newEvent.MessageID, \"\")\n\t\ts.ChannelMessageEdit(channel, newEvent.MessageID, message)\n\t}\n\n\t// Add appliccable reactions\n\ts.MessageReactionsRemoveAll(channel, newEvent.MessageID)\n\tswitch newEvent.State {\n\tcase stateNew:\n\t\tfallthrough\n\tcase stateDate:\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"⏫\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"🔼\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"🔽\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"⏬\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"👍\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"❌\")\n\tcase stateTime:\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"⏪\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"◀\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"▶\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"⏩\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"👍\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"❌\")\n\tcase stateTimeZone:\n\t\tfor emoji := range gv.tzByEmoji {\n\t\t\ts.MessageReactionAdd(channel, newEvent.MessageID, emoji)\n\t\t}\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"❌\")\n\tcase stateDuration:\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiOne)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiTwo)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiThree)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiFour)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiFive)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiSix)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiSeven)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiEight)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiNine)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"❌\")\n\tcase stateTeamSize:\n\t\tif newEvent.Event.TeamSize > 9 {\n\t\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"◀\")\n\t\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiZero)\n\t\t}\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiOne)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiTwo)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiThree)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiFour)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiFive)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiSix)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiSeven)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiEight)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, EmojiNine)\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"▶\")\n\t\t//s.MessageReactionAdd(channel, newEvent.MessageID, \"👍\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"❌\")\n\tcase stateDone:\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"✅\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"❌\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"🗓\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"🕑\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"🌍\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"⏳\")\n\t\ts.MessageReactionAdd(channel, newEvent.MessageID, \"👬\")\n\tdefault:\n\t}\n}", "func CreateGame(hand Hand, trumpCard Card, isOpponentMove bool) Game {\n\tif len(hand) != 6 {\n\t\tpanic(\"player's hand is not complete\")\n\t}\n\n\treturn Game{\n\t\ttrump: trumpCard.Suit,\n\t\tscore: 0,\n\t\topponentScore: 0,\n\t\thand: hand,\n\t\tknownOpponentCards: NewHand(),\n\t\tseenCards: NewPile(),\n\t\tunseenCards: getHiddenCards(hand, trumpCard),\n\t\ttrumpCard: &trumpCard,\n\t\tcardPlayed: nil,\n\t\tisOpponentMove: isOpponentMove,\n\t\tisClosed: false,\n\t\tagent: dummyAgent{},\n\t}\n}", "func execNew(_ int, p *gop.Context) {\n\targs := p.GetArgs(1)\n\tret := template.New(args[0].(string))\n\tp.Ret(1, ret)\n}", "func newRoutine(wg *sync.WaitGroup) {\n\tfmt.Println(\"New Routine\")\n\twg.Done()\n}", "func newCreateFile() *cobra.Command {\n\tvar (\n\t\toptions core.CreateFileOptions\n\t)\n\tcreateFileCmd := cobra.Command{\n\t\tUse: \"file NAME\",\n\t\tShort: `Create a new content file`,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tpath := args[0]\n\t\t\treturn core.CreateFile(path, options)\n\t\t},\n\t}\n\n\tcreateFileCmd.Flags().StringVarP(&options.Project, \"project\", \"p\", \".\", `project path to create file in.`)\n\n\treturn &createFileCmd\n}", "func (sd *SimpleDialog) Custom(owner walk.Form, widget Widget) (accepted bool, err error) {\n\tvar (\n\t\tdlg *walk.Dialog\n\t)\n\n\tif _, err := (Dialog{\n\t\tAssignTo: &dlg,\n\t\tLayout: VBox{Margins: Margins{}},\n\t\tChildren: []Widget{\n\t\t\twidget,\n\t\t\tComposite{\n\t\t\t\tLayout: HBox{Margins: Margins{}},\n\t\t\t\tChildren: []Widget{\n\t\t\t\t\tPushButton{\n\t\t\t\t\t\tText: i18n.Tr(\"widget.button.ok\"),\n\t\t\t\t\t\tOnClicked: func() {\n\t\t\t\t\t\t\t// some stuff here...\n\t\t\t\t\t\t\tdlg.Close(0)\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tPushButton{\n\t\t\t\t\t\tText: i18n.Tr(\"widget.button.cancel\"),\n\t\t\t\t\t\tOnClicked: func() {\n\t\t\t\t\t\t\tdlg.Close(0)\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\tTitle: sd.Title,\n\t\tSize: sd.Size,\n\t\tFixedSize: sd.FixedSize,\n\t}).Run(owner); err != nil {\n\t\treturn false, err\n\t}\n\n\treturn\n}", "func newView() tcell.Screen {\n\ttcell.SetEncodingFallback(tcell.EncodingFallbackASCII)\n\ts, e := tcell.NewScreen()\n\tif e != nil {\n\t\tfmt.Fprintf(os.Stderr, \"%v\\n\", e)\n\t\tos.Exit(1)\n\t}\n\tif e = s.Init(); e != nil {\n\t\tfmt.Fprintf(os.Stderr, \"%v\\n\", e)\n\t\tos.Exit(1)\n\t}\n\ts.Clear()\n\twindowWidth, windowHeight = s.Size()\n\treturn s\n}", "func BuildModal(p tview.Primitive, width, height int) tview.Primitive {\n\tcpnt := tview.NewFlex().SetDirection(tview.FlexRow).\n\t\tAddItem(nil, 0, 1, false).\n\t\tAddItem(p, height, 1, false).\n\t\tAddItem(nil, 0, 1, false)\n\n\treturn tview.NewFlex().\n\t\tAddItem(nil, 0, 1, false).\n\t\tAddItem(cpnt, width, 1, false).\n\t\tAddItem(nil, 0, 1, false)\n}", "func (uc *UserCreate) SetDialog(d *Dialog) *UserCreate {\n\treturn uc.SetDialogID(d.ID)\n}", "func New()(*Window,error){\n\n\n/*8:*/\n\n\n//line goacme.w:147\n\n{\nvar err error\nonce.Do(func(){fsys,err= client.MountService(\"acme\")})\nif err!=nil{\nreturn nil,err\n}\n}\n\n\n\n/*:8*/\n\n\n//line goacme.w:160\n\nf,err:=fsys.Open(\"new/ctl\",plan9.OREAD)\nif err!=nil{\nreturn nil,err\n}\ndefer f.Close()\nvar id int\nif _,err:=fmt.Fscan(f,&id);err!=nil{\nreturn nil,err\n}\nreturn Open(id)\n}", "func (ptr *Application) onClickMenuAboutNotepad() {\n\tptr.setCurrentMsgBox(MsgBoxAboutNotepad)\n}", "func NewFileOpen(callback func(fyne.URIReadCloser, error), parent fyne.Window) *FileDialog {\n\tdialog := &FileDialog{callback: callback, parent: parent}\n\treturn dialog\n}", "func (ptr *Application) onClickMenuFileNew() {\n\n\t// reset the text editor\n\tptr.textEditor.SetText(\"\")\n}" ]
[ "0.6481888", "0.63578427", "0.62546325", "0.6170362", "0.61563224", "0.60556924", "0.5908183", "0.58998257", "0.56593597", "0.5580943", "0.547547", "0.5463997", "0.54177654", "0.53838277", "0.53588384", "0.53536123", "0.5321696", "0.52956635", "0.5292912", "0.5272295", "0.5265524", "0.52388394", "0.5226447", "0.52215266", "0.52052855", "0.51588076", "0.51588076", "0.5150056", "0.50535655", "0.50245374", "0.50193185", "0.4980593", "0.49554208", "0.4930668", "0.4929701", "0.49175856", "0.49119443", "0.48978937", "0.48609954", "0.48494726", "0.48361838", "0.48330277", "0.48290676", "0.4818578", "0.47811428", "0.474087", "0.47262844", "0.47181094", "0.47128645", "0.4687326", "0.46811327", "0.46749482", "0.46549034", "0.46525994", "0.4634257", "0.46294153", "0.46248382", "0.46098003", "0.460313", "0.46018943", "0.46015787", "0.45804814", "0.45762604", "0.45651236", "0.45549035", "0.45527524", "0.4543616", "0.4520808", "0.4517616", "0.45117363", "0.4511285", "0.45098603", "0.4507333", "0.45061427", "0.44899186", "0.44887236", "0.44884062", "0.4480568", "0.44679093", "0.44539168", "0.44511002", "0.44494197", "0.44465923", "0.4442768", "0.44401023", "0.44401023", "0.44394824", "0.44370937", "0.44301403", "0.44247487", "0.44184342", "0.4417937", "0.4413831", "0.4410543", "0.43921256", "0.43883187", "0.43839177", "0.43749085", "0.43703318", "0.43665704" ]
0.7018586
0
NewLocalHashMapDBMgr instantiates a new local LRU memmgr.
NewLocalHashMapDBMgr создает новый локальный LRU memmgr.
func NewLocalHashMapDBMgr(pfx string) *LocalHashMapDBMgr { return &LocalHashMapDBMgr{memMap: make(map[common.Key]interface{}), policy: common.DBMgrPolicyLocalMap, prefix: pfx, base: Base{common.Key{BPTkey: ""}, 0}} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewLocalManager(ctx context.Context, root string) *LocalManager {\n\treturn &LocalManager{path: root}\n}", "func (m *LocalManager) New(ctx context.Context, id string) (linker.Storage, error) {\n\tdb, err := NewLocalStorage(ctx, fmt.Sprintf(\"%s/db-%s\", m.path, id))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "func newHLLCache(size int, wsize int, db *RockDB) (*hllCache, error) {\n\tc := &hllCache{\n\t\tdb: db,\n\t}\n\tvar err error\n\tc.readCache, err = lru.NewWithEvict(size, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.dirtyWriteCache, err = lru.NewWithEvict(wsize, c.onEvicted)\n\treturn c, err\n}", "func newTableManager() (*tableManager, error) {\n\tvar tb *tableManager = new(tableManager)\n\tif tb == nil {\n\t\treturn nil, errors.New(\"Could not create the TableManager\")\n\t}\n\ttb.data = make(map[uint64]*tableEntry)\n\tif tb.data == nil {\n\t\treturn nil, errors.New(\"Could not allocate the map for table.\")\n\t}\n\ttb.dirtyList = make([]uint64, 0, tableSize)\n\tif tb.dirtyList == nil {\n\t\treturn nil, errors.New(\"Could not allocate dirtyList.\")\n\t}\n\ttb.lruHead = new(tableEntry)\n\ttb.lruTail = new(tableEntry)\n\tif tb.lruHead == nil || tb.lruTail == nil {\n\t\treturn nil, errors.New(\"Could not allocate LRU Head/Tail.\")\n\t}\n\n\ttb.lruHead.lruNext = tb.lruTail\n\ttb.lruTail.lruPrev = tb.lruHead\n\treturn tb, nil\n}", "func CreateNewLocalSecretManager() *LocalSecretManager {\n\treturn &LocalSecretManager{}\n}", "func NewManager(redisHosts []string, redisPw string, deadChan chan<- string, commitChan chan<- int64) *Mgr {\n\tm := &Mgr{workers: NewMap(), deadChan: deadChan, commitChan: commitChan}\n\tdeadWorkers, err := NewCache(redisHosts, redisPw, \"deadWs24\", 100000)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tm.deadWorkers = deadWorkers\n\tgo m.doPing()\n\treturn m\n}", "func NewLocal(label string) *Local {\n\treturn &Local{Root: configdir.LocalCache(label)}\n}", "func NewLocalFS(m map[string]struct{}, basePath string) LocalFS {\n\tpfs := make(map[string]*LocalFile, len(m))\n\tfor k := range m {\n\t\tpfs[k] = &LocalFile{\n\t\t\tpath: k,\n\t\t}\n\t}\n\n\treturn LocalFS{\n\t\tm: pfs,\n\t\tbasePath: basePath,\n\t}\n}", "func NewLocalLedger() *LocalLedger {\n\tlog.Printf(\"BLURB-LEDGER: Initializing\")\n\treturn &LocalLedger{\n\t\tledger: sync.Map{},\n\t\tbidCounter: 0,\n\t\tbidMutex: sync.Mutex{},\n\n\t\tfeeds: struct {\n\t\t\tcache sync.Map\n\t\t\tlength int\n\t\t\tblurbsPerUser int\n\t\t}{\n\t\t\tcache: sync.Map{},\n\t\t\tlength: 100,\n\t\t\tblurbsPerUser: 10,\n\t\t},\n\t}\n}", "func NewLocalStore() *LocalStore {\n\treturn &LocalStore{\n\t\tstore: make(map[string]string),\n\t\tlock: &sync.RWMutex{},\n\t}\n}", "func New(options ...LocalCacheOption) *LocalCache {\n\tc := LocalCache{\n\t\tData: make(map[interface{}]*Value),\n\t\tLRU: NewLRUQueue(),\n\t}\n\tc.Sweeper = async.NewInterval(c.Sweep, 500*time.Millisecond)\n\tfor _, opt := range options {\n\t\topt(&c)\n\t}\n\treturn &c\n}", "func NewManager(partitioner Partitioner, serviceName, dataDir, myEntryId string) *Manager {\n manager := &Manager{\n table : nil,\n connections : make(map[string]client.Client),\n DataDir : dataDir,\n ServiceName : serviceName,\n MyEntryId : myEntryId,\n }\n //attempt to load from disk\n err := manager.load()\n if err != nil {\n log.Println(err)\n }\n return manager\n}", "func (cd *Codec) UseLocalCache(maxLen int, expiration time.Duration) {\n\tcd.localCache = lrucache.New(maxLen, expiration)\n}", "func newLocalStore(address net.Address) (Store, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tsession, err := primitive.NewSession(ctx, primitive.Partition{ID: 1, Address: address})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tupdatesName := primitive.Name{\n\t\tNamespace: \"local\",\n\t\tName: primitiveName,\n\t}\n\tupdates, err := _map.New(context.Background(), updatesName, []*primitive.Session{session})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &atomixStore{\n\t\tupdates: updates,\n\t}, nil\n}", "func NewLocalRegistry(artHome string) *LocalRegistry {\n\tr := &LocalRegistry{\n\t\tRepositories: []*Repository{},\n\t\tArtHome: artHome,\n\t}\n\t// load local registry\n\tr.Load()\n\treturn r\n}", "func NewManager(local *peer.Local, f LoadMessageFunc, log *logger.Logger) *Manager {\n\tm := &Manager{\n\t\tlocal: local,\n\t\tloadMessageFunc: f,\n\t\tlog: log,\n\t\tevents: Events{\n\t\t\tMessageReceived: events.NewEvent(messageReceived),\n\t\t},\n\t\tneighborsEvents: map[NeighborsGroup]NeighborsEvents{\n\t\t\tNeighborsGroupAuto: NewNeighborsEvents(),\n\t\t\tNeighborsGroupManual: NewNeighborsEvents(),\n\t\t},\n\t\tneighbors: map[identity.ID]*Neighbor{},\n\t\tserver: nil,\n\t}\n\n\tm.messageWorkerPool = workerpool.New(func(task workerpool.Task) {\n\t\tm.processPacketMessage(task.Param(0).([]byte), task.Param(1).(*Neighbor))\n\n\t\ttask.Return(nil)\n\t}, workerpool.WorkerCount(messageWorkerCount), workerpool.QueueSize(messageWorkerQueueSize))\n\n\tm.messageRequestWorkerPool = workerpool.New(func(task workerpool.Task) {\n\t\tm.processMessageRequest(task.Param(0).([]byte), task.Param(1).(*Neighbor))\n\n\t\ttask.Return(nil)\n\t}, workerpool.WorkerCount(messageRequestWorkerCount), workerpool.QueueSize(messageRequestWorkerQueueSize))\n\n\treturn m\n}", "func NewLevelDbManager(dbRoot string) Manager {\n\treturn levelDbManager(dbRoot)\n}", "func New(bufferPoolSize int, views map[string]View) *Manager {\n\tif bufferPoolSize <= 0 {\n\t\tpanic(ErrBufferPoolSizeInvalid)\n\t}\n\tm := &Manager{\n\t\tm: &sync.RWMutex{},\n\t\tbuffers: newBufferPool(bufferPoolSize),\n\t\tviews: make(map[string]View),\n\t}\n\tif views != nil {\n\t\tfor name, v := range views {\n\t\t\tif v == nil {\n\t\t\t\tpanic(fmt.Errorf(\"view: View \\\"%s\\\" is nil\", name))\n\t\t\t}\n\t\t\tm.views[name] = v\n\t\t}\n\t}\n\treturn m\n}", "func New(dir, name string) (mp *MapDB, err error) {\n\tvar m MapDB\n\t// Initialize map\n\tm.m = make(map[string]string)\n\n\t// Encryption middleware\n\tcmw := middleware.NewCryptyMW([]byte(\" encryption key \"), make([]byte, 16))\n\tif cmw == nil {\n\n\t}\n\n\t// Create a new instance of mrT\n\tif m.mrT, err = mrT.New(dir, name); err != nil {\n\t\treturn\n\t}\n\n\tif err = m.mrT.ForEach(m.load); err != nil {\n\t\treturn\n\t}\n\n\t// Assign pointer to our MapDB\n\tmp = &m\n\treturn\n}", "func New(capacity int64) chainstore.Store {\n\tmemStore := &memStore{\n\t\tdata: make(map[string][]byte, 1000),\n\t}\n\tstore := lrumgr.New(capacity, memStore)\n\treturn store\n}", "func NewLocalPool(sizePerProc int, newFn func() interface{}, resetFn func(obj interface{})) *LocalPool {\n\tslots := make([]*slot, runtime.GOMAXPROCS(0))\n\tfor i := 0; i < len(slots); i++ {\n\t\tslots[i] = &slot{\n\t\t\tobjs: make([]interface{}, 0, sizePerProc),\n\t\t}\n\t}\n\treturn &LocalPool{\n\t\tsizePerProc: sizePerProc,\n\t\tslots: slots,\n\t\tnewFn: newFn,\n\t\tresetFn: resetFn,\n\t}\n}", "func NewLRU(cap int) kv.Store {\n\treturn newStore(newLRUStore(cap))\n}", "func NewLRUMap() *LRUMap {\n\treturn &LRUMap{\n\t\tdict: make(map[int]*keyValNode),\n\t\tfront: nil,\n\t\trear: nil,\n\t\tlen: 0,\n\t}\n}", "func New(cf Config) cache.Cache {\n\treturn &localCache{\n\t\tcacheEngine: freecache.NewCache(cf.Size),\n\t\tcf: cf,\n\t}\n}", "func newRouteManager(wg *sync.WaitGroup, logRouteChanges bool, syncPeriod time.Duration) *routeManager {\n\treturn &routeManager{\n\t\tlogRouteChanges: logRouteChanges,\n\t\tsyncPeriod: syncPeriod,\n\t\tstore: make(map[string]routesPerLink),\n\t\taddRouteCh: make(chan routesPerLink, 5),\n\t\tdelRouteCh: make(chan routesPerLink, 5),\n\t\twg: wg,\n\t}\n}", "func NewLocalNode(db *DB, key *ecdsa.PrivateKey) *LocalNode {\n\tln := &LocalNode{\n\t\tid: PubkeyToIDV4(&key.PublicKey),\n\t\tdb: db,\n\t\tkey: key,\n\t\tentries: make(map[string]qnr.Entry),\n\t\tendpoint4: lnEndpoint{\n\t\t\ttrack: netutil.NewIPTracker(iptrackWindow, iptrackContactWindow, iptrackMinStatements),\n\t\t},\n\t\tendpoint6: lnEndpoint{\n\t\t\ttrack: netutil.NewIPTracker(iptrackWindow, iptrackContactWindow, iptrackMinStatements),\n\t\t},\n\t}\n\tln.seq = db.localSeq(ln.id)\n\tln.invalidate()\n\treturn ln\n}", "func NewLocalStore(meta Container, storage LocalStorage, pd Prophet) LocalStore {\n\treturn &defaultLocalStore{\n\t\tmeta: meta,\n\t\tdb: &defaultLocalDB{storage: storage},\n\t\tpd: pd,\n\t}\n}", "func NewMgr(dbPath string, ccInfoProvider ledger.DeployedChaincodeInfoProvider) (*Mgr, error) {\n\tp, err := newDBProvider(dbPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Mgr{ccInfoProvider, p}, nil\n}", "func NewLocalAuthManager() AuthManager {\n\tcache := NewLocalSessionCache()\n\treturn AuthManager{\n\t\tMode: AuthManagerModeJWT,\n\t\tCookieSecure: DefaultCookieSecure,\n\t\tCookieHTTPOnly: DefaultCookieHTTPOnly,\n\t\tCookieSameSite: DefaultCookieSameSite,\n\t\tPersistHandler: cache.PersistHandler,\n\t\tFetchHandler: cache.FetchHandler,\n\t\tRemoveHandler: cache.RemoveHandler,\n\t}\n}", "func NewHashMap(hashFn func() hash.Hash64, size uint64) *HashMap {\n\thm := &HashMap{\n\t\tnodes: make([]*node, size),\n\t\thasher: sync.Pool{\n\t\t\tNew:func() interface{} {\n\t\t\t\treturn hashFn()\n\t\t\t},\n\t\t},\n\n\t\tsize: size,\n\t}\n\tfor i := range hm.nodes {\n\t\thm.nodes[i] = &node{}\n\t}\n\treturn hm\n}", "func NewLocalDatabaseProvider(name string, type_ string) *LocalDatabaseProvider {\n\tthis := LocalDatabaseProvider{}\n\tthis.Name = name\n\tthis.Type = type_\n\tvar deviceLimitPerUser int32 = 100\n\tthis.DeviceLimitPerUser = &deviceLimitPerUser\n\tvar adminProvider bool = false\n\tthis.AdminProvider = &adminProvider\n\tvar inactivityTimeoutMinutes int32 = 0\n\tthis.InactivityTimeoutMinutes = &inactivityTimeoutMinutes\n\tvar networkInactivityTimeoutEnabled bool = false\n\tthis.NetworkInactivityTimeoutEnabled = &networkInactivityTimeoutEnabled\n\tvar blockLocalDnsRequests bool = false\n\tthis.BlockLocalDnsRequests = &blockLocalDnsRequests\n\tvar userLockoutThreshold int32 = 5\n\tthis.UserLockoutThreshold = &userLockoutThreshold\n\tvar userLockoutDurationMinutes int32 = 1\n\tthis.UserLockoutDurationMinutes = &userLockoutDurationMinutes\n\tvar minPasswordLength int32 = 0\n\tthis.MinPasswordLength = &minPasswordLength\n\treturn &this\n}", "func NewLocalStore() (Store, error) {\n\t_, address := utils.StartLocalNode()\n\treturn newLocalStore(address)\n}", "func createCache(cacheSize int) (glc glcache.Cache) {\n\tconf := glcache.Config{\n\t\tMaxSize: defaultCacheSize,\n\t\tEnableLRU: true,\n\t}\n\n\tif cacheSize > 0 {\n\t\tconf.MaxSize = uint(cacheSize)\n\t}\n\n\treturn glcache.New(conf)\n}", "func NewManager() Manager {\n\treturn &manager{\n\t\tcontexts: make(map[uint64]*context),\n\t\tglobal: make(Map),\n\t}\n}", "func NewLocalRedis(p *providers.Provider) (providers.ClowderProvider, error) {\n\tconfig := config.InMemoryDBConfig{}\n\n\tredisProvider := localRedis{Provider: *p, Config: config}\n\n\treturn &redisProvider, nil\n}", "func NewManager(rawurl string, opts ...Option) (Manager, error) {\n\turl, err := url.Parse(rawurl)\n\tif err != nil {\n\t\treturn nil, ErrInvalidURL\n\t}\n\n\tcache, _ := NewLRUCache(_defaultCacheSize)\n\n\tlogger := zerolog.\n\t\tNew(os.Stderr).With().\n\t\tLogger().\n\t\tLevel(zerolog.Disabled)\n\n\tmng := &manager{\n\t\turl: url,\n\t\tcache: cache,\n\t\tclient: &http.Client{Timeout: _defaultTimeout},\n\t\tlookup: true,\n\t\tretries: _defaultRetries,\n\t\tlogger: logger,\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(mng)\n\t}\n\n\treturn mng, nil\n}", "func newCache(size int) *cache {\n\treturn &cache{0, make([]byte, size), make([]FileID, 0), make(map[FileID]location)}\n}", "func initLMDB() {\n\tlmdb, err := db.MakeLMDBHandler(\"./\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// Add random proposal to the database\n\tid := uuid.NewV4()\n\tbeego.Info(\"Prop ID: \", id.String())\n\tprop := messages.Proposal{}\n\tprop.FillRandom()\n\tdata, _ := json.Marshal(prop)\n\tlmdb.Write(db.PROPOSALS, id.Bytes(), data)\n\t// Add random chat message to the database\n\tid = uuid.NewV4()\n\n\tchatb := messages.ChatBucket{}\n\tchatb.FillRandom(15)\n\tdata, _ = json.Marshal(chatb)\n\tlmdb.Write(db.CHAT, id.Bytes(), data)\n\n\tprev := id.String()\n\tid = uuid.NewV4()\n\tchatb.FillRandom(20)\n\tchatb.Previous = &prev\n\tdata, _ = json.Marshal(chatb)\n\tlmdb.Write(db.CHAT, id.Bytes(), data)\n\n\tbeego.Info(\"Chat Bucket ID: \", id.String())\n\t// Global database\n\tdb.DB = lmdb\n}", "func NewLocal(l *util.StandardLogger, basePath string, maxSize int) (*Local, error) {\n\tp, err := filepath.Abs(basePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Local{l, maxSize, p}, nil\n}", "func New(cap int) (*HashMap, error) {\n\tif cap <= 0 {\n\t\treturn nil, errors.New(\"Capacity should be greater than 0\")\n\t}\n\n\treturn &HashMap{make([]*mapNode, cap), 0}, nil\n}", "func New() (hm *HashMap) {\n\thm = new(HashMap)\n\thm.data = make([]*list.List, dataLen)\n\tfor i := uint32(0); i < dataLen; i++ {\n\t\thm.data[i] = list.New()\n\t}\n\treturn\n}", "func newCache(conf configuration.Conf, fname string) *Cache {\n\tvar err error\n\n\tc := new(Cache)\n\tc.apiKey = conf.APISecretKey\n\tc.DB, err = gorm.Open(\"sqlite3\", fname)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = c.DB.AutoMigrate(&quandl.Record{}, &ref{}).Error\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tc.ref = make(map[string]time.Time)\n\n\t// Restore saved refs if any from the db.\n\t// That will avoid unnecessary refresh, and identify all Tickers.\n\t// Extract tickers from config file as default tickers.\n\tc.restoreRefs(conf.Tickers()...)\n\n\treturn c\n}", "func newLavaToolsCache(c *lava.Connection, retry *retry, opt Options) (obj *cache, err error) {\n\tobj = &cache{c: c,\n\t\tdeviceList: deviceListCache{DeviceList: []lava.DeviceList{}},\n\t\tdevices: map[string]deviceCache{},\n\t\tdeviceTags: map[string]tagsCache{},\n\t\tdeviceTypeTemplate: map[string]deviceTypeTemplateCache{},\n\t\tpollInterval: opt.PollInterval,\n\t\tinvalidTimeout: opt.InvalidTimeout,\n\t\tretry: retry,\n\t}\n\n\tif opt.BackgroundPrefetching {\n\t\tgo obj.updatePeriodic(opt.BackgroundInterval)\n\t}\n\n\treturn\n}", "func NewMapLRU(capacity int) LRU {\n\tif capacity <= 0 {\n\t\tcapacity = 1\n\t}\n\n\treturn &mapLRU{\n\t\tcapacity: capacity,\n\t\tcache: make(map[string]*mapLRUItem, capacity),\n\t}\n}", "func NewHashMap(blockSize int, fn ...HashFunc) (*HashMap, error) {\n\tif blockSize <= 0 {\n\t\treturn nil, errors.New(\"blockSize must be more than 0\")\n\t}\n\tf := hashFunc\n\tif len(fn) > 0 {\n\t\tf = fn[0]\n\t}\n\treturn &HashMap{\n\t\tBlockSize: blockSize,\n\t\tHashFunc: f,\n\t\tBuckets: make([]*Entry, blockSize),\n\t\tEntries: 0,\n\t}, nil\n}", "func newDbCache(ldb *leveldb.DB, store *blockStore, maxSize uint64, flushIntervalSecs uint32) *dbCache {\n\treturn &dbCache{\n\t\tldb: ldb,\n\t\tstore: store,\n\t\tmaxSize: maxSize,\n\t\tflushInterval: time.Second * time.Duration(flushIntervalSecs),\n\t\tlastFlush: time.Now(),\n\t\tcachedKeys: treap.NewImmutable(),\n\t\tcachedRemove: treap.NewImmutable(),\n\t}\n}", "func NewLocalAuthManagerFromCache(cache *LocalSessionCache) AuthManager {\n\treturn AuthManager{\n\t\tMode: AuthManagerModeLocal,\n\t\tCookieSecure: DefaultCookieSecure,\n\t\tCookieHTTPOnly: DefaultCookieHTTPOnly,\n\t\tCookieSameSite: DefaultCookieSameSite,\n\t\tPersistHandler: cache.PersistHandler,\n\t\tFetchHandler: cache.FetchHandler,\n\t\tRemoveHandler: cache.RemoveHandler,\n\t}\n}", "func newLockMap() *lockMap {\n\treturn &lockMap{\n\t\tmutexMap: make(map[string]*sync.Mutex),\n\t}\n}", "func NewLockBasedTxMgr(initializer *Initializer) (*LockBasedTxMgr, error) {\n\tif initializer.HashFunc == nil {\n\t\treturn nil, errors.New(\"create new lock based TxMgr failed: passed in nil ledger hasher\")\n\t}\n\n\tif err := initializer.DB.Open(); err != nil {\n\t\treturn nil, err\n\t}\n\ttxmgr := &LockBasedTxMgr{\n\t\tledgerid: initializer.LedgerID,\n\t\tdb: initializer.DB,\n\t\tstateListeners: initializer.StateListeners,\n\t\tccInfoProvider: initializer.CCInfoProvider,\n\t\thashFunc: initializer.HashFunc,\n\t}\n\tpvtstatePurgeMgr, err := pvtstatepurgemgmt.InstantiatePurgeMgr(\n\t\tinitializer.LedgerID,\n\t\tinitializer.DB,\n\t\tinitializer.BtlPolicy,\n\t\tinitializer.BookkeepingProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttxmgr.pvtdataPurgeMgr = &pvtdataPurgeMgr{pvtstatePurgeMgr, false}\n\ttxmgr.commitBatchPreparer = validation.NewCommitBatchPreparer(\n\t\ttxmgr,\n\t\tinitializer.DB,\n\t\tinitializer.CustomTxProcessors,\n\t\tinitializer.HashFunc)\n\treturn txmgr, nil\n}", "func New(name string, MaxEntries int) *Cache {\n\treturn &Cache{\n\t\tlru: lru.New(MaxEntries),\n\t\tName: name,\n\t}\n}", "func newlru(what string, maxItems int, new func(epoch uint64) interface{}) *lru {\n\tif maxItems <= 1 {\n\t\tmaxItems = 5\n\t}\n\tcache, _ := simplelru.NewLRU(maxItems, func(key, value interface{}) {\n\t\tlog.Trace(\"Evicted minerva \"+what, \"epoch\", key)\n\t})\n\treturn &lru{what: what, new: new, cache: cache}\n}", "func New(maxEntries int) *Cache {\n\treturn &Cache{\n\t\tmaxEntries: maxEntries,\n\t\tddl: list.New(),\n\t\tcache: map[Key]*list.Element{},\n\t}\n}", "func New(size int) *GCache {\n\treturn NewWithType(size, gcache.TYPE_LRU)\n}", "func NewManagerSeed(partitioner Partitioner, serviceName, dataDir, myEntryId string, seedHttpUrls []string) (*Manager, error) {\n //TODO: can we get the servicename from the routing table?\n\n manager := NewManager(partitioner, serviceName, dataDir, myEntryId)\n var err error\n for _,url := range(seedHttpUrls) {\n\n client := client.NewHttp(url)\n tble, err := RequestRouterTable(client)\n client.Close()\n if err != nil {\n //found a table.. woot\n manager.SetRouterTable(tble)\n return manager, nil\n }\n }\n\n if manager.table != nil {\n //uhh, I guess we sucessfully loaded it elsewhere\n return manager, nil\n }\n //we still return the manager since it is usable just doesnt have a routing table.\n return manager, err\n}", "func newMemorySliceDB() (*sliceDB, error) {\r\n\tdb, err := leveldb.Open(storage.NewMemStorage(), nil)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &sliceDB{\r\n\t\tlvl: db,\r\n\t\tquit: make(chan struct{}),\r\n\t}, nil\r\n}", "func NewLockedLRU(size int, name string, openStat bool,\n\temitCounter func(name string, value interface{}, prefix string, tagkv map[string]string)) *lockedLRU {\n\tif size <= 0 {\n\t\tpanic(\"inmem: must provide a positive size\")\n\t}\n\tlru := &lockedLRU{\n\t\topenStat: openStat,\n\t\tstopSignal: make(chan struct{}),\n\t\tname: name,\n\t\tc: simpleLRU{\n\t\t\tsize: size,\n\t\t\tlru: list.New(),\n\t\t\titems: make(map[interface{}]*list.Element),\n\t\t},\n\t\temitCounter: emitCounter,\n\t}\n\n\tif openStat && emitCounter != nil {\n\t\tgo runStat(lru)\n\t\truntime.SetFinalizer(lru, stopStat)\n\n\t}\n\treturn lru\n}", "func NewLRUCache(capacity int, highPriorityPoolRatio float64) *Cache {\n\treturn &Cache{\n\t\tc: C.rocksdb_cache_create_lru_with_ratio(\n\t\t\tC.size_t(capacity),\n\t\t\tC.double(highPriorityPoolRatio),\n\t\t),\n\t}\n}", "func newCacheDB(persistent, memory storage.DataStore) storage.DataStore {\n\treturn &memoryDB{\n\t\tpersistent: persistent,\n\t\tinmem: memory,\n\t\tpersistentAPN: nil,\n\t\tinmemAPN: nil,\n\t}\n}", "func NewLRUTokenStore(maxOrigins, tokensPerOrigin int) TokenStore {\n\treturn &lruTokenStore{\n\t\tm: make(map[string]*list.Element[*lruTokenStoreEntry]),\n\t\tq: list.New[*lruTokenStoreEntry](),\n\t\tcapacity: maxOrigins,\n\t\tsingleOriginSize: tokensPerOrigin,\n\t}\n}", "func NewLRUCache(max int) *LRUCache {\n\tc := &LRUCache{max: max}\n\tc.reset()\n\treturn c\n}", "func NewManager() (*Manager, error) {\n\tsm := &Manager{\n\t\tsessions: make(map[string]*client),\n\t}\n\tsm.updateCondition = sync.NewCond(&sm.mu)\n\treturn sm, nil\n}", "func InitDB() (*LevelLedger, error) {\n\t// Options struct doc: https://godoc.org/github.com/syndtr/goleveldb/leveldb/opt#Options.\n\topts := &opt.Options{\n\t\tAltFilters: nil,\n\t\tBlockCacher: opt.LRUCacher,\n\t\t// BlockCacheCapacity increased to 32MiB from default 8 MiB.\n\t\t// BlockCacheCapacity defines the capacity of the 'sorted table' block caching.\n\t\tBlockCacheCapacity: 32 * 1024 * 1024,\n\t\tBlockRestartInterval: 16,\n\t\tBlockSize: 4 * 1024,\n\t\tCompactionExpandLimitFactor: 25,\n\t\tCompactionGPOverlapsFactor: 10,\n\t\tCompactionL0Trigger: 4,\n\t\tCompactionSourceLimitFactor: 1,\n\t\tCompactionTableSize: 2 * 1024 * 1024,\n\t\tCompactionTableSizeMultiplier: 1.0,\n\t\tCompactionTableSizeMultiplierPerLevel: nil,\n\t\t// CompactionTotalSize increased to 32MiB from default 10 MiB.\n\t\t// CompactionTotalSize limits total size of 'sorted table' for each level.\n\t\t// The limits for each level will be calculated as:\n\t\t// CompactionTotalSize * (CompactionTotalSizeMultiplier ^ Level)\n\t\tCompactionTotalSize: 32 * 1024 * 1024,\n\t\tCompactionTotalSizeMultiplier: 10.0,\n\t\tCompactionTotalSizeMultiplierPerLevel: nil,\n\t\tComparer: comparer.DefaultComparer,\n\t\tCompression: opt.DefaultCompression,\n\t\tDisableBufferPool: false,\n\t\tDisableBlockCache: false,\n\t\tDisableCompactionBackoff: false,\n\t\tDisableLargeBatchTransaction: false,\n\t\tErrorIfExist: false,\n\t\tErrorIfMissing: false,\n\t\tFilter: nil,\n\t\tIteratorSamplingRate: 1 * 1024 * 1024,\n\t\tNoSync: false,\n\t\tNoWriteMerge: false,\n\t\tOpenFilesCacher: opt.LRUCacher,\n\t\tOpenFilesCacheCapacity: 500,\n\t\tReadOnly: false,\n\t\tStrict: opt.DefaultStrict,\n\t\tWriteBuffer: 16 * 1024 * 1024, // Default is 4 MiB\n\t\tWriteL0PauseTrigger: 12,\n\t\tWriteL0SlowdownTrigger: 8,\n\t}\n\n\tabsPath, err := filepath.Abs(dbDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb, err := leveldb.OpenFile(absPath, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar zeroID record.ID\n\tledger := LevelLedger{\n\t\tldb: db,\n\t\t// FIXME: temporary pulse implementation\n\t\tpulseFn: func() record.PulseNum {\n\t\t\treturn record.PulseNum(time.Now().Unix() / 10)\n\t\t},\n\t\tzeroRef: record.Reference{\n\t\t\tDomain: record.ID{}, // TODO: fill domain\n\t\t\tRecord: zeroID,\n\t\t},\n\t}\n\t_, err = db.Get([]byte(zeroRecordHash), nil)\n\tif err == leveldb.ErrNotFound {\n\t\terr = db.Put([]byte(zeroRecordHash), []byte(zeroRecordBinary), nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &ledger, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ledger, nil\n}", "func NewMgr(ctx context.Context, bc lbcf.ConfigSetting) (*GtwyMgr, error) {\n\tpreflight(ctx, bc)\n\n\tif EnvDebugOn {\n\t\tlblog.LogEvent(\"GtwyMgr\", \"NewMgr\", \"info\", \"start\")\n\t}\n\n\tdatastoreClient, err := datastore.NewClient(ctx, bc.GetConfigValue(ctx, \"EnvGtwayGcpProject\"), option.WithGRPCConnectionPool(EnvClientPool))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcm1 := &GtwyMgr{\n\t\tds: datastoreClient,\n\t\tbc: bc,\n\t}\n\n\tif EnvDebugOn {\n\t\tlblog.LogEvent(\"GtwyMgr\", \"NewMgr\", \"info\", \"end\")\n\t}\n\n\treturn cm1, nil\n}", "func New(gcPercent uint64) *CacheMap {\n\tc := &CacheMap{\n\t\titems: make(map[string]item),\n\t\tgcPercent: gcPercent,\n\t\tnbytes: 0,\n\t}\n\tgo c.GC()\n\treturn c\n}", "func NewLevelDB(name, dir string) (db dbm.DB, err error) {\n\tbackend := dbm.GoLevelDBBackend\n\tif DBBackend == string(dbm.CLevelDBBackend) {\n\t\tbackend = dbm.CLevelDBBackend\n\t}\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terr = fmt.Errorf(\"couldn't create db: %v\", r)\n\t\t}\n\t}()\n\treturn dbm.NewDB(name, backend, dir), err\n}", "func NewLRU(maxEntries int) *LRU {\n\treturn &LRU{\n\t\tmaxEntries: maxEntries,\n\t\tll: list.New(),\n\t\tcache: make(map[interface{}]*list.Element),\n\t}\n}", "func newCache() cache {\n\treturn cache{\n\t\taddressRecords: make(map[addressRecordID]addressRecord),\n\t\tpointerRecords: make(map[serviceInstanceName]pointerRecord),\n\t\tserviceRecords: make(map[serviceInstanceName]serviceRecord),\n\t\ttextRecords: make(map[serviceInstanceName]textRecord),\n\t}\n}", "func (h *Handle) LocalDB() (IDB, error) {\n\tdb := C.alpm_get_localdb(h.ptr)\n\tif db == nil {\n\t\treturn nil, h.LastError()\n\t}\n\n\treturn &DB{db, *h}, nil\n}", "func InitDBM() DBMem {\n\treturn DBMem{\n data: make(map[int]Person),\n history: InitHistoryStore(),\n }\n}", "func New(cb Done, transport http.RoundTripper) *Manager {\n\treturn &Manager{\n\t\tkeys: sets.NewString(),\n\t\tcb: cb,\n\t\ttransport: transport,\n\t}\n}", "func newLdbCacheIter(snap *dbCacheSnapshot, slice *util.Range) *ldbCacheIter {\n\titer := snap.pendingKeys.Iterator(slice.Start, slice.Limit)\n\treturn &ldbCacheIter{Iterator: iter}\n}", "func NewManager(storage *storage.Storage, ledgerIndex iotago.MilestoneIndex) (*Manager, error) {\n\tmanager := &Manager{\n\t\tEvents: &Events{\n\t\t\tNextMilestoneUnsupported: event.New1[*iotago.ProtocolParamsMilestoneOpt](),\n\t\t\tCriticalErrors: event.New1[error](),\n\t\t},\n\t\tstorage: storage,\n\t\tcurrent: nil,\n\t\tpending: nil,\n\t}\n\n\tif err := manager.init(ledgerIndex); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn manager, nil\n}", "func New(size int) *LRU {\r\n\treturn &LRU{\r\n\t\tcache: make(Map),\r\n\t\tlink: list.New(),\r\n\t\tsize: size,\r\n\t}\r\n\r\n}", "func CreateNewCache(fileName string, maxEntry uint64, save bool) *SimpleCache {\n\tcache := &SimpleCache{\n\t\tData: make(map[string]*queueData),\n\t\tFileName: fileName,\n\t\tMaxEntry: maxEntry,\n\t\tQueue: newPriorityQueue(),\n\t\tTTL: -1,\n\t\tLock: new(sync.Mutex),\n\t\tExpiryChannel: make(chan bool),\n\t\tSaveFile: save,\n\t}\n\twg.Add(1)\n\tgo cache.concurrentProcessChecks()\n\treturn cache\n}", "func New(maxEntries int) *Cache {\n\treturn &Cache{\n\t\tmaxEntries: maxEntries,\n\t\tlinkedList: list.New(),\n\t\tcacheByKey: make(map[string]*list.Element),\n\t}\n}", "func New(conf map[string]interface{}) (cache.Cache, error) {\n\tc := &config{}\n\terr := mapstructure.Decode(conf, c)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"lru: error decoding config\")\n\t}\n\tc.init()\n\n\tsvc := &lru{\n\t\tconfig: c,\n\t\tcache: gcache.New(c.Size).LRU().Build(),\n\t}\n\n\treturn svc, nil\n}", "func New(folder string, cfg *Config) (*DB, error) {\n\tenv, err := lmdb.NewEnv()\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"env create failed\")\n\t}\n\n\terr = env.SetMaxDBs(cfg.MaxDBs)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"env config failed\")\n\t}\n\terr = env.SetMapSize(cfg.SizeMbs * 1024 * 1024)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"map size failed\")\n\t}\n\n\tif err = env.SetFlags(cfg.EnvFlags); err != nil {\n\t\treturn nil, errors.Wrap(err, \"set flag\")\n\t}\n\n\tos.MkdirAll(folder, os.ModePerm)\n\terr = env.Open(folder, 0, cfg.Mode)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"open env\")\n\t}\n\n\tvar staleReaders int\n\tif staleReaders, err = env.ReaderCheck(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"reader check\")\n\t}\n\tif staleReaders > 0 {\n\t\tlog.Printf(\"cleared %d reader slots from dead processes\", staleReaders)\n\t}\n\n\tvar dbi lmdb.DBI\n\terr = env.Update(func(txn *lmdb.Txn) (err error) {\n\t\tdbi, err = txn.CreateDBI(\"agg\")\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"create DB\")\n\t}\n\n\treturn &DB{env, dbi}, nil\n\n}", "func NewCache(maxEntries int) *Cache {\r\n\treturn &Cache{\r\n\t\tMaxEntries: maxEntries,\r\n\t\tPurgeInterval: 60,\r\n\t\tll: list.New(),\r\n\t\tcache: make(map[interface{}]*list.Element),\r\n\t}\r\n}", "func NewGlobalManager(key sdk.StoreKey, holder param.ParamHolder) GlobalManager {\n\treturn GlobalManager{\n\t\tstorage: model.NewGlobalStorage(key),\n\t\tparamHolder: holder,\n\t}\n}", "func New(logger *log.Logger, root string) (LDCache, error) {\n\tpath := filepath.Join(root, ldcachePath)\n\n\tlogger.Debugf(\"Opening ld.conf at %v\", path)\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\td, err := syscall.Mmap(int(f.Fd()), 0, int(fi.Size()),\n\t\tsyscall.PROT_READ, syscall.MAP_PRIVATE)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcache := &ldcache{\n\t\tdata: d,\n\t\tReader: bytes.NewReader(d),\n\t\troot: root,\n\t\tlogger: logger,\n\t}\n\treturn cache, cache.parse()\n}", "func NewManager(m project.Manager) *Manager {\n\treturn &Manager{\n\t\tBaseManager: cached.NewBaseManager(cached.ResourceTypeProject),\n\t\tdelegator: m,\n\t\tkeyBuilder: cached.NewObjectKey(cached.ResourceTypeProject),\n\t\tlifetime: time.Duration(config.CacheExpireHours()) * time.Hour,\n\t}\n}", "func NewDBManager(name, path, secret string, batchMode bool, buckets []string) (dbm *DBManager, err error) {\n\tvar info os.FileInfo\n\tif path != \"\" {\n\t\tinfo, err = os.Stat(path)\n\t\tif err != nil || !info.Mode().IsDir() {\n\t\t\terr = ErrPathInvalid\n\t\t\treturn\n\t\t}\n\t}\n\n\tfullPath := filepath.Join(path, name)\n\tinfo, err = os.Stat(fullPath)\n\tif err == nil && !info.Mode().IsRegular() {\n\t\terr = ErrFileNameInvalid\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\tif Debug {\n\t\t\tLogger.Printf(\"NewDBManager DB file %s does not exist, will be created\", fullPath)\n\t\t}\n\t}\n\n\tdbm = &DBManager{\n\t\tname: name,\n\t\tpath: path,\n\t\tfullPath: fullPath,\n\t\tbatchMode: batchMode,\n\t\tbuckets: buckets,\n\t}\n\n\tif err = dbm.SetSecret(secret); err != nil {\n\t\treturn\n\t}\n\n\tif err = dbm.openDB(); err != nil {\n\t\treturn\n\t}\n\tdefer dbm.closeDB()\n\n\treturn\n}", "func NewLRUCache(capacity uint64) Cache {\n return ConstructShardedLRUCache(capacity)\n}", "func newLocalService(config fab.EndpointConfig, mspID string, opts ...coptions.Opt) *LocalService {\n\tlogger.Debug(\"Creating new local discovery service\")\n\n\ts := &LocalService{mspID: mspID}\n\ts.service = newService(config, s.queryPeers, opts...)\n\treturn s\n}", "func New() *LocalStore {\n\treturn &LocalStore{}\n}", "func NewLRUClientSessionCache(capacity int) tls.ClientSessionCache", "func NewCacheL1(executor executor.Executor) executor.Launcher {\n\treturn New(executor, \"stress-ng-cache-l1\", fmt.Sprintf(\"--cache=%d --cache-level=1\", StressngCacheL1ProcessNumber.Value()))\n}", "func New(tracker *bestblock.Tracker, lag int64, config Config) (*Manager, error) {\n\tm := &Manager{\n\t\tconfig: config,\n\t\tlag: lag,\n\t\ttracker: tracker,\n\t\tclosed: false,\n\t\tstopChan: make(chan bool),\n\t}\n\n\tlog.Info(\"setting up redis connection\")\n\tm.redis = redis.NewClient(&redis.Options{\n\t\tAddr: config.RedisServer,\n\t\tPassword: config.RedisPassword,\n\t\tDB: 0,\n\t\tReadTimeout: time.Second * 1,\n\t})\n\n\terr := m.redis.Ping().Err()\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tlog.Info(\"connected to redis successfully\")\n\n\tgo m.watchNewBlocks()\n\n\treturn m, nil\n}", "func NewManager(ps common.PubsubInterface, primaryCapacity int, overflowCapacity int) *Manager {\n\tshelves := map[string]*primaryShelf{\n\t\t\"hot\": NewPrimaryShelf(primaryCapacity),\n\t\t\"cold\": NewPrimaryShelf(primaryCapacity),\n\t\t\"frozen\": NewPrimaryShelf(primaryCapacity),\n\t}\n\toverflow := NewOverflowShelf(overflowCapacity, []string{\"hot\", \"cold\", \"frozen\"})\n\treturn &Manager{shelves, overflow, ps}\n}", "func NewLocalLogger(\n\tprefix LogPrefix,\n\tlevel fw.LogLevel,\n\tstdout fw.StdOut,\n\ttimer fw.Timer,\n\tprogramRuntime fw.ProgramRuntime,\n) mdlogger.Local {\n\treturn mdlogger.NewLocal(string(prefix), level, stdout, timer, programRuntime)\n}", "func NewManager() *Manager {\n\tm := &Manager{\n\t\tPersistenceManager: persistencemanager.NewMapPersistenceManager(),\n\t}\n\n\tm.DeckManager = deck.NewDeckManager(m.PersistenceManager)\n\tm.PileManager = pile.NewPileManager(m.PersistenceManager)\n\n\treturn m\n}", "func New(opts ...Option) *LRU {\n\tl := &LRU{}\n\tfor _, o := range opts {\n\t\to.apply(l)\n\t}\n\tif l.nshards < 1 {\n\t\tl.nshards = 1\n\t}\n\n\tcap := l.cap / l.nshards\n\tl.shards = make([]*shard, l.nshards)\n\tfor i := 0; i < l.nshards; i++ {\n\t\tl.shards[i] = newShard(cap)\n\t}\n\treturn l\n}", "func New(ctx context.Context, m map[string]interface{}) (auth.Manager, error) {\n\tvar mgr manager\n\tif err := mgr.Configure(m); err != nil {\n\t\treturn nil, err\n\t}\n\tgw, err := pool.GetGatewayServiceClient(pool.Endpoint(mgr.c.GatewayAddr))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmgr.gw = gw\n\n\treturn &mgr, nil\n}", "func NewManager(config config.Config) *Manager {\n\ttm := &Manager{config: config}\n\ttm.tasks = make(map[uint64]*task)\n\treturn tm\n}", "func NewManager(r *http.Request) *Manager {\n\tsession := db.GetDBSession(r)\n\treturn &Manager{\n\t\tsession: session,\n\t\tcollection: getCollection(session),\n\t}\n}", "func NewLevelManager(levelFilePath string, seed int64) *LevelManager {\n\tsrc := rand.NewSource(seed)\n\tfmt.Printf(\"Seed: %d\\n\", seed)\n\treturn &LevelManager{\n\t\tfilePath: levelFilePath,\n\t\tlevels: make(map[string]Map),\n\t\trandomSource: rand.New(src),\n\t}\n}", "func NewLocalService(chroot string, routes []Route) *LocalService {\n\treturn &LocalService{\n\t\troutes: routes,\n\t\tchroot: chroot,\n\t\twriteNotifications: make(chan WriteNotification, 100),\n\t}\n}", "func NewHashMap(name string, client *Client) HashMap {\n\treturn HashMap{name: name, c: client}\n}", "func newMapCache(dss map[string]rrd.DataSourcer) *mapCache {\n\tmc := &mapCache{make(map[string]int64), make(map[int64]rrd.DataSourcer)}\n\tvar n int64\n\tfor name, ds := range dss {\n\t\tmc.byName[name] = n\n\t\tmc.byId[n] = ds\n\t\tn++\n\t}\n\treturn mc\n}", "func NewLocal() build_remote.ExecutionCacheServiceServer {\n\tstore, err := action.NewOnDisk()\n\tif err != nil {\n\t\tlog.Fatalf(\"could not initialise ExecutionCacheService: %v\", err)\n\t}\n\treturn &local{store}\n}" ]
[ "0.61819696", "0.60259074", "0.5961291", "0.5807322", "0.5721401", "0.5707583", "0.5698278", "0.5694999", "0.5629836", "0.56234133", "0.5574107", "0.5541237", "0.55317944", "0.55115384", "0.5459979", "0.54501456", "0.54334444", "0.5427154", "0.5390991", "0.5389694", "0.53836066", "0.5377683", "0.5375434", "0.5359582", "0.5353348", "0.53482616", "0.53354025", "0.532056", "0.52916515", "0.5284211", "0.5267258", "0.52604157", "0.5249791", "0.5228152", "0.5224863", "0.5221276", "0.52120644", "0.52001995", "0.5196861", "0.51852506", "0.51667", "0.5150599", "0.5149123", "0.5141555", "0.5139266", "0.5137381", "0.5133383", "0.51201564", "0.510054", "0.5093685", "0.5091284", "0.50773656", "0.5074612", "0.50458926", "0.50408393", "0.5040508", "0.5026618", "0.5025556", "0.5025451", "0.50170404", "0.5016414", "0.50094867", "0.50072575", "0.50024545", "0.49993673", "0.49984893", "0.4990108", "0.497377", "0.4970062", "0.496397", "0.4962606", "0.49600613", "0.49598375", "0.49594772", "0.49562034", "0.4956087", "0.49537534", "0.4952274", "0.49366185", "0.49299285", "0.4926158", "0.49256203", "0.4925532", "0.4925323", "0.49245605", "0.4923184", "0.491709", "0.49153236", "0.49091658", "0.4904808", "0.49046335", "0.48970178", "0.4895718", "0.48948982", "0.48942426", "0.48863786", "0.48685265", "0.48678398", "0.4857144", "0.48541862" ]
0.79498154
0
GetRoot Get root base for the tree.
GetRoot Получает базу корня для дерева.
func (mgr *LocalHashMapDBMgr) GetRoot() (*Base, error) { if mgr.base.RootKey.IsNil() || mgr.base.Degree == 0 { return nil, nil } return &mgr.base, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mt *MerkleTree) GetRoot() {\n\tvar concat string\n\t// if no current transactions, set root to ''\n\tif len(mt.TransactionIDs) == 0 {\n\t\troot := \"\"\n\t\tmt.Root = &root\n\t\treturn\n\t}\n\n\tif len(mt.TransactionIDs) == 1 {\n\t\troot := mt.TransactionIDs[0]\n\t\tmt.Root = &root\n\t} else {\n\t\tconcat = mt.hashPair(mt.TransactionIDs[0], mt.TransactionIDs[1])\n\t\tmt.TransactionIDs = append([]string{concat}, mt.TransactionIDs[2:]...)\n\t\tmt.layers = append(mt.layers, mt.TransactionIDs)\n\t\tmt.GetRoot()\n\t}\n}", "func (t *Tree) Root() *TreeNode {\n\treturn t.root\n}", "func (bst *Bst) Root() *Node {\n\treturn bst.root\n}", "func (r Ctx) GetRoot() string {\n\treturn r[RootKey].(string)\n}", "func (t *tree) Root() *node {\n\treturn t.root\n}", "func (t *Tree) Root() *node {\n\treturn t.root\n}", "func (r *RouterEventFilter) getRoot(ctx context.Context, rootId string) *tree.Node {\n\n\tif node, ok := r.RootNodesCache.Get(rootId); ok {\n\t\treturn node.(*tree.Node)\n\t}\n\tresp, e := r.pool.GetTreeClient().ReadNode(ctx, &tree.ReadNodeRequest{Node: &tree.Node{Uuid: rootId}})\n\tif e == nil && resp.Node != nil {\n\t\tr.RootNodesCache.Set(rootId, resp.Node.Clone(), cache.DefaultExpiration)\n\t\treturn resp.Node\n\t}\n\treturn nil\n\n}", "func (mt *merkleTreeImp) GetRootNode() Node {\n\treturn mt.root\n}", "func (fs *FS) Root() (fspkg.Node, error) {\n\tte, ok := fs.r.Lookup(\"\")\n\tif !ok {\n\t\treturn nil, errors.New(\"failed to find root in stargz\")\n\t}\n\treturn &node{fs, te}, nil\n}", "func (b *BinarySearch) Root() *BinarySearchNode {\n\treturn b.root\n}", "func (c *Client) GetRoot() (*RootOutput, *ErrorOutput) {\n\toutput := new(RootOutput)\n\terrorOutput := c.sendAPIRequest(\"GET\", \"\", nil, output)\n\treturn output, errorOutput\n}", "func (fs *FS) Root() (fs.Node, error) {\n\tfs.μ.RLock()\n\tdefer fs.μ.RUnlock()\n\treturn fs.rnode, nil\n}", "func (n *NamespacedMerkleTree) Root() []byte {\n\tif n.rawRoot == nil {\n\t\tn.rawRoot = n.computeRoot(0, len(n.leaves))\n\t}\n\treturn n.rawRoot\n}", "func (a *AST) GetRoot() AST {\n\tif a.RootToken {\n\t\treturn *a\n\t}\n\n\tif len(a.Children) == 0 {\n\t\treturn AST{}\n\t}\n\n\treturn a.Children[0]\n}", "func (n *NodeBuilder) Root() *TagNode {\n\treturn n.root\n}", "func (e *Environment) GetRoot() Namespace {\n\treturn e.Get(RootDomain, func() Namespace {\n\t\treturn e.New(RootDomain)\n\t})\n}", "func (dfs *DaosFileSystem) Root() *DaosNode {\n\treturn dfs.root\n}", "func (c *Container) Root() *Root {\n\treturn c.root\n}", "func (db *Database) Root() *doltdb.RootValue {\n\treturn db.root\n}", "func (r *Root) Root() (fs.Node, error) {\n\treturn newDir(nil, r.registry), nil\n}", "func (agent *MerkleAgent) Root() []byte {\n\treturn agent.root\n}", "func (r *Root) Root() (fs.Node, error) {\n\tdebug.Log(\"Root()\")\n\treturn r, nil\n}", "func (m *SiteCollection) GetRoot()(Rootable) {\n return m.root\n}", "func (this *Heap[T]) GetRoot() (data T, ok bool) {\n\tif len(this.datas) > 0 {\n\t\treturn this.datas[0], true\n\t}\n\treturn\n}", "func (tree *tree) Root() *zipkincore.Span {\n\tnodes := tree.nodes[0]\n\tif len(nodes) == 1 {\n\t\treturn nodes[0]\n\t} else {\n\t\treturn nil\n\t}\n}", "func (p *ancestorTree) GetRoot(blkID ids.ID) ids.ID {\n\tfor {\n\t\tparentID, ok := p.childToParent[blkID]\n\t\t// this is the furthest parent available, break loop and return blkID\n\t\tif !ok {\n\t\t\treturn blkID\n\t\t}\n\t\t// continue to loop with parentID\n\t\tblkID = parentID\n\t}\n}", "func (mt *merkleTreeImp) GetRootHash() []byte {\n\tif mt.root == nil {\n\t\treturn EmptyTreeRootHash\n\t}\n\treturn mt.root.getNodeHash()\n\n}", "func (s *ShortenBlock) GetRootID() string {\n\treturn s.tree.id\n}", "func (n Node) GetRoot() Node {\n\tif n.Parent == nil {\n\t\treturn n\n\t}\n\n\treturn n.Parent.GetRoot()\n}", "func (l *Loader) Root() *ecsgen.Root {\n\treturn l.root\n}", "func (fs HgmFs) Root() (fs.Node, error) {\n\treturn &HgmDir{hgmFs: fs, localDir: \"/\"}, nil\n}", "func (t *BinaryTree) RootValue() interface{} { return t.root.value }", "func (db *Database) Root() *Group {\n\treturn db.root\n}", "func (w *RootWalker) Root() *Root {\n\treturn w.r\n}", "func (tb *TreeBuilder) Root() (Node, error) {\n\tif len(tb.levels) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tif len(tb.levels[0].Chunks) > 0 {\n\t\tfor i := 0; i < len(tb.levels)-1; i++ {\n\t\t\tvar n Node = tb.levels[i]\n\t\t\tif tb.F != nil {\n\t\t\t\tvar err error\n\t\t\t\tn, err = tb.F(tb.levels[i])\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\ttb.levels[i+1].Nodes = append(tb.levels[i+1].Nodes, n)\n\t\t\ttb.levels[i] = nil // help the gc reclaim memory sooner, maybe\n\t\t}\n\t}\n\n\t// Don't necessarily return the highest node in tb.levels.\n\t// We can prune any would-be root nodes that have only one child.\n\n\t// If we _are_ going to return tb.levels[len(tb.levels)-1],\n\t// we have to call tb.F on it.\n\t// If we're not, we don't:\n\t// tb.F has already been called on all other nodes.\n\n\tif len(tb.levels) == 1 {\n\t\tvar result Node = tb.levels[0]\n\t\tif tb.F != nil {\n\t\t\treturn tb.F(tb.levels[0])\n\t\t}\n\t\treturn result, nil\n\t}\n\n\ttop := tb.levels[len(tb.levels)-1]\n\tif len(top.Nodes) > 1 {\n\t\tif tb.F != nil {\n\t\t\treturn tb.F(top)\n\t\t}\n\t\treturn top, nil\n\t}\n\n\tvar (\n\t\troot Node = top\n\t\terr error\n\t)\n\tfor root.NumChildren() == 1 {\n\t\troot, err = root.Child(0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn root, nil\n}", "func (r *RPCClient) Root() (t *RPCClientRoot) {\n\treturn &RPCClientRoot{r}\n}", "func (el *Tree) Root() *Tree {\n\tif el.Parent() == nil {\n\t\treturn el\n\t}\n\t\n\treturn el.Parent().Root()\n}", "func (v *VaultFS) Root() (fs.Node, error) {\n\tlogrus.Debug(\"returning root\")\n\treturn NewRoot(v.root, v.Logical()), nil\n}", "func GetRoot(dbPath string) (data db.Data, code int, err error) {\n\tif _, ok := allDB[dbPath]; !ok {\n\t\treturn data, http.StatusBadRequest, errors.New(\"There's no any db with such path (\" + dbPath + \")\")\n\t}\n\n\tdata, err = allDB[dbPath].GetRoot()\n\tif err != nil {\n\t\treturn data, http.StatusInternalServerError, err\n\t}\n\n\treturn data, http.StatusOK, nil\n}", "func (fs *Ossfs) Root() *ossInode {\n\treturn fs.root\n}", "func (bn *ObjList) GetRoot() (address *obj_container, obj *Object) {\n\n\tbn.lock.MinLock()\n\tif bn.root == nil {\n\t\t// log.Println(\"ObjBank>> GetRoot was called while ObjList was empty\")\n\t\tbn.lock.MinUnlock()\n\t\treturn nil, nil\n\t}\n\taddress, obj = bn.root, bn.root.data\n\tbn.lock.MinUnlock()\n\treturn\n}", "func (k *KeyTransactions) Root() []byte {\n\treturn k.root\n}", "func (d *Document) Root() Node {\n\treturn Node{0, d.rev, d}\n}", "func (m *Drive) GetRoot()(DriveItemable) {\n return m.root\n}", "func (p *Parser) Root() *FileNode {\n\treturn p.nod\n}", "func (f *FS) Root() (fs.Node, error) {\n\treturn &Node{fs: f}, nil\n}", "func (r *router) Root() *OpenAPI {\n\treturn r.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (f *Fs) Root() string {\n\treturn f.root\n}", "func (l *loaderImpl) Root() string {\n\treturn l.root\n}", "func (_ZKOnacci *ZKOnacciCaller) Root(opts *bind.CallOpts) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _ZKOnacci.contract.Call(opts, &out, \"root\")\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "func (g *Graph) Root() *Node {\n\treturn g.Nodes[0]\n}", "func (nf *NavigationFactory) Root() string {\n\treturn nf.rootPath\n}", "func getRoot(b Builder) Builder {\n\tfor {\n\t\tp := b.GetParent()\n\t\tif p == nil {\n\t\t\treturn b\n\t\t}\n\t\tb = p\n\t}\n}", "func (T *SparseMerkleTree) GetLatestRoot() (string) {\n\trootDigest, _ := T.getLatestNode(\"\")\n\treturn base64.StdEncoding.EncodeToString(rootDigest)\n}", "func (node *Node) Root() *Node {\n\tfor node.Parent != nil {\n\t\tnode = node.Parent\n\t}\n\treturn node\n}", "func (cmd *Command) Root() *Command {\n\tif cmd.parent == nil {\n\t\treturn cmd\n\t}\n\n\treturn cmd.parent.Root()\n}", "func GetRoot(store store.Store, id string) Root { return GetFromCache(store, id).(Root) }", "func GetRootCommand() *cobra.Command { return rootCmd }", "func (t *Tree) GetRootData() int {\n\treturn t.Root.Data\n}", "func (x *Indexer) Root() string {\n\treturn x.config.IndexRoot\n}", "func (lt *LinkedTreeNode) GetRootNode() (*LinkedTreeNode, error) {\n\treturn lt.getRootNode()\n}", "func (obj *language) Root() string {\n\treturn obj.root\n}", "func (adder *Adder) curRootNode() (ipld.Node, error) {\n\tmr, err := adder.mfsRoot()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\troot, err := mr.GetDirectory().GetNode()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// if one root file, use that hash as root.\n\tif len(root.Links()) == 1 {\n\t\tnd, err := root.Links()[0].GetNode(adder.ctx, adder.dagService)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\troot = nd\n\t}\n\n\treturn root, err\n}", "func (l *fileLoader) Root() string {\n\treturn l.root\n}", "func (f *Forest) Root() *RuleNode {\n\tif f == nil || len(f.symbolNodes) == 0 {\n\t\treturn nil\n\t}\n\treturn &RuleNode{\n\t\tsymbol: f.root,\n\t}\n}", "func (p *Project) Root() string {\n\treturn p.root\n}", "func root(n uint) uint {\n\tw := nodeWidth(n)\n\treturn uint((1 << log2(w)) - 1)\n}", "func (cache *ContentCache) Root() string {\n\treturn cache.root\n}", "func Root(name, path string) *TRoot {\n\tvar tmpl = &Template{template.New(name), name}\n\tvar t = &TRoot{tmpl, path}\n\n\treturn t\n}", "func (a *API) getRoot(w http.ResponseWriter, r *http.Request) {\n\tout := map[string]string{\n\t\t\"apiName\": \"rutte-api\",\n\t\t\"apiDescription\": \"API's for voting platform\",\n\t\t\"apiVersion\": \"v0.0\",\n\t\t\"appVersion\": version.String(),\n\t}\n\trender.JSON(w, r, out)\n}", "func GetRoot(t pb.Trace) *pb.Span {\n\t// That should be caught beforehand\n\tif len(t) == 0 {\n\t\treturn nil\n\t}\n\t// General case: go over all spans and check for one which matching parent\n\tparentIDToChild := map[uint64]*pb.Span{}\n\n\tfor i := range t {\n\t\t// Common case optimization: check for span with ParentID == 0, starting from the end,\n\t\t// since some clients report the root last\n\t\tj := len(t) - 1 - i\n\t\tif t[j].ParentID == 0 {\n\t\t\treturn t[j]\n\t\t}\n\t\tparentIDToChild[t[j].ParentID] = t[j]\n\t}\n\n\tfor i := range t {\n\t\tdelete(parentIDToChild, t[i].SpanID)\n\t}\n\n\t// Here, if the trace is valid, we should have len(parentIDToChild) == 1\n\tif len(parentIDToChild) != 1 {\n\t\tlog.Debugf(\"Didn't reliably find the root span for traceID:%v\", t[0].TraceID)\n\t}\n\n\t// Have a safe behavior if that's not the case\n\t// Pick the first span without its parent\n\tfor parentID := range parentIDToChild {\n\t\treturn parentIDToChild[parentID]\n\t}\n\n\t// Gracefully fail with the last span of the trace\n\treturn t[len(t)-1]\n}", "func (a *AttesterSlashing) HashTreeRoot() ([32]byte, error) {\n\treturn ssz.HashWithDefaultHasher(a)\n}", "func (kh kelvinHandler) GetBase() string {\n\treturn scaleToText(kh.Base)\n}", "func (tree *DNFTree) CreateRoot(phi br.ClauseSet, isFinal bool) int {\n\treturn tree.CreateNodeEntry(phi, 0, isFinal)\n}", "func (v *GenerateServiceRequest) GetThriftRoot() (o string) {\n\tif v != nil {\n\t\to = v.ThriftRoot\n\t}\n\treturn\n}", "func baseForRoot(root interface{}, cache ResolutionCache) string {\n\tif root == nil {\n\t\treturn \"\"\n\t}\n\n\t// cache the root document to resolve $ref's\n\tnormalizedBase := normalizeBase(rootBase)\n\tcache.Set(normalizedBase, root)\n\n\treturn normalizedBase\n}", "func (s *SVFS) Root() (fs.Node, error) {\n\t// Mount a specific container\n\tif TargetContainer != \"\" {\n\t\tbaseContainer, _, err := SwiftConnection.Container(TargetContainer)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Find segment container too\n\t\tsegmentContainerName := TargetContainer + SegmentContainerSuffix\n\t\tsegmentContainer, _, err := SwiftConnection.Container(segmentContainerName)\n\n\t\t// Create it if missing\n\t\tif err == swift.ContainerNotFound {\n\t\t\tvar container *swift.Container\n\t\t\tcontainer, err = createContainer(segmentContainerName)\n\t\t\tsegmentContainer = *container\n\t\t}\n\t\tif err != nil && err != swift.ContainerNotFound {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &Container{\n\t\t\tDirectory: &Directory{\n\t\t\t\tapex: true,\n\t\t\t\tc: &baseContainer,\n\t\t\t\tcs: &segmentContainer,\n\t\t\t},\n\t\t}, nil\n\t}\n\n\t// Mount all containers within an account\n\treturn &Root{\n\t\tDirectory: &Directory{\n\t\t\tapex: true,\n\t\t},\n\t}, nil\n}", "func (fr *fakeRequest) Root() cid.Cid {\n\treturn fr.root\n}", "func (s *StateDB) RootHash() *corecrypto.HashType {\n\treturn s.trie.RootHash()\n}", "func (obj *file) Root() string {\n\treturn obj.root\n}", "func (tree *LinkedTree) GetRootNode() (*LinkedTreeNode, error) {\n\ttree.mux.Lock()\n\tdefer tree.mux.Unlock()\n\tif tree.root != nil {\n\t\treturn tree.root, nil\n\t}\n\treturn nil, fmt.Errorf(\"Can't get a node from a tree without a root node\")\n}", "func (s *Server) GetStateRoot() stateroot.Service {\n\treturn s.stateRoot\n}", "func (t *BalanceTable) Root() (cid.Cid, error) {\n\treturn (*Map)(t).Root()\n}", "func (b *BTree) GetRootNodeRef() *storageref.StorageRef {\n\tb.mtx.Lock()\n\tdefer b.mtx.Unlock()\n\n\treturn b.rootNodRef\n}", "func (f *FileSystem) Root() (fs.Node, error) {\n\tf.logger.Debugf(\"Root() request\\n\")\n\n\troot, err := f.get(nil, 0)\n\tif err != nil {\n\t\tf.logger.Printf(\"Root failed: %v\\n\", err)\n\t\treturn nil, fuse.EIO\n\t}\n\n\taccount, err := f.putio.Account.Info(nil)\n\tif err != nil {\n\t\tf.logger.Debugf(\"Fetching account info failed: %v\\n\", err)\n\t\treturn nil, fuse.EIO\n\t}\n\tf.account = account\n\n\treturn &Dir{\n\t\tfs: f,\n\t\tFile: &root,\n\t}, nil\n}", "func (s *Session) Root() Rootable {\n\n\treturn s.root\n}", "func (db *DB) GetStateRoot() (core.UserState, error) {\n\tvar state core.UserState\n\terr := db.Instance.Scopes(QueryByType(core.TYPE_ROOT), QueryByDepth(0)).Find(&state).Error\n\tif err != nil {\n\t\treturn state, core.ErrRecordNotFound(fmt.Sprintf(\"unable to find record. err:%v\", err))\n\t}\n\treturn state, nil\n}", "func (f *FileList) Root() string {\n\treturn f.root\n}", "func (q *pathCompression) Root(r int) int {\n\tfor {\n\t\tif r == q.IDs[r] {\n\t\t\tbreak\n\t\t}\n\t\tq.IDs[r] = q.IDs[q.IDs[r]]\n\t\tr = q.IDs[r]\n\t}\n\treturn r\n}", "func (f *Filler) Root() *Root {\n\treturn f.r\n}", "func GetRootLanguageTag(t language.Tag) language.Tag {\n\tfor {\n\t\tparent := t.Parent()\n\t\tif parent == language.Und {\n\t\t\treturn t\n\t\t}\n\t\tt = parent\n\t}\n}", "func (sc *TraceScope) Root() *TraceScope {\n\treturn sc.top\n}", "func (c Cache) Root() Path {\n\treturn c.Join(\"root\")\n}", "func (un Decoder) Root() dom.Node {\n\tfor n := un.Node; n != nil; n = n.Parent() {\n\t\tif n.Parent() == nil {\n\t\t\treturn n\n\t\t}\n\t}\n\treturn nil\n}" ]
[ "0.72971463", "0.6967713", "0.6905524", "0.68161714", "0.6813087", "0.6761039", "0.6685708", "0.6630886", "0.66104454", "0.6586958", "0.6486263", "0.6472821", "0.64700806", "0.6454522", "0.64251405", "0.6360517", "0.6333982", "0.6299451", "0.6248249", "0.62472093", "0.6242822", "0.62346697", "0.6232892", "0.62168634", "0.6212113", "0.6207682", "0.62062746", "0.6195026", "0.6172461", "0.61615133", "0.61168766", "0.6110793", "0.6061909", "0.6050642", "0.60393095", "0.6035057", "0.6034974", "0.6031947", "0.6014249", "0.6000308", "0.599112", "0.5989138", "0.598202", "0.59637", "0.59278274", "0.59157616", "0.5911425", "0.5896549", "0.5896549", "0.5896549", "0.5896549", "0.5896549", "0.5896549", "0.5896549", "0.58923125", "0.58611125", "0.5859474", "0.5849432", "0.583758", "0.5836774", "0.5828033", "0.5814039", "0.5810767", "0.58036244", "0.5800528", "0.57905126", "0.57740045", "0.57715636", "0.5763361", "0.5734202", "0.57224345", "0.5719554", "0.57182366", "0.5705077", "0.5704783", "0.5700256", "0.56759644", "0.5657907", "0.56546247", "0.56453687", "0.5637345", "0.5633382", "0.5618613", "0.5611757", "0.5606504", "0.55952126", "0.5568897", "0.5556989", "0.5552695", "0.5543489", "0.55280066", "0.55269605", "0.55251473", "0.55214894", "0.5518078", "0.55075955", "0.55004364", "0.55002445", "0.54959315", "0.54817635" ]
0.7211411
1
SetRoot Set root base for the tree.
SetRoot Устанавливает корневую базу для дерева.
func (mgr *LocalHashMapDBMgr) SetRoot(base *Base) error { mgr.base.Degree = base.Degree mgr.base.RootKey = base.RootKey return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func SetRoot(path string) {\n\trootPath = path\n}", "func (db *Database) SetRoot(newRoot *doltdb.RootValue) {\n\t// TODO: races\n\tdb.root = newRoot\n}", "func (m *SiteCollection) SetRoot(value Rootable)() {\n m.root = value\n}", "func (f *FileList) SetRoot(path string) {\n\tf.root = path\n}", "func (api *Client) SetRoot(RootURL string) *Client {\n\tapi.mu.Lock()\n\tdefer api.mu.Unlock()\n\tapi.rootURL = RootURL\n\treturn api\n}", "func (cfg *Config) SetRoot(root string) *Config {\n\tcfg.RootDir = root\n\treturn cfg\n}", "func (c *Container) SetRoot(root *Root) (ok bool) {\n\tif root == nil {\n\t\tpanic(ErrMissingRoot)\n\t}\n\tif c.root == nil {\n\t\tc.root, ok = root, true\n\t\treturn\n\t}\n\tif c.root.Time < root.Time {\n\t\tc.root, ok = root, true\n\t}\n\treturn\n}", "func (m *Drive) SetRoot(value DriveItemable)() {\n m.root = value\n}", "func (a *Application) SetRoot(root Primitive, fullscreen bool) *Application {\n\ta.Lock()\n\ta.root = root\n\ta.rootFullscreen = fullscreen\n\tif a.screen != nil {\n\t\ta.screen.Clear()\n\t}\n\ta.Unlock()\n\n\ta.SetFocus(root)\n\n\treturn a\n}", "func (f *Fs) setRoot(root string) {\n\tf.root = strings.Trim(root, \"/\")\n\tf.slashRoot = \"/\" + f.root\n\tf.slashRootSlash = f.slashRoot\n\tif f.root != \"\" {\n\t\tf.slashRootSlash += \"/\"\n\t}\n}", "func (c *Compiler) SetAstRoot(root Node) {\n\tc.ast = root\n}", "func (s *EnablePolicyTypeOutput) SetRoot(v *Root) *EnablePolicyTypeOutput {\n\ts.Root = v\n\treturn s\n}", "func (s *DisablePolicyTypeOutput) SetRoot(v *Root) *DisablePolicyTypeOutput {\n\ts.Root = v\n\treturn s\n}", "func (ft *functionTree) setRoot(f *function) error {\n\tif ft.root != nil {\n\t\treturn errors.New(\"setRoot: root already exists\")\n\t}\n\tft.root = f\n\treturn nil\n}", "func SetRootNode(node []byte, isRoot bool) {\n\tvar IsRootNodeField *uint8 = (*uint8)(unsafe.Pointer(&node[IsRootNodeOffset]))\n\tif isRoot {\n\t\t*IsRootNodeField = 1\n\t} else {\n\t\t*IsRootNodeField = 0\n\t}\n}", "func SetRootDirectory(rootDirectory string) {\n\troot = rootDirectory\n\tif root[len(root)-1] != '/' {\n\t\troot += \"/\"\n\t}\n\tlog.Println(\"Set root directory to : '\" + root + \"'\")\n}", "func (bb *BlockBuilder) SetStateRoot(root cid.Cid) {\n\tbb.block.ParentStateRoot = root\n}", "func (_m *MockDataCoord) SetRootCoord(rootCoord types.RootCoord) {\n\t_m.Called(rootCoord)\n}", "func (m *RestaurantMutation) SetRootID(id int) {\n\tm.root = &id\n}", "func (bb *BlockBuilder) SetStateRoot(root cid.Cid) {\n\tbb.block.StateRoot = root\n}", "func (b *Builder) SetStateRoot(h hash.Hash32B) *Builder {\n\tb.blk.Header.stateRoot = h\n\treturn b\n}", "func (t *Tree) UpdateRoot(p *Pos, model ModelInterface) {\n\tif t.p == nil || t.p.Hash() != p.Hash() {\n\t\tt.p = p\n\t\tt.root = t.NewTreeNode(nil, 0, false, 1, true)\n\t\tt.root.rootify(p, model)\n\t}\n}", "func SetRootPrefix(prefix string) {\n\trootPrefix = prefix\n}", "func (node *DataNode) SetRootCoord(rc types.RootCoord) error {\n\tswitch {\n\tcase rc == nil, node.rootCoord != nil:\n\t\treturn errors.New(\"nil parameter or repeatedly set\")\n\tdefault:\n\t\tnode.rootCoord = rc\n\t\treturn nil\n\t}\n}", "func (s *State) SetRootKey(rootKey session.RootKeyable) {\n\ts.rootKey = rootKey.(*root.Key)\n}", "func (d *VirtualDom) SetRootNode(node Node) {\n\tswitch node.(type) {\n\tcase string:\n\t\td.RootNode = node\n\tcase *ElementNode:\n\t\td.RootNode = node\n\tcase Component:\n\t\td.RootNode = node\n\tdefault:\n\t\tpanic(\"invalid dom node\")\n\t}\n}", "func (_e *MockDataCoord_Expecter) SetRootCoord(rootCoord interface{}) *MockDataCoord_SetRootCoord_Call {\n\treturn &MockDataCoord_SetRootCoord_Call{Call: _e.mock.On(\"SetRootCoord\", rootCoord)}\n}", "func (adder *Adder) SetMfsRoot(r *mfs.Root) {\n\tadder.mroot = r\n}", "func (fs *fsMutable) initRoot() (err error) {\n\t_, found := fs.lookupTree.Get(formKey(fuseops.RootInodeID))\n\tif found {\n\t\treturn\n\t}\n\terr = fs.createNode(\n\t\tformLookupKey(fuseops.RootInodeID, rootPath),\n\t\tfuseops.RootInodeID,\n\t\trootPath,\n\t\tnil,\n\t\tfuseutil.DT_Directory,\n\t\ttrue)\n\treturn\n}", "func (m *RestaurantMutation) ResetRoot() {\n\tm.root = nil\n\tm.clearedroot = false\n}", "func (_e *MockQueryCoord_Expecter) SetRootCoord(rootCoord interface{}) *MockQueryCoord_SetRootCoord_Call {\n\treturn &MockQueryCoord_SetRootCoord_Call{Call: _e.mock.On(\"SetRootCoord\", rootCoord)}\n}", "func SetRootHandler(path string) {\n\troothandlerpath = path\n}", "func (c *Container) SetEncodedRoot(data []byte) (ok bool, err error) {\n\tvar root *Root\n\tif root, err = decodeRoot(data); err != nil {\n\t\treturn\n\t}\n\tok = c.SetRoot(root)\n\treturn\n}", "func (self *StateObject) updateRoot(db trie.Database) {\n\tself.updateTrie(db)\n\tself.data.Root = self.trie.Hash()\n}", "func (obj *StateObject) updateRoot(db Database) {\n\tobj.updateTrie(db)\n\tobj.data.StorageRoot = obj.trie.Hash()\n}", "func ExtendRoot(overrides RootIface) *Root {\n\tjsiiID, err := jsii.GlobalRuntime.Client().Create(\n\t\t\"jsii$cdk$0.0.0.Root\",\n\t\t[]interface{}{},\n\t\tnil,\n\t)\n\tif err != nil {\n\t\tpanic(\"how are error handled?\" + err.Error())\n\t}\n\treturn &Root{\n\t\tbase: jsii.Base{ID: jsiiID},\n\t\tConstruct: InternalNewConstructAsBaseClass(jsiiID),\n\t}\n}", "func (tp *Template) Root(name string) *Template {\n\ttp.root = name\n\treturn tp\n}", "func (delegateObject *delegateObject) updateRoot(db Database) {\n\tdelegateObject.updateTrie(db)\n\tdelegateObject.data.Root = delegateObject.trie.Hash()\n}", "func (mt *MerkleTree) GetRoot() {\n\tvar concat string\n\t// if no current transactions, set root to ''\n\tif len(mt.TransactionIDs) == 0 {\n\t\troot := \"\"\n\t\tmt.Root = &root\n\t\treturn\n\t}\n\n\tif len(mt.TransactionIDs) == 1 {\n\t\troot := mt.TransactionIDs[0]\n\t\tmt.Root = &root\n\t} else {\n\t\tconcat = mt.hashPair(mt.TransactionIDs[0], mt.TransactionIDs[1])\n\t\tmt.TransactionIDs = append([]string{concat}, mt.TransactionIDs[2:]...)\n\t\tmt.layers = append(mt.layers, mt.TransactionIDs)\n\t\tmt.GetRoot()\n\t}\n}", "func (in *ActionExportCreateInput) SetRootSquash(value bool) *ActionExportCreateInput {\n\tin.RootSquash = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"RootSquash\"] = nil\n\treturn in\n}", "func (g *Graph) UpdateRoot(root Transaction) {\n\tptr := &root\n\n\tg.Lock()\n\n\tg.depthIndex[root.Depth] = append(g.depthIndex[root.Depth], ptr)\n\tg.eligibleIndex.ReplaceOrInsert((*sortByDepthTX)(ptr))\n\n\tg.transactions[root.ID] = ptr\n\n\tif g.indexer != nil {\n\t\tg.indexer.Index(hex.EncodeToString(root.ID[:]))\n\t}\n\n\tg.height = root.Depth + 1\n\n\tg.Unlock()\n\n\tg.UpdateRootDepth(root.Depth)\n}", "func (n *TreeNode) rootify(p *Pos, model ModelInterface) {\n\tn.step = 0\n\tn.side = 1\n\tn.first = true\n\tn.parent = nil\n\tn.children = n.children[:0]\n\tn.Expand(p, model)\n}", "func (d *Deployer) setRootID(f *v1.FilterSpec) error {\n\tif f.RootID != \"\" {\n\t\treturn nil\n\t}\n\trootId, err := d.getRootId(f.Image)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.RootID = rootId\n\treturn nil\n}", "func Root(name, path string) *TRoot {\n\tvar tmpl = &Template{template.New(name), name}\n\tvar t = &TRoot{tmpl, path}\n\n\treturn t\n}", "func (t *Tree) Root() *TreeNode {\n\treturn t.root\n}", "func (tree *DNFTree) CreateRoot(phi br.ClauseSet, isFinal bool) int {\n\treturn tree.CreateNodeEntry(phi, 0, isFinal)\n}", "func (bst *Bst) Root() *Node {\n\treturn bst.root\n}", "func NewRoot() *Root {\n\treturn ExtendRoot(nil)\n}", "func (g *Generator) SetRootfsType(rootfsType string) {\n\tg.image.RootFS.Type = rootfsType\n}", "func (log Logger) Root(root Data) Logger {\n\tnewRoot := Data{}\n\tfor k, v := range log.root {\n\t\tnewRoot[k] = v\n\t}\n\tfor k, v := range root {\n\t\tnewRoot[k] = v\n\t}\n\tlog.root = newRoot\n\treturn log\n}", "func (s *EnablePolicyTypeInput) SetRootId(v string) *EnablePolicyTypeInput {\n\ts.RootId = &v\n\treturn s\n}", "func NewRoot() *Root {\n\tr := new(Root)\n\tr.objects.init(8)\n\tr.idCache = make(map[int]libFldDoc)\n\tr.missing = make(map[int]libFldDoc)\n\treturn r\n}", "func (a *AttesterSlashing) HashTreeRoot() ([32]byte, error) {\n\treturn ssz.HashWithDefaultHasher(a)\n}", "func (r *Root) Root() (fs.Node, error) {\n\treturn newDir(nil, r.registry), nil\n}", "func Root(appName, version string) (opt *RootCmdOpt) {\n\troot := &RootCommand{AppName: appName, Version: version, Command: Command{BaseOpt: BaseOpt{Name: appName}}}\n\t// rootCommand = root\n\topt = RootFrom(root)\n\treturn\n}", "func Root(appName, version string) (opt *RootCmdOpt) {\n\troot := &RootCommand{AppName: appName, Version: version, Command: Command{BaseOpt: BaseOpt{Name: appName}}}\n\t// rootCommand = root\n\topt = RootFrom(root)\n\treturn\n}", "func (hi *HandshakeInfo) SetRootCertProvider(root certprovider.Provider) {\n\thi.mu.Lock()\n\thi.rootProvider = root\n\thi.mu.Unlock()\n}", "func (s *DisablePolicyTypeInput) SetRootId(v string) *DisablePolicyTypeInput {\n\ts.RootId = &v\n\treturn s\n}", "func (repo *Repo) LinkRoot() {\n\trepo.Root = repo\n\tLinkTo(repo.Externals, repo)\n}", "func (r *Root) Root() (fs.Node, error) {\n\tdebug.Log(\"Root()\")\n\treturn r, nil\n}", "func (a *ActStatus) SetTrieRoot(stateRoot arry.Hash) error {\n\treturn a.db.SetRoot(stateRoot)\n}", "func (s *DjangoEngine) RootDir(root string) *DjangoEngine {\n\tif s.fs != nil && root != \"\" && root != \"/\" && root != \".\" && root != s.rootDir {\n\t\tsub, err := fs.Sub(s.fs, s.rootDir)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\ts.fs = sub // here so the \"middleware\" can work.\n\t}\n\n\ts.rootDir = filepath.ToSlash(root)\n\treturn s\n}", "func (t *tree) Root() *node {\n\treturn t.root\n}", "func (stateObj *stateObject) updateRoot(db StateDatabase) {\n\t// If nothing changed, don't bother with hashing anything\n\tif stateObj.updateTrie(db) == nil {\n\t\treturn\n\t}\n\t// Track the amount of time wasted on hashing the storage trie\n\tif metrics.EnabledExpensive {\n\t\tdefer func(start time.Time) { stateObj.db.StorageHashes += time.Since(start) }(time.Now())\n\t}\n\tstateObj.data.Root = stateObj.trie.Hash()\n}", "func InternalNewRootAsBaseClass(jsiiID string) *Root {\n\treturn &Root{\n\t\tbase: jsii.Base{ID: jsiiID},\n\t\tConstruct: InternalNewConstructAsBaseClass(jsiiID),\n\t}\n}", "func (b *Bst) Reset() {\n b.root = nil\n}", "func (fs *FS) Root() (fspkg.Node, error) {\n\tte, ok := fs.r.Lookup(\"\")\n\tif !ok {\n\t\treturn nil, errors.New(\"failed to find root in stargz\")\n\t}\n\treturn &node{fs, te}, nil\n}", "func (w *RootWalker) Root() *Root {\n\treturn w.r\n}", "func (self *Map) SetRootTagName(root string) {\n\tself.rootTagName = root\n}", "func (fs HgmFs) Root() (fs.Node, error) {\n\treturn &HgmDir{hgmFs: fs, localDir: \"/\"}, nil\n}", "func (dfs *DaosFileSystem) Root() *DaosNode {\n\treturn dfs.root\n}", "func (n *NamespacedMerkleTree) Root() []byte {\n\tif n.rawRoot == nil {\n\t\tn.rawRoot = n.computeRoot(0, len(n.leaves))\n\t}\n\treturn n.rawRoot\n}", "func NewSetRootResourceReference(receiver, runtime string) New {\n\treturn func(f *jen.File, o types.Object) {\n\t\tf.Commentf(\"SetResourceReference of this %s.\", o.Name())\n\t\tf.Func().Params(jen.Id(receiver).Op(\"*\").Id(o.Name())).Id(\"SetResourceReference\").Params(jen.Id(\"r\").Qual(runtime, \"TypedReference\")).Block(\n\t\t\tjen.Id(receiver).Dot(\"ResourceReference\").Op(\"=\").Id(\"r\"),\n\t\t)\n\t}\n}", "func (f *Pub) UseRoot(rx Publisher) {\n\tf.roots.Add(rx)\n}", "func (t *Tree) InitTree(val int) {\n\tt.Root = initNode(val)\n}", "func ReleaseRoot(oldUID int) error {\n\treturn syscall.Setuid(oldUID)\n}", "func (c *Container) Root() *Root {\n\treturn c.root\n}", "func NewRoot(repo restic.Repository, cfg Config) *Root {\n\tdebug.Log(\"NewRoot(), config %v\", cfg)\n\n\troot := &Root{\n\t\trepo: repo,\n\t\tcfg: cfg,\n\t\tblobCache: bloblru.New(blobCacheSize),\n\t}\n\n\tif !cfg.OwnerIsRoot {\n\t\troot.uid = uint32(os.Getuid())\n\t\troot.gid = uint32(os.Getgid())\n\t}\n\n\t// set defaults, if PathTemplates is not set\n\tif len(cfg.PathTemplates) == 0 {\n\t\tcfg.PathTemplates = []string{\n\t\t\t\"ids/%i\",\n\t\t\t\"snapshots/%T\",\n\t\t\t\"hosts/%h/%T\",\n\t\t\t\"tags/%t/%T\",\n\t\t}\n\t}\n\n\troot.SnapshotsDir = NewSnapshotsDir(root, rootInode, rootInode, NewSnapshotsDirStructure(root, cfg.PathTemplates, cfg.TimeTemplate), \"\")\n\n\treturn root\n}", "func (_Gatekeeper *GatekeeperSession) VoteRoot(_root [32]byte) (*types.Transaction, error) {\n\treturn _Gatekeeper.Contract.VoteRoot(&_Gatekeeper.TransactOpts, _root)\n}", "func (n *NodeBuilder) Root() *TagNode {\n\treturn n.root\n}", "func (_Gatekeeper *GatekeeperTransactor) VoteRoot(opts *bind.TransactOpts, _root [32]byte) (*types.Transaction, error) {\n\treturn _Gatekeeper.contract.Transact(opts, \"VoteRoot\", _root)\n}", "func (db *Database) Root() *doltdb.RootValue {\n\treturn db.root\n}", "func (v *EventButton) XRoot() float64 {\n\tc := v.native().x_root\n\treturn float64(c)\n}", "func (o *JsonEnvironment) SetRootHashOffset(v string) {\n\to.RootHashOffset = &v\n}", "func (t *Tree) Root() *node {\n\treturn t.root\n}", "func (s *QuickUnionSet) Root(element int) int {\n\tparent := element\n\tfor s.ids[parent] != parent {\n\t\tparent = s.ids[parent]\n\t}\n\treturn parent\n}", "func (n *RforkNode) SetTree(t *Tree) {\n\tn.tree = t\n}", "func (node *Node) Root() *Node {\n\tfor node.Parent != nil {\n\t\tnode = node.Parent\n\t}\n\treturn node\n}", "func (m *DeviceManagementConfigurationSettingDefinition) SetRootDefinitionId(value *string)() {\n err := m.GetBackingStore().Set(\"rootDefinitionId\", value)\n if err != nil {\n panic(err)\n }\n}", "func (o *IdentityAccount) SetRootUserId(v string) {\n\to.RootUserId = &v\n}", "func (app *fileBuilder) WithRoot(root string) FileBuilder {\n\tapp.root = root\n\treturn app\n}", "func newRoot(view *View, leafAllocation int64) *root {\n\tif leafAllocation < 10 {\n\t\tleafAllocation = 10\n\t}\n\tleafNum := 3 - ((leafAllocation - 1) % 3) + leafAllocation\n\tnodeNum := (leafNum - 1) / 3\n\tr := new(root)\n\tr.leaves = make([]leaf, leafNum, leafNum)\n\tfor i := 0; i < len(r.leaves)-2; i++ {\n\t\tr.leaves[i].nextFree = &r.leaves[i+1]\n\t}\n\tr.nodes = make([]node, nodeNum, nodeNum)\n\tfor i := 0; i < len(r.nodes)-2; i++ {\n\t\tr.nodes[i].nextFree = &r.nodes[i+1]\n\t}\n\tr.freeNode = &r.nodes[0]\n\tr.freeLeaf = &r.leaves[0]\n\trootNode := r.newNode(view)\n\tr.rootNode = rootNode\n\treturn r\n}", "func (q *pathCompression) Root(r int) int {\n\tfor {\n\t\tif r == q.IDs[r] {\n\t\t\tbreak\n\t\t}\n\t\tq.IDs[r] = q.IDs[q.IDs[r]]\n\t\tr = q.IDs[r]\n\t}\n\treturn r\n}", "func (adder *Adder) PinRoot(root ipld.Node) error {\n\tif !adder.Pin {\n\t\treturn nil\n\t}\n\n\trnk := root.Cid()\n\n\terr := adder.dagService.Add(adder.ctx, root)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif adder.tempRoot.Defined() {\n\t\terr := adder.pinning.Unpin(adder.ctx, adder.tempRoot, true)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tadder.tempRoot = rnk\n\t}\n\n\tdur, err := pin.ExpiresAtWithUnitAndCount(pin.DefaultDurationUnit, adder.PinDuration)\n\tif err != nil {\n\t\treturn err\n\t}\n\tadder.pinning.PinWithMode(rnk, dur, pin.Recursive)\n\treturn adder.pinning.Flush(adder.ctx)\n}", "func (m *RestaurantMutation) ClearRoot() {\n\tm.clearedroot = true\n}", "func (s *Client) ensureRoot() error {\n\texists, _, err := s.conn.Exists(s.zkRoot)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\t_, err := s.conn.Create(s.zkRoot, []byte(\"\"), 0, zk.WorldACL(zk.PermAll))\n\t\tif err != nil && err != zk.ErrNodeExists {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func SetLevel(level Level) {\n\troot.SetLevel(level)\n}", "func (m *MockSpaceStorage) TreeRoot(arg0 string) (*treechangeproto.RawTreeChangeWithId, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"TreeRoot\", arg0)\n\tret0, _ := ret[0].(*treechangeproto.RawTreeChangeWithId)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (_Gatekeeper *GatekeeperTransactorSession) VoteRoot(_root [32]byte) (*types.Transaction, error) {\n\treturn _Gatekeeper.Contract.VoteRoot(&_Gatekeeper.TransactOpts, _root)\n}", "func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) {\n\tindx := hh.Index()\n\n\t// Field (0) 'Attestation1'\n\tif err = a.Attestation1.HashTreeRootWith(hh); err != nil {\n\t\treturn\n\t}\n\n\t// Field (1) 'Attestation2'\n\tif err = a.Attestation2.HashTreeRootWith(hh); err != nil {\n\t\treturn\n\t}\n\n\thh.Merkleize(indx)\n\treturn\n}" ]
[ "0.76017094", "0.7533801", "0.73356307", "0.71561253", "0.7128585", "0.7020409", "0.7009551", "0.6978859", "0.6884092", "0.6771216", "0.66614586", "0.6644592", "0.65779394", "0.6544975", "0.6466843", "0.6459183", "0.6454095", "0.6399124", "0.6379322", "0.62789136", "0.62344044", "0.62098116", "0.6179826", "0.61702716", "0.61642176", "0.61068714", "0.60867053", "0.6044791", "0.6017419", "0.601505", "0.5976435", "0.59312385", "0.59114313", "0.59097636", "0.5883659", "0.5863507", "0.58382684", "0.5808614", "0.572677", "0.5717967", "0.57143724", "0.57007223", "0.5699518", "0.5683765", "0.56753606", "0.56674063", "0.56625694", "0.5662377", "0.56353813", "0.563426", "0.5608046", "0.55950683", "0.5565471", "0.55454105", "0.5545407", "0.5545407", "0.55409074", "0.551329", "0.55032295", "0.55022615", "0.5496664", "0.5479684", "0.54778785", "0.545668", "0.5456517", "0.54454195", "0.5426433", "0.5424829", "0.53988206", "0.5396799", "0.5396505", "0.53884834", "0.53841215", "0.53717184", "0.53650147", "0.53618866", "0.53570884", "0.53463453", "0.5346134", "0.53454375", "0.5336198", "0.53304285", "0.53240037", "0.53227025", "0.5315973", "0.5308605", "0.5303157", "0.5291636", "0.52824855", "0.52822524", "0.5279002", "0.52755904", "0.5266642", "0.52619666", "0.52526915", "0.5251236", "0.524953", "0.52447796", "0.5211782", "0.5210216" ]
0.7836139
0
AtomicUpdate Updates the DB atomically with the provided ops.
AtomicUpdate Обновляет БД атомарно с использованием предоставленных операций.
func (mgr *LocalHashMapDBMgr) AtomicUpdate(ops []common.DBOp) error { for i := 0; i < len(ops); i++ { switch { case ops[i].Op == common.DBOpStore: mgr.Store(ops[i].K, ops[i].E) case ops[i].Op == common.DBOpDelete: mgr.Delete(ops[i].K) case ops[i].Op == common.DBOpSetRoot: mgr.SetRoot(ops[i].E.(*Base)) } } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func update(ctx context.Context, db transactor, fn func(*bolt.Tx) error) error {\n\ttx, ok := ctx.Value(transactionKey{}).(*bolt.Tx)\n\tif !ok {\n\t\treturn db.Update(fn)\n\t} else if !tx.Writable() {\n\t\treturn errors.Wrap(bolt.ErrTxNotWritable, \"unable to use transaction from context\")\n\t}\n\treturn fn(tx)\n}", "func (db *DB) Update(ctx context.Context, fn func(*TransactionManager) error) error {\n\ttries := db.txretiries\n\tvar tx *TransactionManager\n\tvar err error\n\tfor {\n\t\ttx = db.BeginTransaction(true)\n\t\terr = fn(tx)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\terr = tx.Commit()\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err != badger.ErrConflict {\n\t\t\tbreak\n\t\t}\n\t\tif tries < 1 {\n\t\t\tif db.txretiries > 0 {\n\t\t\t\terr = ErrConflictRetriesOver\n\t\t\t} else {\n\t\t\t\terr = ErrConflict\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\ttries--\n\t\ttx.Discard()\n\t}\n\ttx.Discard()\n\n\tif err != nil {\n\t\tinslogger.FromContext(ctx).Errorln(\"DB Update error:\", err)\n\t}\n\treturn err\n}", "func TestTaskDBConcurrentUpdate(t sktest.TestingT, db TaskDB) {\n\tctx := context.Background()\n\n\t// Insert a task.\n\tt1 := types.MakeTestTask(time.Now(), []string{\"a\", \"b\", \"c\", \"d\"})\n\trequire.NoError(t, db.PutTask(ctx, t1))\n\n\t// Retrieve a copy of the task.\n\tt1Cached, err := db.GetTaskById(ctx, t1.Id)\n\trequire.NoError(t, err)\n\tAssertDeepEqual(t, t1, t1Cached)\n\n\t// Update the original task.\n\tt1.Commits = []string{\"a\", \"b\"}\n\trequire.NoError(t, db.PutTask(ctx, t1))\n\n\t// Update the cached copy; should get concurrent update error.\n\tt1Cached.Status = types.TASK_STATUS_RUNNING\n\terr = db.PutTask(ctx, t1Cached)\n\trequire.True(t, IsConcurrentUpdate(err))\n\n\t{\n\t\t// DB should still have the old value of t1.\n\t\tt1Again, err := db.GetTaskById(ctx, t1.Id)\n\t\trequire.NoError(t, err)\n\t\tAssertDeepEqual(t, t1, t1Again)\n\t}\n\n\t// Insert a second task.\n\tt2 := types.MakeTestTask(time.Now(), []string{\"e\", \"f\"})\n\trequire.NoError(t, db.PutTask(ctx, t2))\n\n\t// Update t2 at the same time as t1Cached; should still get an error.\n\tt2Before := t2.Copy()\n\tt2.Status = types.TASK_STATUS_MISHAP\n\terr = db.PutTasks(ctx, []*types.Task{t2, t1Cached})\n\trequire.True(t, IsConcurrentUpdate(err))\n\n\t{\n\t\t// DB should still have the old value of t1 and t2.\n\t\tt1Again, err := db.GetTaskById(ctx, t1.Id)\n\t\trequire.NoError(t, err)\n\t\tAssertDeepEqual(t, t1, t1Again)\n\n\t\tt2Again, err := db.GetTaskById(ctx, t2.Id)\n\t\trequire.NoError(t, err)\n\t\tAssertDeepEqual(t, t2Before, t2Again)\n\t}\n}", "func (tbl AssociationTable) Update(req require.Requirement, vv ...*Association) (int64, error) {\n\tif req == require.All {\n\t\treq = require.Exactly(len(vv))\n\t}\n\n\tvar count int64\n\td := tbl.Dialect()\n\tq := d.Quoter()\n\n\tfor _, v := range vv {\n\t\tvar iv interface{} = v\n\t\tif hook, ok := iv.(sqlapi.CanPreUpdate); ok {\n\t\t\terr := hook.PreUpdate()\n\t\t\tif err != nil {\n\t\t\t\treturn count, tbl.Logger().LogError(err)\n\t\t\t}\n\t\t}\n\n\t\tb := dialect.Adapt(&bytes.Buffer{})\n\t\tb.WriteString(\"UPDATE \")\n\t\ttbl.quotedNameW(b)\n\t\tb.WriteString(\" SET \")\n\n\t\targs, err := constructAssociationTableUpdate(tbl, b, v)\n\t\tif err != nil {\n\t\t\treturn count, err\n\t\t}\n\t\targs = append(args, v.Id)\n\n\t\tb.WriteString(\" WHERE \")\n\t\tq.QuoteW(b, tbl.pk)\n\t\tb.WriteString(\"=?\")\n\n\t\tquery := b.String()\n\t\tn, err := tbl.Exec(nil, query, args...)\n\t\tif err != nil {\n\t\t\treturn count, err\n\t\t}\n\t\tcount += n\n\t}\n\n\treturn count, tbl.Logger().LogIfError(require.ErrorIfExecNotSatisfiedBy(req, count))\n}", "func update(ctx context.Context, tx *sqlx.Tx, todo *Todo) error {\n\t_, err := tx.NamedExecContext(ctx, updateTodo, todo)\n\treturn err\n}", "func (bc *Blockchain) dbUpdate(ps ...bucket.TxHandler) error {\n\treturn bc.db.Update(func(tx *bolt.Tx) error {\n\t\trollbackFuncs := []bucket.Rollback{}\n\t\tfor _, p := range ps {\n\t\t\trb, err := p(tx)\n\t\t\tif err != nil {\n\t\t\t\t// rollback previous updates if any\n\t\t\t\tfor _, r := range rollbackFuncs {\n\t\t\t\t\tr()\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\t\t\trollbackFuncs = append(rollbackFuncs, rb)\n\t\t}\n\n\t\treturn nil\n\t})\n}", "func (db *boltsecDB) update(fn func(*boltsecTx) error) error {\n\twrapper := func(tx *bolt.Tx) error {\n\t\treturn fn(&boltsecTx{tx})\n\t}\n\treturn db.DB.Update(wrapper)\n}", "func (t *Transaction) Update(list ...interface{}) (int64, error) {\n\treturn update(t.dbmap, t, list...)\n}", "func (o *Kvstore) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tkvstoreUpdateCacheMut.RLock()\n\tcache, cached := kvstoreUpdateCache[key]\n\tkvstoreUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tkvstoreAllColumns,\n\t\t\tkvstorePrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update kvstore, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"kvstore\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, kvstorePrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(kvstoreType, kvstoreMapping, append(wl, kvstorePrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update kvstore row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for kvstore\")\n\t}\n\n\tif !cached {\n\t\tkvstoreUpdateCacheMut.Lock()\n\t\tkvstoreUpdateCache[key] = cache\n\t\tkvstoreUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func (e *SqlExecutor) Update(list ...interface{}) (int64, error) {\n\thook := e.db.ExecutorHook()\n\tvar rv int64\n\tfor _, item := range list {\n\t\tvar qArg queryArgs\n\t\tbuilder, err := buildUpdate(e.dbp, item.(Model))\n\t\tif err != nil {\n\t\t\treturn rv, err\n\t\t}\n\t\tqArg.query, qArg.args, err = builder.ToSql()\n\t\tif err != nil {\n\t\t\treturn rv, err\n\t\t}\n\t\thook.BeforeUpdate(e.ctx, qArg.query, qArg.args...)\n\t\tv, err := e.SqlExecutor.Update(item)\n\t\tif err != nil {\n\t\t\treturn rv, err\n\t\t}\n\t\trv += v\n\t\thook.AfterUpdate(e.ctx, qArg.query, qArg.args...)\n\t}\n\treturn rv, nil\n}", "func (blt Bolt) Update(execute dbtx.Execute) error {\n\treturn blt.db.Update(func(tx *b.Tx) error {\n\t\treturn execute(tx.Bucket(blt.Bucket))\n\t})\n}", "func (o *Store) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\to.UpdatedAt = currTime\n\t}\n\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\tstoreUpdateCacheMut.RLock()\n\tcache, cached := storeUpdateCache[key]\n\tstoreUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tstoreAllColumns,\n\t\t\tstorePrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update stores, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"stores\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, storePrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(storeType, storeMapping, append(wl, storePrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update stores row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for stores\")\n\t}\n\n\tif !cached {\n\t\tstoreUpdateCacheMut.Lock()\n\t\tstoreUpdateCache[key] = cache\n\t\tstoreUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "func (db *DB) update(fn func(*Tx) error) error {\n\treturn db.DB.Update(func(tx *bolt.Tx) error {\n\t\treturn fn(&Tx{tx})\n\t})\n}", "func (uqs ControlUpdateQS) Exec(db models.DBInterface) (int64, error) {\n\tif len(uqs.updates) == 0 {\n\t\treturn 0, nil\n\t}\n\n\tc := &models.PositionalCounter{}\n\n\tvar params []interface{}\n\n\tvar sets []string\n\tfor _, set := range uqs.updates {\n\t\ts, p := set.GetConditionFragment(c)\n\n\t\tsets = append(sets, s)\n\t\tparams = append(params, p...)\n\t}\n\n\tws, wp := ControlQS{condFragments: uqs.condFragments}.whereClause(c)\n\n\tst := `UPDATE \"heatcontrol_control\" SET ` + strings.Join(sets, \", \") + ws\n\n\tparams = append(params, wp...)\n\n\tresult, err := db.Exec(st, params...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn result.RowsAffected()\n}", "func (upd *Update) Execute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) {\n\tif upd.QueryTimeout != 0 {\n\t\tcancel := vcursor.SetContextTimeout(time.Duration(upd.QueryTimeout) * time.Millisecond)\n\t\tdefer cancel()\n\t}\n\n\tswitch upd.Opcode {\n\tcase Unsharded:\n\t\treturn upd.execUpdateUnsharded(vcursor, bindVars)\n\tcase Equal:\n\t\treturn upd.execUpdateEqual(vcursor, bindVars)\n\tcase In:\n\t\treturn upd.execUpdateIn(vcursor, bindVars)\n\tcase Scatter:\n\t\treturn upd.execUpdateByDestination(vcursor, bindVars, key.DestinationAllShards{})\n\tcase ByDestination:\n\t\treturn upd.execUpdateByDestination(vcursor, bindVars, upd.TargetDestination)\n\tdefault:\n\t\t// Unreachable.\n\t\treturn nil, fmt.Errorf(\"unsupported opcode: %v\", upd)\n\t}\n}", "func (o *Doc) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\tqueries.SetScanner(&o.UpdatedAt, currTime)\n\t}\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tdocUpdateCacheMut.RLock()\n\tcache, cached := docUpdateCache[key]\n\tdocUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tdocAllColumns,\n\t\t\tdocPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update doc, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `doc` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, docPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(docType, docMapping, append(wl, docPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update doc row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for doc\")\n\t}\n\n\tif !cached {\n\t\tdocUpdateCacheMut.Lock()\n\t\tdocUpdateCache[key] = cache\n\t\tdocUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func (s BoltStore) BatchUpdate(ids []interface{}, data []interface{}, store string, opts ObjectStoreOptions) (err error) {\n\treturn ErrNotImplemented\n}", "func (o *Task) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\to.UpdatedAt = currTime\n\t}\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\ttaskUpdateCacheMut.RLock()\n\tcache, cached := taskUpdateCache[key]\n\ttaskUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\ttaskAllColumns,\n\t\t\ttaskPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update tasks, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"tasks\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, taskPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(taskType, taskMapping, append(wl, taskPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update tasks row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for tasks\")\n\t}\n\n\tif !cached {\n\t\ttaskUpdateCacheMut.Lock()\n\t\ttaskUpdateCache[key] = cache\n\t\ttaskUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func (o *Transaction) Update(exec boil.Executor, whitelist ...string) error {\n\tcurrTime := time.Now().In(boil.GetLocation())\n\n\to.UpdatedAt.Time = currTime\n\to.UpdatedAt.Valid = true\n\n\tvar err error\n\tkey := makeCacheKey(whitelist, nil)\n\ttransactionUpdateCacheMut.RLock()\n\tcache, cached := transactionUpdateCache[key]\n\ttransactionUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := strmangle.UpdateColumnSet(\n\t\t\ttransactionColumns,\n\t\t\ttransactionPrimaryKeyColumns,\n\t\t\twhitelist,\n\t\t)\n\n\t\tif len(whitelist) == 0 {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"models: unable to update transactions, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `transactions` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, transactionPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(transactionType, transactionMapping, append(wl, transactionPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to update transactions row\")\n\t}\n\n\tif !cached {\n\t\ttransactionUpdateCacheMut.Lock()\n\t\ttransactionUpdateCache[key] = cache\n\t\ttransactionUpdateCacheMut.Unlock()\n\t}\n\n\treturn nil\n}", "func UpdateWithTx(ctx context.Context, dr *firestore.DocumentRef, data []firestore.Update, preconds ...firestore.Precondition) error {\n\ttx, ok := GetTx(ctx)\n\tif ok {\n\t\treturn tx.Update(dr, data, preconds...)\n\t} else {\n\t\t_, err := dr.Update(ctx, data, preconds...)\n\t\treturn err\n\t}\n}", "func (d *DbBackendCouch) Update(params dragonfruit.QueryParams, operation int) (interface{},\n\terror) {\n\n\tpathmap, doc, id, v, err := d.getPathSpecificStuff(params)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewdoc, partial, err := findSubDoc(pathmap[1:],\n\t\tparams,\n\t\treflect.ValueOf(doc.Value),\n\t\treflect.ValueOf(v),\n\t\toperation)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdatabase := getDatabaseName(params)\n\t_, out, err := d.save(database, id, newdoc.Interface())\n\tif err != nil {\n\t\treturn out, err\n\t}\n\tout, err = sanitizeDoc(partial.Interface())\n\n\treturn out, err\n\n}", "func (u *updater) Update(ctx context.Context, at int64, payload []byte) error {\n\terr := u.Put(ctx, &index{u.next}, at, payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\tu.next++\n\treturn nil\n}", "func (u *updater) Update(ctx context.Context, at int64, payload []byte) error {\n\terr := u.Put(ctx, &index{u.next}, at, payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\tu.next++\n\treturn nil\n}", "func (db *DB) Update(fn func(*TransactionManager) error) error {\n\ttries := db.txretiries\n\tvar tx *TransactionManager\n\tvar err error\n\tfor {\n\t\ttx = db.BeginTransaction(true)\n\t\terr = fn(tx)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\terr = tx.Commit()\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err != badger.ErrConflict {\n\t\t\tbreak\n\t\t}\n\t\tif tries < 1 {\n\t\t\tif db.txretiries > 0 {\n\t\t\t\terr = ErrConflictRetriesOver\n\t\t\t} else {\n\t\t\t\tlog.Info(\"local storage transaction conflict\")\n\t\t\t\terr = ErrConflict\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\ttries--\n\t\ttx.Discard()\n\t}\n\ttx.Discard()\n\treturn err\n}", "func (o *Transaction) Update(exec boil.Executor, whitelist ...string) error {\n\tvar err error\n\tkey := makeCacheKey(whitelist, nil)\n\ttransactionUpdateCacheMut.RLock()\n\tcache, cached := transactionUpdateCache[key]\n\ttransactionUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := strmangle.UpdateColumnSet(\n\t\t\ttransactionColumns,\n\t\t\ttransactionPrimaryKeyColumns,\n\t\t\twhitelist,\n\t\t)\n\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"model: unable to update transaction, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `transaction` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, transactionPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(transactionType, transactionMapping, append(wl, transactionPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"model: unable to update transaction row\")\n\t}\n\n\tif !cached {\n\t\ttransactionUpdateCacheMut.Lock()\n\t\ttransactionUpdateCache[key] = cache\n\t\ttransactionUpdateCacheMut.Unlock()\n\t}\n\n\treturn nil\n}", "func (tbl DbCompoundTable) UpdateFields(req require.Requirement, wh where.Expression, fields ...sql.NamedArg) (int64, error) {\n\treturn support.UpdateFields(tbl, req, wh, fields...)\n}", "func (d *dbBase) UpdateBatch(ctx context.Context, q dbQuerier, qs *querySet, mi *modelInfo, cond *Condition, params Params, tz *time.Location) (int64, error) {\n\tcolumns := make([]string, 0, len(params))\n\tvalues := make([]interface{}, 0, len(params))\n\tfor col, val := range params {\n\t\tif fi, ok := mi.fields.GetByAny(col); !ok || !fi.dbcol {\n\t\t\tpanic(fmt.Errorf(\"wrong field/column name `%s`\", col))\n\t\t} else {\n\t\t\tcolumns = append(columns, fi.column)\n\t\t\tvalues = append(values, val)\n\t\t}\n\t}\n\n\tif len(columns) == 0 {\n\t\tpanic(fmt.Errorf(\"update params cannot empty\"))\n\t}\n\n\ttables := newDbTables(mi, d.ins)\n\tvar specifyIndexes string\n\tif qs != nil {\n\t\ttables.parseRelated(qs.related, qs.relDepth)\n\t\tspecifyIndexes = tables.getIndexSql(mi.table, qs.useIndex, qs.indexes)\n\t}\n\n\twhere, args := tables.getCondSQL(cond, false, tz)\n\n\tvalues = append(values, args...)\n\n\tjoin := tables.getJoinSQL()\n\n\tvar query, T string\n\n\tQ := d.ins.TableQuote()\n\n\tif d.ins.SupportUpdateJoin() {\n\t\tT = \"T0.\"\n\t}\n\n\tcols := make([]string, 0, len(columns))\n\n\tfor i, v := range columns {\n\t\tcol := fmt.Sprintf(\"%s%s%s%s\", T, Q, v, Q)\n\t\tif c, ok := values[i].(colValue); ok {\n\t\t\tswitch c.opt {\n\t\t\tcase ColAdd:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" + ?\")\n\t\t\tcase ColMinus:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" - ?\")\n\t\t\tcase ColMultiply:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" * ?\")\n\t\t\tcase ColExcept:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" / ?\")\n\t\t\tcase ColBitAnd:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" & ?\")\n\t\t\tcase ColBitRShift:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" >> ?\")\n\t\t\tcase ColBitLShift:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" << ?\")\n\t\t\tcase ColBitXOR:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" ^ ?\")\n\t\t\tcase ColBitOr:\n\t\t\t\tcols = append(cols, col+\" = \"+col+\" | ?\")\n\t\t\t}\n\t\t\tvalues[i] = c.value\n\t\t} else {\n\t\t\tcols = append(cols, col+\" = ?\")\n\t\t}\n\t}\n\n\tsets := strings.Join(cols, \", \") + \" \"\n\n\tif d.ins.SupportUpdateJoin() {\n\t\tquery = fmt.Sprintf(\"UPDATE %s%s%s T0 %s%sSET %s%s\", Q, mi.table, Q, specifyIndexes, join, sets, where)\n\t} else {\n\t\tsupQuery := fmt.Sprintf(\"SELECT T0.%s%s%s FROM %s%s%s T0 %s%s%s\",\n\t\t\tQ, mi.fields.pk.column, Q,\n\t\t\tQ, mi.table, Q,\n\t\t\tspecifyIndexes, join, where)\n\t\tquery = fmt.Sprintf(\"UPDATE %s%s%s SET %sWHERE %s%s%s IN ( %s )\", Q, mi.table, Q, sets, Q, mi.fields.pk.column, Q, supQuery)\n\t}\n\n\td.ins.ReplaceMarks(&query)\n\tres, err := q.ExecContext(ctx, query, values...)\n\tif err == nil {\n\t\treturn res.RowsAffected()\n\t}\n\treturn 0, err\n}", "func updateBatch(db *IndexerDb, updateQuery string, data [][]interface{}) error {\n\tdb.accountingLock.Lock()\n\tdefer db.accountingLock.Unlock()\n\n\ttx, err := db.db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer tx.Rollback() // ignored if .Commit() first\n\n\tupdate, err := tx.Prepare(updateQuery)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error preparing update query: %v\", err)\n\t}\n\tdefer update.Close()\n\n\tfor _, txpr := range data {\n\t\t_, err = update.Exec(txpr...)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"problem updating row (%v): %v\", txpr, err)\n\t\t}\n\t}\n\n\treturn tx.Commit()\n}", "func (o WithdrawalCryptoSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"sqlite3: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), withdrawalCryptoPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"withdrawal_crypto\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 0, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, withdrawalCryptoPrimaryKeyColumns, len(o)))\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"sqlite3: unable to update all in withdrawalCrypto slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"sqlite3: unable to retrieve rows affected all in update all withdrawalCrypto\")\n\t}\n\treturn rowsAff, nil\n}", "func (db *DB) Update(fn func(*Tx) error) error {\n\tt, err := db.Begin(true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Make sure the transaction rolls back in the event of a panic.\n\tdefer func() {\n\t\tif t.db != nil {\n\t\t\tt.rollback()\n\t\t}\n\t}()\n\n\t// Mark as a managed tx so that the inner function cannot manually commit.\n\tt.managed = true\n\n\t// If an error is returned from the function then rollback and return error.\n\terr = fn(t)\n\tt.managed = false\n\tif err != nil {\n\t\t_ = t.Rollback()\n\t\treturn err\n\t}\n\n\treturn t.Commit()\n}", "func TestApplyUpdates(t *testing.T) {\n\tif testing.Short() {\n\t\tt.SkipNow()\n\t}\n\tt.Parallel()\n\n\tt.Run(\"TestApplyUpdates\", func(t *testing.T) {\n\t\tsiadir, err := newTestDir(t.Name())\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\ttestApply(t, siadir, ApplyUpdates)\n\t})\n\tt.Run(\"TestSiaDirApplyUpdates\", func(t *testing.T) {\n\t\tsiadir, err := newTestDir(t.Name())\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\ttestApply(t, siadir, siadir.applyUpdates)\n\t})\n\tt.Run(\"TestCreateAndApplyTransaction\", func(t *testing.T) {\n\t\tsiadir, err := newTestDir(t.Name())\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\ttestApply(t, siadir, siadir.createAndApplyTransaction)\n\t})\n}", "func (o *Utxo) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tutxoUpdateCacheMut.RLock()\n\tcache, cached := utxoUpdateCache[key]\n\tutxoUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tutxoAllColumns,\n\t\t\tutxoPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update utxo, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"utxo\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, utxoPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(utxoType, utxoMapping, append(wl, utxoPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update utxo row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for utxo\")\n\t}\n\n\tif !cached {\n\t\tutxoUpdateCacheMut.Lock()\n\t\tutxoUpdateCache[key] = cache\n\t\tutxoUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func (p *AutoCommitter) Update(pair []interface{}) (e error) {\n\tif p.started {\n\t\tp.docsUpdate <- pair\n\t} else {\n\t\te = errors.New(fmt.Sprintf(\"AutoCommitter-%s(%s)_is_closed\", p.name, p.coll))\n\t}\n\treturn\n}", "func (c *Client) Update(filename string, value Update, values ...Update) error {\n\targs := make([]interface{}, len(values)+2)\n\targs[0] = filename\n\targs[1] = value\n\tfor i, v := range values {\n\t\targs[i+2] = v\n\t}\n\t_, err := c.ExecCmd(NewCmd(\"update\").WithArgs(args...))\n\treturn err\n}", "func (o *Item) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\titemUpdateCacheMut.RLock()\n\tcache, cached := itemUpdateCache[key]\n\titemUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\titemAllColumns,\n\t\t\titemPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update items, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"items\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 0, itemPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(itemType, itemMapping, append(wl, itemPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update items row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for items\")\n\t}\n\n\tif !cached {\n\t\titemUpdateCacheMut.Lock()\n\t\titemUpdateCache[key] = cache\n\t\titemUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "func (ust *UsersShopTrace) Update(ctx context.Context, key ...interface{}) error {\n\tvar err error\n\tvar dbConn *sql.DB\n\n\t// if deleted, bail\n\tif ust._deleted {\n\t\treturn errors.New(\"update failed: marked for deletion\")\n\t}\n\n\ttx, err := components.M.GetConnFromCtx(ctx)\n\tif err != nil {\n\t\tdbConn, err = components.M.GetMasterConn()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ttableName, err := GetUsersShopTraceTableName(key...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// sql query\n\tsqlstr := `UPDATE ` + tableName + ` SET ` +\n\t\t`openid = ?, unionid = ?, appid = ?, uid = ?, fid = ?, sid = ?, updated = ?` +\n\t\t` WHERE id = ?`\n\n\t// run query\n\tutils.GetTraceLog(ctx).Debug(\"DB\", zap.String(\"SQL\", fmt.Sprint(sqlstr, ust.Openid, ust.Unionid, ust.Appid, ust.UID, ust.Fid, ust.Sid, ust.Updated, ust.ID)))\n\tif tx != nil {\n\t\t_, err = tx.Exec(sqlstr, ust.Openid, ust.Unionid, ust.Appid, ust.UID, ust.Fid, ust.Sid, ust.Updated, ust.ID)\n\t} else {\n\t\t_, err = dbConn.Exec(sqlstr, ust.Openid, ust.Unionid, ust.Appid, ust.UID, ust.Fid, ust.Sid, ust.Updated, ust.ID)\n\t}\n\treturn err\n}", "func (u *__Notify_Updater) Update(db XODB) (int, error) {\n\tvar err error\n\n\tvar updateArgs []interface{}\n\tvar sqlUpdateArr []string\n\t/*for up, newVal := range u.updates {\n\t sqlUpdateArr = append(sqlUpdateArr, up)\n\t updateArgs = append(updateArgs, newVal)\n\t}*/\n\tfor _, up := range u.updates {\n\t\tsqlUpdateArr = append(sqlUpdateArr, up.col)\n\t\tupdateArgs = append(updateArgs, up.val)\n\t}\n\tsqlUpdate := strings.Join(sqlUpdateArr, \",\")\n\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tvar allArgs []interface{}\n\tallArgs = append(allArgs, updateArgs...)\n\tallArgs = append(allArgs, whereArgs...)\n\n\tsqlstr := `UPDATE sun.notify SET ` + sqlUpdate\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tif LogTableSqlReq.Notify {\n\t\tXOLog(sqlstr, allArgs)\n\t}\n\tres, err := db.Exec(sqlstr, allArgs...)\n\tif err != nil {\n\t\tif LogTableSqlReq.Notify {\n\t\t\tXOLogErr(err)\n\t\t}\n\t\treturn 0, err\n\t}\n\n\tnum, err := res.RowsAffected()\n\tif err != nil {\n\t\tif LogTableSqlReq.Notify {\n\t\t\tXOLogErr(err)\n\t\t}\n\t\treturn 0, err\n\t}\n\n\treturn int(num), nil\n}", "func TestAtomic(t *testing.T) {\n\tvar ops uint64 = 0\n\n\tfor i := 0; i < 8; i++ {\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tatomic.AddUint64(&ops, 1)\n\t\t\t\truntime.Gosched()\n\t\t\t}\n\t\t}()\n\t}\n\ttime.Sleep(1 * time.Second)\n\topsFinal := atomic.LoadUint64(&ops)\n\tt.Log(\"ops:\", opsFinal)\n}", "func (o KvstoreSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), kvstorePrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"kvstore\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, kvstorePrimaryKeyColumns, len(o)))\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in kvstore slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all kvstore\")\n\t}\n\treturn rowsAff, nil\n}", "func (o DocSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), docPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE `doc` SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, docPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in doc slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all doc\")\n\t}\n\treturn rowsAff, nil\n}", "func (ix *IndexedBucket) Update(inputRecs []Record, writeFn WriteFn) error {\n\treturn ix.writeRecs(inputRecs, writeFn, nil)\n}", "func (so *SQLOrderItemStore) Update(oi *model.OrderItem) (*model.OrderItem, error) {\n\toi.UpdatedAt = time.Now().UnixNano()\n\t_, err := so.SQLStore.Tx.Update(oi)\n\treturn oi, err\n}", "func (r *DarwinTimetable) Update(f func(*bolt.Tx) error) error {\n\treturn r.db.Update(f)\n}", "func (mm *Model) Update(selector, update interface{}, keys ...string) error {\n\treturn mm.execute(func(c CachedCollection) error {\n\t\treturn c.Update(selector, update, keys...)\n\t})\n}", "func (store TodoStore) Update(_ sqlx.Ext, update gtimer.Todo) (gtimer.Todo, error) {\n\ttodo, err := store.Get(update.ID)\n\tif err != nil {\n\t\treturn gtimer.Todo{}, err\n\t}\n\tif update.Status != \"completed\" && update.Status != \"active\" {\n\t\treturn gtimer.Todo{}, fmt.Errorf(\"invalid status: %s\", update.Status)\n\t}\n\ttodo.Title = update.Title\n\ttodo.Status = update.Status\n\ttodo.Updated = time.Now()\n\tstore[todo.ID] = todo\n\treturn todo, nil\n}", "func Update(ctx context.Context, tx pgx.Tx, sb sq.UpdateBuilder) (int64, error) {\n\tq, vs, err := sb.ToSql()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\ttag, err := tx.Exec(ctx, q, vs...)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn tag.RowsAffected(), nil\n}", "func (o *Stock) Update(exec boil.Executor, whitelist ...string) error {\n\tvar err error\n\tkey := makeCacheKey(whitelist, nil)\n\tstockUpdateCacheMut.RLock()\n\tcache, cached := stockUpdateCache[key]\n\tstockUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := strmangle.UpdateColumnSet(\n\t\t\tstockColumns,\n\t\t\tstockPrimaryKeyColumns,\n\t\t\twhitelist,\n\t\t)\n\n\t\tif len(whitelist) == 0 {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"models: unable to update stock, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `stock` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, stockPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(stockType, stockMapping, append(wl, stockPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to update stock row\")\n\t}\n\n\tif !cached {\n\t\tstockUpdateCacheMut.Lock()\n\t\tstockUpdateCache[key] = cache\n\t\tstockUpdateCacheMut.Unlock()\n\t}\n\n\treturn nil\n}", "func (t *Table) ExecuteUpdate(u *UpdateCommand) {\n\tu.real.execute(t, u.allocated[:u.allocSplit])\n\tu.virt.execute(t, u.allocated[u.allocSplit:])\n\tu.clear()\n}", "func (o *WithdrawalCrypto) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\twithdrawalCryptoUpdateCacheMut.RLock()\n\tcache, cached := withdrawalCryptoUpdateCache[key]\n\twithdrawalCryptoUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\twithdrawalCryptoAllColumns,\n\t\t\twithdrawalCryptoPrimaryKeyColumns,\n\t\t)\n\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"sqlite3: unable to update withdrawal_crypto, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"withdrawal_crypto\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 0, withdrawalCryptoPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(withdrawalCryptoType, withdrawalCryptoMapping, append(wl, withdrawalCryptoPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"sqlite3: unable to update withdrawal_crypto row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"sqlite3: failed to get rows affected by update for withdrawal_crypto\")\n\t}\n\n\tif !cached {\n\t\twithdrawalCryptoUpdateCacheMut.Lock()\n\t\twithdrawalCryptoUpdateCache[key] = cache\n\t\twithdrawalCryptoUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func (d *Database) Update(fn func(db *gorm.DB) error) error {\n\ttx := d.db.Begin()\n\tif err := fn(tx); err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\treturn tx.Commit().Error\n}", "func (o TaskSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), taskPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"tasks\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, taskPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in task slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all task\")\n\t}\n\treturn rowsAff, nil\n}", "func (c *Collection) Update(ctx context.Context, doc Document, mods Mods) error {\n\t_, err := c.Actions().Update(doc, mods).Do(ctx)\n\treturn err\n}", "func (md *ImpMySQLDB) Update(_ context.Context, schema, table string, keys map[string]interface{}, values map[string]interface{}) error {\n\targs := make([]interface{}, 0, len(keys)+len(values))\n\tkvs := genSetFields(values, &args)\n\twhere := genWhere(keys, &args)\n\tstmt := fmt.Sprintf(\"UPDATE `%s`.`%s` SET %s WHERE %s;\", schema, table, kvs, where)\n\t_, err := md.db.Exec(stmt, args...)\n\n\tif md.verbose {\n\t\tstmt = md.genPlainSQL(stmt, args)\n\t\tfmt.Println(stmt)\n\t}\n\n\treturn errors.Trace(err)\n}", "func (o StoreSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), storePrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"stores\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, storePrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in store slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all store\")\n\t}\n\treturn rowsAff, nil\n}", "func (o UtxoSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), utxoPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"utxo\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, utxoPrimaryKeyColumns, len(o)))\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in utxo slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all utxo\")\n\t}\n\treturn rowsAff, nil\n}", "func (idx *Autoincrement) Update(id, oldV, newV string) error {\n\tif err := idx.Remove(id, oldV); err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := idx.Add(id, newV); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (c *MySQLClient) Update(p *purchase.Purchase) error {\n\tif p.ID == 0 {\n\t\treturn fmt.Errorf(\"purchase must have a preexisting ID\")\n\t}\n\n\tbuyBytes, err := json.Marshal(p.BuyOrder)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to marshal buy order: %v\", err)\n\t}\n\n\tsellBytes, err := json.Marshal(p.SellOrder)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to marshal sell order: %v\", err)\n\t}\n\n\tquery := `UPDATE trader_one\n SET\n buy_order = ?,\n sell_order = ?,\n updated_at = NOW()\n WHERE\n id = ?`\n\tctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancelFunc()\n\tstmt, err := c.db.PrepareContext(ctx, query)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to prepare SQL statement: %v\", err)\n\t}\n\tdefer stmt.Close()\n\n\t_, err = stmt.ExecContext(ctx, jsonString(buyBytes), jsonString(sellBytes), p.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to update row: %v\", err)\n\t}\n\treturn nil\n}", "func Update(s Session, dbname string, collection string, selector map[string]interface{}, updator map[string]interface{}) error {\n\treturn s.DB(dbname).C(collection).Update(selector, updator)\n}", "func (t *Testzzz) Update(ctx context.Context, key ...interface{}) error {\n\tvar err error\n\tvar dbConn *sql.DB\n\n\t// if deleted, bail\n\tif t._deleted {\n\t\treturn errors.New(\"update failed: marked for deletion\")\n\t}\n\n\ttx, err := components.M.GetConnFromCtx(ctx)\n\tif err != nil {\n\t\tdbConn, err = components.M.GetMasterConn()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ttableName, err := GetTestzzzTableName(key...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// sql query\n\tsqlstr := `UPDATE ` + tableName + ` SET ` +\n\t\t`a = ?, b = ?, c = ?` +\n\t\t` WHERE id = ?`\n\n\t// run query\n\tutils.GetTraceLog(ctx).Debug(\"DB\", zap.String(\"SQL\", fmt.Sprint(sqlstr, t.A, t.B, t.C, t.ID)))\n\tif tx != nil {\n\t\t_, err = tx.Exec(sqlstr, t.A, t.B, t.C, t.ID)\n\t} else {\n\t\t_, err = dbConn.Exec(sqlstr, t.A, t.B, t.C, t.ID)\n\t}\n\treturn err\n}", "func testUpdateOperationDelete(t *testing.T) {\n\tt.Parallel()\n\n\th := UpdateOperationHandler(&matcher.Mock{\n\t\tDeleteUpdateOperations_: func(context.Context, ...uuid.UUID) (int64, error) { return 0, nil },\n\t})\n\tsrv := httptest.NewServer(h)\n\tdefer srv.Close()\n\tc := srv.Client()\n\n\tid := uuid.New().String()\n\tu := srv.URL + \"/\" + id\n\treq, err := http.NewRequest(http.MethodDelete, u, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create request: %v\", err)\n\t}\n\tresp, err := c.Do(req)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to do request: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Fatalf(\"got: %v, want: %v\", resp.StatusCode, http.StatusOK)\n\t}\n}", "func (o *Ticket) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\tticketUpdateCacheMut.RLock()\n\tcache, cached := ticketUpdateCache[key]\n\tticketUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tticketAllColumns,\n\t\t\tticketPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update tickets, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"tickets\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, ticketPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(ticketType, ticketMapping, append(wl, ticketPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update tickets row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for tickets\")\n\t}\n\n\tif !cached {\n\t\tticketUpdateCacheMut.Lock()\n\t\tticketUpdateCache[key] = cache\n\t\tticketUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "func Update(db gorp.SqlExecutor, i interface{}) error {\n\treturn Mapper.Update(db, i)\n}", "func (o MempoolBinSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), mempoolBinPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"mempool_bin\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, mempoolBinPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in mempoolBin slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all mempoolBin\")\n\t}\n\treturn rowsAff, nil\n}", "func (uqs InstantprofileUpdateQS) Exec(db models.DBInterface) (int64, error) {\n\tif len(uqs.updates) == 0 {\n\t\treturn 0, nil\n\t}\n\n\tc := &models.PositionalCounter{}\n\n\tvar params []interface{}\n\n\tvar sets []string\n\tfor _, set := range uqs.updates {\n\t\ts, p := set.GetConditionFragment(c)\n\n\t\tsets = append(sets, s)\n\t\tparams = append(params, p...)\n\t}\n\n\tws, wp := InstantprofileQS{condFragments: uqs.condFragments}.whereClause(c)\n\n\tst := `UPDATE \"heatcontrol_instantprofile\" SET ` + strings.Join(sets, \", \") + ws\n\n\tparams = append(params, wp...)\n\n\tresult, err := db.Exec(st, params...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn result.RowsAffected()\n}", "func IncidentUpdates(incidentId int, resolvedBy string, description string, isResolved string) {\n\tsess := SetupDB()\n\n\t//select component id on which incident happen ....===========================\n\tid, err1 := sess.Select(\"component_id\").\n\t\tFrom(\"incidents\").\n\t\tWhere(\"id = ?\", incidentId).\n\t\tReturnInt64()\n\tCheckErr(err1)\n\t//============================================================================\n\n\t//insert record into incident_updates table ...================================\n\tvar incident IncidentUpdate\n\tincident.ComponentId = id\n\tincident.IncidentId = incidentId\n\tincident.Updated_by = resolvedBy\n\tincident.Description = description\n\n\t_, err := sess.InsertInto(\"incident_update\").\n\t\tColumns(\"incident_id\", \"component_id\", \"description\", \"updated_by\").\n\t\tRecord(incident).\n\t\tExec()\n\tCheckErr(err)\n\t//============================================================================\n\n\tif isResolved == \"true\" {\n\t\t//update status of incident to resolved ...===================================\n\t\t_, err3 := sess.Update(\"incidents\").\n\t\t\tSet(\"status\", \"resolved\").\n\t\t\tSet(\"resolved_at\", \"NOW()\").\n\t\t\tWhere(\"id = ?\", incident.IncidentId).\n\t\t\tExec()\n\t\tCheckErr(err3)\n\t\t//============================================================================\n\t}\n}", "func Update(tableName string, property []string, values []interface{}, whereProperty string, whereOpt string, whereValue interface{}) bool {\n\tif db == nil {\n\t\tlogger.Println(tag_DBUtil, \"Update, db is nil\")\n\t\treturn false\n\t}\n\tlogger.Println(tag_DBUtil, property, values, whereProperty, whereValue)\n\tif len(property) < 1 || len(property) != len(values) {\n\t\tlogger.Println(tag_DBUtil, \"Update, property length is not equal values\")\n\t\treturn false\n\t}\n\tvar mysql string = \"update \" + tableName + \" set\"\n\tfor i := 0; i < len(property); i++ {\n\t\tif i == 0 {\n\t\t\tmysql += \" \" + property[i] + \" = ?\"\n\t\t} else {\n\t\t\tmysql += \" ,\" + property[i] + \" = ?\"\n\t\t}\n\t}\n\t//where\n\tif whereProperty != \"\" && whereOpt != \"\" {\n\t\tmysql += \" where \" + whereProperty + \" \" + whereOpt + \" ?\"\n\t}\n\tlogger.Println(tag_DBUtil, mysql)\n\tstmt, err := db.Prepare(mysql)\n\tif err != nil {\n\t\tlogger.Println(tag_DBUtil, err)\n\t\treturn false\n\t}\n\tif len(whereProperty) < 1 {\n\t\t_, err = stmt.Exec(values...)\n\t} else {\n\t\tnewValue := append(values, whereValue)\n\t\t_, err = stmt.Exec(newValue...)\n\t}\n\tif err != nil {\n\t\tlogger.Println(tag_DBUtil, err)\n\t\treturn false\n\t}\n\treturn true\n}", "func (o VoteSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), votePrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"vote\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, votePrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in vote slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all vote\")\n\t}\n\treturn rowsAff, nil\n}", "func (o *Storestate) Update(exec boil.Executor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tstorestateUpdateCacheMut.RLock()\n\tcache, cached := storestateUpdateCache[key]\n\tstorestateUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tstorestateColumns,\n\t\t\tstorestatePrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"stellarcore: unable to update storestate, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"storestate\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, storestatePrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(storestateType, storestateMapping, append(wl, storestatePrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"stellarcore: unable to update storestate row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"stellarcore: failed to get rows affected by update for storestate\")\n\t}\n\n\tif !cached {\n\t\tstorestateUpdateCacheMut.Lock()\n\t\tstorestateUpdateCache[key] = cache\n\t\tstorestateUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(exec)\n}", "func ExampleBuilder_WithUpdate() {\n\tcfg, err := config.LoadDefaultConfig(context.TODO())\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn\n\t}\n\n\tclient := dynamodb.NewFromConfig(cfg)\n\n\t// Create an update to set two fields in the table.\n\tupdate := expression.Set(\n\t\texpression.Name(\"Year\"),\n\t\texpression.Value(2015),\n\t).Set(\n\t\texpression.Name(\"AlbumTitle\"),\n\t\texpression.Value(\"Louder Than Ever\"),\n\t)\n\n\t// Create the DynamoDB expression from the Update.\n\texpr, err := expression.NewBuilder().\n\t\tWithUpdate(update).\n\t\tBuild()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\t// Use the built expression to populate the DynamoDB UpdateItem API\n\t// input parameters.\n\tinput := &dynamodb.UpdateItemInput{\n\t\tExpressionAttributeNames: expr.Names(),\n\t\tExpressionAttributeValues: expr.Values(),\n\t\tKey: map[string]types.AttributeValue{\n\t\t\t\"Artist\": &types.AttributeValueMemberS{Value: \"Acme Band\"},\n\t\t\t\"SongTitle\": &types.AttributeValueMemberS{Value: \"Happy Day\"},\n\t\t},\n\t\tReturnValues: \"ALL_NEW\",\n\t\tTableName: aws.String(\"Music\"),\n\t\tUpdateExpression: expr.Update(),\n\t}\n\n\tresult, err := client.UpdateItem(context.TODO(), input)\n\tif err != nil {\n\t\tif apiErr := new(types.ProvisionedThroughputExceededException); errors.As(err, &apiErr) {\n\t\t\tfmt.Println(\"throughput exceeded\")\n\t\t} else if apiErr := new(types.ResourceNotFoundException); errors.As(err, &apiErr) {\n\t\t\tfmt.Println(\"resource not found\")\n\t\t} else if apiErr := new(types.InternalServerError); errors.As(err, &apiErr) {\n\t\t\tfmt.Println(\"internal server error\")\n\t\t} else {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}", "func (s *dbstore) Put(keyVal ...*api.KeyValue) error {\n\tvar docs []*couchdb.CouchDoc\n\tfor _, kv := range keyVal {\n\t\tdataDoc, err := s.createCouchDoc(string(encodeKey(kv.Key, time.Time{})), kv.Value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif dataDoc != nil {\n\t\t\tdocs = append(docs, dataDoc)\n\t\t}\n\t}\n\n\tif len(docs) == 0 {\n\t\tlogger.Debugf(\"[%s] Nothing to do\", s.dbName)\n\t\treturn nil\n\t}\n\n\t_, err := s.db.BatchUpdateDocuments(docs)\n\tif nil != err {\n\t\treturn errors.WithMessage(err, fmt.Sprintf(\"BatchUpdateDocuments failed for [%d] documents\", len(docs)))\n\t}\n\n\treturn nil\n}", "func TestJobDBConcurrentUpdate(t sktest.TestingT, db JobDB) {\n\tctx := context.Background()\n\t// Insert a job.\n\tj1 := types.MakeTestJob(time.Now())\n\trequire.NoError(t, db.PutJob(ctx, j1))\n\n\t// Retrieve a copy of the job.\n\tj1Cached, err := db.GetJobById(ctx, j1.Id)\n\trequire.NoError(t, err)\n\tAssertDeepEqual(t, j1, j1Cached)\n\n\t// Update the original job.\n\tj1.Repo = \"another-repo\"\n\trequire.NoError(t, db.PutJob(ctx, j1))\n\n\t// Update the cached copy; should get concurrent update error.\n\tj1Cached.Status = types.JOB_STATUS_IN_PROGRESS\n\terr = db.PutJob(ctx, j1Cached)\n\trequire.True(t, IsConcurrentUpdate(err))\n\n\t{\n\t\t// DB should still have the old value of j1.\n\t\tj1Again, err := db.GetJobById(ctx, j1.Id)\n\t\trequire.NoError(t, err)\n\t\tAssertDeepEqual(t, j1, j1Again)\n\t}\n\n\t// Insert a second job.\n\tj2 := types.MakeTestJob(time.Now())\n\trequire.NoError(t, db.PutJob(ctx, j2))\n\n\t// Update j2 at the same time as j1Cached; should still get an error.\n\tj2Before := j2.Copy()\n\tj2.Status = types.JOB_STATUS_MISHAP\n\terr = db.PutJobs(ctx, []*types.Job{j2, j1Cached})\n\trequire.True(t, IsConcurrentUpdate(err))\n\n\t{\n\t\t// DB should still have the old value of j1 and j2.\n\t\tj1Again, err := db.GetJobById(ctx, j1.Id)\n\t\trequire.NoError(t, err)\n\t\tAssertDeepEqual(t, j1, j1Again)\n\n\t\tj2Again, err := db.GetJobById(ctx, j2.Id)\n\t\trequire.NoError(t, err)\n\t\tAssertDeepEqual(t, j2Before, j2Again)\n\t}\n}", "func (o *Currency) Update(exec boil.Executor, columns boil.Columns) (int64, error) {\n\tcurrTime := time.Now().In(boil.GetLocation())\n\n\to.UpdatedAt = currTime\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tcurrencyUpdateCacheMut.RLock()\n\tcache, cached := currencyUpdateCache[key]\n\tcurrencyUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tcurrencyColumns,\n\t\t\tcurrencyPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update currency, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"currency\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, currencyPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(currencyType, currencyMapping, append(wl, currencyPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update currency row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for currency\")\n\t}\n\n\tif !cached {\n\t\tcurrencyUpdateCacheMut.Lock()\n\t\tcurrencyUpdateCache[key] = cache\n\t\tcurrencyUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(exec)\n}", "func (q withdrawalCryptoQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tqueries.SetUpdate(q.Query, cols)\n\n\tresult, err := q.Query.ExecContext(ctx, exec)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"sqlite3: unable to update all for withdrawal_crypto\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"sqlite3: unable to retrieve rows affected for withdrawal_crypto\")\n\t}\n\n\treturn rowsAff, nil\n}", "func (q kvstoreQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tqueries.SetUpdate(q.Query, cols)\n\n\tresult, err := q.Query.ExecContext(ctx, exec)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all for kvstore\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected for kvstore\")\n\t}\n\n\treturn rowsAff, nil\n}", "func (od *OrderDetail) Update(ctx context.Context, db DB) error {\n\tswitch {\n\tcase !od._exists: // doesn't exist\n\t\treturn logerror(&ErrUpdateFailed{ErrDoesNotExist})\n\tcase od._deleted: // deleted\n\t\treturn logerror(&ErrUpdateFailed{ErrMarkedForDeletion})\n\t}\n\t// update with primary key\n\tconst sqlstr = `UPDATE northwind.order_details SET ` +\n\t\t`unit_price = ?, quantity = ?, discount = ? ` +\n\t\t`WHERE order_id = ? AND product_id = ?`\n\t// run\n\tlogf(sqlstr, od.UnitPrice, od.Quantity, od.Discount, od.OrderID, od.ProductID)\n\tif _, err := db.ExecContext(ctx, sqlstr, od.UnitPrice, od.Quantity, od.Discount, od.OrderID, od.ProductID); err != nil {\n\t\treturn logerror(err)\n\t}\n\treturn nil\n}", "func (tc *TaskCount) Update(c context.Context, queue string, exec, tot int) error {\n\t// Queue names are globally unique, so we can use them as IDs.\n\ttc.ID = queue\n\ttc.Computed = clock.Now(c).UTC()\n\ttc.Queue = queue\n\ttc.Executing = exec\n\ttc.Total = tot\n\tif err := datastore.Put(c, tc); err != nil {\n\t\treturn errors.Annotate(err, \"failed to store count\").Err()\n\t}\n\treturn nil\n}", "func (q storeQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tqueries.SetUpdate(q.Query, cols)\n\n\tresult, err := q.Query.ExecContext(ctx, exec)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all for stores\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected for stores\")\n\t}\n\n\treturn rowsAff, nil\n}", "func (t *DbService) Update(request *UpdateRequest) (*UpdateResponse, error) {\n\trsp := &UpdateResponse{}\n\treturn rsp, t.client.Call(\"db\", \"Update\", request, rsp)\n}", "func (o *Auth) Update(exec boil.Executor, whitelist ...string) error {\n\tcurrTime := time.Now().In(boil.GetLocation())\n\n\to.UpdatedAt.Time = currTime\n\to.UpdatedAt.Valid = true\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(exec); err != nil {\n\t\treturn err\n\t}\n\tkey := makeCacheKey(whitelist, nil)\n\tauthUpdateCacheMut.RLock()\n\tcache, cached := authUpdateCache[key]\n\tauthUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := strmangle.UpdateColumnSet(\n\t\t\tauthColumns,\n\t\t\tauthPrimaryKeyColumns,\n\t\t\twhitelist,\n\t\t)\n\n\t\tif len(whitelist) == 0 {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"models: unable to update auths, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"auths\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, authPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(authType, authMapping, append(wl, authPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to update auths row\")\n\t}\n\n\tif !cached {\n\t\tauthUpdateCacheMut.Lock()\n\t\tauthUpdateCache[key] = cache\n\t\tauthUpdateCacheMut.Unlock()\n\t}\n\n\treturn o.doAfterUpdateHooks(exec)\n}", "func (s structModel)Update(table string)(query string, values[]interface{}, err error){\n\tif s.err != nil{\n\t\treturn \"\", nil, s.err\n\t}\n\tvar arrQuery []string\n\tquery = \"UPDATE \" + table + \" SET\"\n\tlistValues := make([]interface{}, 0)\n\tfor i, _ := range s.value{\n\t\tarrQuery = append(arrQuery, \" \" + s.key[i] + \"= $\" + strconv.Itoa(i+1))\n\t\tlistValues = append(listValues, s.value[i])\n\t}\n\tquery = query + strings.Join(arrQuery, \",\")\n\treturn query, listValues, nil\n}", "func ExampleUpdate() {\n\tupd := q.Update(q.T(\"user\")).Set(q.C(\"name\"), \"hackme\").Where(q.Eq(q.C(\"id\"), 1))\n\tfmt.Println(upd)\n\t// Even in this case, the original name is used as a table and a column name\n\t// because Insert, Delete and Update aren't supporting \"AS\" syntax.\n\tu := q.T(\"user\", \"u\")\n\tfmt.Println(q.Update(u).Set(u.C(\"name\"), \"hackme\").Where(q.Eq(u.C(\"id\"), 1)))\n\t// When overwriting in the same name, the last one is effective.\n\tfmt.Println(q.Update(u).Set(u.C(\"name\"), \"hackyou\").Set(u.C(\"name\"), \"hackme\").Where(q.Eq(u.C(\"id\"), 1)))\n\t// Output:\n\t// UPDATE \"user\" SET \"name\" = ? WHERE \"id\" = ? [hackme 1]\n\t// UPDATE \"user\" SET \"name\" = ? WHERE \"id\" = ? [hackme 1]\n\t// UPDATE \"user\" SET \"name\" = ? WHERE \"id\" = ? [hackme 1]\n}", "func (o AutomodRuleDatumSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), automodRuleDatumPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"automod_rule_data\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, automodRuleDatumPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in automodRuleDatum slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all automodRuleDatum\")\n\t}\n\treturn rowsAff, nil\n}", "func (m *Account) Updates(values interface{}) error {\n\treturn UnscopedDb().Model(m).UpdateColumns(values).Error\n}", "func (o *FilesStorage) Update(exec boil.Executor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tfilesStorageUpdateCacheMut.RLock()\n\tcache, cached := filesStorageUpdateCache[key]\n\tfilesStorageUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tfilesStorageColumns,\n\t\t\tfilesStoragePrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update files_storages, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `files_storages` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, filesStoragePrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(filesStorageType, filesStorageMapping, append(wl, filesStoragePrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update files_storages row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for files_storages\")\n\t}\n\n\tif !cached {\n\t\tfilesStorageUpdateCacheMut.Lock()\n\t\tfilesStorageUpdateCache[key] = cache\n\t\tfilesStorageUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(exec)\n}", "func TestUpdate(t *testing.T) {\n\tlocalStore := NewEventLocalStore()\n\n\teventTest1 := &entities.Event{ID: \"id1\", Title: \"Title1\"}\n\terr := localStore.Create(eventTest1)\n\tassert.NoError(t, err)\n\n\teventTest2 := &entities.Event{ID: \"id1\", Title: \"Title2\"}\n\terr = localStore.Update(eventTest2)\n\tassert.NoError(t, err)\n\n\tassert.Equal(t, localStore.events[\"id1\"].Title, \"Title2\")\n}", "func (o CMFBalanceChargeAdminSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), cmfBalanceChargeAdminPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE `cmf_balance_charge_admin` SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, cmfBalanceChargeAdminPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in cmfBalanceChargeAdmin slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all cmfBalanceChargeAdmin\")\n\t}\n\treturn rowsAff, nil\n}", "func (o *Store) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error {\n\tif o == nil {\n\t\treturn errors.New(\"models: no stores provided for upsert\")\n\t}\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\tif o.CreatedAt.IsZero() {\n\t\t\to.CreatedAt = currTime\n\t\t}\n\t\to.UpdatedAt = currTime\n\t}\n\n\tnzDefaults := queries.NonZeroDefaultSet(storeColumnsWithDefault, o)\n\n\t// Build cache key in-line uglily - mysql vs psql problems\n\tbuf := strmangle.GetBuffer()\n\tif updateOnConflict {\n\t\tbuf.WriteByte('t')\n\t} else {\n\t\tbuf.WriteByte('f')\n\t}\n\tbuf.WriteByte('.')\n\tfor _, c := range conflictColumns {\n\t\tbuf.WriteString(c)\n\t}\n\tbuf.WriteByte('.')\n\tbuf.WriteString(strconv.Itoa(updateColumns.Kind))\n\tfor _, c := range updateColumns.Cols {\n\t\tbuf.WriteString(c)\n\t}\n\tbuf.WriteByte('.')\n\tbuf.WriteString(strconv.Itoa(insertColumns.Kind))\n\tfor _, c := range insertColumns.Cols {\n\t\tbuf.WriteString(c)\n\t}\n\tbuf.WriteByte('.')\n\tfor _, c := range nzDefaults {\n\t\tbuf.WriteString(c)\n\t}\n\tkey := buf.String()\n\tstrmangle.PutBuffer(buf)\n\n\tstoreUpsertCacheMut.RLock()\n\tcache, cached := storeUpsertCache[key]\n\tstoreUpsertCacheMut.RUnlock()\n\n\tvar err error\n\n\tif !cached {\n\t\tinsert, ret := insertColumns.InsertColumnSet(\n\t\t\tstoreAllColumns,\n\t\t\tstoreColumnsWithDefault,\n\t\t\tstoreColumnsWithoutDefault,\n\t\t\tnzDefaults,\n\t\t)\n\t\tupdate := updateColumns.UpdateColumnSet(\n\t\t\tstoreAllColumns,\n\t\t\tstorePrimaryKeyColumns,\n\t\t)\n\n\t\tif updateOnConflict && len(update) == 0 {\n\t\t\treturn errors.New(\"models: unable to upsert stores, could not build update column list\")\n\t\t}\n\n\t\tconflict := conflictColumns\n\t\tif len(conflict) == 0 {\n\t\t\tconflict = make([]string, len(storePrimaryKeyColumns))\n\t\t\tcopy(conflict, storePrimaryKeyColumns)\n\t\t}\n\t\tcache.query = buildUpsertQueryPostgres(dialect, \"\\\"stores\\\"\", updateOnConflict, ret, update, conflict, insert)\n\n\t\tcache.valueMapping, err = queries.BindMapping(storeType, storeMapping, insert)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(ret) != 0 {\n\t\t\tcache.retMapping, err = queries.BindMapping(storeType, storeMapping, ret)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tvalue := reflect.Indirect(reflect.ValueOf(o))\n\tvals := queries.ValuesFromMapping(value, cache.valueMapping)\n\tvar returns []interface{}\n\tif len(cache.retMapping) != 0 {\n\t\treturns = queries.PtrsFromMapping(value, cache.retMapping)\n\t}\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, vals)\n\t}\n\tif len(cache.retMapping) != 0 {\n\t\terr = exec.QueryRowContext(ctx, cache.query, vals...).Scan(returns...)\n\t\tif err == sql.ErrNoRows {\n\t\t\terr = nil // Postgres doesn't return anything when there's no update\n\t\t}\n\t} else {\n\t\t_, err = exec.ExecContext(ctx, cache.query, vals...)\n\t}\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to upsert stores\")\n\t}\n\n\tif !cached {\n\t\tstoreUpsertCacheMut.Lock()\n\t\tstoreUpsertCache[key] = cache\n\t\tstoreUpsertCacheMut.Unlock()\n\t}\n\n\treturn nil\n}", "func (o *Vote) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\tvoteUpdateCacheMut.RLock()\n\tcache, cached := voteUpdateCache[key]\n\tvoteUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tvoteAllColumns,\n\t\t\tvotePrimaryKeyColumns,\n\t\t)\n\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update vote, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"vote\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, votePrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(voteType, voteMapping, append(wl, votePrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update vote row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for vote\")\n\t}\n\n\tif !cached {\n\t\tvoteUpdateCacheMut.Lock()\n\t\tvoteUpdateCache[key] = cache\n\t\tvoteUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "func (o *Vote) Update(exec boil.Executor, whitelist ...string) error {\n\tcurrTime := time.Now().In(boil.GetLocation())\n\n\to.UpdatedAt = currTime\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(exec); err != nil {\n\t\treturn err\n\t}\n\tkey := makeCacheKey(whitelist, nil)\n\tvoteUpdateCacheMut.RLock()\n\tcache, cached := voteUpdateCache[key]\n\tvoteUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := strmangle.UpdateColumnSet(\n\t\t\tvoteColumns,\n\t\t\tvotePrimaryKeyColumns,\n\t\t\twhitelist,\n\t\t)\n\n\t\tif len(whitelist) == 0 {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"models: unable to update vote, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `vote` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, votePrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(voteType, voteMapping, append(wl, votePrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to update vote row\")\n\t}\n\n\tif !cached {\n\t\tvoteUpdateCacheMut.Lock()\n\t\tvoteUpdateCache[key] = cache\n\t\tvoteUpdateCacheMut.Unlock()\n\t}\n\n\treturn o.doAfterUpdateHooks(exec)\n}", "func (b *Backend) Update() (c context.Context, err error) {\n\tvar m Mutation\n\tfor {\n\t\terr = b.cursor.Next(c, &m)\n\t\tif err == scroll.Done {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn\n\t\t}\n\t\tm.Update(b)\n\t}\n\treturn\n}", "func (o *Repository) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\trepositoryUpdateCacheMut.RLock()\n\tcache, cached := repositoryUpdateCache[key]\n\trepositoryUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\trepositoryAllColumns,\n\t\t\trepositoryPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update repositories, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `repositories` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, repositoryPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(repositoryType, repositoryMapping, append(wl, repositoryPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update repositories row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for repositories\")\n\t}\n\n\tif !cached {\n\t\trepositoryUpdateCacheMut.Lock()\n\t\trepositoryUpdateCache[key] = cache\n\t\trepositoryUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func TestUpdate(T *testing.T) {\n\tvar db etcdDB\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintln(w, `{\"action\":\"set\",\"node\":{\"key\":\"/testDir\",\"value\":\"Hello\",\"modifiedIndex\":4,\"createdIndex\":4}}`)\n\t}))\n\n\tdefer ts.Close()\n\n\tconfig := ts.URL\n\tdb.Cfg = cli.Config{\n\t\tEndpoints: []string{config},\n\t\tTransport: cli.DefaultTransport,\n\t\t// set timeout per request to fail fast when the target endpoint is unavailable\n\t\tHeaderTimeoutPerRequest: time.Second,\n\t}\n\n\tdb.C, _ = cli.New(db.Cfg)\n\n\tdb.Kapi = cli.NewKeysAPI(db.C)\n\tdb.Ctx = context.Background()\n\n\terr := db.Update(\"/testDir\", \"Hello\", true)\n\n\tif err != nil {\n\t\tT.Fail()\n\t}\n\n}", "func (t *TableStruct) Update(id int, doc map[string]string) (err error) {\n\tif t == nil {\n\t\terr = fmt.Errorf(\"%s\", \"Requested table does not exist\")\n\t\treturn\n\t}\n\n\tif id > t.IndexNum {\n\t\terr = fmt.Errorf(\"%s\", \"id is missing\")\n\t\treturn\n\t}\n\n\tfor name, val := range doc {\n\t\tif _, ok := t.Fields[name]; !ok {\n\t\t\t//if field not exist - just skip it\n\t\t\tcontinue\n\t\t}\n\t\tfield := t.Fields[name]\n\n\t\tif len(val) > field.Size {\n\t\t\tval = val[0:field.Size]\n\t\t}\n\n\t\tvar b []byte\n\t\tmisslen := field.Size - len(val)\n\t\tb = append([]byte(val), make([]byte, misslen)...)\n\t\t_, err = field.File.WriteAt(b, int64(id*field.Size))\n\t}\n\n\treturn\n}", "func (o *AutomodRuleDatum) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\tautomodRuleDatumUpdateCacheMut.RLock()\n\tcache, cached := automodRuleDatumUpdateCache[key]\n\tautomodRuleDatumUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tautomodRuleDatumAllColumns,\n\t\t\tautomodRuleDatumPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update automod_rule_data, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"automod_rule_data\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, automodRuleDatumPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(automodRuleDatumType, automodRuleDatumMapping, append(wl, automodRuleDatumPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update automod_rule_data row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for automod_rule_data\")\n\t}\n\n\tif !cached {\n\t\tautomodRuleDatumUpdateCacheMut.Lock()\n\t\tautomodRuleDatumUpdateCache[key] = cache\n\t\tautomodRuleDatumUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "func (u *__Room_Updater) Update(db XODB) (int, error) {\n\tvar err error\n\n\tvar updateArgs []interface{}\n\tvar sqlUpdateArr []string\n\tfor up, newVal := range u.updates {\n\t\tsqlUpdateArr = append(sqlUpdateArr, up)\n\t\tupdateArgs = append(updateArgs, newVal)\n\t}\n\tsqlUpdate := strings.Join(sqlUpdateArr, \",\")\n\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tvar allArgs []interface{}\n\tallArgs = append(allArgs, updateArgs...)\n\tallArgs = append(allArgs, whereArgs...)\n\n\tsqlstr := `UPDATE ms.room SET ` + sqlUpdate\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tXOLog(sqlstr, allArgs)\n\tres, err := db.Exec(sqlstr, allArgs...)\n\tif err != nil {\n\t\tXOLogErr(err)\n\t\treturn 0, err\n\t}\n\n\tnum, err := res.RowsAffected()\n\tif err != nil {\n\t\tXOLogErr(err)\n\t\treturn 0, err\n\t}\n\n\treturn int(num), nil\n}", "func (o *SysDB) Update(db *gorm.DB, fields ...SysDBDBSchemaField) error {\n\tdbNameToFieldName := map[string]interface{}{\n\t\t\"id\": o.ID,\n\t\t\"show_name\": o.ShowName,\n\t\t\"host\": o.Host,\n\t\t\"port\": o.Port,\n\t\t\"user\": o.User,\n\t\t\"password\": o.Password,\n\t\t\"db_name\": o.DBName,\n\t\t\"created_at\": o.CreatedAt,\n\t\t\"updated_at\": o.UpdatedAt,\n\t}\n\tu := map[string]interface{}{}\n\tfor _, f := range fields {\n\t\tfs := f.String()\n\t\tu[fs] = dbNameToFieldName[fs]\n\t}\n\tif err := db.Model(o).Updates(u).Error; err != nil {\n\t\tif err == gorm.ErrRecordNotFound {\n\t\t\treturn err\n\t\t}\n\n\t\treturn fmt.Errorf(\"can't update SysDB %v fields %v: %s\",\n\t\t\to, fields, err)\n\t}\n\n\treturn nil\n}", "func (b *Builder) Update(updates ...Eq) *Builder {\r\n\tb.updates = updates\r\n\tb.optype = updateType\r\n\treturn b\r\n}", "func (m *SQLIgnoreStore) Update(id int, rule *IgnoreRule) error {\n\tstmt := `UPDATE ignorerule SET updated_by=?, expires=?, query=?, note=? WHERE id=?`\n\n\tres, err := m.vdb.DB.Exec(stmt, rule.UpdatedBy, rule.Expires.Unix(), rule.Query, rule.Note, rule.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tn, err := res.RowsAffected()\n\tif err == nil && n == 0 {\n\t\treturn fmt.Errorf(\"Did not find an IgnoreRule with id: %d\", id)\n\t}\n\tm.inc()\n\treturn nil\n}", "func (o ItemSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), itemPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"items\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 0, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, itemPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in item slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all item\")\n\t}\n\treturn rowsAff, nil\n}", "func (o HoldenAtSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), holdenAtPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE \\\"HoldenAt\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, holdenAtPrimaryKeyColumns, len(o)))\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in holdenAt slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all holdenAt\")\n\t}\n\treturn rowsAff, nil\n}" ]
[ "0.53321916", "0.5310427", "0.5304057", "0.5290424", "0.52536964", "0.5223758", "0.5218239", "0.5211529", "0.5206224", "0.5174038", "0.51708364", "0.5149535", "0.51188", "0.5112181", "0.5062066", "0.49757835", "0.4972469", "0.49406815", "0.49391848", "0.493276", "0.49311072", "0.49192944", "0.49192944", "0.48968837", "0.48887056", "0.4886131", "0.48677903", "0.48657212", "0.4865557", "0.48646715", "0.48562282", "0.48367456", "0.48120964", "0.48048437", "0.4794715", "0.47716355", "0.4760329", "0.47545445", "0.4753615", "0.47389293", "0.47369036", "0.47350627", "0.47178683", "0.47169754", "0.4710537", "0.4709137", "0.47032768", "0.47013855", "0.47013566", "0.46999383", "0.46979427", "0.46965903", "0.46931666", "0.46900767", "0.46777496", "0.46757483", "0.46755084", "0.46742752", "0.46730766", "0.46725395", "0.46628505", "0.46595618", "0.4650766", "0.46486142", "0.46389863", "0.46261913", "0.4622737", "0.46182472", "0.461343", "0.46124095", "0.45892054", "0.45856413", "0.4585266", "0.45837367", "0.45714536", "0.45655543", "0.45600554", "0.4556554", "0.45444942", "0.45441714", "0.45431787", "0.45402473", "0.45382312", "0.45372784", "0.4532298", "0.45311594", "0.45283407", "0.45282745", "0.45280692", "0.45265913", "0.45241445", "0.4519387", "0.4516854", "0.45165655", "0.45151302", "0.45138702", "0.45137188", "0.4509855", "0.45097363", "0.45087925" ]
0.74732876
0
LogAllKeys Prints the content of memory manager
LogAllKeys Печатает содержимое менеджера памяти
func (mgr *LocalHashMapDBMgr) LogAllKeys() { for k, e := range mgr.memMap { glog.Infof("%v: %v", k, e) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *LRUCache) PrintAll() {\n\tc.mutex.RLock()\n\tdefer c.mutex.RUnlock()\n\tfor e := c.cacheList.Front(); e != nil; e = e.Next() {\n\t\tfmt.Printf(\"[%v, %v] \", e.Value.(*entry).key, e.Value.(*entry).value)\n\t}\n\tfmt.Println()\n\treturn\n}", "func PrintAll(c config.Config) error {\n\tlog.Info(\"Opening session for all entries in vault\")\n\tcleartextValues, err := decryptVault(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmenuItems := []string{}\n\tfor key := range cleartextValues {\n\t\tmenuItems = append(menuItems, key)\n\t}\n\n\tprintWithMenu(menuItems, cleartextValues, c.DecryptSessionTimeout)\n\treturn nil\n}", "func (fr *FileRing) PrintStore() {\n\tfr.lock.RLock()\n\tdefer fr.lock.RUnlock()\n\tfmt.Println(\"Files being stored at this machine:\")\n\tfor _, m := range fr.hashMap {\n\t\tj := 0\n\t\tfor _, f := range m.SortedFiles() {\n\t\t\tif f.Tombstone {\n\t\t\t\tfmt.Printf(\"%v TOMBSTONE\\n\", f.File)\n\t\t\t} else {\n\t\t\t\tj += 1\n\t\t\t\tif f.AutoTombstone {\n\t\t\t\t\tfmt.Printf(\"%v (Version %v)\\t%v\\tDELETED\\n\", f.File, j, f.Sequence)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"%v (Version %v)\\t%v\\n\", f.File, j, f.Sequence)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "func DisplayAll() {\n\n\tif len(dataStorageMap) == 0 {\n\t\tfmt.Println(\"Data Storage Empty!!! No data Found !!!\")\n\t} else {\n\t\tfor key, val := range dataStorageMap {\n\t\t\tfmt.Println(key, \"-->\", val)\n\t\t}\n\t}\n}", "func Print(key Type) {\n\tmutex.RLock()\n\tdefer mutex.RUnlock()\n\n\tklog.Infof(\"%s: %s\", key, GlobalStats[key])\n}", "func Print(key Type) {\n\tmutex.RLock()\n\tdefer mutex.RUnlock()\n\n\tklog.Infof(\"%s: %s\", key, globalStats[key])\n}", "func Log(m map[string]interface{}) {\n\tfmt.Println(\"[debug] →\")\n\tfor k, v := range m {\n\t\tfmt.Printf(\"\\t%v: %+v\\n\", k, v)\n\t}\n\tfmt.Println(\"[debug] □\")\n}", "func Dump(nodes *map[string]storage.Node) {\n\tt := time.Now()\n\tf, _ := os.Create(strings.Join([]string{\"persister/data/dump_\", getTimeStr(t), \".log\"}, \"\"))\n\tdefer f.Close()\n\tfor k, v := range *nodes {\n\t\tf.WriteString(\"key: \" + k + \" \" + v.String() + \"\\n\")\n\t}\n\n}", "func (d *data) printAll(logFileName string) {\n\n\tfileLocation := \"/\" + d.logFileLocation + \"/\" + logFileName\n\tfile, err := os.Open(fileLocation)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t}\n\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\tscanner.Split(bufio.ScanLines)\n\n\tfor scanner.Scan() {\n\t\tfmt.Println(scanner.Text())\n\t}\n}", "func (m *DBMem) PrintDB() {\n m.RLock()\n defer m.RUnlock()\n\n for i := 0; i < len(m.data); i++ {\n fmt.Println(\"ID:\", i, m.data[i])\n }\n}", "func ListAllKeys() error {\n\n\tdb := Connect()\n\n\tif ExistDb(PathDb) {\n\n\t\tfmt.Println(\"Exist\", db)\n\n\t} else {\n\n\t\tfmt.Println(\"Not exist!\")\n\t\tos.Exit(1)\n\t}\n\n\tdb.View(func(tx *bolt.Tx) error {\n\n\t\t// Assume bucket exists and has keys\n\t\tb := tx.Bucket([]byte(Database))\n\n\t\tc := b.Cursor()\n\n\t\tfor k, v := c.First(); k != nil; k, v = c.Next() {\n\n\t\t\tfmt.Printf(\"key=%s, value=%s\\n\", k, v)\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn nil\n\n}", "func (u *LRU) show() {\n\tfmt.Println(\"MAP:\")\n\tfor k, v := range u.entries {\n\t\tvv := v.Value.(kvpair)\n\t\tfmt.Printf(\"K:%20s K2: %20s V:%20s\\n\", k, vv.Key, vv.Value)\n\t}\n\tfmt.Println(\"LIST:\")\n\tfor elem := u.last.Front(); elem != nil; elem = elem.Next() {\n\t\tvv := elem.Value.(kvpair)\n\t\tfmt.Printf(\"kvpair:%+v\\n\", vv)\n\t}\n}", "func (l *Log) DumpLog() {\n\tfor _, v := range l.Entries {\n\t\tfmt.Println(v)\n\t}\n}", "func printScanKey(ch <-chan []string) {\n\tfor {\n\t\tfor _, v := range <-ch {\n\t\t\tfmt.Println(v)\n\t\t}\n\t}\n}", "func (o *IgmpFlowTbl) dumpAll() {\n\n\tvar it core.DListIterHead\n\tcnt := 0\n\tfor it.Init(&o.head); it.IsCont(); it.Next() {\n\t\te := covertToIgmpEntry(it.Val())\n\t\tfmt.Printf(\" %v:%v \\n\", cnt, e.Ipv4)\n\t\tcnt++\n\t}\n}", "func PrintMap(m map[string]string) {\n\tfor k := range m {\n\t log.Println(\"\\t\",k,\"=\",m[k])\n\t}\n}", "func printKV(ag *alertGroup, m *sync.Mutex) {\n\tm.Lock()\n\tfor _, alert := range ag.Alerts {\n\n\t\tfmt.Printf(\"\\\"status: %s\\\", \", alert.Status)\n\n\t\tfor k, v := range alert.Labels {\n\t\t\tfmt.Printf(\"\\\"%s: %s\\\", \", k, v)\n\t\t}\n\t\tfor k, v := range alert.Annotations {\n\t\t\tfmt.Printf(\"\\\"%s: %s\\\", \", k, v)\n\t\t}\n\t\tfmt.Printf(\"\\\"startsAt: %s\\\", \\\"endsAt: %s\\\"\\n\", alert.StartsAt.Truncate(time.Millisecond), alert.EndsAt.Truncate(time.Millisecond))\n\t}\n\tm.Unlock()\n}", "func (h *MaxKeyHeap) Print() {\n\tfor i := 0; i < h.Len(); i++ {\n\t\tfmt.Printf(\"%v \", (*h)[i])\n\t}\n\tprintln(\"\")\n}", "func (store KeyValue) Dump() {\n\t// TODO: Dump out debugging information here\n\ttexts := store.database.Stats()\n\tfor key, value := range texts {\n\t\tlog.Debug(\"Stat\", key, value)\n\t}\n\n\titer := store.database.Iterator(nil, nil)\n\tfor ; iter.Valid(); iter.Next() {\n\t\thash := iter.Key()\n\t\tnode := iter.Value()\n\t\tlog.Debug(\"Row\", hash, node)\n\t}\n}", "func (s *LoginServer) printServerKeys(w http.ResponseWriter) {\n\n\tfmt.Fprintf(w, \"List of server keys\\n\")\n\tfmt.Fprintf(w, \"-------------------\\n\")\n\tfmt.Fprintf(w, \"Index\\tValue\\n\")\n\tfor _, key := range s.Keys.ServiceKeys() {\n\t\tfmt.Fprintf(w, \"%v\\t%v\\n\", key.Index, hex.EncodeToString(key.Value[:]))\n\t}\n}", "func (am *AccountManager) DumpKeys() ([]string, error) {\n\tvar keys []string\n\tfor _, a := range am.AllAccounts() {\n\t\tswitch walletKeys, err := a.DumpPrivKeys(); err {\n\t\tcase wallet.ErrWalletLocked:\n\t\t\treturn nil, err\n\n\t\tcase nil:\n\t\t\tkeys = append(keys, walletKeys...)\n\n\t\tdefault: // any other non-nil error\n\t\t\treturn nil, err\n\t\t}\n\n\t}\n\treturn keys, nil\n}", "func (session KeyValueSession) Dump() {\n\ttexts := session.store.database.Stats()\n\tfor key, value := range texts {\n\t\tlog.Debug(\"Stat\", key, value)\n\t}\n\n\titer := session.store.database.Iterator(nil, nil)\n\tfor ; iter.Valid(); iter.Next() {\n\t\thash := iter.Key()\n\t\tnode := iter.Value()\n\t\tlog.Debug(\"Row\", hash, node)\n\t}\n}", "func (eh *Hashset) PrintAll() {\n\tfor _, page := range eh.pages {\n\t\tfor _, v := range page.items {\n\t\t\tfmt.Println(v)\n\t\t}\n\t}\n}", "func (kvStore *KVStore) DumpStore() []KVPair {\n els := make([]KVPair, len(kvStore.mapping))\n\n i := 0\n for k, v := range kvStore.mapping {\n els[i] = KVPair{k, *v}\n i++\n }\n\n return els\n}", "func ( handle * MemcacheClient) GetAllKey( ) ([]string ,error){\n\treturn nil,nil\n}", "func GetLogKeys() map[string]bool {\n\tconsoleLogKeys := ConsoleLogKey().EnabledLogKeys()\n\tlogKeys := make(map[string]bool, len(consoleLogKeys))\n\tfor _, v := range consoleLogKeys {\n\t\tlogKeys[v] = true\n\t}\n\treturn logKeys\n}", "func KeyLog(rw io.ReadWriter) (err error) {\r\n\t// Query key mapped to integer `0x00` to `0xFF` if it's pressed.\r\n\tfor i := 0; i < 0xFF; i++ {\r\n\t\tasynch, _, _ := syscall.Syscall(procGetAsyncKeyState.Addr(), 1, uintptr(i), 0, 0)\r\n\r\n\t\t// If the least significant bit is set ignore it.\r\n\t\t//\r\n\t\t// As it's written in the documentation:\r\n\t\t// `if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState.`\r\n\t\t// Which we don't care about :)\r\n\t\tif asynch&0x1 == 0 {\r\n\t\t\tcontinue\r\n\t\t}\r\n\r\n\t\t// Write i to rw.\r\n\t\terr = writeKey(i, rw)\r\n\r\n\t\tif err != nil {\r\n\t\t\treturn err\r\n\t\t}\r\n\t}\r\n\r\n\treturn nil\r\n}", "func printCmd(cmd data.ShareCommand) {\n\tfor _, v := range cmd.Data() {\n\t\tlog.Println(v)\n\t}\n}", "func (consensus *Consensus) DebugPrintPublicKeys() {\n\tfor _, k := range consensus.PublicKeys {\n\t\tstr := fmt.Sprintf(\"%s\", k)\n\t\tutils.GetLogInstance().Debug(\"pk:\", \"string\", str)\n\t}\n\n\tutils.GetLogInstance().Debug(\"PublicKeys:\", \"#\", len(consensus.PublicKeys))\n}", "func (dbm *MemDB) Print() error {\n\tdbm.mtx.RLock()\n\tdefer dbm.mtx.RUnlock()\n\n\tdbm.btree.Ascend(func(i btree.Item) bool {\n\t\titem := i.(*item)\n\t\tfmt.Printf(\"[%X]:\\t[%X]\\n\", item.key, item.value)\n\t\treturn true\n\t})\n\treturn nil\n}", "func (m *MemoryStorage) GetAll() (map[string]Entry, error) {\n\treturn m.entries, nil\n}", "func (lmem *lockedMemRepo) List() ([]string, error) {\n\tif err := lmem.checkToken(); err != nil {\n\t\treturn nil, err\n\t}\n\tlmem.RLock()\n\tdefer lmem.RUnlock()\n\n\tres := make([]string, 0, len(lmem.mem.keystore))\n\tfor k := range lmem.mem.keystore {\n\t\tres = append(res, k)\n\t}\n\treturn res, nil\n}", "func (s *DNSControllerScope) AllKeys() []string {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\n\tvar keys []string\n\tfor k := range s.Records {\n\t\tkeys = append(keys, k)\n\t}\n\treturn keys\n}", "func main1() {\n\twg := sync.WaitGroup{}\n\tfor i := 0; i < 20; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tkey := strconv.Itoa(i)\n\t\t\tset(key, i)\n\t\t\tfmt.Printf(\"key:%v,value:%v \\n\", key, i)\n\t\t\twg.Done()\n\t\t}()\n\t}\n\twg.Wait()\n\tfmt.Println(len(m))\n}", "func (l *MemoryLogger) Debug(msg string, keyvals ...interface{}) {\n\tl.println(\"DEBUG\", msg, keyvals)\n}", "func (list *APTAuditList) printAll() {\n\tfor _, result := range list.results {\n\t\tfmt.Print(result)\n\t}\n}", "func printHostStorageMapVerbose(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error {\n\tfor _, key := range hsm.Keys() {\n\t\thss := hsm[key]\n\t\thosts := getPrintHosts(hss.HostSet.RangedString(), opts...)\n\t\tlineBreak := strings.Repeat(\"-\", len(hosts))\n\t\tfmt.Fprintf(out, \"%s\\n%s\\n%s\\n\", lineBreak, hosts, lineBreak)\n\t\tfmt.Fprintf(out, \"HugePage Size: %d KB\\n\", hss.HostStorage.MemInfo.HugepageSizeKiB)\n\t\tif len(hss.HostStorage.ScmNamespaces) == 0 {\n\t\t\tif err := PrintScmModules(hss.HostStorage.ScmModules, out, opts...); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := PrintScmNamespaces(hss.HostStorage.ScmNamespaces, out, opts...); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintln(out)\n\t\tif err := PrintNvmeControllers(hss.HostStorage.NvmeDevices, out, opts...); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintln(out)\n\t}\n\n\treturn nil\n}", "func (kb *Keybase) List() ([]keys.Info, error) {\n\tkb.mx.Lock()\n\tdefer kb.mx.Unlock()\n\treturn kb.kb.List()\n}", "func PrintMetaMap(metaMap map[string]*FileMetaData) {\n\n\tfmt.Println(\"--------BEGIN PRINT MAP--------\")\n\n\tfor _, filemeta := range metaMap {\n\t\tfmt.Println(\"\\t\", filemeta.Filename, filemeta.Version, filemeta.BlockHashList)\n\t}\n\n\tfmt.Println(\"---------END PRINT MAP--------\")\n\n}", "func (i *Instance) AllKeys() []string {\n\trows, err := i.db.Query(`SELECT key FROM config`)\n\tif err != nil {\n\t\tmultilog.Error(\"config:AllKeys query failed: %s\", errs.JoinMessage(err))\n\t\treturn nil\n\t}\n\tvar keys []string\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar key string\n\t\trows.Scan(&key)\n\t\tkeys = append(keys, key)\n\t}\n\treturn keys\n}", "func showlog(w http.ResponseWriter, _req *http.Request) {\n\tstoreLock.RLock()\n\tvar slogs = make([]*proto.SlowlogEntries, len(storeMap))\n\tidx := 0\n\tfor _, s := range storeMap {\n\t\tslogs[idx] = s.Reply()\n\t\tidx++\n\t}\n\tstoreLock.RUnlock()\n\n\tencoder := json.NewEncoder(w)\n\terr := encoder.Encode(slogs)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"%s\", err), http.StatusInternalServerError)\n\t}\n}", "func PrintMetaMap(metaMap map[string]FileMetaData) {\n\n\tfmt.Println(\"--------BEGIN PRINT MAP--------\")\n\n\tfor _, filemeta := range metaMap {\n\t\tfmt.Println(\"\\t\", filemeta.Filename, filemeta.Version, filemeta.BlockHashList)\n//\t\tfmt.Println(\"\\t\", filemeta.Filename, filemeta.Version)\n\t}\n\n\tfmt.Println(\"---------END PRINT MAP--------\")\n\n}", "func (l *MemoryLogger) Info(msg string, keyvals ...interface{}) {\n\tl.println(\"INFO \", msg, keyvals)\n}", "func keys(c *cli.Context) {\n\tif c.NArg() < 1 {\n\t\tfmt.Fprintln(c.App.ErrWriter, \"keys requires at least 1 argument\")\n\t\tcli.ShowCommandHelp(c, \"keys\")\n\t\treturn\n\t}\n\tfor _, filepath := range c.Args() {\n\t\tdecoder := decoder.NewDecoder()\n\t\tgo dump.Decode(c, decoder, filepath)\n\t\tfor e := range decoder.Entries {\n\t\t\tfmt.Fprintf(c.App.Writer, \"%v\\n\", e.Key)\n\t\t}\n\t}\n}", "func PrintCommands() {\n logger.Log(fmt.Sprintln(\"** Daemonized Commands **\"))\n for cmd, desc := range DaemonizedCommands() {\n logger.Log(fmt.Sprintf(\"%15s: %s\\n\", cmd, desc.description))\n }\n\n logger.Log(fmt.Sprintln(\"** Information Commands **\"))\n for cmd, desc := range InfoCommands() {\n logger.Log(fmt.Sprintf(\"%15s: %s\\n\", cmd, desc.description))\n }\n\n logger.Log(fmt.Sprintln(\"** Interactive Commands **\"))\n for cmd, desc := range InteractiveCommands() {\n logger.Log(fmt.Sprintf(\"%15s: %s\\n\", cmd, desc.description))\n }\n}", "func prettyPrintKeys(keyStores []trustmanager.KeyStore, writer io.Writer) {\n\tvar info []keyInfo\n\n\tfor _, store := range keyStores {\n\t\tfor keyID, keyIDInfo := range store.ListKeys() {\n\t\t\tinfo = append(info, keyInfo{\n\t\t\t\trole: keyIDInfo.Role,\n\t\t\t\tlocation: store.Name(),\n\t\t\t\tgun: keyIDInfo.Gun,\n\t\t\t\tkeyID: keyID,\n\t\t\t})\n\t\t}\n\t}\n\n\tif len(info) == 0 {\n\t\twriter.Write([]byte(\"No signing keys found.\\n\"))\n\t\treturn\n\t}\n\n\tsort.Stable(keyInfoSorter(info))\n\n\ttw := initTabWriter([]string{\"ROLE\", \"GUN\", \"KEY ID\", \"LOCATION\"}, writer)\n\n\tfor _, oneKeyInfo := range info {\n\t\tfmt.Fprintf(\n\t\t\ttw,\n\t\t\tfourItemRow,\n\t\t\toneKeyInfo.role,\n\t\t\ttruncateWithEllipsis(oneKeyInfo.gun.String(), maxGUNWidth, true),\n\t\t\toneKeyInfo.keyID,\n\t\t\ttruncateWithEllipsis(oneKeyInfo.location, maxLocWidth, true),\n\t\t)\n\t}\n\ttw.Flush()\n}", "func (m *MemoryStorer) All() ([]string, error) {\n\tm.mut.RLock()\n\tdefer m.mut.RUnlock()\n\n\tsessions := make([]string, len(m.sessions))\n\n\ti := 0\n\tfor id := range m.sessions {\n\t\tsessions[i] = id\n\t\ti++\n\t}\n\n\treturn sessions, nil\n}", "func (proxy *StandAloneProxyConfig) Log() {\n\tfmt.Println(\"---------------------\")\n\tfmt.Println(\"managedArrays\")\n\tfor key, val := range proxy.managedArrays {\n\t\tfmt.Printf(\"%s ::: %+v\\n\", key, val)\n\t}\n\tfmt.Println(\"---------------------\")\n\tfmt.Println(\"---------------------\")\n\tfmt.Println(\"managementServers\")\n\tfor key, val := range proxy.managementServers {\n\t\tfmt.Printf(\"%v ::: %+v\\n\", key, val)\n\t}\n\tfmt.Println(\"---------------------\")\n\tfmt.Println(\"---------------------\")\n\tfmt.Println(\"proxyCredentials\")\n\tfor key, val := range proxy.proxyCredentials {\n\t\tfmt.Printf(\"%s ::: %+v\\n\", key, val)\n\t}\n\tfmt.Println(\"---------------------\")\n}", "func (m *Map) Print() {\n\tfmt.Println(\"Map size:\", m.area)\n\n\tfor y := uint8(0); y < m.area.height; y++ {\n\t\tfmt.Printf(\"%4d |\", y)\n\n\t\tfor x := uint8(0); x < m.area.width; x++ {\n\t\t\tif p := atomic.LoadPointer(m.fields[y][x]); fieldIsEmpty(p) {\n\t\t\t\tfmt.Print(\" .\")\n\t\t\t} else {\n\t\t\t\tfmt.Print(\" x\")\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println()\n\t}\n}", "func (r *reflectorStore) ListKeys() []string {\n\tpanic(\"not implemented\")\n}", "func (ks *KeyStore) PrintTokenSlots() {\n\tp, err := initializeLib()\n\tif err != nil {\n\t\tlogrus.Errorf(err.Error())\n\t\treturn\n\t}\n\tslots, err := p.GetSlotList(true)\n\tif err != nil {\n\t\tdefer common.FinalizeAndDestroy(p)\n\t\tlogrus.Errorf(\"loaded library %s, but failed to list HSM slots %s\", pkcs11Lib, err)\n\t\treturn\n\t}\n\tdefer common.FinalizeAndDestroy(p)\n\tprettyPrintTokens(slots, os.Stdout, p)\n}", "func show(keyStr string) {\n\tkeys, err := keybinding.ParseAll(keyStr)\n\tif err != nil {\n\t\tfmt.Println(\"Error parsing\", keyStr, \":\", err)\n\t} else {\n\t\tfmt.Println(\"Key: \", keyStr, \"=\", keys)\n\t}\n}", "func PrintAllPods() {\n\tcfg := &etcd.ClientConfig{\n\t\tConfig: &clientv3.Config{\n\t\t\tEndpoints: []string{\"127.0.0.1:32379\"},\n\t\t},\n\t\tOpTimeout: 1 * time.Second,\n\t}\n\t// Create connection to etcd.\n\tdb, err := etcd.NewEtcdConnectionWithBytes(*cfg, logrus.DefaultLogger())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\titr, err := db.ListValues(\"/vnf-agent/contiv-ksr/allocatedIDs/\")\n\tif err != nil {\n\t\tfmt.Printf(\"Error getting values\")\n\t\treturn\n\t}\n\tfor {\n\t\tkv, stop := itr.GetNext()\n\t\tif stop {\n\t\t\tfmt.Println()\n\t\t\tbreak\n\t\t}\n\t\tbuf := kv.GetValue()\n\t\tnodeInfo := &nodeinfomodel.NodeInfo{}\n\t\terr = json.Unmarshal(buf, nodeInfo)\n\t\tfmt.Println(\"\\n\" + nodeInfo.Name + \":\")\n\t\tfmt.Println(\"--------------\")\n\n\t\tPrintPodsPerNode(nodeInfo.ManagementIpAddress)\n\t}\n\tdb.Close()\n}", "func EnumerateDebugRenderableKeys() []string {\n\tkeys := []string{}\n\tdebugMap.Range(func(k, v interface{}) bool {\n\t\tkey, ok := k.(string)\n\t\tif ok {\n\t\t\tkeys = append(keys, key)\n\t\t}\n\t\treturn true\n\t})\n\treturn keys\n}", "func (d *DiskStorage) GetAll() (map[string]Entry, error) {\n\treturn d.memStorage.GetAll()\n}", "func List(memoryStorage *PassgenStorage) {\n\tif len(memoryStorage.Storage) == 0 {\n\t\thelpers.NegativePrintf(\"\\nThere is no item in your storage\\n\\n\")\n\t\treturn\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader([]string{\"Application Name\", \"User Name\", \"Password\"})\n\n\tfor _, v := range memoryStorage.Storage {\n\t\ttable.Append([]string{v.AppName, v.UserName, v.Password})\n\t}\n\ttable.Render()\n}", "func (cli *Cli) GetFreezedLogsAll(from, to int) map[string]*dai.Mapping {\n\tmappings := make(map[string]*dai.Mapping)\n\tfor {\n\t\tend := from + 100\n\t\tif end >= to {\n\t\t\tend = to\n\t\t}\n\t\tm := cli.GetFreezedLogsRetry(from, end, 5)\n\t\tlog.Printf(\"get freezed logs from %d to %d: %d logs\\n\", from, end, len(m))\n\t\tfor k, v := range m {\n\t\t\tmappings[k] = v\n\t\t}\n\t\tfrom = end + 1\n\t\tif from > to {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn mappings\n}", "func (m *Manager) clear() error {\n\tfor _, ch := range m.meter {\n\t\tif ch == '\\n' {\n\t\t\t_, err := os.Stdout.WriteString(\"\\x1b[1A\\x1b[2K\")\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}", "func (s *sequencer) dump() {\n\tif logrus.GetLevel() != logrus.TraceLevel {\n\t\treturn\n\t}\n\n\ts.lock.RLock()\n\tdefer s.lock.RUnlock()\n\n\tfor height := range s.blockPool {\n\t\tblk, err := s.get(height)\n\t\tif err == nil {\n\t\t\tlog.WithField(\"hash\", hex.EncodeToString(blk.Header.Hash)).\n\t\t\t\tWithField(\"height\", blk.Header.Height).\n\t\t\t\tTrace(\"sequencer item\")\n\t\t}\n\t}\n}", "func (c *AdapterMemory) Keys(ctx context.Context) ([]interface{}, error) {\n\treturn c.data.Keys()\n}", "func (cache Cache) ShowContent() {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\tfor e := cache.linkedList.Front(); e != nil; e = e.Next() {\n\t\tk := e.Value.(CacheStruct).key\n\t\tv := cache.cacheMap[k].Value.(CacheStruct).value\n\t\tfmt.Println(\" k and v\", k, v)\n\t}\n}", "func (ks *MemoryStore) RemoveAll() (err error) {\n\n\tfor key := range ks.Keys {\n\t\tdelete(ks.Keys, key)\n\t}\n\n\treturn\n}", "func printAllocations(c *cli.Context) error {\n\tvar rooms, err = controllers.GetRoomAllocations(con)\n\n\texitOnError(err)\n\n\tfor _, room := range rooms {\n\t\tprintRoomDetails(room)\n\t}\n\n\treturn nil\n}", "func (cfg *Config) Print() {\n fmt.Println(\"assigned key:\", cfg.ConsumerKey)\n}", "func (p *PubKey) PrintList() int {\n\treturn p.OutputList(os.Stdout)\n}", "func (p *Logger) flushLogs() {\n\tvar err error\n\tdefer func() {\n\t\tp.loopWait <- struct{}{}\n\t}()\n\tre := regexp.MustCompile(keyPattern)\n\tfor {\n\t\tselect {\n\t\tcase <-p.loopFactor:\n\t\t\treturn\n\t\tdefault:\n\t\t\those := make(chan interface{}, p.maxWorkers)\n\t\t\tvar wg sync.WaitGroup\n\n\t\t\t// workers\n\t\t\tfor i := 0; i < p.maxWorkers; i++ {\n\t\t\t\tp.env.ScheduleDaemon(func() {\n\t\t\t\t\tfor keyI := range hose {\n\t\t\t\t\t\tkey, _ := keyI.(string)\n\t\t\t\t\t\tmatch := re.FindStringSubmatch(key)\n\t\t\t\t\t\tif len(match) > 2 {\n\t\t\t\t\t\t\tif err = p.sendLogs(match[2]); err == nil {\n\t\t\t\t\t\t\t\tp.cmap.Delete(key)\n\t\t\t\t\t\t\t\twg.Done()\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttsN, _ := strconv.ParseInt(match[1], 10, 64)\n\t\t\t\t\t\t\tts := time.Unix(0, tsN)\n\n\t\t\t\t\t\t\tif time.Since(ts) > p.retentionPeriod {\n\t\t\t\t\t\t\t\tp.cmap.Delete(key)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\twg.Done()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tp.cmap.Range(func(k, v interface{}) bool {\n\t\t\t\twg.Add(1)\n\t\t\t\those <- k\n\t\t\t\treturn true\n\t\t\t})\n\t\t\twg.Wait()\n\t\t\tclose(hose)\n\t\t\ttime.Sleep(500 * time.Millisecond)\n\t\t}\n\t}\n}", "func (cf *Info) GetAllKeys() []string {\n\tkeys := []string{}\n\tfor key := range cf.objInfo {\n\t\tkeys = append(keys, key)\n\t}\n\n\tsort.Strings(keys)\n\treturn keys\n}", "func printKeysAndValues(l *log.Logger, keysAndValues ...interface{}) {\n\tfor i := 0; i < len(keysAndValues)/2; i += 2 {\n\t\tl.Printf(\"\\t%s = %s\\n\", keysAndValues[i], keysAndValues[i+1])\n\t}\n}", "func (l Log) ShowLog () {\n fmt.Printf(\"\\n\\n----------------------------------------------------------------------------\\n\")\n fmt.Printf(\" ACTIVITY LOG \\n\")\n for i := range l.Action {\n fmt.Printf(\"%s\\n\", l.Action[i])\n }\n fmt.Printf(\"____________________________________________________________________________\\n\")\n}", "func PrintBucketMap() string {\n\tbucketMap.RLock()\n\tdefer bucketMap.RUnlock()\n\n\tres := fmt.Sprintf(\"len:%d\\n\", len(bucketMap.m))\n\tres += \"keys:\\n\"\n\n\tfor k := range bucketMap.m {\n\t\tres += fmt.Sprintf(\"%s\\n\", k)\n\t}\n\n\treturn res\n}", "func (s *SSHOrch) ShowClientMap() {\n\tfor k, v := range s.lookup {\n\t\tfmt.Printf(\"%s:%s\\n\", k, v.LocalAddr())\n\t}\n}", "func List() []string {\n\tvar keys []string\n\tfor k := range loggers {\n\t\tkeys = append(keys, k)\n\t}\n\treturn keys\n}", "func (keyMask LogKey) EnabledLogKeys() []string {\n\tvar logKeys = make([]string, 0, len(logKeyNames))\n\tfor i := 0; i < len(logKeyNames); i++ {\n\t\tlogKey := LogKey(1) << uint32(i)\n\t\tif keyMask.enabled(logKey, false) {\n\t\t\tlogKeys = append(logKeys, LogKeyName(logKey))\n\t\t}\n\t}\n\treturn logKeys\n}", "func dumpMaps() {\n\t// TODO: make this function part of the exporter\n\tfor name, cmap := range builtinMetricMaps {\n\t\tquery, ok := queryOverrides[name]\n\t\tif !ok {\n\t\t\tfmt.Println(name)\n\t\t} else {\n\t\t\tfor _, queryOverride := range query {\n\t\t\t\tfmt.Println(name, queryOverride.versionRange, queryOverride.query)\n\t\t\t}\n\t\t}\n\n\t\tfor column, details := range cmap.columnMappings {\n\t\t\tfmt.Printf(\" %-40s %v\\n\", column, details)\n\t\t}\n\t\tfmt.Println()\n\t}\n}", "func (s *collectorCache) ListKeys() []string {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tkeys := make([]string, 0, len(s.collectorMap))\n\tfor k := range s.collectorMap {\n\t\tkeys = append(keys, k)\n\t}\n\treturn keys\n}", "func (hm *HashMap) GetAllKeyAsString() []string {\n\thm.lock.RLock()\n\tdefer hm.lock.RUnlock()\n\n\tmapList := make([]string, 0)\n\tfor val := range hm.data {\n\t\tmapList = append(mapList, val.String())\n\t}\n\treturn mapList\n}", "func dumpInfo(c chan os.Signal) {\n\tfor {\n\t\t<-c\n\t\tlog.Println(\"Signal caught - dumping runtime stats\")\n\t\tvar m runtime.MemStats\n\t\truntime.ReadMemStats(&m)\n\t\ts, _ := json.Marshal(m)\n\t\tlog.Println(\"MemStats JSON follows\")\n\t\tlog.Printf(\"%s\\n\", s)\n\t\tvar garC debug.GCStats\n\t\tdebug.ReadGCStats(&garC)\n\t\tlog.Printf(\"\\nLastGC:\\t%s\", garC.LastGC) // time of last collection\n\t\tlog.Printf(\"\\nNumGC:\\t%d\", garC.NumGC) // number of garbage collections\n\t\tlog.Printf(\"\\nPauseTotal:\\t%s\", garC.PauseTotal) // total pause for all collections\n\t\tlog.Printf(\"\\nPause:\\t%s\", garC.Pause) // pause history, most recent first\n\t\tlog.Println(\"debug.Stack: \" + string(debug.Stack()))\n\t\tlog.Println(\"runtime.NumGoroutine: \" + string(runtime.NumGoroutine()))\n\t}\n}", "func (p *PersistableEvent) ToStringKeys() []string {\n\treturn []string{\"type\", \"nodeID\", \"fullNodeID\", \"amount\", \"time\", \"manaType\", \"transactionID\", \"inputID\"}\n}", "func (ms *MemStore) GetAll(data map[string]io.ReaderFrom) error {\n\tvar err error\n\tms.mu.RLock()\n\tfor k, d := range data {\n\t\tbuf, ok := ms.data[k]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif _, err = d.ReadFrom(&buf); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tms.mu.RUnlock()\n\treturn err\n}", "func (km *Keystore) List() ([]string, error) {\n\tentries, err := km.ds.Query(query.Query{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkeys, err := entries.Rest()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ids []string\n\tfor _, v := range keys {\n\t\tids = append(ids, strings.Split(v.Key, \"/\")[1])\n\t}\n\treturn ids, nil\n}", "func (s Set) print() {\n\tvar (\n\t\tkeys []string\n\t)\n\n\tfor k := range s {\n\t\tkeys = append(keys, k)\n\t}\n\n\tsort.Strings(keys)\n\n\tfor _, k := range keys {\n\t\tfmt.Printf(\"%s -> \", k)\n\t\tfor _, v := range s[k] {\n\t\t\tfmt.Printf(\"%v \", v.name)\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}", "func (m _Map_String_String_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {\n\tfor k, v := range m {\n\t\tenc.AddString((string)(k), v)\n\t}\n\treturn err\n}", "func (d *DB) PrintAll() map[string]interface{} {\n\treturn gin.H{\n\t\t\"number\": 10,\n\t}\n}", "func (manager *KeysManager) Clear() {\n\tmanager.KeyList = make([]*jose.JSONWebKey, 0)\n\tmanager.KeyMap = make(map[string]*jose.JSONWebKey)\n}", "func (q *SubmitQueue) Dump() {\n\tfor i, item := range q.items {\n\t\tfmt.Printf(\"[%2d] %s:%d %s\\n\", i, item.Repo, item.PRNumber, item.Sha1)\n\t}\n}", "func (m *logMeasurement) keys() []string {\n\ta := make([]string, 0, len(m.tagSet))\n\tfor k := range m.tagSet {\n\t\ta = append(a, k)\n\t}\n\tsort.Strings(a)\n\treturn a\n}", "func (kdc krbAuth) DumpStrings() {\n\tfor _, val := range kdc.KrbRequests {\n\t\tdata, _ := val.String()\n\t\tfmt.Println(data)\n\t}\n}", "func (m _Map_String_Binary_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {\n\tfor k, v := range m {\n\t\tenc.AddString((string)(k), base64.StdEncoding.EncodeToString(v))\n\t}\n\treturn err\n}", "func (ds *DataStore) GetAllKeys() []uint64 {\n\tds.dataStoreLock.RLock()\n\tdefer ds.dataStoreLock.RUnlock()\n\tkeys := make([]uint64, 0)\n\tfor k := range ds.kvSet {\n\t\tkeys = append(keys, k)\n\t}\n\treturn keys\n}", "func printAllCommands(cmds []Commander) {\n\tconst format = \"%v\\t%v\\t%v\\t%v\\n\"\n\ttw := new(tabwriter.Writer).Init(os.Stdout, 0, 8, 2, ' ', 0)\n\tfmt.Fprintf(tw, format, \"Path\", \"Alias\", \"Command\", \"Args\")\n\tfmt.Fprintf(tw, format, \"-----\", \"-----\", \"-------\", \"----\")\n\tfor _, t := range cmds {\n\t\tfmt.Fprintf(tw, format, t.Path, t.Alias, t.Command, strings.Join(t.Args, \" \"))\n\t}\n\ttw.Flush()\n}", "func (t *TLSCheckWriter) PrintAll(authDebug []byte) error {\n\tw, fullAuth, err := t.setupTLSCheckPrint(authDebug)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, entry := range fullAuth {\n\t\ttlsCheckPrintln(w, entry)\n\t}\n\treturn w.Flush()\n}", "func GetAll() interface{} { return viper.AllKeys() }", "func printState() {\n\tfmt.Println(\"\\nKVNODE STATE:\")\n\tfmt.Println(\"-keyValueStore:\")\n\tfor k := range keyValueStore {\n\t\tmutex.Lock()\n\t\tval := keyValueStore[k]\n\t\tmutex.Unlock()\n\t\tfmt.Println(\" Key:\", k, \"Value:\", val)\n\t}\n\tfmt.Println(\"-transactions:\")\n\tfor txId := range transactions {\n\t\tmutex.Lock()\n\t\ttx := transactions[txId]\n\t\tmutex.Unlock()\n\t\tfmt.Println(\" --Transaction ID:\", tx.ID, \"IsAborted:\", tx.IsAborted, \"IsCommitted:\", tx.IsCommitted, \"CommitId:\", tx.CommitID)\n\t\tfmt.Printf(\" Hash:%x\\n\", tx.CommitHash)\n\t\tfmt.Printf(\" AllHashes:%x\\n\", tx.AllHashes)\n\t\tfmt.Println(\" PutSet:\")\n\t\tfor k := range tx.PutSet {\n\t\t\tfmt.Println(\" Key:\", k, \"Value:\", tx.PutSet[k])\n\t\t}\n\t}\n\tfmt.Println(\"-blockChain:\")\n\tprintBlockChain()\n\tfmt.Println(\"blockChain size:\", len(blockChain))\n\tfmt.Println(\"Total number of transactions is:\", len(transactions), \"\\n\")\n\tfmt.Println(\"Nodes List and Status:\", nodeIpAndStatuses)\n}", "func (c *Cache) GetAllItems() string {\n\tvar str string\n\tvar keys []string\n\n\tc.lock.RLock()\n\tdefer c.lock.RUnlock()\n\n\tfor k := range c.items {\n\t\tkeys = append(keys, k)\n\t}\n\n\tsort.Strings(keys)\n\tstr += \"\\n\"\n\n\tfor _, k := range keys {\n\t\tstr += k + \" \" + fmt.Sprintf(\"%v\", c.items[k].data) + \"\\n\"\n\t}\n\n\treturn str\n}", "func (c *Cache) GetAllKeys() []string {\n\tkeys := make([]string, 0, len(c.cacheByKey))\n\n\tfor k := range c.cacheByKey {\n\t\tkeys = append(keys, k)\n\t}\n\n\treturn keys\n}", "func GetAll(key string, conn *radix.Pool) string {\n\tif conn == nil {\n\t\tconn = GetPool()\n\t}\n\tvar value string\n\terr := conn.Do(radix.Cmd(value, \"hgetall\", key))\n\tif err != nil {\n\t\tprintln(err)\n\t\tpanic(err)\n\t}\n\treturn value\n}", "func AllLog(ctx *context.Context) *string {\n\tlogString := (*ctx).Value(KeyAllLog)\n\tif logString != nil {\n\t\tv := logString.(string)\n\t\treturn &v\n\t}\n\treturn nil\n}", "func (tcdb *Teocdb) List(key string) (keyList cdb.KeyList, err error) {\n\tvar keyOut string\n\titer := tcdb.session.Query(`\n\t\tSELECT key FROM map WHERE key >= ? and key < ?\n\t\tALLOW FILTERING`,\n\t\tkey, key+\"a\").Iter()\n\tfor iter.Scan(&keyOut) {\n\t\tkeyList.Append(keyOut)\n\t}\n\treturn\n}", "func (cs *Caches) ShowAll(db Store) error {\n\ttx := db.Find(cs)\n\treturn tx.Error\n}", "func (m *WatcherMetrics) NKeys() int { return 4 }" ]
[ "0.6180221", "0.60460794", "0.59220344", "0.5912047", "0.57457006", "0.574495", "0.5689104", "0.5659756", "0.5619629", "0.5607107", "0.5596631", "0.55544996", "0.55493444", "0.55463827", "0.55437076", "0.5507923", "0.54788", "0.5450998", "0.5426974", "0.54160655", "0.54081875", "0.53727245", "0.5368841", "0.5360314", "0.53251034", "0.53132284", "0.53121185", "0.5288654", "0.5267655", "0.5266145", "0.5254447", "0.5227436", "0.52050394", "0.51971495", "0.51836073", "0.516645", "0.5162509", "0.5160141", "0.515802", "0.515218", "0.51331", "0.5123023", "0.51105744", "0.51045966", "0.5097505", "0.50879794", "0.50288785", "0.50153154", "0.50142664", "0.49897972", "0.49886778", "0.49828732", "0.4974849", "0.49677914", "0.49665982", "0.4964966", "0.49549755", "0.49514443", "0.4934833", "0.49256277", "0.49251628", "0.49187338", "0.49163696", "0.4916285", "0.49071988", "0.49015212", "0.48973867", "0.4896572", "0.48952723", "0.48936558", "0.48927054", "0.48898694", "0.48827794", "0.4869007", "0.48656186", "0.48646286", "0.4853024", "0.4840376", "0.4840283", "0.48398113", "0.4826027", "0.4816849", "0.4811739", "0.48046857", "0.4797962", "0.4788317", "0.47882167", "0.47874737", "0.47805527", "0.47758952", "0.47696176", "0.47559398", "0.47501096", "0.47498658", "0.47422868", "0.47418433", "0.47370908", "0.4733618", "0.47280207", "0.4720245" ]
0.78134096
0
Policy Get the policy name for this manager.
Политика Получить имя политики для этого менеджера.
func (mgr *LocalHashMapDBMgr) Policy() string { return mgr.policy }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (nri *NodeReportItem) GetPolicy() string {\n\n\tif nri.Policy == \"\" {\n\t\treturn \"no policy\"\n\t}\n\n\treturn nri.Policy\n}", "func (o ResiliencyPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ResiliencyPolicy) pulumi.StringOutput { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o GroupPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *GroupPolicy) pulumi.StringOutput { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o ConfigurationBackupOutput) PolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConfigurationBackup) *string { return v.PolicyName }).(pulumi.StringPtrOutput)\n}", "func (p *Policy) Name() string {\n\treturn p.InternalName\n}", "func (o MrScalarTaskScalingUpPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarTaskScalingUpPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o ElastigroupScalingTargetPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ElastigroupScalingTargetPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o *ExportPolicyCreateRequest) PolicyName() ExportPolicyNameType {\n\tvar r ExportPolicyNameType\n\tif o.PolicyNamePtr == nil {\n\t\treturn r\n\t}\n\tr = *o.PolicyNamePtr\n\treturn r\n}", "func (km KeyValueMap) Policy() string {\n\treturn km[kmPolicy]\n}", "func (o MrScalarCoreScalingUpPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarCoreScalingUpPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o *VolumeExportAttributesType) Policy() string {\n\tvar r string\n\tif o.PolicyPtr == nil {\n\t\treturn r\n\t}\n\tr = *o.PolicyPtr\n\treturn r\n}", "func (o *SnapmirrorCreateRequest) Policy() string {\n\tvar r string\n\tif o.PolicyPtr == nil {\n\t\treturn r\n\t}\n\tr = *o.PolicyPtr\n\treturn r\n}", "func (o MrScalarTaskScalingDownPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarTaskScalingDownPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o ValidatingAdmissionPolicyBindingSpecPatchOutput) PolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ValidatingAdmissionPolicyBindingSpecPatch) *string { return v.PolicyName }).(pulumi.StringPtrOutput)\n}", "func (o RolePolicyAttachmentOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *RolePolicyAttachment) pulumi.StringOutput { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o ValidatingAdmissionPolicyBindingSpecOutput) PolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ValidatingAdmissionPolicyBindingSpec) *string { return v.PolicyName }).(pulumi.StringPtrOutput)\n}", "func (o *ExportPolicyCreateRequest) PolicyName() ExportPolicyNameType {\n\tr := *o.PolicyNamePtr\n\treturn r\n}", "func (o MrScalarCoreScalingDownPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarCoreScalingDownPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o ConfigurationBackupPtrOutput) PolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConfigurationBackup) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PolicyName\n\t}).(pulumi.StringPtrOutput)\n}", "func (r *Bucket) Policy() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"policy\"])\n}", "func (o *ExportPolicyDestroyRequest) PolicyName() ExportPolicyNameType {\n\tvar r ExportPolicyNameType\n\tif o.PolicyNamePtr == nil {\n\t\treturn r\n\t}\n\tr = *o.PolicyNamePtr\n\treturn r\n}", "func (o ElastigroupScalingDownPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ElastigroupScalingDownPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (o ElastigroupScalingUpPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ElastigroupScalingUpPolicy) string { return v.PolicyName }).(pulumi.StringOutput)\n}", "func (r *Policy) Name() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"name\"])\n}", "func (o ValidatingAdmissionPolicyBindingSpecPatchPtrOutput) PolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ValidatingAdmissionPolicyBindingSpecPatch) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PolicyName\n\t}).(pulumi.StringPtrOutput)\n}", "func (policy *PolicySvc) Name() string {\n\treturn \"policy\"\n}", "func (o ValidatingAdmissionPolicyBindingSpecPtrOutput) PolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ValidatingAdmissionPolicyBindingSpec) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PolicyName\n\t}).(pulumi.StringPtrOutput)\n}", "func (o AuthorizationPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AuthorizationPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (o TopicPolicyOutput) Policy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *TopicPolicy) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput)\n}", "func (o *GuardianPolicyDataData) GetPolicyName() string {\n\tif o == nil || o.PolicyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PolicyName\n}", "func (o *SSHAuthorizationPolicy) GetName() string {\n\n\treturn o.Name\n}", "func (o ReplicaExternalKeyOutput) Policy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ReplicaExternalKey) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput)\n}", "func (pg *PolicyGroup) GetPolicy() *api.Policy {\n\treturn pg.Policy\n}", "func (o UserPolicyOutput) Policy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *UserPolicy) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput)\n}", "func (c *IAM) getPolicyName() (string, error) {\n\tclusterName, err := c.cfg.AccessPoint.GetClusterName()\n\tif err != nil {\n\t\treturn \"\", trace.Wrap(err)\n\t}\n\n\tprefix := clusterName.GetClusterName()\n\n\t// If the length of the policy name is over the limit, trim the cluster\n\t// name from right and keep the policyNameSuffix intact.\n\tmaxPrefixLength := maxPolicyNameLength - len(policyNameSuffix)\n\tif len(prefix) > maxPrefixLength {\n\t\tprefix = prefix[:maxPrefixLength]\n\t}\n\n\treturn prefix + policyNameSuffix, nil\n}", "func (o AclTokenPolicyAttachmentOutput) Policy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AclTokenPolicyAttachment) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput)\n}", "func (o ServerPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ServerPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (o CloudConfigurationRuleOutput) Policy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *CloudConfigurationRule) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput)\n}", "func (o UserPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *UserPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (o BucketOutput) Policy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Bucket) pulumi.StringPtrOutput { return v.Policy }).(pulumi.StringPtrOutput)\n}", "func (e *Enforcer) GetPolicy() [][]string {\n\treturn e.GetNamedPolicy(\"p\")\n}", "func (m *PolicyRule) 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}", "func (c *controller) GetPolicy(ctx context.Context, id int64) (*policyModels.Schema, error) {\n\treturn c.pManager.Get(ctx, id)\n}", "func (o *SparseSSHAuthorizationPolicy) GetName() (out string) {\n\n\tif o.Name == nil {\n\t\treturn\n\t}\n\n\treturn *o.Name\n}", "func (p scheduleWithOverProvisioningAwareness) name() policyName {\n\treturn overProvisioningPolicy\n}", "func (o AlertPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AlertPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (e *Enforcer) GetNamedPolicy(ptype string) [][]string {\n\treturn e.model.GetPolicy(\"p\", ptype)\n}", "func (r *Policy) PolicyType() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"policyType\"])\n}", "func (c *controller) GetPolicyByName(ctx context.Context, projectID int64, name string) (*policyModels.Schema, error) {\n\treturn c.pManager.GetByName(ctx, projectID, name)\n}", "func (f *Factory) GetPolicyStatement() (string, error) {\n\t// Perform checks\n\tif len(f.accountID) == 0 {\n\t\treturn \"\", errors.New(AccountIDMissingErr)\n\t}\n\n\tif len(f.region) == 0 {\n\t\treturn \"\", errors.New(RegionMissingErr)\n\t}\n\n\tif len(f.partition) == 0 {\n\t\treturn \"\", errors.New(PartitionMissingErr)\n\t}\n\n\t// Replace AWS placeholders\n\tt := fmt.Sprintf(iamTemplate, strings.Join(f.policies, \",\"))\n\tt = strings.ReplaceAll(t, \"${AWS::Partition}\", f.partition)\n\tt = strings.ReplaceAll(t, \"${AWS::Region}\", f.region)\n\tt = strings.ReplaceAll(t, \"${AWS::AccountId}\", f.accountID)\n\n\t// Return the policy document\n\treturn t, nil\n}", "func (o ArgoCDSpecRbacPtrOutput) Policy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ArgoCDSpecRbac) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Policy\n\t}).(pulumi.StringPtrOutput)\n}", "func (o ArgoCDSpecRbacOutput) Policy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ArgoCDSpecRbac) *string { return v.Policy }).(pulumi.StringPtrOutput)\n}", "func (m *DeviceManagementConfigurationPolicy) 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}", "func (o NetworkSimPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *NetworkSimPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (e *SyncedEnforcer) GetPolicy() [][]string {\n\te.m.RLock()\n\tdefer e.m.RUnlock()\n\treturn e.Enforcer.GetPolicy()\n}", "func (p *BaseProcessor) GetPolicyType() Type {\n\treturn \"\"\n}", "func (ps *PolicyStore) GetPolicy(name string) (*Policy, error) {\n\tdefer metrics.MeasureSince([]string{\"policy\", \"get_policy\"}, time.Now())\n\tif ps.lru != nil {\n\t\t// Check for cached policy\n\t\tif raw, ok := ps.lru.Get(name); ok {\n\t\t\treturn raw.(*Policy), nil\n\t\t}\n\t}\n\n\t// Special case the root policy\n\tif name == \"root\" {\n\t\tp := &Policy{Name: \"root\"}\n\t\tif ps.lru != nil {\n\t\t\tps.lru.Add(p.Name, p)\n\t\t}\n\t\treturn p, nil\n\t}\n\n\t// Load the policy in\n\tout, err := ps.view.Get(name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read policy: %v\", err)\n\t}\n\tif out == nil {\n\t\treturn nil, nil\n\t}\n\n\t// In Vault 0.1.X we stored the raw policy, but in\n\t// Vault 0.2 we switch to the PolicyEntry\n\tpolicyEntry := new(PolicyEntry)\n\tvar policy *Policy\n\tif err := out.DecodeJSON(policyEntry); err == nil {\n\t\t// Parse normally\n\t\tp, err := Parse(policyEntry.Raw)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse policy: %v\", err)\n\t\t}\n\t\tp.Name = name\n\t\tpolicy = p\n\n\t} else {\n\t\t// On error, attempt to use V1 parsing\n\t\tp, err := Parse(string(out.Value))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse policy: %v\", err)\n\t\t}\n\t\tp.Name = name\n\n\t\t// V1 used implicit glob, we need to do a fix-up\n\t\tfor _, pp := range p.Paths {\n\t\t\tpp.Glob = true\n\t\t}\n\t\tpolicy = p\n\t}\n\n\tif ps.lru != nil {\n\t\t// Update the LRU cache\n\t\tps.lru.Add(name, policy)\n\t}\n\n\treturn policy, nil\n}", "func (c *Client) GetPolicy(name string) (*Policy, error) {\n\tif name == \"\" {\n\t\treturn nil, errored.Errorf(\"Policy invalid: empty string for name\")\n\t}\n\n\tresp, err := c.etcdClient.Get(context.Background(), c.policy(name), nil)\n\tif err != nil {\n\t\treturn nil, errors.EtcdToErrored(err)\n\t}\n\n\ttc := NewPolicy()\n\tif err := json.Unmarshal([]byte(resp.Node.Value), tc); err != nil {\n\t\treturn nil, err\n\t}\n\n\ttc.Name = name\n\n\terr = tc.Validate()\n\treturn tc, err\n}", "func (o AutoSnapshotPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AutoSnapshotPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (e *Enforcer) GetNamedPolicy(ctx context.Context, ptype string) ([][]string, error) {\n\tres, err := e.client.remoteClient.GetNamedPolicy(ctx, &pb.PolicyRequest{\n\t\tEnforcerHandler: e.handler,\n\t\tPType: ptype,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn replyTo2DSlice(res), nil\n}", "func (o OrganizationSecurityPolicyOutput) PolicyId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *OrganizationSecurityPolicy) pulumi.StringOutput { return v.PolicyId }).(pulumi.StringOutput)\n}", "func getStrategyPolicy(policy ParentAbstractionServiceRetryPolicy) string {\n\tswitch policy {\n\tcase ParentAbstractionServiceRetryPolicyConsistentHash:\n\t\treturn `consistent_hash`\n\tcase ParentAbstractionServiceRetryPolicyRoundRobinIP:\n\t\treturn `rr_ip`\n\tcase ParentAbstractionServiceRetryPolicyRoundRobinStrict:\n\t\treturn `rr_strict`\n\tcase ParentAbstractionServiceRetryPolicyFirst:\n\t\treturn `first_live`\n\tcase ParentAbstractionServiceRetryPolicyLatched:\n\t\treturn `latched`\n\tdefault:\n\t\treturn getStrategyPolicy(DefaultParentAbstractionServiceRetryPolicy)\n\t}\n}", "func (o SharedAccessPolicyOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SharedAccessPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func (o *ServerConfigImportAllOf) GetPolicyPrefix() string {\n\tif o == nil || o.PolicyPrefix == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PolicyPrefix\n}", "func (p scheduleOnHost) name() policyName {\n\treturn scheduleOnHostAnnotationPolicy\n}", "func (e *CachedEnforcer) GetNamedPolicy(ptype string) [][]string {\n\treturn e.api.GetNamedPolicy(ptype)\n}", "func (o *GuardianPolicyDataData) GetPolicyId() string {\n\tif o == nil || o.PolicyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PolicyId\n}", "func (s *Storage) GetPolicy(ctx context.Context, ID int64) (*Policy, error) {\n\tvar policy Policy\n\terr := s.db.QueryRowContext(ctx, `SELECT query_policy($1);`, ID).Scan(&policy)\n\tif err != nil {\n\t\treturn nil, s.database.ProcessError(err)\n\t}\n\n\treturn &policy, nil\n}", "func (ResourceType) Policy() ent.Policy {\n\t// TODO setup RBAC policies for entities (RBAC based on user's role) such as:\n\t// return authz.NewPolicy(\n\t// \tauthz.WithMutationRules(\n\t// \t\tauthz.ResourceTypeWritePolicyRule(),\n\t// \t),\n\t// )\n\treturn nil\n}", "func (p antiAffinityLabel) name() policyName {\n\treturn antiAffinityLabelPolicy\n}", "func (o ListenerPtrOutput) AlpnPolicy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Listener) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AlpnPolicy\n\t}).(pulumi.StringPtrOutput)\n}", "func (o ListenerOutput) AlpnPolicy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Listener) *string { return v.AlpnPolicy }).(pulumi.StringPtrOutput)\n}", "func (o FioSpecVolumeVolumeSourceVsphereVolumePtrOutput) StoragePolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *FioSpecVolumeVolumeSourceVsphereVolume) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.StoragePolicyName\n\t}).(pulumi.StringPtrOutput)\n}", "func getPolicyName(downstream, upstream service.K8sServiceAccount) string {\n\treturn fmt.Sprintf(\"%s to %s\", downstream, upstream)\n}", "func (o GetSecurityPoliciesPolicyOutput) SecurityPolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetSecurityPoliciesPolicy) string { return v.SecurityPolicyName }).(pulumi.StringOutput)\n}", "func (o ResourcePolicyExemptionOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ResourcePolicyExemption) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "func GetPolicyType(policy string) PolicyType {\n\ttypes := map[string]PolicyType{\n\t\t\"ANONYMOUS_POLICY\": AnonymousPolicy,\n\t\t\"READER_POLICY\": ReaderPolicy,\n\t\t\"WRITER_POLICY\": WriterPolicy,\n\t\t\"MANAGER_POLICY\": ManagerPolicy,\n\t\t\"OWNER_POLICY\": OwnerPolicy,\n\t\t\"ADMIN_POLICY\": AdminPolicy,\n\t}\n\n\treturn types[policy]\n}", "func (o ControlPolicyAttachmentOutput) PolicyId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ControlPolicyAttachment) pulumi.StringOutput { return v.PolicyId }).(pulumi.StringOutput)\n}", "func (o IopingSpecVolumeVolumeSourceVsphereVolumePtrOutput) StoragePolicyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *IopingSpecVolumeVolumeSourceVsphereVolume) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.StoragePolicyName\n\t}).(pulumi.StringPtrOutput)\n}", "func (e *Enforcer) GetPolicy(ctx context.Context) ([][]string, error) {\n\tres, err := e.client.remoteClient.GetPolicy(ctx, &pb.EmptyRequest{Handler: e.handler})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn replyTo2DSlice(res), nil\n}", "func ModuleName(p *policyv1.Policy) string {\n\tswitch pt := p.PolicyType.(type) {\n\tcase *policyv1.Policy_ResourcePolicy:\n\t\treturn ResourcePolicyModuleName(pt.ResourcePolicy.Resource, pt.ResourcePolicy.Version)\n\tcase *policyv1.Policy_PrincipalPolicy:\n\t\treturn PrincipalPolicyModuleName(pt.PrincipalPolicy.Principal, pt.PrincipalPolicy.Version)\n\tcase *policyv1.Policy_DerivedRoles:\n\t\treturn DerivedRolesModuleName(pt.DerivedRoles.Name)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unknown policy type %T\", pt))\n\t}\n}", "func (s *DefaultStore) GetPolicy(policyGen object.Generation) (*lang.Policy, object.Generation, error) {\n\t// todo should we use RWMutex for get/update policy?\n\tpolicyData, err := s.GetPolicyData(policyGen)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\treturn s.getPolicyFromData(policyData)\n}", "func (e *CachedEnforcer) GetPolicy() [][]string {\n\treturn e.api.GetPolicy()\n}", "func (Recommendations) Policy() ent.Policy {\n\t/*return authz.NewPolicy(\n\t\tauthz.WithMutationRules(\n\t\t\tauthz.AssuranceTemplatesWritePolicyRule(),\n\t\t),\n\t)*/\n\treturn authz.NewPolicy(\n\t\tauthz.WithMutationRules(\n\t\t\tprivacy.AlwaysAllowRule(),\n\t\t),\n\t)\n}", "func (p *policy) String() string {\n\treturn fmt.Sprintf(policyDocument,\n\t\tp.Expiration,\n\t\tp.Bucket,\n\t\tp.Key,\n\t\tp.O.MaxFileSize,\n\t\tp.Credential,\n\t\tp.Date,\n\t)\n}", "func (c *Client) Policy() (*www.PolicyReply, error) {\n\tresponseBody, err := c.makeRequest(http.MethodGet,\n\t\twww.PoliteiaWWWAPIRoute, www.RoutePolicy, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar pr www.PolicyReply\n\terr = json.Unmarshal(responseBody, &pr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unmarshal PolicyReply: %v\", err)\n\t}\n\n\tif c.cfg.Verbose {\n\t\terr := prettyPrintJSON(pr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn &pr, nil\n}", "func (t *TestSpec) NetworkPolicyName() string {\n\treturn fmt.Sprintf(\"%s_policy.json\", t.Prefix)\n}", "func (sys *IAMSys) PolicyDBGet(name string) (string, error) {\n\tif name == \"\" {\n\t\treturn \"\", errInvalidArgument\n\t}\n\n\tobjectAPI := newObjectLayerFn()\n\tif objectAPI == nil {\n\t\treturn \"\", errServerNotInitialized\n\t}\n\n\tsys.RLock()\n\tdefer sys.RUnlock()\n\n\tif _, ok := sys.iamUsersMap[name]; !ok {\n\t\treturn \"\", errNoSuchUser\n\t}\n\n\tpolicy := sys.iamUserPolicyMap[name]\n\t// returned policy could be empty\n\treturn policy.Policy, nil\n}", "func PolicyFile() string {\n\tvar filename = path.Join(WorkDir(), \"policy.json\")\n\tpolicyPath := os.Getenv(\"OXBM_POLICY_PATH\")\n\tif len(policyPath) > 0 {\n\t\tfilename = path.Join(policyPath, \"policy.json\")\n\t}\n\treturn filename\n}", "func (o *WafPolicyGroup) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (r *Policy) ID() pulumi.IDOutput {\n\treturn r.s.ID()\n}", "func ResourcePolicyModuleName(resource, version string) string {\n\treturn fmt.Sprintf(\"%s.%s.v%s\", ResourcePoliciesPrefix, Sanitize(resource), Sanitize(version))\n}", "func (p preferScheduleOnHost) name() policyName {\n\treturn preferScheduleOnHostAnnotationPolicy\n}", "func GetPolicy(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *PolicyState, opts ...pulumi.ResourceOption) (*Policy, error) {\n\tvar resource Policy\n\terr := ctx.ReadResource(\"aws-native:iot:Policy\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (o *VolumeExportAttributesType) SetPolicy(newValue string) *VolumeExportAttributesType {\n\to.PolicyPtr = &newValue\n\treturn o\n}", "func (s *RemovePermissionOutput) SetPolicy(v string) *RemovePermissionOutput {\n\ts.Policy = &v\n\treturn s\n}", "func (b *Bundle) PolicyManager() policies.Manager {\n\treturn b.policyManager\n}", "func GetPolicyRepoPath() string {\n\treturn Global.Policy.RepoPath\n}", "func (s *PutPermissionOutput) SetPolicy(v string) *PutPermissionOutput {\n\ts.Policy = &v\n\treturn s\n}", "func (o RolePolicyAttachmentOutput) PolicyType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *RolePolicyAttachment) pulumi.StringOutput { return v.PolicyType }).(pulumi.StringOutput)\n}" ]
[ "0.71685594", "0.71337616", "0.7127744", "0.7121374", "0.71197397", "0.70768213", "0.7059616", "0.702617", "0.70009947", "0.7000554", "0.6979791", "0.69775784", "0.6968762", "0.6955846", "0.69364214", "0.692103", "0.69128716", "0.69038796", "0.68980217", "0.682995", "0.68024987", "0.67950577", "0.6791111", "0.6771931", "0.67275816", "0.67075604", "0.6688253", "0.66538507", "0.66464716", "0.6628853", "0.66073734", "0.6604281", "0.65815574", "0.6565979", "0.65296483", "0.6517541", "0.646706", "0.6408185", "0.6398974", "0.63649076", "0.63603646", "0.6350223", "0.63459367", "0.63396835", "0.633226", "0.6330829", "0.63231725", "0.6268286", "0.6245451", "0.62443984", "0.622477", "0.62045026", "0.61795986", "0.6174511", "0.61435264", "0.61297464", "0.611335", "0.605974", "0.6056052", "0.6052512", "0.60469764", "0.6041556", "0.6035039", "0.6015701", "0.5995268", "0.59857404", "0.5935773", "0.5932242", "0.59120935", "0.5908589", "0.58826554", "0.5841144", "0.5836523", "0.5829322", "0.5828917", "0.5823592", "0.581661", "0.581626", "0.58160657", "0.5803721", "0.5770824", "0.57659245", "0.5758214", "0.5749862", "0.57303226", "0.5721584", "0.57208264", "0.5707373", "0.5706228", "0.5693805", "0.5660466", "0.56497514", "0.5647006", "0.56436694", "0.56307364", "0.56277645", "0.5607473", "0.5598355", "0.55913985", "0.5588144" ]
0.7230925
0
SetHeader to set header (NOT SUPPORTED)
SetHeader для установки заголовка (НЕ ВОЗМОЖНО)
func (l *EchoLogrus) SetHeader(string) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Socket) SetHeader(key, value string) {\n\ts.Lock()\n\ts.Conn.httpHeader().Set(key, value)\n\ts.Unlock()\n}", "func (rm *REKTManager) SetHeader(key, value string) {\n\trm.headers.Set(key, value)\n}", "func (req *Request) SetHeader(name, val string) {\n\treq.w.Header().Set(name, val)\n}", "func SetHeader(w http.ResponseWriter, key, value string) {\n\tw.Header().Set(key, value)\n}", "func (h *HTTP) SetHeader(key, value string) {\n\th.headers[key] = value\n}", "func (api *Client) SetHeader(key, value string) *Client {\n\tapi.mu.Lock()\n\tdefer api.mu.Unlock()\n\tapi.headers[key] = value\n\treturn api\n}", "func (r *Router) SetHeader(w http.ResponseWriter, k, v string) {\n\tw.Header().Set(k, v)\n}", "func (c *Action) SetHeader(key string, value string) {\n\tc.Header().Set(key, value)\n}", "func (r *Request) SetHeader(k, v string) *Request {\n\tpanic(\"TODO\")\n\treturn r\n}", "func (this *Context) SetHeader(hdr string, val string, unique bool) {\n\tif unique {\n\t\tthis.Header().Set(hdr, val)\n\t} else {\n\t\tthis.Header().Add(hdr, val)\n\t}\n}", "func (c *Client) SetHeader(key, value string) {\n\tc.Headers[key] = value\n}", "func (ctx *Context) SetHeader(hdr string, val string, unique bool) {\n\tif unique {\n\t\tctx.Header().Set(hdr, val)\n\t} else {\n\t\tctx.Header().Add(hdr, val)\n\t}\n}", "func (i *ICoreWebView2HttpRequestHeaders) SetHeader(name, value string) error {\n\t_name, err := windows.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\t_value, err := windows.UTF16PtrFromString(value)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tres, _, err := i.vtbl.SetHeader.Call(\n\t\tuintptr(unsafe.Pointer(i)),\n\t\tuintptr(unsafe.Pointer(_name)),\n\t\tuintptr(unsafe.Pointer(_value)),\n\t)\n\tif err != windows.ERROR_SUCCESS {\n\t\treturn err\n\t}\n\tif windows.Handle(res) != windows.S_OK {\n\t\treturn syscall.Errno(res)\n\t}\n\treturn nil\n}", "func (c *Context) SetHeader(key, value string) {\n\tc.W.Header().Set(key, value)\n}", "func (req *Request) SetHeader(key, value string) {\n\treq.header.Set(key, value)\n}", "func (r *Request) SetHeader(key, val string) {\n\tr.Headers[key] = val\n}", "func (c *CommandDescriptor) SetHeader(key string, value interface{}) {\n\tc.headers[key] = value\n}", "func (service *Manager) SetHeader(header interface{}) {\n\tservice.client.AddHeader(header)\n}", "func (c *Context) SetHeader(key string, value string) {\n\tc.Writer.Header().Set(key, value)\n}", "func (m *MailYak) SetHeader(name, value string) {\n\tm.headers[m.trimRegex.ReplaceAllString(name, \"\")] = []string{mime.QEncoding.Encode(\"UTF-8\", m.trimRegex.ReplaceAllString(value, \"\"))}\n}", "func (zr *ZRequest) SetHeader(key, value string) *ZRequest {\n\tif zr.ended {\n\t\treturn zr\n\t}\n\tzr.headers.Set(key, value)\n\treturn zr\n}", "func (f *fakeDiskUpdateWatchServer) SetHeader(metadata.MD) error { return nil }", "func (req *Request) SetHeader(key, value string) {\n\treq.Req.Header.Set(key, value)\n}", "func SetHeader(out io.Writer, key, value string) {\n\tif resp, ok := out.(http.ResponseWriter); ok {\n\t\tresp.Header().Set(key, value)\n\t}\n}", "func (c *baseClient) SetHeader(key, value string) *baseClient {\n\tc.header.Add(key, value)\n\treturn c\n}", "func (pw *pooledWriter) SetHeader(h writer.Header) {\n\tpw.Name = h.Name\n\tpw.Extra = h.Extra\n\tpw.Comment = h.Comment\n\tpw.ModTime = h.ModTime\n\tpw.OS = h.OS\n}", "func (req *PatchJSONRequest) SetHeader(k, v string) {\n\treq.req.Header.Set(k, v)\n}", "func (request *Request) SetHeader(key string, value string) *Request {\n\trequest.Headers.Set(key, value)\n\treturn request\n}", "func (F *Frisby) SetHeader(key, value string) *Frisby {\n\tif F.Req.Headers == nil {\n\t\tF.Req.Headers = make(map[string]string)\n\t}\n\tF.Req.Headers[key] = value\n\treturn F\n}", "func (h Header) Set(key, value string) {\n\ttextproto.MIMEHeader(h).Set(key, value)\n}", "func (c *httpClient) SetHeader(header http.Header) HttpClient {\n\tclient := *c\n\tclient.headers = header\n\treturn &client\n}", "func (self *AbtabURL) SetHeader(header []string) {\n\tself.Header = header\n\tself.HeaderMap = make(map[string]int)\n\tfor idx, fname := range header {\n\t\t//fmt.Printf(\"SetHeader: %s=%d\\n\", fname, idx)\n\t\tself.HeaderMap[fname] = idx\n\t}\n}", "func (h headers) Set(value string) error {\n\tparts := strings.SplitN(value, \":\", 2)\n\tif len(parts) != 2 {\n\t\treturn fmt.Errorf(\"header '%s' has a wrong format\", value)\n\t}\n\tkey, val := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1])\n\tif key == \"\" || val == \"\" {\n\t\treturn fmt.Errorf(\"header '%s' has a wrong format\", value)\n\t}\n\t// Add key/value directly to the http.Header (map[string][]string).\n\t// http.Header.Add() canonicalizes keys but vegeta is used\n\t// to test systems that require case-sensitive headers.\n\th.Header[key] = append(h.Header[key], val)\n\treturn nil\n}", "func (ctx *HijackRequest) SetHeader(pairs ...string) *HijackRequest {\n\tctx.req.Header(pairs...)\n\treturn ctx\n}", "func (p *Part) SetHeader(name string, value string) {\n\theaders := C.g_mime_object_get_header_list(p.asGMimeObject())\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\tcValue := C.CString(value)\n\tdefer C.free(unsafe.Pointer(cValue))\n\tcCharset := C.CString(\"UTF-8\")\n\tdefer C.free(unsafe.Pointer(cCharset))\n\n\tC.g_mime_header_list_set(headers, cName, cValue, cCharset)\n}", "func (ctx *HijackResponse) SetHeader(pairs ...string) {\n\tfor i := 0; i < len(pairs); i += 2 {\n\t\tctx.payload.ResponseHeaders = append(ctx.payload.ResponseHeaders, &proto.FetchHeaderEntry{\n\t\t\tName: pairs[i],\n\t\t\tValue: pairs[i+1],\n\t\t})\n\t}\n}", "func (r *Response) SetHeader(key, value string) {\n\tif r.Header == nil {\n\t\tr.Header = make(http.Header)\n\t}\n\tr.Header.Set(key, value)\n}", "func (r *Request) SetHeader(key string, values ...string) *Request {\n\tif r.headers == nil {\n\t\tr.headers = http.Header{}\n\t}\n\n\tr.headers.Del(key)\n\n\tfor _, value := range values {\n\t\tr.headers.Add(key, value)\n\t}\n\n\treturn r\n}", "func (r *Request) SetHeader(key, value string) *Request {\n\tr.header.Set(key, value)\n\treturn r\n}", "func (h *headerFlags) Set(value string) error {\n\th.flat = append(h.flat, value)\n\theaderParts := strings.Split(value, \":\")\n\tif len(headerParts) != 2 {\n\t\t_ = fmt.Errorf(\"invalid header format specified: `%s`, \"+\n\t\t\t\"must be in format `name:value`\", value)\n\t\tos.Exit(1)\n\t}\n\tif h.header == nil {\n\t\th.header = http.Header{}\n\t}\n\th.header.Add(headerParts[0], headerParts[1])\n\treturn nil\n}", "func (h *ResponseHeader) Set(key, val string) {\n\th.ResponseHeader.Set(key, val)\n}", "func (service *MediaServiceInterface) SetHeader(header interface{}) {\n\tservice.client.AddHeader(header)\n}", "func (this *SIPMessage) SetHeader(h header.Header) (IllegalArgumentException error) {\n\tif h == nil {\n\t\treturn errors.New(\"IllegalArgumentException: nil header!\")\n\t}\n\n\tif hl, ok := h.(header.SIPHeaderLister); ok {\n\t\t// Ignore empty lists.\n\t\tif hl.Len() == 0 {\n\t\t\treturn nil\n\t\t}\n\t}\n\tthis.RemoveHeader(h.GetHeaderName())\n\treturn this.AttachHeader3(h, true, false)\n}", "func (req *Request) SetRequestHeader(k, v string) {\n\treq.r.Header.Set(k, v)\n}", "func SetHeader(ctx context.Context, key HeaderContextKey, value string) context.Context {\n\treturn context.WithValue(ctx, key, value)\n}", "func (c *Context) setHead(key, value string) {\n\tc.f.Response.Header.Set(key, value)\n}", "func (_e *MockDataReceiverService_PutMetricServer_Expecter) SetHeader(_a0 interface{}) *MockDataReceiverService_PutMetricServer_SetHeader_Call {\n\treturn &MockDataReceiverService_PutMetricServer_SetHeader_Call{Call: _e.mock.On(\"SetHeader\", _a0)}\n}", "func (self *Response) SetHeader(header http.Header) {\n\tself.header = header\n}", "func (h *RequestHeader) Set(key, val string) {\n\th.RequestHeader.Set(key, val)\n}", "func (ac challenge) SetHeaders(w http.ResponseWriter) {\n\n}", "func (ctx *Context) SetHeader(key, value string) {\n\tctx.Response.Header.Set(key, value)\n}", "func SetHeader(req *http.Request) {\n\treq.Header.Set(\"Accept\", \"Application/json\")\n\treq.Header.Set(\"Content-Type\", \"Application/json\")\n\treq.Header.Set(\"Charset\", \"utf-8\")\n}", "func (rc *RelayController) SetNewHeader(header *types.Header) {\n\tif header.Relayer == nil {\n\t\treturn\n\t}\n\n\tif header.Relayer.Address == rc.currentNodeAddress {\n\t\trc.logger.Debug(\"RELAY SetNewHeader\", \"rc.startRelay()\")\n\t\trc.startRelay()\n\t} else {\n\t\trc.logger.Debug(\"RELAY SetNewHeader\", \"rc.stopRelay()\",\n\t\t\tfmt.Sprintf(\"expcted: %s obtain: %s\", header.Relayer.Address, rc.currentNodeAddress))\n\t\trc.stopRelay()\n\t}\n}", "func (h HttpHeader) Set(key, value string) {\n\tif _, ok := h[key]; ok {\n\t\th[key] = nil\n\t}\n\th[key] = make([]string, 0)\n\th[key] = append(h[key], value)\n}", "func SetHeaderKey(req *http.Request, key string, value string) {\n\treq.Header.Set(key, value)\n}", "func (h *RequestHeader) Set(key, value string) {\n\tinitHeaderKV(&h.bufKV, key, value, h.disableNormalizing)\n\th.SetCanonical(h.bufKV.key, h.bufKV.value)\n}", "func (_e *MockDataRegistryService_CreateOrUpdateMetricsServer_Expecter) SetHeader(_a0 interface{}) *MockDataRegistryService_CreateOrUpdateMetricsServer_SetHeader_Call {\n\treturn &MockDataRegistryService_CreateOrUpdateMetricsServer_SetHeader_Call{Call: _e.mock.On(\"SetHeader\", _a0)}\n}", "func (r *Request) SetHeader(header, value string) *Request {\n\tr.Header.Set(header, value)\n\treturn r\n}", "func (c *Ctx) Set(key string, val string) {\n\tc.Response.Header.Set(key, val)\n}", "func (client *Client) setHeaders(req *http.Request, httpVerb, path, contentType, content string) error {\n\tif client.creds == nil {\n\t\treturn ErrNoCredentials\n\t}\n\tnow := time.Now().UTC().Format(\"2006-01-02T15:04:05.000000Z07:00\")\n\n\tif len(contentType) > 0 {\n\t\treq.Header.Set(\"Content-Type\", contentType)\n\t}\n\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"Dragonchain\", client.creds.GetDragonchainID())\n\treq.Header.Set(\"Timestamp\", fmt.Sprintf(\"%s\", now))\n\treq.Header.Set(\"Authorization\", client.creds.GetAuthorization(httpVerb, path, now, contentType, content))\n\treturn nil\n}", "func (h CommonHeader) Set(key string, value string) {\n\th[key] = value\n}", "func (m *MockWerftService_ListenServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (h *ResponseHeader) Set(key, value string) {\n\tinitHeaderKV(&h.bufKV, key, value, h.disableNormalizing)\n\th.SetCanonical(h.bufKV.key, h.bufKV.value)\n}", "func (c *Context) Header(key, value string) {\n\tif len(value) == 0 {\n\t\tc.Writer.Header().Del(key)\n\t} else {\n\t\tc.Writer.Header().Set(key, value)\n\t}\n}", "func (h *ApnsHeader) set(reqHeader http.Header) {\n\t// headers are optional\n\tif h == nil {\n\t\treturn\n\t}\n\n\tif h.ApnsId != \"\" {\n\t\treqHeader.Set(\"apns-id\", h.ApnsId)\n\t} // when omitted, Apple will generate a UUID for you\n\n\tif h.ApnsCollapseId != \"\" {\n\t\treqHeader.Set(\"apns-collapse-id\", h.ApnsCollapseId)\n\t}\n\n\tif h.ApnsPriority != \"\" {\n\t\treqHeader.Set(\"apns-priority\", h.ApnsPriority)\n\t} // when omitted, the default priority is 10\n\n\tif h.ApnsTopic != \"\" {\n\t\treqHeader.Set(\"apns-topic\", h.ApnsTopic)\n\t}\n\tif !h.ApnsExpiration.IsZero() {\n\t\treqHeader.Set(\"apns-expiration\", fmt.Sprintf(\"%v\", h.ApnsExpiration.Unix()))\n\t}\n\n}", "func setHeader(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Server\", \"WebServer\")\n\tw.Header().Set(\"Content-Type\", \"text/html\")\n\tw.Header().Set(\"Cache-Control\", \"no-cache, private, max-age=0\")\n\tw.Header().Set(\"Expires\", time.Unix(0, 0).Format(http.TimeFormat))\n\tw.Header().Set(\"Pragma\", \"no-cache\")\n\tw.Header().Set(\"X-Accel-Expires\", \"0\")\n}", "func (m *MockAgentSecure_TaggerStreamEntitiesServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (m *MockAgentSecure_WorkloadmetaStreamEntitiesServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func SetMsgHeader(header uint64, msgData []byte) error {\n if len(msgData) < HEADER_LEN_B {\n return ErrBufferTooSmall\n }\n\n msgData[0] = byte(header >> 56)\n msgData[1] = byte(header >> 48)\n msgData[2] = byte(header >> 40)\n msgData[3] = byte(header >> 32)\n msgData[4] = byte(header >> 24)\n msgData[5] = byte(header >> 16)\n msgData[6] = byte(header >> 8)\n msgData[7] = byte(header)\n\n return nil\n}", "func (m *MockWerftService_SubscribeServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (m *MockMachine_ExecuteServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func SetAuthHeader(token string) string {\n\treturn fmt.Sprintf(\"Bearer %s\", token)\n}", "func (m *MockBasic_PrimeServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (h *header) Set(value string) error {\n\ti := strings.IndexRune(value, ':')\n\tif i < 0 {\n\t\treturn errorString(\"Header field format must be `name: value'\")\n\t}\n\thf := hfield{value[0:i], value[i+1:]}\n\t*h = append(*h, hf)\n\treturn nil\n}", "func (m *MockMessageBus_SubscribeServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (h *Header) Set(key, value string) {\n\tif i, ok := h.index(key); ok {\n\t\th.slice[i+1] = value\n\t} else {\n\t\th.slice = append(h.slice, key, value)\n\t}\n}", "func (h Headers) Set(key, value string) {\n\tkey = strings.ToLower(key)\n\th[key] = value\n}", "func (m *MockConfigAdminService_UploadRegisterModelServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func SetHeader() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\tc.Header(\"Access-Control-Allow-Origin\", \"*\")\n\t\tc.Header(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS, PUT, DELETE, UPDATE\")\n\t\tc.Header(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Authorization\")\n\t\tc.Header(\"Access-Control-Expose-Headers\", \"Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Cache-Control, Content-Language, Content-Type\")\n\t\tc.Header(\"Access-Control-Allow-Credentials\", \"true\")\n\n\t\tif c.Request.Method == \"OPTIONS\" {\n\t\t\tc.AbortWithStatus(204)\n\t\t\treturn\n\t\t}\n\n\t\tc.Next()\n\t}\n}", "func (c *Context) Header(key, value string) {\n\tif len(value) == 0 {\n\t\tc.Response.Header.Del(key)\n\t} else {\n\t\tc.Response.Header.Set(key, value)\n\t}\n}", "func (l *Lambda) ResponseHeaderSet(header, value string) {\n\tl.w.Header().Set(header, value)\n}", "func (p *Context) Header(k, v string) {\n\tp.Writer.Header().Set(k, v)\n}", "func (c *Client) SetHeaders(headers http.Header) {\n\tc.modifyLock.Lock()\n\tdefer c.modifyLock.Unlock()\n\tc.headers = headers\n}", "func ResponseSetHeader(key, value string) ResponseModifier {\n\treturn func(resp *http.Response, err error) (*http.Response, error) {\n\t\tif resp != nil {\n\t\t\tif resp.Header == nil {\n\t\t\t\tresp.Header = make(http.Header)\n\t\t\t}\n\t\t\tresp.Header.Set(key, value)\n\t\t}\n\t\treturn resp, err\n\t}\n}", "func (m *MockTopo_WatchServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (m *mockHTTPWriter) WriteHeader(scode int) {\n\tm.WriteHeader(1)\n}", "func (req *Request) SetHeaderCookie(key, value string) {\n\treq.Req.Header.Set(key, value)\n}", "func (requestHeader *RequestHeader) SetVersion(version uint16) {\n\t// if requestHeader.APIVersion == -1 {\n\t// \treturn\n\t// }\n\trequestHeader.APIVersion = version\n}", "func (m *MockWerftService_StartLocalJobServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (xs *Sheet) SetHeader(header string, margin float64) int {\n\ttmp, _, _ := xs.xb.lib.NewProc(\"xlSheetSetHeaderW\").\n\t\tCall(xs.self, S(header), F(margin))\n\treturn int(tmp)\n}", "func (m *MockProvisioner_ProvisionResourceServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (filterdev *NetworkTap) SetHeaderComplete(f int) error {\n\t_, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(filterdev.device.Fd()), syscall.BIOCSHDRCMPLT, uintptr(unsafe.Pointer(&f)))\n\tif err != 0 {\n\t\treturn syscall.Errno(err)\n\t}\n\treturn nil\n}", "func (c *Context) Header(key, value string) {\n\tif len(value) == 0 {\n\t\tc.Response.Header().Del(key)\n\t} else {\n\t\tc.Response.Header().Set(key, value)\n\t}\n}", "func (t *Target) AddHeader(key, value string) {\n t.header.Add(key, value)\n}", "func (m *MockPdfService_InternalRasterizePdfServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (m *MockConfigAdminService_ListSnapshotsServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (req *Request) SetResponseHeader(k, v string) {\n\treq.res.Header().Set(k, v)\n}", "func setHeaders(request *http.Request, headers Vals) {\n\tfor _, v := range headers {\n\t\trequest.Header.Set(v.Name, v.Value)\n\t}\n}", "func (m *MockAergoRPCService_ListBlockStreamServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "func (m *MockPdfService_RasterizePdfServer) SetHeader(arg0 metadata.MD) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetHeader\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}" ]
[ "0.8070126", "0.7863313", "0.78547883", "0.7850843", "0.7806121", "0.7799137", "0.7771557", "0.77660334", "0.7763081", "0.77529764", "0.7746852", "0.7710076", "0.76950485", "0.7674024", "0.7665853", "0.7630679", "0.76287884", "0.75963986", "0.75706214", "0.7531666", "0.7529309", "0.7486373", "0.7444187", "0.74303573", "0.7419241", "0.7382404", "0.7324501", "0.7299423", "0.726452", "0.7241963", "0.71823", "0.7161666", "0.7159289", "0.71453655", "0.7130562", "0.7080792", "0.70418185", "0.7018735", "0.70115507", "0.6993368", "0.6984197", "0.69671535", "0.69659156", "0.6958884", "0.69519997", "0.694", "0.6915952", "0.6904668", "0.6897196", "0.68971115", "0.6890349", "0.68321323", "0.68292177", "0.6824746", "0.6824145", "0.6780497", "0.6749665", "0.6746709", "0.66865224", "0.6660264", "0.6651109", "0.6636311", "0.66294825", "0.661627", "0.6604738", "0.659837", "0.6565052", "0.65493804", "0.65378636", "0.65223813", "0.6509688", "0.65054744", "0.6504087", "0.65036196", "0.6500422", "0.6500043", "0.64942235", "0.6493328", "0.648808", "0.6480659", "0.6451055", "0.6449517", "0.64338887", "0.6427749", "0.6422714", "0.6411387", "0.6407322", "0.6405319", "0.64023274", "0.64007497", "0.638059", "0.63762474", "0.636864", "0.6366837", "0.6357793", "0.63509315", "0.6349258", "0.6346229", "0.63296896", "0.6322976" ]
0.7985397
1
H1 hashes m to a curve point
H1 хэширует m в точку кривой
func H1(m []byte) (x, y *big.Int) { h := sha512.New() var i uint32 byteLen := (curve.BitSize + 7) >> 3 for x == nil && i < 100 { // TODO: Use a NIST specified DRBG. h.Reset() if err := binary.Write(h, binary.BigEndian, i); err != nil { panic(err) } if _, err := h.Write(m); err != nil { panic(err) } r := []byte{2} // Set point encoding to "compressed", y=0. r = h.Sum(r) x, y = Unmarshal(curve, r[:byteLen+1]) i++ } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func hash1Prf(suite pairing.Suite, m string, k kyber.Scalar) kyber.Point {\n\thm := hash1(suite, m)\n\thmk := hm.Mul(k, hm)\n\treturn hmk\n}", "func HashG1(msg, dst []byte) *G1 {\n\treturn mapToCurve(hashToBase(msg, dst))\n}", "func (path *PATH) H(x float64) *PATH {\n\treturn path.AddPart(\"H\", x)\n}", "func (path *PATH) Hh(x float64) *PATH {\n\treturn path.AddPart(\"h\", x)\n}", "func (pk *PublicKey) ProofToHash(m, proof []byte) (index [32]byte, err error) {\n\tnilIndex := [32]byte{}\n\t// verifier checks that s == H2(m, [t]G + [s]([k]G), [t]H1(m) + [s]VRF_k(m))\n\tif got, want := len(proof), 64+65; got != want {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\n\t// Parse proof into s, t, and vrf.\n\ts := proof[0:32]\n\tt := proof[32:64]\n\tvrf := proof[64 : 64+65]\n\n\tuHx, uHy := elliptic.Unmarshal(curve, vrf)\n\tif uHx == nil {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\n\t// [t]G + [s]([k]G) = [t+ks]G\n\ttGx, tGy := curve.ScalarBaseMult(t)\n\tksGx, ksGy := curve.ScalarMult(pk.X, pk.Y, s)\n\ttksGx, tksGy := curve.Add(tGx, tGy, ksGx, ksGy)\n\n\t// H = H1(m)\n\t// [t]H + [s]VRF = [t+ks]H\n\tHx, Hy := H1(m)\n\ttHx, tHy := curve.ScalarMult(Hx, Hy, t)\n\tsHx, sHy := curve.ScalarMult(uHx, uHy, s)\n\ttksHx, tksHy := curve.Add(tHx, tHy, sHx, sHy)\n\n\t// H2(G, H, [k]G, VRF, [t]G + [s]([k]G), [t]H + [s]VRF)\n\t// = H2(G, H, [k]G, VRF, [t+ks]G, [t+ks]H)\n\t// = H2(G, H, [k]G, VRF, [r]G, [r]H)\n\tvar b bytes.Buffer\n\tif _, err := b.Write(elliptic.Marshal(curve, curve.Gx, curve.Gy)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, Hx, Hy)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, pk.X, pk.Y)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(vrf); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, tksGx, tksGy)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, tksHx, tksHy)); err != nil {\n\t\tpanic(err)\n\t}\n\th2 := H2(b.Bytes())\n\n\t// Left pad h2 with zeros if needed. This will ensure that h2 is padded\n\t// the same way s is.\n\tvar buf bytes.Buffer\n\tif _, err := buf.Write(make([]byte, 32-len(h2.Bytes()))); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := buf.Write(h2.Bytes()); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif !hmac.Equal(s, buf.Bytes()) {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\treturn sha256.Sum256(vrf), nil\n}", "func (p point) h(delta int) point {\n\treturn point{\n\t\tx: p.x + int64(delta),\n\t\ty: p.y,\n\t}\n}", "func (pk *VrfablePublicKey) ProofToHash(m, proof []byte) (index [32]byte, err error) {\n\tnilIndex := [32]byte{}\n\t// verifier checks that s == H2(m, [t]G + [s]([k]G), [t]H1(m) + [s]VRF_k(m))\n\tif got, want := len(proof), 64+65; got != want {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\n\t// Parse proof into s, t, and vrf.\n\ts := proof[0:32]\n\tt := proof[32:64]\n\tvrf := proof[64 : 64+65]\n\n\t// uHx, uHy := elliptic.Unmarshal(curve, vrf)\n\tuHx, uHy := curve.Unmarshal(vrf) //////???\n\tif uHx == nil {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\n\t// [t]G + [s]([k]G) = [t+ks]G\n\ttGx, tGy := curve.ScalarBaseMult(t)\n\tksGx, ksGy := curve.ScalarMult(pk.X, pk.Y, s)\n\ttksGx, tksGy := curve.Add(tGx, tGy, ksGx, ksGy)\n\n\t// H = H1(m)\n\t// [t]H + [s]VRF = [t+ks]H\n\tHx, Hy := H1(m)\n\ttHx, tHy := curve.ScalarMult(Hx, Hy, t)\n\tsHx, sHy := curve.ScalarMult(uHx, uHy, s)\n\ttksHx, tksHy := curve.Add(tHx, tHy, sHx, sHy)\n\n\t// H2(G, H, [k]G, VRF, [t]G + [s]([k]G), [t]H + [s]VRF)\n\t// = H2(G, H, [k]G, VRF, [t+ks]G, [t+ks]H)\n\t// = H2(G, H, [k]G, VRF, [r]G, [r]H)\n\tvar b bytes.Buffer\n\tb.Write(curve.Marshal(params.Gx, params.Gy))\n\tb.Write(curve.Marshal(Hx, Hy))\n\tb.Write(curve.Marshal(pk.X, pk.Y))\n\tb.Write(vrf)\n\tb.Write(curve.Marshal(tksGx, tksGy))\n\tb.Write(curve.Marshal(tksHx, tksHy))\n\th2 := H2(b.Bytes())\n\n\t// Left pad h2 with zeros if needed. This will ensure that h2 is padded\n\t// the same way s is.\n\tvar buf bytes.Buffer\n\tbuf.Write(make([]byte, 32-len(h2.Bytes())))\n\tbuf.Write(h2.Bytes())\n\n\tif !hmac.Equal(s, buf.Bytes()) {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\treturn sha256.Sum256(vrf), nil\n}", "func generateH() ristretto.Point {\n\tvar random ristretto.Scalar\n\tvar H ristretto.Point\n\trandom.Rand()\n\tH.ScalarMultBase(&random)\n\treturn H\n}", "func (o Orbit) H() []float64 {\n\treturn Cross(o.RV())\n}", "func bls_hash_to_point(M []byte) *ECP {\n\tDST := []byte(\"BLS_SIG_FP256BNG1_XMD:SHA-256_SVDW_RO_NUL_\")\n\tu := hash_to_field(core.MC_SHA2,HASH_TYPE,DST,M,2)\n\n\tP:=ECP_map2point(u[0])\n\tP1 := ECP_map2point(u[1]);\n\tP.Add(P1)\n\tP.Cfp()\n\tP.Affine()\n\treturn P\n}", "func (g *G1) Hash(input, dst []byte) {\n\tconst L = 64\n\tpseudo := expander.NewExpanderMD(crypto.SHA256, dst).Expand(input, 2*L)\n\n\tvar u0, u1 ff.Fp\n\tu0.SetBytes(pseudo[0*L : 1*L])\n\tu1.SetBytes(pseudo[1*L : 2*L])\n\n\tvar q0, q1 isogG1Point\n\tq0.sswu(&u0)\n\tq1.sswu(&u1)\n\tvar p0, p1 G1\n\tp0.evalIsogG1(&q0)\n\tp1.evalIsogG1(&q1)\n\tg.Add(&p0, &p1)\n\tg.clearCofactor()\n}", "func (c *core) HashToCurveTryAndIncrement(pk *point, alpha []byte) (*point, error) {\n\thasher := c.getHasher()\n\thash := make([]byte, 1+hasher.Size())\n\thash[0] = 2 // compress format\n\n\t// step 1: ctr = 0\n\tctr := 0\n\n\t// step 2: PK_string = point_to_string(Y)\n\tpkBytes := c.Marshal(pk)\n\n\t// step 3 ~ 6\n\tprefix := []byte{c.SuiteString, 0x01}\n\tsuffix := []byte{0}\n\tfor ; ctr < 256; ctr++ {\n\t\t// hash_string = Hash(suite_string || one_string || PK_string || alpha_string || ctr_string)\n\t\tsuffix[0] = byte(ctr)\n\t\thasher.Reset()\n\t\thasher.Write(prefix)\n\t\thasher.Write(pkBytes)\n\t\thasher.Write(alpha)\n\t\thasher.Write(suffix)\n\t\t// apppend right after compress format\n\t\thasher.Sum(hash[1:1])\n\n\t\t// H = arbitrary_string_to_point(hash_string)\n\t\tif H := c.Unmarshal(hash); H != nil {\n\t\t\tif c.Cofactor > 1 {\n\t\t\t\t// If H is not \"INVALID\" and cofactor > 1, set H = cofactor * H\n\t\t\t\tH = c.ScalarMult(H, []byte{c.Cofactor})\n\t\t\t}\n\t\t\treturn H, nil\n\t\t}\n\t}\n\treturn nil, errors.New(\"no valid point found\")\n}", "func hashSchnorr(suite *bn256.Suite, message []byte, p kyber.Point) kyber.Scalar {\n pb, _ := p.MarshalBinary()\n c := suite.XOF(pb)\n c.Write(message)\n return suite.G1().Scalar().Pick(c)\n}", "func getHash(p Point, precision Accuracy) (uint64, error) {\n\thash, err := hashstructure.Hash(p.truncate(precision), nil)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"unable to get hash point\")\n\t}\n\treturn hash, nil\n}", "func GenerateH() *ristretto.Point {\n\trandom := new(ristretto.Scalar).Rand()\n\tH := new(ristretto.Point)\n\tH.ScalarMultBase(random)\n\treturn H\n}", "func (p *Path) Ha(xs ...float64) *Path {\n\treturn p.addCmd(\"H\", hCmd{xs: xs})\n}", "func hashToPoint(suite suites.Suite, msg []byte) kyber.Point {\n\thash := sha3.NewLegacyKeccak256()\n\tvar buf []byte\n\thash.Write(msg)\n\tbuf = hash.Sum(buf)\n\tx := suite.G1().Scalar().SetBytes(buf)\n\tpoint := suite.G1().Point().Mul(x, nil)\n\treturn point\n}", "func DrawHLine(m draw.Image, x1, y, x2 int) {\n\tfor ; x1 <= x2; x1++ {\n\t\tm.Set(x1, y, color.RGBA{0, 0, 255, 255})\n\t}\n}", "func H2(m []byte) *big.Int {\n\t// NIST SP 800-90A § A.5.1: Simple discard method.\n\tbyteLen := (curve.BitSize + 7) >> 3\n\th := sha512.New()\n\tfor i := uint32(0); ; i++ {\n\t\t// TODO: Use a NIST specified DRBG.\n\t\th.Reset()\n\t\tif err := binary.Write(h, binary.BigEndian, i); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif _, err := h.Write(m); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tb := h.Sum(nil)\n\t\tk := new(big.Int).SetBytes(b[:byteLen])\n\t\tif k.Cmp(new(big.Int).Sub(curve.N, one)) == -1 {\n\t\t\treturn k.Add(k, one)\n\t\t}\n\t}\n}", "func (params *SRPParams) calculateM1(username, salt, A, B, K []byte) []byte {\n\t/*\n\t\ti = H(g) xor H(N)\n\t\tM1 = H(i) + H(I) + H(salt) + H(A) + H(B) + H(K)\n\t\t+ ==> sha256_update\n\t*/\n\t// A,B 必须对齐,不然gg\n\tdigestn := params.Digest(padToN(params.G, params))\n\tdigestg := params.Digest(params.N.Bytes())\n\tdigesti := params.Digest(username)\n\thxor := make([]byte, len(digestn))\n\tfor i := range digestn {\n\t\thxor[i] = digestn[i] ^ digestg[i]\n\t}\n\th := params.Hash.New()\n\th.Write(hxor)\n\th.Write(digesti)\n\th.Write(salt)\n\th.Write(A)\n\th.Write(B)\n\th.Write(K)\n\tm1 := h.Sum(nil)\n\treturn m1\n}", "func (party *EcdsaParty) Phase1(pub2 *PubKey) *PubKey {\n\tprv := party.prv\n\tpub := prv.PubKey()\n\tcurve := pub.Curve\n\n\tpx, py := curve.ScalarMult(pub2.X, pub2.Y, prv.D.Bytes())\n\treturn &PubKey{X: px, Y: py, Curve: curve}\n}", "func h(x float64) float64 {\n\treturn math.Sin(x)\n}", "func (h *Histogram) Delta1h() HistogramValue {\n\tb := make([]HistogramBucket, len(h.buckets))\n\tfor i, v := range h.buckets {\n\t\tb[i] = HistogramBucket{\n\t\t\tLowBound: v.lowBound,\n\t\t\tCount: v.count.Delta1h(),\n\t\t}\n\t}\n\n\tv := HistogramValue{\n\t\tCount: h.count.Delta1h(),\n\t\tSum: h.sum.Delta1h(),\n\t\tSumOfSquares: h.sumOfSquares.Delta1h(),\n\t\tMin: h.tracker.Min1h(),\n\t\tMax: h.tracker.Max1h(),\n\t\tBuckets: b,\n\t}\n\treturn v\n}", "func encodeHash(x uint64, p, pPrime uint) (hashCode uint64) {\n\tif x&onesFromTo(64-pPrime, 63-p) == 0 {\n\t\tr := rho(extractShift(x, 0, 63-pPrime))\n\t\treturn concat([]concatInput{\n\t\t\t{x, 64 - pPrime, 63},\n\t\t\t{uint64(r), 0, 5},\n\t\t\t{1, 0, 0}, // this just adds a 1 bit at the end\n\t\t})\n\t} else {\n\t\treturn concat([]concatInput{\n\t\t\t{x, 64 - pPrime, 63},\n\t\t\t{0, 0, 0}, // this just adds a 0 bit at the end\n\t\t})\n\t}\n}", "func hline (x1 int, x2 int, y int) {\n\tfor n := x1; n < x2; n++ {\n\t\t\timg.Set(n, y, col)\n\t}\n}", "func (_Ethdkg *EthdkgCaller) HashToG1(opts *bind.CallOpts, message []byte) ([2]*big.Int, error) {\n\tvar (\n\t\tret0 = new([2]*big.Int)\n\t)\n\tout := ret0\n\terr := _Ethdkg.contract.Call(opts, out, \"HashToG1\", message)\n\treturn *ret0, err\n}", "func h(a, b []int32) float64 {\n\tx1, y1, x2, y2 := a[0], a[1], b[0], b[1]\n\treturn math.Abs(float64(x1)-float64(x2)) + math.Abs(float64(y1)-float64(y2))\n}", "func Secp256k1Hash(hash []byte) []byte {\n\thash = SumSHA256(hash)\n\t_, seckey := generateDeterministicKeyPair(hash) //seckey1 is usually sha256 of hash\n\tpubkey, _ := generateDeterministicKeyPair(SumSHA256(hash)) //SumSHA256(hash) equals seckey usually\n\tecdh := ECDH(pubkey, seckey) //raise pubkey to power of seckey in curve\n\treturn SumSHA256(append(hash, ecdh...)) //append signature to sha256(seed) and hash\n}", "func (p *Path) Hr(xs ...float64) *Path {\n\treturn p.addCmd(\"h\", hCmd{xs: xs})\n}", "func (k PrivateKey) Evaluate(m []byte) (index [32]byte, proof []byte) {\n\tnilIndex := [32]byte{}\n\t// Prover chooses r <-- [1,N-1]\n\tr, _, _, err := elliptic.GenerateKey(curve, rand.Reader)\n\tif err != nil {\n\t\treturn nilIndex, nil\n\t}\n\tri := new(big.Int).SetBytes(r)\n\n\t// H = H1(m)\n\tHx, Hy := H1(m)\n\n\t// VRF_k(m) = [k]H\n\tsHx, sHy := curve.ScalarMult(Hx, Hy, k.D.Bytes())\n\tvrf := elliptic.Marshal(curve, sHx, sHy) // 65 bytes.\n\n\t// G is the base point\n\t// s = H2(G, H, [k]G, VRF, [r]G, [r]H)\n\trGx, rGy := curve.ScalarBaseMult(r)\n\trHx, rHy := curve.ScalarMult(Hx, Hy, r)\n\tvar b bytes.Buffer\n\tif _, err := b.Write(elliptic.Marshal(curve, curve.Gx, curve.Gy)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, Hx, Hy)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, k.PublicKey.X, k.PublicKey.Y)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(vrf); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, rGx, rGy)); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := b.Write(elliptic.Marshal(curve, rHx, rHy)); err != nil {\n\t\tpanic(err)\n\t}\n\ts := H2(b.Bytes())\n\n\t// t = r−s*k mod N\n\tt := new(big.Int).Sub(ri, new(big.Int).Mul(s, k.D))\n\tt.Mod(t, curve.N)\n\n\t// Index = H(vrf)\n\tindex = sha256.Sum256(vrf)\n\n\t// Write s, t, and vrf to a proof blob. Also write leading zeros before s and t\n\t// if needed.\n\tvar buf bytes.Buffer\n\tif _, err := buf.Write(make([]byte, 32-len(s.Bytes()))); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := buf.Write(s.Bytes()); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := buf.Write(make([]byte, 32-len(t.Bytes()))); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := buf.Write(t.Bytes()); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := buf.Write(vrf); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn index, buf.Bytes()\n}", "func (_Ethdkg *EthdkgCallerSession) HashToG1(message []byte) ([2]*big.Int, error) {\n\treturn _Ethdkg.Contract.HashToG1(&_Ethdkg.CallOpts, message)\n}", "func siphash(k0, k1, m uint64) uint64 {\n\t// Initialization.\n\tv0 := k0 ^ 0x736f6d6570736575\n\tv1 := k1 ^ 0x646f72616e646f6d\n\tv2 := k0 ^ 0x6c7967656e657261\n\tv3 := k1 ^ 0x7465646279746573\n\tt := uint64(8) << 56\n\n\t// Compression.\n\tv3 ^= m\n\n\t// Round 1.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\t// Round 2.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\tv0 ^= m\n\n\t// Compress last block.\n\tv3 ^= t\n\n\t// Round 1.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\t// Round 2.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\tv0 ^= t\n\n\t// Finalization.\n\tv2 ^= 0xff\n\n\t// Round 1.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\t// Round 2.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\t// Round 3.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\t// Round 4.\n\tv0 += v1\n\tv1 = v1<<13 | v1>>(64-13)\n\tv1 ^= v0\n\tv0 = v0<<32 | v0>>(64-32)\n\n\tv2 += v3\n\tv3 = v3<<16 | v3>>(64-16)\n\tv3 ^= v2\n\n\tv0 += v3\n\tv3 = v3<<21 | v3>>(64-21)\n\tv3 ^= v0\n\n\tv2 += v1\n\tv1 = v1<<17 | v1>>(64-17)\n\tv1 ^= v2\n\tv2 = v2<<32 | v2>>(64-32)\n\n\treturn v0 ^ v1 ^ v2 ^ v3\n}", "func hDist(p1, p2 pos) float64 {\n\treturn 2 * rEarth *\n\t\tmath.Asin(math.Sqrt(haversine(p2.latRad-p1.latRad)+\n\t\t\tmath.Cos(p1.latRad)*math.Cos(p2.latRad)*haversine(p2.lonRad-p1.lonRad)))\n}", "func MortonHash(lon, lat float64) uint64 {\n\treturn numeric.Interleave(scaleLon(lon), scaleLat(lat))\n}", "func (_Ethdkg *EthdkgSession) HashToG1(message []byte) ([2]*big.Int, error) {\n\treturn _Ethdkg.Contract.HashToG1(&_Ethdkg.CallOpts, message)\n}", "func (m *Matrix) H() int {\n\treturn int(m.focus.Bounds().Y)\n}", "func ( self * Akima_curve )\tPoint ( x float64 )\t\tfloat64\t{\n\tvar (\n\t\tx_minus_x1 = x - self.X1\n\t\tx_minus_x1_pow2\t= x_minus_x1 * x_minus_x1\n\t)\n\treturn\tself.p0 + self.p3 * x_minus_x1 * x_minus_x1_pow2 +\n\t\t\tself.T1 * x_minus_x1 + self.p2 * x_minus_x1_pow2\n}", "func Secp256k1Hash(seed []byte) []byte { //nolint:golint\n\thash := SumSHA256(seed)\n\t_, seckey := deterministicKeyPairIteratorStep(hash) // seckey1 is usually sha256 of hash\n\tpubkeySeed := SumSHA256(hash) // SumSHA256(hash) usually equals seckey\n\tpubkey, _ := deterministicKeyPairIteratorStep(pubkeySeed)\n\tecdh := ECDH(pubkey, seckey) // raise pubkey to power of seckey in curve\n\tout := SumSHA256(append(hash, ecdh...)) // append signature to sha256(seed) and hash\n\treturn out\n}", "func H(data string) string {\n\tdigest := md5.New()\n\tdigest.Write([]byte(data))\n\treturn fmt.Sprintf(\"%x\", digest.Sum(nil))\n}", "func H(data string) string {\n\tdigest := md5.New()\n\tdigest.Write([]byte(data))\n\treturn fmt.Sprintf(\"%x\", digest.Sum(nil))\n}", "func (ph *PHash) computeHash(img [][]float32) hashtype.Binary {\n\t// TODO: Remove magic numbers\n\thash := make(hashtype.Binary, 8)\n\tvar c uint\n\tfor i := range img {\n\t\tfor j := range img[i] {\n\t\t\tif img[i][j] != 0 {\n\t\t\t\thash.Set(c)\n\t\t\t}\n\t\t\tc++\n\t\t}\n\t}\n\treturn hash\n}", "func mathExpm1(ctx phpv.Context, args []*phpv.ZVal) (*phpv.ZVal, error) {\n\tvar x phpv.ZFloat\n\t_, err := core.Expand(ctx, args, &x)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn phpv.ZFloat(math.Expm1(float64(x))).ZVal(), nil\n}", "func SignHashed(curve CurveSystem, sk Privkey, msg []byte) Signature {\n\treturn SignCustHash(curve, sk, msg, blake2b256)\n}", "func (p *Processor) getHash(x *mat.Dense) int {\n\th := x.T().Mul(p.r.Value())\n\tconcat := mat.ConcatV(h, h.ProdScalar(-1.0))\n\treturn f64utils.ArgMax(concat.Data())\n}", "func (m *Matrix) HAbs() int {\n\treturn int(m.y)\n}", "func (c1 CIELab) DeltaH(c2 CIELab) float64 {\n\txDE := math.Sqrt(math.Pow(c2.A, 2)+math.Pow(c2.B, 2)) -\n\t\tmath.Sqrt(math.Pow(c1.A, 2)+math.Pow(c1.B, 2))\n\n\treturn math.Sqrt(math.Pow(c2.A-c1.A, 2) +\n\t\tmath.Pow(c2.B-c1.B, 2) - math.Pow(xDE, 2))\n}", "func (h PublicKey) Hex() string { return strings.ToLower(hex.EncodeToString(h[:])) }", "func HmacSha1(message []byte, secret string) []byte {\n\th := hmac.New(sha1.New, []byte(secret))\n\th.Write(message)\n\treturn h.Sum(nil)\n}", "func Marshal(curve elliptic.Curve, x, y *big.Int) []byte", "func Hashes(r Roller, p []byte) []uint64 {\n\tn := r.Len()\n\tif len(p) < n {\n\t\treturn nil\n\t}\n\th := make([]uint64, len(p)-n+1)\n\tfor i := 0; i < n-1; i++ {\n\t\tr.RollByte(p[i])\n\t}\n\tfor i := range h {\n\t\th[i] = r.RollByte(p[i+n-1])\n\t}\n\treturn h\n}", "func (g SimplePoint) Geohash(precision int) (string, error) {\n\tp := g.CalculatedPoint()\n\treturn geohash.Encode(p.Y, p.X, precision)\n}", "func Ripemd160H(d []byte) []byte {\n\th := ripemd160.New()\n\th.Write(d)\n\treturn h.Sum(nil)\n}", "func Hann(input VectorComplex) VectorComplex {\n\tvh := input.Copy()\n\ttheta := 2.0 * math.Pi / float64(len(vh)-1)\n\tfor i := 0; i < len(vh); i++ {\n\t\tx := complex(theta*float64(i), 0)\n\t\tvh[i] *= (1.0 - cmplx.Cos(x)) / 2.0\n\t}\n\treturn vh\n}", "func HashASM(k0, k1 uint64, p []byte) uint64", "func Hash(k0, k1 uint64, p []byte) uint64 {\n\tvar d digest\n\td.size = Size\n\td.k0 = k0\n\td.k1 = k1\n\td.Reset()\n\td.Write(p)\n\treturn d.Sum64()\n}", "func DhashHorizontal(img image.Image, hashLen int) ([]byte, error) {\n imgGray := imaging.Grayscale(img) // Grayscale image first\n return horizontalGradient(imgGray, hashLen) // horizontal diff gradient\n}", "func (ts *TagSet) HashH() uint64 {\n\treturn ts.hashH\n}", "func (h *Header) Hash() [32]byte {\n\tvar f []string\n\tif h.Description.Value != \"\" {\n\t\tf = append(f, h.Description.Value)\n\t}\n\tf = append(f, fmt.Sprint(h.Required.Value))\n\tf = append(f, fmt.Sprint(h.Deprecated.Value))\n\tf = append(f, fmt.Sprint(h.AllowEmptyValue.Value))\n\tif h.Style.Value != \"\" {\n\t\tf = append(f, h.Style.Value)\n\t}\n\tf = append(f, fmt.Sprint(h.Explode.Value))\n\tf = append(f, fmt.Sprint(h.AllowReserved.Value))\n\tif h.Schema.Value != nil {\n\t\tf = append(f, low.GenerateHashString(h.Schema.Value))\n\t}\n\tif h.Example.Value != nil {\n\t\tf = append(f, fmt.Sprint(h.Example.Value))\n\t}\n\tif len(h.Examples.Value) > 0 {\n\t\tfor k := range h.Examples.Value {\n\t\t\tf = append(f, fmt.Sprintf(\"%s-%x\", k.Value, h.Examples.Value[k].Value.Hash()))\n\t\t}\n\t}\n\tif len(h.Content.Value) > 0 {\n\t\tfor k := range h.Content.Value {\n\t\t\tf = append(f, fmt.Sprintf(\"%s-%x\", k.Value, h.Content.Value[k].Value.Hash()))\n\t\t}\n\t}\n\tkeys := make([]string, len(h.Extensions))\n\tz := 0\n\tfor k := range h.Extensions {\n\t\tkeys[z] = fmt.Sprintf(\"%s-%x\", k.Value, sha256.Sum256([]byte(fmt.Sprint(h.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}", "func (ctx *Context) h(left, right, pubSeed []byte, addr address) []byte {\n\tret := make([]byte, ctx.p.N)\n\tctx.hInto(ctx.newScratchPad(), left, right,\n\t\tctx.precomputeHashes(pubSeed, nil), addr, ret)\n\treturn ret\n}", "func Expm1(x float64) float64 {\n\n\treturn math.Exp(x) - 1\n}", "func HLine(img *image.RGBA, x1, y, x2 int, col color.Color) {\n\tfor ; x1 <= x2; x1++ {\n\t\timg.Set(x1, y, col)\n\t}\n}", "func ( self * Akima_curve )\tPrev_curve ( data_points * [][] float64 )\t\t( prev * Akima_curve )\t{\n\n\tvar points_len\t= uint ( len ( * data_points ) )\n//\tCare : Uint 0 -1 ~ undefined\n\tif\tself.Index_x1 == 0\t{\treturn\tnil\t}\n\n\tprev\t= new ( Akima_curve )\n\tprev.Index_x1\t= self.Index_x1 -1\n\n\tprev.X1\t= ( * data_points ) [ prev.Index_x1 ][ 0 ]\n\tprev.T1\t= slope_five_point ( data_points, points_len, prev.Index_x1 )\n\tprev.X2, prev.T2\t= self.X1 ,\tself.T1\n\n\tprev.set_coefficients ( ( * data_points ) [ prev.Index_x1 ][ 1 ] , ( * data_points ) [ self.Index_x1 ][ 1 ] ) ;\treturn\n}", "func P384() Curve { return p384 }", "func h(data string) string {\n\tdigest := md5.New()\n\tdigest.Write([]byte(data))\n\treturn fmt.Sprintf(\"%x\", digest.Sum(nil))\n}", "func (b *Builder) AltH1(header string) *Builder {\n\theader = reCRLN.ReplaceAllString(header, \" \")\n\theader = strings.TrimSpace(header)\n\treturn b.writeln(header).writeln(strings.Repeat(\"=\", charLen(header))).nl()\n}", "func Hash1(usr string) string {\n\tbytes := []byte(usr)\n\thash_bytes := hasher1.Sum(bytes)\n\treturn hex.EncodeToString(hash_bytes)\n}", "func Hann(x float64, n int) float64 {\n\treturn 0.5 - 0.5*math.Cos(2*x*math.Pi/float64(n))\n}", "func Hsl(h, s, l float64) Color {\r\n if s == 0 {\r\n return Color{l, l, l}\r\n }\r\n\r\n var r, g, b float64\r\n var t1 float64\r\n var t2 float64\r\n var tr float64\r\n var tg float64\r\n var tb float64\r\n\r\n if l < 0.5 {\r\n t1 = l * (1.0 + s)\r\n } else {\r\n t1 = l + s - l*s\r\n }\r\n\r\n t2 = 2*l - t1\r\n h = h / 360\r\n tr = h + 1.0/3.0\r\n tg = h\r\n tb = h - 1.0/3.0\r\n\r\n if tr < 0 {\r\n tr += 1\r\n }\r\n if tr > 1 {\r\n tr -= 1\r\n }\r\n if tg < 0 {\r\n tg += 1\r\n }\r\n if tg > 1 {\r\n tg -= 1\r\n }\r\n if tb < 0 {\r\n tb += 1\r\n }\r\n if tb > 1 {\r\n tb -= 1\r\n }\r\n\r\n // Red\r\n if 6*tr < 1 {\r\n r = t2 + (t1-t2)*6*tr\r\n } else if 2*tr < 1 {\r\n r = t1\r\n } else if 3*tr < 2 {\r\n r = t2 + (t1-t2)*(2.0/3.0-tr)*6\r\n } else {\r\n r = t2\r\n }\r\n\r\n // Green\r\n if 6*tg < 1 {\r\n g = t2 + (t1-t2)*6*tg\r\n } else if 2*tg < 1 {\r\n g = t1\r\n } else if 3*tg < 2 {\r\n g = t2 + (t1-t2)*(2.0/3.0-tg)*6\r\n } else {\r\n g = t2\r\n }\r\n\r\n // Blue\r\n if 6*tb < 1 {\r\n b = t2 + (t1-t2)*6*tb\r\n } else if 2*tb < 1 {\r\n b = t1\r\n } else if 3*tb < 2 {\r\n b = t2 + (t1-t2)*(2.0/3.0-tb)*6\r\n } else {\r\n b = t2\r\n }\r\n\r\n return Color{r, g, b}\r\n}", "func hubbleTime(H0 float64) (timeGyr float64) {\n\thubbleTime := (1 / H0) // 1/(km/s/Mpc) = Mpc s / km\n\thubbleTime *= kmInAMpc // s\n\thubbleTime /= secInAGyr // Gyr\n\n\treturn hubbleTime\n}", "func (o Orbit) HNorm() float64 {\n\treturn o.RNorm() * o.VNorm() * o.CosΦfpa()\n}", "func GenerateOneTimePK(pkP publicKeyPair, hasher hash.Hash, Curve elliptic.Curve) (Px, Py, Rx, Ry *big.Int) {\n\n\tif Curve == nil {\n\t\tCurve = defaultCurve\n\t}\n\n\tif hasher == nil {\n\t\thasher = defaultHasher\n\t} else if hasher.Size() != 32 {\n\t\tpanic(\"only hashes with outputsize of 32 bytes allowed!\", )\n\t}\n\n\thasher.Reset()\n\tr := RandFieldElement(Curve)\n\t// X1,y1 = Hs(rA)G\n\tPx, Py = Curve.ScalarMult(pkP.Ax, pkP.Ay, r.Bytes())\n\tre := hasher.Sum(append(Px.Bytes()[:], Py.Bytes()[:]...))\n\tra := new(big.Int).SetBytes(re[:])\n\tra.Mod(ra, Curve.Params().N)\n\tPx, Py = Curve.ScalarBaseMult(ra.Bytes())\n\t//+BG\n\tPx, Py = Curve.Add(Px, Py, pkP.Bx, pkP.By)\n\tRx, Ry = Curve.ScalarBaseMult(r.Bytes())\n\treturn\n}", "func hammingDistance(x int, y int) int {\n\n}", "func (this *NurbsCurve) Point(u float64) vec3.T {\n\thomoPt := this.nonRationalPoint(u)\n\treturn homoPt.Dehomogenized()\n}", "func (e *Edge) P1() int {\n\treturn e.p1\n}", "func HmacSha1ToHex(message []byte, secret string) string {\n\th := hmac.New(sha1.New, []byte(secret))\n\th.Write(message)\n\treturn hex.EncodeToString(h.Sum(nil))\n}", "func (b *Builder) H1(text string) *Builder {\n\treturn b.writeln(header(text, 1)).nl()\n}", "func (t Tuple1) Hash() uint32 {\n\tif t.E1 == nil {\n\t\treturn 0\n\t}\n\treturn t.E1.Hash()\n}", "func (ch *ColorMoment) Calculate(img image.Image) hashtype.Float64 {\n\tr := imgproc.Resize(ch.width, ch.height, img, ch.interp)\n\tb := imgproc.GaussianBlur(r, ch.kernel, ch.sigma)\n\tyrb, _ := imgproc.YCrCb(b)\n\thsv, _ := imgproc.HSV(b)\n\tyrbMom := imgproc.GetMoments(yrb)\n\t// Switch R and B channels\n\tyrbMom[0], yrbMom[2] = yrbMom[2], yrbMom[0]\n\thsvMom := imgproc.GetMoments(hsv)\n\t// Switch R and B channels\n\thsvMom[0], hsvMom[2] = hsvMom[2], hsvMom[0]\n\tyHuMom := imgproc.HuMoments(yrbMom)\n\thHuMom := imgproc.HuMoments(hsvMom)\n\thash := make(hashtype.Float64, len(hHuMom)+len(yHuMom))\n\tvar i int\n\tfor i = 0; i < len(hHuMom); i++ {\n\t\thash[i] = hHuMom[i]\n\t}\n\tfor ; i < len(hHuMom)+len(yHuMom); i++ {\n\t\thash[i] = yHuMom[i-len(hHuMom)]\n\t}\n\treturn hash\n}", "func (in *Instance) hash(x, y, mu *big.Int, T uint64) *big.Int {\n\tb := sha512.New()\n\tb.Write(x.Bytes())\n\tb.Write(y.Bytes())\n\tb.Write(mu.Bytes())\n\tbits := make([]byte, 8)\n\tbinary.LittleEndian.PutUint64(bits, T)\n\tb.Write(bits)\n\tres := new(big.Int).SetBytes(b.Sum(nil))\n\tres.Mod(res, in.rsaModulus)\n\treturn res\n}", "func ScalarMultH(scalar *Key) (result *Key) {\n\th := new(ExtendedGroupElement)\n\th.FromBytes(&H)\n\tresultPoint := new(ProjectiveGroupElement)\n\tGeScalarMult(resultPoint, scalar, h)\n\tresult = new(Key)\n\tresultPoint.ToBytes(result)\n\treturn\n}", "func SToH(utfString string) string {\n\treturn hex.EncodeToString([]byte(utfString))\n}", "func HADDPD(mx, x operand.Op) { ctx.HADDPD(mx, x) }", "func hash(key string) int{\n\tvar num = 0\n\t// get the lenght of the key\n\tvar length = len(key)\n\n\t// add the ascii character value to creat a sum \n\tfor i := 0; i < length; i++{\n\n\t\tnum += int(key[i])\n\t}\n\t\n\t// square in the middle hash method\n\tvar avg = num * int((math.Pow(5.0, 0.5) - 1)) / 2\n\tvar numeric = avg - int(math.Floor(float64(avg)))\n\n\n\t// hash value to place into the table slice between -1 and CAPACITY - 1\n\treturn int(math.Floor(float64(numeric * CAPACITY)))\n}", "func computeHPrime(H []*Point, y *big.Int) []*Point {\n\t// y^{-n} == (y^{-1})^n\n\tyExpNegN := powers(Inv(y), len(H))\n\n\t// H' is a set of generators derived from H. (64)\n\tHprime := make([]*Point, len(H))\n\tfor i := range H {\n\t\tHprime[i] = ScalarMulPoint(H[i], yExpNegN[i])\n\t}\n\n\treturn Hprime\n}", "func (s *CountMinSketch) baseHashes(key []byte) [2]uint32 {\n\ts.h.Reset()\n\ts.h.Write(key)\n\tsum := s.h.Sum(nil)\n\treturn [2]uint32{binary.BigEndian.Uint32(sum[0:4]), binary.BigEndian.Uint32(sum[4:8])}\n}", "func NewH1(text string) Element {\n\treturn NewHeader(1, text)\n}", "func HashFileSha1(hs string) []byte {\n\tfile, err := os.Open(hs)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer func() {\n\t\terr := file.Close()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\tdata := sha1.New()\n\tif _, err := io.Copy(data, file); err != nil {\n\t\tpanic(err)\n\t}\n\n\thash := data.Sum(nil)\n\treturn hash[:]\n}", "func HADDPS(mx, x operand.Op) { ctx.HADDPS(mx, x) }", "func (self *State)Atanh(a any)any{\n self.IncOperations(self.coeff[\"atanh\"]+self.off[\"atanh\"])\n return wrap1(a,math.Atanh)\n}", "func hash(m datasource.Metric) uint64 {\n\thash := fnv.New64a()\n\tlabels := m.Labels\n\tsort.Slice(labels, func(i, j int) bool {\n\t\treturn labels[i].Name < labels[j].Name\n\t})\n\tfor _, l := range labels {\n\t\t// drop __name__ to be consistent with Prometheus alerting\n\t\tif l.Name == \"__name__\" {\n\t\t\tcontinue\n\t\t}\n\t\thash.Write([]byte(l.Name))\n\t\thash.Write([]byte(l.Value))\n\t\thash.Write([]byte(\"\\xff\"))\n\t}\n\treturn hash.Sum64()\n}", "func pkcs1v15HashInfo(hash crypto.Hash, inLen int) (hashLen int, prefix []byte, err error) {\n\t// Special case: crypto.Hash(0) is used to indicate that the data is\n\t// signed directly.\n\tif hash == 0 {\n\t\treturn inLen, nil, nil\n\t}\n\n\thashLen = hash.Size()\n\tif inLen != hashLen {\n\t\treturn 0, nil, errors.New(\"input must be hashed message\")\n\t}\n\n\t// CHANGE: Using our private prefix table as it contains the new SHA3 algorithm IDs\n\tprefix, ok := pkcs1Prefix[hash]\n\tif !ok {\n\t\treturn 0, nil, errors.New(\"unsupported hash function\")\n\t}\n\treturn\n}", "func (curve *EdCurve) ToMontgomeryPointForm1(sqrtB *big.Int, p *EcPoint) (p1, p2 *EcPoint) {\n\toneSubY := new(big.Int).Sub(ONE, p.Y) // 1-y\n\toneAddY := new(big.Int).Add(ONE, p.Y) // 1+y\n\tp1, p2 = NewPoint(), NewPoint()\n\tp1.X = ModFraction(oneAddY, oneSubY, curve.P) // (1+y)/(1-y)\n\tp1.Y = ModFraction(p1.X, p.X, curve.P) // u/x\n\tp1.Y.Mul(p1.Y, sqrtB) // sqrtB * u/x\n\tp1.Y.Mod(p1.Y, curve.P)\n\n\tp2.X = ModFraction(oneSubY, oneAddY, curve.P) // (1-y)/(1+y)\n\tp2.Y = ModFraction(p2.X, p.X, curve.P) // u/x\n\tp2.Y.Mul(p2.Y, sqrtB) // sqrtB * u/x\n\tp2.Y.Mod(p2.Y, curve.P)\n\treturn\n}", "func (c *core) HashPoints(points ...*point) *big.Int {\n\thasher := c.getHasher()\n\thasher.Write([]byte{c.SuiteString, 0x2})\n\tfor _, pt := range points {\n\t\thasher.Write(c.Marshal(pt))\n\t}\n\treturn bits2int(hasher.Sum(nil), c.N()*8)\n}", "func HashPoint(x, xmin, xdel []float64, tol float64) int {\n\tif tol < 1e-15 {\n\t\tchk.Panic(\"HashPoint: minimum tolerance must be 1e-15. %v is invalid\", tol)\n\t}\n\tcoefs := []float64{11, 101, 1001}\n\tn := utl.Imin(len(x), 3)\n\tvar hash, xbar float64\n\tfor i := 0; i < n; i++ {\n\t\tif x[i] < xmin[i] {\n\t\t\tchk.Panic(\"HashPoint: coordinate is outside range: %v < %v\", x[i], xmin[i])\n\t\t}\n\t\tif x[i] > xmin[i]+xdel[i] {\n\t\t\tchk.Panic(\"HashPoint: coordinate is outside range: %v > %v\", x[i], xmin[i]+xdel[i])\n\t\t}\n\t\tif xdel[i] > 0 {\n\t\t\txbar = (x[i] - xmin[i]) / xdel[i]\n\t\t\tif xbar < 0 {\n\t\t\t\txbar = 0\n\t\t\t}\n\t\t\tif xbar > 1 {\n\t\t\t\txbar = 1\n\t\t\t}\n\t\t\thash += (xbar / tol) * coefs[i]\n\t\t}\n\t}\n\treturn int(hash)\n}", "func (t *openAddressing) hash(key string, round int) uint32 {\n\tnum := uint(stringToInt(key))\n\tmax := uint(len(t.values) - 1)\n\treturn uint32((hashDivision(num, max) + uint(round)*hashDivision2(num, max)) % max)\n}", "func memhash(p unsafe.Pointer, h, s uintptr) uintptr", "func memhash(p unsafe.Pointer, h, s uintptr) uintptr", "func GenerateOneTime_VOTE(key *edwards.PublicKey, hasher hash.Hash, Curve elliptic.Curve) (P, R edwards.PublicKey) {\n\n\tif Curve == nil {\n\t\tCurve = defaultCurve\n\t}\n\n\tif hasher == nil {\n\t\thasher = defaultHasher\n\t} else if hasher.Size() != 32 {\n\t\tpanic(\"only hashes with outputsize of 32 bytes allowed!\", )\n\t}\n\n\thasher.Reset()\n\tr := RandFieldElement(Curve)\n\t// X1,y1 = Hs(rA)G\n\tPx, Py := Curve.ScalarMult(key.X, key.Y, r.Bytes())\n\tre := hasher.Sum(append(Px.Bytes()[:], Py.Bytes()[:]...))\n\tra := new(big.Int).SetBytes(re[:])\n\tra.Mod(ra, Curve.Params().N)\n\tPx, Py = Curve.ScalarBaseMult(ra.Bytes())\n\tP = edwards.PublicKey{X: Px, Y: Py}\n\tRx, Ry := Curve.ScalarBaseMult(r.Bytes())\n\tR = edwards.PublicKey{X: Rx, Y: Ry}\n\treturn\n}", "func MOVHPS(mx, mx1 operand.Op) { ctx.MOVHPS(mx, mx1) }", "func (h *Histogram) copyHDataFrom(src *Histogram) {\n\tif h.Divider == src.Divider && h.Offset == src.Offset {\n\t\tfor i := 0; i < len(h.Hdata); i++ {\n\t\t\th.Hdata[i] += src.Hdata[i]\n\t\t}\n\t\treturn\n\t}\n\n\thData := src.Export()\n\tfor _, data := range hData.Data {\n\t\th.record((data.Start+data.End)/2, int(data.Count))\n\t}\n}" ]
[ "0.670059", "0.6191052", "0.60214895", "0.59542876", "0.58978754", "0.585371", "0.5751907", "0.5730881", "0.57265484", "0.56613463", "0.5578008", "0.5534485", "0.54807895", "0.54439586", "0.5409997", "0.5383044", "0.5313983", "0.53073287", "0.5304563", "0.5226101", "0.5205866", "0.5202658", "0.5182499", "0.517529", "0.5146467", "0.51308787", "0.5126647", "0.5089565", "0.5081696", "0.5041892", "0.50393045", "0.50325924", "0.50063884", "0.49845472", "0.49734113", "0.49688593", "0.4958525", "0.49168682", "0.4908639", "0.4908639", "0.49001205", "0.4884286", "0.48840994", "0.48796174", "0.48760396", "0.48738897", "0.48650077", "0.48610687", "0.48581108", "0.4843927", "0.4839314", "0.48245984", "0.48083338", "0.48082006", "0.48078644", "0.48046607", "0.4792597", "0.47901624", "0.47864193", "0.47651386", "0.47533637", "0.47529027", "0.47499633", "0.47395414", "0.4736165", "0.4727827", "0.472598", "0.47247043", "0.47073066", "0.4706501", "0.46929687", "0.46856675", "0.4679661", "0.4671708", "0.4663699", "0.4660283", "0.46593162", "0.46568796", "0.46523973", "0.4645791", "0.46416643", "0.46389243", "0.46333185", "0.46248087", "0.46216178", "0.46184957", "0.46149132", "0.45988256", "0.45957255", "0.45902634", "0.4588229", "0.45821214", "0.4580715", "0.45785505", "0.45765594", "0.45711353", "0.45711353", "0.45600137", "0.4553724", "0.454745" ]
0.7891151
0
bind an existing texture object to the specified texture unit
связать существующий объект текстуры с указанным текстурным юнитом
func BindTextureUnit(unit uint32, texture uint32) { C.glowBindTextureUnit(gpBindTextureUnit, (C.GLuint)(unit), (C.GLuint)(texture)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func BindTextureUnit(unit uint32, texture uint32) {\n\tsyscall.Syscall(gpBindTextureUnit, 2, uintptr(unit), uintptr(texture), 0)\n}", "func BindTexture(target uint32, texture uint32) {\n C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))\n}", "func BindTexture(target Enum, t Texture) {\n\tgl.BindTexture(uint32(target), t.Value)\n}", "func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {\n C.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format))\n}", "func BindTexture(target uint32, texture uint32) {\n\tsyscall.Syscall(gpBindTexture, 2, uintptr(target), uintptr(texture), 0)\n}", "func (debugging *debuggingOpenGL) BindTexture(target uint32, texture uint32) {\n\tdebugging.recordEntry(\"BindTexture\", target, texture)\n\tdebugging.gl.BindTexture(target, texture)\n\tdebugging.recordExit(\"BindTexture\")\n}", "func (t *Texture2D) Bind() {\n\tgl.BindTexture(gl.TEXTURE_2D, t.ID)\n}", "func (gl *WebGL) BindTexture(target GLEnum, texture WebGLTexture) {\n\tgl.context.Call(\"bindTexture\", target, texture)\n}", "func (t Texture3D) Bind() {\n\tgl.BindTexture(gl.TEXTURE_3D, t.id)\n}", "func BindTexture(target GLEnum, texture Texture) {\n\tgl.BindTexture(uint32(target), uint32(texture))\n}", "func BindTexture(target Enum, texture Uint) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tctexture, _ := (C.GLuint)(texture), cgoAllocsUnknown\n\tC.glBindTexture(ctarget, ctexture)\n}", "func (native *OpenGL) BindTexture(target uint32, texture uint32) {\n\tgl.BindTexture(target, texture)\n}", "func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {\n\tsyscall.Syscall9(gpBindImageTexture, 7, uintptr(unit), uintptr(texture), uintptr(level), boolToUintptr(layered), uintptr(layer), uintptr(access), uintptr(format), 0, 0)\n}", "func (c *Context) BindTexture(texture *Texture) {\n\tif texture == nil {\n\t\treturn\n\t}\n\tif c.currentTexture == nil || texture.id != c.currentTexture.id {\n\t\tgl.BindTexture(gl.TEXTURE_2D, texture.id)\n\t\tc.currentTexture = texture\n\t}\n}", "func BindTexture(target uint32, texture uint32) {\n\tC.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))\n}", "func BindTexture(target uint32, texture uint32) {\n\tC.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))\n}", "func (self *TileSprite) SetTextureA(member *Texture) {\n self.Object.Set(\"texture\", member)\n}", "func (c *Context) AddTextureObject(cfg *TextureConfig) (*TextureObject, error) {\n\n\t// var pbo uint32\n\t// gl.GenBuffers(1, &pbo)\n\t// gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo)\n\t// // Write PBO with nil to initialize the space\n\t// gl.BufferData(gl.PIXEL_UNPACK_BUFFER, len(cfg.Image.Pix), nil, gl.STREAM_DRAW)\n\n\tmode := int32(gl.LINEAR)\n\tif cfg.Mode != 0 {\n\t\tmode = cfg.Mode\n\t}\n\n\tvar texID uint32\n\tgl.GenTextures(1, &texID)\n\tgl.ActiveTexture(gl.TEXTURE0)\n\tgl.BindTexture(gl.TEXTURE_2D, texID)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, mode)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, mode)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)\n\n\t// write texture with nil pointer to initialize the space\n\tgl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA,\n\t\tint32(cfg.Image.Rect.Size().X), int32(cfg.Image.Rect.Size().Y),\n\t\t0, gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(cfg.Image.Pix))\n\n\ttexLoc := c.GetUniformLocation(cfg.UniformName)\n\tgl.Uniform1i(texLoc, 0)\n\n\ttex := &TextureObject{\n\t\ttexID: texID,\n\t\ttexLoc: texLoc,\n\t\t//pbo: pbo,\n\t\timage: cfg.Image,\n\t}\n\tc.textures = append(c.textures, tex)\n\treturn tex, nil\n}", "func BindSampler(unit uint32, sampler uint32) {\n C.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler))\n}", "func (self *TileSprite) SetTexture(texture *Texture) {\n self.Object.Call(\"setTexture\", texture)\n}", "func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {\n\tC.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format))\n}", "func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {\n\tC.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format))\n}", "func BindTextures(first uint32, count int32, textures *uint32) {\n\tsyscall.Syscall(gpBindTextures, 3, uintptr(first), uintptr(count), uintptr(unsafe.Pointer(textures)))\n}", "func BindTextures(first uint32, count int32, textures *uint32) {\n C.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}", "func (self *TileSprite) SetTexture1O(texture *Texture, destroy bool) {\n self.Object.Call(\"setTexture\", texture, destroy)\n}", "func TextureView(texture uint32, target uint32, origtexture uint32, internalformat uint32, minlevel uint32, numlevels uint32, minlayer uint32, numlayers uint32) {\n C.glowTextureView(gpTextureView, (C.GLuint)(texture), (C.GLenum)(target), (C.GLuint)(origtexture), (C.GLenum)(internalformat), (C.GLuint)(minlevel), (C.GLuint)(numlevels), (C.GLuint)(minlayer), (C.GLuint)(numlayers))\n}", "func BindRenderbuffer(target uint32, renderbuffer uint32) {\n C.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer))\n}", "func updateTextureVbo(data []float32, vbo uint32) {\n\tgl.BindBuffer(gl.ARRAY_BUFFER, vbo)\n\tgl.BufferSubData(gl.ARRAY_BUFFER, 0, len(data)*4, gl.Ptr(data))\n\tgl.BindBuffer(gl.ARRAY_BUFFER, 0)\n}", "func (obj *Device) UpdateTexture(sourceTexture, destTexture *BaseTexture) Error {\n\tret, _, _ := syscall.Syscall(\n\t\tobj.vtbl.UpdateTexture,\n\t\t3,\n\t\tuintptr(unsafe.Pointer(obj)),\n\t\tuintptr(unsafe.Pointer(sourceTexture)),\n\t\tuintptr(unsafe.Pointer(destTexture)),\n\t)\n\treturn toErr(ret)\n}", "func BindTextures(first uint32, count int32, textures *uint32) {\n\tC.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}", "func BindTextures(first uint32, count int32, textures *uint32) {\n\tC.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}", "func (obj *Device) SetTexture(sampler uint32, texture BaseTextureImpl) Error {\n\tvar base uintptr\n\tif texture != nil {\n\t\tbase = texture.baseTexturePointer()\n\t}\n\tret, _, _ := syscall.Syscall(\n\t\tobj.vtbl.SetTexture,\n\t\t3,\n\t\tuintptr(unsafe.Pointer(obj)),\n\t\tuintptr(sampler),\n\t\tbase,\n\t)\n\treturn toErr(ret)\n}", "func BindSampler(unit uint32, sampler uint32) {\n\tC.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler))\n}", "func BindSampler(unit uint32, sampler uint32) {\n\tC.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler))\n}", "func (self *GameObjectCreator) RenderTexture3O(width int, height int, key string) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width, height, key)}\n}", "func (self *GameObjectCreator) RenderTexture2O(width int, height int) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width, height)}\n}", "func BindImageTextures(first uint32, count int32, textures *uint32) {\n C.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}", "func (gl *WebGL) UnbindTexture(target GLEnum) {\n\tgl.context.Call(\"bindTexture\", target, nil)\n}", "func (self *GameObjectCreator) RenderTexture() *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\")}\n}", "func (self *TileSprite) SetTextureI(args ...interface{}) {\n self.Object.Call(\"setTexture\", args)\n}", "func (debugging *debuggingOpenGL) BindSampler(unit uint32, sampler uint32) {\n\tdebugging.recordEntry(\"BindSampler\", unit, sampler)\n\tdebugging.gl.BindSampler(unit, sampler)\n\tdebugging.recordExit(\"BindSampler\")\n}", "func BindSampler(unit uint32, sampler uint32) {\n\tsyscall.Syscall(gpBindSampler, 2, uintptr(unit), uintptr(sampler), 0)\n}", "func BindRenderbuffer(target GLEnum, renderbuffer Renderbuffer) {\n\tgl.BindRenderbuffer(uint32(target), uint32(renderbuffer))\n}", "func FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {\n C.glowFramebufferTexture(gpFramebufferTexture, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level))\n}", "func (self *GameObjectCreator) RenderTexture1O(width int) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width)}\n}", "func (t Texture3D) Unbind() {\n\tgl.BindTexture(gl.TEXTURE_3D, 0)\n}", "func BindRenderbuffer(target uint32, renderbuffer uint32) {\n\tC.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer))\n}", "func BindRenderbuffer(target uint32, renderbuffer uint32) {\n\tC.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer))\n}", "func (native *OpenGL) BindSampler(unit uint32, sampler uint32) {\n\tgl.BindSampler(unit, sampler)\n}", "func TextureView(texture uint32, target uint32, origtexture uint32, internalformat uint32, minlevel uint32, numlevels uint32, minlayer uint32, numlayers uint32) {\n\tsyscall.Syscall9(gpTextureView, 8, uintptr(texture), uintptr(target), uintptr(origtexture), uintptr(internalformat), uintptr(minlevel), uintptr(numlevels), uintptr(minlayer), uintptr(numlayers), 0)\n}", "func BindRenderbuffer(target Enum, rb Renderbuffer) {\n\tgl.BindRenderbuffer(uint32(target), rb.Value)\n}", "func BindImageTextures(first uint32, count int32, textures *uint32) {\n\tsyscall.Syscall(gpBindImageTextures, 3, uintptr(first), uintptr(count), uintptr(unsafe.Pointer(textures)))\n}", "func (self *TileSprite) LoadTexture1O(key interface{}, frame interface{}) {\n self.Object.Call(\"loadTexture\", key, frame)\n}", "func TextureView(texture uint32, target uint32, origtexture uint32, internalformat uint32, minlevel uint32, numlevels uint32, minlayer uint32, numlayers uint32) {\n\tC.glowTextureView(gpTextureView, (C.GLuint)(texture), (C.GLenum)(target), (C.GLuint)(origtexture), (C.GLenum)(internalformat), (C.GLuint)(minlevel), (C.GLuint)(numlevels), (C.GLuint)(minlayer), (C.GLuint)(numlayers))\n}", "func TextureView(texture uint32, target uint32, origtexture uint32, internalformat uint32, minlevel uint32, numlevels uint32, minlayer uint32, numlayers uint32) {\n\tC.glowTextureView(gpTextureView, (C.GLuint)(texture), (C.GLenum)(target), (C.GLuint)(origtexture), (C.GLenum)(internalformat), (C.GLuint)(minlevel), (C.GLuint)(numlevels), (C.GLuint)(minlayer), (C.GLuint)(numlayers))\n}", "func (self *TileSprite) LoadTexture(key interface{}) {\n self.Object.Call(\"loadTexture\", key)\n}", "func (self *GameObjectCreator) RenderTexture4O(width int, height int, key string, addToCache bool) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width, height, key, addToCache)}\n}", "func (debugging *debuggingOpenGL) BindRenderbuffer(target uint32, buffer uint32) {\n\tdebugging.recordEntry(\"BindRenderbuffer\", target, buffer)\n\tdebugging.gl.BindRenderbuffer(target, buffer)\n\tdebugging.recordExit(\"BindRenderbuffer\")\n}", "func BindBuffer(target uint32, buffer uint32) {\n C.glowBindBuffer(gpBindBuffer, (C.GLenum)(target), (C.GLuint)(buffer))\n}", "func (bm Blendmap) Texture() *gl.Texture {\n\treturn bm.Map.id\n}", "func BindRenderbuffer(target uint32, renderbuffer uint32) {\n\tsyscall.Syscall(gpBindRenderbuffer, 2, uintptr(target), uintptr(renderbuffer), 0)\n}", "func (self *TileSprite) Texture() *Texture{\n return &Texture{self.Object.Get(\"texture\")}\n}", "func NewTexture(scene *Scene, element *Element) *Texture {\n\tt := &Texture{\n\t\tObject: *NewObject(scene, element),\n\t}\n\treturn t\n}", "func (debugging *debuggingOpenGL) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {\n\tdebugging.recordEntry(\"FramebufferTexture\", target, attachment, texture, level)\n\tdebugging.gl.FramebufferTexture(target, attachment, texture, level)\n\tdebugging.recordExit(\"FramebufferTexture\")\n}", "func (self *TileSprite) LoadTexture2O(key interface{}, frame interface{}, stopAnimation bool) {\n self.Object.Call(\"loadTexture\", key, frame, stopAnimation)\n}", "func (spriteBatch *SpriteBatch) SetTexture(newtexture ITexture) {\n\tspriteBatch.texture = newtexture\n}", "func BindBufferBase(target uint32, index uint32, buffer uint32) {\n C.glowBindBufferBase(gpBindBufferBase, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer))\n}", "func TextureBuffer(texture uint32, internalformat uint32, buffer uint32) {\n\tsyscall.Syscall(gpTextureBuffer, 3, uintptr(texture), uintptr(internalformat), uintptr(buffer))\n}", "func (self *Graphics) GenerateTexture() *Texture{\n return &Texture{self.Object.Call(\"generateTexture\")}\n}", "func (am *Manager) AddTexture(t *Texture) error {\n\tif _, ok := am.Textures[t.Name]; ok {\n\t\treturn fmt.Errorf(\"asset.Manager.AddTexture error: texture %s already exists\", t.Name)\n\t}\n\n\tam.Textures[t.Name] = t\n\n\treturn nil\n}", "func (self *TileSprite) SetTilingTextureA(member *PIXITexture) {\n self.Object.Set(\"tilingTexture\", member)\n}", "func BindRenderbuffer(target Enum, renderbuffer Uint) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tcrenderbuffer, _ := (C.GLuint)(renderbuffer), cgoAllocsUnknown\n\tC.glBindRenderbuffer(ctarget, crenderbuffer)\n}", "func (am *AssetManager) LoadTexture(name, iname string) {\n\tif strings.Contains(name, \".png\") {\n\t\tpic, err := LoadPng(am.texturesDir + name)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tam.Textures[iname] = pic\n\t} else {\n\t\tlog.Fatal(\"unable to find texture \" + (am.modelsDir + name))\n\t}\n}", "func BindFramebuffer(target uint32, framebuffer uint32) {\n C.glowBindFramebuffer(gpBindFramebuffer, (C.GLenum)(target), (C.GLuint)(framebuffer))\n}", "func (native *OpenGL) BindRenderbuffer(target uint32, renderbuffer uint32) {\n\tgl.BindRenderbuffer(target, renderbuffer)\n}", "func UniformBlockBinding(program uint32, uniformBlockIndex uint32, uniformBlockBinding uint32) {\n C.glowUniformBlockBinding(gpUniformBlockBinding, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLuint)(uniformBlockBinding))\n}", "func (t *Three) Texture() *Texture {\n\tp := t.ctx.Get(\"Texture\")\n\treturn TextureFromJSObject(p)\n}", "func (f *Framebuffer) Texture2D(attachment gfx.FramebufferAttachment, target gfx.TextureTarget, tex gfx.Texture) {\n\tf.useState()\n\tf.ctx.O.Call(\n\t\t\"framebufferTexture2D\",\n\t\tf.ctx.FRAMEBUFFER,\n\t\tf.ctx.Enums[int(attachment)],\n\t\tf.ctx.Enums[int(target)],\n\t\ttex.Object().(*js.Object),\n\t\t0,\n\t)\n}", "func (this *RectangleShape) SetTexture(texture *Texture, resetRect bool) {\n\tC.sfRectangleShape_setTexture(this.cptr, texture.cptr, goBool2C(resetRect))\n\tthis.texture = texture\n}", "func BindImageTextures(first uint32, count int32, textures *uint32) {\n\tC.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}", "func BindImageTextures(first uint32, count int32, textures *uint32) {\n\tC.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}", "func (gl *WebGL) ActiveTexture(target GLEnum) {\n\tgl.context.Call(\"activeTexture\", target)\n}", "func (self *GameObjectCreator) RenderTextureI(args ...interface{}) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", args)}\n}", "func (w *Worley) GenerateTexture(tex *texture.Texture) {\n\tgl.BindImageTexture(0, tex.GetHandle(), 0, false, 0, gl.READ_WRITE, gl.RGBA32F)\n\tgl.BindImageTexture(1, w.noisetexture.GetHandle(), 0, false, 0, gl.READ_ONLY, gl.RGBA32F)\n\n\tw.computeshader.Use()\n\tw.computeshader.UpdateInt32(\"uWidth\", w.width)\n\tw.computeshader.UpdateInt32(\"uHeight\", w.height)\n\tw.computeshader.UpdateInt32(\"uResolution\", w.resolution)\n\tw.computeshader.UpdateInt32(\"uOctaves\", w.octaves)\n\tw.computeshader.UpdateFloat32(\"uRadius\", w.radius)\n\tw.computeshader.UpdateFloat32(\"uRadiusScale\", w.radiusscale)\n\tw.computeshader.UpdateFloat32(\"uBrightness\", w.brightness)\n\tw.computeshader.UpdateFloat32(\"uContrast\", w.contrast)\n\tw.computeshader.UpdateFloat32(\"uScale\", w.scale)\n\tw.computeshader.UpdateFloat32(\"uPersistance\", w.persistance)\n\tw.computeshader.Compute(uint32(w.width), uint32(w.height), 1)\n\tw.computeshader.Compute(1024, 1024, 1)\n\tw.computeshader.Release()\n\n\tgl.MemoryBarrier(gl.ALL_BARRIER_BITS)\n\n\tgl.BindImageTexture(0, 0, 0, false, 0, gl.WRITE_ONLY, gl.RGBA32F)\n\tgl.BindImageTexture(1, 0, 0, false, 0, gl.READ_ONLY, gl.RGBA32F)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func (c *Button) loadTextureFromTTF() {\n\tvar err error\n\tc.font = engosdl.GetFontManager().CreateFont(c.GetName(), c.FontFile, c.FontSize)\n\tc.texture = c.font.GetTextureFromFont(c.Message, c.Color)\n\t_, _, c.width, c.height, err = c.texture.Query()\n\tif err != nil {\n\t\tengosdl.Logger.Error().Err(err).Msg(\"Query error\")\n\t\tpanic(err)\n\t}\n\tc.GetEntity().GetTransform().SetDim(engosdl.NewVector(float64(c.width), float64(c.height)))\n}", "func ActiveTexture(texture uint32) {\n C.glowActiveTexture(gpActiveTexture, (C.GLenum)(texture))\n}", "func BindBufferRange(target uint32, index uint32, buffer uint32, offset int, size int) {\n C.glowBindBufferRange(gpBindBufferRange, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func (self *TileSprite) SetTintedTextureA(member *Canvas) {\n self.Object.Set(\"tintedTexture\", member)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func (self *TileSprite) OnTextureUpdate(event interface{}) {\n self.Object.Call(\"onTextureUpdate\", event)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func FramebufferTextureLayer(target uint32, attachment uint32, texture uint32, level int32, layer int32) {\n C.glowFramebufferTextureLayer(gpFramebufferTextureLayer, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer))\n}", "func Make(width, height int, internalformat int32, format, pixelType uint32,\n\tdata unsafe.Pointer, min, mag, s, t int32) Texture {\n\n\ttexture := Texture{0, gl.TEXTURE_2D, 0}\n\n\t// generate and bind texture\n\tgl.GenTextures(1, &texture.handle)\n\ttexture.Bind(0)\n\n\t// set texture properties\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, min)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, mag)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, s)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, t)\n\n\t// specify a texture image\n\tgl.TexImage2D(gl.TEXTURE_2D, 0, internalformat, int32(width), int32(height),\n\t\t0, format, pixelType, data)\n\n\t// unbind texture\n\ttexture.Unbind()\n\n\treturn texture\n}", "func (animation *AnimationSet) AddTexture(texture *Texture) {\n\tsimlog.FuncIn()\n\tanimation.textures = append(animation.textures, texture)\n\tsimlog.FuncOut()\n}", "func (self *Graphics) GenerateTexture1O(resolution int) *Texture{\n return &Texture{self.Object.Call(\"generateTexture\", resolution)}\n}", "func BindBuffer(target Enum, b Buffer) {\n\tgl.BindBuffer(uint32(target), b.Value)\n}", "func (self *Graphics) GenerateTexture2O(resolution int, scaleMode int) *Texture{\n return &Texture{self.Object.Call(\"generateTexture\", resolution, scaleMode)}\n}" ]
[ "0.7944882", "0.7141327", "0.7066944", "0.70379597", "0.69296485", "0.6858803", "0.6800018", "0.6781621", "0.6781285", "0.6778453", "0.6636072", "0.6617039", "0.6567981", "0.65639764", "0.64981437", "0.64981437", "0.6295844", "0.62708545", "0.6270802", "0.6261718", "0.6245072", "0.6245072", "0.6235691", "0.6209771", "0.612629", "0.6105346", "0.60828143", "0.6070847", "0.59799135", "0.59710383", "0.59710383", "0.59539014", "0.5931821", "0.5931821", "0.5918407", "0.58965087", "0.58862257", "0.58838946", "0.582722", "0.58149177", "0.5792632", "0.5792193", "0.5771302", "0.57566863", "0.5710121", "0.5702316", "0.57020956", "0.57020956", "0.56998354", "0.56969744", "0.56934637", "0.5684608", "0.5669352", "0.5636915", "0.5636915", "0.56252205", "0.5607815", "0.5607313", "0.5605351", "0.56029904", "0.56011385", "0.56002367", "0.55896777", "0.5557968", "0.55155665", "0.5492506", "0.5492208", "0.5481271", "0.5476883", "0.54641664", "0.5454424", "0.54541165", "0.5452608", "0.5452039", "0.54422134", "0.54096574", "0.5401207", "0.5386257", "0.5385246", "0.5380177", "0.5380177", "0.5373289", "0.53729904", "0.53639513", "0.5350581", "0.5349032", "0.5324349", "0.53219783", "0.53150004", "0.5304096", "0.5299353", "0.52902514", "0.52742726", "0.52643794", "0.5260727", "0.5256475", "0.52495277", "0.5244961", "0.5241873" ]
0.798627
1
specify the clear value for the color index buffers
установите явное значение для индексных буферов цвета
func ClearIndex(c float32) { C.glowClearIndex(gpClearIndex, (C.GLfloat)(c)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ClearIndex(c float32) {\n C.glowClearIndex(gpClearIndex, (C.GLfloat)(c))\n}", "func ClearIndex(c float32) {\n\tsyscall.Syscall(gpClearIndex, 1, uintptr(math.Float32bits(c)), 0, 0)\n}", "func (debugging *debuggingOpenGL) Clear(mask uint32) {\n\tdebugging.recordEntry(\"Clear\", mask)\n\tdebugging.gl.Clear(mask)\n\tdebugging.recordExit(\"Clear\")\n}", "func (v *Bitmap256) Clear(pos uint8) {\n\tv[pos>>6] &= ^(1 << (pos & 63))\n}", "func (native *OpenGL) Clear(mask uint32) {\n\tgl.Clear(mask)\n}", "func Clear(mask uint32) {\n C.glowClear(gpClear, (C.GLbitfield)(mask))\n}", "func Clear(mask Enum) {\n\tgl.Clear(uint32(mask))\n}", "func Clear(mask GLbitfield) {\n\tC.glClear(C.GLbitfield(mask))\n}", "func ClearColor(red float32, green float32, blue float32, alpha float32) {\n C.glowClearColor(gpClearColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))\n}", "func ClearColor(red float32, green float32, blue float32, alpha float32) {\n\tsyscall.Syscall6(gpClearColor, 4, uintptr(math.Float32bits(red)), uintptr(math.Float32bits(green)), uintptr(math.Float32bits(blue)), uintptr(math.Float32bits(alpha)), 0, 0)\n}", "func Clear(mask Bitfield) {\n\tcmask, _ := (C.GLbitfield)(mask), cgoAllocsUnknown\n\tC.glClear(cmask)\n}", "func Clear(r, g, b, a float32) {\n\tgl.ClearColor(r, g, b, a)\n\tgl.Clear(gl.COLOR_BUFFER_BIT)\n}", "func (ctl *Controller) Clear() {\n\tfor i := 0; i < ctl.count; i++ {\n\t\tctl.SetColour(i, Off)\n\t}\n}", "func ClearAccum(red float32, green float32, blue float32, alpha float32) {\n C.glowClearAccum(gpClearAccum, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))\n}", "func (c *Color) Reset() {\n\tc.params = c.params[:0]\n}", "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}", "func Clear(mask uint32) {\n\tC.glowClear(gpClear, (C.GLbitfield)(mask))\n}", "func Clear(mask uint32) {\n\tC.glowClear(gpClear, (C.GLbitfield)(mask))\n}", "func (n *saturationDegreeIterator) Reset() { panic(\"coloring: invalid call to Reset\") }", "func (r *Render) clear(cursor int) {\n\tr.move(cursor, 0)\n\tr.out.EraseDown()\n}", "func (b *Builder) ClearBackbuffer(ctx context.Context) (red, green, blue, black api.CmdID) {\n\tred = b.Add(\n\t\tb.CB.GlClearColor(1.0, 0.0, 0.0, 1.0),\n\t\tb.CB.GlClear(gles.GLbitfield_GL_COLOR_BUFFER_BIT),\n\t) + 1\n\tgreen = b.Add(\n\t\tb.CB.GlClearColor(0.0, 1.0, 0.0, 1.0),\n\t\tb.CB.GlClear(gles.GLbitfield_GL_COLOR_BUFFER_BIT),\n\t) + 1\n\tblue = b.Add(\n\t\tb.CB.GlClearColor(0.0, 0.0, 1.0, 1.0),\n\t\tb.CB.GlClear(gles.GLbitfield_GL_COLOR_BUFFER_BIT),\n\t) + 1\n\tblack = b.Add(\n\t\tb.CB.GlClearColor(0.0, 0.0, 0.0, 1.0),\n\t\tb.CB.GlClear(gles.GLbitfield_GL_COLOR_BUFFER_BIT),\n\t) + 1\n\treturn red, green, blue, black\n}", "func SetClearColor(r uint8, g uint8, b uint8) {\n\n\tgl.ClearColor(gl.Float(r)/255, gl.Float(g)/255, gl.Float(b)/255, 1.0)\n}", "func ClearAccum(red float32, green float32, blue float32, alpha float32) {\n\tsyscall.Syscall6(gpClearAccum, 4, uintptr(math.Float32bits(red)), uintptr(math.Float32bits(green)), uintptr(math.Float32bits(blue)), uintptr(math.Float32bits(alpha)), 0, 0)\n}", "func ClearColor(red float32, green float32, blue float32, alpha float32) {\n\tC.glowClearColor(gpClearColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))\n}", "func ClearColor(red float32, green float32, blue float32, alpha float32) {\n\tC.glowClearColor(gpClearColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))\n}", "func (glx *Context) Clear() {\n\tglx.constants.Clear(glx.constants.COLOR_BUFFER_BIT)\n\tglx.constants.Clear(glx.constants.DEPTH_BUFFER_BIT)\n}", "func ClearColor(red Float, green Float, blue Float, alpha Float) {\n\tcred, _ := (C.GLfloat)(red), cgoAllocsUnknown\n\tcgreen, _ := (C.GLfloat)(green), cgoAllocsUnknown\n\tcblue, _ := (C.GLfloat)(blue), cgoAllocsUnknown\n\tcalpha, _ := (C.GLfloat)(alpha), cgoAllocsUnknown\n\tC.glClearColor(cred, cgreen, cblue, calpha)\n}", "func (obj *Device) Clear(\n\trects []RECT,\n\tflags uint32,\n\tcolor COLOR,\n\tz float32,\n\tstencil uint32,\n) Error {\n\tvar rectPtr *RECT\n\tif len(rects) > 0 {\n\t\trectPtr = &rects[0]\n\t}\n\tret, _, _ := syscall.Syscall9(\n\t\tobj.vtbl.Clear,\n\t\t7,\n\t\tuintptr(unsafe.Pointer(obj)),\n\t\tuintptr(len(rects)),\n\t\tuintptr(unsafe.Pointer(rectPtr)),\n\t\tuintptr(flags),\n\t\tuintptr(color),\n\t\tuintptr(math.Float32bits(z)),\n\t\tuintptr(stencil),\n\t\t0,\n\t\t0,\n\t)\n\treturn toErr(ret)\n}", "func ClearAccum(red float32, green float32, blue float32, alpha float32) {\n\tC.glowClearAccum(gpClearAccum, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))\n}", "func (c *Canvas) Clear() error {\n\tb, err := buffer.New(c.Size())\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.buffer = b\n\treturn nil\n}", "func ClearColor(red, green, blue, alpha float32) {\n\tgl.ClearColor(red, green, blue, alpha)\n}", "func (spriteBatch *SpriteBatch) ClearColor() {\n\tspriteBatch.color = []float32{1, 1, 1, 1}\n}", "func (debugging *debuggingOpenGL) ClearColor(red float32, green float32, blue float32, alpha float32) {\n\tdebugging.recordEntry(\"ClearColor\", red, green, blue, alpha)\n\tdebugging.gl.ClearColor(red, green, blue, alpha)\n\tdebugging.recordExit(\"ClearColor\")\n}", "func Clear() {\n\tfor i := 0; i < bufferLength; i++ {\n\t\tbuffer[i] = 0x00\n\t}\n}", "func (f *Framebuffer) ClearColor(r, g, b, a float32) gfx.FramebufferStateValue {\n\treturn s.CSV{\n\t\tValue: [4]float32{r, g, b, a},\n\t\tDefaultValue: [4]float32{0, 0, 0, 0}, // TODO(slimsag): verify\n\t\tKey: csClearColor,\n\t\tGLCall: f.ctx.glClearColor,\n\t}\n}", "func Clear(l Layer, c color.RGBA) {\n\tFill{Fullscreen, c}.Draw(l)\n}", "func (NilUGauge) Clear() uint64 { return 0 }", "func ClearColor(red GLfloat, green GLfloat, blue GLfloat, alpha GLfloat) {\n\tC.glClearColor(C.GLfloat(red), C.GLfloat(green), C.GLfloat(blue), C.GLfloat(alpha))\n}", "func (gl *WebGL) Clear(option GLEnum) {\n\tgl.context.Call(\"clear\", option)\n}", "func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {\n C.glowClearBufferData(gpClearBufferData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func (native *OpenGL) ClearColor(red float32, green float32, blue float32, alpha float32) {\n\tgl.ClearColor(red, green, blue, alpha)\n}", "func (w *Window) Clear() {\n\tfor i, _ := range w.tex {\n\t\tw.tex[i] = 0\n\t}\n}", "func (gl *WebGL) ClearColor(r, g, b, a float64) {\n\tgl.context.Call(\"clearColor\", float32(r), float32(g), float32(b), float32(a))\n}", "func Clear() string {\n\treturn csi(\"2J\") + csi(\"H\")\n}", "func Clear(mask uint32) {\n\tsyscall.Syscall(gpClear, 1, uintptr(mask), 0, 0)\n}", "func Clear(data []uintptr, bitIdx int) {\n\twordIdx := uint(bitIdx) / BitsPerWord\n\tdata[wordIdx] = data[wordIdx] &^ (1 << (uint(bitIdx) % BitsPerWord))\n}", "func Clear() error {\n\n\tgl.Clear(gl.COLOR_BUFFER_BIT)\n\n\treturn checkForErrors()\n}", "func (d *Driver) Clear() {\n\tfor i := 0; i < len(d.buff); i++ {\n\t\td.buff[i] = 0\n\t}\n}", "func (b *Buffer) Clear() {\n\tb.series = make(map[string]*influxdb.Series)\n\tb.size = 0\n}", "func (NilCounter) Clear() {}", "func (NilCounter) Clear() {}", "func (b *Buffer) ClearAt(o int) {\n\tif o < len(b.Tiles) {\n\t\tb.Tiles[o] = nil\n\t}\n}", "func (b *Buffer) Clear() {\n\tfor o := range b.Tiles {\n\t\tb.Tiles[o] = nil\n\t}\n}", "func (g *gfx) ClearPixel(x, y int) {\n\tg[x][y] = COLOR_BLACK\n}", "func (f *Framebuffer) Clear(m gfx.ClearMask) {\n\tvar mask int\n\tif m&gfx.ColorBuffer != 0 {\n\t\tmask |= f.ctx.COLOR_BUFFER_BIT\n\t}\n\tif m&gfx.DepthBuffer != 0 {\n\t\tmask |= f.ctx.DEPTH_BUFFER_BIT\n\t}\n\tif m&gfx.StencilBuffer != 0 {\n\t\tmask |= f.ctx.STENCIL_BUFFER_BIT\n\t}\n\n\t// Use this framebuffer's state, and perform the clear operation.\n\tf.useState()\n\tf.ctx.O.Call(\"clear\", mask)\n}", "func (frac *Fractal) Clear() {\n\tfrac.R = histo.New(frac.Width, frac.Height)\n\tfrac.G = histo.New(frac.Width, frac.Height)\n\tfrac.B = histo.New(frac.Width, frac.Height)\n}", "func (d *Display) Clear() {\n\td.sendCommand(0b00000001)\n\ttime.Sleep(10 * time.Millisecond) // long instruction, max 6.2ms\n}", "func (z *Int) Clear() *Int {\n\tz[3], z[2], z[1], z[0] = 0, 0, 0, 0\n\treturn z\n}", "func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {\n\tC.glowClearBufferData(gpClearBufferData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {\n\tC.glowClearBufferData(gpClearBufferData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func (c *ChromaHighlight) ClrBuffer() {\n\tswitch c.srcBuff {\n\tcase nil:\n\t\tc.txtBuff.Delete(c.txtBuff.GetStartIter(), c.txtBuff.GetEndIter())\n\tdefault:\n\t\tc.srcBuff.Delete(c.srcBuff.GetStartIter(), c.srcBuff.GetEndIter())\n\t}\n}", "func (pi *PixelIterator) Clear() {\n\tC.ClearPixelIterator(pi.pi)\n\truntime.KeepAlive(pi)\n}", "func (this *channelStruct) Clear() {\n\tthis.samples = make([]float64, 0)\n}", "func (p Pin) Clear() {\n\tp.Port().bsrr.Store(uint32(Pin0) << 16 << p.index())\n}", "func (rb *RingBuffer[T]) Clear() {\n\trb.mu.Lock()\n\tdefer rb.mu.Unlock()\n\trb.pos = 0\n\trb.buf = nil\n}", "func Unset() {\n\tif NoColor {\n\t\treturn\n\t}\n\n\tOutput.Write(unsafeByteSlice(escapePrefix + Reset.String() + escapeSuffix))\n}", "func (b *Buffer) ClearTo(o int) {\n\tfor o = calc.MinInt(o, len(b.Tiles)); o >= 0; o-- {\n\t\tb.Tiles[o] = nil\n\t}\n}", "func ClearBufferSubData(target uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) {\n C.glowClearBufferSubData(gpClearBufferSubData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func (self *nativePduBuffer) Clear() {\n\tself.start = 0\n\tself.count = 0\n}", "func (i *Input) Clear() {\n\ti.Pos = 0\n\ti.Buffer = NewLine()\n}", "func (wv *Spectrum) SetZero() {\n\tfor k := 0; k < 4; k++ {\n\t\twv.C[k] = 0\n\t}\n\n}", "func ClearStencil(s int32) {\n C.glowClearStencil(gpClearStencil, (C.GLint)(s))\n}", "func (c *Canvas) Reset() {\n\tfor y := 0; uint8(y) < canvasHeight; y++ {\n\t\tfor x := 0; uint8(x) < canvasWidth; x++ {\n\t\t\t(*c)[y][x] = 0\n\t\t}\n\t}\n}", "func InvalidateBufferData(buffer uint32) {\n C.glowInvalidateBufferData(gpInvalidateBufferData, (C.GLuint)(buffer))\n}", "func (pw *PixelWand) Clear() {\n\tC.ClearPixelWand(pw.pw)\n\truntime.KeepAlive(pw)\n}", "func ClearDepth(depth float64) {\n C.glowClearDepth(gpClearDepth, (C.GLdouble)(depth))\n}", "func (c *standardResettingCounter) Clear() {\n\tatomic.StoreInt64(&c.count, 0)\n}", "func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {\n\tsyscall.Syscall6(gpClearBufferData, 5, uintptr(target), uintptr(internalformat), uintptr(format), uintptr(xtype), uintptr(data), 0)\n}", "func Clear() {\n\tprint(\"\\033[H\\033[2J\")\n}", "func (sd *saturationDegree) reset(colors map[int64]int) {\n\tsd.colors = colors\n\tfor i := range sd.nodes {\n\t\tsd.adjColors[i] = make(set.Ints)\n\t}\n\tfor uid, c := range colors {\n\t\tto := sd.g.From(uid)\n\t\tfor to.Next() {\n\t\t\tsd.adjColors[sd.indexOf[to.Node().ID()]].Add(c)\n\t\t}\n\t}\n}", "func Clear() {\n\tfmt.Print(\"\\033[2J\")\n}", "func (c Color) Clearer(pct float32) Color {\n\tf32 := NRGBAf32Model.Convert(c).(NRGBAf32)\n\tf32.A -= pct / 100\n\tf32.A = mat32.Clamp(f32.A, 0, 1)\n\treturn ColorModel.Convert(f32).(Color)\n}", "func (x *Secp256k1N) Clear() {\n\tx.limbs[0] = 0\n\tx.limbs[1] = 0\n\tx.limbs[2] = 0\n\tx.limbs[3] = 0\n\tx.limbs[4] = 0\n}", "func (m *MIDs) Clear() {\n\tm.index = make([]*CPContext, int(midMax))\n}", "func (t *FileTarget) clearBuffer() {\n\tfor {\n\t\tselect {\n\t\tcase <-t.tick.C:\n\t\t\t_ = t.writer.Flush()\n\t\t}\n\t}\n}", "func ClearScreen() {\n\temitEscape(\"J\", 2)\n}", "func (imd *IMDraw) Clear() {\n\timd.tri.SetLen(0)\n\timd.batch.Dirty()\n}", "func ClearStencil(s int32) {\n\tsyscall.Syscall(gpClearStencil, 1, uintptr(s), 0, 0)\n}", "func (n *Uint256) Zero() {\n\tn.n[0], n.n[1], n.n[2], n.n[3] = 0, 0, 0, 0\n}", "func opUI8Bitclear(inputs []ast.CXValue, outputs []ast.CXValue) {\n\toutV0 := inputs[0].Get_ui8() &^ inputs[1].Get_ui8()\n\toutputs[0].Set_ui8(outV0)\n}", "func (mc *MultiCursor) Clear() {\n\tmc.cursors = mc.cursors[0:1]\n}", "func (b FormatOption) Clear(flag FormatOption) FormatOption { return b &^ flag }", "func clearLoopLen(b []byte) {\n\tb[0] = 0xf0\n\tb[1] = 0\n}", "func (d *Display) resetBuffer() {\n\td.width = d.device.Width()\n\td.height = d.device.Height()\n\td.buffer = make([][]byte, d.height)\n\tfor y := range d.buffer {\n\t\td.buffer[y] = make([]byte, d.width)\n\t}\n}", "func (gdt *Array) Clear() {\n\targ0 := gdt.getBase()\n\n\tC.go_godot_array_clear(GDNative.api, arg0)\n}", "func ClearBufferSubData(target uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) {\n\tC.glowClearBufferSubData(gpClearBufferSubData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func ClearBufferSubData(target uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) {\n\tC.glowClearBufferSubData(gpClearBufferSubData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func clearIndex(\n\tctx context.Context,\n\texecCfg *sql.ExecutorConfig,\n\ttableDesc catalog.TableDescriptor,\n\tindex descpb.IndexDescriptor,\n) error {\n\tlog.Infof(ctx, \"clearing index %d from table %d\", index.ID, tableDesc.GetID())\n\tif index.IsInterleaved() {\n\t\treturn errors.Errorf(\"unexpected interleaved index %d\", index.ID)\n\t}\n\n\tsp := tableDesc.IndexSpan(execCfg.Codec, index.ID)\n\tstart, err := keys.Addr(sp.Key)\n\tif err != nil {\n\t\treturn errors.Errorf(\"failed to addr index start: %v\", err)\n\t}\n\tend, err := keys.Addr(sp.EndKey)\n\tif err != nil {\n\t\treturn errors.Errorf(\"failed to addr index end: %v\", err)\n\t}\n\trSpan := roachpb.RSpan{Key: start, EndKey: end}\n\treturn clearSpanData(ctx, execCfg.DB, execCfg.DistSender, rSpan)\n}", "func (mg *MoveGen) Clear() {\n\tmg.index = 0\n}", "func (display smallEpd) Clear() (err error) {\n\tlog.Debug(\"EPD42 Clear\")\n\n\tif err = display.sendCommand(DATA_START_TRANSMISSION_1); err != nil {\n\t\treturn\n\t}\n\n\t// TODO: Verify that this is enough bits\n\tfor i := 0; i < display.Width()*display.Height()/8; i++ {\n\t\tif err = display.sendData([]byte{0xFF}); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif err = display.sendCommand(DATA_START_TRANSMISSION_2); err != nil {\n\t\treturn\n\t}\n\n\tfor i := 0; i < display.Width()*display.Height()/8; i++ {\n\t\tif err = display.sendData([]byte{0xFF}); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif err = display.sendCommand(DISPLAY_REFRESH); err != nil {\n\t\treturn\n\t}\n\n\tif err = display.waitUntilIdle(); err != nil {\n\t\treturn\n\t}\n\n\tlog.Debug(\"EPD42 Clear End\")\n\treturn\n}" ]
[ "0.7557742", "0.6926225", "0.6661539", "0.66511786", "0.6609662", "0.65809613", "0.6549761", "0.6321644", "0.63114774", "0.6242595", "0.62145805", "0.62142456", "0.6212063", "0.62066", "0.61998916", "0.6166759", "0.6153944", "0.6153944", "0.61492884", "0.61306447", "0.602728", "0.6015588", "0.60130703", "0.5992833", "0.5992833", "0.59668773", "0.59666157", "0.596032", "0.59461194", "0.59434265", "0.59326655", "0.59303963", "0.5919334", "0.5916094", "0.58646196", "0.5863361", "0.5848986", "0.58480567", "0.5811105", "0.57845265", "0.5783361", "0.5750174", "0.57318616", "0.57291764", "0.5723938", "0.5714473", "0.5708906", "0.5702252", "0.5694861", "0.5685039", "0.5685039", "0.5684971", "0.567208", "0.5667179", "0.56595093", "0.564808", "0.5635059", "0.5624169", "0.56084096", "0.56084096", "0.55884326", "0.55857986", "0.55799407", "0.557674", "0.55751646", "0.5555243", "0.5545292", "0.55275065", "0.5522197", "0.5520504", "0.5511463", "0.55046326", "0.55007905", "0.5490794", "0.5480402", "0.547568", "0.54690456", "0.54374766", "0.54239565", "0.5407808", "0.53873134", "0.5377919", "0.537424", "0.5368595", "0.5348063", "0.5343423", "0.5340826", "0.5327524", "0.53236634", "0.53167635", "0.5309815", "0.5308199", "0.53061134", "0.5303768", "0.53021544", "0.52970123", "0.52970123", "0.5294328", "0.5289729", "0.5288904" ]
0.732023
1
specify a twodimensional texture subimage in a compressed format
указать двумерное подизображение текстуры в сжатом формате
func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) { C.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetCompressedTextureSubImage, 10, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetTextureSubImage, 12, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(bufSize), uintptr(pixels))\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage3D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height))\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage2D, 8, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height), 0)\n}", "func (tex Texture) Sub(ctx gl.Context, lvl int, width int, height int, data []byte) {\n\tctx.TexSubImage2D(gl.TEXTURE_2D, lvl, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data)\n\tif lvl > 0 {\n\t\tctx.GenerateMipmap(gl.TEXTURE_2D)\n\t}\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexSubImage2D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tsyscall.Syscall6(gpCopyTextureSubImage1D, 6, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(x), uintptr(y), uintptr(width))\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexSubImage2D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) {\n\tgl.TexSubImage2D(uint32(target), int32(level), int32(x), int32(y), int32(width), int32(height), uint32(format), uint32(ty), gl.Ptr(&data[0]))\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CompressedTexSubImage2D(target GLEnum, level, xoffset, yoffset, width, height int32, format GLEnum, imageSize int32, pixels []float32) {\n\tgl.CompressedTexSubImage2D(uint32(target), level, xoffset, yoffset, width, height, uint32(format), imageSize, unsafe.Pointer(&pixels[0]))\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTexSubImage3D, 11, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func TexSubImage2D(target GLEnum, level, xoffset, yoffset, width, height int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexSubImage2D(uint32(target), level, xoffset, yoffset, width, height, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall6(gpGetCompressedTextureImage, 4, uintptr(texture), uintptr(level), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels)\n}", "func CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) {\n\tgl.CompressedTexSubImage2D(uint32(target), int32(level), int32(xoffset), int32(yoffset), int32(width), int32(height), uint32(format), int32(len(data)), gl.Ptr(data))\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage2D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(imageSize), uintptr(data), 0)\n}", "func TexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, width Sizei, height Sizei, format Enum, kind Enum, pixels unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcformat, _ := (C.GLenum)(format), cgoAllocsUnknown\n\tckind, _ := (C.GLenum)(kind), cgoAllocsUnknown\n\tcpixels, _ := (unsafe.Pointer)(unsafe.Pointer(pixels)), cgoAllocsUnknown\n\tC.glTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cwidth, cheight, cformat, ckind, cpixels)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexSubImage1D, 7, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTexSubImage3D, 11, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n C.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, width Sizei, height Sizei, format Enum, imageSize Sizei, data unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcformat, _ := (C.GLenum)(format), cgoAllocsUnknown\n\tcimageSize, _ := (C.GLsizei)(imageSize), cgoAllocsUnknown\n\tcdata, _ := (unsafe.Pointer)(unsafe.Pointer(data)), cgoAllocsUnknown\n\tC.glCompressedTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cwidth, cheight, cformat, cimageSize, cdata)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexImage2D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func TexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexImage2D(uint32(target), level, int32(internalformat), width, height, border, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexSubImage1D, 7, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) {\n\tp := unsafe.Pointer(nil)\n\tif len(data) > 0 {\n\t\tp = gl.Ptr(&data[0])\n\t}\n\tgl.TexImage2D(uint32(target), int32(level), int32(format), int32(width), int32(height), 0, uint32(format), uint32(ty), p)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n C.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func (debugging *debuggingOpenGL) TexImage2D(target uint32, level int32, internalFormat uint32, width int32, height int32,\n\tborder int32, format uint32, xtype uint32, pixels interface{}) {\n\tdebugging.recordEntry(\"TexImage2D\", target, level, internalFormat, width, height, border, format, xtype, pixels)\n\tdebugging.gl.TexImage2D(target, level, internalFormat, width, height, border, format, xtype, pixels)\n\tdebugging.recordExit(\"TexImage2D\")\n}", "func CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) {\n\tgl.CompressedTexImage2D(uint32(target), int32(level), uint32(internalformat), int32(width), int32(height), int32(border), int32(len(data)), gl.Ptr(data))\n}", "func CompressedTexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border, imageSize int32, pixels []float32) {\n\tgl.CompressedTexImage2D(uint32(target), level, uint32(internalformat), width, height, border, imageSize, unsafe.Pointer(&pixels[0]))\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tC.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tC.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n C.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func (native *OpenGL) TexImage2D(target uint32, level int32, internalFormat uint32, width int32, height int32,\n\tborder int32, format uint32, xtype uint32, pixels interface{}) {\n\tptr, isPointer := pixels.(unsafe.Pointer)\n\tif isPointer {\n\t\tgl.TexImage2D(target, level, int32(internalFormat), width, height, border, format, xtype, ptr)\n\t} else {\n\t\tgl.TexImage2D(target, level, int32(internalFormat), width, height, border, format, xtype, gl.Ptr(pixels))\n\t}\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n C.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tsyscall.Syscall(gpGetCompressedTexImage, 3, uintptr(target), uintptr(level), uintptr(img))\n}", "func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n C.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func (gl *WebGL) TexImage2D(target GLEnum, level int, internalFormat GLEnum, format GLEnum, texelType GLEnum, pixels interface{}) {\n\tgl.context.Call(\"texImage2D\", target, level, internalFormat, format, texelType, pixels)\n}", "func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n C.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage3D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(depth), uintptr(border), uintptr(imageSize), uintptr(data))\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage1D, 7, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(border), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {\n C.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format))\n}", "func CompressedTexImage2D(target Enum, level Int, internalformat Enum, width Sizei, height Sizei, border Int, imageSize Sizei, data unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcinternalformat, _ := (C.GLenum)(internalformat), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcborder, _ := (C.GLint)(border), cgoAllocsUnknown\n\tcimageSize, _ := (C.GLsizei)(imageSize), cgoAllocsUnknown\n\tcdata, _ := (unsafe.Pointer)(unsafe.Pointer(data)), cgoAllocsUnknown\n\tC.glCompressedTexImage2D(ctarget, clevel, cinternalformat, cwidth, cheight, cborder, cimageSize, cdata)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tC.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tC.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tsyscall.Syscall9(gpCopyTexImage2D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(border), 0)\n}", "func (self *Graphics) GenerateTexture2O(resolution int, scaleMode int) *Texture{\n return &Texture{self.Object.Call(\"generateTexture\", resolution, scaleMode)}\n}" ]
[ "0.75624573", "0.74462503", "0.74462503", "0.7382152", "0.733096", "0.733096", "0.7265395", "0.71279454", "0.7097129", "0.7097129", "0.6861826", "0.6717682", "0.6717682", "0.6695255", "0.6680614", "0.6680614", "0.66295075", "0.6612707", "0.6605899", "0.6605899", "0.6574313", "0.6574313", "0.65357566", "0.65144676", "0.6504656", "0.6504656", "0.6480661", "0.64585876", "0.6403474", "0.6390071", "0.6390071", "0.6337915", "0.6337915", "0.6335403", "0.6332997", "0.6332359", "0.6305687", "0.62996304", "0.62996304", "0.6239961", "0.62393045", "0.6211405", "0.6211405", "0.61972624", "0.61952597", "0.6187488", "0.6177589", "0.6139043", "0.6139043", "0.60941833", "0.60900843", "0.60900843", "0.60647374", "0.6056523", "0.5942622", "0.59338504", "0.5907641", "0.59032553", "0.5886487", "0.5874333", "0.5874333", "0.57928145", "0.5787828", "0.5787828", "0.5786048", "0.5741639", "0.57364833", "0.57364833", "0.57158744", "0.5698743", "0.56864345", "0.5672856", "0.56230116", "0.5620403", "0.5603419", "0.55983955", "0.5578517", "0.5578517", "0.55336726", "0.55336726", "0.55312806", "0.55312806", "0.5478601", "0.5445027", "0.5347705", "0.53076416", "0.5286839", "0.52686876", "0.52682906", "0.52631176", "0.5257812", "0.51905894", "0.51804966", "0.5174424", "0.5171122", "0.51666373", "0.51666373", "0.5154171", "0.5135581" ]
0.7577275
1
specify a threedimensional texture subimage in a compressed format
указать трехмерную текстурную подизображение в сжатом формате
func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) { C.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetCompressedTextureSubImage, 10, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage3D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height))\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTexSubImage3D, 11, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetTextureSubImage, 12, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(bufSize), uintptr(pixels))\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tsyscall.Syscall6(gpCopyTextureSubImage1D, 6, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(x), uintptr(y), uintptr(width))\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall6(gpGetCompressedTextureImage, 4, uintptr(texture), uintptr(level), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTexSubImage3D, 11, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func (tex Texture) Sub(ctx gl.Context, lvl int, width int, height int, data []byte) {\n\tctx.TexSubImage2D(gl.TEXTURE_2D, lvl, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data)\n\tif lvl > 0 {\n\t\tctx.GenerateMipmap(gl.TEXTURE_2D)\n\t}\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage2D, 8, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height), 0)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexSubImage2D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) {\n\tgl.TexSubImage2D(uint32(target), int32(level), int32(x), int32(y), int32(width), int32(height), uint32(format), uint32(ty), gl.Ptr(&data[0]))\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CompressedTexSubImage2D(target GLEnum, level, xoffset, yoffset, width, height int32, format GLEnum, imageSize int32, pixels []float32) {\n\tgl.CompressedTexSubImage2D(uint32(target), level, xoffset, yoffset, width, height, uint32(format), imageSize, unsafe.Pointer(&pixels[0]))\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexSubImage2D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage2D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(imageSize), uintptr(data), 0)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexSubImage1D, 7, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func TexSubImage2D(target GLEnum, level, xoffset, yoffset, width, height int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexSubImage2D(uint32(target), level, xoffset, yoffset, width, height, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n C.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexSubImage1D, 7, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) {\n\tgl.CompressedTexSubImage2D(uint32(target), int32(level), int32(xoffset), int32(yoffset), int32(width), int32(height), uint32(format), int32(len(data)), gl.Ptr(data))\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n C.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage3D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(depth), uintptr(border), uintptr(imageSize), uintptr(data))\n}", "func TexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexImage2D(uint32(target), level, int32(internalformat), width, height, border, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) {\n\tp := unsafe.Pointer(nil)\n\tif len(data) > 0 {\n\t\tp = gl.Ptr(&data[0])\n\t}\n\tgl.TexImage2D(uint32(target), int32(level), int32(format), int32(width), int32(height), 0, uint32(format), uint32(ty), p)\n}", "func CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) {\n\tgl.CompressedTexImage2D(uint32(target), int32(level), uint32(internalformat), int32(width), int32(height), int32(border), int32(len(data)), gl.Ptr(data))\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexImage2D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage1D, 7, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(border), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func CompressedTexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border, imageSize int32, pixels []float32) {\n\tgl.CompressedTexImage2D(uint32(target), level, uint32(internalformat), width, height, border, imageSize, unsafe.Pointer(&pixels[0]))\n}", "func TexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, width Sizei, height Sizei, format Enum, kind Enum, pixels unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcformat, _ := (C.GLenum)(format), cgoAllocsUnknown\n\tckind, _ := (C.GLenum)(kind), cgoAllocsUnknown\n\tcpixels, _ := (unsafe.Pointer)(unsafe.Pointer(pixels)), cgoAllocsUnknown\n\tC.glTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cwidth, cheight, cformat, ckind, cpixels)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tC.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tC.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CompressedTexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, width Sizei, height Sizei, format Enum, imageSize Sizei, data unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcformat, _ := (C.GLenum)(format), cgoAllocsUnknown\n\tcimageSize, _ := (C.GLsizei)(imageSize), cgoAllocsUnknown\n\tcdata, _ := (unsafe.Pointer)(unsafe.Pointer(data)), cgoAllocsUnknown\n\tC.glCompressedTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cwidth, cheight, cformat, cimageSize, cdata)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTexImage3D, 10, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(depth), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tsyscall.Syscall(gpGetCompressedTexImage, 3, uintptr(target), uintptr(level), uintptr(img))\n}", "func (debugging *debuggingOpenGL) TexImage2D(target uint32, level int32, internalFormat uint32, width int32, height int32,\n\tborder int32, format uint32, xtype uint32, pixels interface{}) {\n\tdebugging.recordEntry(\"TexImage2D\", target, level, internalFormat, width, height, border, format, xtype, pixels)\n\tdebugging.gl.TexImage2D(target, level, internalFormat, width, height, border, format, xtype, pixels)\n\tdebugging.recordExit(\"TexImage2D\")\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n C.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tC.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tC.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func TexImage1D(target uint32, level int32, internalformat int32, width int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexImage1D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexImage3D(gpTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage3D(gpTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage3D(gpTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}" ]
[ "0.7413762", "0.726753", "0.726753", "0.72593474", "0.72593474", "0.7232897", "0.7199341", "0.71802086", "0.71552026", "0.71552026", "0.6744676", "0.667433", "0.667433", "0.6587511", "0.6587511", "0.6553164", "0.65196425", "0.63975227", "0.6391272", "0.6342379", "0.6342379", "0.6335705", "0.6335705", "0.63193494", "0.6305585", "0.6305585", "0.6284242", "0.6284242", "0.6277623", "0.6271112", "0.6271112", "0.62583905", "0.62547237", "0.62024236", "0.61768454", "0.61734706", "0.6142903", "0.6101152", "0.6101152", "0.608834", "0.6088192", "0.6079898", "0.6079898", "0.60359746", "0.6034976", "0.6031571", "0.6031571", "0.6015362", "0.6014512", "0.59687316", "0.5948147", "0.5948147", "0.5918612", "0.5918612", "0.59132814", "0.58945316", "0.58945316", "0.5894125", "0.5861998", "0.5861822", "0.5839391", "0.58344233", "0.57997257", "0.57462", "0.5737097", "0.5725774", "0.5725774", "0.57246256", "0.5715732", "0.5715732", "0.5699877", "0.56535393", "0.55589014", "0.55479765", "0.55442345", "0.5522677", "0.55188686", "0.5493213", "0.5491885", "0.54781926", "0.54781926", "0.54684263", "0.54684263", "0.5441828", "0.54332495", "0.541208", "0.54057884", "0.53769135", "0.5370847", "0.5370847", "0.5363173", "0.534126", "0.534126", "0.5321106", "0.5287312", "0.5275723", "0.5275723", "0.5232185", "0.5232185" ]
0.74802285
1
copy pixels into a color table
скопировать пиксели в таблицу цветов
func CopyColorTable(target uint32, internalformat uint32, x int32, y int32, width int32) { C.glowCopyColorTable(gpCopyColorTable, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CopyColorTable(target uint32, internalformat uint32, x int32, y int32, width int32) {\n C.glowCopyColorTable(gpCopyColorTable, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyColorSubTable(target uint32, start int32, x int32, y int32, width int32) {\n C.glowCopyColorSubTable(gpCopyColorSubTable, (C.GLenum)(target), (C.GLsizei)(start), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyColorSubTable(target uint32, start int32, x int32, y int32, width int32) {\n\tC.glowCopyColorSubTable(gpCopyColorSubTable, (C.GLenum)(target), (C.GLsizei)(start), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func ColorSubTable(target uint32, start int32, count int32, format uint32, xtype uint32, data unsafe.Pointer) {\n C.glowColorSubTable(gpColorSubTable, (C.GLenum)(target), (C.GLsizei)(start), (C.GLsizei)(count), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func ColorTable(target uint32, internalformat uint32, width int32, format uint32, xtype uint32, table unsafe.Pointer) {\n C.glowColorTable(gpColorTable, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), table)\n}", "func ColorSubTable(target uint32, start int32, count int32, format uint32, xtype uint32, data unsafe.Pointer) {\n\tC.glowColorSubTable(gpColorSubTable, (C.GLenum)(target), (C.GLsizei)(start), (C.GLsizei)(count), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}", "func CopyPixels(x int32, y int32, width int32, height int32, xtype uint32) {\n C.glowCopyPixels(gpCopyPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(xtype))\n}", "func ColorTable(target uint32, internalformat uint32, width int32, format uint32, xtype uint32, table unsafe.Pointer) {\n\tC.glowColorTable(gpColorTable, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), table)\n}", "func CopyPixels(x int32, y int32, width int32, height int32, xtype uint32) {\n\tsyscall.Syscall6(gpCopyPixels, 5, uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(xtype), 0)\n}", "func CopyPixels(x int32, y int32, width int32, height int32, xtype uint32) {\n\tC.glowCopyPixels(gpCopyPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(xtype))\n}", "func setPixel(x, y int, c color, pixels []byte) {\n\tindex := (y*windowWidth + x) * 4\n\n\tif index < len(pixels)-4 && index >= 0 {\n\t\tpixels[index] = c.r\n\t\tpixels[index+1] = c.g\n\t\tpixels[index+1] = c.b\n\t}\n}", "func (c *Canvas) copyTo(offset image.Point, dstSetCell setCellFunc) error {\n\tfor col := range c.buffer {\n\t\tfor row := range c.buffer[col] {\n\t\t\tpartial, err := c.buffer.IsPartial(image.Point{col, row})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif partial {\n\t\t\t\t// Skip over partial cells, i.e. cells that follow a cell\n\t\t\t\t// containing a full-width rune. A full-width rune takes only\n\t\t\t\t// one cell in the buffer, but two on the terminal.\n\t\t\t\t// See http://www.unicode.org/reports/tr11/.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcell := c.buffer[col][row]\n\t\t\tp := image.Point{col, row}.Add(offset)\n\t\t\tif err := dstSetCell(p, cell.Rune, cell.Opts); err != nil {\n\t\t\t\treturn fmt.Errorf(\"setCellFunc%v => error: %v\", p, err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "func GetColorTable(target uint32, format uint32, xtype uint32, table unsafe.Pointer) {\n C.glowGetColorTable(gpGetColorTable, (C.GLenum)(target), (C.GLenum)(format), (C.GLenum)(xtype), table)\n}", "func putPixel(screen []byte, color color, x int, y int) {\n\tscreenX := (windowWidth / 2) + x\n\tscreenY := (windowHeight / 2) - y - 1\n\tbase := (screenY*windowWidth + screenX) * 4\n\tscreen[base] = color.r\n\tscreen[base+1] = color.g\n\tscreen[base+2] = color.b\n\tscreen[base+3] = 0xFF\n\tscreen[0] = 0xFF\n}", "func setPixel(x, y int, c color, pixels []byte) error {\n\tindex := (y*int(winWidth) + x) * 4\n\n\tif index > len(pixels) || index < 0 {\n\t\t// simple string-based error\n\t\treturn fmt.Errorf(\"the pixel index is not valid, index: %d\", index)\n\t}\n\n\tif index < len(pixels) && index >= 0 {\n\t\tpixels[index] = c.r\n\t\tpixels[index+1] = c.g\n\t\tpixels[index+2] = c.b\n\t}\n\n\treturn nil\n}", "func setPixel(x, y int, c color, pixels []byte) error {\n\tindex := (y*int(winWidth) + x) * 4\n\n\tif index > len(pixels) || index < 0 {\n\t\t// simple string-based error\n\t\treturn fmt.Errorf(\"the pixel index is not valid, index: %d\", index)\n\t}\n\n\tif index < len(pixels) && index >= 0 {\n\t\tpixels[index] = c.r\n\t\tpixels[index+1] = c.g\n\t\tpixels[index+2] = c.b\n\t}\n\n\treturn nil\n}", "func GenColor(intr int) [][]uint8 {\n\toutput := [][]uint8{}\n\tfor i := 0; i <= 255; i += intr {\n\t\tfor j := 0; j <= 255; j += intr {\n\t\t\tfor k := 0; k <= 255; k += intr {\n\t\t\t\ta := []uint8{uint8(i), uint8(j), uint8(k)}\n\t\t\t\toutput = append(output, a)\n\n\t\t\t}\n\t\t}\n\t}\n\treturn output\n\n}", "func (i *ImageBuf) CopyPixels(src *ImageBuf) error {\n\tok := bool(C.ImageBuf_copy_pixels(i.ptr, src.ptr))\n\truntime.KeepAlive(i)\n\truntime.KeepAlive(src)\n\tif !ok {\n\t\treturn i.LastError()\n\t}\n\treturn nil\n}", "func (fr *Frame) Copy(orig *Frame) {\n\tfr.Status = orig.Status\n\tfor y, row := range orig.Pix {\n\t\tcopy(fr.Pix[y][:], row)\n\t}\n}", "func drawTilePixels(image *image.RGBA, pixel [8][8]color.RGBA, xOffset int, yOffset int) *image.RGBA {\n\tfor x := 0; x < TileWidth; x++ {\n\t\tfor y := 0; y < TileHeight; y++ {\n\t\t\timage.SetRGBA(xOffset*TileWidth+x, yOffset*TileHeight+y, pixel[y][x])\n\t\t}\n\t}\n\treturn image\n}", "func GetColorTable(target uint32, format uint32, xtype uint32, table unsafe.Pointer) {\n\tC.glowGetColorTable(gpGetColorTable, (C.GLenum)(target), (C.GLenum)(format), (C.GLenum)(xtype), table)\n}", "func Copy(i ImageIr) ImageIr {\n\tc := make([][][]uint32, len(i.pixels))\n\tcopy(c, i.pixels)\n\treturn ImageIr{i.width, i.height, c}\n}", "func Copy(dst draw.Image, src image.Image) {\n\tbd := src.Bounds().Intersect(dst.Bounds())\n\tat := imageutil.NewAtFunc(src)\n\tset := imageutil.NewSetFunc(dst)\n\timageutil.Parallel1D(bd, func(bd image.Rectangle) {\n\t\tfor y := bd.Min.Y; y < bd.Max.Y; y++ {\n\t\t\tfor x := bd.Min.X; x < bd.Max.X; x++ {\n\t\t\t\tr, g, b, a := at(x, y)\n\t\t\t\tset(x, y, r, g, b, a)\n\t\t\t}\n\t\t}\n\t})\n}", "func tileToPixel(tileIndex uint8, mem *GBMem) [TileHeight][TileWidth]color.RGBA {\n\tvar pixels [TileHeight][TileWidth]color.RGBA\n\tfor y := 0; y < TileHeight; y++ {\n\t\tvar line [TileWidth]color.RGBA\n\t\tlsb := mem.vram[int(tileIndex)*16+2*y]\n\t\thsb := mem.vram[int(tileIndex)*16+2*y+1]\n\n\t\tfor x := 0; x < TileWidth; x++ {\n\t\t\tline[TileWidth-1-x] = paletteMap[compositePixel(lsb, hsb, uint8(x))]\n\t\t}\n\t\tpixels[y] = line\n\t}\n\treturn pixels\n}", "func newColorsImage(width, height int, colors []colorFreq, save bool) image.Image {\n\timg := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{width, height}})\n\tvar xStart, xEnd int\n\t// for each color, calculate the start and end x positions, then fill in the column\n\tfor i, c := range colors {\n\t\tif i == 0 {\n\t\t\txStart = 0\n\t\t} else {\n\t\t\txStart = xEnd\n\t\t}\n\t\txEnd = xStart + int(c.freq*float32(width))\n\n\t\tfor x := xStart; x < xEnd; x++ {\n\t\t\tfor y := 0; y < height; y++ {\n\t\t\t\timg.Set(x, y, c.color)\n\t\t\t}\n\t\t}\n\t}\n\n\tif save {\n\t\tout, _ := os.Create(\"./newColorsImage.png\")\n\t\tjpeg.Encode(out, img, nil)\n\t}\n\n\treturn img\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n C.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func (c *Canvas) pixelate(data []uint8, rect image.Rectangle, noiseLevel int) []uint8 {\n\t// Converts the array buffer to an image\n\timg := pixels.PixToImage(data, rect)\n\n\t// Quantize the substracted image in order to reduce the number of colors.\n\t// This will create a new pixelated subtype image.\n\tcell := quant.Draw(img, c.numOfColors, c.cellSize, noiseLevel)\n\n\tdst := image.NewNRGBA(cell.Bounds())\n\tdraw.Draw(dst, cell.Bounds(), cell, image.Point{}, draw.Over)\n\n\treturn pixels.ImgToPix(dst)\n}", "func (i *Image) readPixelsFromGPU() error {\n\tvar err error\n\ti.basePixels, err = i.image.Pixels()\n\tif err != nil {\n\t\treturn err\n\t}\n\ti.drawImageHistory = nil\n\ti.stale = false\n\treturn nil\n}", "func SetPixel(x, y int, c [4]byte, pixels *[]byte) {\n\tindex := (y* int(cfg.COLS*cfg.CELL_SIZE) + x) * 4\n\n\tif index < len(*pixels)-4 && index >= 0 {\n\t\t(*pixels)[index] = c[0]\n\t\t(*pixels)[index+1] = c[1]\n\t\t(*pixels)[index+2] = c[2]\t\n\t\t(*pixels)[index+3] = c[3]\t\n\t}\n}", "func SetPixel(n, r, g, b uint8) {\n\tbuffer[n*3] = g\n\tbuffer[n*3+1] = r\n\tbuffer[n*3+2] = b\n}", "func clone(dst, src *image.Gray) {\n\tif dst.Stride == src.Stride {\n\t\t// no need to correct stride, simply copy pixels.\n\t\tcopy(dst.Pix, src.Pix)\n\t\treturn\n\t}\n\t// need to correct stride.\n\tfor i := 0; i < src.Rect.Dy(); i++ {\n\t\tdstH := i * dst.Stride\n\t\tsrcH := i * src.Stride\n\t\tcopy(dst.Pix[dstH:dstH+dst.Stride], src.Pix[srcH:srcH+dst.Stride])\n\t}\n}", "func PreparePic(dx, dy int) [][]uint8 {\n\trows := make([][]uint8, dy)\n\tfor i := range rows {\n\t\trows[i] = make([]uint8, dx)\n\t}\n\treturn rows\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tC.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tC.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func (fb FrameBuffer) ColorAt(x int, y int) color.Color {\n\tc := fb.img.At(x, y)\n\treturn c\n}", "func (img *ByteImage) pixels() [][]byte {\n\tbyteIdx := 0\n\tpixels := make([][]byte, img.height)\n\tfor rowIdx := 0; rowIdx < img.height; rowIdx++ {\n\t\tpixels[rowIdx] = make([]byte, img.width)\n\t\tfor colIdx := 0; colIdx < img.width; colIdx++ {\n\t\t\tpixels[rowIdx][colIdx] = img.bytes[byteIdx]\n\t\t\tbyteIdx++\n\t\t}\n\t}\n\treturn pixels\n}", "func eachPixel(img image.Image, f func(int, int, color.Color)) {\n\tr := img.Bounds()\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\tf(x, y, img.At(x, y))\n\t\t}\n\t}\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tsyscall.Syscall9(gpCopyTexImage2D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(border), 0)\n}", "func extractSwatches(src *image.RGBA, numColors int) []colorful.Color {\n\tconst (\n\t\tW = 400\n\t\tH = 75\n\t)\n\tvar swatches []colorful.Color\n\tb := src.Bounds()\n\tsw := W / numColors\n\tfor i := 0; i < numColors; i++ {\n\t\tm := src.SubImage(trimRect(image.Rect(b.Min.X+i*sw, b.Max.Y-H, b.Min.X+(i+1)*sw, b.Max.Y), 10))\n\t\tswatches = append(swatches, toColorful(averageColor(m)))\n\t\tsavePNG(strconv.Itoa(i), m) // for debugging\n\t}\n\tconst dim = 50\n\tm := image.NewRGBA(image.Rect(0, 0, dim*len(swatches), dim))\n\tfor i, c := range swatches {\n\t\tr := image.Rect(i*dim, 0, (i+1)*dim, dim)\n\t\tdraw.Draw(m, r, &image.Uniform{fromColorful(c)}, image.ZP, draw.Src)\n\t}\n\tsavePNG(\"swatches\", m) // for debugging\n\treturn swatches\n}", "func p256Select(point, table []uint64, idx int)", "func p256Select(point, table []uint64, idx int)", "func (img Image) groupPixelOverColor() map[color.Color]int {\n\tcol := img.height\n\trow := img.width\n\n\tm := make(map[color.Color]int)\n\tfor i := 0; i < col*row; i++ {\n\n\t\tr, g, b, a := getP9RGBA(img.pixels[i])\n\t\tcurrentColor := color.RGBA{r, g, b, a}\n\n\t\tif _, ok := m[currentColor]; ok {\n\t\t\tm[currentColor]++\n\t\t} else {\n\t\t\tm[currentColor] = 0\n\t\t}\n\t}\n\n\treturn m\n}", "func (c *Canvas) pixToImage(pixels []uint8, dim int) image.Image {\n\tc.frame = image.NewNRGBA(image.Rect(0, 0, dim, dim))\n\tbounds := c.frame.Bounds()\n\tdx, dy := bounds.Max.X, bounds.Max.Y\n\tcol := color.NRGBA{\n\t\tR: uint8(0),\n\t\tG: uint8(0),\n\t\tB: uint8(0),\n\t\tA: uint8(255),\n\t}\n\n\tfor y := bounds.Min.Y; y < dy; y++ {\n\t\tfor x := bounds.Min.X; x < dx*4; x += 4 {\n\t\t\tcol.R = uint8(pixels[x+y*dx*4])\n\t\t\tcol.G = uint8(pixels[x+y*dx*4+1])\n\t\t\tcol.B = uint8(pixels[x+y*dx*4+2])\n\t\t\tcol.A = uint8(pixels[x+y*dx*4+3])\n\n\t\t\tc.frame.SetNRGBA(y, int(x/4), col)\n\t\t}\n\t}\n\treturn c.frame\n}", "func ColorPointer(size int32, xtype uint32, stride int32, pointer unsafe.Pointer) {\n C.glowColorPointer(gpColorPointer, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer)\n}", "func hLine(img *image.NRGBA, x1, y, x2 int, col color.Color) {\r\n\tfor ; x1 <= x2; x1++ {\r\n\t\timg.Set(x1, y, col)\r\n\t}\r\n}", "func SwitchData(x, y gb.UINT8, src, dst []gb.UINT8) {}", "func ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) {\n\tgl.ReadPixels(int32(x), int32(y), int32(width), int32(height), uint32(format), uint32(ty), gl.Ptr(&dst[0]))\n}", "func CopyTexImage2D(target Enum, level Int, internalformat Enum, x Int, y Int, width Sizei, height Sizei, border Int) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcinternalformat, _ := (C.GLenum)(internalformat), cgoAllocsUnknown\n\tcx, _ := (C.GLint)(x), cgoAllocsUnknown\n\tcy, _ := (C.GLint)(y), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcborder, _ := (C.GLint)(border), cgoAllocsUnknown\n\tC.glCopyTexImage2D(ctarget, clevel, cinternalformat, cx, cy, cwidth, cheight, cborder)\n}", "func (fb *FrameBuffer) SetColorAt(x int, y int, c color.Color) {\n\tif x >= 0 && y >= 0 && x < fb.width && y < fb.height {\n\t\tfb.img.Set(x, y, c) // = c\n\t}\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n C.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))\n}", "func reflectPixels(pixels [7][7]bool) [7][7]bool {\n\t// Reflect over the middle line\n\tfor i := 0; i < 7; i++ {\n\t\tfor j := 0; j < 7; j++ {\n\t\t\tpixels[6-i][j] = pixels[i][j]\n\t\t}\n\t}\n\treturn pixels\n}", "func ColorPointer(size int32, xtype uint32, stride int32, pointer unsafe.Pointer) {\n\tsyscall.Syscall6(gpColorPointer, 4, uintptr(size), uintptr(xtype), uintptr(stride), uintptr(pointer), 0, 0)\n}", "func (p *RGBAf) Set(x, y int, c color.Color) {\n\tif !(image.Point{x, y}.In(p.Rect)) {\n\t\treturn\n\t}\n\ti := p.PixOffset(x, y)\n\tc1 := color.RGBAModel.Convert(c).(color.RGBA)\n\ts := p.Pix[i : i+4 : i+4] // Small cap improves performance, see https://golang.org/issue/27857\n\ts[0] = float32(c1.R)\n\ts[1] = float32(c1.G)\n\ts[2] = float32(c1.B)\n\ts[3] = float32(c1.A)\n}", "func getHistogram(src [][3]int, size float64, pixels *[HistSize][3]float64, hist *[HistSize]float64) {\n\tvar ind, r, g, b, i int\n\tvar inr, ing, inb int\n\n\tfor i = range src {\n\t\tr = src[i][0]\n\t\tg = src[i][1]\n\t\tb = src[i][2]\n\n\t\tinr = r >> Shift\n\t\ting = g >> Shift\n\t\tinb = b >> Shift\n\n\t\tind = (inr << (2 * HistBits)) + (ing << HistBits) + inb\n\t\tpixels[ind][0], pixels[ind][1], pixels[ind][2] = float64(r), float64(g), float64(b)\n\t\thist[ind]++\n\t}\n\n\t// normalize weight by the number of pixels in the image\n\tfor i = 0; i < HistSize; i++ {\n\t\thist[i] /= size\n\t}\n}", "func dHash(img image.Image) (bits [2]uint64) {\n\t// Resize the image to 9x8.\n\tscaled := resize.Resize(8, 8, img, resize.Bicubic)\n\n\t// Scan it.\n\tyPos := uint(0)\n\tcbPos := uint(0)\n\tcrPos := uint(32)\n\tfor y := 0; y < 8; y++ {\n\t\tfor x := 0; x < 8; x++ {\n\t\t\tyTR, cbTR, crTR := ycbcr(scaled.At(x, y))\n\t\t\tif x == 0 {\n\t\t\t\t// The first bit is a rough approximation of the colour value.\n\t\t\t\tif yTR&0x80 > 0 {\n\t\t\t\t\tbits[0] |= 1 << yPos\n\t\t\t\t\tyPos++\n\t\t\t\t}\n\t\t\t\tif y&1 == 0 {\n\t\t\t\t\t_, cbBR, crBR := ycbcr(scaled.At(x, y+1))\n\t\t\t\t\tif (cbBR+cbTR)>>1&0x80 > 0 {\n\t\t\t\t\t\tbits[1] |= 1 << cbPos\n\t\t\t\t\t\tcbPos++\n\t\t\t\t\t}\n\t\t\t\t\tif (crBR+crTR)>>1&0x80 > 0 {\n\t\t\t\t\t\tbits[1] |= 1 << crPos\n\t\t\t\t\t\tcrPos++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Use a rough first derivative for the other bits.\n\t\t\t\tyTL, cbTL, crTL := ycbcr(scaled.At(x-1, y))\n\t\t\t\tif yTR > yTL {\n\t\t\t\t\tbits[0] |= 1 << yPos\n\t\t\t\t\tyPos++\n\t\t\t\t}\n\t\t\t\tif y&1 == 0 {\n\t\t\t\t\t_, cbBR, crBR := ycbcr(scaled.At(x, y+1))\n\t\t\t\t\t_, cbBL, crBL := ycbcr(scaled.At(x-1, y+1))\n\t\t\t\t\tif (cbBR+cbTR)>>1 > (cbBL+cbTL)>>1 {\n\t\t\t\t\t\tbits[1] |= 1 << cbPos\n\t\t\t\t\t\tcbPos++\n\t\t\t\t\t}\n\t\t\t\t\tif (crBR+crTR)>>1 > (crBL+crTL)>>1 {\n\t\t\t\t\t\tbits[1] |= 1 << crPos\n\t\t\t\t\t\tcrPos++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}", "func GetPixels(img image.Image) [][]Pixel {\n\tbounds := img.Bounds()\n\timg_size := bounds.Size()\n\tw, h := img_size.X, img_size.Y\n\tpixels := make([][]Pixel, h)\n\tfor i := 0; i < h; i++ {\n\t\tpixels[i] = make([]Pixel, w)\n\t}\n\n\tdi := 0\n\tfor y := bounds.Min.Y; y < bounds.Max.Y; y++ {\n\t\tdj := 0\n\t\tfor x := bounds.Min.X; x < bounds.Max.X; x++ {\n\t\t\torig_color := img.At(x, y)\n\t\t\tcolor, alpha_flag := colorful.MakeColor(orig_color)\n\t\t\tif !alpha_flag {\n\t\t\t\tcolor = colorful.Color{R: 1.0, G: 1.0, B: 1.0}\n\t\t\t}\n\t\t\t_, _, _, alpha := orig_color.RGBA()\n\t\t\tpixels[di][dj] = Pixel{\n\t\t\t\tcolor: color,\n\t\t\t\talpha: alpha,\n\t\t\t}\n\t\t\tdj++\n\t\t}\n\t\tdi++\n\t}\n\n\treturn pixels\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n C.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func (c *Container) setBitmapCopy(bitmap []uint64) {\n\tvar bitmapCopy [bitmapN]uint64\n\tcopy(bitmapCopy[:], bitmap)\n\tc.setBitmap(bitmapCopy[:])\n}", "func (c *Canvas) SetPixels(pixels []uint8) {\n\tc.gf.Dirty()\n\n\tmainthread.Call(func() {\n\t\ttex := c.Texture()\n\t\ttex.Begin()\n\t\ttex.SetPixels(0, 0, tex.Width(), tex.Height(), pixels)\n\t\ttex.End()\n\t})\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n\tC.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n\tC.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))\n}", "func (a *AnAlgorithm) mapSkinPixels() () {\n\tupLeft := image.Point{0, 0}\n\tlowRight := image.Point{a.width, a.height}\n\n\ta.skinMap = image.NewRGBA(image.Rectangle{upLeft, lowRight})\n\n\tblack := color.RGBA{0,0,0, 0xff}\n\twhite := color.RGBA{255,255,255, 0xff}\n\n\ta.backgroundPixelCount = 0\n\ta.skinPixelCount = 0\n\n\tvar drawPixCol color.RGBA\n\tfor x := 0; x < a.width; x++ {\n\t\tfor y := 0; y < a.height; y++ {\n\t\t\tpixCol := a.img.At(x, y)\n\n\t\t\tdrawPixCol = white\n\t\t\tif a.yCbCrSkinDetector(pixCol) == true {\n\t\t\t\ta.skinPixelCount++\n\t\t\t\tdrawPixCol = black\n\t\t\t} else {\n\t\t\t\ta.backgroundPixelCount++\n\t\t\t}\n\n\t\t\ta.skinMap.(draw.Image).Set(x, y, drawPixCol)\n\t\t}\n\t}\n\n}", "func histogramRGBPixels(filename string) [16][4]float64 {\n\tm := openImage(filename)\n\tbounds := m.Bounds()\n\n\tvar histogram [16][4]int\n\tfor y := bounds.Min.Y; y < bounds.Max.Y; y++ {\n\t\tfor x := bounds.Min.X; x < bounds.Max.X; x++ {\n\t\t\tr, g, b, a := m.At(x, y).RGBA()\n\t\t\thistogram[r>>12][0]++\n\t\t\thistogram[g>>12][1]++\n\t\t\thistogram[b>>12][2]++\n\t\t\thistogram[a>>12][3]++\n\t\t}\n\t}\n\t//printHistogram(histogram)\n\n\t//normalize\n\tvar histogramf [16][4]float64\n\tpixels := (bounds.Max.Y - bounds.Min.Y) * (bounds.Max.X - bounds.Min.X)\n\tfor bucket := range histogram {\n\t\tfor color := range histogram[bucket] {\n\t\t\thistogramf[bucket][color] = float64(histogram[bucket][color]) / float64(pixels)\n\t\t}\n\t}\n\t//printFHistogram(histogramf)\n\treturn histogramf\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n\tsyscall.Syscall9(gpCopyTexImage1D, 7, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(x), uintptr(y), uintptr(width), uintptr(border), 0, 0)\n}", "func vLine(img *image.NRGBA, x, y1, y2 int, col color.Color) {\r\n\tfor ; y1 <= y2; y1++ {\r\n\t\timg.Set(x, y1, col)\r\n\t}\r\n}", "func fill(pix []byte, c color.RGBA) {\n\tfor i := 0; i < len(pix); i += 4 {\n\t\tpix[i] = c.R\n\t\tpix[i+1] = c.G\n\t\tpix[i+2] = c.B\n\t\tpix[i+3] = c.A\n\t}\n}", "func hline (x1 int, x2 int, y int) {\n\tfor n := x1; n < x2; n++ {\n\t\t\timg.Set(n, y, col)\n\t}\n}", "func copyImg(filename string, rowX int, colX int) string {\n\t//Filename path\n\tpath := \"/gorpc/Images/\" + filename\n\n\t//Extract matrix of image file data\n\tpixels := gocv.IMRead(path, 1)\n\n\t//Get dimensions from picture\n\tdimensions := pixels.Size()\n\theight := dimensions[0]\n\twidth := dimensions[1]\n\n\t//Get type of mat\n\tmatType := pixels.Type()\n\n\t//Create a new mat to fill\n\tbigMat := gocv.NewMatWithSize(height * rowX, width * colX, matType)\n\n\t//Created a wait group to sync filling images\n\twg := sync.WaitGroup{}\n\twg.Add(rowX * colX)\n\n\t//Fill in image copies by relative index on matrix\n\tfor i := 0; i < rowX; i++{\n\t\tfor j := 0; j < colX; j++{\n\t\t\tgo func (i int, j int){\n\t\t\t\t//Decrement counter if an image copy is made\n\t\t\t\tdefer wg.Done()\n\n\t\t\t\t//Iterate over original image and store in new index copy\n\t\t\t\tfor x := 0; x < height; x++{\n\t\t\t\t\tfor y := 0; y < width; y++{\n\t\t\t\t\t\tval := GetVecbAt(pixels, x, y)\n\n\t\t\t\t\t\tval.SetVecbAt(bigMat, (i*height) + x, (j*width) + y)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}(i, j)\n\t\t}\n\t}\n\n\t//Wait till all copies are filled in\n\twg.Wait()\n\n\t//Remove extension from filename\n\text := filepath.Ext(filename)\n\tname := strings.TrimSuffix(filename, ext)\n\n\t//Rename the new scaled image\n\tnewName := name + \"C\" + ext\n\n\t//New path\n\tnewPath := \"/gorpc/Images/\" + newName\n\n\t//Save the new image from matrix in local directory\n\tgocv.IMWrite(newPath, bigMat)\n\n\treturn newName\n}", "func (g *gfx) SetPixel(x, y int) {\n\tg[x][y] = COLOR_WHITE\n}", "func colorDestinationImage(\n\tdestinationImage *image.NRGBA,\n\tsourceImage image.Image,\n\tdestinationCoordinates []complex128,\n\ttransformedCoordinates []complex128,\n\tcolorValueBoundMin complex128,\n\tcolorValueBoundMax complex128,\n) {\n\tsourceImageBounds := sourceImage.Bounds()\n\tfor index, transformedCoordinate := range transformedCoordinates {\n\t\tvar sourceColorR, sourceColorG, sourceColorB, sourceColorA uint32\n\n\t\tif real(transformedCoordinate) < real(colorValueBoundMin) ||\n\t\t\timag(transformedCoordinate) < imag(colorValueBoundMin) ||\n\t\t\treal(transformedCoordinate) > real(colorValueBoundMax) ||\n\t\t\timag(transformedCoordinate) > imag(colorValueBoundMax) {\n\t\t\tsourceColorR, sourceColorG, sourceColorB, sourceColorA = 0, 0, 0, 0\n\t\t} else {\n\t\t\tsourceImagePixelX := int(mathutility.ScaleValueBetweenTwoRanges(\n\t\t\t\tfloat64(real(transformedCoordinate)),\n\t\t\t\treal(colorValueBoundMin),\n\t\t\t\treal(colorValueBoundMax),\n\t\t\t\tfloat64(sourceImageBounds.Min.X),\n\t\t\t\tfloat64(sourceImageBounds.Max.X),\n\t\t\t))\n\t\t\tsourceImagePixelY := int(mathutility.ScaleValueBetweenTwoRanges(\n\t\t\t\tfloat64(imag(transformedCoordinate)),\n\t\t\t\timag(colorValueBoundMin),\n\t\t\t\timag(colorValueBoundMax),\n\t\t\t\tfloat64(sourceImageBounds.Min.Y),\n\t\t\t\tfloat64(sourceImageBounds.Max.Y),\n\t\t\t))\n\t\t\tsourceColorR, sourceColorG, sourceColorB, sourceColorA = sourceImage.At(sourceImagePixelX, sourceImagePixelY).RGBA()\n\t\t}\n\n\t\tdestinationPixelX := int(real(destinationCoordinates[index]))\n\t\tdestinationPixelY := int(imag(destinationCoordinates[index]))\n\n\t\tdestinationImage.Set(\n\t\t\tdestinationPixelX,\n\t\t\tdestinationPixelY,\n\t\t\tcolor.NRGBA{\n\t\t\t\tR: uint8(sourceColorR >> 8),\n\t\t\t\tG: uint8(sourceColorG >> 8),\n\t\t\t\tB: uint8(sourceColorB >> 8),\n\t\t\t\tA: uint8(sourceColorA >> 8),\n\t\t\t},\n\t\t)\n\t}\n}", "func (display smallEpd) convertImage(image image.Image) (black []byte, red []byte) {\n\t// Resize image to width and height\n\t// Each pixel in image is turned into a bit\n\t// which says 1 or 0\n\t// Create two buffers of (w*h)/8 bytes\n\t// TODO: Allow for other colors. Switch to HSL mode and\n\t// calculate by hue\n\tw := display.Width()\n\th := display.Height()\n\ts := (w * h) / 8\n\tblackBuf := make([]byte, s)\n\tredBuf := make([]byte, s)\n\tfor y := 0; y < h; y++ {\n\t\tfor x := 0; x < w; x++ {\n\t\t\tpixelIdx := ((y * w) + x)\n\t\t\tbyteIdx := pixelIdx / 8\n\t\t\tbitIdx := uint(7 - pixelIdx%8)\n\t\t\tpix := image.At(x, y)\n\t\t\trgba := color.RGBAModel.Convert(pix).(color.RGBA)\n\t\t\tgray := color.GrayModel.Convert(pix).(color.Gray)\n\t\t\t// Flip all bits and mask with 0xFF. Divide by 0xFF to get 1 as last bit for black, 0 for anything else. Then XOR it.\n\t\t\t// black := (((^rgba.R ^ rgba.B ^ rgba.G) & 0xFF) / 0xFF) ^ 0x01 // Black is 1 (white) if not absolute black\n\t\t\t// red := ((rgba.R &^ rgba.B &^ rgba.G) / 0xFF) ^ 0x01 // Red is 1 if only full saturation red. Otherwise 0\n\t\t\tblack := byte(0x00)\n\t\t\tif gray.Y > 180 {\n\t\t\t\tblack = 0x01\n\t\t\t}\n\t\t\tred := byte(0x01)\n\t\t\tif rgba.B < 180 && rgba.G < 180 && rgba.R > 180 {\n\t\t\t\tred = 0x00\n\t\t\t}\n\t\t\tblackBuf[byteIdx] |= black << bitIdx\n\t\t\tredBuf[byteIdx] |= red << bitIdx\n\t\t}\n\t}\n\t// Dither and do another loop for black?\n\treturn blackBuf, redBuf\n}", "func GenerateColormap(colors []models.ColorModel) {\n\tlogger := log.ColoredLogger()\n\tdateStr := strings.ReplaceAll(time.Now().Format(time.UnixDate), \":\", \"-\")\n\tfilepath := fmt.Sprintf(\"lib/assets/images/colormap_%s.png\", dateStr)\n\t// alright, this is going to be a very long terminal command. Hopefully there aren't limits.\n\tqueryStr := fmt.Sprintf(\"convert -size %dx1 xc:white \", len(colors))\n\tfor i, c := range colors {\n\t\tqueryStr += fmt.Sprintf(\"-fill '%s' -draw 'point %d,0' \", c.Hex, i)\n\t}\n\tqueryStr += filepath\n\n\tcmd := exec.Command(queryStr)\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\tlogger.Error(\"error\", zap.Error(cmd.Run()))\n}", "func ImageToGraphPixels(colorMapped ColorMappedImage, args Args) Graph {\n\tbounds := colorMapped.image.Bounds()\n\tgraph := Graph{bounds: bounds}\n\tfor y := 0; y < bounds.Max.Y; y++ {\n\t\tfor x := 0; x < bounds.Max.X; x++ {\n\t\t\tgray := colorMapped.image.GrayAt(x, y)\n\t\t\tcommits := colorMapped.colorMap[int(gray.Y)]\n\t\t\tgraph.pixels = append(graph.pixels, GraphPixel{\n\t\t\t\tpixelDaysAgo(x, y, bounds.Max.X, args.weeksAgo), commits,\n\t\t\t})\n\t\t}\n\t}\n\treturn graph\n}", "func rgbaToPixel(r uint32, g uint32, b uint32, a uint32, row int, rowPos int) Pixel {\n\treturn Pixel{\n\t\trgba: Rgba{\n\t\t\tint(r / 257),\n\t\t\tint(g / 257),\n\t\t\tint(b / 257),\n\t\t\tint(a / 257),\n\t\t},\n\t\tRow: row,\n\t\tRowPos: rowPos,\n\t}\n}", "func drawBackground(image *image.RGBA, mem *GBMem) *image.RGBA {\n\tfor x := 0; x < MapWidth; x++ {\n\t\tfor y := 0; y < MapHeight; y++ {\n\t\t\t// get tile index\n\t\t\ttileIndex := mem.read(uint16(VRAMBackgroundMap + x + (y * MapHeight)))\n\n\t\t\t// get pixels corresponding to tile index\n\t\t\tpixels := tileToPixel(tileIndex, mem)\n\n\t\t\t// draw pixels\n\t\t\tdrawTilePixels(image, pixels, x, y)\n\t\t}\n\t}\n\treturn image\n}", "func ColorSamplingPointsForStillColorsVideo(videoW, videoH int) map[string]image.Point {\n\touterCorners := map[string]image.Point{\n\t\t\"outer_top_left\": {1, 1},\n\t\t\"outer_top_right\": {(videoW - 1) - 1, 1},\n\t\t\"outer_bottom_right\": {videoW - 1, videoH - 1},\n\t\t\"outer_bottom_left\": {1, (videoH - 1) - 1},\n\t}\n\tedgeOffset := 5\n\tstencilW := 5\n\tinnerCorners := map[string]image.Point{\n\t\t\"inner_top_left_00\": {edgeOffset, edgeOffset},\n\t\t\"inner_top_left_01\": {edgeOffset, edgeOffset + stencilW},\n\t\t\"inner_top_left_10\": {edgeOffset + stencilW, edgeOffset},\n\t\t\"inner_top_left_11\": {edgeOffset + stencilW, edgeOffset + stencilW},\n\t\t\"inner_top_right_00\": {(videoW - 1) - edgeOffset, edgeOffset},\n\t\t\"inner_top_right_01\": {(videoW - 1) - edgeOffset, edgeOffset + stencilW},\n\t\t\"inner_top_right_10\": {(videoW - 1) - edgeOffset - stencilW, edgeOffset},\n\t\t\"inner_top_right_11\": {(videoW - 1) - edgeOffset - stencilW, edgeOffset + stencilW},\n\t\t\"inner_bottom_right_00\": {(videoW - 1) - edgeOffset, (videoH - 1) - edgeOffset},\n\t\t\"inner_bottom_right_01\": {(videoW - 1) - edgeOffset, (videoH - 1) - edgeOffset - stencilW},\n\t\t\"inner_bottom_right_10\": {(videoW - 1) - edgeOffset - stencilW, (videoH - 1) - edgeOffset},\n\t\t\"inner_bottom_right_11\": {(videoW - 1) - edgeOffset - stencilW, (videoH - 1) - edgeOffset - stencilW},\n\t\t\"inner_bottom_left_00\": {edgeOffset, (videoH - 1) - edgeOffset},\n\t\t\"inner_bottom_left_01\": {edgeOffset, (videoH - 1) - edgeOffset - stencilW},\n\t\t\"inner_bottom_left_10\": {edgeOffset + stencilW, (videoH - 1) - edgeOffset},\n\t\t\"inner_bottom_left_11\": {edgeOffset + stencilW, (videoH - 1) - edgeOffset - stencilW},\n\t}\n\tsamples := map[string]image.Point{}\n\tfor k, v := range innerCorners {\n\t\tsamples[k] = v\n\t}\n\tfor k, v := range outerCorners {\n\t\tsamples[k] = v\n\t}\n\treturn samples\n}", "func paintFill(image [][]string, c string, y, x int) [][]string {\n\t//range check\n\tif y > len(image)-1 {\n\t\treturn image\n\t}\n\tif x > len(image[y])-1 {\n\t\treturn image\n\t}\n\t//dupe color check\n\tif image[y][x] == c {\n\t\treturn image\n\t}\n\t//identify origin color\n\torig := image[y][x]\n\t//color origin\n\tmImage := image\n\tmImage[y][x] = c\n\t//check for valid left\n\tif x > 0 && mImage[y][x-1] == orig {\n\t\tmImage = paintFill(mImage, c, y, x-1)\n\t}\n\t//check for valid right\n\tif x < len(mImage[y])-1 && mImage[y][x+1] == orig {\n\t\tmImage = paintFill(mImage, c, y, x+1)\n\t}\n\t//check for valid up\n\tif y > 0 && mImage[y-1][x] == orig {\n\t\tmImage = paintFill(mImage, c, y-1, x)\n\t}\n\t//check for valid down\n\tif y < len(mImage)-1 && mImage[y+1][x] == orig {\n\t\tmImage = paintFill(mImage, c, y+1, x)\n\t}\n\treturn mImage\n}", "func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n C.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func (a *PixelSubArray) set(x, y int) {\n\txByte := x/8 - a.xStartByte\n\txBit := uint(x % 8)\n\tyRow := y - a.yStart\n\n\tif yRow > len(a.bytes) {\n\t\tfmt.Println(\"Y OOB:\", len(a.bytes), yRow)\n\t}\n\n\tif xByte > len(a.bytes[0]) {\n\t\tfmt.Println(\"X OOB:\", len(a.bytes[0]), xByte)\n\t}\n\n\ta.bytes[yRow][xByte] |= (1 << xBit)\n}", "func makeTable(r, c int) Table {\n\t// Return value \"Table\" does not need to be a pointer, since it represents\n\t// a slice header that consists of len, cap, and a pointer to the actual\n\t// data. Remember the lecture on slices!\n\tt := make(Table, r, r) // set len and cap to # of rows\n\tfor i := 0; i < r; i++ {\n\t\t// Pre-allocate a row\n\t\tt[i].Hrate = make([]int, c, c) // set len and cap to # of cols\n\t}\n\treturn t\n}", "func (cs *colourSketch) CopySketch() *colourSketch {\n\tc := make([]rgba, len(cs.Colours))\n\tfor i := 0; i < len(c); i++ {\n\t\tc[i] = cs.Colours[i]\n\t}\n\treturn &colourSketch{\n\t\tColours: c,\n\t\tId: cs.Id,\n\t}\n}", "func loadImage(pattern int, data []uint8) {\n\tfor i := 0; i < rows; i++ {\n\t\tfor j := 0; j < cols; j++ {\n\t\t\tdata[(4*(i*cols+j))+0] = 0xff\n\t\t\tdata[(4*(i*cols+j))+1] = 0x00\n\t\t\tdata[(4*(i*cols+j))+2] = 0x00\n\t\t\tdata[(4*(i*cols+j))+3] = 0xff\n\t\t}\n\t}\n\tif pattern == 1 {\n\t\tvar border = cols / 4\n\t\tfor i := border; i < rows-border; i++ {\n\t\t\tfor j := border; j < cols-border; j++ {\n\t\t\t\tvalue := rand.Float64()\n\t\t\t\tif value > 0.7 {\n\t\t\t\t\tdata[(4*(i*cols+j))+2] = uint8(math.Round(255.0 * value))\n\t\t\t\t} else {\n\t\t\t\t\tdata[(4*(i*cols+j))+2] = 0xff\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tvar checker = 40\n\t\tfor i := 0; i < rows; i++ {\n\t\t\tfor j := 0; j < cols; j++ {\n\t\t\t\tif (((i/checker)%2) == 0 && ((j/checker)%2) == 0) ||\n\t\t\t\t\t(((i/checker)%2) == 1 && ((j/checker)%2) == 1) {\n\t\t\t\t\tvalue := rand.Float64()\n\t\t\t\t\tdata[(4*(i*cols+j))+2] = uint8(math.Round(255.0 * value))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "func CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) {\n\tgl.CopyTexImage2D(uint32(target), int32(level), uint32(internalformat), int32(x), int32(y), int32(width), int32(height), int32(border))\n}", "func TestWritePixel(t *testing.T) {\n\t// Given\n\tc := canvas.New(10, 20)\n\tred := color.New(1.0, 0.0, 0.0)\n\n\t// When\n\tc.SetPixel(2, 3, red)\n\n\t// Then\n\tassert.True(t, c.Pixel(2, 3).Equal(red))\n}", "func nextcolor(c color.RGBA) color.RGBA {\n\tswitch {\n\tcase c.R == 255 && c.G == 0 && c.B == 0:\n\t\tc.G += 5\n\tcase c.R == 255 && c.G != 255 && c.B == 0:\n\t\tc.G += 5\n\tcase c.G == 255 && c.R != 0:\n\t\tc.R -= 5\n\tcase c.R == 0 && c.B != 255:\n\t\tc.B += 5\n\tcase c.B == 255 && c.G != 0:\n\t\tc.G -= 5\n\tcase c.G == 0 && c.R != 255:\n\t\tc.R += 5\n\tdefault:\n\t\tc.B -= 5\n\t}\n\treturn c\n}", "func ColorPointer(size int32, xtype uint32, stride int32, pointer unsafe.Pointer) {\n\tC.glowColorPointer(gpColorPointer, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer)\n}", "func TestReadPixelsFromVolatileImage(t *testing.T) {\n\tconst w, h = 16, 16\n\tdst := restorable.NewImage(w, h, restorable.ImageTypeVolatile)\n\tsrc := restorable.NewImage(w, h, restorable.ImageTypeRegular)\n\n\t// First, make sure that dst has pixels\n\tdst.WritePixels(make([]byte, 4*w*h), image.Rect(0, 0, w, h))\n\n\t// Second, draw src to dst. If the implementation is correct, dst becomes stale.\n\tpix := make([]byte, 4*w*h)\n\tfor i := range pix {\n\t\tpix[i] = 0xff\n\t}\n\tsrc.WritePixels(pix, image.Rect(0, 0, w, h))\n\tvs := quadVertices(1, 1, 0, 0)\n\tis := graphics.QuadIndices()\n\tdr := graphicsdriver.Region{\n\t\tX: 0,\n\t\tY: 0,\n\t\tWidth: w,\n\t\tHeight: h,\n\t}\n\tdst.DrawTriangles([graphics.ShaderImageCount]*restorable.Image{src}, vs, is, graphicsdriver.BlendCopy, dr, [graphics.ShaderImageCount]graphicsdriver.Region{}, restorable.NearestFilterShader, nil, false)\n\n\t// Read the pixels. If the implementation is correct, dst tries to read its pixels from GPU due to being\n\t// stale.\n\twant := byte(0xff)\n\n\tvar result [4]byte\n\tif err := dst.ReadPixels(ui.GraphicsDriverForTesting(), result[:], image.Rect(0, 0, 1, 1)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgot := result[0]\n\tif got != want {\n\t\tt.Errorf(\"got: %v, want: %v\", got, want)\n\t}\n}", "func (self *TraitPixbuf) Copy() (return__ *Pixbuf) {\n\tvar __cgo__return__ *C.GdkPixbuf\n\t__cgo__return__ = C.gdk_pixbuf_copy(self.CPointer)\n\tif __cgo__return__ != nil {\n\t\treturn__ = NewPixbufFromCPointer(unsafe.Pointer(reflect.ValueOf(__cgo__return__).Pointer()))\n\t}\n\treturn\n}", "func (s *Surface) PixelData(area geo.Rect) []color.RGBA {\n\tx, y, w, h := math.Floor(area.X), math.Floor(area.Y), math.Floor(area.W), math.Floor(area.H)\n\timgData := s.Ctx.Call(\"getImageData\", x, y, w, h).Get(\"data\")\n\tdata := make([]color.RGBA, int(w*h))\n\tfor i := 0; i < len(data); i++ {\n\t\tdata[i] = color.RGBA{\n\t\t\tR: uint8(imgData.Index(i * 4).Int()),\n\t\t\tG: uint8(imgData.Index(i*4 + 1).Int()),\n\t\t\tB: uint8(imgData.Index(i*4 + 2).Int()),\n\t\t\tA: uint8(imgData.Index(i*4 + 3).Int()),\n\t\t}\n\t}\n\treturn data\n}", "func square(img *image.Paletted, p squareParams) {\n\tfor x := p.from.x; x < p.to.x; x++ {\n\t\tfor y := p.from.y; y < p.to.y; y++ {\n\t\t\timg.Set(x, y, p.c)\n\t\t}\n\t}\n}", "func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n C.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func MemCopy(dst unsafe.Pointer, src unsafe.Pointer, bytes int) {\n\tfor i := 0; i < bytes; i++ {\n\t\t*(*uint8)(MemAccess(dst, i)) = *(*uint8)(MemAccess(src, i))\n\t}\n}", "func generatePalette(c0, c1 float64) [8]float64 {\n\n\t//Get signed float normalized palette (0 to 1)\n\tpal := [8]float64{}\n\tpal[0], pal[1] = c0, c1\n\tif c0 > c1 {\n\t\tpal[2] = (6*c0 + 1*c1) / 7\n\t\tpal[3] = (5*c0 + 2*c1) / 7\n\t\tpal[4] = (4*c0 + 3*c1) / 7\n\t\tpal[5] = (3*c0 + 4*c1) / 7\n\t\tpal[6] = (2*c0 + 5*c1) / 7\n\t\tpal[7] = (1*c0 + 6*c1) / 7\n\t} else {\n\t\tpal[2] = (4*c0 + 1*c1) / 5\n\t\tpal[3] = (3*c0 + 2*c1) / 5\n\t\tpal[4] = (2*c0 + 3*c1) / 5\n\t\tpal[5] = (1*c0 + 4*c1) / 5\n\t\tpal[6] = 0\n\t\tpal[7] = 1\n\t}\n\treturn pal\n}", "func (t *Texture) GetPixels() []rgb565.Rgb565Color {\n\tnewArray := make([]rgb565.Rgb565Color, len(t.pixels))\n\tcopy(newArray, t.pixels)\n\treturn newArray\n}", "func tableSetUp(m, n int) *[][]int {\n\tresult := make([][]int, m)\n\tfor i := range result {\n\t\tresult[i] = make([]int, n)\n\t}\n\tfor c := range result[0] {\n\t\tresult[0][c] = c\n\t}\n\tfor r := 0; r < len(result); r++ {\n\t\tresult[r][0] = r\n\t}\n\n\treturn &result\n}", "func Pic(dx, dy int) [][]uint8 {\n\trow := make([]uint8, dx)\n\tcanvas := make([][]uint8, dy)\n\n\tfor i := range canvas {\n\t\tcanvas[i] = row\n\t}\n\n\tfor i := range canvas {\n\t\tfor j := range canvas[i] {\n\t\t\tcanvas[i][j] = uint8((i + j) / 2)\n\t\t\t// canvas[i][j] = uint8(i * j)\n\t\t\t// canvas[i][j] = uint8(math.Pow(float64(i), float64(j)))\n\t\t}\n\t}\n\treturn canvas\n}", "func DecodePixelsFromImage(img image.Image, offsetX, offsetY int) []*Pixel {\n var pixels []*Pixel\n\n for y := 0; y <= img.Bounds().Max.Y; y++ {\n for x := 0; x <= img.Bounds().Max.X; x++ {\n p := &Pixel{\n Point: image.Point{X: x + offsetX, Y: y + offsetY},\n Color: img.At(x, y),\n }\n pixels = append(pixels, p)\n }\n }\n\n return pixels\n}", "func Pic(dx, dy int) [][]uint8 {\n\tfmt.Println(dx, dy)\n\tyy := make([][]uint8, dy)\n\tfor i, _ := range yy {\n\t\txx := make([]uint8, dx)\n\t\tfor j, _ := range xx {\n\t\t\txx[j] = uint8(10)\n\t\t}\n\t\tyy[i] = append(yy[i], xx...)\n\t\t//fmt.Println(line)\n\t}\n\treturn yy\n}", "func applyConvolutionToPixel(im ImageMatrix, x int, y int, cmSize int, column []color.RGBA, cm ConvolutionMatrix, conFunc func(ImageMatrix, int, int, int, int, color.RGBA, float64) int) {\n\tcurrentColour := im[x][y]\n\tredTotal := 0\n\tgreenTotal := 0\n\tblueTotal := 0\n\tweight := 0\n\n\tkernelMatrix := im.GetKernelMatrix(x, y, cmSize)\n\n\tfor i, kernelColumn := range kernelMatrix {\n\t\tfor j, kernelPixelColour := range kernelColumn {\n\n\t\t\t// get the distance of the current pixel compared to the centre of the kernel\n\t\t\t// the centre one is the one we are modifying and saving to a new image/matrix of course...\n\t\t\tdistance := math.Sqrt(math.Pow(float64(cmSize-i), 2) + math.Pow(float64(cmSize-j), 2))\n\n\t\t\t// Call the function the user passed and get the return weight of how much influence\n\t\t\t// it should have over the centre pixel we want to change\n\t\t\t// We are multipling it by the weight in the convolution matrix as that way you can\n\t\t\t// control an aspect of the weight through the matrix as well (as well as the function that\n\t\t\t// we pass in of course :)\n\t\t\tcmValue := conFunc(im, x, y, i, j, kernelPixelColour, distance) * int(cm[i][j])\n\n\t\t\t// apply the influence / weight ... (eg. if cmValue was 0, then the current pixel would have\n\t\t\t// no influence over the pixel we are changing, if it was large in comparision to what we return\n\t\t\t// for the other kernel pixels, then it will have a large influence)\n\t\t\tredTotal += int(kernelPixelColour.R) * cmValue\n\t\t\tgreenTotal += int(kernelPixelColour.G) * cmValue\n\t\t\tblueTotal += int(kernelPixelColour.B) * cmValue\n\t\t\tweight += cmValue\n\t\t}\n\t}\n\n\t// If the convolution matrix normalised itself; aka, say it was something like:\n\t// { 0 -1 0}\n\t// {-1 4 -1}\n\t// { 0 -1 0}\n\t// then adding the entries (4 + (-1) + (-1) + (-1) + (-1)) results in a zero, in which case we leave\n\t// the weights alone (by setting the weight to divide by to 1) (aka, the weights do not have an impact,\n\t// but the pixels with a weight more more or less than 0 still do have an impact on the pixel\n\t// we are changing of course)\n\tif weight == 0 {\n\t\tweight = 1\n\t}\n\n\t// Normalise the values (based on the weight (total's in the matrix))\n\tnewRedValue := redTotal / weight\n\tnewGreenValue := greenTotal / weight\n\tnewBlueValue := blueTotal / weight\n\n\t// If the values are \"out of range\" (outside the colour range of 0-255) then set them to 0 (absence of that\n\t// colour) if they were negative or 255 (100% of that colour) if they were greater than the max allowed.\n\tif newRedValue < 0 {\n\t\tnewRedValue = 0\n\t} else if newRedValue > 255 {\n\t\tnewRedValue = 255\n\t}\n\n\tif newGreenValue < 0 {\n\t\tnewGreenValue = 0\n\t} else if newGreenValue > 255 {\n\t\tnewGreenValue = 255\n\t}\n\n\tif newBlueValue < 0 {\n\t\tnewBlueValue = 0\n\t} else if newBlueValue > 255 {\n\t\tnewBlueValue = 255\n\t}\n\n\t// Assign the new values to the pixel in the column 'column' at position y\n\tcolumn[y] = color.RGBA{uint8(newRedValue), uint8(newGreenValue), uint8(newBlueValue), currentColour.A}\n\t// fmt.Printf(\"[%v,%v] %v => %v\\n\", x, y, currentColour, column[y])\n}", "func Image(m *image.RGBA, key string, colors []color.RGBA) {\n\tsize := m.Bounds().Size()\n\tsquares := 6\n\tquad := size.X / squares\n\tmiddle := math.Ceil(float64(squares) / float64(2))\n\tcolorMap := make(map[int]color.RGBA)\n\tvar currentYQuadrand = 0\n\tfor y := 0; y < size.Y; y++ {\n\t\tyQuadrant := y / quad\n\t\tif yQuadrant != currentYQuadrand {\n\t\t\t// when y quadrant changes, clear map\n\t\t\tcolorMap = make(map[int]color.RGBA)\n\t\t\tcurrentYQuadrand = yQuadrant\n\t\t}\n\t\tfor x := 0; x < size.X; x++ {\n\t\t\txQuadrant := x / quad\n\t\t\tif _, ok := colorMap[xQuadrant]; !ok {\n\t\t\t\tif float64(xQuadrant) < middle {\n\t\t\t\t\tcolorMap[xQuadrant] = draw.PickColor(key, colors, xQuadrant+3*yQuadrant)\n\t\t\t\t} else if xQuadrant < squares {\n\t\t\t\t\tcolorMap[xQuadrant] = colorMap[squares-xQuadrant-1]\n\t\t\t\t} else {\n\t\t\t\t\tcolorMap[xQuadrant] = colorMap[0]\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.Set(x, y, colorMap[xQuadrant])\n\t\t}\n\t}\n}" ]
[ "0.7236274", "0.7012368", "0.680525", "0.627135", "0.6227392", "0.6080061", "0.60735536", "0.60356534", "0.5952416", "0.59139735", "0.5843787", "0.5701853", "0.5590321", "0.5556233", "0.54842144", "0.54842144", "0.54763526", "0.54234326", "0.54201484", "0.5406675", "0.53734493", "0.5333936", "0.53220487", "0.5252402", "0.5187752", "0.51608765", "0.51597816", "0.5157448", "0.5142194", "0.5134447", "0.51214284", "0.5097681", "0.509333", "0.509333", "0.5058054", "0.50357056", "0.50249606", "0.49674588", "0.49626556", "0.49576434", "0.49576434", "0.48932037", "0.48928496", "0.48771825", "0.4871633", "0.4862217", "0.48588812", "0.48477137", "0.48421603", "0.48309577", "0.4804104", "0.47956526", "0.4766196", "0.47598338", "0.47518393", "0.47426265", "0.47260967", "0.47258008", "0.47132674", "0.47030997", "0.47030997", "0.46983707", "0.46974888", "0.46929076", "0.4686118", "0.46752864", "0.4673603", "0.4665839", "0.46582022", "0.46338367", "0.46321288", "0.46293166", "0.46288276", "0.46271372", "0.4621921", "0.46216372", "0.46170396", "0.46159106", "0.4614012", "0.46126747", "0.46124282", "0.46078247", "0.46001825", "0.45964566", "0.45955122", "0.4592647", "0.4591248", "0.45897254", "0.45859054", "0.4584006", "0.45781636", "0.4577769", "0.45727938", "0.45723814", "0.4569663", "0.4568378", "0.45544836", "0.4552726", "0.45456916", "0.45436856" ]
0.70833987
1
copy pixels into a twodimensional convolution filter
скопировать пиксели в двумерный фильтр свертки
func CopyConvolutionFilter2D(target uint32, internalformat uint32, x int32, y int32, width int32, height int32) { C.glowCopyConvolutionFilter2D(gpCopyConvolutionFilter2D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CopyConvolutionFilter2D(target uint32, internalformat uint32, x int32, y int32, width int32, height int32) {\n C.glowCopyConvolutionFilter2D(gpCopyConvolutionFilter2D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyConvolutionFilter1D(target uint32, internalformat uint32, x int32, y int32, width int32) {\n C.glowCopyConvolutionFilter1D(gpCopyConvolutionFilter1D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func ConvolutionFilter2D(target uint32, internalformat uint32, width int32, height int32, format uint32, xtype uint32, image unsafe.Pointer) {\n C.glowConvolutionFilter2D(gpConvolutionFilter2D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), image)\n}", "func ConvolutionFilter2D(target uint32, internalformat uint32, width int32, height int32, format uint32, xtype uint32, image unsafe.Pointer) {\n\tC.glowConvolutionFilter2D(gpConvolutionFilter2D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), image)\n}", "func CopyConvolutionFilter1D(target uint32, internalformat uint32, x int32, y int32, width int32) {\n\tC.glowCopyConvolutionFilter1D(gpCopyConvolutionFilter1D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func Convolve(src, dst []float64, kernel []float64, border Border) {\n\twidth := len(kernel)\n\thalfWidth := width / 2\n\tfor i := range dst {\n\t\tk := i - halfWidth\n\t\tvar sum float64\n\t\tif k >= 0 && k <= len(src)-width {\n\t\t\tfor j, x := range kernel {\n\t\t\t\tsum += src[k+j] * x\n\t\t\t}\n\t\t} else {\n\t\t\tfor j, x := range kernel {\n\t\t\t\tsum += border.Interpolate(src, k+j) * x\n\t\t\t}\n\t\t}\n\t\tdst[i] = sum\n\t}\n}", "func (img *FloatImage) convolve(kernel *ConvKernel, px planeExtension) *FloatImage {\n\n\t// convolve each plane independently:\n\tres := new([3][]float32)\n\tfor i := 0; i < 3; i++ {\n\t\tconvolvePlane(&img.Ip[i], kernel, img.Width, img.Height, px)\n\t}\n\n\treturn &FloatImage{\n\t\tIp: *res,\n\t\tWidth: img.Width,\n\t\tHeight: img.Height,\n\t}\n}", "func ConstructedConv2D(m *Model, x tensor.Tensor, kernelH int, kernelW int, filters int) tensor.Tensor {\n\tslen := len(x.Shape())\n\tfAxis := slen - 1\n\twAxis := slen - 2\n\thAxis := slen - 3\n\tinFilters := x.Shape()[fAxis]\n\tinW := x.Shape()[wAxis]\n\tinH := x.Shape()[hAxis]\n\n\twShape := onesLike(x)\n\twShape[fAxis] = filters\n\twShape[wAxis] = inFilters * kernelH * kernelW\n\n\tbShape := onesLike(x)\n\tbShape[fAxis] = filters\n\n\tweight := m.AddWeight(wShape...)\n\tbias := m.AddBias(bShape...)\n\n\tslices := make([]tensor.Tensor, 0, kernelH*kernelW)\n\n\tfor hoff := 0; hoff < kernelH; hoff++ {\n\t\thslice := tensor.Slice(x, hAxis, hoff, inH-kernelH+1+hoff)\n\t\tfor woff := 0; woff < kernelW; woff++ {\n\t\t\twslice := tensor.Slice(hslice, wAxis, woff, inW-kernelW+1+woff)\n\t\t\tslices = append(slices, wslice)\n\t\t}\n\t}\n\n\tx = tensor.Concat(fAxis, slices...)\n\tx = tensor.MatMul(x, weight, wAxis, fAxis)\n\tx = tensor.Add(x, bias)\n\n\treturn x\n}", "func ConvolutionFilter1D(target uint32, internalformat uint32, width int32, format uint32, xtype uint32, image unsafe.Pointer) {\n C.glowConvolutionFilter1D(gpConvolutionFilter1D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), image)\n}", "func applyConvolutionToPixel(im ImageMatrix, x int, y int, cmSize int, column []color.RGBA, cm ConvolutionMatrix, conFunc func(ImageMatrix, int, int, int, int, color.RGBA, float64) int) {\n\tcurrentColour := im[x][y]\n\tredTotal := 0\n\tgreenTotal := 0\n\tblueTotal := 0\n\tweight := 0\n\n\tkernelMatrix := im.GetKernelMatrix(x, y, cmSize)\n\n\tfor i, kernelColumn := range kernelMatrix {\n\t\tfor j, kernelPixelColour := range kernelColumn {\n\n\t\t\t// get the distance of the current pixel compared to the centre of the kernel\n\t\t\t// the centre one is the one we are modifying and saving to a new image/matrix of course...\n\t\t\tdistance := math.Sqrt(math.Pow(float64(cmSize-i), 2) + math.Pow(float64(cmSize-j), 2))\n\n\t\t\t// Call the function the user passed and get the return weight of how much influence\n\t\t\t// it should have over the centre pixel we want to change\n\t\t\t// We are multipling it by the weight in the convolution matrix as that way you can\n\t\t\t// control an aspect of the weight through the matrix as well (as well as the function that\n\t\t\t// we pass in of course :)\n\t\t\tcmValue := conFunc(im, x, y, i, j, kernelPixelColour, distance) * int(cm[i][j])\n\n\t\t\t// apply the influence / weight ... (eg. if cmValue was 0, then the current pixel would have\n\t\t\t// no influence over the pixel we are changing, if it was large in comparision to what we return\n\t\t\t// for the other kernel pixels, then it will have a large influence)\n\t\t\tredTotal += int(kernelPixelColour.R) * cmValue\n\t\t\tgreenTotal += int(kernelPixelColour.G) * cmValue\n\t\t\tblueTotal += int(kernelPixelColour.B) * cmValue\n\t\t\tweight += cmValue\n\t\t}\n\t}\n\n\t// If the convolution matrix normalised itself; aka, say it was something like:\n\t// { 0 -1 0}\n\t// {-1 4 -1}\n\t// { 0 -1 0}\n\t// then adding the entries (4 + (-1) + (-1) + (-1) + (-1)) results in a zero, in which case we leave\n\t// the weights alone (by setting the weight to divide by to 1) (aka, the weights do not have an impact,\n\t// but the pixels with a weight more more or less than 0 still do have an impact on the pixel\n\t// we are changing of course)\n\tif weight == 0 {\n\t\tweight = 1\n\t}\n\n\t// Normalise the values (based on the weight (total's in the matrix))\n\tnewRedValue := redTotal / weight\n\tnewGreenValue := greenTotal / weight\n\tnewBlueValue := blueTotal / weight\n\n\t// If the values are \"out of range\" (outside the colour range of 0-255) then set them to 0 (absence of that\n\t// colour) if they were negative or 255 (100% of that colour) if they were greater than the max allowed.\n\tif newRedValue < 0 {\n\t\tnewRedValue = 0\n\t} else if newRedValue > 255 {\n\t\tnewRedValue = 255\n\t}\n\n\tif newGreenValue < 0 {\n\t\tnewGreenValue = 0\n\t} else if newGreenValue > 255 {\n\t\tnewGreenValue = 255\n\t}\n\n\tif newBlueValue < 0 {\n\t\tnewBlueValue = 0\n\t} else if newBlueValue > 255 {\n\t\tnewBlueValue = 255\n\t}\n\n\t// Assign the new values to the pixel in the column 'column' at position y\n\tcolumn[y] = color.RGBA{uint8(newRedValue), uint8(newGreenValue), uint8(newBlueValue), currentColour.A}\n\t// fmt.Printf(\"[%v,%v] %v => %v\\n\", x, y, currentColour, column[y])\n}", "func GetConvolutionFilter(target uint32, format uint32, xtype uint32, image unsafe.Pointer) {\n C.glowGetConvolutionFilter(gpGetConvolutionFilter, (C.GLenum)(target), (C.GLenum)(format), (C.GLenum)(xtype), image)\n}", "func (t1 *Tensor) Convolve2D(kernel *Tensor, stride int) (*Tensor, error) {\n\toutTensor := NewTensor((t1.Size.X-kernel.Size.X)/stride+1, (t1.Size.Y-kernel.Size.Y)/stride+1, t1.Size.Z)\n\tfor x := 0; x < outTensor.Size.X; x++ {\n\t\tfor y := 0; y < outTensor.Size.Y; y++ {\n\t\t\tmappedX, mappedY := x*stride, y*stride\n\t\t\tfor i := 0; i < kernel.Size.X; i++ {\n\t\t\t\tfor j := 0; j < kernel.Size.X; j++ {\n\t\t\t\t\tfor z := 0; z < t1.Size.Z; z++ {\n\t\t\t\t\t\tf := kernel.Get(i, j, z)\n\t\t\t\t\t\tv := t1.Get(mappedX+i, mappedY+j, z)\n\t\t\t\t\t\toutTensor.SetAdd(x, y, z, f*v)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn outTensor, nil\n}", "func ConvolutionFilter1D(target uint32, internalformat uint32, width int32, format uint32, xtype uint32, image unsafe.Pointer) {\n\tC.glowConvolutionFilter1D(gpConvolutionFilter1D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), image)\n}", "func (fir *FIR) Convolve(input []float64) ([]float64, error) {\n\tkernelSize := len(fir.kernel)\n\tn := len(input)\n\n\tif n <= kernelSize {\n\t\terr := fmt.Errorf(\"input size %d is not greater than kernel size %d\", n, kernelSize)\n\t\treturn []float64{}, err\n\t}\n\n\toutput := make([]float64, n)\n\n\t//\n\tfor i := 0; i < kernelSize; i++ {\n\t\tsum := 0.0\n\n\t\t// convolve the input with the filter kernel\n\t\tfor j := 0; j < i; j++ {\n\t\t\tsum += (input[j] * fir.kernel[kernelSize-(1+i-j)])\n\t\t}\n\n\t\toutput[i] = sum\n\t}\n\n\tfor i := kernelSize; i < n; i++ {\n\t\tsum := 0.0\n\n\t\t// convolve the input with the filter kernel\n\t\tfor j := 0; j < kernelSize; j++ {\n\t\t\tsum += (input[i-j] * fir.kernel[j])\n\t\t}\n\n\t\toutput[i] = sum\n\t}\n\n\treturn output, nil\n}", "func Copy(i ImageIr) ImageIr {\n\tc := make([][][]uint32, len(i.pixels))\n\tcopy(c, i.pixels)\n\treturn ImageIr{i.width, i.height, c}\n}", "func createFilter(img image.Image, factor [2]float32, size int, kernel func(float32) float32) (f Filter) {\n\tsizeX := size * (int(math.Ceil(float64(factor[0]))))\n\tsizeY := size * (int(math.Ceil(float64(factor[1]))))\n\n\tswitch img.(type) {\n\tdefault:\n\t\tf = &filterModel{\n\t\t\t&genericConverter{img},\n\t\t\tfactor, kernel,\n\t\t\tmake([]colorArray, sizeX), make([]colorArray, sizeY),\n\t\t}\n\tcase *image.RGBA:\n\t\tf = &filterModel{\n\t\t\t&rgbaConverter{img.(*image.RGBA)},\n\t\t\tfactor, kernel,\n\t\t\tmake([]colorArray, sizeX), make([]colorArray, sizeY),\n\t\t}\n\tcase *image.RGBA64:\n\t\tf = &filterModel{\n\t\t\t&rgba64Converter{img.(*image.RGBA64)},\n\t\t\tfactor, kernel,\n\t\t\tmake([]colorArray, sizeX), make([]colorArray, sizeY),\n\t\t}\n\tcase *image.Gray:\n\t\tf = &filterModel{\n\t\t\t&grayConverter{img.(*image.Gray)},\n\t\t\tfactor, kernel,\n\t\t\tmake([]colorArray, sizeX), make([]colorArray, sizeY),\n\t\t}\n\tcase *image.Gray16:\n\t\tf = &filterModel{\n\t\t\t&gray16Converter{img.(*image.Gray16)},\n\t\t\tfactor, kernel,\n\t\t\tmake([]colorArray, sizeX), make([]colorArray, sizeY),\n\t\t}\n\tcase *image.YCbCr:\n\t\tf = &filterModel{\n\t\t\t&ycbcrConverter{img.(*image.YCbCr)},\n\t\t\tfactor, kernel,\n\t\t\tmake([]colorArray, sizeX), make([]colorArray, sizeY),\n\t\t}\n\t}\n\treturn\n}", "func clone(dst, src *image.Gray) {\n\tif dst.Stride == src.Stride {\n\t\t// no need to correct stride, simply copy pixels.\n\t\tcopy(dst.Pix, src.Pix)\n\t\treturn\n\t}\n\t// need to correct stride.\n\tfor i := 0; i < src.Rect.Dy(); i++ {\n\t\tdstH := i * dst.Stride\n\t\tsrcH := i * src.Stride\n\t\tcopy(dst.Pix[dstH:dstH+dst.Stride], src.Pix[srcH:srcH+dst.Stride])\n\t}\n}", "func (l *Conv2D) Forward(inputTensor tensor.Tensor) tensor.Tensor {\n\tl.inputSizeMustMatch(inputTensor)\n\n\tsave := inputTensor.(*Tensor)\n\tl.saveInput(save)\n\n\tbatchSize := l.inputBatchSize(inputTensor)\n\n\tinput := save\n\toutputSize := []int{\n\t\tl.outputSize[0],\n\t\tbatchSize,\n\t\tl.outputSize[1],\n\t\tl.outputSize[2],\n\t}\n\n\toutputHeight := outputSize[2]\n\toutputWidth := outputSize[3]\n\n\tim2ColMatrixHeight := l.numChannels() * l.kernelWidth() * l.kernelHeight()\n\tim2ColMatrixWidth := outputWidth * outputHeight * batchSize\n\tim2ColMatrix := l.TensorOperator.CreateTensor(\n\t\t[]int{im2ColMatrixHeight, im2ColMatrixWidth})\n\tdefer l.TensorOperator.Free(im2ColMatrix)\n\n\tl.im2Col(input, im2ColMatrix,\n\t\t[2]int{l.kernelWidth(), l.kernelHeight()},\n\t\t[4]int{l.padding[0], l.padding[1], l.padding[2], l.padding[3]},\n\t\t[2]int{l.stride[0], l.stride[1]},\n\t\t[2]int{0, 0},\n\t)\n\n\tkernelMatrixWidth := l.kernelWidth() * l.kernelHeight() * l.numChannels()\n\tkernelMatrixHeight := l.numKernels()\n\tkernelMatrix := l.kernel.Reshape(\n\t\t[]int{kernelMatrixHeight, kernelMatrixWidth})\n\n\thKernelData := make([]float32, kernelMatrixWidth*kernelMatrixHeight)\n\tl.GPUDriver.MemCopyD2H(l.GPUCtx, hKernelData, kernelMatrix.ptr)\n\n\toutputMatrix := l.TensorOperator.CreateTensor(\n\t\t[]int{kernelMatrixHeight, im2ColMatrixWidth})\n\tbiasTensor := l.TensorOperator.CreateTensor(\n\t\t[]int{batchSize, l.outputSize[0], l.outputSize[1], l.outputSize[2]})\n\tbiasTensorTrans := l.TensorOperator.CreateTensor(\n\t\t[]int{l.outputSize[0], batchSize, l.outputSize[1], l.outputSize[2]})\n\tl.TensorOperator.Repeat(l.bias, biasTensor, batchSize)\n\tl.TensorOperator.TransposeTensor(biasTensor, biasTensorTrans,\n\t\t[]int{1, 0, 2, 3})\n\tbiasMatrix := biasTensorTrans.Reshape(\n\t\t[]int{l.numKernels(), im2ColMatrixWidth})\n\n\tl.TensorOperator.Gemm(\n\t\tfalse, false,\n\t\tkernelMatrixHeight,\n\t\tim2ColMatrixWidth,\n\t\tkernelMatrixWidth,\n\t\t1.0, 1.0,\n\t\tkernelMatrix, im2ColMatrix, biasMatrix, outputMatrix)\n\n\toutput := &Tensor{\n\t\tdriver: l.GPUDriver,\n\t\tctx: l.GPUCtx,\n\t\tsize: outputSize,\n\t\tptr: outputMatrix.ptr,\n\t\tdescriptor: \"CNHW\",\n\t}\n\n\ttransposedOutput := l.TensorOperator.CreateTensor([]int{\n\t\tbatchSize,\n\t\tl.outputSize[0],\n\t\tl.outputSize[1],\n\t\tl.outputSize[2]})\n\tl.TensorOperator.TransposeTensor(\n\t\toutput, transposedOutput, []int{1, 0, 2, 3})\n\n\tl.TensorOperator.Free(biasTensor)\n\tl.TensorOperator.Free(biasTensorTrans)\n\tl.TensorOperator.Free(output)\n\n\treturn transposedOutput\n}", "func BoxFilter(src, dst []float64, width int, border Border) {\n\t// TODO optimize\n\talpha := 1.0 / float64(width)\n\tkernel := make([]float64, width)\n\tfor i := range kernel {\n\t\tkernel[i] = alpha\n\t}\n\tConvolve(src, dst, kernel, border)\n}", "func (img *FloatImage) convolveWith(kernel *ConvKernel, px planeExtension) {\n\n\t// convolve each plane independently:\n\tfor i := 0; i < 3; i++ {\n\t\timg.Ip[i] = *convolvePlane(&img.Ip[i], kernel, img.Width, img.Height, px)\n\t}\n}", "func ConvDiff(geom *Geom, fltOn, fltOff *etensor.Float32, imgOn, imgOff, out *etensor.Float32, gain, gainOn float32) {\n\tfy := fltOn.Dim(0)\n\tfx := fltOn.Dim(1)\n\n\tgeom.FiltSz = image.Point{fx, fy}\n\tgeom.UpdtFilt()\n\n\timgSz := image.Point{imgOn.Dim(1), imgOn.Dim(0)}\n\tgeom.SetSize(imgSz)\n\toshp := []int{2, int(geom.Out.Y), int(geom.Out.X)}\n\tif !etensor.EqualInts(oshp, out.Shp) {\n\t\tout.SetShape(oshp, nil, []string{\"OnOff\", \"Y\", \"X\"})\n\t}\n\tncpu := nproc.NumCPU()\n\tnthrs, nper, rmdr := nproc.ThreadNs(ncpu, geom.Out.Y)\n\tvar wg sync.WaitGroup\n\tfor th := 0; th < nthrs; th++ {\n\t\twg.Add(1)\n\t\tyst := th * nper\n\t\tgo convDiffThr(&wg, geom, yst, nper, fltOn, fltOff, imgOn, imgOff, out, gain, gainOn)\n\t}\n\tif rmdr > 0 {\n\t\twg.Add(1)\n\t\tyst := nthrs * nper\n\t\tgo convDiffThr(&wg, geom, yst, rmdr, fltOn, fltOff, imgOn, imgOff, out, gain, gainOn)\n\t}\n\twg.Wait()\n}", "func convolvePlane(planePtr *[]float32, kernel *ConvKernel, width, height int, toPlaneCoords planeExtension) *[]float32 {\n\n\tplane := *planePtr\n\tradius := kernel.Radius\n\tdiameter := radius*2 + 1\n\tres := make([]float32, width*height)\n\n\t// for each pixel of the intensity plane:\n\tfor y := 0; y < height; y++ {\n\t\tfor x := 0; x < width; x++ {\n\t\t\tindex := y*width + x\n\n\t\t\t// compute convolved value of the pixel:\n\t\t\tresV := float32(0)\n\t\t\tfor yk := 0; yk < diameter; yk++ {\n\t\t\t\typ := toPlaneCoords(y+yk-radius, height)\n\t\t\t\tfor xk := 0; xk < diameter; xk++ {\n\t\t\t\t\txp := toPlaneCoords(x+xk-radius, width)\n\t\t\t\t\tplaneIndex := yp*width + xp\n\t\t\t\t\tkernelIndex := yk*diameter + xk\n\t\t\t\t\tresV += (plane[planeIndex] * kernel.Kernel[kernelIndex])\n\t\t\t\t}\n\t\t\t}\n\t\t\tres[index] = resV\n\t\t}\n\t}\n\n\treturn &res\n}", "func (img *ImageTask) ApplyConvulusion(neighbors *Neighbors, kernel [9]float64) *Colors{\n\n\tvar blue float64\n\tvar green float64\n\tvar red float64\n\tfor r := 0; r < 9; r++ {\n\t\tred = red + (neighbors.inputs[r].Red * kernel[r])\n\t\tgreen = green + (neighbors.inputs[r].Green * kernel[r])\n\t\tblue = blue + (neighbors.inputs[r].Blue * kernel[r])\n\t}\n\n\treturned := Colors{Red: red, Green: green, Blue: blue, Alpha: neighbors.inputs[4].Alpha}\n\treturn &returned\n}", "func GetConvolutionFilter(target uint32, format uint32, xtype uint32, image unsafe.Pointer) {\n\tC.glowGetConvolutionFilter(gpGetConvolutionFilter, (C.GLenum)(target), (C.GLenum)(format), (C.GLenum)(xtype), image)\n}", "func (r *Ri) PixelFilter(filterfunc RtFilterFunc, xwidth, ywidth RtFloat) error {\n\treturn r.writef(\"PixelFilter\", filterfunc, xwidth, ywidth)\n}", "func SeparableFilter2D(target uint32, internalformat uint32, width int32, height int32, format uint32, xtype uint32, row unsafe.Pointer, column unsafe.Pointer) {\n C.glowSeparableFilter2D(gpSeparableFilter2D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), row, column)\n}", "func convDiffThr(wg *sync.WaitGroup, geom *Geom, yst, ny int, fltOn, fltOff *etensor.Float32, imgOn, imgOff, out *etensor.Float32, gain, gainOn float32) {\n\tist := geom.Border.Sub(geom.FiltLt)\n\tfor yi := 0; yi < ny; yi++ {\n\t\ty := yst + yi\n\t\tiy := int(ist.Y + y*geom.Spacing.Y)\n\t\tfor x := 0; x < geom.Out.X; x++ {\n\t\t\tix := ist.X + x*geom.Spacing.X\n\t\t\tvar sumOn, sumOff float32\n\t\t\tfi := 0\n\t\t\tfor fy := 0; fy < geom.FiltSz.Y; fy++ {\n\t\t\t\tfor fx := 0; fx < geom.FiltSz.X; fx++ {\n\t\t\t\t\tidx := imgOn.Offset([]int{iy + fy, ix + fx})\n\t\t\t\t\tsumOn += imgOn.Values[idx] * fltOn.Values[fi]\n\t\t\t\t\tsumOff += imgOff.Values[idx] * fltOff.Values[fi]\n\t\t\t\t\tfi++\n\t\t\t\t}\n\t\t\t}\n\t\t\tdiff := gain * (gainOn*sumOn - sumOff)\n\t\t\tif diff > 0 {\n\t\t\t\tout.Set([]int{0, y, x}, diff)\n\t\t\t\tout.Set([]int{1, y, x}, float32(0))\n\t\t\t} else {\n\t\t\t\tout.Set([]int{0, y, x}, float32(0))\n\t\t\t\tout.Set([]int{1, y, x}, -diff)\n\t\t\t}\n\t\t}\n\t}\n\twg.Done()\n}", "func ConcurrentEdgeFilter(imgSrc image.Image) image.Image {\n\tngo:=runtime.NumCPU()\n\tout := make(chan portion)\n\tslices := imagetools.CropChevauchement(imgSrc, ngo, 10) //on laisse 5 pixels de chevauchement\n\n\tfor i := 0; i < ngo; i++ {\n\t\tgo edgWorker(i, out, slices[i][0])\n\t}\n\n\tfor i := 0; i < ngo; i++ {\n\t\tslice := <-out\n\t\tslices[slice.id][0] = slice.img\n\t}\n\n\timgEnd := imagetools.RebuildChevauchement(slices, 10)\n\n\treturn imgEnd\n\n}", "func Conv2D(t Tensor, k Tensor, hAxis int, wAxis int, fAxis int) Tensor {\n\tkh, kw := k.Shape()[0], k.Shape()[1]\n\treturn &Conv2DTensor{\n\t\tbaseTensor: base(conv2d(t, k, hAxis, wAxis, fAxis), 1, t, k),\n\t\tt: t,\n\t\tk: k,\n\t\thAxis: hAxis,\n\t\twAxis: wAxis,\n\t\tfAxis: fAxis,\n\t\tpadH: kh - 1,\n\t\tpadW: kw - 1,\n\t}\n}", "func MakePixelMixingFilter() *Filter {\n\tf := new(Filter)\n\tf.F = func(x float64, scaleFactor float64) float64 {\n\t\tvar p float64\n\t\tif scaleFactor < 1.0 {\n\t\t\tp = scaleFactor\n\t\t} else {\n\t\t\tp = 1.0 / scaleFactor\n\t\t}\n\t\tif x < 0.5-p/2.0 {\n\t\t\treturn 1.0\n\t\t} else if x < 0.5+p/2.0 {\n\t\t\treturn 0.5 - (x-0.5)/p\n\t\t}\n\t\treturn 0.0\n\t}\n\tf.Radius = func(scaleFactor float64) float64 {\n\t\tif scaleFactor < 1.0 {\n\t\t\treturn 0.5 + scaleFactor\n\t\t}\n\t\treturn 0.5 + 1.0/scaleFactor\n\t}\n\treturn f\n}", "func Copy(dst draw.Image, src image.Image) {\n\tbd := src.Bounds().Intersect(dst.Bounds())\n\tat := imageutil.NewAtFunc(src)\n\tset := imageutil.NewSetFunc(dst)\n\timageutil.Parallel1D(bd, func(bd image.Rectangle) {\n\t\tfor y := bd.Min.Y; y < bd.Max.Y; y++ {\n\t\t\tfor x := bd.Min.X; x < bd.Max.X; x++ {\n\t\t\t\tr, g, b, a := at(x, y)\n\t\t\t\tset(x, y, r, g, b, a)\n\t\t\t}\n\t\t}\n\t})\n}", "func sm2P256CopyConditional(out, in *sm2P256FieldElement, mask uint32) {\n\tfor i := 0; i < 9; i++ {\n\t\ttmp := mask & (in[i] ^ out[i])\n\t\tout[i] ^= tmp\n\t}\n}", "func Contrast(percentage float32) Filter {\n\tif percentage == 0 {\n\t\treturn &copyimageFilter{}\n\t}\n\n\tp := 1 + minf32(maxf32(percentage, -100), 100)/100\n\n\treturn &colorchanFilter{\n\t\tfn: func(x float32) float32 {\n\t\t\tif 0 <= p && p <= 1 {\n\t\t\t\treturn 0.5 + (x-0.5)*p\n\t\t\t} else if 1 < p && p < 2 {\n\t\t\t\treturn 0.5 + (x-0.5)*(1/(2.0-p))\n\t\t\t} else {\n\t\t\t\tif x < 0.5 {\n\t\t\t\t\treturn 0\n\t\t\t\t}\n\t\t\t\treturn 1\n\t\t\t}\n\t\t},\n\t\tlut: false,\n\t}\n}", "func GaussianFilter(src, dst []float64, width int, sigma float64, border Border) {\n\tif width <= 0 {\n\t\twidth = 1 + 2*int(math.Floor(sigma*4+0.5))\n\t}\n\tkernel := make([]float64, width)\n\tGaussianKernel(kernel, sigma)\n\tConvolve(src, dst, kernel, border)\n}", "func SeparableFilter2D(target uint32, internalformat uint32, width int32, height int32, format uint32, xtype uint32, row unsafe.Pointer, column unsafe.Pointer) {\n\tC.glowSeparableFilter2D(gpSeparableFilter2D, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), row, column)\n}", "func CopyPixels(x int32, y int32, width int32, height int32, xtype uint32) {\n C.glowCopyPixels(gpCopyPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(xtype))\n}", "func worker(threads int, doneWorker chan<- bool, imageTasks <-chan *imagetask.ImageTask, imageResults chan<- *imagetask.ImageTask) {\n\n\t// Initial placing image chunks in to a channel for filter to consume.\n\tchunkStreamGenerator := func(done <- chan interface{}, imageChunks []*imagetask.ImageTask) chan *imagetask.ImageTask {\n\t\tchunkStream := make(chan *imagetask.ImageTask)\n\t\tgo func() {\n\t\t\tdefer close(chunkStream)\n\t\t\tfor _, chunk := range imageChunks {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\t\treturn\n\t\t\t\tcase chunkStream <- chunk:\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t\treturn chunkStream\n\t}\n\n\t// Filter applies a filter in a pipeline fashion. \n\t// A goroutine is spawned for each chunk that needs to be filtered (which is numOfThreads chunks for each filter effect)\n\tfilter := func(threads int, effect string, effectNum int, done <- chan interface{}, chunkStream chan *imagetask.ImageTask) chan *imagetask.ImageTask {\n\t\tfilterStream := make(chan *imagetask.ImageTask, threads) // Only numOfThreads image chunks should be in the local filter channel.\n\t\tdonefilterChunk := make(chan bool)\n\t\tfor chunk := range chunkStream { // For each image chunk ...\n\t\t\tif effectNum > 0 {\n\t\t\t\tchunk.Img.UpdateInImg() // Replace inImg with outImg if not the first effect to compund effects.\n\t\t\t}\t\n\t\t\tgo func(chunk *imagetask.ImageTask) { // Spawn a goroutine for each chunk, which is equal to the numOfThreads. Each goroutine works on a portion of the image.\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\t\tdonefilterChunk <- true\n\t\t\t\t\treturn\n\t\t\t\tcase filterStream <- chunk:\n\t\t\t\t\tif effect != \"G\" {\n\t\t\t\t\t\tchunk.Img.ApplyConvolution(effect) // Can wait to apply effect until after chunk is in the channel because has to wait for all goroutines to finish before it can move on to the next filter for a given image.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchunk.Img.Grayscale()\n\t\t\t\t\t}\n\t\t\t\t\tdonefilterChunk <- true // Indicate that the filtering is done for the given chunk.\n\t\t\t\t}\n\t\t\t}(chunk)\n\t\t}\n\t\tfor i := 0; i < threads; i ++ { // Wait for all portions to be put through one filter because of image dependencies with convolution.\n\t\t\t<-donefilterChunk\n\t\t}\n\t\treturn filterStream\n\t}\n\n\t// While there are more image tasks to grab ...\n\tfor true {\n\t\t// Grab image task from image task channel.\t\n\t\timgTask, more := <-imageTasks\n\n\t\t// If you get an image task, split up the image in to even chunks by y-pixels.\n\t\tif more {\n\t\t\timageChunks := imgTask.SplitImage(threads)\n\t\t\t\n\t\t\t// Iterate through filters on image chunks.\n\t\t\t// Will spawn a goroutine for each chunk in each filter (n goroutines per filter)\n\t\t\tdone := make(chan interface{})\n\t\t\tdefer close(done)\n\t\t\tchunkStream := chunkStreamGenerator(done, imageChunks)\n\t\t\tfor i := 0; i < len(imgTask.Effects); i++ {\n\t\t\t\teffect := imgTask.Effects[i]\n\t\t\t\tchunkStream = filter(threads, effect, i, done, chunkStream)\n\t\t\t\tclose(chunkStream)\n\t\t\t}\n\n\t\t\t// Put the image back together.\n\t\t\treconstructedImage, _ := imgTask.Img.NewImage()\n\t\t\tfor imgChunk := range chunkStream {\n\t\t\t\treconstructedImage.ReAddChunk(imgChunk.Img, imgChunk.YPixelStart, imgChunk.ChunkPart)\n\t\t\t}\n\t\t\timgTask.Img = reconstructedImage\n\t\t\timageResults <- imgTask // Send image to results channel to be saved.\n\n\t\t} else { // Otherwise, if there are no more image tasks, then goroutine worker exits.\n\t\t\tdoneWorker <- true // Indicate that the worker is done.\n\t\t\treturn\n\t\t}\n\t}\n}", "func CopyPixels(x int32, y int32, width int32, height int32, xtype uint32) {\n\tC.glowCopyPixels(gpCopyPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(xtype))\n}", "func MakeConvolutionCoder(r, k int, poly []uint16) *ConvolutionCoder {\n\tif len(poly) != r {\n\t\tpanic(\"The number of polys should match the rate\")\n\t}\n\n\treturn &ConvolutionCoder{\n\t\tr: r,\n\t\tk: k,\n\t\tpoly: poly,\n\t\tcc: correctwrap.Correct_convolutional_create(int64(r), int64(k), &poly[0]),\n\t}\n}", "func (img *FloatImage) ConvolveWrap(kernel *ConvKernel) *FloatImage {\n\treturn img.convolve(kernel, wrapPlaneExtension)\n}", "func SpectralConvolution(spectrum []int) []int {\n\tvar convolution []int\n\tfor i := 0; i < len(spectrum)-1; i++ {\n\t\tfor j := i + 1; j < len(spectrum); j++ {\n\t\t\tval := spectrum[j] - spectrum[i]\n\t\t\tif val > 0 {\n\t\t\t\tconvolution = append(convolution, val)\n\t\t\t}\n\t\t}\n\t}\n\treturn convolution\n}", "func blendPixelOverPixel(ic_old,ic_new uint8, al_new float64)(c_res uint8) {\n\n\tal_old := float64(1); _=al_old\n\tc_old := float64(ic_old)\n\tc_new := float64(ic_new)\n\n\talgo1 := c_old*(1-al_new) + c_new*al_new\n\tc_res = uint8( util.Min( util.Round(algo1),255) )\n\t//log.Printf(\"\\t\\t %3.1f + %3.1f = %3.1f\", c_old*(1-al_new),c_new*al_new, algo1)\n\n\treturn \n}", "func CopyPixels(x int32, y int32, width int32, height int32, xtype uint32) {\n\tsyscall.Syscall6(gpCopyPixels, 5, uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(xtype), 0)\n}", "func (c *Canvas) pixelate(data []uint8, rect image.Rectangle, noiseLevel int) []uint8 {\n\t// Converts the array buffer to an image\n\timg := pixels.PixToImage(data, rect)\n\n\t// Quantize the substracted image in order to reduce the number of colors.\n\t// This will create a new pixelated subtype image.\n\tcell := quant.Draw(img, c.numOfColors, c.cellSize, noiseLevel)\n\n\tdst := image.NewNRGBA(cell.Bounds())\n\tdraw.Draw(dst, cell.Bounds(), cell, image.Point{}, draw.Over)\n\n\treturn pixels.ImgToPix(dst)\n}", "func convolutionMatrixSampleFunction(im ImageMatrix, imagePositionX int, imagePositionY int, kernelPixelX int, kernelPixel int, colour color.RGBA, distance float64) int {\n\tif distance < 1 {\n\t\treturn 1\n\t}\n\n\tif colour.R > 150 && colour.G < 100 && colour.B < 100 {\n\t\treturn int(5 * distance)\n\t}\n\n\treturn 5\n}", "func PMOVZXBW(mx, x operand.Op) { ctx.PMOVZXBW(mx, x) }", "func filter(src <-chan int, dst chan<- int, prime int) {\n\tfor i := range src { // Loop over values received from 'src'.\n\t\tif i%prime != 0 {\n\t\t\tdst <- i // Send 'i' to channel 'dst'.\n\t\t}\n\t}\n}", "func (fr *Frame) Copy(orig *Frame) {\n\tfr.Status = orig.Status\n\tfor y, row := range orig.Pix {\n\t\tcopy(fr.Pix[y][:], row)\n\t}\n}", "func VPMOVZXBW(ops ...operand.Op) { ctx.VPMOVZXBW(ops...) }", "func StepConvolution() *Step {\n\t// TODO\n\treturn nil\n}", "func ExampleConv2() {\n\n\tconv := cnns.NewConvLayer(&tensor.TDsize{X: 5, Y: 5, Z: 3}, 1, 3, 2)\n\trelu := cnns.NewReLULayer(conv.GetOutputSize())\n\tmaxpool := cnns.NewPoolingLayer(relu.GetOutputSize(), 2, 2, \"max\", \"valid\")\n\tfullyconnected := cnns.NewFullyConnectedLayer(maxpool.GetOutputSize(), 2)\n\n\tnet := cnns.WholeNet{\n\t\tLP: cnns.NewLearningParametersDefault(),\n\t}\n\tnet.Layers = append(net.Layers, conv)\n\tnet.Layers = append(net.Layers, relu)\n\tnet.Layers = append(net.Layers, maxpool)\n\tnet.Layers = append(net.Layers, fullyconnected)\n\n\tredChannel := mat.NewDense(5, 5, []float64{\n\t\t1, 0, 1, 0, 2,\n\t\t1, 1, 3, 2, 1,\n\t\t1, 1, 0, 1, 1,\n\t\t2, 3, 2, 1, 3,\n\t\t0, 2, 0, 1, 0,\n\t})\n\tgreenChannel := mat.NewDense(5, 5, []float64{\n\t\t1, 0, 0, 1, 0,\n\t\t2, 0, 1, 2, 0,\n\t\t3, 1, 1, 3, 0,\n\t\t0, 3, 0, 3, 2,\n\t\t1, 0, 3, 2, 1,\n\t})\n\tblueChannel := mat.NewDense(5, 5, []float64{\n\t\t2, 0, 1, 2, 1,\n\t\t3, 3, 1, 3, 2,\n\t\t2, 1, 1, 1, 0,\n\t\t3, 1, 3, 2, 0,\n\t\t1, 1, 2, 1, 1,\n\t})\n\n\tkernel1R := mat.NewDense(3, 3, []float64{\n\t\t0, 1, 0,\n\t\t0, 0, 2,\n\t\t0, 1, 0,\n\t})\n\tkernel1G := mat.NewDense(3, 3, []float64{\n\t\t2, 1, 0,\n\t\t0, 0, 0,\n\t\t0, 3, 0,\n\t})\n\tkernel1B := mat.NewDense(3, 3, []float64{\n\t\t1, 0, 0,\n\t\t1, 0, 0,\n\t\t0, 0, 2,\n\t})\n\n\tkernel2R := mat.NewDense(3, 3, []float64{\n\t\t0, -1, 0,\n\t\t0, 0, 2,\n\t\t0, 1, 0,\n\t})\n\tkernel2G := mat.NewDense(3, 3, []float64{\n\t\t2, 1, 0,\n\t\t0, 0, 0,\n\t\t0, -3, 0,\n\t})\n\tkernel2B := mat.NewDense(3, 3, []float64{\n\t\t1, 0, 0,\n\t\t1, 0, 0,\n\t\t0, 0, -2,\n\t})\n\n\timg2 := &mat.Dense{}\n\timg2.Stack(redChannel, greenChannel)\n\timage := &mat.Dense{}\n\timage.Stack(img2, blueChannel)\n\n\tkernel1 := &mat.Dense{}\n\tkernel1.Stack(kernel1R, kernel1G)\n\tconvCustomWeights1 := &mat.Dense{}\n\tconvCustomWeights1.Stack(kernel1, kernel1B)\n\n\tkernel2 := &mat.Dense{}\n\tkernel2.Stack(kernel2R, kernel2G)\n\tconvCustomWeights2 := &mat.Dense{}\n\tconvCustomWeights2.Stack(kernel2, kernel2B)\n\tconv.SetCustomWeights([]*mat.Dense{convCustomWeights1, convCustomWeights2})\n\n\tfcCustomWeights := mat.NewDense(2, maxpool.GetOutputSize().Total(), []float64{\n\t\t-0.19908814, 0.01521263,\n\t\t0.17908468, -0.28144695,\n\t})\n\tfullyconnected.SetCustomWeights([]*mat.Dense{fcCustomWeights})\n\n\tfmt.Printf(\"Layers weights:\\n\")\n\tfor i := range net.Layers {\n\t\tfmt.Printf(\"%s #%d weights:\\n\", net.Layers[i].GetType(), i)\n\t\tnet.Layers[i].PrintWeights()\n\t}\n\n\tfmt.Println(\"\\tDoing training....\")\n\tfor e := 0; e < 1; e++ {\n\t\terr := net.FeedForward(image)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Feedforward caused error: %s\", err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tdesired := mat.NewDense(2, 1, []float64{0.15, 0.8})\n\t\terr = net.Backpropagate(desired)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Backpropagate caused error: %s\", err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tfmt.Printf(\"Epoch #%d. New layers weights\\n\", e)\n\t\tfor i := range net.Layers {\n\t\t\tfmt.Printf(\"%s #%d weights on epoch #%d:\\n\", net.Layers[i].GetType(), i, e)\n\t\t\tnet.Layers[i].PrintWeights()\n\t\t}\n\t}\n}", "func (i *ImageBuf) CopyPixels(src *ImageBuf) error {\n\tok := bool(C.ImageBuf_copy_pixels(i.ptr, src.ptr))\n\truntime.KeepAlive(i)\n\truntime.KeepAlive(src)\n\tif !ok {\n\t\treturn i.LastError()\n\t}\n\treturn nil\n}", "func Conv(scope *Scope, input tf.Output, filter tf.Output, strides []int64, padding string, optional ...ConvAttr) (output tf.Output) {\n\tif scope.Err() != nil {\n\t\treturn\n\t}\n\tattrs := map[string]interface{}{\"strides\": strides, \"padding\": padding}\n\tfor _, a := range optional {\n\t\ta(attrs)\n\t}\n\topspec := tf.OpSpec{\n\t\tType: \"Conv\",\n\t\tInput: []tf.Input{\n\t\t\tinput, filter,\n\t\t},\n\t\tAttrs: attrs,\n\t}\n\top := scope.AddOperation(opspec)\n\treturn op.Output(0)\n}", "func Conv2DBackpropFilter(scope *Scope, input tf.Output, filter_sizes tf.Output, out_backprop tf.Output, strides []int64, padding string, optional ...Conv2DBackpropFilterAttr) (output tf.Output) {\n\tif scope.Err() != nil {\n\t\treturn\n\t}\n\tattrs := map[string]interface{}{\"strides\": strides, \"padding\": padding}\n\tfor _, a := range optional {\n\t\ta(attrs)\n\t}\n\topspec := tf.OpSpec{\n\t\tType: \"Conv2DBackpropFilter\",\n\t\tInput: []tf.Input{\n\t\t\tinput, filter_sizes, out_backprop,\n\t\t},\n\t\tAttrs: attrs,\n\t}\n\top := scope.AddOperation(opspec)\n\treturn op.Output(0)\n}", "func (p *Image64) Convolved(k Kernel64) *Image64 {\n\tswitch k.(type) {\n\tcase *separableKernel64:\n\t\treturn p.separableConvolution(k.(*separableKernel64))\n\tdefault:\n\t\treturn p.fullConvolution(k)\n\t}\n\tpanic(\"unreachable\")\n}", "func Dilation2DBackpropFilter(scope *Scope, input tf.Output, filter tf.Output, out_backprop tf.Output, strides []int64, rates []int64, padding string) (filter_backprop tf.Output) {\n\tif scope.Err() != nil {\n\t\treturn\n\t}\n\tattrs := map[string]interface{}{\"strides\": strides, \"rates\": rates, \"padding\": padding}\n\topspec := tf.OpSpec{\n\t\tType: \"Dilation2DBackpropFilter\",\n\t\tInput: []tf.Input{\n\t\t\tinput, filter, out_backprop,\n\t\t},\n\t\tAttrs: attrs,\n\t}\n\top := scope.AddOperation(opspec)\n\treturn op.Output(0)\n}", "func extractSwatches(src *image.RGBA, numColors int) []colorful.Color {\n\tconst (\n\t\tW = 400\n\t\tH = 75\n\t)\n\tvar swatches []colorful.Color\n\tb := src.Bounds()\n\tsw := W / numColors\n\tfor i := 0; i < numColors; i++ {\n\t\tm := src.SubImage(trimRect(image.Rect(b.Min.X+i*sw, b.Max.Y-H, b.Min.X+(i+1)*sw, b.Max.Y), 10))\n\t\tswatches = append(swatches, toColorful(averageColor(m)))\n\t\tsavePNG(strconv.Itoa(i), m) // for debugging\n\t}\n\tconst dim = 50\n\tm := image.NewRGBA(image.Rect(0, 0, dim*len(swatches), dim))\n\tfor i, c := range swatches {\n\t\tr := image.Rect(i*dim, 0, (i+1)*dim, dim)\n\t\tdraw.Draw(m, r, &image.Uniform{fromColorful(c)}, image.ZP, draw.Src)\n\t}\n\tsavePNG(\"swatches\", m) // for debugging\n\treturn swatches\n}", "func (b *Bilateral) Apply(t *Tensor) *Tensor {\n\tdistances := NewTensor(b.KernelSize, b.KernelSize, 1)\n\tcenter := b.KernelSize / 2\n\tfor i := 0; i < b.KernelSize; i++ {\n\t\tfor j := 0; j < b.KernelSize; j++ {\n\t\t\t*distances.At(i, j, 0) = float32((i-center)*(i-center) + (j-center)*(j-center))\n\t\t}\n\t}\n\n\t// Pad with very large negative numbers to prevent\n\t// the filter from incorporating the padding.\n\tpadded := t.Add(100).Pad(center, center, center, center).Add(-100)\n\tout := NewTensor(t.Height, t.Width, t.Depth)\n\tPatches(padded, b.KernelSize, 1, func(idx int, patch *Tensor) {\n\t\tb.blurPatch(distances, patch, out.Data[idx*out.Depth:(idx+1)*out.Depth])\n\t})\n\n\treturn out\n}", "func CopyFiltered(slice interface{}, funcs ...FilterFunc) interface{} {\n\trv := reflect.ValueOf(slice)\n\tif rv.Kind() != reflect.Slice {\n\t\tpanic(\"not a slice\")\n\t}\n\n\tlength := rv.Len()\n\n\tptrfiltered := reflect.New(rv.Type())\n\tptrfiltered.Elem().Set(\n\t\t//reflect.MakeSlice(rv.Type(), 0, length))\n\t\treflect.MakeSlice(rv.Type(), length, length)) // copy is done by dest[j] = src[i], so it's allocated in advance\n\tfiltered := ptrfiltered.Elem()\n\n\treflect.Copy(filtered, rv)\n\n\tFilter(ptrfiltered.Interface(), funcs...)\n\n\treturn filtered.Interface()\n}", "func p256CopyConditional(out, in *[p256Limbs]uint32, mask uint32) {\n\tfor i := 0; i < p256Limbs; i++ {\n\t\ttmp := mask & (in[i] ^ out[i])\n\t\tout[i] ^= tmp\n\t}\n}", "func Saturation(percentage float32) Filter {\n\tp := 1 + minf32(maxf32(percentage, -100), 500)/100\n\tif p == 1 {\n\t\treturn &copyimageFilter{}\n\t}\n\n\treturn &colorFilter{\n\t\tfn: func(px pixel) pixel {\n\t\t\th, s, l := convertRGBToHSL(px.R, px.G, px.B)\n\t\t\ts *= p\n\t\t\tif s > 1 {\n\t\t\t\ts = 1\n\t\t\t}\n\t\t\tr, g, b := convertHSLToRGB(h, s, l)\n\t\t\treturn pixel{r, g, b, px.A}\n\t\t},\n\t}\n}", "func (dithering Dithering) Convert(input image.Image) image.Image {\n\tgrayInput := Gray{\n\t\tAlgorithm: GrayAlgorithms.Luminosity,\n\t}.Convert(input)\n\tbounds := grayInput.Bounds()\n\tw, h := bounds.Max.X, bounds.Max.Y\n\n\tmatrix := make([][]float32, w)\n\tfor x := 0; x < w; x++ {\n\t\tmatrix[x] = make([]float32, h)\n\t\tfor y := 0; y < h; y++ {\n\t\t\tr, _, _, _ := grayInput.At(x, y).RGBA()\n\t\t\tmatrix[x][y] = float32(r >> 8)\n\t\t}\n\t}\n\tthreshold := calculateThreshold(grayInput)\n\n\tfor y := 0; y < h-1; y++ {\n\t\tfor x := 1; x < w-1; x++ {\n\t\t\toldpixel := matrix[x][y]\n\t\t\tnewpixel := toBlackOrWhite(oldpixel, threshold)\n\t\t\tmatrix[x][y] = newpixel\n\t\t\tquantError := oldpixel - newpixel\n\t\t\tmatrix[x+1][y] = matrix[x+1][y] + quantError*7/16\n\t\t\tmatrix[x-1][y+1] = matrix[x-1][y+1] + quantError*3/16\n\t\t\tmatrix[x][y+1] = matrix[x][y+1] + quantError*5/16\n\t\t\tmatrix[x+1][y+1] = matrix[x+1][y+1] + quantError*1/16\n\t\t}\n\t}\n\n\tfor x := 0; x < w; x++ {\n\t\tfor y := 0; y < h; y++ {\n\t\t\tcol := color.Gray{Y: uint8(matrix[x][y])}\n\t\t\tgrayInput.Set(x, y, col)\n\t\t}\n\t}\n\n\treturn grayInput\n}", "func VPMOVSXBW(ops ...operand.Op) { ctx.VPMOVSXBW(ops...) }", "func MulConstSSE32(c float32, x []float32, y []float32)", "func newImageBinaryChannels(imgSrc image.Image, colorChannelTypes ...channelType) []*imageBinaryChannel {\n\tchannels := make([]*imageBinaryChannel, 3)\n\tmax := imgSrc.Bounds().Max\n\tw, h := max.X, max.Y\n\tfor i, channelType := range colorChannelTypes {\n\t\tcolorChannel := image.NewGray(image.Rectangle{Max: image.Point{w, h}})\n\t\tfor x := 0; x < w; x++ {\n\t\t\tfor y := 0; y < h; y++ {\n\t\t\t\tcolorPixel := imgSrc.At(x, y).(color.NRGBA)\n\t\t\t\tvar c uint8\n\t\t\t\tswitch channelType {\n\t\t\t\tcase red:\n\t\t\t\t\tc = colorPixel.R\n\t\t\t\tcase green:\n\t\t\t\t\tc = colorPixel.G\n\t\t\t\tcase blue:\n\t\t\t\t\tc = colorPixel.B\n\t\t\t\t}\n\t\t\t\tgrayPixel := color.Gray{Y: c}\n\t\t\t\tcolorChannel.Set(x, y, grayPixel)\n\t\t\t}\n\t\t}\n\t\tchannels[i] = newImageBinaryChannel(colorChannel, channelType)\n\t}\n\treturn channels\n}", "func ycbcrToGray(dst *image.Gray, src *image.YCbCr) {\n\tfor i := 0; i < src.Rect.Dy(); i++ {\n\t\tdstH := i * dst.Stride\n\t\tsrcH := i * src.YStride\n\t\tcopy(dst.Pix[dstH:dstH+dst.Stride], src.Y[srcH:srcH+dst.Stride])\n\t}\n}", "func Brightness(percentage float32) Filter {\n\tif percentage == 0 {\n\t\treturn &copyimageFilter{}\n\t}\n\n\tshift := minf32(maxf32(percentage, -100), 100) / 100\n\n\treturn &colorchanFilter{\n\t\tfn: func(x float32) float32 {\n\t\t\treturn x + shift\n\t\t},\n\t\tlut: false,\n\t}\n}", "func MulConstSSE64(c float64, x []float64, y []float64)", "func Filter(dst, src []float64, f func(v float64) bool) []float64 {\n\n\tif dst == nil {\n\t\tdst = make([]float64, 0, len(src))\n\t}\n\n\tdst = dst[:0]\n\tfor _, x := range src {\n\t\tif f(x) {\n\t\t\tdst = append(dst, x)\n\t\t}\n\t}\n\n\treturn dst\n}", "func copy2DSlice(sourceSlice [][]byte, destinationSlice [][]byte) {\n\tfor i := 0; i < len(sourceSlice); i++ {\n\t\tfor j := 0; j < len(sourceSlice[i]); j++ {\n\t\t\tdestinationSlice[i][j] = sourceSlice[i][j]\n\t\t}\n\t}\n}", "func forwardDCT64(input []float64) {\n\tvar temp [64]float64\n\tfor i := 0; i < 32; i++ {\n\t\tx, y := input[i], input[63-i]\n\t\ttemp[i] = x + y\n\t\ttemp[i+32] = (x - y) / dct64[i]\n\t}\n\tforwardDCT32(temp[:32])\n\tforwardDCT32(temp[32:])\n\tfor i := 0; i < 32-1; i++ {\n\t\tinput[i*2+0] = temp[i]\n\t\tinput[i*2+1] = temp[i+32] + temp[i+32+1]\n\t}\n\tinput[62], input[63] = temp[31], temp[63]\n}", "func DepthwiseConv2dNativeBackpropFilter(scope *Scope, input tf.Output, filter_sizes tf.Output, out_backprop tf.Output, strides []int64, padding string, optional ...DepthwiseConv2dNativeBackpropFilterAttr) (output tf.Output) {\n\tif scope.Err() != nil {\n\t\treturn\n\t}\n\tattrs := map[string]interface{}{\"strides\": strides, \"padding\": padding}\n\tfor _, a := range optional {\n\t\ta(attrs)\n\t}\n\topspec := tf.OpSpec{\n\t\tType: \"DepthwiseConv2dNativeBackpropFilter\",\n\t\tInput: []tf.Input{\n\t\t\tinput, filter_sizes, out_backprop,\n\t\t},\n\t\tAttrs: attrs,\n\t}\n\top := scope.AddOperation(opspec)\n\treturn op.Output(0)\n}", "func (img *ByteImage) pixels() [][]byte {\n\tbyteIdx := 0\n\tpixels := make([][]byte, img.height)\n\tfor rowIdx := 0; rowIdx < img.height; rowIdx++ {\n\t\tpixels[rowIdx] = make([]byte, img.width)\n\t\tfor colIdx := 0; colIdx < img.width; colIdx++ {\n\t\t\tpixels[rowIdx][colIdx] = img.bytes[byteIdx]\n\t\t\tbyteIdx++\n\t\t}\n\t}\n\treturn pixels\n}", "func (fd FailureDist) Convolve(other FailureDist) (FailureDist, error) {\n\tn := len(fd.prob)\n\tif n != len(other.prob) {\n\t\treturn FailureDist{},\n\t\t\tfmt.Errorf(\"size mismatch %d != %d\", n, len(other.prob))\n\t}\n\tresult := make([]float64, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tk := i + j\n\t\t\tif k < n {\n\t\t\t\tresult[k] += fd.prob[i] * other.prob[j]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn MakeFailureDist(result)\n}", "func filter(source <-chan int, destination chan<- int, prime int) {\n\tfor i := range source {\n\t\tif i%prime != 0 {\n\t\t\tdestination <- i // Send 'i' to 'destination'.\n\t\t}\n\t}\n}", "func (filter *Merge) Process(img *FilterImage) error {\n\tout := img.Image\n\tbounds := out.Bounds()\n\tinbounds := filter.Image.Bounds()\n\n\txmin := bounds.Min.X\n\tif xmin < inbounds.Min.X {\n\t\txmin = inbounds.Min.X\n\t}\n\txmax := bounds.Max.X\n\tif xmax > inbounds.Max.X {\n\t\txmax = inbounds.Max.X\n\t}\n\tymin := bounds.Min.Y\n\tif ymin < inbounds.Min.Y {\n\t\tymin = inbounds.Min.Y\n\t}\n\tymax := bounds.Max.Y\n\tif ymax > inbounds.Max.Y {\n\t\tymax = inbounds.Max.Y\n\t}\n\n\tfor x := xmin; x < xmax; x++ {\n\t\tfor y := ymin; y < ymax; y++ {\n\t\t\tr, g, b, a := out.At(x, y).RGBA()\n\t\t\tir, ig, ib, ia := filter.Image.At(x, y).RGBA()\n\n\t\t\tr = uint32(ClipInt(int(r + ir), 0, 0xFFFF))\n\t\t\tg = uint32(ClipInt(int(g + ig), 0, 0xFFFF))\n\t\t\tb = uint32(ClipInt(int(b + ib), 0, 0xFFFF))\n\t\t\ta = uint32(ClipInt(int(a + ia), 0, 0xFFFF))\n\n\t\t\tout.Set(x, y, color.NRGBA64{uint16(r), uint16(g), uint16(b), uint16(a)})\n\t\t}\n\t}\n\n\treturn nil\n}", "func (pxd pixelData) MultiChannelCircles(dest string, index int) error {\n\n rgbChannels := []RGBChannel {cs.red, cs.blue, cs.green}\n\n err := pxd.pixelLooper(func(pxAddr chan pxAddress) {\n\n for pxa := range pxAddr {\n\n row := float64(pxa.row)\n col := float64(pxa.column)\n mult := float64(pxd.blockSize)\n\n // Assign RGB values\n rgb := []float64{\n pxa.pixelWand.GetRed(), \n pxa.pixelWand.GetGreen(), \n pxa.pixelWand.GetBlue(), \n }\n\n for idx, channel := range rgbChannels {\n\n // Calculate how large each cirlce should be\n circleSize := mult / (rgb[idx] * 255 / 255 * 15 + 3)\n\n pxd.wands.pw.SetColor(channel.fill)\n // TODO\n // pxd.wands.dw.SetStrokeWidth(0)\n // pxd.wands.dw.SetStrokeColor(channel.stroke)\n pxd.wands.pw.SetOpacity(channel.opacity)\n pxd.wands.dw.SetFillColor(pxd.wands.pw)\n\n ox := float64(col*mult + channel.offset)\n oy := float64(row*mult + channel.offset)\n px := ox-float64(circleSize)\n py := oy-float64(circleSize)\n\n pxd.wands.dw.Circle(ox,oy,px,py)\n }\n }\n }, dest)\n\n return err\n}", "func downsample(srcImg image.Image) image.Image {\n\tbounds := srcImg.Bounds()\n\treturn resize.Resize(bounds.Dx()/2, bounds.Dy()/2, srcImg, resize.Bilinear)\n}", "func (f *Frame) Crop(w, h, xOffset, yOffset int) error {\n\tif w+xOffset > f.Width {\n\t\treturn fmt.Errorf(\"cropped width + x offset (%d) cannot exceed original width (%d)\",\n\t\t\tw+xOffset, f.Width)\n\t}\n\tif h+yOffset > f.Height {\n\t\treturn fmt.Errorf(\"cropped height + y offset (%d) cannot exceed original height (%d)\",\n\t\t\th+yOffset, f.Height)\n\t}\n\tnewY := make([]byte, 0, w*h)\n\tfor y := 0; y < h; y++ {\n\t\tyt := y + yOffset\n\t\tx0 := yt*f.Width + xOffset\n\t\tx1 := x0 + w\n\t\tnewY = append(newY, f.Y[x0:x1]...)\n\t}\n\tf.Y = newY\n\txss := xSubsamplingFactor[f.Chroma]\n\tyss := ySubsamplingFactor[f.Chroma]\n\tnewCb := make([]byte, 0, w/xss*h/yss)\n\tnewCr := make([]byte, 0, w/xss*h/yss)\n\tfor y := 0; y < h/yss; y++ {\n\t\tyt := y + yOffset/yss\n\t\tx0 := yt*f.Width/xss + xOffset/xss\n\t\tx1 := x0 + w/xss\n\t\tnewCb = append(newCb, f.Cb[x0:x1]...)\n\t\tnewCr = append(newCr, f.Cr[x0:x1]...)\n\t}\n\tf.Cb = newCb\n\tf.Cr = newCr\n\tif len(f.Alpha) > 0 {\n\t\tnewAlpha := make([]byte, 0, w*h)\n\t\tfor y := 0; y < h; y++ {\n\t\t\tyt := y + yOffset\n\t\t\tx0 := yt*f.Width + xOffset\n\t\t\tx1 := x0 + w\n\t\t\tnewAlpha = append(newAlpha, f.Alpha[x0:x1]...)\n\t\t}\n\t\tf.Alpha = newAlpha\n\t}\n\tf.Width = w\n\tf.Height = h\n\treturn nil\n}", "func PMOVSXBW(mx, x operand.Op) { ctx.PMOVSXBW(mx, x) }", "func dewarpFisheye(b []byte) []byte {\n\timg, _, err := image.Decode(bytes.NewReader(b))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\td := image.NewRGBA(img.Bounds())\n\twidth := d.Bounds().Size().X\n\theight := d.Bounds().Size().Y\n\thalfY := height / 2\n\thalfX := width / 2\n\n\tstrength := 2.35\n\tcorrRad := math.Sqrt(float64(width*width+height*height)) / strength\n\tEPSILON := 0.0000000001\n\tzoom := 1.00\n\n\tfor y := 0; y < height; y++ {\n\t\tfor x := 0; x < width; x++ {\n\t\t\tabsX := float64(x - halfX)\n\t\t\tabsY := float64(y - halfY)\n\n\t\t\tdist := math.Sqrt(absX*absX + absY*absY)\n\t\t\tr := dist / corrRad\n\t\t\ttheta := 1.\n\t\t\tif r > EPSILON {\n\t\t\t\ttheta = math.Atan(r) / r\n\t\t\t}\n\n\t\t\tsrcX := float64(halfX) + theta*absX*zoom\n\t\t\tsrcY := float64(halfY) + theta*absY*zoom\n\n\t\t\t// (srcX, srcY) will point to a place between pixels; interpolate its color value by weighting its neighbors'\n\t\t\tloX := int(srcX)\n\t\t\thiX := loX + 1\n\t\t\tdX := srcX - float64(loX)\n\n\t\t\tloY := int(srcY)\n\t\t\thiY := loY + 1\n\t\t\tdY := srcY - float64(loY)\n\n\t\t\tRi, Gi, Bi, Ai := img.At(loX, loY).RGBA()\n\t\t\tR := float64(Ri) * (1 - dX) * (1 - dY)\n\t\t\tG := float64(Gi) * (1 - dX) * (1 - dY)\n\t\t\tB := float64(Bi) * (1 - dX) * (1 - dY)\n\t\t\tA := float64(Ai) * (1 - dX) * (1 - dY)\n\n\t\t\tRi, Gi, Bi, Ai = img.At(hiX, loY).RGBA()\n\t\t\tR += float64(Ri) * dX * (1 - dY)\n\t\t\tG += float64(Gi) * dX * (1 - dY)\n\t\t\tB += float64(Bi) * dX * (1 - dY)\n\t\t\tA += float64(Ai) * dX * (1 - dY)\n\n\t\t\tRi, Gi, Bi, Ai = img.At(loX, hiY).RGBA()\n\t\t\tR += float64(Ri) * (1 - dX) * dY\n\t\t\tG += float64(Gi) * (1 - dX) * dY\n\t\t\tB += float64(Bi) * (1 - dX) * dY\n\t\t\tA += float64(Ai) * (1 - dX) * dY\n\n\t\t\tRi, Gi, Bi, Ai = img.At(hiX, hiY).RGBA()\n\t\t\tR += float64(Ri) * dX * dY\n\t\t\tG += float64(Gi) * dX * dY\n\t\t\tB += float64(Bi) * dX * dY\n\t\t\tA += float64(Ai) * dX * dY\n\n\t\t\tR16 := uint16(math.Round(R))\n\t\t\tG16 := uint16(math.Round(G))\n\t\t\tB16 := uint16(math.Round(B))\n\t\t\tA16 := uint16(math.Round(A))\n\n\t\t\tc := color.RGBA64{R: R16, G: G16, B: B16, A: A16}\n\n\t\t\td.Set(x, y, c)\n\t\t}\n\t}\n\n\tvar buf bytes.Buffer\n\tjpeg.Encode(&buf, d, nil)\n\treturn buf.Bytes()\n}", "func p256MovCond(res, a, b []uint64, cond int)", "func p256MovCond(res, a, b []uint64, cond int)", "func Conv2DBackpropFilterV2(scope *Scope, input tf.Output, filter tf.Output, out_backprop tf.Output, strides []int64, padding string, optional ...Conv2DBackpropFilterV2Attr) (output tf.Output) {\n\tif scope.Err() != nil {\n\t\treturn\n\t}\n\tattrs := map[string]interface{}{\"strides\": strides, \"padding\": padding}\n\tfor _, a := range optional {\n\t\ta(attrs)\n\t}\n\topspec := tf.OpSpec{\n\t\tType: \"Conv2DBackpropFilterV2\",\n\t\tInput: []tf.Input{\n\t\t\tinput, filter, out_backprop,\n\t\t},\n\t\tAttrs: attrs,\n\t}\n\top := scope.AddOperation(opspec)\n\treturn op.Output(0)\n}", "func (img *FloatImage) ConvolveWrapWith(kernel *ConvKernel, px planeExtension) {\n\timg.convolveWith(kernel, wrapPlaneExtension)\n}", "func Pow2Image(src image.Image) image.Image {\n\tsb := src.Bounds()\n\tw, h := uint32(sb.Dx()), uint32(sb.Dy())\n\n\tif IsPow2(w) && IsPow2(h) {\n\t\treturn src // Nothing to do.\n\t}\n\n\trect := image.Rect(0, 0, int(Pow2(w)), int(Pow2(h)))\n\n\tswitch src := src.(type) {\n\tcase *image.Alpha:\n\t\treturn copyImg(src, image.NewAlpha(rect))\n\n\tcase *image.Alpha16:\n\t\treturn copyImg(src, image.NewAlpha16(rect))\n\n\tcase *image.Gray:\n\t\treturn copyImg(src, image.NewGray(rect))\n\n\tcase *image.Gray16:\n\t\treturn copyImg(src, image.NewGray16(rect))\n\n\tcase *image.NRGBA:\n\t\treturn copyImg(src, image.NewNRGBA(rect))\n\n\tcase *image.NRGBA64:\n\t\treturn copyImg(src, image.NewNRGBA64(rect))\n\n\tcase *image.Paletted:\n\t\treturn copyImg(src, image.NewPaletted(rect, src.Palette))\n\n\tcase *image.RGBA:\n\t\treturn copyImg(src, image.NewRGBA(rect))\n\n\tcase *image.RGBA64:\n\t\treturn copyImg(src, image.NewRGBA64(rect))\n\t}\n\n\tpanic(fmt.Sprintf(\"Unsupported image format: %T\", src))\n}", "func Resize(img image.Image, width, height int, filter ResampleFilter) *image.RGBA {\n\tif width <= 0 || height <= 0 || img.Bounds().Empty() {\n\t\treturn image.NewRGBA(image.Rect(0, 0, 0, 0))\n\t}\n\n\tsrc := clone.AsRGBA(img)\n\tvar dst *image.RGBA\n\n\t// NearestNeighbor is a special case, it's faster to compute without convolution matrix.\n\tif filter.Support <= 0 {\n\t\tdst = nearestNeighbor(src, width, height)\n\t} else {\n\t\tdst = resampleHorizontal(src, width, filter)\n\t\tdst = resampleVertical(dst, height, filter)\n\t}\n\n\treturn dst\n}", "func (cm *ConnectionManager) RegisterFilters(source <-chan packet.Packet,\n\tfilters ...func(packet.Packet) packet.Packet) <-chan packet.Packet {\n\tsink := make(chan packet.Packet)\n\n\tgo func() {\n\t\tfor p := range source {\n\t\t\tfor _, filter := range filters {\n\t\t\t\tif pass := filter(p); pass != nil {\n\t\t\t\t\tsink <- pass\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn sink\n}", "func stream_copy(src io.Reader, dst io.Writer) <-chan int {\n\tbuf := make([]byte, 1024)\n\tsync_channel := make(chan int)\n\tgo func() {\n\t\tdefer func() {\n\t\t\tif con, ok := dst.(net.Conn); ok {\n\t\t\t\tcon.Close()\n\t\t\t\tlog.Printf(\"Connection from %v is closed\\n\", con.RemoteAddr())\n\t\t\t}\n\t\t\tsync_channel <- 0 // Notify that processing is finished\n\t\t}()\n\t\tfor {\n\t\t\tvar nBytes int\n\t\t\tvar err error\n\t\t\tnBytes, err = src.Read(buf)\n\t\t\tif err != nil {\n\t\t\t\tif err != io.EOF {\n\t\t\t\t\tlog.Printf(\"Read error: %s\\n\", err)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t_, err = dst.Write(buf[0:nBytes])\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"Write error: %s\\n\", err)\n\t\t\t}\n\t\t}\n\t}()\n\treturn sync_channel\n}", "func (s *ImageSpec) PixelBytesChans(chanBegin, chanEnd int, native bool) int {\n\tret := int(C.ImageSpec_pixel_bytes_chans(s.ptr, C.int(chanBegin), C.int(chanEnd), C.bool(native)))\n\truntime.KeepAlive(s)\n\treturn ret\n}", "func ToBWByteSlice(imgToConvert *image.Gray, threshold uint8) (outputBytes [][]byte) {\n\tw, h := imgToConvert.Bounds().Max.X, imgToConvert.Bounds().Max.Y\n\toutputBytes = make([][]byte, h/8, h/8)\n\tfor i := 0; i < len(outputBytes); i++ {\n\t\toutputBytes[i] = make([]byte, w)\n\t}\n\tfor currentY := 0; currentY < h/8; currentY++ {\n\t\tvar CurrentPage []byte = make([]byte, w, w)\n\t\tfor currentX := 0; currentX < w; currentX++ {\n\t\t\tvar constructedVLine byte = 0\n\t\t\tif imgToConvert.GrayAt(currentX, 0+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine++\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 1+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 2\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 2+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 4\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 3+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 8\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 4+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 16\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 5+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 32\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 6+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 64\n\t\t\t}\n\t\t\tif imgToConvert.GrayAt(currentX, 7+(8*currentY)).Y >= threshold {\n\t\t\t\tconstructedVLine += 128\n\t\t\t}\n\t\t\tCurrentPage[currentX] = constructedVLine\n\t\t}\n\t\toutputBytes[currentY] = CurrentPage\n\t}\n\treturn outputBytes\n}", "func SwitchData(x, y gb.UINT8, src, dst []gb.UINT8) {}", "func Copy(dst Mutable, src Const) {\n\tif err := errIfDimsNotEq(src, dst); err != nil {\n\t\tpanic(err)\n\t}\n\n\tm, n := src.Dims()\n\tfor i := 0; i < m; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tdst.Set(i, j, src.At(i, j))\n\t\t}\n\t}\n}", "func (p *p256Point) CopyConditional(src *p256Point, v int) {\r\n\tpMask := uint64(v) - 1\r\n\tsrcMask := ^pMask\r\n\r\n\tfor i, n := range p.xyz {\r\n\t\tp.xyz[i] = (n & pMask) | (src.xyz[i] & srcMask)\r\n\t}\r\n}", "func (r *Rasterizer8BitsSample) fillEvenOdd(img *image.RGBA, c color.Color, clipBound [4]float64) {\n\tvar x, y uint32\n\n\tminX := uint32(clipBound[0])\n\tmaxX := uint32(clipBound[2])\n\n\tminY := uint32(clipBound[1]) >> SUBPIXEL_SHIFT\n\tmaxY := uint32(clipBound[3]) >> SUBPIXEL_SHIFT\n\n\trgba := convert(c)\n\tpixColor := *(*uint32)(unsafe.Pointer(&rgba))\n\n\tcs1 := pixColor & 0xff00ff\n\tcs2 := pixColor >> 8 & 0xff00ff\n\n\tstride := uint32(img.Stride)\n\tvar mask SUBPIXEL_DATA\n\tmaskY := minY * uint32(r.BufferWidth)\n\tminY *= stride\n\tmaxY *= stride\n\tvar tp []uint8\n\tvar pixelx uint32\n\tfor y = minY; y < maxY; y += stride {\n\t\ttp = img.Pix[y:]\n\t\tmask = 0\n\n\t\t//i0 := (s.Y-r.Image.Rect.Min.Y)*r.Image.Stride + (s.X0-r.Image.Rect.Min.X)*4\r\n\t\t//i1 := i0 + (s.X1-s.X0)*4\r\n\t\tpixelx = minX * 4\n\t\tfor x = minX; x <= maxX; x++ {\n\t\t\tmask ^= r.MaskBuffer[maskY+x]\n\t\t\t// 8bits\r\n\t\t\talpha := uint32(coverageTable[mask])\n\t\t\t// 16bits\r\n\t\t\t//alpha := uint32(coverageTable[mask & 0xff] + coverageTable[(mask >> 8) & 0xff])\r\n\t\t\t// 32bits\r\n\t\t\t//alpha := uint32(coverageTable[mask & 0xff] + coverageTable[(mask >> 8) & 0xff] + coverageTable[(mask >> 16) & 0xff] + coverageTable[(mask >> 24) & 0xff])\r\n\n\t\t\t// alpha is in range of 0 to SUBPIXEL_COUNT\r\n\t\t\tp := (*uint32)(unsafe.Pointer(&tp[pixelx]))\n\t\t\tif alpha == SUBPIXEL_FULL_COVERAGE {\n\t\t\t\t*p = pixColor\n\t\t\t} else if alpha != 0 {\n\t\t\t\tinvAlpha := SUBPIXEL_COUNT - alpha\n\t\t\t\tct1 := *p & 0xff00ff * invAlpha\n\t\t\t\tct2 := *p >> 8 & 0xff00ff * invAlpha\n\n\t\t\t\tct1 = (ct1 + cs1*alpha) >> SUBPIXEL_SHIFT & 0xff00ff\n\t\t\t\tct2 = (ct2 + cs2*alpha) << (8 - SUBPIXEL_SHIFT) & 0xff00ff00\n\n\t\t\t\t*p = ct1 + ct2\n\t\t\t}\n\t\t\tpixelx += 4\n\t\t}\n\t\tmaskY += uint32(r.BufferWidth)\n\t}\n}", "func (filter *Saturation) Process(img *FilterImage) error {\n\tout := img.Image\n\tbounds := out.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\tr, g, b, a := out.At(x, y).RGBA()\n\n\t\t\tgrey := (r + g + b) / 3\n\n\t\t\tnr := Trunc(r + ((Abs(int32(r-grey)) * filter.Strength) / 100))\n\t\t\tng := Trunc(g + ((Abs(int32(g-grey)) * filter.Strength) / 100))\n\t\t\tnb := Trunc(b + ((Abs(int32(b-grey)) * filter.Strength) / 100))\n\n\t\t\tnc := color.NRGBA64{nr, ng, nb, uint16(a)}\n\t\t\tout.Set(x, y, nc)\n\t\t}\n\t}\n\treturn nil\n}", "func encodeBWData(w io.Writer, img image.Image, opts *EncodeOptions) error {\n\t// In the background, write each index value into a channel.\n\trect := img.Bounds()\n\twidth := rect.Max.X - rect.Min.X\n\tsamples := make(chan uint16, width)\n\tgo func() {\n\t\tbwImage := NewBW(image.ZR)\n\t\tcm := bwImage.ColorModel().(color.Palette)\n\t\tfor y := rect.Min.Y; y < rect.Max.Y; y++ {\n\t\t\tfor x := rect.Min.X; x < rect.Max.X; x++ {\n\t\t\t\tsamples <- uint16(cm.Index(img.At(x, y)))\n\t\t\t}\n\t\t}\n\t\tclose(samples)\n\t}()\n\n\t// In the foreground, consume index values (either 0 or 1) and\n\t// write them to the image file as individual bits. Pack 8\n\t// bits to a byte, pad each row, and output.\n\tif opts.Plain {\n\t\treturn writePlainData(w, samples)\n\t}\n\twb, ok := w.(*bufio.Writer)\n\tif !ok {\n\t\twb = bufio.NewWriter(w)\n\t}\n\tvar b byte // Next byte to write\n\tvar bLen uint // Valid bits in b\n\tvar rowBits int // Bits written to the current row\n\tfor s := range samples {\n\t\tb = b<<1 | byte(s)\n\t\tbLen++\n\t\trowBits++\n\t\tif rowBits == width {\n\t\t\t// Pad the last byte in the row.\n\t\t\tb <<= 8 - bLen\n\t\t\tbLen = 8\n\t\t\trowBits = 0\n\t\t}\n\t\tif bLen == 8 {\n\t\t\t// Write a full byte to the output.\n\t\t\tif err := wb.WriteByte(b); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tb = 0\n\t\t\tbLen = 0\n\t\t}\n\t}\n\twb.Flush()\n\treturn nil\n}", "func MulConstAVX32(c float32, x []float32, y []float32)", "func square(img *image.Paletted, p squareParams) {\n\tfor x := p.from.x; x < p.to.x; x++ {\n\t\tfor y := p.from.y; y < p.to.y; y++ {\n\t\t\timg.Set(x, y, p.c)\n\t\t}\n\t}\n}", "func (n *Node) Convconst(con *Node, t *Type)" ]
[ "0.7410087", "0.6712185", "0.6649832", "0.64741814", "0.63578194", "0.63215214", "0.60116434", "0.5824171", "0.57838714", "0.5715813", "0.56136847", "0.5597352", "0.54525596", "0.53481835", "0.5248561", "0.5243912", "0.5227945", "0.519987", "0.5178303", "0.5174178", "0.51658684", "0.51640326", "0.5138945", "0.510374", "0.5078412", "0.50470674", "0.5040979", "0.502544", "0.5008604", "0.49861428", "0.49692625", "0.49605152", "0.49239093", "0.48906052", "0.48841786", "0.48593852", "0.48378694", "0.47637844", "0.47277978", "0.47265518", "0.46816558", "0.46541014", "0.46495754", "0.46490166", "0.46433717", "0.46374553", "0.4634919", "0.46142185", "0.46135357", "0.4598141", "0.45730522", "0.4554533", "0.45506656", "0.453461", "0.45238167", "0.4494606", "0.4479729", "0.4450312", "0.4442128", "0.44279388", "0.4418432", "0.44160232", "0.44042432", "0.43990484", "0.43884668", "0.43872827", "0.43841377", "0.43810913", "0.4368192", "0.4364542", "0.43591183", "0.4355022", "0.43544436", "0.43495566", "0.43468073", "0.43458748", "0.43453974", "0.43403178", "0.4338219", "0.43341443", "0.4331383", "0.4326496", "0.4326496", "0.4313152", "0.43099505", "0.42842475", "0.4277752", "0.42625254", "0.4260349", "0.4257632", "0.42544687", "0.4254064", "0.42495963", "0.4216882", "0.42144206", "0.4211415", "0.42107898", "0.42091486", "0.4207261", "0.42028525" ]
0.7162849
1
copy a threedimensional texture subimage
скопировать подизображение трехмерного текстура
func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) { C.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage3D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height))\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage2D, 8, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height), 0)\n}", "func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tsyscall.Syscall6(gpCopyTextureSubImage1D, 6, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(x), uintptr(y), uintptr(width))\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n C.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func (tex Texture) Sub(ctx gl.Context, lvl int, width int, height int, data []byte) {\n\tctx.TexSubImage2D(gl.TEXTURE_2D, lvl, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data)\n\tif lvl > 0 {\n\t\tctx.GenerateMipmap(gl.TEXTURE_2D)\n\t}\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tC.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tC.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))\n}", "func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n C.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n C.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n C.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tsyscall.Syscall9(gpCopyTexImage2D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(border), 0)\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tC.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {\n\tC.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))\n}", "func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n C.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTexSubImage2D, 8, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height), 0)\n}", "func TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) {\n\tgl.TexSubImage2D(uint32(target), int32(level), int32(x), int32(y), int32(width), int32(height), uint32(format), uint32(ty), gl.Ptr(&data[0]))\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {\n\tsyscall.Syscall15(gpCopyImageSubData, 15, uintptr(srcName), uintptr(srcTarget), uintptr(srcLevel), uintptr(srcX), uintptr(srcY), uintptr(srcZ), uintptr(dstName), uintptr(dstTarget), uintptr(dstLevel), uintptr(dstX), uintptr(dstY), uintptr(dstZ), uintptr(srcWidth), uintptr(srcHeight), uintptr(srcDepth))\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetTextureSubImage, 12, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(bufSize), uintptr(pixels))\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexSubImage2D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTexSubImage3D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height))\n}", "func CopyTexImage2D(target GLEnum, level int32, internalformat GLEnum, x, y, width, height, border int32) {\n\tgl.CopyTexImage2D(uint32(target), level, uint32(internalformat), x, y, width, height, border)\n}", "func CopyTexSubImage2D(target GLEnum, level, xoffset, yoffset, x, y, width, height int32) {\n\tgl.CopyTexSubImage2D(uint32(target), level, xoffset, yoffset, x, y, width, height)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tC.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) {\n C.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))\n}", "func CopyColorSubTable(target uint32, start int32, x int32, y int32, width int32) {\n C.glowCopyColorSubTable(gpCopyColorSubTable, (C.GLenum)(target), (C.GLsizei)(start), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTexSubImage3D, 11, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {\n\tsyscall.Syscall6(gpCopyTexSubImage1D, 6, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(x), uintptr(y), uintptr(width))\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) {\n\tgl.CopyTexImage2D(uint32(target), int32(level), uint32(internalformat), int32(x), int32(y), int32(width), int32(height), int32(border))\n}", "func CopyColorSubTable(target uint32, start int32, x int32, y int32, width int32) {\n\tC.glowCopyColorSubTable(gpCopyColorSubTable, (C.GLenum)(target), (C.GLsizei)(start), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexSubImage2D(target GLEnum, level, xoffset, yoffset, width, height int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexSubImage2D(uint32(target), level, xoffset, yoffset, width, height, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) {\n\tgl.CopyTexSubImage2D(uint32(target), int32(level), int32(xoffset), int32(yoffset), int32(x), int32(y), int32(width), int32(height))\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n C.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))\n}", "func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexSubImage1D, 7, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetCompressedTextureSubImage, 10, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func TexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, width Sizei, height Sizei, format Enum, kind Enum, pixels unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcformat, _ := (C.GLenum)(format), cgoAllocsUnknown\n\tckind, _ := (C.GLenum)(kind), cgoAllocsUnknown\n\tcpixels, _ := (unsafe.Pointer)(unsafe.Pointer(pixels)), cgoAllocsUnknown\n\tC.glTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cwidth, cheight, cformat, ckind, cpixels)\n}", "func CopyTexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, x Int, y Int, width Sizei, height Sizei) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcx, _ := (C.GLint)(x), cgoAllocsUnknown\n\tcy, _ := (C.GLint)(y), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tC.glCopyTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cx, cy, cwidth, cheight)\n}", "func CopyTexImage2D(target Enum, level Int, internalformat Enum, x Int, y Int, width Sizei, height Sizei, border Int) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcinternalformat, _ := (C.GLenum)(internalformat), cgoAllocsUnknown\n\tcx, _ := (C.GLint)(x), cgoAllocsUnknown\n\tcy, _ := (C.GLint)(y), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcborder, _ := (C.GLint)(border), cgoAllocsUnknown\n\tC.glCopyTexImage2D(ctarget, clevel, cinternalformat, cx, cy, cwidth, cheight, cborder)\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n\tsyscall.Syscall9(gpCopyTexImage1D, 7, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(x), uintptr(y), uintptr(width), uintptr(border), 0, 0)\n}", "func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) {\n\tC.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))\n}", "func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) {\n\tC.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func (t *Texture) Clone() *Texture {\n\tt.p.Call(\"clone\")\n\treturn t\n}", "func CopyImageSubDataNV(hSrcRC unsafe.Pointer, srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, hDstRC unsafe.Pointer, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, width int32, height int32, depth int32) unsafe.Pointer {\n\tpanic(\"\\\"CopyImageSubDataNV\\\" is not implemented\")\n}", "func (p *Paletted) SubImage(r Rectangle) Image {\n\tr = r.Intersect(p.Rect)\n\t// If r1 and r2 are Rectangles, r1.Intersect(r2) is not guaranteed to be inside\n\t// either r1 or r2 if the intersection is empty. Without explicitly checking for\n\t// this, the Pix[i:] expression below can panic.\n\tif r.Empty() {\n\t\treturn &Paletted{\n\t\t\tPalette: p.Palette,\n\t\t}\n\t}\n\ti := p.PixOffset(r.Min.X, r.Min.Y)\n\treturn &Paletted{\n\t\tPix: p.Pix[i:],\n\t\tStride: p.Stride,\n\t\tRect: p.Rect.Intersect(r),\n\t\tPalette: p.Palette,\n\t}\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n\tC.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))\n}", "func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {\n\tC.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexImage2D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func Copy(dst draw.Image, src image.Image) {\n\tbd := src.Bounds().Intersect(dst.Bounds())\n\tat := imageutil.NewAtFunc(src)\n\tset := imageutil.NewSetFunc(dst)\n\timageutil.Parallel1D(bd, func(bd image.Rectangle) {\n\t\tfor y := bd.Min.Y; y < bd.Max.Y; y++ {\n\t\t\tfor x := bd.Min.X; x < bd.Max.X; x++ {\n\t\t\t\tr, g, b, a := at(x, y)\n\t\t\t\tset(x, y, r, g, b, a)\n\t\t\t}\n\t\t}\n\t})\n}", "func TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) {\n\tp := unsafe.Pointer(nil)\n\tif len(data) > 0 {\n\t\tp = gl.Ptr(&data[0])\n\t}\n\tgl.TexImage2D(uint32(target), int32(level), int32(format), int32(width), int32(height), 0, uint32(format), uint32(ty), p)\n}", "func (self *TileSprite) TintedTexture() *Canvas{\n return &Canvas{self.Object.Get(\"tintedTexture\")}\n}", "func TexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexImage2D(uint32(target), level, int32(internalformat), width, height, border, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func (s *stencilOverdraw) copyImageAspect(ctx context.Context,\n\tcb CommandBuilder,\n\tgs *api.GlobalState,\n\tst *State,\n\ta arena.Arena,\n\tdevice VkDevice,\n\tcmdBuffer VkCommandBuffer,\n\tsrcImgDesc imageDesc,\n\tdstImgDesc imageDesc,\n\textent VkExtent3D,\n\talloc func(v ...interface{}) api.AllocResult,\n\taddCleanup func(func()),\n\tout transform.Writer,\n) {\n\tsrcImg := srcImgDesc.image\n\tdstImg := dstImgDesc.image\n\tcopyBuffer := s.createDepthCopyBuffer(ctx, cb, gs, st, a, device,\n\t\tsrcImg.Info().Fmt(),\n\t\textent.Width(), extent.Height(),\n\t\talloc, addCleanup, out)\n\n\tallCommandsStage := VkPipelineStageFlags(\n\t\tVkPipelineStageFlagBits_VK_PIPELINE_STAGE_ALL_COMMANDS_BIT)\n\tallMemoryAccess := VkAccessFlags(\n\t\tVkAccessFlagBits_VK_ACCESS_MEMORY_WRITE_BIT |\n\t\t\tVkAccessFlagBits_VK_ACCESS_MEMORY_READ_BIT)\n\n\timgBarriers0 := make([]VkImageMemoryBarrier, 2)\n\timgBarriers1 := make([]VkImageMemoryBarrier, 2)\n\t// Transition the src image in and out of the required layouts\n\timgBarriers0[0] = NewVkImageMemoryBarrier(a,\n\t\tVkStructureType_VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType\n\t\t0, // pNext\n\t\tallMemoryAccess, // srcAccessMask\n\t\tVkAccessFlags(VkAccessFlagBits_VK_ACCESS_TRANSFER_READ_BIT), // dstAccessMask\n\t\tsrcImgDesc.layout, // oldLayout\n\t\tVkImageLayout_VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // newLayout\n\t\t^uint32(0), // srcQueueFamilyIndex: VK_QUEUE_FAMILY_IGNORED\n\t\t^uint32(0), // dstQueueFamilyIndex\n\t\tsrcImg.VulkanHandle(), // image\n\t\tsrcImgDesc.subresource, // subresourceRange\n\t)\n\tsrcFinalLayout := srcImgDesc.layout\n\tif srcFinalLayout == VkImageLayout_VK_IMAGE_LAYOUT_UNDEFINED ||\n\t\tsrcFinalLayout == VkImageLayout_VK_IMAGE_LAYOUT_PREINITIALIZED {\n\t\tsrcFinalLayout = VkImageLayout_VK_IMAGE_LAYOUT_GENERAL\n\t}\n\timgBarriers1[0] = NewVkImageMemoryBarrier(a,\n\t\tVkStructureType_VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType\n\t\t0, // pNext\n\t\tVkAccessFlags(VkAccessFlagBits_VK_ACCESS_TRANSFER_READ_BIT), // srcAccessMask\n\t\tallMemoryAccess, // dstAccessMask\n\t\tVkImageLayout_VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // oldLayout\n\t\tsrcFinalLayout, // newLayout\n\t\t^uint32(0), // srcQueueFamilyIndex: VK_QUEUE_FAMILY_IGNORED\n\t\t^uint32(0), // dstQueueFamilyIndex\n\t\tsrcImg.VulkanHandle(), // image\n\t\tsrcImgDesc.subresource, // subresourceRange\n\t)\n\n\t// Transition the new image in and out of its required layouts\n\timgBarriers0[1] = NewVkImageMemoryBarrier(a,\n\t\tVkStructureType_VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType\n\t\t0, // pNext\n\t\tallMemoryAccess, // srcAccessMask\n\t\tVkAccessFlags(VkAccessFlagBits_VK_ACCESS_TRANSFER_WRITE_BIT), // dstAccessMask\n\t\tdstImgDesc.layout, // oldLayout\n\t\tVkImageLayout_VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout\n\t\t^uint32(0), // srcQueueFamilyIndex: VK_QUEUE_FAMILY_IGNORED\n\t\t^uint32(0), // dstQueueFamilyIndex\n\t\tdstImg.VulkanHandle(), // image\n\t\tdstImgDesc.subresource, // subresourceRange\n\t)\n\n\tdstFinalLayout := dstImgDesc.layout\n\tif dstFinalLayout == VkImageLayout_VK_IMAGE_LAYOUT_UNDEFINED ||\n\t\tdstFinalLayout == VkImageLayout_VK_IMAGE_LAYOUT_PREINITIALIZED {\n\t\tdstFinalLayout = VkImageLayout_VK_IMAGE_LAYOUT_GENERAL\n\t}\n\timgBarriers1[1] = NewVkImageMemoryBarrier(a,\n\t\tVkStructureType_VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType\n\t\t0, // pNext\n\t\tVkAccessFlags(VkAccessFlagBits_VK_ACCESS_TRANSFER_WRITE_BIT), // srcAccessMask\n\t\tallMemoryAccess, // dstAccessMask\n\t\tVkImageLayout_VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // oldLayout\n\t\tdstFinalLayout, // newLayout\n\t\t^uint32(0), // srcQueueFamilyIndex: VK_QUEUE_FAMILY_IGNORED\n\t\t^uint32(0), // dstQueueFamilyIndex\n\t\tdstImg.VulkanHandle(), // image\n\t\tdstImgDesc.subresource, // subresourceRange\n\t)\n\n\tbufBarrier := NewVkBufferMemoryBarrier(a,\n\t\tVkStructureType_VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // sType\n\t\t0, // pNext\n\t\tVkAccessFlags(VkAccessFlagBits_VK_ACCESS_TRANSFER_WRITE_BIT), // srcAccessMask\n\t\tVkAccessFlags(VkAccessFlagBits_VK_ACCESS_TRANSFER_READ_BIT), // dstAccessMask\n\t\t^uint32(0), // srcQueueFamilyIndex: VK_QUEUE_FAMILY_IGNORED\n\t\t^uint32(0), // dstQueueFamilyIndex\n\t\tcopyBuffer, // buffer\n\t\t0, // offset\n\t\t^VkDeviceSize(0), // size: VK_WHOLE_SIZE\n\t)\n\n\tibCopy := NewVkBufferImageCopy(a,\n\t\t0, // bufferOffset\n\t\t0, // bufferRowLength\n\t\t0, // bufferImageHeight\n\t\tNewVkImageSubresourceLayers(a,\n\t\t\tVkImageAspectFlags(srcImgDesc.aspect), // aspectMask\n\t\t\tsrcImgDesc.subresource.BaseMipLevel(), // mipLevel\n\t\t\tsrcImgDesc.subresource.BaseArrayLayer(), // baseArrayLayer\n\t\t\t1, // layerCount\n\t\t), // srcSubresource\n\t\tNewVkOffset3D(a, 0, 0, 0), // offset\n\t\tNewVkExtent3D(a, extent.Width(), extent.Height(), 1), // extent\n\t)\n\n\tbiCopy := NewVkBufferImageCopy(a,\n\t\t0, // bufferOffset\n\t\t0, // bufferRowLength\n\t\t0, // bufferImageHeight\n\t\tNewVkImageSubresourceLayers(a,\n\t\t\tVkImageAspectFlags(dstImgDesc.aspect), // aspectMask\n\t\t\tdstImgDesc.subresource.BaseMipLevel(), // mipLevel\n\t\t\tdstImgDesc.subresource.BaseArrayLayer(), // baseArrayLayer\n\t\t\t1, // layerCount\n\t\t), // srcSubresource\n\t\tNewVkOffset3D(a, 0, 0, 0), // offset\n\t\tNewVkExtent3D(a, extent.Width(), extent.Height(), 1), // extent\n\t)\n\n\timgBarriers0Data := alloc(imgBarriers0)\n\tibCopyData := alloc(ibCopy)\n\tbufBarrierData := alloc(bufBarrier)\n\tbiCopyData := alloc(biCopy)\n\timgBarriers1Data := alloc(imgBarriers1)\n\n\twriteEach(ctx, out,\n\t\tcb.VkCmdPipelineBarrier(cmdBuffer,\n\t\t\tallCommandsStage, // srcStageMask\n\t\t\tVkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_TRANSFER_BIT), // dstStageMask\n\t\t\t0, // dependencyFlags\n\t\t\t0, // memoryBarrierCount\n\t\t\tmemory.Nullptr, // pMemoryBarriers\n\t\t\t0, // bufferMemoryBarrierCount\n\t\t\tmemory.Nullptr, // pBufferMemoryBarriers\n\t\t\t2, // imageMemoryBarrierCount\n\t\t\timgBarriers0Data.Ptr(), // pImageMemoryBarriers\n\t\t).AddRead(imgBarriers0Data.Data()),\n\t\tcb.VkCmdCopyImageToBuffer(cmdBuffer,\n\t\t\tsrcImg.VulkanHandle(), // srcImage\n\t\t\tVkImageLayout_VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // srcImageLayout\n\t\t\tcopyBuffer, // dstBuffer\n\t\t\t1, // regionCount\n\t\t\tibCopyData.Ptr(), // pRegions\n\t\t).AddRead(ibCopyData.Data()),\n\t\tcb.VkCmdPipelineBarrier(cmdBuffer,\n\t\t\tVkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_TRANSFER_BIT), // srcStageMask\n\t\t\tVkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_TRANSFER_BIT), // dstStageMask\n\t\t\t0, // dependencyFlags\n\t\t\t0, // memoryBarrierCount\n\t\t\tmemory.Nullptr, // pMemoryBarriers\n\t\t\t1, // bufferMemoryBarrierCount\n\t\t\tbufBarrierData.Ptr(), // pBufferMemoryBarriers\n\t\t\t0, // imageMemoryBarrierCount\n\t\t\tmemory.Nullptr, // pImageMemoryBarriers\n\t\t).AddRead(bufBarrierData.Data()),\n\t\tcb.VkCmdCopyBufferToImage(cmdBuffer,\n\t\t\tcopyBuffer, // srcBuffer\n\t\t\tdstImg.VulkanHandle(), // dstImage\n\t\t\tVkImageLayout_VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // dstImageLayout\n\t\t\t1, // regionCount\n\t\t\tbiCopyData.Ptr(), // pRegions\n\t\t).AddRead(biCopyData.Data()),\n\t\tcb.VkCmdPipelineBarrier(cmdBuffer,\n\t\t\tVkPipelineStageFlags(VkPipelineStageFlagBits_VK_PIPELINE_STAGE_TRANSFER_BIT), // srcStageMask\n\t\t\tallCommandsStage, // dstStageMask\n\t\t\t0, // dependencyFlags\n\t\t\t0, // memoryBarrierCount\n\t\t\tmemory.Nullptr, // pMemoryBarriers\n\t\t\t0, // bufferMemoryBarrierCount\n\t\t\tmemory.Nullptr, // pBufferMemoryBarriers\n\t\t\t2, // imageMemoryBarrierCount\n\t\t\timgBarriers1Data.Ptr(), // pImageMemoryBarriers\n\t\t).AddRead(imgBarriers1Data.Data()),\n\t)\n}", "func (w *WebGLRenderTarget) Copy(source *WebGLRenderTarget) *WebGLRenderTarget {\n\tw.p.Call(\"copy\", source.p)\n\treturn w\n}", "func (debugging *debuggingOpenGL) TexImage2D(target uint32, level int32, internalFormat uint32, width int32, height int32,\n\tborder int32, format uint32, xtype uint32, pixels interface{}) {\n\tdebugging.recordEntry(\"TexImage2D\", target, level, internalFormat, width, height, border, format, xtype, pixels)\n\tdebugging.gl.TexImage2D(target, level, internalFormat, width, height, border, format, xtype, pixels)\n\tdebugging.recordExit(\"TexImage2D\")\n}", "func Copy(i ImageIr) ImageIr {\n\tc := make([][][]uint32, len(i.pixels))\n\tcopy(c, i.pixels)\n\treturn ImageIr{i.width, i.height, c}\n}", "func ClearTexSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, data unsafe.Pointer) {\n C.glowClearTexSubImage(gpClearTexSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), data)\n}" ]
[ "0.7187993", "0.70949566", "0.70949566", "0.708144", "0.708144", "0.70596516", "0.7054913", "0.67202014", "0.6595204", "0.65076804", "0.65076804", "0.64512175", "0.63771796", "0.63712007", "0.6359094", "0.6359094", "0.6334243", "0.6325183", "0.63112533", "0.63112533", "0.6302705", "0.62790334", "0.6275056", "0.6275056", "0.62609875", "0.6257258", "0.6257258", "0.62356967", "0.62356967", "0.6231525", "0.6231525", "0.6225208", "0.6179596", "0.6171186", "0.61664397", "0.61664397", "0.6160316", "0.6146657", "0.61387587", "0.61212903", "0.61169785", "0.61169785", "0.6108922", "0.60923976", "0.60897774", "0.6081194", "0.6072792", "0.6072792", "0.60632414", "0.60632414", "0.60605687", "0.60605687", "0.60472995", "0.60226524", "0.6010495", "0.5983922", "0.5983922", "0.5964952", "0.59475", "0.59307337", "0.59307337", "0.59211874", "0.59087914", "0.589313", "0.589313", "0.5888336", "0.58417827", "0.58100647", "0.5787175", "0.57688576", "0.57660896", "0.5761601", "0.575254", "0.5739825", "0.57214755", "0.57214755", "0.5692504", "0.5692504", "0.56906873", "0.5661127", "0.5624166", "0.5599978", "0.5572948", "0.5572948", "0.5561408", "0.54319286", "0.5425427", "0.54194856", "0.54194856", "0.5403998", "0.54017115", "0.5395289", "0.53816503", "0.53387606", "0.53362775", "0.52835846", "0.52802545", "0.5277008", "0.516684" ]
0.72157633
1
Parameter callback has type C.GLDEBUGPROCAMD.
Параметр callback имеет тип C.GLDEBUGPROCAMD.
func DebugMessageCallbackAMD(callback unsafe.Pointer, userParam unsafe.Pointer) { C.glowDebugMessageCallbackAMD(gpDebugMessageCallbackAMD, (C.GLDEBUGPROCAMD)(callback), userParam) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func DebugMessageCallback(callback DebugProc, userParam unsafe.Pointer) {\n userDebugCallback = callback\n C.glowDebugMessageCallback(gpDebugMessageCallback, (C.GLDEBUGPROC)(unsafe.Pointer(&callback)), userParam)\n}", "func DebugMessageCallbackAMD(callback unsafe.Pointer, userParam unsafe.Pointer) {\n\tsyscall.Syscall(gpDebugMessageCallbackAMD, 2, uintptr(callback), uintptr(userParam), 0)\n}", "func DebugMessageCallback(callback DebugProc, userParam unsafe.Pointer) {\n\tuserDebugCallback = callback\n\tC.glowDebugMessageCallback(gpDebugMessageCallback, (C.GLDEBUGPROC)(unsafe.Pointer(&callback)), userParam)\n}", "func DebugMessageCallback(callback DebugProc, userParam unsafe.Pointer) {\n\tuserDebugCallback = callback\n\tC.glowDebugMessageCallback(gpDebugMessageCallback, (C.GLDEBUGPROC)(unsafe.Pointer(&callback)), userParam)\n}", "func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {\n\tgpActiveProgramEXT = (C.GPACTIVEPROGRAMEXT)(getProcAddr(\"glActiveProgramEXT\"))\n\tgpActiveShaderProgram = (C.GPACTIVESHADERPROGRAM)(getProcAddr(\"glActiveShaderProgram\"))\n\tif gpActiveShaderProgram == nil {\n\t\treturn errors.New(\"glActiveShaderProgram\")\n\t}\n\tgpActiveShaderProgramEXT = (C.GPACTIVESHADERPROGRAMEXT)(getProcAddr(\"glActiveShaderProgramEXT\"))\n\tgpActiveTexture = (C.GPACTIVETEXTURE)(getProcAddr(\"glActiveTexture\"))\n\tif gpActiveTexture == nil {\n\t\treturn errors.New(\"glActiveTexture\")\n\t}\n\tgpApplyFramebufferAttachmentCMAAINTEL = (C.GPAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL)(getProcAddr(\"glApplyFramebufferAttachmentCMAAINTEL\"))\n\tgpAttachShader = (C.GPATTACHSHADER)(getProcAddr(\"glAttachShader\"))\n\tif gpAttachShader == nil {\n\t\treturn errors.New(\"glAttachShader\")\n\t}\n\tgpBeginConditionalRender = (C.GPBEGINCONDITIONALRENDER)(getProcAddr(\"glBeginConditionalRender\"))\n\tif gpBeginConditionalRender == nil {\n\t\treturn errors.New(\"glBeginConditionalRender\")\n\t}\n\tgpBeginConditionalRenderNV = (C.GPBEGINCONDITIONALRENDERNV)(getProcAddr(\"glBeginConditionalRenderNV\"))\n\tgpBeginPerfMonitorAMD = (C.GPBEGINPERFMONITORAMD)(getProcAddr(\"glBeginPerfMonitorAMD\"))\n\tgpBeginPerfQueryINTEL = (C.GPBEGINPERFQUERYINTEL)(getProcAddr(\"glBeginPerfQueryINTEL\"))\n\tgpBeginQuery = (C.GPBEGINQUERY)(getProcAddr(\"glBeginQuery\"))\n\tif gpBeginQuery == nil {\n\t\treturn errors.New(\"glBeginQuery\")\n\t}\n\tgpBeginQueryIndexed = (C.GPBEGINQUERYINDEXED)(getProcAddr(\"glBeginQueryIndexed\"))\n\tif gpBeginQueryIndexed == nil {\n\t\treturn errors.New(\"glBeginQueryIndexed\")\n\t}\n\tgpBeginTransformFeedback = (C.GPBEGINTRANSFORMFEEDBACK)(getProcAddr(\"glBeginTransformFeedback\"))\n\tif gpBeginTransformFeedback == nil {\n\t\treturn errors.New(\"glBeginTransformFeedback\")\n\t}\n\tgpBindAttribLocation = (C.GPBINDATTRIBLOCATION)(getProcAddr(\"glBindAttribLocation\"))\n\tif gpBindAttribLocation == nil {\n\t\treturn errors.New(\"glBindAttribLocation\")\n\t}\n\tgpBindBuffer = (C.GPBINDBUFFER)(getProcAddr(\"glBindBuffer\"))\n\tif gpBindBuffer == nil {\n\t\treturn errors.New(\"glBindBuffer\")\n\t}\n\tgpBindBufferBase = (C.GPBINDBUFFERBASE)(getProcAddr(\"glBindBufferBase\"))\n\tif gpBindBufferBase == nil {\n\t\treturn errors.New(\"glBindBufferBase\")\n\t}\n\tgpBindBufferRange = (C.GPBINDBUFFERRANGE)(getProcAddr(\"glBindBufferRange\"))\n\tif gpBindBufferRange == nil {\n\t\treturn errors.New(\"glBindBufferRange\")\n\t}\n\tgpBindBuffersBase = (C.GPBINDBUFFERSBASE)(getProcAddr(\"glBindBuffersBase\"))\n\tgpBindBuffersRange = (C.GPBINDBUFFERSRANGE)(getProcAddr(\"glBindBuffersRange\"))\n\tgpBindFragDataLocation = (C.GPBINDFRAGDATALOCATION)(getProcAddr(\"glBindFragDataLocation\"))\n\tif gpBindFragDataLocation == nil {\n\t\treturn errors.New(\"glBindFragDataLocation\")\n\t}\n\tgpBindFragDataLocationIndexed = (C.GPBINDFRAGDATALOCATIONINDEXED)(getProcAddr(\"glBindFragDataLocationIndexed\"))\n\tif gpBindFragDataLocationIndexed == nil {\n\t\treturn errors.New(\"glBindFragDataLocationIndexed\")\n\t}\n\tgpBindFramebuffer = (C.GPBINDFRAMEBUFFER)(getProcAddr(\"glBindFramebuffer\"))\n\tif gpBindFramebuffer == nil {\n\t\treturn errors.New(\"glBindFramebuffer\")\n\t}\n\tgpBindImageTexture = (C.GPBINDIMAGETEXTURE)(getProcAddr(\"glBindImageTexture\"))\n\tif gpBindImageTexture == nil {\n\t\treturn errors.New(\"glBindImageTexture\")\n\t}\n\tgpBindImageTextures = (C.GPBINDIMAGETEXTURES)(getProcAddr(\"glBindImageTextures\"))\n\tgpBindMultiTextureEXT = (C.GPBINDMULTITEXTUREEXT)(getProcAddr(\"glBindMultiTextureEXT\"))\n\tgpBindProgramPipeline = (C.GPBINDPROGRAMPIPELINE)(getProcAddr(\"glBindProgramPipeline\"))\n\tif gpBindProgramPipeline == nil {\n\t\treturn errors.New(\"glBindProgramPipeline\")\n\t}\n\tgpBindProgramPipelineEXT = (C.GPBINDPROGRAMPIPELINEEXT)(getProcAddr(\"glBindProgramPipelineEXT\"))\n\tgpBindRenderbuffer = (C.GPBINDRENDERBUFFER)(getProcAddr(\"glBindRenderbuffer\"))\n\tif gpBindRenderbuffer == nil {\n\t\treturn errors.New(\"glBindRenderbuffer\")\n\t}\n\tgpBindSampler = (C.GPBINDSAMPLER)(getProcAddr(\"glBindSampler\"))\n\tif gpBindSampler == nil {\n\t\treturn errors.New(\"glBindSampler\")\n\t}\n\tgpBindSamplers = (C.GPBINDSAMPLERS)(getProcAddr(\"glBindSamplers\"))\n\tgpBindShadingRateImageNV = (C.GPBINDSHADINGRATEIMAGENV)(getProcAddr(\"glBindShadingRateImageNV\"))\n\tgpBindTexture = (C.GPBINDTEXTURE)(getProcAddr(\"glBindTexture\"))\n\tif gpBindTexture == nil {\n\t\treturn errors.New(\"glBindTexture\")\n\t}\n\tgpBindTextureUnit = (C.GPBINDTEXTUREUNIT)(getProcAddr(\"glBindTextureUnit\"))\n\tgpBindTextures = (C.GPBINDTEXTURES)(getProcAddr(\"glBindTextures\"))\n\tgpBindTransformFeedback = (C.GPBINDTRANSFORMFEEDBACK)(getProcAddr(\"glBindTransformFeedback\"))\n\tif gpBindTransformFeedback == nil {\n\t\treturn errors.New(\"glBindTransformFeedback\")\n\t}\n\tgpBindVertexArray = (C.GPBINDVERTEXARRAY)(getProcAddr(\"glBindVertexArray\"))\n\tif gpBindVertexArray == nil {\n\t\treturn errors.New(\"glBindVertexArray\")\n\t}\n\tgpBindVertexBuffer = (C.GPBINDVERTEXBUFFER)(getProcAddr(\"glBindVertexBuffer\"))\n\tgpBindVertexBuffers = (C.GPBINDVERTEXBUFFERS)(getProcAddr(\"glBindVertexBuffers\"))\n\tgpBlendBarrierKHR = (C.GPBLENDBARRIERKHR)(getProcAddr(\"glBlendBarrierKHR\"))\n\tgpBlendBarrierNV = (C.GPBLENDBARRIERNV)(getProcAddr(\"glBlendBarrierNV\"))\n\tgpBlendColor = (C.GPBLENDCOLOR)(getProcAddr(\"glBlendColor\"))\n\tif gpBlendColor == nil {\n\t\treturn errors.New(\"glBlendColor\")\n\t}\n\tgpBlendEquation = (C.GPBLENDEQUATION)(getProcAddr(\"glBlendEquation\"))\n\tif gpBlendEquation == nil {\n\t\treturn errors.New(\"glBlendEquation\")\n\t}\n\tgpBlendEquationSeparate = (C.GPBLENDEQUATIONSEPARATE)(getProcAddr(\"glBlendEquationSeparate\"))\n\tif gpBlendEquationSeparate == nil {\n\t\treturn errors.New(\"glBlendEquationSeparate\")\n\t}\n\tgpBlendEquationSeparatei = (C.GPBLENDEQUATIONSEPARATEI)(getProcAddr(\"glBlendEquationSeparatei\"))\n\tif gpBlendEquationSeparatei == nil {\n\t\treturn errors.New(\"glBlendEquationSeparatei\")\n\t}\n\tgpBlendEquationSeparateiARB = (C.GPBLENDEQUATIONSEPARATEIARB)(getProcAddr(\"glBlendEquationSeparateiARB\"))\n\tgpBlendEquationi = (C.GPBLENDEQUATIONI)(getProcAddr(\"glBlendEquationi\"))\n\tif gpBlendEquationi == nil {\n\t\treturn errors.New(\"glBlendEquationi\")\n\t}\n\tgpBlendEquationiARB = (C.GPBLENDEQUATIONIARB)(getProcAddr(\"glBlendEquationiARB\"))\n\tgpBlendFunc = (C.GPBLENDFUNC)(getProcAddr(\"glBlendFunc\"))\n\tif gpBlendFunc == nil {\n\t\treturn errors.New(\"glBlendFunc\")\n\t}\n\tgpBlendFuncSeparate = (C.GPBLENDFUNCSEPARATE)(getProcAddr(\"glBlendFuncSeparate\"))\n\tif gpBlendFuncSeparate == nil {\n\t\treturn errors.New(\"glBlendFuncSeparate\")\n\t}\n\tgpBlendFuncSeparatei = (C.GPBLENDFUNCSEPARATEI)(getProcAddr(\"glBlendFuncSeparatei\"))\n\tif gpBlendFuncSeparatei == nil {\n\t\treturn errors.New(\"glBlendFuncSeparatei\")\n\t}\n\tgpBlendFuncSeparateiARB = (C.GPBLENDFUNCSEPARATEIARB)(getProcAddr(\"glBlendFuncSeparateiARB\"))\n\tgpBlendFunci = (C.GPBLENDFUNCI)(getProcAddr(\"glBlendFunci\"))\n\tif gpBlendFunci == nil {\n\t\treturn errors.New(\"glBlendFunci\")\n\t}\n\tgpBlendFunciARB = (C.GPBLENDFUNCIARB)(getProcAddr(\"glBlendFunciARB\"))\n\tgpBlendParameteriNV = (C.GPBLENDPARAMETERINV)(getProcAddr(\"glBlendParameteriNV\"))\n\tgpBlitFramebuffer = (C.GPBLITFRAMEBUFFER)(getProcAddr(\"glBlitFramebuffer\"))\n\tif gpBlitFramebuffer == nil {\n\t\treturn errors.New(\"glBlitFramebuffer\")\n\t}\n\tgpBlitNamedFramebuffer = (C.GPBLITNAMEDFRAMEBUFFER)(getProcAddr(\"glBlitNamedFramebuffer\"))\n\tgpBufferAddressRangeNV = (C.GPBUFFERADDRESSRANGENV)(getProcAddr(\"glBufferAddressRangeNV\"))\n\tgpBufferAttachMemoryNV = (C.GPBUFFERATTACHMEMORYNV)(getProcAddr(\"glBufferAttachMemoryNV\"))\n\tgpBufferData = (C.GPBUFFERDATA)(getProcAddr(\"glBufferData\"))\n\tif gpBufferData == nil {\n\t\treturn errors.New(\"glBufferData\")\n\t}\n\tgpBufferPageCommitmentARB = (C.GPBUFFERPAGECOMMITMENTARB)(getProcAddr(\"glBufferPageCommitmentARB\"))\n\tgpBufferPageCommitmentMemNV = (C.GPBUFFERPAGECOMMITMENTMEMNV)(getProcAddr(\"glBufferPageCommitmentMemNV\"))\n\tgpBufferStorage = (C.GPBUFFERSTORAGE)(getProcAddr(\"glBufferStorage\"))\n\tgpBufferSubData = (C.GPBUFFERSUBDATA)(getProcAddr(\"glBufferSubData\"))\n\tif gpBufferSubData == nil {\n\t\treturn errors.New(\"glBufferSubData\")\n\t}\n\tgpCallCommandListNV = (C.GPCALLCOMMANDLISTNV)(getProcAddr(\"glCallCommandListNV\"))\n\tgpCheckFramebufferStatus = (C.GPCHECKFRAMEBUFFERSTATUS)(getProcAddr(\"glCheckFramebufferStatus\"))\n\tif gpCheckFramebufferStatus == nil {\n\t\treturn errors.New(\"glCheckFramebufferStatus\")\n\t}\n\tgpCheckNamedFramebufferStatus = (C.GPCHECKNAMEDFRAMEBUFFERSTATUS)(getProcAddr(\"glCheckNamedFramebufferStatus\"))\n\tgpCheckNamedFramebufferStatusEXT = (C.GPCHECKNAMEDFRAMEBUFFERSTATUSEXT)(getProcAddr(\"glCheckNamedFramebufferStatusEXT\"))\n\tgpClampColor = (C.GPCLAMPCOLOR)(getProcAddr(\"glClampColor\"))\n\tif gpClampColor == nil {\n\t\treturn errors.New(\"glClampColor\")\n\t}\n\tgpClear = (C.GPCLEAR)(getProcAddr(\"glClear\"))\n\tif gpClear == nil {\n\t\treturn errors.New(\"glClear\")\n\t}\n\tgpClearBufferData = (C.GPCLEARBUFFERDATA)(getProcAddr(\"glClearBufferData\"))\n\tgpClearBufferSubData = (C.GPCLEARBUFFERSUBDATA)(getProcAddr(\"glClearBufferSubData\"))\n\tgpClearBufferfi = (C.GPCLEARBUFFERFI)(getProcAddr(\"glClearBufferfi\"))\n\tif gpClearBufferfi == nil {\n\t\treturn errors.New(\"glClearBufferfi\")\n\t}\n\tgpClearBufferfv = (C.GPCLEARBUFFERFV)(getProcAddr(\"glClearBufferfv\"))\n\tif gpClearBufferfv == nil {\n\t\treturn errors.New(\"glClearBufferfv\")\n\t}\n\tgpClearBufferiv = (C.GPCLEARBUFFERIV)(getProcAddr(\"glClearBufferiv\"))\n\tif gpClearBufferiv == nil {\n\t\treturn errors.New(\"glClearBufferiv\")\n\t}\n\tgpClearBufferuiv = (C.GPCLEARBUFFERUIV)(getProcAddr(\"glClearBufferuiv\"))\n\tif gpClearBufferuiv == nil {\n\t\treturn errors.New(\"glClearBufferuiv\")\n\t}\n\tgpClearColor = (C.GPCLEARCOLOR)(getProcAddr(\"glClearColor\"))\n\tif gpClearColor == nil {\n\t\treturn errors.New(\"glClearColor\")\n\t}\n\tgpClearDepth = (C.GPCLEARDEPTH)(getProcAddr(\"glClearDepth\"))\n\tif gpClearDepth == nil {\n\t\treturn errors.New(\"glClearDepth\")\n\t}\n\tgpClearDepthdNV = (C.GPCLEARDEPTHDNV)(getProcAddr(\"glClearDepthdNV\"))\n\tgpClearDepthf = (C.GPCLEARDEPTHF)(getProcAddr(\"glClearDepthf\"))\n\tif gpClearDepthf == nil {\n\t\treturn errors.New(\"glClearDepthf\")\n\t}\n\tgpClearNamedBufferData = (C.GPCLEARNAMEDBUFFERDATA)(getProcAddr(\"glClearNamedBufferData\"))\n\tgpClearNamedBufferDataEXT = (C.GPCLEARNAMEDBUFFERDATAEXT)(getProcAddr(\"glClearNamedBufferDataEXT\"))\n\tgpClearNamedBufferSubData = (C.GPCLEARNAMEDBUFFERSUBDATA)(getProcAddr(\"glClearNamedBufferSubData\"))\n\tgpClearNamedBufferSubDataEXT = (C.GPCLEARNAMEDBUFFERSUBDATAEXT)(getProcAddr(\"glClearNamedBufferSubDataEXT\"))\n\tgpClearNamedFramebufferfi = (C.GPCLEARNAMEDFRAMEBUFFERFI)(getProcAddr(\"glClearNamedFramebufferfi\"))\n\tgpClearNamedFramebufferfv = (C.GPCLEARNAMEDFRAMEBUFFERFV)(getProcAddr(\"glClearNamedFramebufferfv\"))\n\tgpClearNamedFramebufferiv = (C.GPCLEARNAMEDFRAMEBUFFERIV)(getProcAddr(\"glClearNamedFramebufferiv\"))\n\tgpClearNamedFramebufferuiv = (C.GPCLEARNAMEDFRAMEBUFFERUIV)(getProcAddr(\"glClearNamedFramebufferuiv\"))\n\tgpClearStencil = (C.GPCLEARSTENCIL)(getProcAddr(\"glClearStencil\"))\n\tif gpClearStencil == nil {\n\t\treturn errors.New(\"glClearStencil\")\n\t}\n\tgpClearTexImage = (C.GPCLEARTEXIMAGE)(getProcAddr(\"glClearTexImage\"))\n\tgpClearTexSubImage = (C.GPCLEARTEXSUBIMAGE)(getProcAddr(\"glClearTexSubImage\"))\n\tgpClientAttribDefaultEXT = (C.GPCLIENTATTRIBDEFAULTEXT)(getProcAddr(\"glClientAttribDefaultEXT\"))\n\tgpClientWaitSync = (C.GPCLIENTWAITSYNC)(getProcAddr(\"glClientWaitSync\"))\n\tif gpClientWaitSync == nil {\n\t\treturn errors.New(\"glClientWaitSync\")\n\t}\n\tgpClipControl = (C.GPCLIPCONTROL)(getProcAddr(\"glClipControl\"))\n\tgpColorFormatNV = (C.GPCOLORFORMATNV)(getProcAddr(\"glColorFormatNV\"))\n\tgpColorMask = (C.GPCOLORMASK)(getProcAddr(\"glColorMask\"))\n\tif gpColorMask == nil {\n\t\treturn errors.New(\"glColorMask\")\n\t}\n\tgpColorMaski = (C.GPCOLORMASKI)(getProcAddr(\"glColorMaski\"))\n\tif gpColorMaski == nil {\n\t\treturn errors.New(\"glColorMaski\")\n\t}\n\tgpCommandListSegmentsNV = (C.GPCOMMANDLISTSEGMENTSNV)(getProcAddr(\"glCommandListSegmentsNV\"))\n\tgpCompileCommandListNV = (C.GPCOMPILECOMMANDLISTNV)(getProcAddr(\"glCompileCommandListNV\"))\n\tgpCompileShader = (C.GPCOMPILESHADER)(getProcAddr(\"glCompileShader\"))\n\tif gpCompileShader == nil {\n\t\treturn errors.New(\"glCompileShader\")\n\t}\n\tgpCompileShaderIncludeARB = (C.GPCOMPILESHADERINCLUDEARB)(getProcAddr(\"glCompileShaderIncludeARB\"))\n\tgpCompressedMultiTexImage1DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE1DEXT)(getProcAddr(\"glCompressedMultiTexImage1DEXT\"))\n\tgpCompressedMultiTexImage2DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE2DEXT)(getProcAddr(\"glCompressedMultiTexImage2DEXT\"))\n\tgpCompressedMultiTexImage3DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE3DEXT)(getProcAddr(\"glCompressedMultiTexImage3DEXT\"))\n\tgpCompressedMultiTexSubImage1DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE1DEXT)(getProcAddr(\"glCompressedMultiTexSubImage1DEXT\"))\n\tgpCompressedMultiTexSubImage2DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE2DEXT)(getProcAddr(\"glCompressedMultiTexSubImage2DEXT\"))\n\tgpCompressedMultiTexSubImage3DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE3DEXT)(getProcAddr(\"glCompressedMultiTexSubImage3DEXT\"))\n\tgpCompressedTexImage1D = (C.GPCOMPRESSEDTEXIMAGE1D)(getProcAddr(\"glCompressedTexImage1D\"))\n\tif gpCompressedTexImage1D == nil {\n\t\treturn errors.New(\"glCompressedTexImage1D\")\n\t}\n\tgpCompressedTexImage2D = (C.GPCOMPRESSEDTEXIMAGE2D)(getProcAddr(\"glCompressedTexImage2D\"))\n\tif gpCompressedTexImage2D == nil {\n\t\treturn errors.New(\"glCompressedTexImage2D\")\n\t}\n\tgpCompressedTexImage3D = (C.GPCOMPRESSEDTEXIMAGE3D)(getProcAddr(\"glCompressedTexImage3D\"))\n\tif gpCompressedTexImage3D == nil {\n\t\treturn errors.New(\"glCompressedTexImage3D\")\n\t}\n\tgpCompressedTexSubImage1D = (C.GPCOMPRESSEDTEXSUBIMAGE1D)(getProcAddr(\"glCompressedTexSubImage1D\"))\n\tif gpCompressedTexSubImage1D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage1D\")\n\t}\n\tgpCompressedTexSubImage2D = (C.GPCOMPRESSEDTEXSUBIMAGE2D)(getProcAddr(\"glCompressedTexSubImage2D\"))\n\tif gpCompressedTexSubImage2D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage2D\")\n\t}\n\tgpCompressedTexSubImage3D = (C.GPCOMPRESSEDTEXSUBIMAGE3D)(getProcAddr(\"glCompressedTexSubImage3D\"))\n\tif gpCompressedTexSubImage3D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage3D\")\n\t}\n\tgpCompressedTextureImage1DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE1DEXT)(getProcAddr(\"glCompressedTextureImage1DEXT\"))\n\tgpCompressedTextureImage2DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE2DEXT)(getProcAddr(\"glCompressedTextureImage2DEXT\"))\n\tgpCompressedTextureImage3DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE3DEXT)(getProcAddr(\"glCompressedTextureImage3DEXT\"))\n\tgpCompressedTextureSubImage1D = (C.GPCOMPRESSEDTEXTURESUBIMAGE1D)(getProcAddr(\"glCompressedTextureSubImage1D\"))\n\tgpCompressedTextureSubImage1DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE1DEXT)(getProcAddr(\"glCompressedTextureSubImage1DEXT\"))\n\tgpCompressedTextureSubImage2D = (C.GPCOMPRESSEDTEXTURESUBIMAGE2D)(getProcAddr(\"glCompressedTextureSubImage2D\"))\n\tgpCompressedTextureSubImage2DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE2DEXT)(getProcAddr(\"glCompressedTextureSubImage2DEXT\"))\n\tgpCompressedTextureSubImage3D = (C.GPCOMPRESSEDTEXTURESUBIMAGE3D)(getProcAddr(\"glCompressedTextureSubImage3D\"))\n\tgpCompressedTextureSubImage3DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE3DEXT)(getProcAddr(\"glCompressedTextureSubImage3DEXT\"))\n\tgpConservativeRasterParameterfNV = (C.GPCONSERVATIVERASTERPARAMETERFNV)(getProcAddr(\"glConservativeRasterParameterfNV\"))\n\tgpConservativeRasterParameteriNV = (C.GPCONSERVATIVERASTERPARAMETERINV)(getProcAddr(\"glConservativeRasterParameteriNV\"))\n\tgpCopyBufferSubData = (C.GPCOPYBUFFERSUBDATA)(getProcAddr(\"glCopyBufferSubData\"))\n\tif gpCopyBufferSubData == nil {\n\t\treturn errors.New(\"glCopyBufferSubData\")\n\t}\n\tgpCopyImageSubData = (C.GPCOPYIMAGESUBDATA)(getProcAddr(\"glCopyImageSubData\"))\n\tgpCopyMultiTexImage1DEXT = (C.GPCOPYMULTITEXIMAGE1DEXT)(getProcAddr(\"glCopyMultiTexImage1DEXT\"))\n\tgpCopyMultiTexImage2DEXT = (C.GPCOPYMULTITEXIMAGE2DEXT)(getProcAddr(\"glCopyMultiTexImage2DEXT\"))\n\tgpCopyMultiTexSubImage1DEXT = (C.GPCOPYMULTITEXSUBIMAGE1DEXT)(getProcAddr(\"glCopyMultiTexSubImage1DEXT\"))\n\tgpCopyMultiTexSubImage2DEXT = (C.GPCOPYMULTITEXSUBIMAGE2DEXT)(getProcAddr(\"glCopyMultiTexSubImage2DEXT\"))\n\tgpCopyMultiTexSubImage3DEXT = (C.GPCOPYMULTITEXSUBIMAGE3DEXT)(getProcAddr(\"glCopyMultiTexSubImage3DEXT\"))\n\tgpCopyNamedBufferSubData = (C.GPCOPYNAMEDBUFFERSUBDATA)(getProcAddr(\"glCopyNamedBufferSubData\"))\n\tgpCopyPathNV = (C.GPCOPYPATHNV)(getProcAddr(\"glCopyPathNV\"))\n\tgpCopyTexImage1D = (C.GPCOPYTEXIMAGE1D)(getProcAddr(\"glCopyTexImage1D\"))\n\tif gpCopyTexImage1D == nil {\n\t\treturn errors.New(\"glCopyTexImage1D\")\n\t}\n\tgpCopyTexImage2D = (C.GPCOPYTEXIMAGE2D)(getProcAddr(\"glCopyTexImage2D\"))\n\tif gpCopyTexImage2D == nil {\n\t\treturn errors.New(\"glCopyTexImage2D\")\n\t}\n\tgpCopyTexSubImage1D = (C.GPCOPYTEXSUBIMAGE1D)(getProcAddr(\"glCopyTexSubImage1D\"))\n\tif gpCopyTexSubImage1D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage1D\")\n\t}\n\tgpCopyTexSubImage2D = (C.GPCOPYTEXSUBIMAGE2D)(getProcAddr(\"glCopyTexSubImage2D\"))\n\tif gpCopyTexSubImage2D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage2D\")\n\t}\n\tgpCopyTexSubImage3D = (C.GPCOPYTEXSUBIMAGE3D)(getProcAddr(\"glCopyTexSubImage3D\"))\n\tif gpCopyTexSubImage3D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage3D\")\n\t}\n\tgpCopyTextureImage1DEXT = (C.GPCOPYTEXTUREIMAGE1DEXT)(getProcAddr(\"glCopyTextureImage1DEXT\"))\n\tgpCopyTextureImage2DEXT = (C.GPCOPYTEXTUREIMAGE2DEXT)(getProcAddr(\"glCopyTextureImage2DEXT\"))\n\tgpCopyTextureSubImage1D = (C.GPCOPYTEXTURESUBIMAGE1D)(getProcAddr(\"glCopyTextureSubImage1D\"))\n\tgpCopyTextureSubImage1DEXT = (C.GPCOPYTEXTURESUBIMAGE1DEXT)(getProcAddr(\"glCopyTextureSubImage1DEXT\"))\n\tgpCopyTextureSubImage2D = (C.GPCOPYTEXTURESUBIMAGE2D)(getProcAddr(\"glCopyTextureSubImage2D\"))\n\tgpCopyTextureSubImage2DEXT = (C.GPCOPYTEXTURESUBIMAGE2DEXT)(getProcAddr(\"glCopyTextureSubImage2DEXT\"))\n\tgpCopyTextureSubImage3D = (C.GPCOPYTEXTURESUBIMAGE3D)(getProcAddr(\"glCopyTextureSubImage3D\"))\n\tgpCopyTextureSubImage3DEXT = (C.GPCOPYTEXTURESUBIMAGE3DEXT)(getProcAddr(\"glCopyTextureSubImage3DEXT\"))\n\tgpCoverFillPathInstancedNV = (C.GPCOVERFILLPATHINSTANCEDNV)(getProcAddr(\"glCoverFillPathInstancedNV\"))\n\tgpCoverFillPathNV = (C.GPCOVERFILLPATHNV)(getProcAddr(\"glCoverFillPathNV\"))\n\tgpCoverStrokePathInstancedNV = (C.GPCOVERSTROKEPATHINSTANCEDNV)(getProcAddr(\"glCoverStrokePathInstancedNV\"))\n\tgpCoverStrokePathNV = (C.GPCOVERSTROKEPATHNV)(getProcAddr(\"glCoverStrokePathNV\"))\n\tgpCoverageModulationNV = (C.GPCOVERAGEMODULATIONNV)(getProcAddr(\"glCoverageModulationNV\"))\n\tgpCoverageModulationTableNV = (C.GPCOVERAGEMODULATIONTABLENV)(getProcAddr(\"glCoverageModulationTableNV\"))\n\tgpCreateBuffers = (C.GPCREATEBUFFERS)(getProcAddr(\"glCreateBuffers\"))\n\tgpCreateCommandListsNV = (C.GPCREATECOMMANDLISTSNV)(getProcAddr(\"glCreateCommandListsNV\"))\n\tgpCreateFramebuffers = (C.GPCREATEFRAMEBUFFERS)(getProcAddr(\"glCreateFramebuffers\"))\n\tgpCreatePerfQueryINTEL = (C.GPCREATEPERFQUERYINTEL)(getProcAddr(\"glCreatePerfQueryINTEL\"))\n\tgpCreateProgram = (C.GPCREATEPROGRAM)(getProcAddr(\"glCreateProgram\"))\n\tif gpCreateProgram == nil {\n\t\treturn errors.New(\"glCreateProgram\")\n\t}\n\tgpCreateProgramPipelines = (C.GPCREATEPROGRAMPIPELINES)(getProcAddr(\"glCreateProgramPipelines\"))\n\tgpCreateQueries = (C.GPCREATEQUERIES)(getProcAddr(\"glCreateQueries\"))\n\tgpCreateRenderbuffers = (C.GPCREATERENDERBUFFERS)(getProcAddr(\"glCreateRenderbuffers\"))\n\tgpCreateSamplers = (C.GPCREATESAMPLERS)(getProcAddr(\"glCreateSamplers\"))\n\tgpCreateShader = (C.GPCREATESHADER)(getProcAddr(\"glCreateShader\"))\n\tif gpCreateShader == nil {\n\t\treturn errors.New(\"glCreateShader\")\n\t}\n\tgpCreateShaderProgramEXT = (C.GPCREATESHADERPROGRAMEXT)(getProcAddr(\"glCreateShaderProgramEXT\"))\n\tgpCreateShaderProgramv = (C.GPCREATESHADERPROGRAMV)(getProcAddr(\"glCreateShaderProgramv\"))\n\tif gpCreateShaderProgramv == nil {\n\t\treturn errors.New(\"glCreateShaderProgramv\")\n\t}\n\tgpCreateShaderProgramvEXT = (C.GPCREATESHADERPROGRAMVEXT)(getProcAddr(\"glCreateShaderProgramvEXT\"))\n\tgpCreateStatesNV = (C.GPCREATESTATESNV)(getProcAddr(\"glCreateStatesNV\"))\n\tgpCreateSyncFromCLeventARB = (C.GPCREATESYNCFROMCLEVENTARB)(getProcAddr(\"glCreateSyncFromCLeventARB\"))\n\tgpCreateTextures = (C.GPCREATETEXTURES)(getProcAddr(\"glCreateTextures\"))\n\tgpCreateTransformFeedbacks = (C.GPCREATETRANSFORMFEEDBACKS)(getProcAddr(\"glCreateTransformFeedbacks\"))\n\tgpCreateVertexArrays = (C.GPCREATEVERTEXARRAYS)(getProcAddr(\"glCreateVertexArrays\"))\n\tgpCullFace = (C.GPCULLFACE)(getProcAddr(\"glCullFace\"))\n\tif gpCullFace == nil {\n\t\treturn errors.New(\"glCullFace\")\n\t}\n\tgpDebugMessageCallback = (C.GPDEBUGMESSAGECALLBACK)(getProcAddr(\"glDebugMessageCallback\"))\n\tgpDebugMessageCallbackARB = (C.GPDEBUGMESSAGECALLBACKARB)(getProcAddr(\"glDebugMessageCallbackARB\"))\n\tgpDebugMessageCallbackKHR = (C.GPDEBUGMESSAGECALLBACKKHR)(getProcAddr(\"glDebugMessageCallbackKHR\"))\n\tgpDebugMessageControl = (C.GPDEBUGMESSAGECONTROL)(getProcAddr(\"glDebugMessageControl\"))\n\tgpDebugMessageControlARB = (C.GPDEBUGMESSAGECONTROLARB)(getProcAddr(\"glDebugMessageControlARB\"))\n\tgpDebugMessageControlKHR = (C.GPDEBUGMESSAGECONTROLKHR)(getProcAddr(\"glDebugMessageControlKHR\"))\n\tgpDebugMessageInsert = (C.GPDEBUGMESSAGEINSERT)(getProcAddr(\"glDebugMessageInsert\"))\n\tgpDebugMessageInsertARB = (C.GPDEBUGMESSAGEINSERTARB)(getProcAddr(\"glDebugMessageInsertARB\"))\n\tgpDebugMessageInsertKHR = (C.GPDEBUGMESSAGEINSERTKHR)(getProcAddr(\"glDebugMessageInsertKHR\"))\n\tgpDeleteBuffers = (C.GPDELETEBUFFERS)(getProcAddr(\"glDeleteBuffers\"))\n\tif gpDeleteBuffers == nil {\n\t\treturn errors.New(\"glDeleteBuffers\")\n\t}\n\tgpDeleteCommandListsNV = (C.GPDELETECOMMANDLISTSNV)(getProcAddr(\"glDeleteCommandListsNV\"))\n\tgpDeleteFramebuffers = (C.GPDELETEFRAMEBUFFERS)(getProcAddr(\"glDeleteFramebuffers\"))\n\tif gpDeleteFramebuffers == nil {\n\t\treturn errors.New(\"glDeleteFramebuffers\")\n\t}\n\tgpDeleteNamedStringARB = (C.GPDELETENAMEDSTRINGARB)(getProcAddr(\"glDeleteNamedStringARB\"))\n\tgpDeletePathsNV = (C.GPDELETEPATHSNV)(getProcAddr(\"glDeletePathsNV\"))\n\tgpDeletePerfMonitorsAMD = (C.GPDELETEPERFMONITORSAMD)(getProcAddr(\"glDeletePerfMonitorsAMD\"))\n\tgpDeletePerfQueryINTEL = (C.GPDELETEPERFQUERYINTEL)(getProcAddr(\"glDeletePerfQueryINTEL\"))\n\tgpDeleteProgram = (C.GPDELETEPROGRAM)(getProcAddr(\"glDeleteProgram\"))\n\tif gpDeleteProgram == nil {\n\t\treturn errors.New(\"glDeleteProgram\")\n\t}\n\tgpDeleteProgramPipelines = (C.GPDELETEPROGRAMPIPELINES)(getProcAddr(\"glDeleteProgramPipelines\"))\n\tif gpDeleteProgramPipelines == nil {\n\t\treturn errors.New(\"glDeleteProgramPipelines\")\n\t}\n\tgpDeleteProgramPipelinesEXT = (C.GPDELETEPROGRAMPIPELINESEXT)(getProcAddr(\"glDeleteProgramPipelinesEXT\"))\n\tgpDeleteQueries = (C.GPDELETEQUERIES)(getProcAddr(\"glDeleteQueries\"))\n\tif gpDeleteQueries == nil {\n\t\treturn errors.New(\"glDeleteQueries\")\n\t}\n\tgpDeleteRenderbuffers = (C.GPDELETERENDERBUFFERS)(getProcAddr(\"glDeleteRenderbuffers\"))\n\tif gpDeleteRenderbuffers == nil {\n\t\treturn errors.New(\"glDeleteRenderbuffers\")\n\t}\n\tgpDeleteSamplers = (C.GPDELETESAMPLERS)(getProcAddr(\"glDeleteSamplers\"))\n\tif gpDeleteSamplers == nil {\n\t\treturn errors.New(\"glDeleteSamplers\")\n\t}\n\tgpDeleteShader = (C.GPDELETESHADER)(getProcAddr(\"glDeleteShader\"))\n\tif gpDeleteShader == nil {\n\t\treturn errors.New(\"glDeleteShader\")\n\t}\n\tgpDeleteStatesNV = (C.GPDELETESTATESNV)(getProcAddr(\"glDeleteStatesNV\"))\n\tgpDeleteSync = (C.GPDELETESYNC)(getProcAddr(\"glDeleteSync\"))\n\tif gpDeleteSync == nil {\n\t\treturn errors.New(\"glDeleteSync\")\n\t}\n\tgpDeleteTextures = (C.GPDELETETEXTURES)(getProcAddr(\"glDeleteTextures\"))\n\tif gpDeleteTextures == nil {\n\t\treturn errors.New(\"glDeleteTextures\")\n\t}\n\tgpDeleteTransformFeedbacks = (C.GPDELETETRANSFORMFEEDBACKS)(getProcAddr(\"glDeleteTransformFeedbacks\"))\n\tif gpDeleteTransformFeedbacks == nil {\n\t\treturn errors.New(\"glDeleteTransformFeedbacks\")\n\t}\n\tgpDeleteVertexArrays = (C.GPDELETEVERTEXARRAYS)(getProcAddr(\"glDeleteVertexArrays\"))\n\tif gpDeleteVertexArrays == nil {\n\t\treturn errors.New(\"glDeleteVertexArrays\")\n\t}\n\tgpDepthBoundsdNV = (C.GPDEPTHBOUNDSDNV)(getProcAddr(\"glDepthBoundsdNV\"))\n\tgpDepthFunc = (C.GPDEPTHFUNC)(getProcAddr(\"glDepthFunc\"))\n\tif gpDepthFunc == nil {\n\t\treturn errors.New(\"glDepthFunc\")\n\t}\n\tgpDepthMask = (C.GPDEPTHMASK)(getProcAddr(\"glDepthMask\"))\n\tif gpDepthMask == nil {\n\t\treturn errors.New(\"glDepthMask\")\n\t}\n\tgpDepthRange = (C.GPDEPTHRANGE)(getProcAddr(\"glDepthRange\"))\n\tif gpDepthRange == nil {\n\t\treturn errors.New(\"glDepthRange\")\n\t}\n\tgpDepthRangeArraydvNV = (C.GPDEPTHRANGEARRAYDVNV)(getProcAddr(\"glDepthRangeArraydvNV\"))\n\tgpDepthRangeArrayv = (C.GPDEPTHRANGEARRAYV)(getProcAddr(\"glDepthRangeArrayv\"))\n\tif gpDepthRangeArrayv == nil {\n\t\treturn errors.New(\"glDepthRangeArrayv\")\n\t}\n\tgpDepthRangeIndexed = (C.GPDEPTHRANGEINDEXED)(getProcAddr(\"glDepthRangeIndexed\"))\n\tif gpDepthRangeIndexed == nil {\n\t\treturn errors.New(\"glDepthRangeIndexed\")\n\t}\n\tgpDepthRangeIndexeddNV = (C.GPDEPTHRANGEINDEXEDDNV)(getProcAddr(\"glDepthRangeIndexeddNV\"))\n\tgpDepthRangedNV = (C.GPDEPTHRANGEDNV)(getProcAddr(\"glDepthRangedNV\"))\n\tgpDepthRangef = (C.GPDEPTHRANGEF)(getProcAddr(\"glDepthRangef\"))\n\tif gpDepthRangef == nil {\n\t\treturn errors.New(\"glDepthRangef\")\n\t}\n\tgpDetachShader = (C.GPDETACHSHADER)(getProcAddr(\"glDetachShader\"))\n\tif gpDetachShader == nil {\n\t\treturn errors.New(\"glDetachShader\")\n\t}\n\tgpDisable = (C.GPDISABLE)(getProcAddr(\"glDisable\"))\n\tif gpDisable == nil {\n\t\treturn errors.New(\"glDisable\")\n\t}\n\tgpDisableClientStateIndexedEXT = (C.GPDISABLECLIENTSTATEINDEXEDEXT)(getProcAddr(\"glDisableClientStateIndexedEXT\"))\n\tgpDisableClientStateiEXT = (C.GPDISABLECLIENTSTATEIEXT)(getProcAddr(\"glDisableClientStateiEXT\"))\n\tgpDisableIndexedEXT = (C.GPDISABLEINDEXEDEXT)(getProcAddr(\"glDisableIndexedEXT\"))\n\tgpDisableVertexArrayAttrib = (C.GPDISABLEVERTEXARRAYATTRIB)(getProcAddr(\"glDisableVertexArrayAttrib\"))\n\tgpDisableVertexArrayAttribEXT = (C.GPDISABLEVERTEXARRAYATTRIBEXT)(getProcAddr(\"glDisableVertexArrayAttribEXT\"))\n\tgpDisableVertexArrayEXT = (C.GPDISABLEVERTEXARRAYEXT)(getProcAddr(\"glDisableVertexArrayEXT\"))\n\tgpDisableVertexAttribArray = (C.GPDISABLEVERTEXATTRIBARRAY)(getProcAddr(\"glDisableVertexAttribArray\"))\n\tif gpDisableVertexAttribArray == nil {\n\t\treturn errors.New(\"glDisableVertexAttribArray\")\n\t}\n\tgpDisablei = (C.GPDISABLEI)(getProcAddr(\"glDisablei\"))\n\tif gpDisablei == nil {\n\t\treturn errors.New(\"glDisablei\")\n\t}\n\tgpDispatchCompute = (C.GPDISPATCHCOMPUTE)(getProcAddr(\"glDispatchCompute\"))\n\tgpDispatchComputeGroupSizeARB = (C.GPDISPATCHCOMPUTEGROUPSIZEARB)(getProcAddr(\"glDispatchComputeGroupSizeARB\"))\n\tgpDispatchComputeIndirect = (C.GPDISPATCHCOMPUTEINDIRECT)(getProcAddr(\"glDispatchComputeIndirect\"))\n\tgpDrawArrays = (C.GPDRAWARRAYS)(getProcAddr(\"glDrawArrays\"))\n\tif gpDrawArrays == nil {\n\t\treturn errors.New(\"glDrawArrays\")\n\t}\n\tgpDrawArraysIndirect = (C.GPDRAWARRAYSINDIRECT)(getProcAddr(\"glDrawArraysIndirect\"))\n\tif gpDrawArraysIndirect == nil {\n\t\treturn errors.New(\"glDrawArraysIndirect\")\n\t}\n\tgpDrawArraysInstanced = (C.GPDRAWARRAYSINSTANCED)(getProcAddr(\"glDrawArraysInstanced\"))\n\tif gpDrawArraysInstanced == nil {\n\t\treturn errors.New(\"glDrawArraysInstanced\")\n\t}\n\tgpDrawArraysInstancedARB = (C.GPDRAWARRAYSINSTANCEDARB)(getProcAddr(\"glDrawArraysInstancedARB\"))\n\tgpDrawArraysInstancedBaseInstance = (C.GPDRAWARRAYSINSTANCEDBASEINSTANCE)(getProcAddr(\"glDrawArraysInstancedBaseInstance\"))\n\tif gpDrawArraysInstancedBaseInstance == nil {\n\t\treturn errors.New(\"glDrawArraysInstancedBaseInstance\")\n\t}\n\tgpDrawArraysInstancedEXT = (C.GPDRAWARRAYSINSTANCEDEXT)(getProcAddr(\"glDrawArraysInstancedEXT\"))\n\tgpDrawBuffer = (C.GPDRAWBUFFER)(getProcAddr(\"glDrawBuffer\"))\n\tif gpDrawBuffer == nil {\n\t\treturn errors.New(\"glDrawBuffer\")\n\t}\n\tgpDrawBuffers = (C.GPDRAWBUFFERS)(getProcAddr(\"glDrawBuffers\"))\n\tif gpDrawBuffers == nil {\n\t\treturn errors.New(\"glDrawBuffers\")\n\t}\n\tgpDrawCommandsAddressNV = (C.GPDRAWCOMMANDSADDRESSNV)(getProcAddr(\"glDrawCommandsAddressNV\"))\n\tgpDrawCommandsNV = (C.GPDRAWCOMMANDSNV)(getProcAddr(\"glDrawCommandsNV\"))\n\tgpDrawCommandsStatesAddressNV = (C.GPDRAWCOMMANDSSTATESADDRESSNV)(getProcAddr(\"glDrawCommandsStatesAddressNV\"))\n\tgpDrawCommandsStatesNV = (C.GPDRAWCOMMANDSSTATESNV)(getProcAddr(\"glDrawCommandsStatesNV\"))\n\tgpDrawElements = (C.GPDRAWELEMENTS)(getProcAddr(\"glDrawElements\"))\n\tif gpDrawElements == nil {\n\t\treturn errors.New(\"glDrawElements\")\n\t}\n\tgpDrawElementsBaseVertex = (C.GPDRAWELEMENTSBASEVERTEX)(getProcAddr(\"glDrawElementsBaseVertex\"))\n\tif gpDrawElementsBaseVertex == nil {\n\t\treturn errors.New(\"glDrawElementsBaseVertex\")\n\t}\n\tgpDrawElementsIndirect = (C.GPDRAWELEMENTSINDIRECT)(getProcAddr(\"glDrawElementsIndirect\"))\n\tif gpDrawElementsIndirect == nil {\n\t\treturn errors.New(\"glDrawElementsIndirect\")\n\t}\n\tgpDrawElementsInstanced = (C.GPDRAWELEMENTSINSTANCED)(getProcAddr(\"glDrawElementsInstanced\"))\n\tif gpDrawElementsInstanced == nil {\n\t\treturn errors.New(\"glDrawElementsInstanced\")\n\t}\n\tgpDrawElementsInstancedARB = (C.GPDRAWELEMENTSINSTANCEDARB)(getProcAddr(\"glDrawElementsInstancedARB\"))\n\tgpDrawElementsInstancedBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEINSTANCE)(getProcAddr(\"glDrawElementsInstancedBaseInstance\"))\n\tif gpDrawElementsInstancedBaseInstance == nil {\n\t\treturn errors.New(\"glDrawElementsInstancedBaseInstance\")\n\t}\n\tgpDrawElementsInstancedBaseVertex = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEX)(getProcAddr(\"glDrawElementsInstancedBaseVertex\"))\n\tif gpDrawElementsInstancedBaseVertex == nil {\n\t\treturn errors.New(\"glDrawElementsInstancedBaseVertex\")\n\t}\n\tgpDrawElementsInstancedBaseVertexBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(getProcAddr(\"glDrawElementsInstancedBaseVertexBaseInstance\"))\n\tif gpDrawElementsInstancedBaseVertexBaseInstance == nil {\n\t\treturn errors.New(\"glDrawElementsInstancedBaseVertexBaseInstance\")\n\t}\n\tgpDrawElementsInstancedEXT = (C.GPDRAWELEMENTSINSTANCEDEXT)(getProcAddr(\"glDrawElementsInstancedEXT\"))\n\tgpDrawMeshTasksIndirectNV = (C.GPDRAWMESHTASKSINDIRECTNV)(getProcAddr(\"glDrawMeshTasksIndirectNV\"))\n\tgpDrawMeshTasksNV = (C.GPDRAWMESHTASKSNV)(getProcAddr(\"glDrawMeshTasksNV\"))\n\tgpDrawRangeElements = (C.GPDRAWRANGEELEMENTS)(getProcAddr(\"glDrawRangeElements\"))\n\tif gpDrawRangeElements == nil {\n\t\treturn errors.New(\"glDrawRangeElements\")\n\t}\n\tgpDrawRangeElementsBaseVertex = (C.GPDRAWRANGEELEMENTSBASEVERTEX)(getProcAddr(\"glDrawRangeElementsBaseVertex\"))\n\tif gpDrawRangeElementsBaseVertex == nil {\n\t\treturn errors.New(\"glDrawRangeElementsBaseVertex\")\n\t}\n\tgpDrawTransformFeedback = (C.GPDRAWTRANSFORMFEEDBACK)(getProcAddr(\"glDrawTransformFeedback\"))\n\tif gpDrawTransformFeedback == nil {\n\t\treturn errors.New(\"glDrawTransformFeedback\")\n\t}\n\tgpDrawTransformFeedbackInstanced = (C.GPDRAWTRANSFORMFEEDBACKINSTANCED)(getProcAddr(\"glDrawTransformFeedbackInstanced\"))\n\tif gpDrawTransformFeedbackInstanced == nil {\n\t\treturn errors.New(\"glDrawTransformFeedbackInstanced\")\n\t}\n\tgpDrawTransformFeedbackStream = (C.GPDRAWTRANSFORMFEEDBACKSTREAM)(getProcAddr(\"glDrawTransformFeedbackStream\"))\n\tif gpDrawTransformFeedbackStream == nil {\n\t\treturn errors.New(\"glDrawTransformFeedbackStream\")\n\t}\n\tgpDrawTransformFeedbackStreamInstanced = (C.GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(getProcAddr(\"glDrawTransformFeedbackStreamInstanced\"))\n\tif gpDrawTransformFeedbackStreamInstanced == nil {\n\t\treturn errors.New(\"glDrawTransformFeedbackStreamInstanced\")\n\t}\n\tgpDrawVkImageNV = (C.GPDRAWVKIMAGENV)(getProcAddr(\"glDrawVkImageNV\"))\n\tgpEGLImageTargetTexStorageEXT = (C.GPEGLIMAGETARGETTEXSTORAGEEXT)(getProcAddr(\"glEGLImageTargetTexStorageEXT\"))\n\tgpEGLImageTargetTextureStorageEXT = (C.GPEGLIMAGETARGETTEXTURESTORAGEEXT)(getProcAddr(\"glEGLImageTargetTextureStorageEXT\"))\n\tgpEdgeFlagFormatNV = (C.GPEDGEFLAGFORMATNV)(getProcAddr(\"glEdgeFlagFormatNV\"))\n\tgpEnable = (C.GPENABLE)(getProcAddr(\"glEnable\"))\n\tif gpEnable == nil {\n\t\treturn errors.New(\"glEnable\")\n\t}\n\tgpEnableClientStateIndexedEXT = (C.GPENABLECLIENTSTATEINDEXEDEXT)(getProcAddr(\"glEnableClientStateIndexedEXT\"))\n\tgpEnableClientStateiEXT = (C.GPENABLECLIENTSTATEIEXT)(getProcAddr(\"glEnableClientStateiEXT\"))\n\tgpEnableIndexedEXT = (C.GPENABLEINDEXEDEXT)(getProcAddr(\"glEnableIndexedEXT\"))\n\tgpEnableVertexArrayAttrib = (C.GPENABLEVERTEXARRAYATTRIB)(getProcAddr(\"glEnableVertexArrayAttrib\"))\n\tgpEnableVertexArrayAttribEXT = (C.GPENABLEVERTEXARRAYATTRIBEXT)(getProcAddr(\"glEnableVertexArrayAttribEXT\"))\n\tgpEnableVertexArrayEXT = (C.GPENABLEVERTEXARRAYEXT)(getProcAddr(\"glEnableVertexArrayEXT\"))\n\tgpEnableVertexAttribArray = (C.GPENABLEVERTEXATTRIBARRAY)(getProcAddr(\"glEnableVertexAttribArray\"))\n\tif gpEnableVertexAttribArray == nil {\n\t\treturn errors.New(\"glEnableVertexAttribArray\")\n\t}\n\tgpEnablei = (C.GPENABLEI)(getProcAddr(\"glEnablei\"))\n\tif gpEnablei == nil {\n\t\treturn errors.New(\"glEnablei\")\n\t}\n\tgpEndConditionalRender = (C.GPENDCONDITIONALRENDER)(getProcAddr(\"glEndConditionalRender\"))\n\tif gpEndConditionalRender == nil {\n\t\treturn errors.New(\"glEndConditionalRender\")\n\t}\n\tgpEndConditionalRenderNV = (C.GPENDCONDITIONALRENDERNV)(getProcAddr(\"glEndConditionalRenderNV\"))\n\tgpEndPerfMonitorAMD = (C.GPENDPERFMONITORAMD)(getProcAddr(\"glEndPerfMonitorAMD\"))\n\tgpEndPerfQueryINTEL = (C.GPENDPERFQUERYINTEL)(getProcAddr(\"glEndPerfQueryINTEL\"))\n\tgpEndQuery = (C.GPENDQUERY)(getProcAddr(\"glEndQuery\"))\n\tif gpEndQuery == nil {\n\t\treturn errors.New(\"glEndQuery\")\n\t}\n\tgpEndQueryIndexed = (C.GPENDQUERYINDEXED)(getProcAddr(\"glEndQueryIndexed\"))\n\tif gpEndQueryIndexed == nil {\n\t\treturn errors.New(\"glEndQueryIndexed\")\n\t}\n\tgpEndTransformFeedback = (C.GPENDTRANSFORMFEEDBACK)(getProcAddr(\"glEndTransformFeedback\"))\n\tif gpEndTransformFeedback == nil {\n\t\treturn errors.New(\"glEndTransformFeedback\")\n\t}\n\tgpEvaluateDepthValuesARB = (C.GPEVALUATEDEPTHVALUESARB)(getProcAddr(\"glEvaluateDepthValuesARB\"))\n\tgpFenceSync = (C.GPFENCESYNC)(getProcAddr(\"glFenceSync\"))\n\tif gpFenceSync == nil {\n\t\treturn errors.New(\"glFenceSync\")\n\t}\n\tgpFinish = (C.GPFINISH)(getProcAddr(\"glFinish\"))\n\tif gpFinish == nil {\n\t\treturn errors.New(\"glFinish\")\n\t}\n\tgpFlush = (C.GPFLUSH)(getProcAddr(\"glFlush\"))\n\tif gpFlush == nil {\n\t\treturn errors.New(\"glFlush\")\n\t}\n\tgpFlushMappedBufferRange = (C.GPFLUSHMAPPEDBUFFERRANGE)(getProcAddr(\"glFlushMappedBufferRange\"))\n\tif gpFlushMappedBufferRange == nil {\n\t\treturn errors.New(\"glFlushMappedBufferRange\")\n\t}\n\tgpFlushMappedNamedBufferRange = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGE)(getProcAddr(\"glFlushMappedNamedBufferRange\"))\n\tgpFlushMappedNamedBufferRangeEXT = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGEEXT)(getProcAddr(\"glFlushMappedNamedBufferRangeEXT\"))\n\tgpFogCoordFormatNV = (C.GPFOGCOORDFORMATNV)(getProcAddr(\"glFogCoordFormatNV\"))\n\tgpFragmentCoverageColorNV = (C.GPFRAGMENTCOVERAGECOLORNV)(getProcAddr(\"glFragmentCoverageColorNV\"))\n\tgpFramebufferDrawBufferEXT = (C.GPFRAMEBUFFERDRAWBUFFEREXT)(getProcAddr(\"glFramebufferDrawBufferEXT\"))\n\tgpFramebufferDrawBuffersEXT = (C.GPFRAMEBUFFERDRAWBUFFERSEXT)(getProcAddr(\"glFramebufferDrawBuffersEXT\"))\n\tgpFramebufferFetchBarrierEXT = (C.GPFRAMEBUFFERFETCHBARRIEREXT)(getProcAddr(\"glFramebufferFetchBarrierEXT\"))\n\tgpFramebufferParameteri = (C.GPFRAMEBUFFERPARAMETERI)(getProcAddr(\"glFramebufferParameteri\"))\n\tgpFramebufferParameteriMESA = (C.GPFRAMEBUFFERPARAMETERIMESA)(getProcAddr(\"glFramebufferParameteriMESA\"))\n\tgpFramebufferReadBufferEXT = (C.GPFRAMEBUFFERREADBUFFEREXT)(getProcAddr(\"glFramebufferReadBufferEXT\"))\n\tgpFramebufferRenderbuffer = (C.GPFRAMEBUFFERRENDERBUFFER)(getProcAddr(\"glFramebufferRenderbuffer\"))\n\tif gpFramebufferRenderbuffer == nil {\n\t\treturn errors.New(\"glFramebufferRenderbuffer\")\n\t}\n\tgpFramebufferSampleLocationsfvARB = (C.GPFRAMEBUFFERSAMPLELOCATIONSFVARB)(getProcAddr(\"glFramebufferSampleLocationsfvARB\"))\n\tgpFramebufferSampleLocationsfvNV = (C.GPFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr(\"glFramebufferSampleLocationsfvNV\"))\n\tgpFramebufferTexture = (C.GPFRAMEBUFFERTEXTURE)(getProcAddr(\"glFramebufferTexture\"))\n\tif gpFramebufferTexture == nil {\n\t\treturn errors.New(\"glFramebufferTexture\")\n\t}\n\tgpFramebufferTexture1D = (C.GPFRAMEBUFFERTEXTURE1D)(getProcAddr(\"glFramebufferTexture1D\"))\n\tif gpFramebufferTexture1D == nil {\n\t\treturn errors.New(\"glFramebufferTexture1D\")\n\t}\n\tgpFramebufferTexture2D = (C.GPFRAMEBUFFERTEXTURE2D)(getProcAddr(\"glFramebufferTexture2D\"))\n\tif gpFramebufferTexture2D == nil {\n\t\treturn errors.New(\"glFramebufferTexture2D\")\n\t}\n\tgpFramebufferTexture3D = (C.GPFRAMEBUFFERTEXTURE3D)(getProcAddr(\"glFramebufferTexture3D\"))\n\tif gpFramebufferTexture3D == nil {\n\t\treturn errors.New(\"glFramebufferTexture3D\")\n\t}\n\tgpFramebufferTextureARB = (C.GPFRAMEBUFFERTEXTUREARB)(getProcAddr(\"glFramebufferTextureARB\"))\n\tgpFramebufferTextureFaceARB = (C.GPFRAMEBUFFERTEXTUREFACEARB)(getProcAddr(\"glFramebufferTextureFaceARB\"))\n\tgpFramebufferTextureLayer = (C.GPFRAMEBUFFERTEXTURELAYER)(getProcAddr(\"glFramebufferTextureLayer\"))\n\tif gpFramebufferTextureLayer == nil {\n\t\treturn errors.New(\"glFramebufferTextureLayer\")\n\t}\n\tgpFramebufferTextureLayerARB = (C.GPFRAMEBUFFERTEXTURELAYERARB)(getProcAddr(\"glFramebufferTextureLayerARB\"))\n\tgpFramebufferTextureMultiviewOVR = (C.GPFRAMEBUFFERTEXTUREMULTIVIEWOVR)(getProcAddr(\"glFramebufferTextureMultiviewOVR\"))\n\tgpFrontFace = (C.GPFRONTFACE)(getProcAddr(\"glFrontFace\"))\n\tif gpFrontFace == nil {\n\t\treturn errors.New(\"glFrontFace\")\n\t}\n\tgpGenBuffers = (C.GPGENBUFFERS)(getProcAddr(\"glGenBuffers\"))\n\tif gpGenBuffers == nil {\n\t\treturn errors.New(\"glGenBuffers\")\n\t}\n\tgpGenFramebuffers = (C.GPGENFRAMEBUFFERS)(getProcAddr(\"glGenFramebuffers\"))\n\tif gpGenFramebuffers == nil {\n\t\treturn errors.New(\"glGenFramebuffers\")\n\t}\n\tgpGenPathsNV = (C.GPGENPATHSNV)(getProcAddr(\"glGenPathsNV\"))\n\tgpGenPerfMonitorsAMD = (C.GPGENPERFMONITORSAMD)(getProcAddr(\"glGenPerfMonitorsAMD\"))\n\tgpGenProgramPipelines = (C.GPGENPROGRAMPIPELINES)(getProcAddr(\"glGenProgramPipelines\"))\n\tif gpGenProgramPipelines == nil {\n\t\treturn errors.New(\"glGenProgramPipelines\")\n\t}\n\tgpGenProgramPipelinesEXT = (C.GPGENPROGRAMPIPELINESEXT)(getProcAddr(\"glGenProgramPipelinesEXT\"))\n\tgpGenQueries = (C.GPGENQUERIES)(getProcAddr(\"glGenQueries\"))\n\tif gpGenQueries == nil {\n\t\treturn errors.New(\"glGenQueries\")\n\t}\n\tgpGenRenderbuffers = (C.GPGENRENDERBUFFERS)(getProcAddr(\"glGenRenderbuffers\"))\n\tif gpGenRenderbuffers == nil {\n\t\treturn errors.New(\"glGenRenderbuffers\")\n\t}\n\tgpGenSamplers = (C.GPGENSAMPLERS)(getProcAddr(\"glGenSamplers\"))\n\tif gpGenSamplers == nil {\n\t\treturn errors.New(\"glGenSamplers\")\n\t}\n\tgpGenTextures = (C.GPGENTEXTURES)(getProcAddr(\"glGenTextures\"))\n\tif gpGenTextures == nil {\n\t\treturn errors.New(\"glGenTextures\")\n\t}\n\tgpGenTransformFeedbacks = (C.GPGENTRANSFORMFEEDBACKS)(getProcAddr(\"glGenTransformFeedbacks\"))\n\tif gpGenTransformFeedbacks == nil {\n\t\treturn errors.New(\"glGenTransformFeedbacks\")\n\t}\n\tgpGenVertexArrays = (C.GPGENVERTEXARRAYS)(getProcAddr(\"glGenVertexArrays\"))\n\tif gpGenVertexArrays == nil {\n\t\treturn errors.New(\"glGenVertexArrays\")\n\t}\n\tgpGenerateMipmap = (C.GPGENERATEMIPMAP)(getProcAddr(\"glGenerateMipmap\"))\n\tif gpGenerateMipmap == nil {\n\t\treturn errors.New(\"glGenerateMipmap\")\n\t}\n\tgpGenerateMultiTexMipmapEXT = (C.GPGENERATEMULTITEXMIPMAPEXT)(getProcAddr(\"glGenerateMultiTexMipmapEXT\"))\n\tgpGenerateTextureMipmap = (C.GPGENERATETEXTUREMIPMAP)(getProcAddr(\"glGenerateTextureMipmap\"))\n\tgpGenerateTextureMipmapEXT = (C.GPGENERATETEXTUREMIPMAPEXT)(getProcAddr(\"glGenerateTextureMipmapEXT\"))\n\tgpGetActiveAtomicCounterBufferiv = (C.GPGETACTIVEATOMICCOUNTERBUFFERIV)(getProcAddr(\"glGetActiveAtomicCounterBufferiv\"))\n\tif gpGetActiveAtomicCounterBufferiv == nil {\n\t\treturn errors.New(\"glGetActiveAtomicCounterBufferiv\")\n\t}\n\tgpGetActiveAttrib = (C.GPGETACTIVEATTRIB)(getProcAddr(\"glGetActiveAttrib\"))\n\tif gpGetActiveAttrib == nil {\n\t\treturn errors.New(\"glGetActiveAttrib\")\n\t}\n\tgpGetActiveSubroutineName = (C.GPGETACTIVESUBROUTINENAME)(getProcAddr(\"glGetActiveSubroutineName\"))\n\tif gpGetActiveSubroutineName == nil {\n\t\treturn errors.New(\"glGetActiveSubroutineName\")\n\t}\n\tgpGetActiveSubroutineUniformName = (C.GPGETACTIVESUBROUTINEUNIFORMNAME)(getProcAddr(\"glGetActiveSubroutineUniformName\"))\n\tif gpGetActiveSubroutineUniformName == nil {\n\t\treturn errors.New(\"glGetActiveSubroutineUniformName\")\n\t}\n\tgpGetActiveSubroutineUniformiv = (C.GPGETACTIVESUBROUTINEUNIFORMIV)(getProcAddr(\"glGetActiveSubroutineUniformiv\"))\n\tif gpGetActiveSubroutineUniformiv == nil {\n\t\treturn errors.New(\"glGetActiveSubroutineUniformiv\")\n\t}\n\tgpGetActiveUniform = (C.GPGETACTIVEUNIFORM)(getProcAddr(\"glGetActiveUniform\"))\n\tif gpGetActiveUniform == nil {\n\t\treturn errors.New(\"glGetActiveUniform\")\n\t}\n\tgpGetActiveUniformBlockName = (C.GPGETACTIVEUNIFORMBLOCKNAME)(getProcAddr(\"glGetActiveUniformBlockName\"))\n\tif gpGetActiveUniformBlockName == nil {\n\t\treturn errors.New(\"glGetActiveUniformBlockName\")\n\t}\n\tgpGetActiveUniformBlockiv = (C.GPGETACTIVEUNIFORMBLOCKIV)(getProcAddr(\"glGetActiveUniformBlockiv\"))\n\tif gpGetActiveUniformBlockiv == nil {\n\t\treturn errors.New(\"glGetActiveUniformBlockiv\")\n\t}\n\tgpGetActiveUniformName = (C.GPGETACTIVEUNIFORMNAME)(getProcAddr(\"glGetActiveUniformName\"))\n\tif gpGetActiveUniformName == nil {\n\t\treturn errors.New(\"glGetActiveUniformName\")\n\t}\n\tgpGetActiveUniformsiv = (C.GPGETACTIVEUNIFORMSIV)(getProcAddr(\"glGetActiveUniformsiv\"))\n\tif gpGetActiveUniformsiv == nil {\n\t\treturn errors.New(\"glGetActiveUniformsiv\")\n\t}\n\tgpGetAttachedShaders = (C.GPGETATTACHEDSHADERS)(getProcAddr(\"glGetAttachedShaders\"))\n\tif gpGetAttachedShaders == nil {\n\t\treturn errors.New(\"glGetAttachedShaders\")\n\t}\n\tgpGetAttribLocation = (C.GPGETATTRIBLOCATION)(getProcAddr(\"glGetAttribLocation\"))\n\tif gpGetAttribLocation == nil {\n\t\treturn errors.New(\"glGetAttribLocation\")\n\t}\n\tgpGetBooleanIndexedvEXT = (C.GPGETBOOLEANINDEXEDVEXT)(getProcAddr(\"glGetBooleanIndexedvEXT\"))\n\tgpGetBooleani_v = (C.GPGETBOOLEANI_V)(getProcAddr(\"glGetBooleani_v\"))\n\tif gpGetBooleani_v == nil {\n\t\treturn errors.New(\"glGetBooleani_v\")\n\t}\n\tgpGetBooleanv = (C.GPGETBOOLEANV)(getProcAddr(\"glGetBooleanv\"))\n\tif gpGetBooleanv == nil {\n\t\treturn errors.New(\"glGetBooleanv\")\n\t}\n\tgpGetBufferParameteri64v = (C.GPGETBUFFERPARAMETERI64V)(getProcAddr(\"glGetBufferParameteri64v\"))\n\tif gpGetBufferParameteri64v == nil {\n\t\treturn errors.New(\"glGetBufferParameteri64v\")\n\t}\n\tgpGetBufferParameteriv = (C.GPGETBUFFERPARAMETERIV)(getProcAddr(\"glGetBufferParameteriv\"))\n\tif gpGetBufferParameteriv == nil {\n\t\treturn errors.New(\"glGetBufferParameteriv\")\n\t}\n\tgpGetBufferParameterui64vNV = (C.GPGETBUFFERPARAMETERUI64VNV)(getProcAddr(\"glGetBufferParameterui64vNV\"))\n\tgpGetBufferPointerv = (C.GPGETBUFFERPOINTERV)(getProcAddr(\"glGetBufferPointerv\"))\n\tif gpGetBufferPointerv == nil {\n\t\treturn errors.New(\"glGetBufferPointerv\")\n\t}\n\tgpGetBufferSubData = (C.GPGETBUFFERSUBDATA)(getProcAddr(\"glGetBufferSubData\"))\n\tif gpGetBufferSubData == nil {\n\t\treturn errors.New(\"glGetBufferSubData\")\n\t}\n\tgpGetCommandHeaderNV = (C.GPGETCOMMANDHEADERNV)(getProcAddr(\"glGetCommandHeaderNV\"))\n\tgpGetCompressedMultiTexImageEXT = (C.GPGETCOMPRESSEDMULTITEXIMAGEEXT)(getProcAddr(\"glGetCompressedMultiTexImageEXT\"))\n\tgpGetCompressedTexImage = (C.GPGETCOMPRESSEDTEXIMAGE)(getProcAddr(\"glGetCompressedTexImage\"))\n\tif gpGetCompressedTexImage == nil {\n\t\treturn errors.New(\"glGetCompressedTexImage\")\n\t}\n\tgpGetCompressedTextureImage = (C.GPGETCOMPRESSEDTEXTUREIMAGE)(getProcAddr(\"glGetCompressedTextureImage\"))\n\tgpGetCompressedTextureImageEXT = (C.GPGETCOMPRESSEDTEXTUREIMAGEEXT)(getProcAddr(\"glGetCompressedTextureImageEXT\"))\n\tgpGetCompressedTextureSubImage = (C.GPGETCOMPRESSEDTEXTURESUBIMAGE)(getProcAddr(\"glGetCompressedTextureSubImage\"))\n\tgpGetCoverageModulationTableNV = (C.GPGETCOVERAGEMODULATIONTABLENV)(getProcAddr(\"glGetCoverageModulationTableNV\"))\n\tgpGetDebugMessageLog = (C.GPGETDEBUGMESSAGELOG)(getProcAddr(\"glGetDebugMessageLog\"))\n\tgpGetDebugMessageLogARB = (C.GPGETDEBUGMESSAGELOGARB)(getProcAddr(\"glGetDebugMessageLogARB\"))\n\tgpGetDebugMessageLogKHR = (C.GPGETDEBUGMESSAGELOGKHR)(getProcAddr(\"glGetDebugMessageLogKHR\"))\n\tgpGetDoubleIndexedvEXT = (C.GPGETDOUBLEINDEXEDVEXT)(getProcAddr(\"glGetDoubleIndexedvEXT\"))\n\tgpGetDoublei_v = (C.GPGETDOUBLEI_V)(getProcAddr(\"glGetDoublei_v\"))\n\tif gpGetDoublei_v == nil {\n\t\treturn errors.New(\"glGetDoublei_v\")\n\t}\n\tgpGetDoublei_vEXT = (C.GPGETDOUBLEI_VEXT)(getProcAddr(\"glGetDoublei_vEXT\"))\n\tgpGetDoublev = (C.GPGETDOUBLEV)(getProcAddr(\"glGetDoublev\"))\n\tif gpGetDoublev == nil {\n\t\treturn errors.New(\"glGetDoublev\")\n\t}\n\tgpGetError = (C.GPGETERROR)(getProcAddr(\"glGetError\"))\n\tif gpGetError == nil {\n\t\treturn errors.New(\"glGetError\")\n\t}\n\tgpGetFirstPerfQueryIdINTEL = (C.GPGETFIRSTPERFQUERYIDINTEL)(getProcAddr(\"glGetFirstPerfQueryIdINTEL\"))\n\tgpGetFloatIndexedvEXT = (C.GPGETFLOATINDEXEDVEXT)(getProcAddr(\"glGetFloatIndexedvEXT\"))\n\tgpGetFloati_v = (C.GPGETFLOATI_V)(getProcAddr(\"glGetFloati_v\"))\n\tif gpGetFloati_v == nil {\n\t\treturn errors.New(\"glGetFloati_v\")\n\t}\n\tgpGetFloati_vEXT = (C.GPGETFLOATI_VEXT)(getProcAddr(\"glGetFloati_vEXT\"))\n\tgpGetFloatv = (C.GPGETFLOATV)(getProcAddr(\"glGetFloatv\"))\n\tif gpGetFloatv == nil {\n\t\treturn errors.New(\"glGetFloatv\")\n\t}\n\tgpGetFragDataIndex = (C.GPGETFRAGDATAINDEX)(getProcAddr(\"glGetFragDataIndex\"))\n\tif gpGetFragDataIndex == nil {\n\t\treturn errors.New(\"glGetFragDataIndex\")\n\t}\n\tgpGetFragDataLocation = (C.GPGETFRAGDATALOCATION)(getProcAddr(\"glGetFragDataLocation\"))\n\tif gpGetFragDataLocation == nil {\n\t\treturn errors.New(\"glGetFragDataLocation\")\n\t}\n\tgpGetFramebufferAttachmentParameteriv = (C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr(\"glGetFramebufferAttachmentParameteriv\"))\n\tif gpGetFramebufferAttachmentParameteriv == nil {\n\t\treturn errors.New(\"glGetFramebufferAttachmentParameteriv\")\n\t}\n\tgpGetFramebufferParameteriv = (C.GPGETFRAMEBUFFERPARAMETERIV)(getProcAddr(\"glGetFramebufferParameteriv\"))\n\tgpGetFramebufferParameterivEXT = (C.GPGETFRAMEBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetFramebufferParameterivEXT\"))\n\tgpGetFramebufferParameterivMESA = (C.GPGETFRAMEBUFFERPARAMETERIVMESA)(getProcAddr(\"glGetFramebufferParameterivMESA\"))\n\tgpGetGraphicsResetStatus = (C.GPGETGRAPHICSRESETSTATUS)(getProcAddr(\"glGetGraphicsResetStatus\"))\n\tgpGetGraphicsResetStatusARB = (C.GPGETGRAPHICSRESETSTATUSARB)(getProcAddr(\"glGetGraphicsResetStatusARB\"))\n\tgpGetGraphicsResetStatusKHR = (C.GPGETGRAPHICSRESETSTATUSKHR)(getProcAddr(\"glGetGraphicsResetStatusKHR\"))\n\tgpGetImageHandleARB = (C.GPGETIMAGEHANDLEARB)(getProcAddr(\"glGetImageHandleARB\"))\n\tgpGetImageHandleNV = (C.GPGETIMAGEHANDLENV)(getProcAddr(\"glGetImageHandleNV\"))\n\tgpGetInteger64i_v = (C.GPGETINTEGER64I_V)(getProcAddr(\"glGetInteger64i_v\"))\n\tif gpGetInteger64i_v == nil {\n\t\treturn errors.New(\"glGetInteger64i_v\")\n\t}\n\tgpGetInteger64v = (C.GPGETINTEGER64V)(getProcAddr(\"glGetInteger64v\"))\n\tif gpGetInteger64v == nil {\n\t\treturn errors.New(\"glGetInteger64v\")\n\t}\n\tgpGetIntegerIndexedvEXT = (C.GPGETINTEGERINDEXEDVEXT)(getProcAddr(\"glGetIntegerIndexedvEXT\"))\n\tgpGetIntegeri_v = (C.GPGETINTEGERI_V)(getProcAddr(\"glGetIntegeri_v\"))\n\tif gpGetIntegeri_v == nil {\n\t\treturn errors.New(\"glGetIntegeri_v\")\n\t}\n\tgpGetIntegerui64i_vNV = (C.GPGETINTEGERUI64I_VNV)(getProcAddr(\"glGetIntegerui64i_vNV\"))\n\tgpGetIntegerui64vNV = (C.GPGETINTEGERUI64VNV)(getProcAddr(\"glGetIntegerui64vNV\"))\n\tgpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr(\"glGetIntegerv\"))\n\tif gpGetIntegerv == nil {\n\t\treturn errors.New(\"glGetIntegerv\")\n\t}\n\tgpGetInternalformatSampleivNV = (C.GPGETINTERNALFORMATSAMPLEIVNV)(getProcAddr(\"glGetInternalformatSampleivNV\"))\n\tgpGetInternalformati64v = (C.GPGETINTERNALFORMATI64V)(getProcAddr(\"glGetInternalformati64v\"))\n\tgpGetInternalformativ = (C.GPGETINTERNALFORMATIV)(getProcAddr(\"glGetInternalformativ\"))\n\tif gpGetInternalformativ == nil {\n\t\treturn errors.New(\"glGetInternalformativ\")\n\t}\n\tgpGetMemoryObjectDetachedResourcesuivNV = (C.GPGETMEMORYOBJECTDETACHEDRESOURCESUIVNV)(getProcAddr(\"glGetMemoryObjectDetachedResourcesuivNV\"))\n\tgpGetMultiTexEnvfvEXT = (C.GPGETMULTITEXENVFVEXT)(getProcAddr(\"glGetMultiTexEnvfvEXT\"))\n\tgpGetMultiTexEnvivEXT = (C.GPGETMULTITEXENVIVEXT)(getProcAddr(\"glGetMultiTexEnvivEXT\"))\n\tgpGetMultiTexGendvEXT = (C.GPGETMULTITEXGENDVEXT)(getProcAddr(\"glGetMultiTexGendvEXT\"))\n\tgpGetMultiTexGenfvEXT = (C.GPGETMULTITEXGENFVEXT)(getProcAddr(\"glGetMultiTexGenfvEXT\"))\n\tgpGetMultiTexGenivEXT = (C.GPGETMULTITEXGENIVEXT)(getProcAddr(\"glGetMultiTexGenivEXT\"))\n\tgpGetMultiTexImageEXT = (C.GPGETMULTITEXIMAGEEXT)(getProcAddr(\"glGetMultiTexImageEXT\"))\n\tgpGetMultiTexLevelParameterfvEXT = (C.GPGETMULTITEXLEVELPARAMETERFVEXT)(getProcAddr(\"glGetMultiTexLevelParameterfvEXT\"))\n\tgpGetMultiTexLevelParameterivEXT = (C.GPGETMULTITEXLEVELPARAMETERIVEXT)(getProcAddr(\"glGetMultiTexLevelParameterivEXT\"))\n\tgpGetMultiTexParameterIivEXT = (C.GPGETMULTITEXPARAMETERIIVEXT)(getProcAddr(\"glGetMultiTexParameterIivEXT\"))\n\tgpGetMultiTexParameterIuivEXT = (C.GPGETMULTITEXPARAMETERIUIVEXT)(getProcAddr(\"glGetMultiTexParameterIuivEXT\"))\n\tgpGetMultiTexParameterfvEXT = (C.GPGETMULTITEXPARAMETERFVEXT)(getProcAddr(\"glGetMultiTexParameterfvEXT\"))\n\tgpGetMultiTexParameterivEXT = (C.GPGETMULTITEXPARAMETERIVEXT)(getProcAddr(\"glGetMultiTexParameterivEXT\"))\n\tgpGetMultisamplefv = (C.GPGETMULTISAMPLEFV)(getProcAddr(\"glGetMultisamplefv\"))\n\tif gpGetMultisamplefv == nil {\n\t\treturn errors.New(\"glGetMultisamplefv\")\n\t}\n\tgpGetNamedBufferParameteri64v = (C.GPGETNAMEDBUFFERPARAMETERI64V)(getProcAddr(\"glGetNamedBufferParameteri64v\"))\n\tgpGetNamedBufferParameteriv = (C.GPGETNAMEDBUFFERPARAMETERIV)(getProcAddr(\"glGetNamedBufferParameteriv\"))\n\tgpGetNamedBufferParameterivEXT = (C.GPGETNAMEDBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetNamedBufferParameterivEXT\"))\n\tgpGetNamedBufferParameterui64vNV = (C.GPGETNAMEDBUFFERPARAMETERUI64VNV)(getProcAddr(\"glGetNamedBufferParameterui64vNV\"))\n\tgpGetNamedBufferPointerv = (C.GPGETNAMEDBUFFERPOINTERV)(getProcAddr(\"glGetNamedBufferPointerv\"))\n\tgpGetNamedBufferPointervEXT = (C.GPGETNAMEDBUFFERPOINTERVEXT)(getProcAddr(\"glGetNamedBufferPointervEXT\"))\n\tgpGetNamedBufferSubData = (C.GPGETNAMEDBUFFERSUBDATA)(getProcAddr(\"glGetNamedBufferSubData\"))\n\tgpGetNamedBufferSubDataEXT = (C.GPGETNAMEDBUFFERSUBDATAEXT)(getProcAddr(\"glGetNamedBufferSubDataEXT\"))\n\tgpGetNamedFramebufferAttachmentParameteriv = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr(\"glGetNamedFramebufferAttachmentParameteriv\"))\n\tgpGetNamedFramebufferAttachmentParameterivEXT = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXT)(getProcAddr(\"glGetNamedFramebufferAttachmentParameterivEXT\"))\n\tgpGetNamedFramebufferParameteriv = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIV)(getProcAddr(\"glGetNamedFramebufferParameteriv\"))\n\tgpGetNamedFramebufferParameterivEXT = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetNamedFramebufferParameterivEXT\"))\n\tgpGetNamedProgramLocalParameterIivEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERIIVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterIivEXT\"))\n\tgpGetNamedProgramLocalParameterIuivEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERIUIVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterIuivEXT\"))\n\tgpGetNamedProgramLocalParameterdvEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERDVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterdvEXT\"))\n\tgpGetNamedProgramLocalParameterfvEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERFVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterfvEXT\"))\n\tgpGetNamedProgramStringEXT = (C.GPGETNAMEDPROGRAMSTRINGEXT)(getProcAddr(\"glGetNamedProgramStringEXT\"))\n\tgpGetNamedProgramivEXT = (C.GPGETNAMEDPROGRAMIVEXT)(getProcAddr(\"glGetNamedProgramivEXT\"))\n\tgpGetNamedRenderbufferParameteriv = (C.GPGETNAMEDRENDERBUFFERPARAMETERIV)(getProcAddr(\"glGetNamedRenderbufferParameteriv\"))\n\tgpGetNamedRenderbufferParameterivEXT = (C.GPGETNAMEDRENDERBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetNamedRenderbufferParameterivEXT\"))\n\tgpGetNamedStringARB = (C.GPGETNAMEDSTRINGARB)(getProcAddr(\"glGetNamedStringARB\"))\n\tgpGetNamedStringivARB = (C.GPGETNAMEDSTRINGIVARB)(getProcAddr(\"glGetNamedStringivARB\"))\n\tgpGetNextPerfQueryIdINTEL = (C.GPGETNEXTPERFQUERYIDINTEL)(getProcAddr(\"glGetNextPerfQueryIdINTEL\"))\n\tgpGetObjectLabel = (C.GPGETOBJECTLABEL)(getProcAddr(\"glGetObjectLabel\"))\n\tgpGetObjectLabelEXT = (C.GPGETOBJECTLABELEXT)(getProcAddr(\"glGetObjectLabelEXT\"))\n\tgpGetObjectLabelKHR = (C.GPGETOBJECTLABELKHR)(getProcAddr(\"glGetObjectLabelKHR\"))\n\tgpGetObjectPtrLabel = (C.GPGETOBJECTPTRLABEL)(getProcAddr(\"glGetObjectPtrLabel\"))\n\tgpGetObjectPtrLabelKHR = (C.GPGETOBJECTPTRLABELKHR)(getProcAddr(\"glGetObjectPtrLabelKHR\"))\n\tgpGetPathCommandsNV = (C.GPGETPATHCOMMANDSNV)(getProcAddr(\"glGetPathCommandsNV\"))\n\tgpGetPathCoordsNV = (C.GPGETPATHCOORDSNV)(getProcAddr(\"glGetPathCoordsNV\"))\n\tgpGetPathDashArrayNV = (C.GPGETPATHDASHARRAYNV)(getProcAddr(\"glGetPathDashArrayNV\"))\n\tgpGetPathLengthNV = (C.GPGETPATHLENGTHNV)(getProcAddr(\"glGetPathLengthNV\"))\n\tgpGetPathMetricRangeNV = (C.GPGETPATHMETRICRANGENV)(getProcAddr(\"glGetPathMetricRangeNV\"))\n\tgpGetPathMetricsNV = (C.GPGETPATHMETRICSNV)(getProcAddr(\"glGetPathMetricsNV\"))\n\tgpGetPathParameterfvNV = (C.GPGETPATHPARAMETERFVNV)(getProcAddr(\"glGetPathParameterfvNV\"))\n\tgpGetPathParameterivNV = (C.GPGETPATHPARAMETERIVNV)(getProcAddr(\"glGetPathParameterivNV\"))\n\tgpGetPathSpacingNV = (C.GPGETPATHSPACINGNV)(getProcAddr(\"glGetPathSpacingNV\"))\n\tgpGetPerfCounterInfoINTEL = (C.GPGETPERFCOUNTERINFOINTEL)(getProcAddr(\"glGetPerfCounterInfoINTEL\"))\n\tgpGetPerfMonitorCounterDataAMD = (C.GPGETPERFMONITORCOUNTERDATAAMD)(getProcAddr(\"glGetPerfMonitorCounterDataAMD\"))\n\tgpGetPerfMonitorCounterInfoAMD = (C.GPGETPERFMONITORCOUNTERINFOAMD)(getProcAddr(\"glGetPerfMonitorCounterInfoAMD\"))\n\tgpGetPerfMonitorCounterStringAMD = (C.GPGETPERFMONITORCOUNTERSTRINGAMD)(getProcAddr(\"glGetPerfMonitorCounterStringAMD\"))\n\tgpGetPerfMonitorCountersAMD = (C.GPGETPERFMONITORCOUNTERSAMD)(getProcAddr(\"glGetPerfMonitorCountersAMD\"))\n\tgpGetPerfMonitorGroupStringAMD = (C.GPGETPERFMONITORGROUPSTRINGAMD)(getProcAddr(\"glGetPerfMonitorGroupStringAMD\"))\n\tgpGetPerfMonitorGroupsAMD = (C.GPGETPERFMONITORGROUPSAMD)(getProcAddr(\"glGetPerfMonitorGroupsAMD\"))\n\tgpGetPerfQueryDataINTEL = (C.GPGETPERFQUERYDATAINTEL)(getProcAddr(\"glGetPerfQueryDataINTEL\"))\n\tgpGetPerfQueryIdByNameINTEL = (C.GPGETPERFQUERYIDBYNAMEINTEL)(getProcAddr(\"glGetPerfQueryIdByNameINTEL\"))\n\tgpGetPerfQueryInfoINTEL = (C.GPGETPERFQUERYINFOINTEL)(getProcAddr(\"glGetPerfQueryInfoINTEL\"))\n\tgpGetPointerIndexedvEXT = (C.GPGETPOINTERINDEXEDVEXT)(getProcAddr(\"glGetPointerIndexedvEXT\"))\n\tgpGetPointeri_vEXT = (C.GPGETPOINTERI_VEXT)(getProcAddr(\"glGetPointeri_vEXT\"))\n\tgpGetPointerv = (C.GPGETPOINTERV)(getProcAddr(\"glGetPointerv\"))\n\tgpGetPointervKHR = (C.GPGETPOINTERVKHR)(getProcAddr(\"glGetPointervKHR\"))\n\tgpGetProgramBinary = (C.GPGETPROGRAMBINARY)(getProcAddr(\"glGetProgramBinary\"))\n\tif gpGetProgramBinary == nil {\n\t\treturn errors.New(\"glGetProgramBinary\")\n\t}\n\tgpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr(\"glGetProgramInfoLog\"))\n\tif gpGetProgramInfoLog == nil {\n\t\treturn errors.New(\"glGetProgramInfoLog\")\n\t}\n\tgpGetProgramInterfaceiv = (C.GPGETPROGRAMINTERFACEIV)(getProcAddr(\"glGetProgramInterfaceiv\"))\n\tgpGetProgramPipelineInfoLog = (C.GPGETPROGRAMPIPELINEINFOLOG)(getProcAddr(\"glGetProgramPipelineInfoLog\"))\n\tif gpGetProgramPipelineInfoLog == nil {\n\t\treturn errors.New(\"glGetProgramPipelineInfoLog\")\n\t}\n\tgpGetProgramPipelineInfoLogEXT = (C.GPGETPROGRAMPIPELINEINFOLOGEXT)(getProcAddr(\"glGetProgramPipelineInfoLogEXT\"))\n\tgpGetProgramPipelineiv = (C.GPGETPROGRAMPIPELINEIV)(getProcAddr(\"glGetProgramPipelineiv\"))\n\tif gpGetProgramPipelineiv == nil {\n\t\treturn errors.New(\"glGetProgramPipelineiv\")\n\t}\n\tgpGetProgramPipelineivEXT = (C.GPGETPROGRAMPIPELINEIVEXT)(getProcAddr(\"glGetProgramPipelineivEXT\"))\n\tgpGetProgramResourceIndex = (C.GPGETPROGRAMRESOURCEINDEX)(getProcAddr(\"glGetProgramResourceIndex\"))\n\tgpGetProgramResourceLocation = (C.GPGETPROGRAMRESOURCELOCATION)(getProcAddr(\"glGetProgramResourceLocation\"))\n\tgpGetProgramResourceLocationIndex = (C.GPGETPROGRAMRESOURCELOCATIONINDEX)(getProcAddr(\"glGetProgramResourceLocationIndex\"))\n\tgpGetProgramResourceName = (C.GPGETPROGRAMRESOURCENAME)(getProcAddr(\"glGetProgramResourceName\"))\n\tgpGetProgramResourcefvNV = (C.GPGETPROGRAMRESOURCEFVNV)(getProcAddr(\"glGetProgramResourcefvNV\"))\n\tgpGetProgramResourceiv = (C.GPGETPROGRAMRESOURCEIV)(getProcAddr(\"glGetProgramResourceiv\"))\n\tgpGetProgramStageiv = (C.GPGETPROGRAMSTAGEIV)(getProcAddr(\"glGetProgramStageiv\"))\n\tif gpGetProgramStageiv == nil {\n\t\treturn errors.New(\"glGetProgramStageiv\")\n\t}\n\tgpGetProgramiv = (C.GPGETPROGRAMIV)(getProcAddr(\"glGetProgramiv\"))\n\tif gpGetProgramiv == nil {\n\t\treturn errors.New(\"glGetProgramiv\")\n\t}\n\tgpGetQueryBufferObjecti64v = (C.GPGETQUERYBUFFEROBJECTI64V)(getProcAddr(\"glGetQueryBufferObjecti64v\"))\n\tgpGetQueryBufferObjectiv = (C.GPGETQUERYBUFFEROBJECTIV)(getProcAddr(\"glGetQueryBufferObjectiv\"))\n\tgpGetQueryBufferObjectui64v = (C.GPGETQUERYBUFFEROBJECTUI64V)(getProcAddr(\"glGetQueryBufferObjectui64v\"))\n\tgpGetQueryBufferObjectuiv = (C.GPGETQUERYBUFFEROBJECTUIV)(getProcAddr(\"glGetQueryBufferObjectuiv\"))\n\tgpGetQueryIndexediv = (C.GPGETQUERYINDEXEDIV)(getProcAddr(\"glGetQueryIndexediv\"))\n\tif gpGetQueryIndexediv == nil {\n\t\treturn errors.New(\"glGetQueryIndexediv\")\n\t}\n\tgpGetQueryObjecti64v = (C.GPGETQUERYOBJECTI64V)(getProcAddr(\"glGetQueryObjecti64v\"))\n\tif gpGetQueryObjecti64v == nil {\n\t\treturn errors.New(\"glGetQueryObjecti64v\")\n\t}\n\tgpGetQueryObjectiv = (C.GPGETQUERYOBJECTIV)(getProcAddr(\"glGetQueryObjectiv\"))\n\tif gpGetQueryObjectiv == nil {\n\t\treturn errors.New(\"glGetQueryObjectiv\")\n\t}\n\tgpGetQueryObjectui64v = (C.GPGETQUERYOBJECTUI64V)(getProcAddr(\"glGetQueryObjectui64v\"))\n\tif gpGetQueryObjectui64v == nil {\n\t\treturn errors.New(\"glGetQueryObjectui64v\")\n\t}\n\tgpGetQueryObjectuiv = (C.GPGETQUERYOBJECTUIV)(getProcAddr(\"glGetQueryObjectuiv\"))\n\tif gpGetQueryObjectuiv == nil {\n\t\treturn errors.New(\"glGetQueryObjectuiv\")\n\t}\n\tgpGetQueryiv = (C.GPGETQUERYIV)(getProcAddr(\"glGetQueryiv\"))\n\tif gpGetQueryiv == nil {\n\t\treturn errors.New(\"glGetQueryiv\")\n\t}\n\tgpGetRenderbufferParameteriv = (C.GPGETRENDERBUFFERPARAMETERIV)(getProcAddr(\"glGetRenderbufferParameteriv\"))\n\tif gpGetRenderbufferParameteriv == nil {\n\t\treturn errors.New(\"glGetRenderbufferParameteriv\")\n\t}\n\tgpGetSamplerParameterIiv = (C.GPGETSAMPLERPARAMETERIIV)(getProcAddr(\"glGetSamplerParameterIiv\"))\n\tif gpGetSamplerParameterIiv == nil {\n\t\treturn errors.New(\"glGetSamplerParameterIiv\")\n\t}\n\tgpGetSamplerParameterIuiv = (C.GPGETSAMPLERPARAMETERIUIV)(getProcAddr(\"glGetSamplerParameterIuiv\"))\n\tif gpGetSamplerParameterIuiv == nil {\n\t\treturn errors.New(\"glGetSamplerParameterIuiv\")\n\t}\n\tgpGetSamplerParameterfv = (C.GPGETSAMPLERPARAMETERFV)(getProcAddr(\"glGetSamplerParameterfv\"))\n\tif gpGetSamplerParameterfv == nil {\n\t\treturn errors.New(\"glGetSamplerParameterfv\")\n\t}\n\tgpGetSamplerParameteriv = (C.GPGETSAMPLERPARAMETERIV)(getProcAddr(\"glGetSamplerParameteriv\"))\n\tif gpGetSamplerParameteriv == nil {\n\t\treturn errors.New(\"glGetSamplerParameteriv\")\n\t}\n\tgpGetShaderInfoLog = (C.GPGETSHADERINFOLOG)(getProcAddr(\"glGetShaderInfoLog\"))\n\tif gpGetShaderInfoLog == nil {\n\t\treturn errors.New(\"glGetShaderInfoLog\")\n\t}\n\tgpGetShaderPrecisionFormat = (C.GPGETSHADERPRECISIONFORMAT)(getProcAddr(\"glGetShaderPrecisionFormat\"))\n\tif gpGetShaderPrecisionFormat == nil {\n\t\treturn errors.New(\"glGetShaderPrecisionFormat\")\n\t}\n\tgpGetShaderSource = (C.GPGETSHADERSOURCE)(getProcAddr(\"glGetShaderSource\"))\n\tif gpGetShaderSource == nil {\n\t\treturn errors.New(\"glGetShaderSource\")\n\t}\n\tgpGetShaderiv = (C.GPGETSHADERIV)(getProcAddr(\"glGetShaderiv\"))\n\tif gpGetShaderiv == nil {\n\t\treturn errors.New(\"glGetShaderiv\")\n\t}\n\tgpGetShadingRateImagePaletteNV = (C.GPGETSHADINGRATEIMAGEPALETTENV)(getProcAddr(\"glGetShadingRateImagePaletteNV\"))\n\tgpGetShadingRateSampleLocationivNV = (C.GPGETSHADINGRATESAMPLELOCATIONIVNV)(getProcAddr(\"glGetShadingRateSampleLocationivNV\"))\n\tgpGetStageIndexNV = (C.GPGETSTAGEINDEXNV)(getProcAddr(\"glGetStageIndexNV\"))\n\tgpGetString = (C.GPGETSTRING)(getProcAddr(\"glGetString\"))\n\tif gpGetString == nil {\n\t\treturn errors.New(\"glGetString\")\n\t}\n\tgpGetStringi = (C.GPGETSTRINGI)(getProcAddr(\"glGetStringi\"))\n\tif gpGetStringi == nil {\n\t\treturn errors.New(\"glGetStringi\")\n\t}\n\tgpGetSubroutineIndex = (C.GPGETSUBROUTINEINDEX)(getProcAddr(\"glGetSubroutineIndex\"))\n\tif gpGetSubroutineIndex == nil {\n\t\treturn errors.New(\"glGetSubroutineIndex\")\n\t}\n\tgpGetSubroutineUniformLocation = (C.GPGETSUBROUTINEUNIFORMLOCATION)(getProcAddr(\"glGetSubroutineUniformLocation\"))\n\tif gpGetSubroutineUniformLocation == nil {\n\t\treturn errors.New(\"glGetSubroutineUniformLocation\")\n\t}\n\tgpGetSynciv = (C.GPGETSYNCIV)(getProcAddr(\"glGetSynciv\"))\n\tif gpGetSynciv == nil {\n\t\treturn errors.New(\"glGetSynciv\")\n\t}\n\tgpGetTexImage = (C.GPGETTEXIMAGE)(getProcAddr(\"glGetTexImage\"))\n\tif gpGetTexImage == nil {\n\t\treturn errors.New(\"glGetTexImage\")\n\t}\n\tgpGetTexLevelParameterfv = (C.GPGETTEXLEVELPARAMETERFV)(getProcAddr(\"glGetTexLevelParameterfv\"))\n\tif gpGetTexLevelParameterfv == nil {\n\t\treturn errors.New(\"glGetTexLevelParameterfv\")\n\t}\n\tgpGetTexLevelParameteriv = (C.GPGETTEXLEVELPARAMETERIV)(getProcAddr(\"glGetTexLevelParameteriv\"))\n\tif gpGetTexLevelParameteriv == nil {\n\t\treturn errors.New(\"glGetTexLevelParameteriv\")\n\t}\n\tgpGetTexParameterIiv = (C.GPGETTEXPARAMETERIIV)(getProcAddr(\"glGetTexParameterIiv\"))\n\tif gpGetTexParameterIiv == nil {\n\t\treturn errors.New(\"glGetTexParameterIiv\")\n\t}\n\tgpGetTexParameterIuiv = (C.GPGETTEXPARAMETERIUIV)(getProcAddr(\"glGetTexParameterIuiv\"))\n\tif gpGetTexParameterIuiv == nil {\n\t\treturn errors.New(\"glGetTexParameterIuiv\")\n\t}\n\tgpGetTexParameterfv = (C.GPGETTEXPARAMETERFV)(getProcAddr(\"glGetTexParameterfv\"))\n\tif gpGetTexParameterfv == nil {\n\t\treturn errors.New(\"glGetTexParameterfv\")\n\t}\n\tgpGetTexParameteriv = (C.GPGETTEXPARAMETERIV)(getProcAddr(\"glGetTexParameteriv\"))\n\tif gpGetTexParameteriv == nil {\n\t\treturn errors.New(\"glGetTexParameteriv\")\n\t}\n\tgpGetTextureHandleARB = (C.GPGETTEXTUREHANDLEARB)(getProcAddr(\"glGetTextureHandleARB\"))\n\tgpGetTextureHandleNV = (C.GPGETTEXTUREHANDLENV)(getProcAddr(\"glGetTextureHandleNV\"))\n\tgpGetTextureImage = (C.GPGETTEXTUREIMAGE)(getProcAddr(\"glGetTextureImage\"))\n\tgpGetTextureImageEXT = (C.GPGETTEXTUREIMAGEEXT)(getProcAddr(\"glGetTextureImageEXT\"))\n\tgpGetTextureLevelParameterfv = (C.GPGETTEXTURELEVELPARAMETERFV)(getProcAddr(\"glGetTextureLevelParameterfv\"))\n\tgpGetTextureLevelParameterfvEXT = (C.GPGETTEXTURELEVELPARAMETERFVEXT)(getProcAddr(\"glGetTextureLevelParameterfvEXT\"))\n\tgpGetTextureLevelParameteriv = (C.GPGETTEXTURELEVELPARAMETERIV)(getProcAddr(\"glGetTextureLevelParameteriv\"))\n\tgpGetTextureLevelParameterivEXT = (C.GPGETTEXTURELEVELPARAMETERIVEXT)(getProcAddr(\"glGetTextureLevelParameterivEXT\"))\n\tgpGetTextureParameterIiv = (C.GPGETTEXTUREPARAMETERIIV)(getProcAddr(\"glGetTextureParameterIiv\"))\n\tgpGetTextureParameterIivEXT = (C.GPGETTEXTUREPARAMETERIIVEXT)(getProcAddr(\"glGetTextureParameterIivEXT\"))\n\tgpGetTextureParameterIuiv = (C.GPGETTEXTUREPARAMETERIUIV)(getProcAddr(\"glGetTextureParameterIuiv\"))\n\tgpGetTextureParameterIuivEXT = (C.GPGETTEXTUREPARAMETERIUIVEXT)(getProcAddr(\"glGetTextureParameterIuivEXT\"))\n\tgpGetTextureParameterfv = (C.GPGETTEXTUREPARAMETERFV)(getProcAddr(\"glGetTextureParameterfv\"))\n\tgpGetTextureParameterfvEXT = (C.GPGETTEXTUREPARAMETERFVEXT)(getProcAddr(\"glGetTextureParameterfvEXT\"))\n\tgpGetTextureParameteriv = (C.GPGETTEXTUREPARAMETERIV)(getProcAddr(\"glGetTextureParameteriv\"))\n\tgpGetTextureParameterivEXT = (C.GPGETTEXTUREPARAMETERIVEXT)(getProcAddr(\"glGetTextureParameterivEXT\"))\n\tgpGetTextureSamplerHandleARB = (C.GPGETTEXTURESAMPLERHANDLEARB)(getProcAddr(\"glGetTextureSamplerHandleARB\"))\n\tgpGetTextureSamplerHandleNV = (C.GPGETTEXTURESAMPLERHANDLENV)(getProcAddr(\"glGetTextureSamplerHandleNV\"))\n\tgpGetTextureSubImage = (C.GPGETTEXTURESUBIMAGE)(getProcAddr(\"glGetTextureSubImage\"))\n\tgpGetTransformFeedbackVarying = (C.GPGETTRANSFORMFEEDBACKVARYING)(getProcAddr(\"glGetTransformFeedbackVarying\"))\n\tif gpGetTransformFeedbackVarying == nil {\n\t\treturn errors.New(\"glGetTransformFeedbackVarying\")\n\t}\n\tgpGetTransformFeedbacki64_v = (C.GPGETTRANSFORMFEEDBACKI64_V)(getProcAddr(\"glGetTransformFeedbacki64_v\"))\n\tgpGetTransformFeedbacki_v = (C.GPGETTRANSFORMFEEDBACKI_V)(getProcAddr(\"glGetTransformFeedbacki_v\"))\n\tgpGetTransformFeedbackiv = (C.GPGETTRANSFORMFEEDBACKIV)(getProcAddr(\"glGetTransformFeedbackiv\"))\n\tgpGetUniformBlockIndex = (C.GPGETUNIFORMBLOCKINDEX)(getProcAddr(\"glGetUniformBlockIndex\"))\n\tif gpGetUniformBlockIndex == nil {\n\t\treturn errors.New(\"glGetUniformBlockIndex\")\n\t}\n\tgpGetUniformIndices = (C.GPGETUNIFORMINDICES)(getProcAddr(\"glGetUniformIndices\"))\n\tif gpGetUniformIndices == nil {\n\t\treturn errors.New(\"glGetUniformIndices\")\n\t}\n\tgpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr(\"glGetUniformLocation\"))\n\tif gpGetUniformLocation == nil {\n\t\treturn errors.New(\"glGetUniformLocation\")\n\t}\n\tgpGetUniformSubroutineuiv = (C.GPGETUNIFORMSUBROUTINEUIV)(getProcAddr(\"glGetUniformSubroutineuiv\"))\n\tif gpGetUniformSubroutineuiv == nil {\n\t\treturn errors.New(\"glGetUniformSubroutineuiv\")\n\t}\n\tgpGetUniformdv = (C.GPGETUNIFORMDV)(getProcAddr(\"glGetUniformdv\"))\n\tif gpGetUniformdv == nil {\n\t\treturn errors.New(\"glGetUniformdv\")\n\t}\n\tgpGetUniformfv = (C.GPGETUNIFORMFV)(getProcAddr(\"glGetUniformfv\"))\n\tif gpGetUniformfv == nil {\n\t\treturn errors.New(\"glGetUniformfv\")\n\t}\n\tgpGetUniformi64vARB = (C.GPGETUNIFORMI64VARB)(getProcAddr(\"glGetUniformi64vARB\"))\n\tgpGetUniformi64vNV = (C.GPGETUNIFORMI64VNV)(getProcAddr(\"glGetUniformi64vNV\"))\n\tgpGetUniformiv = (C.GPGETUNIFORMIV)(getProcAddr(\"glGetUniformiv\"))\n\tif gpGetUniformiv == nil {\n\t\treturn errors.New(\"glGetUniformiv\")\n\t}\n\tgpGetUniformui64vARB = (C.GPGETUNIFORMUI64VARB)(getProcAddr(\"glGetUniformui64vARB\"))\n\tgpGetUniformui64vNV = (C.GPGETUNIFORMUI64VNV)(getProcAddr(\"glGetUniformui64vNV\"))\n\tgpGetUniformuiv = (C.GPGETUNIFORMUIV)(getProcAddr(\"glGetUniformuiv\"))\n\tif gpGetUniformuiv == nil {\n\t\treturn errors.New(\"glGetUniformuiv\")\n\t}\n\tgpGetVertexArrayIndexed64iv = (C.GPGETVERTEXARRAYINDEXED64IV)(getProcAddr(\"glGetVertexArrayIndexed64iv\"))\n\tgpGetVertexArrayIndexediv = (C.GPGETVERTEXARRAYINDEXEDIV)(getProcAddr(\"glGetVertexArrayIndexediv\"))\n\tgpGetVertexArrayIntegeri_vEXT = (C.GPGETVERTEXARRAYINTEGERI_VEXT)(getProcAddr(\"glGetVertexArrayIntegeri_vEXT\"))\n\tgpGetVertexArrayIntegervEXT = (C.GPGETVERTEXARRAYINTEGERVEXT)(getProcAddr(\"glGetVertexArrayIntegervEXT\"))\n\tgpGetVertexArrayPointeri_vEXT = (C.GPGETVERTEXARRAYPOINTERI_VEXT)(getProcAddr(\"glGetVertexArrayPointeri_vEXT\"))\n\tgpGetVertexArrayPointervEXT = (C.GPGETVERTEXARRAYPOINTERVEXT)(getProcAddr(\"glGetVertexArrayPointervEXT\"))\n\tgpGetVertexArrayiv = (C.GPGETVERTEXARRAYIV)(getProcAddr(\"glGetVertexArrayiv\"))\n\tgpGetVertexAttribIiv = (C.GPGETVERTEXATTRIBIIV)(getProcAddr(\"glGetVertexAttribIiv\"))\n\tif gpGetVertexAttribIiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribIiv\")\n\t}\n\tgpGetVertexAttribIuiv = (C.GPGETVERTEXATTRIBIUIV)(getProcAddr(\"glGetVertexAttribIuiv\"))\n\tif gpGetVertexAttribIuiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribIuiv\")\n\t}\n\tgpGetVertexAttribLdv = (C.GPGETVERTEXATTRIBLDV)(getProcAddr(\"glGetVertexAttribLdv\"))\n\tif gpGetVertexAttribLdv == nil {\n\t\treturn errors.New(\"glGetVertexAttribLdv\")\n\t}\n\tgpGetVertexAttribLi64vNV = (C.GPGETVERTEXATTRIBLI64VNV)(getProcAddr(\"glGetVertexAttribLi64vNV\"))\n\tgpGetVertexAttribLui64vARB = (C.GPGETVERTEXATTRIBLUI64VARB)(getProcAddr(\"glGetVertexAttribLui64vARB\"))\n\tgpGetVertexAttribLui64vNV = (C.GPGETVERTEXATTRIBLUI64VNV)(getProcAddr(\"glGetVertexAttribLui64vNV\"))\n\tgpGetVertexAttribPointerv = (C.GPGETVERTEXATTRIBPOINTERV)(getProcAddr(\"glGetVertexAttribPointerv\"))\n\tif gpGetVertexAttribPointerv == nil {\n\t\treturn errors.New(\"glGetVertexAttribPointerv\")\n\t}\n\tgpGetVertexAttribdv = (C.GPGETVERTEXATTRIBDV)(getProcAddr(\"glGetVertexAttribdv\"))\n\tif gpGetVertexAttribdv == nil {\n\t\treturn errors.New(\"glGetVertexAttribdv\")\n\t}\n\tgpGetVertexAttribfv = (C.GPGETVERTEXATTRIBFV)(getProcAddr(\"glGetVertexAttribfv\"))\n\tif gpGetVertexAttribfv == nil {\n\t\treturn errors.New(\"glGetVertexAttribfv\")\n\t}\n\tgpGetVertexAttribiv = (C.GPGETVERTEXATTRIBIV)(getProcAddr(\"glGetVertexAttribiv\"))\n\tif gpGetVertexAttribiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribiv\")\n\t}\n\tgpGetVkProcAddrNV = (C.GPGETVKPROCADDRNV)(getProcAddr(\"glGetVkProcAddrNV\"))\n\tgpGetnCompressedTexImageARB = (C.GPGETNCOMPRESSEDTEXIMAGEARB)(getProcAddr(\"glGetnCompressedTexImageARB\"))\n\tgpGetnTexImageARB = (C.GPGETNTEXIMAGEARB)(getProcAddr(\"glGetnTexImageARB\"))\n\tgpGetnUniformdvARB = (C.GPGETNUNIFORMDVARB)(getProcAddr(\"glGetnUniformdvARB\"))\n\tgpGetnUniformfv = (C.GPGETNUNIFORMFV)(getProcAddr(\"glGetnUniformfv\"))\n\tgpGetnUniformfvARB = (C.GPGETNUNIFORMFVARB)(getProcAddr(\"glGetnUniformfvARB\"))\n\tgpGetnUniformfvKHR = (C.GPGETNUNIFORMFVKHR)(getProcAddr(\"glGetnUniformfvKHR\"))\n\tgpGetnUniformi64vARB = (C.GPGETNUNIFORMI64VARB)(getProcAddr(\"glGetnUniformi64vARB\"))\n\tgpGetnUniformiv = (C.GPGETNUNIFORMIV)(getProcAddr(\"glGetnUniformiv\"))\n\tgpGetnUniformivARB = (C.GPGETNUNIFORMIVARB)(getProcAddr(\"glGetnUniformivARB\"))\n\tgpGetnUniformivKHR = (C.GPGETNUNIFORMIVKHR)(getProcAddr(\"glGetnUniformivKHR\"))\n\tgpGetnUniformui64vARB = (C.GPGETNUNIFORMUI64VARB)(getProcAddr(\"glGetnUniformui64vARB\"))\n\tgpGetnUniformuiv = (C.GPGETNUNIFORMUIV)(getProcAddr(\"glGetnUniformuiv\"))\n\tgpGetnUniformuivARB = (C.GPGETNUNIFORMUIVARB)(getProcAddr(\"glGetnUniformuivARB\"))\n\tgpGetnUniformuivKHR = (C.GPGETNUNIFORMUIVKHR)(getProcAddr(\"glGetnUniformuivKHR\"))\n\tgpHint = (C.GPHINT)(getProcAddr(\"glHint\"))\n\tif gpHint == nil {\n\t\treturn errors.New(\"glHint\")\n\t}\n\tgpIndexFormatNV = (C.GPINDEXFORMATNV)(getProcAddr(\"glIndexFormatNV\"))\n\tgpInsertEventMarkerEXT = (C.GPINSERTEVENTMARKEREXT)(getProcAddr(\"glInsertEventMarkerEXT\"))\n\tgpInterpolatePathsNV = (C.GPINTERPOLATEPATHSNV)(getProcAddr(\"glInterpolatePathsNV\"))\n\tgpInvalidateBufferData = (C.GPINVALIDATEBUFFERDATA)(getProcAddr(\"glInvalidateBufferData\"))\n\tgpInvalidateBufferSubData = (C.GPINVALIDATEBUFFERSUBDATA)(getProcAddr(\"glInvalidateBufferSubData\"))\n\tgpInvalidateFramebuffer = (C.GPINVALIDATEFRAMEBUFFER)(getProcAddr(\"glInvalidateFramebuffer\"))\n\tgpInvalidateNamedFramebufferData = (C.GPINVALIDATENAMEDFRAMEBUFFERDATA)(getProcAddr(\"glInvalidateNamedFramebufferData\"))\n\tgpInvalidateNamedFramebufferSubData = (C.GPINVALIDATENAMEDFRAMEBUFFERSUBDATA)(getProcAddr(\"glInvalidateNamedFramebufferSubData\"))\n\tgpInvalidateSubFramebuffer = (C.GPINVALIDATESUBFRAMEBUFFER)(getProcAddr(\"glInvalidateSubFramebuffer\"))\n\tgpInvalidateTexImage = (C.GPINVALIDATETEXIMAGE)(getProcAddr(\"glInvalidateTexImage\"))\n\tgpInvalidateTexSubImage = (C.GPINVALIDATETEXSUBIMAGE)(getProcAddr(\"glInvalidateTexSubImage\"))\n\tgpIsBuffer = (C.GPISBUFFER)(getProcAddr(\"glIsBuffer\"))\n\tif gpIsBuffer == nil {\n\t\treturn errors.New(\"glIsBuffer\")\n\t}\n\tgpIsBufferResidentNV = (C.GPISBUFFERRESIDENTNV)(getProcAddr(\"glIsBufferResidentNV\"))\n\tgpIsCommandListNV = (C.GPISCOMMANDLISTNV)(getProcAddr(\"glIsCommandListNV\"))\n\tgpIsEnabled = (C.GPISENABLED)(getProcAddr(\"glIsEnabled\"))\n\tif gpIsEnabled == nil {\n\t\treturn errors.New(\"glIsEnabled\")\n\t}\n\tgpIsEnabledIndexedEXT = (C.GPISENABLEDINDEXEDEXT)(getProcAddr(\"glIsEnabledIndexedEXT\"))\n\tgpIsEnabledi = (C.GPISENABLEDI)(getProcAddr(\"glIsEnabledi\"))\n\tif gpIsEnabledi == nil {\n\t\treturn errors.New(\"glIsEnabledi\")\n\t}\n\tgpIsFramebuffer = (C.GPISFRAMEBUFFER)(getProcAddr(\"glIsFramebuffer\"))\n\tif gpIsFramebuffer == nil {\n\t\treturn errors.New(\"glIsFramebuffer\")\n\t}\n\tgpIsImageHandleResidentARB = (C.GPISIMAGEHANDLERESIDENTARB)(getProcAddr(\"glIsImageHandleResidentARB\"))\n\tgpIsImageHandleResidentNV = (C.GPISIMAGEHANDLERESIDENTNV)(getProcAddr(\"glIsImageHandleResidentNV\"))\n\tgpIsNamedBufferResidentNV = (C.GPISNAMEDBUFFERRESIDENTNV)(getProcAddr(\"glIsNamedBufferResidentNV\"))\n\tgpIsNamedStringARB = (C.GPISNAMEDSTRINGARB)(getProcAddr(\"glIsNamedStringARB\"))\n\tgpIsPathNV = (C.GPISPATHNV)(getProcAddr(\"glIsPathNV\"))\n\tgpIsPointInFillPathNV = (C.GPISPOINTINFILLPATHNV)(getProcAddr(\"glIsPointInFillPathNV\"))\n\tgpIsPointInStrokePathNV = (C.GPISPOINTINSTROKEPATHNV)(getProcAddr(\"glIsPointInStrokePathNV\"))\n\tgpIsProgram = (C.GPISPROGRAM)(getProcAddr(\"glIsProgram\"))\n\tif gpIsProgram == nil {\n\t\treturn errors.New(\"glIsProgram\")\n\t}\n\tgpIsProgramPipeline = (C.GPISPROGRAMPIPELINE)(getProcAddr(\"glIsProgramPipeline\"))\n\tif gpIsProgramPipeline == nil {\n\t\treturn errors.New(\"glIsProgramPipeline\")\n\t}\n\tgpIsProgramPipelineEXT = (C.GPISPROGRAMPIPELINEEXT)(getProcAddr(\"glIsProgramPipelineEXT\"))\n\tgpIsQuery = (C.GPISQUERY)(getProcAddr(\"glIsQuery\"))\n\tif gpIsQuery == nil {\n\t\treturn errors.New(\"glIsQuery\")\n\t}\n\tgpIsRenderbuffer = (C.GPISRENDERBUFFER)(getProcAddr(\"glIsRenderbuffer\"))\n\tif gpIsRenderbuffer == nil {\n\t\treturn errors.New(\"glIsRenderbuffer\")\n\t}\n\tgpIsSampler = (C.GPISSAMPLER)(getProcAddr(\"glIsSampler\"))\n\tif gpIsSampler == nil {\n\t\treturn errors.New(\"glIsSampler\")\n\t}\n\tgpIsShader = (C.GPISSHADER)(getProcAddr(\"glIsShader\"))\n\tif gpIsShader == nil {\n\t\treturn errors.New(\"glIsShader\")\n\t}\n\tgpIsStateNV = (C.GPISSTATENV)(getProcAddr(\"glIsStateNV\"))\n\tgpIsSync = (C.GPISSYNC)(getProcAddr(\"glIsSync\"))\n\tif gpIsSync == nil {\n\t\treturn errors.New(\"glIsSync\")\n\t}\n\tgpIsTexture = (C.GPISTEXTURE)(getProcAddr(\"glIsTexture\"))\n\tif gpIsTexture == nil {\n\t\treturn errors.New(\"glIsTexture\")\n\t}\n\tgpIsTextureHandleResidentARB = (C.GPISTEXTUREHANDLERESIDENTARB)(getProcAddr(\"glIsTextureHandleResidentARB\"))\n\tgpIsTextureHandleResidentNV = (C.GPISTEXTUREHANDLERESIDENTNV)(getProcAddr(\"glIsTextureHandleResidentNV\"))\n\tgpIsTransformFeedback = (C.GPISTRANSFORMFEEDBACK)(getProcAddr(\"glIsTransformFeedback\"))\n\tif gpIsTransformFeedback == nil {\n\t\treturn errors.New(\"glIsTransformFeedback\")\n\t}\n\tgpIsVertexArray = (C.GPISVERTEXARRAY)(getProcAddr(\"glIsVertexArray\"))\n\tif gpIsVertexArray == nil {\n\t\treturn errors.New(\"glIsVertexArray\")\n\t}\n\tgpLabelObjectEXT = (C.GPLABELOBJECTEXT)(getProcAddr(\"glLabelObjectEXT\"))\n\tgpLineWidth = (C.GPLINEWIDTH)(getProcAddr(\"glLineWidth\"))\n\tif gpLineWidth == nil {\n\t\treturn errors.New(\"glLineWidth\")\n\t}\n\tgpLinkProgram = (C.GPLINKPROGRAM)(getProcAddr(\"glLinkProgram\"))\n\tif gpLinkProgram == nil {\n\t\treturn errors.New(\"glLinkProgram\")\n\t}\n\tgpListDrawCommandsStatesClientNV = (C.GPLISTDRAWCOMMANDSSTATESCLIENTNV)(getProcAddr(\"glListDrawCommandsStatesClientNV\"))\n\tgpLogicOp = (C.GPLOGICOP)(getProcAddr(\"glLogicOp\"))\n\tif gpLogicOp == nil {\n\t\treturn errors.New(\"glLogicOp\")\n\t}\n\tgpMakeBufferNonResidentNV = (C.GPMAKEBUFFERNONRESIDENTNV)(getProcAddr(\"glMakeBufferNonResidentNV\"))\n\tgpMakeBufferResidentNV = (C.GPMAKEBUFFERRESIDENTNV)(getProcAddr(\"glMakeBufferResidentNV\"))\n\tgpMakeImageHandleNonResidentARB = (C.GPMAKEIMAGEHANDLENONRESIDENTARB)(getProcAddr(\"glMakeImageHandleNonResidentARB\"))\n\tgpMakeImageHandleNonResidentNV = (C.GPMAKEIMAGEHANDLENONRESIDENTNV)(getProcAddr(\"glMakeImageHandleNonResidentNV\"))\n\tgpMakeImageHandleResidentARB = (C.GPMAKEIMAGEHANDLERESIDENTARB)(getProcAddr(\"glMakeImageHandleResidentARB\"))\n\tgpMakeImageHandleResidentNV = (C.GPMAKEIMAGEHANDLERESIDENTNV)(getProcAddr(\"glMakeImageHandleResidentNV\"))\n\tgpMakeNamedBufferNonResidentNV = (C.GPMAKENAMEDBUFFERNONRESIDENTNV)(getProcAddr(\"glMakeNamedBufferNonResidentNV\"))\n\tgpMakeNamedBufferResidentNV = (C.GPMAKENAMEDBUFFERRESIDENTNV)(getProcAddr(\"glMakeNamedBufferResidentNV\"))\n\tgpMakeTextureHandleNonResidentARB = (C.GPMAKETEXTUREHANDLENONRESIDENTARB)(getProcAddr(\"glMakeTextureHandleNonResidentARB\"))\n\tgpMakeTextureHandleNonResidentNV = (C.GPMAKETEXTUREHANDLENONRESIDENTNV)(getProcAddr(\"glMakeTextureHandleNonResidentNV\"))\n\tgpMakeTextureHandleResidentARB = (C.GPMAKETEXTUREHANDLERESIDENTARB)(getProcAddr(\"glMakeTextureHandleResidentARB\"))\n\tgpMakeTextureHandleResidentNV = (C.GPMAKETEXTUREHANDLERESIDENTNV)(getProcAddr(\"glMakeTextureHandleResidentNV\"))\n\tgpMapBuffer = (C.GPMAPBUFFER)(getProcAddr(\"glMapBuffer\"))\n\tif gpMapBuffer == nil {\n\t\treturn errors.New(\"glMapBuffer\")\n\t}\n\tgpMapBufferRange = (C.GPMAPBUFFERRANGE)(getProcAddr(\"glMapBufferRange\"))\n\tif gpMapBufferRange == nil {\n\t\treturn errors.New(\"glMapBufferRange\")\n\t}\n\tgpMapNamedBuffer = (C.GPMAPNAMEDBUFFER)(getProcAddr(\"glMapNamedBuffer\"))\n\tgpMapNamedBufferEXT = (C.GPMAPNAMEDBUFFEREXT)(getProcAddr(\"glMapNamedBufferEXT\"))\n\tgpMapNamedBufferRange = (C.GPMAPNAMEDBUFFERRANGE)(getProcAddr(\"glMapNamedBufferRange\"))\n\tgpMapNamedBufferRangeEXT = (C.GPMAPNAMEDBUFFERRANGEEXT)(getProcAddr(\"glMapNamedBufferRangeEXT\"))\n\tgpMatrixFrustumEXT = (C.GPMATRIXFRUSTUMEXT)(getProcAddr(\"glMatrixFrustumEXT\"))\n\tgpMatrixLoad3x2fNV = (C.GPMATRIXLOAD3X2FNV)(getProcAddr(\"glMatrixLoad3x2fNV\"))\n\tgpMatrixLoad3x3fNV = (C.GPMATRIXLOAD3X3FNV)(getProcAddr(\"glMatrixLoad3x3fNV\"))\n\tgpMatrixLoadIdentityEXT = (C.GPMATRIXLOADIDENTITYEXT)(getProcAddr(\"glMatrixLoadIdentityEXT\"))\n\tgpMatrixLoadTranspose3x3fNV = (C.GPMATRIXLOADTRANSPOSE3X3FNV)(getProcAddr(\"glMatrixLoadTranspose3x3fNV\"))\n\tgpMatrixLoadTransposedEXT = (C.GPMATRIXLOADTRANSPOSEDEXT)(getProcAddr(\"glMatrixLoadTransposedEXT\"))\n\tgpMatrixLoadTransposefEXT = (C.GPMATRIXLOADTRANSPOSEFEXT)(getProcAddr(\"glMatrixLoadTransposefEXT\"))\n\tgpMatrixLoaddEXT = (C.GPMATRIXLOADDEXT)(getProcAddr(\"glMatrixLoaddEXT\"))\n\tgpMatrixLoadfEXT = (C.GPMATRIXLOADFEXT)(getProcAddr(\"glMatrixLoadfEXT\"))\n\tgpMatrixMult3x2fNV = (C.GPMATRIXMULT3X2FNV)(getProcAddr(\"glMatrixMult3x2fNV\"))\n\tgpMatrixMult3x3fNV = (C.GPMATRIXMULT3X3FNV)(getProcAddr(\"glMatrixMult3x3fNV\"))\n\tgpMatrixMultTranspose3x3fNV = (C.GPMATRIXMULTTRANSPOSE3X3FNV)(getProcAddr(\"glMatrixMultTranspose3x3fNV\"))\n\tgpMatrixMultTransposedEXT = (C.GPMATRIXMULTTRANSPOSEDEXT)(getProcAddr(\"glMatrixMultTransposedEXT\"))\n\tgpMatrixMultTransposefEXT = (C.GPMATRIXMULTTRANSPOSEFEXT)(getProcAddr(\"glMatrixMultTransposefEXT\"))\n\tgpMatrixMultdEXT = (C.GPMATRIXMULTDEXT)(getProcAddr(\"glMatrixMultdEXT\"))\n\tgpMatrixMultfEXT = (C.GPMATRIXMULTFEXT)(getProcAddr(\"glMatrixMultfEXT\"))\n\tgpMatrixOrthoEXT = (C.GPMATRIXORTHOEXT)(getProcAddr(\"glMatrixOrthoEXT\"))\n\tgpMatrixPopEXT = (C.GPMATRIXPOPEXT)(getProcAddr(\"glMatrixPopEXT\"))\n\tgpMatrixPushEXT = (C.GPMATRIXPUSHEXT)(getProcAddr(\"glMatrixPushEXT\"))\n\tgpMatrixRotatedEXT = (C.GPMATRIXROTATEDEXT)(getProcAddr(\"glMatrixRotatedEXT\"))\n\tgpMatrixRotatefEXT = (C.GPMATRIXROTATEFEXT)(getProcAddr(\"glMatrixRotatefEXT\"))\n\tgpMatrixScaledEXT = (C.GPMATRIXSCALEDEXT)(getProcAddr(\"glMatrixScaledEXT\"))\n\tgpMatrixScalefEXT = (C.GPMATRIXSCALEFEXT)(getProcAddr(\"glMatrixScalefEXT\"))\n\tgpMatrixTranslatedEXT = (C.GPMATRIXTRANSLATEDEXT)(getProcAddr(\"glMatrixTranslatedEXT\"))\n\tgpMatrixTranslatefEXT = (C.GPMATRIXTRANSLATEFEXT)(getProcAddr(\"glMatrixTranslatefEXT\"))\n\tgpMaxShaderCompilerThreadsARB = (C.GPMAXSHADERCOMPILERTHREADSARB)(getProcAddr(\"glMaxShaderCompilerThreadsARB\"))\n\tgpMaxShaderCompilerThreadsKHR = (C.GPMAXSHADERCOMPILERTHREADSKHR)(getProcAddr(\"glMaxShaderCompilerThreadsKHR\"))\n\tgpMemoryBarrier = (C.GPMEMORYBARRIER)(getProcAddr(\"glMemoryBarrier\"))\n\tif gpMemoryBarrier == nil {\n\t\treturn errors.New(\"glMemoryBarrier\")\n\t}\n\tgpMemoryBarrierByRegion = (C.GPMEMORYBARRIERBYREGION)(getProcAddr(\"glMemoryBarrierByRegion\"))\n\tgpMinSampleShading = (C.GPMINSAMPLESHADING)(getProcAddr(\"glMinSampleShading\"))\n\tif gpMinSampleShading == nil {\n\t\treturn errors.New(\"glMinSampleShading\")\n\t}\n\tgpMinSampleShadingARB = (C.GPMINSAMPLESHADINGARB)(getProcAddr(\"glMinSampleShadingARB\"))\n\tgpMultiDrawArrays = (C.GPMULTIDRAWARRAYS)(getProcAddr(\"glMultiDrawArrays\"))\n\tif gpMultiDrawArrays == nil {\n\t\treturn errors.New(\"glMultiDrawArrays\")\n\t}\n\tgpMultiDrawArraysIndirect = (C.GPMULTIDRAWARRAYSINDIRECT)(getProcAddr(\"glMultiDrawArraysIndirect\"))\n\tgpMultiDrawArraysIndirectBindlessCountNV = (C.GPMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNV)(getProcAddr(\"glMultiDrawArraysIndirectBindlessCountNV\"))\n\tgpMultiDrawArraysIndirectBindlessNV = (C.GPMULTIDRAWARRAYSINDIRECTBINDLESSNV)(getProcAddr(\"glMultiDrawArraysIndirectBindlessNV\"))\n\tgpMultiDrawArraysIndirectCountARB = (C.GPMULTIDRAWARRAYSINDIRECTCOUNTARB)(getProcAddr(\"glMultiDrawArraysIndirectCountARB\"))\n\tgpMultiDrawElements = (C.GPMULTIDRAWELEMENTS)(getProcAddr(\"glMultiDrawElements\"))\n\tif gpMultiDrawElements == nil {\n\t\treturn errors.New(\"glMultiDrawElements\")\n\t}\n\tgpMultiDrawElementsBaseVertex = (C.GPMULTIDRAWELEMENTSBASEVERTEX)(getProcAddr(\"glMultiDrawElementsBaseVertex\"))\n\tif gpMultiDrawElementsBaseVertex == nil {\n\t\treturn errors.New(\"glMultiDrawElementsBaseVertex\")\n\t}\n\tgpMultiDrawElementsIndirect = (C.GPMULTIDRAWELEMENTSINDIRECT)(getProcAddr(\"glMultiDrawElementsIndirect\"))\n\tgpMultiDrawElementsIndirectBindlessCountNV = (C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNV)(getProcAddr(\"glMultiDrawElementsIndirectBindlessCountNV\"))\n\tgpMultiDrawElementsIndirectBindlessNV = (C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSNV)(getProcAddr(\"glMultiDrawElementsIndirectBindlessNV\"))\n\tgpMultiDrawElementsIndirectCountARB = (C.GPMULTIDRAWELEMENTSINDIRECTCOUNTARB)(getProcAddr(\"glMultiDrawElementsIndirectCountARB\"))\n\tgpMultiDrawMeshTasksIndirectCountNV = (C.GPMULTIDRAWMESHTASKSINDIRECTCOUNTNV)(getProcAddr(\"glMultiDrawMeshTasksIndirectCountNV\"))\n\tgpMultiDrawMeshTasksIndirectNV = (C.GPMULTIDRAWMESHTASKSINDIRECTNV)(getProcAddr(\"glMultiDrawMeshTasksIndirectNV\"))\n\tgpMultiTexBufferEXT = (C.GPMULTITEXBUFFEREXT)(getProcAddr(\"glMultiTexBufferEXT\"))\n\tgpMultiTexCoordPointerEXT = (C.GPMULTITEXCOORDPOINTEREXT)(getProcAddr(\"glMultiTexCoordPointerEXT\"))\n\tgpMultiTexEnvfEXT = (C.GPMULTITEXENVFEXT)(getProcAddr(\"glMultiTexEnvfEXT\"))\n\tgpMultiTexEnvfvEXT = (C.GPMULTITEXENVFVEXT)(getProcAddr(\"glMultiTexEnvfvEXT\"))\n\tgpMultiTexEnviEXT = (C.GPMULTITEXENVIEXT)(getProcAddr(\"glMultiTexEnviEXT\"))\n\tgpMultiTexEnvivEXT = (C.GPMULTITEXENVIVEXT)(getProcAddr(\"glMultiTexEnvivEXT\"))\n\tgpMultiTexGendEXT = (C.GPMULTITEXGENDEXT)(getProcAddr(\"glMultiTexGendEXT\"))\n\tgpMultiTexGendvEXT = (C.GPMULTITEXGENDVEXT)(getProcAddr(\"glMultiTexGendvEXT\"))\n\tgpMultiTexGenfEXT = (C.GPMULTITEXGENFEXT)(getProcAddr(\"glMultiTexGenfEXT\"))\n\tgpMultiTexGenfvEXT = (C.GPMULTITEXGENFVEXT)(getProcAddr(\"glMultiTexGenfvEXT\"))\n\tgpMultiTexGeniEXT = (C.GPMULTITEXGENIEXT)(getProcAddr(\"glMultiTexGeniEXT\"))\n\tgpMultiTexGenivEXT = (C.GPMULTITEXGENIVEXT)(getProcAddr(\"glMultiTexGenivEXT\"))\n\tgpMultiTexImage1DEXT = (C.GPMULTITEXIMAGE1DEXT)(getProcAddr(\"glMultiTexImage1DEXT\"))\n\tgpMultiTexImage2DEXT = (C.GPMULTITEXIMAGE2DEXT)(getProcAddr(\"glMultiTexImage2DEXT\"))\n\tgpMultiTexImage3DEXT = (C.GPMULTITEXIMAGE3DEXT)(getProcAddr(\"glMultiTexImage3DEXT\"))\n\tgpMultiTexParameterIivEXT = (C.GPMULTITEXPARAMETERIIVEXT)(getProcAddr(\"glMultiTexParameterIivEXT\"))\n\tgpMultiTexParameterIuivEXT = (C.GPMULTITEXPARAMETERIUIVEXT)(getProcAddr(\"glMultiTexParameterIuivEXT\"))\n\tgpMultiTexParameterfEXT = (C.GPMULTITEXPARAMETERFEXT)(getProcAddr(\"glMultiTexParameterfEXT\"))\n\tgpMultiTexParameterfvEXT = (C.GPMULTITEXPARAMETERFVEXT)(getProcAddr(\"glMultiTexParameterfvEXT\"))\n\tgpMultiTexParameteriEXT = (C.GPMULTITEXPARAMETERIEXT)(getProcAddr(\"glMultiTexParameteriEXT\"))\n\tgpMultiTexParameterivEXT = (C.GPMULTITEXPARAMETERIVEXT)(getProcAddr(\"glMultiTexParameterivEXT\"))\n\tgpMultiTexRenderbufferEXT = (C.GPMULTITEXRENDERBUFFEREXT)(getProcAddr(\"glMultiTexRenderbufferEXT\"))\n\tgpMultiTexSubImage1DEXT = (C.GPMULTITEXSUBIMAGE1DEXT)(getProcAddr(\"glMultiTexSubImage1DEXT\"))\n\tgpMultiTexSubImage2DEXT = (C.GPMULTITEXSUBIMAGE2DEXT)(getProcAddr(\"glMultiTexSubImage2DEXT\"))\n\tgpMultiTexSubImage3DEXT = (C.GPMULTITEXSUBIMAGE3DEXT)(getProcAddr(\"glMultiTexSubImage3DEXT\"))\n\tgpNamedBufferAttachMemoryNV = (C.GPNAMEDBUFFERATTACHMEMORYNV)(getProcAddr(\"glNamedBufferAttachMemoryNV\"))\n\tgpNamedBufferData = (C.GPNAMEDBUFFERDATA)(getProcAddr(\"glNamedBufferData\"))\n\tgpNamedBufferDataEXT = (C.GPNAMEDBUFFERDATAEXT)(getProcAddr(\"glNamedBufferDataEXT\"))\n\tgpNamedBufferPageCommitmentARB = (C.GPNAMEDBUFFERPAGECOMMITMENTARB)(getProcAddr(\"glNamedBufferPageCommitmentARB\"))\n\tgpNamedBufferPageCommitmentEXT = (C.GPNAMEDBUFFERPAGECOMMITMENTEXT)(getProcAddr(\"glNamedBufferPageCommitmentEXT\"))\n\tgpNamedBufferPageCommitmentMemNV = (C.GPNAMEDBUFFERPAGECOMMITMENTMEMNV)(getProcAddr(\"glNamedBufferPageCommitmentMemNV\"))\n\tgpNamedBufferStorage = (C.GPNAMEDBUFFERSTORAGE)(getProcAddr(\"glNamedBufferStorage\"))\n\tgpNamedBufferStorageEXT = (C.GPNAMEDBUFFERSTORAGEEXT)(getProcAddr(\"glNamedBufferStorageEXT\"))\n\tgpNamedBufferSubData = (C.GPNAMEDBUFFERSUBDATA)(getProcAddr(\"glNamedBufferSubData\"))\n\tgpNamedBufferSubDataEXT = (C.GPNAMEDBUFFERSUBDATAEXT)(getProcAddr(\"glNamedBufferSubDataEXT\"))\n\tgpNamedCopyBufferSubDataEXT = (C.GPNAMEDCOPYBUFFERSUBDATAEXT)(getProcAddr(\"glNamedCopyBufferSubDataEXT\"))\n\tgpNamedFramebufferDrawBuffer = (C.GPNAMEDFRAMEBUFFERDRAWBUFFER)(getProcAddr(\"glNamedFramebufferDrawBuffer\"))\n\tgpNamedFramebufferDrawBuffers = (C.GPNAMEDFRAMEBUFFERDRAWBUFFERS)(getProcAddr(\"glNamedFramebufferDrawBuffers\"))\n\tgpNamedFramebufferParameteri = (C.GPNAMEDFRAMEBUFFERPARAMETERI)(getProcAddr(\"glNamedFramebufferParameteri\"))\n\tgpNamedFramebufferParameteriEXT = (C.GPNAMEDFRAMEBUFFERPARAMETERIEXT)(getProcAddr(\"glNamedFramebufferParameteriEXT\"))\n\tgpNamedFramebufferReadBuffer = (C.GPNAMEDFRAMEBUFFERREADBUFFER)(getProcAddr(\"glNamedFramebufferReadBuffer\"))\n\tgpNamedFramebufferRenderbuffer = (C.GPNAMEDFRAMEBUFFERRENDERBUFFER)(getProcAddr(\"glNamedFramebufferRenderbuffer\"))\n\tgpNamedFramebufferRenderbufferEXT = (C.GPNAMEDFRAMEBUFFERRENDERBUFFEREXT)(getProcAddr(\"glNamedFramebufferRenderbufferEXT\"))\n\tgpNamedFramebufferSampleLocationsfvARB = (C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARB)(getProcAddr(\"glNamedFramebufferSampleLocationsfvARB\"))\n\tgpNamedFramebufferSampleLocationsfvNV = (C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr(\"glNamedFramebufferSampleLocationsfvNV\"))\n\tgpNamedFramebufferTexture = (C.GPNAMEDFRAMEBUFFERTEXTURE)(getProcAddr(\"glNamedFramebufferTexture\"))\n\tgpNamedFramebufferTexture1DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE1DEXT)(getProcAddr(\"glNamedFramebufferTexture1DEXT\"))\n\tgpNamedFramebufferTexture2DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE2DEXT)(getProcAddr(\"glNamedFramebufferTexture2DEXT\"))\n\tgpNamedFramebufferTexture3DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE3DEXT)(getProcAddr(\"glNamedFramebufferTexture3DEXT\"))\n\tgpNamedFramebufferTextureEXT = (C.GPNAMEDFRAMEBUFFERTEXTUREEXT)(getProcAddr(\"glNamedFramebufferTextureEXT\"))\n\tgpNamedFramebufferTextureFaceEXT = (C.GPNAMEDFRAMEBUFFERTEXTUREFACEEXT)(getProcAddr(\"glNamedFramebufferTextureFaceEXT\"))\n\tgpNamedFramebufferTextureLayer = (C.GPNAMEDFRAMEBUFFERTEXTURELAYER)(getProcAddr(\"glNamedFramebufferTextureLayer\"))\n\tgpNamedFramebufferTextureLayerEXT = (C.GPNAMEDFRAMEBUFFERTEXTURELAYEREXT)(getProcAddr(\"glNamedFramebufferTextureLayerEXT\"))\n\tgpNamedProgramLocalParameter4dEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4DEXT)(getProcAddr(\"glNamedProgramLocalParameter4dEXT\"))\n\tgpNamedProgramLocalParameter4dvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4DVEXT)(getProcAddr(\"glNamedProgramLocalParameter4dvEXT\"))\n\tgpNamedProgramLocalParameter4fEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4FEXT)(getProcAddr(\"glNamedProgramLocalParameter4fEXT\"))\n\tgpNamedProgramLocalParameter4fvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4FVEXT)(getProcAddr(\"glNamedProgramLocalParameter4fvEXT\"))\n\tgpNamedProgramLocalParameterI4iEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4IEXT)(getProcAddr(\"glNamedProgramLocalParameterI4iEXT\"))\n\tgpNamedProgramLocalParameterI4ivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4IVEXT)(getProcAddr(\"glNamedProgramLocalParameterI4ivEXT\"))\n\tgpNamedProgramLocalParameterI4uiEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4UIEXT)(getProcAddr(\"glNamedProgramLocalParameterI4uiEXT\"))\n\tgpNamedProgramLocalParameterI4uivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4UIVEXT)(getProcAddr(\"glNamedProgramLocalParameterI4uivEXT\"))\n\tgpNamedProgramLocalParameters4fvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERS4FVEXT)(getProcAddr(\"glNamedProgramLocalParameters4fvEXT\"))\n\tgpNamedProgramLocalParametersI4ivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERSI4IVEXT)(getProcAddr(\"glNamedProgramLocalParametersI4ivEXT\"))\n\tgpNamedProgramLocalParametersI4uivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERSI4UIVEXT)(getProcAddr(\"glNamedProgramLocalParametersI4uivEXT\"))\n\tgpNamedProgramStringEXT = (C.GPNAMEDPROGRAMSTRINGEXT)(getProcAddr(\"glNamedProgramStringEXT\"))\n\tgpNamedRenderbufferStorage = (C.GPNAMEDRENDERBUFFERSTORAGE)(getProcAddr(\"glNamedRenderbufferStorage\"))\n\tgpNamedRenderbufferStorageEXT = (C.GPNAMEDRENDERBUFFERSTORAGEEXT)(getProcAddr(\"glNamedRenderbufferStorageEXT\"))\n\tgpNamedRenderbufferStorageMultisample = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr(\"glNamedRenderbufferStorageMultisample\"))\n\tgpNamedRenderbufferStorageMultisampleAdvancedAMD = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(getProcAddr(\"glNamedRenderbufferStorageMultisampleAdvancedAMD\"))\n\tgpNamedRenderbufferStorageMultisampleCoverageEXT = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXT)(getProcAddr(\"glNamedRenderbufferStorageMultisampleCoverageEXT\"))\n\tgpNamedRenderbufferStorageMultisampleEXT = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXT)(getProcAddr(\"glNamedRenderbufferStorageMultisampleEXT\"))\n\tgpNamedStringARB = (C.GPNAMEDSTRINGARB)(getProcAddr(\"glNamedStringARB\"))\n\tgpNormalFormatNV = (C.GPNORMALFORMATNV)(getProcAddr(\"glNormalFormatNV\"))\n\tgpObjectLabel = (C.GPOBJECTLABEL)(getProcAddr(\"glObjectLabel\"))\n\tgpObjectLabelKHR = (C.GPOBJECTLABELKHR)(getProcAddr(\"glObjectLabelKHR\"))\n\tgpObjectPtrLabel = (C.GPOBJECTPTRLABEL)(getProcAddr(\"glObjectPtrLabel\"))\n\tgpObjectPtrLabelKHR = (C.GPOBJECTPTRLABELKHR)(getProcAddr(\"glObjectPtrLabelKHR\"))\n\tgpPatchParameterfv = (C.GPPATCHPARAMETERFV)(getProcAddr(\"glPatchParameterfv\"))\n\tif gpPatchParameterfv == nil {\n\t\treturn errors.New(\"glPatchParameterfv\")\n\t}\n\tgpPatchParameteri = (C.GPPATCHPARAMETERI)(getProcAddr(\"glPatchParameteri\"))\n\tif gpPatchParameteri == nil {\n\t\treturn errors.New(\"glPatchParameteri\")\n\t}\n\tgpPathCommandsNV = (C.GPPATHCOMMANDSNV)(getProcAddr(\"glPathCommandsNV\"))\n\tgpPathCoordsNV = (C.GPPATHCOORDSNV)(getProcAddr(\"glPathCoordsNV\"))\n\tgpPathCoverDepthFuncNV = (C.GPPATHCOVERDEPTHFUNCNV)(getProcAddr(\"glPathCoverDepthFuncNV\"))\n\tgpPathDashArrayNV = (C.GPPATHDASHARRAYNV)(getProcAddr(\"glPathDashArrayNV\"))\n\tgpPathGlyphIndexArrayNV = (C.GPPATHGLYPHINDEXARRAYNV)(getProcAddr(\"glPathGlyphIndexArrayNV\"))\n\tgpPathGlyphIndexRangeNV = (C.GPPATHGLYPHINDEXRANGENV)(getProcAddr(\"glPathGlyphIndexRangeNV\"))\n\tgpPathGlyphRangeNV = (C.GPPATHGLYPHRANGENV)(getProcAddr(\"glPathGlyphRangeNV\"))\n\tgpPathGlyphsNV = (C.GPPATHGLYPHSNV)(getProcAddr(\"glPathGlyphsNV\"))\n\tgpPathMemoryGlyphIndexArrayNV = (C.GPPATHMEMORYGLYPHINDEXARRAYNV)(getProcAddr(\"glPathMemoryGlyphIndexArrayNV\"))\n\tgpPathParameterfNV = (C.GPPATHPARAMETERFNV)(getProcAddr(\"glPathParameterfNV\"))\n\tgpPathParameterfvNV = (C.GPPATHPARAMETERFVNV)(getProcAddr(\"glPathParameterfvNV\"))\n\tgpPathParameteriNV = (C.GPPATHPARAMETERINV)(getProcAddr(\"glPathParameteriNV\"))\n\tgpPathParameterivNV = (C.GPPATHPARAMETERIVNV)(getProcAddr(\"glPathParameterivNV\"))\n\tgpPathStencilDepthOffsetNV = (C.GPPATHSTENCILDEPTHOFFSETNV)(getProcAddr(\"glPathStencilDepthOffsetNV\"))\n\tgpPathStencilFuncNV = (C.GPPATHSTENCILFUNCNV)(getProcAddr(\"glPathStencilFuncNV\"))\n\tgpPathStringNV = (C.GPPATHSTRINGNV)(getProcAddr(\"glPathStringNV\"))\n\tgpPathSubCommandsNV = (C.GPPATHSUBCOMMANDSNV)(getProcAddr(\"glPathSubCommandsNV\"))\n\tgpPathSubCoordsNV = (C.GPPATHSUBCOORDSNV)(getProcAddr(\"glPathSubCoordsNV\"))\n\tgpPauseTransformFeedback = (C.GPPAUSETRANSFORMFEEDBACK)(getProcAddr(\"glPauseTransformFeedback\"))\n\tif gpPauseTransformFeedback == nil {\n\t\treturn errors.New(\"glPauseTransformFeedback\")\n\t}\n\tgpPixelStoref = (C.GPPIXELSTOREF)(getProcAddr(\"glPixelStoref\"))\n\tif gpPixelStoref == nil {\n\t\treturn errors.New(\"glPixelStoref\")\n\t}\n\tgpPixelStorei = (C.GPPIXELSTOREI)(getProcAddr(\"glPixelStorei\"))\n\tif gpPixelStorei == nil {\n\t\treturn errors.New(\"glPixelStorei\")\n\t}\n\tgpPointAlongPathNV = (C.GPPOINTALONGPATHNV)(getProcAddr(\"glPointAlongPathNV\"))\n\tgpPointParameterf = (C.GPPOINTPARAMETERF)(getProcAddr(\"glPointParameterf\"))\n\tif gpPointParameterf == nil {\n\t\treturn errors.New(\"glPointParameterf\")\n\t}\n\tgpPointParameterfv = (C.GPPOINTPARAMETERFV)(getProcAddr(\"glPointParameterfv\"))\n\tif gpPointParameterfv == nil {\n\t\treturn errors.New(\"glPointParameterfv\")\n\t}\n\tgpPointParameteri = (C.GPPOINTPARAMETERI)(getProcAddr(\"glPointParameteri\"))\n\tif gpPointParameteri == nil {\n\t\treturn errors.New(\"glPointParameteri\")\n\t}\n\tgpPointParameteriv = (C.GPPOINTPARAMETERIV)(getProcAddr(\"glPointParameteriv\"))\n\tif gpPointParameteriv == nil {\n\t\treturn errors.New(\"glPointParameteriv\")\n\t}\n\tgpPointSize = (C.GPPOINTSIZE)(getProcAddr(\"glPointSize\"))\n\tif gpPointSize == nil {\n\t\treturn errors.New(\"glPointSize\")\n\t}\n\tgpPolygonMode = (C.GPPOLYGONMODE)(getProcAddr(\"glPolygonMode\"))\n\tif gpPolygonMode == nil {\n\t\treturn errors.New(\"glPolygonMode\")\n\t}\n\tgpPolygonOffset = (C.GPPOLYGONOFFSET)(getProcAddr(\"glPolygonOffset\"))\n\tif gpPolygonOffset == nil {\n\t\treturn errors.New(\"glPolygonOffset\")\n\t}\n\tgpPolygonOffsetClamp = (C.GPPOLYGONOFFSETCLAMP)(getProcAddr(\"glPolygonOffsetClamp\"))\n\tgpPolygonOffsetClampEXT = (C.GPPOLYGONOFFSETCLAMPEXT)(getProcAddr(\"glPolygonOffsetClampEXT\"))\n\tgpPopDebugGroup = (C.GPPOPDEBUGGROUP)(getProcAddr(\"glPopDebugGroup\"))\n\tgpPopDebugGroupKHR = (C.GPPOPDEBUGGROUPKHR)(getProcAddr(\"glPopDebugGroupKHR\"))\n\tgpPopGroupMarkerEXT = (C.GPPOPGROUPMARKEREXT)(getProcAddr(\"glPopGroupMarkerEXT\"))\n\tgpPrimitiveBoundingBoxARB = (C.GPPRIMITIVEBOUNDINGBOXARB)(getProcAddr(\"glPrimitiveBoundingBoxARB\"))\n\tgpPrimitiveRestartIndex = (C.GPPRIMITIVERESTARTINDEX)(getProcAddr(\"glPrimitiveRestartIndex\"))\n\tif gpPrimitiveRestartIndex == nil {\n\t\treturn errors.New(\"glPrimitiveRestartIndex\")\n\t}\n\tgpProgramBinary = (C.GPPROGRAMBINARY)(getProcAddr(\"glProgramBinary\"))\n\tif gpProgramBinary == nil {\n\t\treturn errors.New(\"glProgramBinary\")\n\t}\n\tgpProgramParameteri = (C.GPPROGRAMPARAMETERI)(getProcAddr(\"glProgramParameteri\"))\n\tif gpProgramParameteri == nil {\n\t\treturn errors.New(\"glProgramParameteri\")\n\t}\n\tgpProgramParameteriARB = (C.GPPROGRAMPARAMETERIARB)(getProcAddr(\"glProgramParameteriARB\"))\n\tgpProgramParameteriEXT = (C.GPPROGRAMPARAMETERIEXT)(getProcAddr(\"glProgramParameteriEXT\"))\n\tgpProgramPathFragmentInputGenNV = (C.GPPROGRAMPATHFRAGMENTINPUTGENNV)(getProcAddr(\"glProgramPathFragmentInputGenNV\"))\n\tgpProgramUniform1d = (C.GPPROGRAMUNIFORM1D)(getProcAddr(\"glProgramUniform1d\"))\n\tif gpProgramUniform1d == nil {\n\t\treturn errors.New(\"glProgramUniform1d\")\n\t}\n\tgpProgramUniform1dEXT = (C.GPPROGRAMUNIFORM1DEXT)(getProcAddr(\"glProgramUniform1dEXT\"))\n\tgpProgramUniform1dv = (C.GPPROGRAMUNIFORM1DV)(getProcAddr(\"glProgramUniform1dv\"))\n\tif gpProgramUniform1dv == nil {\n\t\treturn errors.New(\"glProgramUniform1dv\")\n\t}\n\tgpProgramUniform1dvEXT = (C.GPPROGRAMUNIFORM1DVEXT)(getProcAddr(\"glProgramUniform1dvEXT\"))\n\tgpProgramUniform1f = (C.GPPROGRAMUNIFORM1F)(getProcAddr(\"glProgramUniform1f\"))\n\tif gpProgramUniform1f == nil {\n\t\treturn errors.New(\"glProgramUniform1f\")\n\t}\n\tgpProgramUniform1fEXT = (C.GPPROGRAMUNIFORM1FEXT)(getProcAddr(\"glProgramUniform1fEXT\"))\n\tgpProgramUniform1fv = (C.GPPROGRAMUNIFORM1FV)(getProcAddr(\"glProgramUniform1fv\"))\n\tif gpProgramUniform1fv == nil {\n\t\treturn errors.New(\"glProgramUniform1fv\")\n\t}\n\tgpProgramUniform1fvEXT = (C.GPPROGRAMUNIFORM1FVEXT)(getProcAddr(\"glProgramUniform1fvEXT\"))\n\tgpProgramUniform1i = (C.GPPROGRAMUNIFORM1I)(getProcAddr(\"glProgramUniform1i\"))\n\tif gpProgramUniform1i == nil {\n\t\treturn errors.New(\"glProgramUniform1i\")\n\t}\n\tgpProgramUniform1i64ARB = (C.GPPROGRAMUNIFORM1I64ARB)(getProcAddr(\"glProgramUniform1i64ARB\"))\n\tgpProgramUniform1i64NV = (C.GPPROGRAMUNIFORM1I64NV)(getProcAddr(\"glProgramUniform1i64NV\"))\n\tgpProgramUniform1i64vARB = (C.GPPROGRAMUNIFORM1I64VARB)(getProcAddr(\"glProgramUniform1i64vARB\"))\n\tgpProgramUniform1i64vNV = (C.GPPROGRAMUNIFORM1I64VNV)(getProcAddr(\"glProgramUniform1i64vNV\"))\n\tgpProgramUniform1iEXT = (C.GPPROGRAMUNIFORM1IEXT)(getProcAddr(\"glProgramUniform1iEXT\"))\n\tgpProgramUniform1iv = (C.GPPROGRAMUNIFORM1IV)(getProcAddr(\"glProgramUniform1iv\"))\n\tif gpProgramUniform1iv == nil {\n\t\treturn errors.New(\"glProgramUniform1iv\")\n\t}\n\tgpProgramUniform1ivEXT = (C.GPPROGRAMUNIFORM1IVEXT)(getProcAddr(\"glProgramUniform1ivEXT\"))\n\tgpProgramUniform1ui = (C.GPPROGRAMUNIFORM1UI)(getProcAddr(\"glProgramUniform1ui\"))\n\tif gpProgramUniform1ui == nil {\n\t\treturn errors.New(\"glProgramUniform1ui\")\n\t}\n\tgpProgramUniform1ui64ARB = (C.GPPROGRAMUNIFORM1UI64ARB)(getProcAddr(\"glProgramUniform1ui64ARB\"))\n\tgpProgramUniform1ui64NV = (C.GPPROGRAMUNIFORM1UI64NV)(getProcAddr(\"glProgramUniform1ui64NV\"))\n\tgpProgramUniform1ui64vARB = (C.GPPROGRAMUNIFORM1UI64VARB)(getProcAddr(\"glProgramUniform1ui64vARB\"))\n\tgpProgramUniform1ui64vNV = (C.GPPROGRAMUNIFORM1UI64VNV)(getProcAddr(\"glProgramUniform1ui64vNV\"))\n\tgpProgramUniform1uiEXT = (C.GPPROGRAMUNIFORM1UIEXT)(getProcAddr(\"glProgramUniform1uiEXT\"))\n\tgpProgramUniform1uiv = (C.GPPROGRAMUNIFORM1UIV)(getProcAddr(\"glProgramUniform1uiv\"))\n\tif gpProgramUniform1uiv == nil {\n\t\treturn errors.New(\"glProgramUniform1uiv\")\n\t}\n\tgpProgramUniform1uivEXT = (C.GPPROGRAMUNIFORM1UIVEXT)(getProcAddr(\"glProgramUniform1uivEXT\"))\n\tgpProgramUniform2d = (C.GPPROGRAMUNIFORM2D)(getProcAddr(\"glProgramUniform2d\"))\n\tif gpProgramUniform2d == nil {\n\t\treturn errors.New(\"glProgramUniform2d\")\n\t}\n\tgpProgramUniform2dEXT = (C.GPPROGRAMUNIFORM2DEXT)(getProcAddr(\"glProgramUniform2dEXT\"))\n\tgpProgramUniform2dv = (C.GPPROGRAMUNIFORM2DV)(getProcAddr(\"glProgramUniform2dv\"))\n\tif gpProgramUniform2dv == nil {\n\t\treturn errors.New(\"glProgramUniform2dv\")\n\t}\n\tgpProgramUniform2dvEXT = (C.GPPROGRAMUNIFORM2DVEXT)(getProcAddr(\"glProgramUniform2dvEXT\"))\n\tgpProgramUniform2f = (C.GPPROGRAMUNIFORM2F)(getProcAddr(\"glProgramUniform2f\"))\n\tif gpProgramUniform2f == nil {\n\t\treturn errors.New(\"glProgramUniform2f\")\n\t}\n\tgpProgramUniform2fEXT = (C.GPPROGRAMUNIFORM2FEXT)(getProcAddr(\"glProgramUniform2fEXT\"))\n\tgpProgramUniform2fv = (C.GPPROGRAMUNIFORM2FV)(getProcAddr(\"glProgramUniform2fv\"))\n\tif gpProgramUniform2fv == nil {\n\t\treturn errors.New(\"glProgramUniform2fv\")\n\t}\n\tgpProgramUniform2fvEXT = (C.GPPROGRAMUNIFORM2FVEXT)(getProcAddr(\"glProgramUniform2fvEXT\"))\n\tgpProgramUniform2i = (C.GPPROGRAMUNIFORM2I)(getProcAddr(\"glProgramUniform2i\"))\n\tif gpProgramUniform2i == nil {\n\t\treturn errors.New(\"glProgramUniform2i\")\n\t}\n\tgpProgramUniform2i64ARB = (C.GPPROGRAMUNIFORM2I64ARB)(getProcAddr(\"glProgramUniform2i64ARB\"))\n\tgpProgramUniform2i64NV = (C.GPPROGRAMUNIFORM2I64NV)(getProcAddr(\"glProgramUniform2i64NV\"))\n\tgpProgramUniform2i64vARB = (C.GPPROGRAMUNIFORM2I64VARB)(getProcAddr(\"glProgramUniform2i64vARB\"))\n\tgpProgramUniform2i64vNV = (C.GPPROGRAMUNIFORM2I64VNV)(getProcAddr(\"glProgramUniform2i64vNV\"))\n\tgpProgramUniform2iEXT = (C.GPPROGRAMUNIFORM2IEXT)(getProcAddr(\"glProgramUniform2iEXT\"))\n\tgpProgramUniform2iv = (C.GPPROGRAMUNIFORM2IV)(getProcAddr(\"glProgramUniform2iv\"))\n\tif gpProgramUniform2iv == nil {\n\t\treturn errors.New(\"glProgramUniform2iv\")\n\t}\n\tgpProgramUniform2ivEXT = (C.GPPROGRAMUNIFORM2IVEXT)(getProcAddr(\"glProgramUniform2ivEXT\"))\n\tgpProgramUniform2ui = (C.GPPROGRAMUNIFORM2UI)(getProcAddr(\"glProgramUniform2ui\"))\n\tif gpProgramUniform2ui == nil {\n\t\treturn errors.New(\"glProgramUniform2ui\")\n\t}\n\tgpProgramUniform2ui64ARB = (C.GPPROGRAMUNIFORM2UI64ARB)(getProcAddr(\"glProgramUniform2ui64ARB\"))\n\tgpProgramUniform2ui64NV = (C.GPPROGRAMUNIFORM2UI64NV)(getProcAddr(\"glProgramUniform2ui64NV\"))\n\tgpProgramUniform2ui64vARB = (C.GPPROGRAMUNIFORM2UI64VARB)(getProcAddr(\"glProgramUniform2ui64vARB\"))\n\tgpProgramUniform2ui64vNV = (C.GPPROGRAMUNIFORM2UI64VNV)(getProcAddr(\"glProgramUniform2ui64vNV\"))\n\tgpProgramUniform2uiEXT = (C.GPPROGRAMUNIFORM2UIEXT)(getProcAddr(\"glProgramUniform2uiEXT\"))\n\tgpProgramUniform2uiv = (C.GPPROGRAMUNIFORM2UIV)(getProcAddr(\"glProgramUniform2uiv\"))\n\tif gpProgramUniform2uiv == nil {\n\t\treturn errors.New(\"glProgramUniform2uiv\")\n\t}\n\tgpProgramUniform2uivEXT = (C.GPPROGRAMUNIFORM2UIVEXT)(getProcAddr(\"glProgramUniform2uivEXT\"))\n\tgpProgramUniform3d = (C.GPPROGRAMUNIFORM3D)(getProcAddr(\"glProgramUniform3d\"))\n\tif gpProgramUniform3d == nil {\n\t\treturn errors.New(\"glProgramUniform3d\")\n\t}\n\tgpProgramUniform3dEXT = (C.GPPROGRAMUNIFORM3DEXT)(getProcAddr(\"glProgramUniform3dEXT\"))\n\tgpProgramUniform3dv = (C.GPPROGRAMUNIFORM3DV)(getProcAddr(\"glProgramUniform3dv\"))\n\tif gpProgramUniform3dv == nil {\n\t\treturn errors.New(\"glProgramUniform3dv\")\n\t}\n\tgpProgramUniform3dvEXT = (C.GPPROGRAMUNIFORM3DVEXT)(getProcAddr(\"glProgramUniform3dvEXT\"))\n\tgpProgramUniform3f = (C.GPPROGRAMUNIFORM3F)(getProcAddr(\"glProgramUniform3f\"))\n\tif gpProgramUniform3f == nil {\n\t\treturn errors.New(\"glProgramUniform3f\")\n\t}\n\tgpProgramUniform3fEXT = (C.GPPROGRAMUNIFORM3FEXT)(getProcAddr(\"glProgramUniform3fEXT\"))\n\tgpProgramUniform3fv = (C.GPPROGRAMUNIFORM3FV)(getProcAddr(\"glProgramUniform3fv\"))\n\tif gpProgramUniform3fv == nil {\n\t\treturn errors.New(\"glProgramUniform3fv\")\n\t}\n\tgpProgramUniform3fvEXT = (C.GPPROGRAMUNIFORM3FVEXT)(getProcAddr(\"glProgramUniform3fvEXT\"))\n\tgpProgramUniform3i = (C.GPPROGRAMUNIFORM3I)(getProcAddr(\"glProgramUniform3i\"))\n\tif gpProgramUniform3i == nil {\n\t\treturn errors.New(\"glProgramUniform3i\")\n\t}\n\tgpProgramUniform3i64ARB = (C.GPPROGRAMUNIFORM3I64ARB)(getProcAddr(\"glProgramUniform3i64ARB\"))\n\tgpProgramUniform3i64NV = (C.GPPROGRAMUNIFORM3I64NV)(getProcAddr(\"glProgramUniform3i64NV\"))\n\tgpProgramUniform3i64vARB = (C.GPPROGRAMUNIFORM3I64VARB)(getProcAddr(\"glProgramUniform3i64vARB\"))\n\tgpProgramUniform3i64vNV = (C.GPPROGRAMUNIFORM3I64VNV)(getProcAddr(\"glProgramUniform3i64vNV\"))\n\tgpProgramUniform3iEXT = (C.GPPROGRAMUNIFORM3IEXT)(getProcAddr(\"glProgramUniform3iEXT\"))\n\tgpProgramUniform3iv = (C.GPPROGRAMUNIFORM3IV)(getProcAddr(\"glProgramUniform3iv\"))\n\tif gpProgramUniform3iv == nil {\n\t\treturn errors.New(\"glProgramUniform3iv\")\n\t}\n\tgpProgramUniform3ivEXT = (C.GPPROGRAMUNIFORM3IVEXT)(getProcAddr(\"glProgramUniform3ivEXT\"))\n\tgpProgramUniform3ui = (C.GPPROGRAMUNIFORM3UI)(getProcAddr(\"glProgramUniform3ui\"))\n\tif gpProgramUniform3ui == nil {\n\t\treturn errors.New(\"glProgramUniform3ui\")\n\t}\n\tgpProgramUniform3ui64ARB = (C.GPPROGRAMUNIFORM3UI64ARB)(getProcAddr(\"glProgramUniform3ui64ARB\"))\n\tgpProgramUniform3ui64NV = (C.GPPROGRAMUNIFORM3UI64NV)(getProcAddr(\"glProgramUniform3ui64NV\"))\n\tgpProgramUniform3ui64vARB = (C.GPPROGRAMUNIFORM3UI64VARB)(getProcAddr(\"glProgramUniform3ui64vARB\"))\n\tgpProgramUniform3ui64vNV = (C.GPPROGRAMUNIFORM3UI64VNV)(getProcAddr(\"glProgramUniform3ui64vNV\"))\n\tgpProgramUniform3uiEXT = (C.GPPROGRAMUNIFORM3UIEXT)(getProcAddr(\"glProgramUniform3uiEXT\"))\n\tgpProgramUniform3uiv = (C.GPPROGRAMUNIFORM3UIV)(getProcAddr(\"glProgramUniform3uiv\"))\n\tif gpProgramUniform3uiv == nil {\n\t\treturn errors.New(\"glProgramUniform3uiv\")\n\t}\n\tgpProgramUniform3uivEXT = (C.GPPROGRAMUNIFORM3UIVEXT)(getProcAddr(\"glProgramUniform3uivEXT\"))\n\tgpProgramUniform4d = (C.GPPROGRAMUNIFORM4D)(getProcAddr(\"glProgramUniform4d\"))\n\tif gpProgramUniform4d == nil {\n\t\treturn errors.New(\"glProgramUniform4d\")\n\t}\n\tgpProgramUniform4dEXT = (C.GPPROGRAMUNIFORM4DEXT)(getProcAddr(\"glProgramUniform4dEXT\"))\n\tgpProgramUniform4dv = (C.GPPROGRAMUNIFORM4DV)(getProcAddr(\"glProgramUniform4dv\"))\n\tif gpProgramUniform4dv == nil {\n\t\treturn errors.New(\"glProgramUniform4dv\")\n\t}\n\tgpProgramUniform4dvEXT = (C.GPPROGRAMUNIFORM4DVEXT)(getProcAddr(\"glProgramUniform4dvEXT\"))\n\tgpProgramUniform4f = (C.GPPROGRAMUNIFORM4F)(getProcAddr(\"glProgramUniform4f\"))\n\tif gpProgramUniform4f == nil {\n\t\treturn errors.New(\"glProgramUniform4f\")\n\t}\n\tgpProgramUniform4fEXT = (C.GPPROGRAMUNIFORM4FEXT)(getProcAddr(\"glProgramUniform4fEXT\"))\n\tgpProgramUniform4fv = (C.GPPROGRAMUNIFORM4FV)(getProcAddr(\"glProgramUniform4fv\"))\n\tif gpProgramUniform4fv == nil {\n\t\treturn errors.New(\"glProgramUniform4fv\")\n\t}\n\tgpProgramUniform4fvEXT = (C.GPPROGRAMUNIFORM4FVEXT)(getProcAddr(\"glProgramUniform4fvEXT\"))\n\tgpProgramUniform4i = (C.GPPROGRAMUNIFORM4I)(getProcAddr(\"glProgramUniform4i\"))\n\tif gpProgramUniform4i == nil {\n\t\treturn errors.New(\"glProgramUniform4i\")\n\t}\n\tgpProgramUniform4i64ARB = (C.GPPROGRAMUNIFORM4I64ARB)(getProcAddr(\"glProgramUniform4i64ARB\"))\n\tgpProgramUniform4i64NV = (C.GPPROGRAMUNIFORM4I64NV)(getProcAddr(\"glProgramUniform4i64NV\"))\n\tgpProgramUniform4i64vARB = (C.GPPROGRAMUNIFORM4I64VARB)(getProcAddr(\"glProgramUniform4i64vARB\"))\n\tgpProgramUniform4i64vNV = (C.GPPROGRAMUNIFORM4I64VNV)(getProcAddr(\"glProgramUniform4i64vNV\"))\n\tgpProgramUniform4iEXT = (C.GPPROGRAMUNIFORM4IEXT)(getProcAddr(\"glProgramUniform4iEXT\"))\n\tgpProgramUniform4iv = (C.GPPROGRAMUNIFORM4IV)(getProcAddr(\"glProgramUniform4iv\"))\n\tif gpProgramUniform4iv == nil {\n\t\treturn errors.New(\"glProgramUniform4iv\")\n\t}\n\tgpProgramUniform4ivEXT = (C.GPPROGRAMUNIFORM4IVEXT)(getProcAddr(\"glProgramUniform4ivEXT\"))\n\tgpProgramUniform4ui = (C.GPPROGRAMUNIFORM4UI)(getProcAddr(\"glProgramUniform4ui\"))\n\tif gpProgramUniform4ui == nil {\n\t\treturn errors.New(\"glProgramUniform4ui\")\n\t}\n\tgpProgramUniform4ui64ARB = (C.GPPROGRAMUNIFORM4UI64ARB)(getProcAddr(\"glProgramUniform4ui64ARB\"))\n\tgpProgramUniform4ui64NV = (C.GPPROGRAMUNIFORM4UI64NV)(getProcAddr(\"glProgramUniform4ui64NV\"))\n\tgpProgramUniform4ui64vARB = (C.GPPROGRAMUNIFORM4UI64VARB)(getProcAddr(\"glProgramUniform4ui64vARB\"))\n\tgpProgramUniform4ui64vNV = (C.GPPROGRAMUNIFORM4UI64VNV)(getProcAddr(\"glProgramUniform4ui64vNV\"))\n\tgpProgramUniform4uiEXT = (C.GPPROGRAMUNIFORM4UIEXT)(getProcAddr(\"glProgramUniform4uiEXT\"))\n\tgpProgramUniform4uiv = (C.GPPROGRAMUNIFORM4UIV)(getProcAddr(\"glProgramUniform4uiv\"))\n\tif gpProgramUniform4uiv == nil {\n\t\treturn errors.New(\"glProgramUniform4uiv\")\n\t}\n\tgpProgramUniform4uivEXT = (C.GPPROGRAMUNIFORM4UIVEXT)(getProcAddr(\"glProgramUniform4uivEXT\"))\n\tgpProgramUniformHandleui64ARB = (C.GPPROGRAMUNIFORMHANDLEUI64ARB)(getProcAddr(\"glProgramUniformHandleui64ARB\"))\n\tgpProgramUniformHandleui64NV = (C.GPPROGRAMUNIFORMHANDLEUI64NV)(getProcAddr(\"glProgramUniformHandleui64NV\"))\n\tgpProgramUniformHandleui64vARB = (C.GPPROGRAMUNIFORMHANDLEUI64VARB)(getProcAddr(\"glProgramUniformHandleui64vARB\"))\n\tgpProgramUniformHandleui64vNV = (C.GPPROGRAMUNIFORMHANDLEUI64VNV)(getProcAddr(\"glProgramUniformHandleui64vNV\"))\n\tgpProgramUniformMatrix2dv = (C.GPPROGRAMUNIFORMMATRIX2DV)(getProcAddr(\"glProgramUniformMatrix2dv\"))\n\tif gpProgramUniformMatrix2dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2dv\")\n\t}\n\tgpProgramUniformMatrix2dvEXT = (C.GPPROGRAMUNIFORMMATRIX2DVEXT)(getProcAddr(\"glProgramUniformMatrix2dvEXT\"))\n\tgpProgramUniformMatrix2fv = (C.GPPROGRAMUNIFORMMATRIX2FV)(getProcAddr(\"glProgramUniformMatrix2fv\"))\n\tif gpProgramUniformMatrix2fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2fv\")\n\t}\n\tgpProgramUniformMatrix2fvEXT = (C.GPPROGRAMUNIFORMMATRIX2FVEXT)(getProcAddr(\"glProgramUniformMatrix2fvEXT\"))\n\tgpProgramUniformMatrix2x3dv = (C.GPPROGRAMUNIFORMMATRIX2X3DV)(getProcAddr(\"glProgramUniformMatrix2x3dv\"))\n\tif gpProgramUniformMatrix2x3dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x3dv\")\n\t}\n\tgpProgramUniformMatrix2x3dvEXT = (C.GPPROGRAMUNIFORMMATRIX2X3DVEXT)(getProcAddr(\"glProgramUniformMatrix2x3dvEXT\"))\n\tgpProgramUniformMatrix2x3fv = (C.GPPROGRAMUNIFORMMATRIX2X3FV)(getProcAddr(\"glProgramUniformMatrix2x3fv\"))\n\tif gpProgramUniformMatrix2x3fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x3fv\")\n\t}\n\tgpProgramUniformMatrix2x3fvEXT = (C.GPPROGRAMUNIFORMMATRIX2X3FVEXT)(getProcAddr(\"glProgramUniformMatrix2x3fvEXT\"))\n\tgpProgramUniformMatrix2x4dv = (C.GPPROGRAMUNIFORMMATRIX2X4DV)(getProcAddr(\"glProgramUniformMatrix2x4dv\"))\n\tif gpProgramUniformMatrix2x4dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x4dv\")\n\t}\n\tgpProgramUniformMatrix2x4dvEXT = (C.GPPROGRAMUNIFORMMATRIX2X4DVEXT)(getProcAddr(\"glProgramUniformMatrix2x4dvEXT\"))\n\tgpProgramUniformMatrix2x4fv = (C.GPPROGRAMUNIFORMMATRIX2X4FV)(getProcAddr(\"glProgramUniformMatrix2x4fv\"))\n\tif gpProgramUniformMatrix2x4fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x4fv\")\n\t}\n\tgpProgramUniformMatrix2x4fvEXT = (C.GPPROGRAMUNIFORMMATRIX2X4FVEXT)(getProcAddr(\"glProgramUniformMatrix2x4fvEXT\"))\n\tgpProgramUniformMatrix3dv = (C.GPPROGRAMUNIFORMMATRIX3DV)(getProcAddr(\"glProgramUniformMatrix3dv\"))\n\tif gpProgramUniformMatrix3dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3dv\")\n\t}\n\tgpProgramUniformMatrix3dvEXT = (C.GPPROGRAMUNIFORMMATRIX3DVEXT)(getProcAddr(\"glProgramUniformMatrix3dvEXT\"))\n\tgpProgramUniformMatrix3fv = (C.GPPROGRAMUNIFORMMATRIX3FV)(getProcAddr(\"glProgramUniformMatrix3fv\"))\n\tif gpProgramUniformMatrix3fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3fv\")\n\t}\n\tgpProgramUniformMatrix3fvEXT = (C.GPPROGRAMUNIFORMMATRIX3FVEXT)(getProcAddr(\"glProgramUniformMatrix3fvEXT\"))\n\tgpProgramUniformMatrix3x2dv = (C.GPPROGRAMUNIFORMMATRIX3X2DV)(getProcAddr(\"glProgramUniformMatrix3x2dv\"))\n\tif gpProgramUniformMatrix3x2dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x2dv\")\n\t}\n\tgpProgramUniformMatrix3x2dvEXT = (C.GPPROGRAMUNIFORMMATRIX3X2DVEXT)(getProcAddr(\"glProgramUniformMatrix3x2dvEXT\"))\n\tgpProgramUniformMatrix3x2fv = (C.GPPROGRAMUNIFORMMATRIX3X2FV)(getProcAddr(\"glProgramUniformMatrix3x2fv\"))\n\tif gpProgramUniformMatrix3x2fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x2fv\")\n\t}\n\tgpProgramUniformMatrix3x2fvEXT = (C.GPPROGRAMUNIFORMMATRIX3X2FVEXT)(getProcAddr(\"glProgramUniformMatrix3x2fvEXT\"))\n\tgpProgramUniformMatrix3x4dv = (C.GPPROGRAMUNIFORMMATRIX3X4DV)(getProcAddr(\"glProgramUniformMatrix3x4dv\"))\n\tif gpProgramUniformMatrix3x4dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x4dv\")\n\t}\n\tgpProgramUniformMatrix3x4dvEXT = (C.GPPROGRAMUNIFORMMATRIX3X4DVEXT)(getProcAddr(\"glProgramUniformMatrix3x4dvEXT\"))\n\tgpProgramUniformMatrix3x4fv = (C.GPPROGRAMUNIFORMMATRIX3X4FV)(getProcAddr(\"glProgramUniformMatrix3x4fv\"))\n\tif gpProgramUniformMatrix3x4fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x4fv\")\n\t}\n\tgpProgramUniformMatrix3x4fvEXT = (C.GPPROGRAMUNIFORMMATRIX3X4FVEXT)(getProcAddr(\"glProgramUniformMatrix3x4fvEXT\"))\n\tgpProgramUniformMatrix4dv = (C.GPPROGRAMUNIFORMMATRIX4DV)(getProcAddr(\"glProgramUniformMatrix4dv\"))\n\tif gpProgramUniformMatrix4dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4dv\")\n\t}\n\tgpProgramUniformMatrix4dvEXT = (C.GPPROGRAMUNIFORMMATRIX4DVEXT)(getProcAddr(\"glProgramUniformMatrix4dvEXT\"))\n\tgpProgramUniformMatrix4fv = (C.GPPROGRAMUNIFORMMATRIX4FV)(getProcAddr(\"glProgramUniformMatrix4fv\"))\n\tif gpProgramUniformMatrix4fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4fv\")\n\t}\n\tgpProgramUniformMatrix4fvEXT = (C.GPPROGRAMUNIFORMMATRIX4FVEXT)(getProcAddr(\"glProgramUniformMatrix4fvEXT\"))\n\tgpProgramUniformMatrix4x2dv = (C.GPPROGRAMUNIFORMMATRIX4X2DV)(getProcAddr(\"glProgramUniformMatrix4x2dv\"))\n\tif gpProgramUniformMatrix4x2dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x2dv\")\n\t}\n\tgpProgramUniformMatrix4x2dvEXT = (C.GPPROGRAMUNIFORMMATRIX4X2DVEXT)(getProcAddr(\"glProgramUniformMatrix4x2dvEXT\"))\n\tgpProgramUniformMatrix4x2fv = (C.GPPROGRAMUNIFORMMATRIX4X2FV)(getProcAddr(\"glProgramUniformMatrix4x2fv\"))\n\tif gpProgramUniformMatrix4x2fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x2fv\")\n\t}\n\tgpProgramUniformMatrix4x2fvEXT = (C.GPPROGRAMUNIFORMMATRIX4X2FVEXT)(getProcAddr(\"glProgramUniformMatrix4x2fvEXT\"))\n\tgpProgramUniformMatrix4x3dv = (C.GPPROGRAMUNIFORMMATRIX4X3DV)(getProcAddr(\"glProgramUniformMatrix4x3dv\"))\n\tif gpProgramUniformMatrix4x3dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x3dv\")\n\t}\n\tgpProgramUniformMatrix4x3dvEXT = (C.GPPROGRAMUNIFORMMATRIX4X3DVEXT)(getProcAddr(\"glProgramUniformMatrix4x3dvEXT\"))\n\tgpProgramUniformMatrix4x3fv = (C.GPPROGRAMUNIFORMMATRIX4X3FV)(getProcAddr(\"glProgramUniformMatrix4x3fv\"))\n\tif gpProgramUniformMatrix4x3fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x3fv\")\n\t}\n\tgpProgramUniformMatrix4x3fvEXT = (C.GPPROGRAMUNIFORMMATRIX4X3FVEXT)(getProcAddr(\"glProgramUniformMatrix4x3fvEXT\"))\n\tgpProgramUniformui64NV = (C.GPPROGRAMUNIFORMUI64NV)(getProcAddr(\"glProgramUniformui64NV\"))\n\tgpProgramUniformui64vNV = (C.GPPROGRAMUNIFORMUI64VNV)(getProcAddr(\"glProgramUniformui64vNV\"))\n\tgpProvokingVertex = (C.GPPROVOKINGVERTEX)(getProcAddr(\"glProvokingVertex\"))\n\tif gpProvokingVertex == nil {\n\t\treturn errors.New(\"glProvokingVertex\")\n\t}\n\tgpPushClientAttribDefaultEXT = (C.GPPUSHCLIENTATTRIBDEFAULTEXT)(getProcAddr(\"glPushClientAttribDefaultEXT\"))\n\tgpPushDebugGroup = (C.GPPUSHDEBUGGROUP)(getProcAddr(\"glPushDebugGroup\"))\n\tgpPushDebugGroupKHR = (C.GPPUSHDEBUGGROUPKHR)(getProcAddr(\"glPushDebugGroupKHR\"))\n\tgpPushGroupMarkerEXT = (C.GPPUSHGROUPMARKEREXT)(getProcAddr(\"glPushGroupMarkerEXT\"))\n\tgpQueryCounter = (C.GPQUERYCOUNTER)(getProcAddr(\"glQueryCounter\"))\n\tif gpQueryCounter == nil {\n\t\treturn errors.New(\"glQueryCounter\")\n\t}\n\tgpRasterSamplesEXT = (C.GPRASTERSAMPLESEXT)(getProcAddr(\"glRasterSamplesEXT\"))\n\tgpReadBuffer = (C.GPREADBUFFER)(getProcAddr(\"glReadBuffer\"))\n\tif gpReadBuffer == nil {\n\t\treturn errors.New(\"glReadBuffer\")\n\t}\n\tgpReadPixels = (C.GPREADPIXELS)(getProcAddr(\"glReadPixels\"))\n\tif gpReadPixels == nil {\n\t\treturn errors.New(\"glReadPixels\")\n\t}\n\tgpReadnPixels = (C.GPREADNPIXELS)(getProcAddr(\"glReadnPixels\"))\n\tgpReadnPixelsARB = (C.GPREADNPIXELSARB)(getProcAddr(\"glReadnPixelsARB\"))\n\tgpReadnPixelsKHR = (C.GPREADNPIXELSKHR)(getProcAddr(\"glReadnPixelsKHR\"))\n\tgpReleaseShaderCompiler = (C.GPRELEASESHADERCOMPILER)(getProcAddr(\"glReleaseShaderCompiler\"))\n\tif gpReleaseShaderCompiler == nil {\n\t\treturn errors.New(\"glReleaseShaderCompiler\")\n\t}\n\tgpRenderbufferStorage = (C.GPRENDERBUFFERSTORAGE)(getProcAddr(\"glRenderbufferStorage\"))\n\tif gpRenderbufferStorage == nil {\n\t\treturn errors.New(\"glRenderbufferStorage\")\n\t}\n\tgpRenderbufferStorageMultisample = (C.GPRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr(\"glRenderbufferStorageMultisample\"))\n\tif gpRenderbufferStorageMultisample == nil {\n\t\treturn errors.New(\"glRenderbufferStorageMultisample\")\n\t}\n\tgpRenderbufferStorageMultisampleAdvancedAMD = (C.GPRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(getProcAddr(\"glRenderbufferStorageMultisampleAdvancedAMD\"))\n\tgpRenderbufferStorageMultisampleCoverageNV = (C.GPRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENV)(getProcAddr(\"glRenderbufferStorageMultisampleCoverageNV\"))\n\tgpResetMemoryObjectParameterNV = (C.GPRESETMEMORYOBJECTPARAMETERNV)(getProcAddr(\"glResetMemoryObjectParameterNV\"))\n\tgpResolveDepthValuesNV = (C.GPRESOLVEDEPTHVALUESNV)(getProcAddr(\"glResolveDepthValuesNV\"))\n\tgpResumeTransformFeedback = (C.GPRESUMETRANSFORMFEEDBACK)(getProcAddr(\"glResumeTransformFeedback\"))\n\tif gpResumeTransformFeedback == nil {\n\t\treturn errors.New(\"glResumeTransformFeedback\")\n\t}\n\tgpSampleCoverage = (C.GPSAMPLECOVERAGE)(getProcAddr(\"glSampleCoverage\"))\n\tif gpSampleCoverage == nil {\n\t\treturn errors.New(\"glSampleCoverage\")\n\t}\n\tgpSampleMaski = (C.GPSAMPLEMASKI)(getProcAddr(\"glSampleMaski\"))\n\tif gpSampleMaski == nil {\n\t\treturn errors.New(\"glSampleMaski\")\n\t}\n\tgpSamplerParameterIiv = (C.GPSAMPLERPARAMETERIIV)(getProcAddr(\"glSamplerParameterIiv\"))\n\tif gpSamplerParameterIiv == nil {\n\t\treturn errors.New(\"glSamplerParameterIiv\")\n\t}\n\tgpSamplerParameterIuiv = (C.GPSAMPLERPARAMETERIUIV)(getProcAddr(\"glSamplerParameterIuiv\"))\n\tif gpSamplerParameterIuiv == nil {\n\t\treturn errors.New(\"glSamplerParameterIuiv\")\n\t}\n\tgpSamplerParameterf = (C.GPSAMPLERPARAMETERF)(getProcAddr(\"glSamplerParameterf\"))\n\tif gpSamplerParameterf == nil {\n\t\treturn errors.New(\"glSamplerParameterf\")\n\t}\n\tgpSamplerParameterfv = (C.GPSAMPLERPARAMETERFV)(getProcAddr(\"glSamplerParameterfv\"))\n\tif gpSamplerParameterfv == nil {\n\t\treturn errors.New(\"glSamplerParameterfv\")\n\t}\n\tgpSamplerParameteri = (C.GPSAMPLERPARAMETERI)(getProcAddr(\"glSamplerParameteri\"))\n\tif gpSamplerParameteri == nil {\n\t\treturn errors.New(\"glSamplerParameteri\")\n\t}\n\tgpSamplerParameteriv = (C.GPSAMPLERPARAMETERIV)(getProcAddr(\"glSamplerParameteriv\"))\n\tif gpSamplerParameteriv == nil {\n\t\treturn errors.New(\"glSamplerParameteriv\")\n\t}\n\tgpScissor = (C.GPSCISSOR)(getProcAddr(\"glScissor\"))\n\tif gpScissor == nil {\n\t\treturn errors.New(\"glScissor\")\n\t}\n\tgpScissorArrayv = (C.GPSCISSORARRAYV)(getProcAddr(\"glScissorArrayv\"))\n\tif gpScissorArrayv == nil {\n\t\treturn errors.New(\"glScissorArrayv\")\n\t}\n\tgpScissorExclusiveArrayvNV = (C.GPSCISSOREXCLUSIVEARRAYVNV)(getProcAddr(\"glScissorExclusiveArrayvNV\"))\n\tgpScissorExclusiveNV = (C.GPSCISSOREXCLUSIVENV)(getProcAddr(\"glScissorExclusiveNV\"))\n\tgpScissorIndexed = (C.GPSCISSORINDEXED)(getProcAddr(\"glScissorIndexed\"))\n\tif gpScissorIndexed == nil {\n\t\treturn errors.New(\"glScissorIndexed\")\n\t}\n\tgpScissorIndexedv = (C.GPSCISSORINDEXEDV)(getProcAddr(\"glScissorIndexedv\"))\n\tif gpScissorIndexedv == nil {\n\t\treturn errors.New(\"glScissorIndexedv\")\n\t}\n\tgpSecondaryColorFormatNV = (C.GPSECONDARYCOLORFORMATNV)(getProcAddr(\"glSecondaryColorFormatNV\"))\n\tgpSelectPerfMonitorCountersAMD = (C.GPSELECTPERFMONITORCOUNTERSAMD)(getProcAddr(\"glSelectPerfMonitorCountersAMD\"))\n\tgpShaderBinary = (C.GPSHADERBINARY)(getProcAddr(\"glShaderBinary\"))\n\tif gpShaderBinary == nil {\n\t\treturn errors.New(\"glShaderBinary\")\n\t}\n\tgpShaderSource = (C.GPSHADERSOURCE)(getProcAddr(\"glShaderSource\"))\n\tif gpShaderSource == nil {\n\t\treturn errors.New(\"glShaderSource\")\n\t}\n\tgpShaderStorageBlockBinding = (C.GPSHADERSTORAGEBLOCKBINDING)(getProcAddr(\"glShaderStorageBlockBinding\"))\n\tgpShadingRateImageBarrierNV = (C.GPSHADINGRATEIMAGEBARRIERNV)(getProcAddr(\"glShadingRateImageBarrierNV\"))\n\tgpShadingRateImagePaletteNV = (C.GPSHADINGRATEIMAGEPALETTENV)(getProcAddr(\"glShadingRateImagePaletteNV\"))\n\tgpShadingRateSampleOrderCustomNV = (C.GPSHADINGRATESAMPLEORDERCUSTOMNV)(getProcAddr(\"glShadingRateSampleOrderCustomNV\"))\n\tgpShadingRateSampleOrderNV = (C.GPSHADINGRATESAMPLEORDERNV)(getProcAddr(\"glShadingRateSampleOrderNV\"))\n\tgpSignalVkFenceNV = (C.GPSIGNALVKFENCENV)(getProcAddr(\"glSignalVkFenceNV\"))\n\tgpSignalVkSemaphoreNV = (C.GPSIGNALVKSEMAPHORENV)(getProcAddr(\"glSignalVkSemaphoreNV\"))\n\tgpSpecializeShaderARB = (C.GPSPECIALIZESHADERARB)(getProcAddr(\"glSpecializeShaderARB\"))\n\tgpStateCaptureNV = (C.GPSTATECAPTURENV)(getProcAddr(\"glStateCaptureNV\"))\n\tgpStencilFillPathInstancedNV = (C.GPSTENCILFILLPATHINSTANCEDNV)(getProcAddr(\"glStencilFillPathInstancedNV\"))\n\tgpStencilFillPathNV = (C.GPSTENCILFILLPATHNV)(getProcAddr(\"glStencilFillPathNV\"))\n\tgpStencilFunc = (C.GPSTENCILFUNC)(getProcAddr(\"glStencilFunc\"))\n\tif gpStencilFunc == nil {\n\t\treturn errors.New(\"glStencilFunc\")\n\t}\n\tgpStencilFuncSeparate = (C.GPSTENCILFUNCSEPARATE)(getProcAddr(\"glStencilFuncSeparate\"))\n\tif gpStencilFuncSeparate == nil {\n\t\treturn errors.New(\"glStencilFuncSeparate\")\n\t}\n\tgpStencilMask = (C.GPSTENCILMASK)(getProcAddr(\"glStencilMask\"))\n\tif gpStencilMask == nil {\n\t\treturn errors.New(\"glStencilMask\")\n\t}\n\tgpStencilMaskSeparate = (C.GPSTENCILMASKSEPARATE)(getProcAddr(\"glStencilMaskSeparate\"))\n\tif gpStencilMaskSeparate == nil {\n\t\treturn errors.New(\"glStencilMaskSeparate\")\n\t}\n\tgpStencilOp = (C.GPSTENCILOP)(getProcAddr(\"glStencilOp\"))\n\tif gpStencilOp == nil {\n\t\treturn errors.New(\"glStencilOp\")\n\t}\n\tgpStencilOpSeparate = (C.GPSTENCILOPSEPARATE)(getProcAddr(\"glStencilOpSeparate\"))\n\tif gpStencilOpSeparate == nil {\n\t\treturn errors.New(\"glStencilOpSeparate\")\n\t}\n\tgpStencilStrokePathInstancedNV = (C.GPSTENCILSTROKEPATHINSTANCEDNV)(getProcAddr(\"glStencilStrokePathInstancedNV\"))\n\tgpStencilStrokePathNV = (C.GPSTENCILSTROKEPATHNV)(getProcAddr(\"glStencilStrokePathNV\"))\n\tgpStencilThenCoverFillPathInstancedNV = (C.GPSTENCILTHENCOVERFILLPATHINSTANCEDNV)(getProcAddr(\"glStencilThenCoverFillPathInstancedNV\"))\n\tgpStencilThenCoverFillPathNV = (C.GPSTENCILTHENCOVERFILLPATHNV)(getProcAddr(\"glStencilThenCoverFillPathNV\"))\n\tgpStencilThenCoverStrokePathInstancedNV = (C.GPSTENCILTHENCOVERSTROKEPATHINSTANCEDNV)(getProcAddr(\"glStencilThenCoverStrokePathInstancedNV\"))\n\tgpStencilThenCoverStrokePathNV = (C.GPSTENCILTHENCOVERSTROKEPATHNV)(getProcAddr(\"glStencilThenCoverStrokePathNV\"))\n\tgpSubpixelPrecisionBiasNV = (C.GPSUBPIXELPRECISIONBIASNV)(getProcAddr(\"glSubpixelPrecisionBiasNV\"))\n\tgpTexAttachMemoryNV = (C.GPTEXATTACHMEMORYNV)(getProcAddr(\"glTexAttachMemoryNV\"))\n\tgpTexBuffer = (C.GPTEXBUFFER)(getProcAddr(\"glTexBuffer\"))\n\tif gpTexBuffer == nil {\n\t\treturn errors.New(\"glTexBuffer\")\n\t}\n\tgpTexBufferARB = (C.GPTEXBUFFERARB)(getProcAddr(\"glTexBufferARB\"))\n\tgpTexBufferRange = (C.GPTEXBUFFERRANGE)(getProcAddr(\"glTexBufferRange\"))\n\tgpTexCoordFormatNV = (C.GPTEXCOORDFORMATNV)(getProcAddr(\"glTexCoordFormatNV\"))\n\tgpTexImage1D = (C.GPTEXIMAGE1D)(getProcAddr(\"glTexImage1D\"))\n\tif gpTexImage1D == nil {\n\t\treturn errors.New(\"glTexImage1D\")\n\t}\n\tgpTexImage2D = (C.GPTEXIMAGE2D)(getProcAddr(\"glTexImage2D\"))\n\tif gpTexImage2D == nil {\n\t\treturn errors.New(\"glTexImage2D\")\n\t}\n\tgpTexImage2DMultisample = (C.GPTEXIMAGE2DMULTISAMPLE)(getProcAddr(\"glTexImage2DMultisample\"))\n\tif gpTexImage2DMultisample == nil {\n\t\treturn errors.New(\"glTexImage2DMultisample\")\n\t}\n\tgpTexImage3D = (C.GPTEXIMAGE3D)(getProcAddr(\"glTexImage3D\"))\n\tif gpTexImage3D == nil {\n\t\treturn errors.New(\"glTexImage3D\")\n\t}\n\tgpTexImage3DMultisample = (C.GPTEXIMAGE3DMULTISAMPLE)(getProcAddr(\"glTexImage3DMultisample\"))\n\tif gpTexImage3DMultisample == nil {\n\t\treturn errors.New(\"glTexImage3DMultisample\")\n\t}\n\tgpTexPageCommitmentARB = (C.GPTEXPAGECOMMITMENTARB)(getProcAddr(\"glTexPageCommitmentARB\"))\n\tgpTexPageCommitmentMemNV = (C.GPTEXPAGECOMMITMENTMEMNV)(getProcAddr(\"glTexPageCommitmentMemNV\"))\n\tgpTexParameterIiv = (C.GPTEXPARAMETERIIV)(getProcAddr(\"glTexParameterIiv\"))\n\tif gpTexParameterIiv == nil {\n\t\treturn errors.New(\"glTexParameterIiv\")\n\t}\n\tgpTexParameterIuiv = (C.GPTEXPARAMETERIUIV)(getProcAddr(\"glTexParameterIuiv\"))\n\tif gpTexParameterIuiv == nil {\n\t\treturn errors.New(\"glTexParameterIuiv\")\n\t}\n\tgpTexParameterf = (C.GPTEXPARAMETERF)(getProcAddr(\"glTexParameterf\"))\n\tif gpTexParameterf == nil {\n\t\treturn errors.New(\"glTexParameterf\")\n\t}\n\tgpTexParameterfv = (C.GPTEXPARAMETERFV)(getProcAddr(\"glTexParameterfv\"))\n\tif gpTexParameterfv == nil {\n\t\treturn errors.New(\"glTexParameterfv\")\n\t}\n\tgpTexParameteri = (C.GPTEXPARAMETERI)(getProcAddr(\"glTexParameteri\"))\n\tif gpTexParameteri == nil {\n\t\treturn errors.New(\"glTexParameteri\")\n\t}\n\tgpTexParameteriv = (C.GPTEXPARAMETERIV)(getProcAddr(\"glTexParameteriv\"))\n\tif gpTexParameteriv == nil {\n\t\treturn errors.New(\"glTexParameteriv\")\n\t}\n\tgpTexStorage1D = (C.GPTEXSTORAGE1D)(getProcAddr(\"glTexStorage1D\"))\n\tif gpTexStorage1D == nil {\n\t\treturn errors.New(\"glTexStorage1D\")\n\t}\n\tgpTexStorage2D = (C.GPTEXSTORAGE2D)(getProcAddr(\"glTexStorage2D\"))\n\tif gpTexStorage2D == nil {\n\t\treturn errors.New(\"glTexStorage2D\")\n\t}\n\tgpTexStorage2DMultisample = (C.GPTEXSTORAGE2DMULTISAMPLE)(getProcAddr(\"glTexStorage2DMultisample\"))\n\tgpTexStorage3D = (C.GPTEXSTORAGE3D)(getProcAddr(\"glTexStorage3D\"))\n\tif gpTexStorage3D == nil {\n\t\treturn errors.New(\"glTexStorage3D\")\n\t}\n\tgpTexStorage3DMultisample = (C.GPTEXSTORAGE3DMULTISAMPLE)(getProcAddr(\"glTexStorage3DMultisample\"))\n\tgpTexSubImage1D = (C.GPTEXSUBIMAGE1D)(getProcAddr(\"glTexSubImage1D\"))\n\tif gpTexSubImage1D == nil {\n\t\treturn errors.New(\"glTexSubImage1D\")\n\t}\n\tgpTexSubImage2D = (C.GPTEXSUBIMAGE2D)(getProcAddr(\"glTexSubImage2D\"))\n\tif gpTexSubImage2D == nil {\n\t\treturn errors.New(\"glTexSubImage2D\")\n\t}\n\tgpTexSubImage3D = (C.GPTEXSUBIMAGE3D)(getProcAddr(\"glTexSubImage3D\"))\n\tif gpTexSubImage3D == nil {\n\t\treturn errors.New(\"glTexSubImage3D\")\n\t}\n\tgpTextureAttachMemoryNV = (C.GPTEXTUREATTACHMEMORYNV)(getProcAddr(\"glTextureAttachMemoryNV\"))\n\tgpTextureBarrier = (C.GPTEXTUREBARRIER)(getProcAddr(\"glTextureBarrier\"))\n\tgpTextureBarrierNV = (C.GPTEXTUREBARRIERNV)(getProcAddr(\"glTextureBarrierNV\"))\n\tgpTextureBuffer = (C.GPTEXTUREBUFFER)(getProcAddr(\"glTextureBuffer\"))\n\tgpTextureBufferEXT = (C.GPTEXTUREBUFFEREXT)(getProcAddr(\"glTextureBufferEXT\"))\n\tgpTextureBufferRange = (C.GPTEXTUREBUFFERRANGE)(getProcAddr(\"glTextureBufferRange\"))\n\tgpTextureBufferRangeEXT = (C.GPTEXTUREBUFFERRANGEEXT)(getProcAddr(\"glTextureBufferRangeEXT\"))\n\tgpTextureImage1DEXT = (C.GPTEXTUREIMAGE1DEXT)(getProcAddr(\"glTextureImage1DEXT\"))\n\tgpTextureImage2DEXT = (C.GPTEXTUREIMAGE2DEXT)(getProcAddr(\"glTextureImage2DEXT\"))\n\tgpTextureImage3DEXT = (C.GPTEXTUREIMAGE3DEXT)(getProcAddr(\"glTextureImage3DEXT\"))\n\tgpTexturePageCommitmentEXT = (C.GPTEXTUREPAGECOMMITMENTEXT)(getProcAddr(\"glTexturePageCommitmentEXT\"))\n\tgpTexturePageCommitmentMemNV = (C.GPTEXTUREPAGECOMMITMENTMEMNV)(getProcAddr(\"glTexturePageCommitmentMemNV\"))\n\tgpTextureParameterIiv = (C.GPTEXTUREPARAMETERIIV)(getProcAddr(\"glTextureParameterIiv\"))\n\tgpTextureParameterIivEXT = (C.GPTEXTUREPARAMETERIIVEXT)(getProcAddr(\"glTextureParameterIivEXT\"))\n\tgpTextureParameterIuiv = (C.GPTEXTUREPARAMETERIUIV)(getProcAddr(\"glTextureParameterIuiv\"))\n\tgpTextureParameterIuivEXT = (C.GPTEXTUREPARAMETERIUIVEXT)(getProcAddr(\"glTextureParameterIuivEXT\"))\n\tgpTextureParameterf = (C.GPTEXTUREPARAMETERF)(getProcAddr(\"glTextureParameterf\"))\n\tgpTextureParameterfEXT = (C.GPTEXTUREPARAMETERFEXT)(getProcAddr(\"glTextureParameterfEXT\"))\n\tgpTextureParameterfv = (C.GPTEXTUREPARAMETERFV)(getProcAddr(\"glTextureParameterfv\"))\n\tgpTextureParameterfvEXT = (C.GPTEXTUREPARAMETERFVEXT)(getProcAddr(\"glTextureParameterfvEXT\"))\n\tgpTextureParameteri = (C.GPTEXTUREPARAMETERI)(getProcAddr(\"glTextureParameteri\"))\n\tgpTextureParameteriEXT = (C.GPTEXTUREPARAMETERIEXT)(getProcAddr(\"glTextureParameteriEXT\"))\n\tgpTextureParameteriv = (C.GPTEXTUREPARAMETERIV)(getProcAddr(\"glTextureParameteriv\"))\n\tgpTextureParameterivEXT = (C.GPTEXTUREPARAMETERIVEXT)(getProcAddr(\"glTextureParameterivEXT\"))\n\tgpTextureRenderbufferEXT = (C.GPTEXTURERENDERBUFFEREXT)(getProcAddr(\"glTextureRenderbufferEXT\"))\n\tgpTextureStorage1D = (C.GPTEXTURESTORAGE1D)(getProcAddr(\"glTextureStorage1D\"))\n\tgpTextureStorage1DEXT = (C.GPTEXTURESTORAGE1DEXT)(getProcAddr(\"glTextureStorage1DEXT\"))\n\tgpTextureStorage2D = (C.GPTEXTURESTORAGE2D)(getProcAddr(\"glTextureStorage2D\"))\n\tgpTextureStorage2DEXT = (C.GPTEXTURESTORAGE2DEXT)(getProcAddr(\"glTextureStorage2DEXT\"))\n\tgpTextureStorage2DMultisample = (C.GPTEXTURESTORAGE2DMULTISAMPLE)(getProcAddr(\"glTextureStorage2DMultisample\"))\n\tgpTextureStorage2DMultisampleEXT = (C.GPTEXTURESTORAGE2DMULTISAMPLEEXT)(getProcAddr(\"glTextureStorage2DMultisampleEXT\"))\n\tgpTextureStorage3D = (C.GPTEXTURESTORAGE3D)(getProcAddr(\"glTextureStorage3D\"))\n\tgpTextureStorage3DEXT = (C.GPTEXTURESTORAGE3DEXT)(getProcAddr(\"glTextureStorage3DEXT\"))\n\tgpTextureStorage3DMultisample = (C.GPTEXTURESTORAGE3DMULTISAMPLE)(getProcAddr(\"glTextureStorage3DMultisample\"))\n\tgpTextureStorage3DMultisampleEXT = (C.GPTEXTURESTORAGE3DMULTISAMPLEEXT)(getProcAddr(\"glTextureStorage3DMultisampleEXT\"))\n\tgpTextureSubImage1D = (C.GPTEXTURESUBIMAGE1D)(getProcAddr(\"glTextureSubImage1D\"))\n\tgpTextureSubImage1DEXT = (C.GPTEXTURESUBIMAGE1DEXT)(getProcAddr(\"glTextureSubImage1DEXT\"))\n\tgpTextureSubImage2D = (C.GPTEXTURESUBIMAGE2D)(getProcAddr(\"glTextureSubImage2D\"))\n\tgpTextureSubImage2DEXT = (C.GPTEXTURESUBIMAGE2DEXT)(getProcAddr(\"glTextureSubImage2DEXT\"))\n\tgpTextureSubImage3D = (C.GPTEXTURESUBIMAGE3D)(getProcAddr(\"glTextureSubImage3D\"))\n\tgpTextureSubImage3DEXT = (C.GPTEXTURESUBIMAGE3DEXT)(getProcAddr(\"glTextureSubImage3DEXT\"))\n\tgpTextureView = (C.GPTEXTUREVIEW)(getProcAddr(\"glTextureView\"))\n\tgpTransformFeedbackBufferBase = (C.GPTRANSFORMFEEDBACKBUFFERBASE)(getProcAddr(\"glTransformFeedbackBufferBase\"))\n\tgpTransformFeedbackBufferRange = (C.GPTRANSFORMFEEDBACKBUFFERRANGE)(getProcAddr(\"glTransformFeedbackBufferRange\"))\n\tgpTransformFeedbackVaryings = (C.GPTRANSFORMFEEDBACKVARYINGS)(getProcAddr(\"glTransformFeedbackVaryings\"))\n\tif gpTransformFeedbackVaryings == nil {\n\t\treturn errors.New(\"glTransformFeedbackVaryings\")\n\t}\n\tgpTransformPathNV = (C.GPTRANSFORMPATHNV)(getProcAddr(\"glTransformPathNV\"))\n\tgpUniform1d = (C.GPUNIFORM1D)(getProcAddr(\"glUniform1d\"))\n\tif gpUniform1d == nil {\n\t\treturn errors.New(\"glUniform1d\")\n\t}\n\tgpUniform1dv = (C.GPUNIFORM1DV)(getProcAddr(\"glUniform1dv\"))\n\tif gpUniform1dv == nil {\n\t\treturn errors.New(\"glUniform1dv\")\n\t}\n\tgpUniform1f = (C.GPUNIFORM1F)(getProcAddr(\"glUniform1f\"))\n\tif gpUniform1f == nil {\n\t\treturn errors.New(\"glUniform1f\")\n\t}\n\tgpUniform1fv = (C.GPUNIFORM1FV)(getProcAddr(\"glUniform1fv\"))\n\tif gpUniform1fv == nil {\n\t\treturn errors.New(\"glUniform1fv\")\n\t}\n\tgpUniform1i = (C.GPUNIFORM1I)(getProcAddr(\"glUniform1i\"))\n\tif gpUniform1i == nil {\n\t\treturn errors.New(\"glUniform1i\")\n\t}\n\tgpUniform1i64ARB = (C.GPUNIFORM1I64ARB)(getProcAddr(\"glUniform1i64ARB\"))\n\tgpUniform1i64NV = (C.GPUNIFORM1I64NV)(getProcAddr(\"glUniform1i64NV\"))\n\tgpUniform1i64vARB = (C.GPUNIFORM1I64VARB)(getProcAddr(\"glUniform1i64vARB\"))\n\tgpUniform1i64vNV = (C.GPUNIFORM1I64VNV)(getProcAddr(\"glUniform1i64vNV\"))\n\tgpUniform1iv = (C.GPUNIFORM1IV)(getProcAddr(\"glUniform1iv\"))\n\tif gpUniform1iv == nil {\n\t\treturn errors.New(\"glUniform1iv\")\n\t}\n\tgpUniform1ui = (C.GPUNIFORM1UI)(getProcAddr(\"glUniform1ui\"))\n\tif gpUniform1ui == nil {\n\t\treturn errors.New(\"glUniform1ui\")\n\t}\n\tgpUniform1ui64ARB = (C.GPUNIFORM1UI64ARB)(getProcAddr(\"glUniform1ui64ARB\"))\n\tgpUniform1ui64NV = (C.GPUNIFORM1UI64NV)(getProcAddr(\"glUniform1ui64NV\"))\n\tgpUniform1ui64vARB = (C.GPUNIFORM1UI64VARB)(getProcAddr(\"glUniform1ui64vARB\"))\n\tgpUniform1ui64vNV = (C.GPUNIFORM1UI64VNV)(getProcAddr(\"glUniform1ui64vNV\"))\n\tgpUniform1uiv = (C.GPUNIFORM1UIV)(getProcAddr(\"glUniform1uiv\"))\n\tif gpUniform1uiv == nil {\n\t\treturn errors.New(\"glUniform1uiv\")\n\t}\n\tgpUniform2d = (C.GPUNIFORM2D)(getProcAddr(\"glUniform2d\"))\n\tif gpUniform2d == nil {\n\t\treturn errors.New(\"glUniform2d\")\n\t}\n\tgpUniform2dv = (C.GPUNIFORM2DV)(getProcAddr(\"glUniform2dv\"))\n\tif gpUniform2dv == nil {\n\t\treturn errors.New(\"glUniform2dv\")\n\t}\n\tgpUniform2f = (C.GPUNIFORM2F)(getProcAddr(\"glUniform2f\"))\n\tif gpUniform2f == nil {\n\t\treturn errors.New(\"glUniform2f\")\n\t}\n\tgpUniform2fv = (C.GPUNIFORM2FV)(getProcAddr(\"glUniform2fv\"))\n\tif gpUniform2fv == nil {\n\t\treturn errors.New(\"glUniform2fv\")\n\t}\n\tgpUniform2i = (C.GPUNIFORM2I)(getProcAddr(\"glUniform2i\"))\n\tif gpUniform2i == nil {\n\t\treturn errors.New(\"glUniform2i\")\n\t}\n\tgpUniform2i64ARB = (C.GPUNIFORM2I64ARB)(getProcAddr(\"glUniform2i64ARB\"))\n\tgpUniform2i64NV = (C.GPUNIFORM2I64NV)(getProcAddr(\"glUniform2i64NV\"))\n\tgpUniform2i64vARB = (C.GPUNIFORM2I64VARB)(getProcAddr(\"glUniform2i64vARB\"))\n\tgpUniform2i64vNV = (C.GPUNIFORM2I64VNV)(getProcAddr(\"glUniform2i64vNV\"))\n\tgpUniform2iv = (C.GPUNIFORM2IV)(getProcAddr(\"glUniform2iv\"))\n\tif gpUniform2iv == nil {\n\t\treturn errors.New(\"glUniform2iv\")\n\t}\n\tgpUniform2ui = (C.GPUNIFORM2UI)(getProcAddr(\"glUniform2ui\"))\n\tif gpUniform2ui == nil {\n\t\treturn errors.New(\"glUniform2ui\")\n\t}\n\tgpUniform2ui64ARB = (C.GPUNIFORM2UI64ARB)(getProcAddr(\"glUniform2ui64ARB\"))\n\tgpUniform2ui64NV = (C.GPUNIFORM2UI64NV)(getProcAddr(\"glUniform2ui64NV\"))\n\tgpUniform2ui64vARB = (C.GPUNIFORM2UI64VARB)(getProcAddr(\"glUniform2ui64vARB\"))\n\tgpUniform2ui64vNV = (C.GPUNIFORM2UI64VNV)(getProcAddr(\"glUniform2ui64vNV\"))\n\tgpUniform2uiv = (C.GPUNIFORM2UIV)(getProcAddr(\"glUniform2uiv\"))\n\tif gpUniform2uiv == nil {\n\t\treturn errors.New(\"glUniform2uiv\")\n\t}\n\tgpUniform3d = (C.GPUNIFORM3D)(getProcAddr(\"glUniform3d\"))\n\tif gpUniform3d == nil {\n\t\treturn errors.New(\"glUniform3d\")\n\t}\n\tgpUniform3dv = (C.GPUNIFORM3DV)(getProcAddr(\"glUniform3dv\"))\n\tif gpUniform3dv == nil {\n\t\treturn errors.New(\"glUniform3dv\")\n\t}\n\tgpUniform3f = (C.GPUNIFORM3F)(getProcAddr(\"glUniform3f\"))\n\tif gpUniform3f == nil {\n\t\treturn errors.New(\"glUniform3f\")\n\t}\n\tgpUniform3fv = (C.GPUNIFORM3FV)(getProcAddr(\"glUniform3fv\"))\n\tif gpUniform3fv == nil {\n\t\treturn errors.New(\"glUniform3fv\")\n\t}\n\tgpUniform3i = (C.GPUNIFORM3I)(getProcAddr(\"glUniform3i\"))\n\tif gpUniform3i == nil {\n\t\treturn errors.New(\"glUniform3i\")\n\t}\n\tgpUniform3i64ARB = (C.GPUNIFORM3I64ARB)(getProcAddr(\"glUniform3i64ARB\"))\n\tgpUniform3i64NV = (C.GPUNIFORM3I64NV)(getProcAddr(\"glUniform3i64NV\"))\n\tgpUniform3i64vARB = (C.GPUNIFORM3I64VARB)(getProcAddr(\"glUniform3i64vARB\"))\n\tgpUniform3i64vNV = (C.GPUNIFORM3I64VNV)(getProcAddr(\"glUniform3i64vNV\"))\n\tgpUniform3iv = (C.GPUNIFORM3IV)(getProcAddr(\"glUniform3iv\"))\n\tif gpUniform3iv == nil {\n\t\treturn errors.New(\"glUniform3iv\")\n\t}\n\tgpUniform3ui = (C.GPUNIFORM3UI)(getProcAddr(\"glUniform3ui\"))\n\tif gpUniform3ui == nil {\n\t\treturn errors.New(\"glUniform3ui\")\n\t}\n\tgpUniform3ui64ARB = (C.GPUNIFORM3UI64ARB)(getProcAddr(\"glUniform3ui64ARB\"))\n\tgpUniform3ui64NV = (C.GPUNIFORM3UI64NV)(getProcAddr(\"glUniform3ui64NV\"))\n\tgpUniform3ui64vARB = (C.GPUNIFORM3UI64VARB)(getProcAddr(\"glUniform3ui64vARB\"))\n\tgpUniform3ui64vNV = (C.GPUNIFORM3UI64VNV)(getProcAddr(\"glUniform3ui64vNV\"))\n\tgpUniform3uiv = (C.GPUNIFORM3UIV)(getProcAddr(\"glUniform3uiv\"))\n\tif gpUniform3uiv == nil {\n\t\treturn errors.New(\"glUniform3uiv\")\n\t}\n\tgpUniform4d = (C.GPUNIFORM4D)(getProcAddr(\"glUniform4d\"))\n\tif gpUniform4d == nil {\n\t\treturn errors.New(\"glUniform4d\")\n\t}\n\tgpUniform4dv = (C.GPUNIFORM4DV)(getProcAddr(\"glUniform4dv\"))\n\tif gpUniform4dv == nil {\n\t\treturn errors.New(\"glUniform4dv\")\n\t}\n\tgpUniform4f = (C.GPUNIFORM4F)(getProcAddr(\"glUniform4f\"))\n\tif gpUniform4f == nil {\n\t\treturn errors.New(\"glUniform4f\")\n\t}\n\tgpUniform4fv = (C.GPUNIFORM4FV)(getProcAddr(\"glUniform4fv\"))\n\tif gpUniform4fv == nil {\n\t\treturn errors.New(\"glUniform4fv\")\n\t}\n\tgpUniform4i = (C.GPUNIFORM4I)(getProcAddr(\"glUniform4i\"))\n\tif gpUniform4i == nil {\n\t\treturn errors.New(\"glUniform4i\")\n\t}\n\tgpUniform4i64ARB = (C.GPUNIFORM4I64ARB)(getProcAddr(\"glUniform4i64ARB\"))\n\tgpUniform4i64NV = (C.GPUNIFORM4I64NV)(getProcAddr(\"glUniform4i64NV\"))\n\tgpUniform4i64vARB = (C.GPUNIFORM4I64VARB)(getProcAddr(\"glUniform4i64vARB\"))\n\tgpUniform4i64vNV = (C.GPUNIFORM4I64VNV)(getProcAddr(\"glUniform4i64vNV\"))\n\tgpUniform4iv = (C.GPUNIFORM4IV)(getProcAddr(\"glUniform4iv\"))\n\tif gpUniform4iv == nil {\n\t\treturn errors.New(\"glUniform4iv\")\n\t}\n\tgpUniform4ui = (C.GPUNIFORM4UI)(getProcAddr(\"glUniform4ui\"))\n\tif gpUniform4ui == nil {\n\t\treturn errors.New(\"glUniform4ui\")\n\t}\n\tgpUniform4ui64ARB = (C.GPUNIFORM4UI64ARB)(getProcAddr(\"glUniform4ui64ARB\"))\n\tgpUniform4ui64NV = (C.GPUNIFORM4UI64NV)(getProcAddr(\"glUniform4ui64NV\"))\n\tgpUniform4ui64vARB = (C.GPUNIFORM4UI64VARB)(getProcAddr(\"glUniform4ui64vARB\"))\n\tgpUniform4ui64vNV = (C.GPUNIFORM4UI64VNV)(getProcAddr(\"glUniform4ui64vNV\"))\n\tgpUniform4uiv = (C.GPUNIFORM4UIV)(getProcAddr(\"glUniform4uiv\"))\n\tif gpUniform4uiv == nil {\n\t\treturn errors.New(\"glUniform4uiv\")\n\t}\n\tgpUniformBlockBinding = (C.GPUNIFORMBLOCKBINDING)(getProcAddr(\"glUniformBlockBinding\"))\n\tif gpUniformBlockBinding == nil {\n\t\treturn errors.New(\"glUniformBlockBinding\")\n\t}\n\tgpUniformHandleui64ARB = (C.GPUNIFORMHANDLEUI64ARB)(getProcAddr(\"glUniformHandleui64ARB\"))\n\tgpUniformHandleui64NV = (C.GPUNIFORMHANDLEUI64NV)(getProcAddr(\"glUniformHandleui64NV\"))\n\tgpUniformHandleui64vARB = (C.GPUNIFORMHANDLEUI64VARB)(getProcAddr(\"glUniformHandleui64vARB\"))\n\tgpUniformHandleui64vNV = (C.GPUNIFORMHANDLEUI64VNV)(getProcAddr(\"glUniformHandleui64vNV\"))\n\tgpUniformMatrix2dv = (C.GPUNIFORMMATRIX2DV)(getProcAddr(\"glUniformMatrix2dv\"))\n\tif gpUniformMatrix2dv == nil {\n\t\treturn errors.New(\"glUniformMatrix2dv\")\n\t}\n\tgpUniformMatrix2fv = (C.GPUNIFORMMATRIX2FV)(getProcAddr(\"glUniformMatrix2fv\"))\n\tif gpUniformMatrix2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2fv\")\n\t}\n\tgpUniformMatrix2x3dv = (C.GPUNIFORMMATRIX2X3DV)(getProcAddr(\"glUniformMatrix2x3dv\"))\n\tif gpUniformMatrix2x3dv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x3dv\")\n\t}\n\tgpUniformMatrix2x3fv = (C.GPUNIFORMMATRIX2X3FV)(getProcAddr(\"glUniformMatrix2x3fv\"))\n\tif gpUniformMatrix2x3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x3fv\")\n\t}\n\tgpUniformMatrix2x4dv = (C.GPUNIFORMMATRIX2X4DV)(getProcAddr(\"glUniformMatrix2x4dv\"))\n\tif gpUniformMatrix2x4dv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x4dv\")\n\t}\n\tgpUniformMatrix2x4fv = (C.GPUNIFORMMATRIX2X4FV)(getProcAddr(\"glUniformMatrix2x4fv\"))\n\tif gpUniformMatrix2x4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x4fv\")\n\t}\n\tgpUniformMatrix3dv = (C.GPUNIFORMMATRIX3DV)(getProcAddr(\"glUniformMatrix3dv\"))\n\tif gpUniformMatrix3dv == nil {\n\t\treturn errors.New(\"glUniformMatrix3dv\")\n\t}\n\tgpUniformMatrix3fv = (C.GPUNIFORMMATRIX3FV)(getProcAddr(\"glUniformMatrix3fv\"))\n\tif gpUniformMatrix3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3fv\")\n\t}\n\tgpUniformMatrix3x2dv = (C.GPUNIFORMMATRIX3X2DV)(getProcAddr(\"glUniformMatrix3x2dv\"))\n\tif gpUniformMatrix3x2dv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x2dv\")\n\t}\n\tgpUniformMatrix3x2fv = (C.GPUNIFORMMATRIX3X2FV)(getProcAddr(\"glUniformMatrix3x2fv\"))\n\tif gpUniformMatrix3x2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x2fv\")\n\t}\n\tgpUniformMatrix3x4dv = (C.GPUNIFORMMATRIX3X4DV)(getProcAddr(\"glUniformMatrix3x4dv\"))\n\tif gpUniformMatrix3x4dv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x4dv\")\n\t}\n\tgpUniformMatrix3x4fv = (C.GPUNIFORMMATRIX3X4FV)(getProcAddr(\"glUniformMatrix3x4fv\"))\n\tif gpUniformMatrix3x4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x4fv\")\n\t}\n\tgpUniformMatrix4dv = (C.GPUNIFORMMATRIX4DV)(getProcAddr(\"glUniformMatrix4dv\"))\n\tif gpUniformMatrix4dv == nil {\n\t\treturn errors.New(\"glUniformMatrix4dv\")\n\t}\n\tgpUniformMatrix4fv = (C.GPUNIFORMMATRIX4FV)(getProcAddr(\"glUniformMatrix4fv\"))\n\tif gpUniformMatrix4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4fv\")\n\t}\n\tgpUniformMatrix4x2dv = (C.GPUNIFORMMATRIX4X2DV)(getProcAddr(\"glUniformMatrix4x2dv\"))\n\tif gpUniformMatrix4x2dv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x2dv\")\n\t}\n\tgpUniformMatrix4x2fv = (C.GPUNIFORMMATRIX4X2FV)(getProcAddr(\"glUniformMatrix4x2fv\"))\n\tif gpUniformMatrix4x2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x2fv\")\n\t}\n\tgpUniformMatrix4x3dv = (C.GPUNIFORMMATRIX4X3DV)(getProcAddr(\"glUniformMatrix4x3dv\"))\n\tif gpUniformMatrix4x3dv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x3dv\")\n\t}\n\tgpUniformMatrix4x3fv = (C.GPUNIFORMMATRIX4X3FV)(getProcAddr(\"glUniformMatrix4x3fv\"))\n\tif gpUniformMatrix4x3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x3fv\")\n\t}\n\tgpUniformSubroutinesuiv = (C.GPUNIFORMSUBROUTINESUIV)(getProcAddr(\"glUniformSubroutinesuiv\"))\n\tif gpUniformSubroutinesuiv == nil {\n\t\treturn errors.New(\"glUniformSubroutinesuiv\")\n\t}\n\tgpUniformui64NV = (C.GPUNIFORMUI64NV)(getProcAddr(\"glUniformui64NV\"))\n\tgpUniformui64vNV = (C.GPUNIFORMUI64VNV)(getProcAddr(\"glUniformui64vNV\"))\n\tgpUnmapBuffer = (C.GPUNMAPBUFFER)(getProcAddr(\"glUnmapBuffer\"))\n\tif gpUnmapBuffer == nil {\n\t\treturn errors.New(\"glUnmapBuffer\")\n\t}\n\tgpUnmapNamedBuffer = (C.GPUNMAPNAMEDBUFFER)(getProcAddr(\"glUnmapNamedBuffer\"))\n\tgpUnmapNamedBufferEXT = (C.GPUNMAPNAMEDBUFFEREXT)(getProcAddr(\"glUnmapNamedBufferEXT\"))\n\tgpUseProgram = (C.GPUSEPROGRAM)(getProcAddr(\"glUseProgram\"))\n\tif gpUseProgram == nil {\n\t\treturn errors.New(\"glUseProgram\")\n\t}\n\tgpUseProgramStages = (C.GPUSEPROGRAMSTAGES)(getProcAddr(\"glUseProgramStages\"))\n\tif gpUseProgramStages == nil {\n\t\treturn errors.New(\"glUseProgramStages\")\n\t}\n\tgpUseProgramStagesEXT = (C.GPUSEPROGRAMSTAGESEXT)(getProcAddr(\"glUseProgramStagesEXT\"))\n\tgpUseShaderProgramEXT = (C.GPUSESHADERPROGRAMEXT)(getProcAddr(\"glUseShaderProgramEXT\"))\n\tgpValidateProgram = (C.GPVALIDATEPROGRAM)(getProcAddr(\"glValidateProgram\"))\n\tif gpValidateProgram == nil {\n\t\treturn errors.New(\"glValidateProgram\")\n\t}\n\tgpValidateProgramPipeline = (C.GPVALIDATEPROGRAMPIPELINE)(getProcAddr(\"glValidateProgramPipeline\"))\n\tif gpValidateProgramPipeline == nil {\n\t\treturn errors.New(\"glValidateProgramPipeline\")\n\t}\n\tgpValidateProgramPipelineEXT = (C.GPVALIDATEPROGRAMPIPELINEEXT)(getProcAddr(\"glValidateProgramPipelineEXT\"))\n\tgpVertexArrayAttribBinding = (C.GPVERTEXARRAYATTRIBBINDING)(getProcAddr(\"glVertexArrayAttribBinding\"))\n\tgpVertexArrayAttribFormat = (C.GPVERTEXARRAYATTRIBFORMAT)(getProcAddr(\"glVertexArrayAttribFormat\"))\n\tgpVertexArrayAttribIFormat = (C.GPVERTEXARRAYATTRIBIFORMAT)(getProcAddr(\"glVertexArrayAttribIFormat\"))\n\tgpVertexArrayAttribLFormat = (C.GPVERTEXARRAYATTRIBLFORMAT)(getProcAddr(\"glVertexArrayAttribLFormat\"))\n\tgpVertexArrayBindVertexBufferEXT = (C.GPVERTEXARRAYBINDVERTEXBUFFEREXT)(getProcAddr(\"glVertexArrayBindVertexBufferEXT\"))\n\tgpVertexArrayBindingDivisor = (C.GPVERTEXARRAYBINDINGDIVISOR)(getProcAddr(\"glVertexArrayBindingDivisor\"))\n\tgpVertexArrayColorOffsetEXT = (C.GPVERTEXARRAYCOLOROFFSETEXT)(getProcAddr(\"glVertexArrayColorOffsetEXT\"))\n\tgpVertexArrayEdgeFlagOffsetEXT = (C.GPVERTEXARRAYEDGEFLAGOFFSETEXT)(getProcAddr(\"glVertexArrayEdgeFlagOffsetEXT\"))\n\tgpVertexArrayElementBuffer = (C.GPVERTEXARRAYELEMENTBUFFER)(getProcAddr(\"glVertexArrayElementBuffer\"))\n\tgpVertexArrayFogCoordOffsetEXT = (C.GPVERTEXARRAYFOGCOORDOFFSETEXT)(getProcAddr(\"glVertexArrayFogCoordOffsetEXT\"))\n\tgpVertexArrayIndexOffsetEXT = (C.GPVERTEXARRAYINDEXOFFSETEXT)(getProcAddr(\"glVertexArrayIndexOffsetEXT\"))\n\tgpVertexArrayMultiTexCoordOffsetEXT = (C.GPVERTEXARRAYMULTITEXCOORDOFFSETEXT)(getProcAddr(\"glVertexArrayMultiTexCoordOffsetEXT\"))\n\tgpVertexArrayNormalOffsetEXT = (C.GPVERTEXARRAYNORMALOFFSETEXT)(getProcAddr(\"glVertexArrayNormalOffsetEXT\"))\n\tgpVertexArraySecondaryColorOffsetEXT = (C.GPVERTEXARRAYSECONDARYCOLOROFFSETEXT)(getProcAddr(\"glVertexArraySecondaryColorOffsetEXT\"))\n\tgpVertexArrayTexCoordOffsetEXT = (C.GPVERTEXARRAYTEXCOORDOFFSETEXT)(getProcAddr(\"glVertexArrayTexCoordOffsetEXT\"))\n\tgpVertexArrayVertexAttribBindingEXT = (C.GPVERTEXARRAYVERTEXATTRIBBINDINGEXT)(getProcAddr(\"glVertexArrayVertexAttribBindingEXT\"))\n\tgpVertexArrayVertexAttribDivisorEXT = (C.GPVERTEXARRAYVERTEXATTRIBDIVISOREXT)(getProcAddr(\"glVertexArrayVertexAttribDivisorEXT\"))\n\tgpVertexArrayVertexAttribFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBFORMATEXT)(getProcAddr(\"glVertexArrayVertexAttribFormatEXT\"))\n\tgpVertexArrayVertexAttribIFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBIFORMATEXT)(getProcAddr(\"glVertexArrayVertexAttribIFormatEXT\"))\n\tgpVertexArrayVertexAttribIOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBIOFFSETEXT)(getProcAddr(\"glVertexArrayVertexAttribIOffsetEXT\"))\n\tgpVertexArrayVertexAttribLFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBLFORMATEXT)(getProcAddr(\"glVertexArrayVertexAttribLFormatEXT\"))\n\tgpVertexArrayVertexAttribLOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBLOFFSETEXT)(getProcAddr(\"glVertexArrayVertexAttribLOffsetEXT\"))\n\tgpVertexArrayVertexAttribOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBOFFSETEXT)(getProcAddr(\"glVertexArrayVertexAttribOffsetEXT\"))\n\tgpVertexArrayVertexBindingDivisorEXT = (C.GPVERTEXARRAYVERTEXBINDINGDIVISOREXT)(getProcAddr(\"glVertexArrayVertexBindingDivisorEXT\"))\n\tgpVertexArrayVertexBuffer = (C.GPVERTEXARRAYVERTEXBUFFER)(getProcAddr(\"glVertexArrayVertexBuffer\"))\n\tgpVertexArrayVertexBuffers = (C.GPVERTEXARRAYVERTEXBUFFERS)(getProcAddr(\"glVertexArrayVertexBuffers\"))\n\tgpVertexArrayVertexOffsetEXT = (C.GPVERTEXARRAYVERTEXOFFSETEXT)(getProcAddr(\"glVertexArrayVertexOffsetEXT\"))\n\tgpVertexAttrib1d = (C.GPVERTEXATTRIB1D)(getProcAddr(\"glVertexAttrib1d\"))\n\tif gpVertexAttrib1d == nil {\n\t\treturn errors.New(\"glVertexAttrib1d\")\n\t}\n\tgpVertexAttrib1dv = (C.GPVERTEXATTRIB1DV)(getProcAddr(\"glVertexAttrib1dv\"))\n\tif gpVertexAttrib1dv == nil {\n\t\treturn errors.New(\"glVertexAttrib1dv\")\n\t}\n\tgpVertexAttrib1f = (C.GPVERTEXATTRIB1F)(getProcAddr(\"glVertexAttrib1f\"))\n\tif gpVertexAttrib1f == nil {\n\t\treturn errors.New(\"glVertexAttrib1f\")\n\t}\n\tgpVertexAttrib1fv = (C.GPVERTEXATTRIB1FV)(getProcAddr(\"glVertexAttrib1fv\"))\n\tif gpVertexAttrib1fv == nil {\n\t\treturn errors.New(\"glVertexAttrib1fv\")\n\t}\n\tgpVertexAttrib1s = (C.GPVERTEXATTRIB1S)(getProcAddr(\"glVertexAttrib1s\"))\n\tif gpVertexAttrib1s == nil {\n\t\treturn errors.New(\"glVertexAttrib1s\")\n\t}\n\tgpVertexAttrib1sv = (C.GPVERTEXATTRIB1SV)(getProcAddr(\"glVertexAttrib1sv\"))\n\tif gpVertexAttrib1sv == nil {\n\t\treturn errors.New(\"glVertexAttrib1sv\")\n\t}\n\tgpVertexAttrib2d = (C.GPVERTEXATTRIB2D)(getProcAddr(\"glVertexAttrib2d\"))\n\tif gpVertexAttrib2d == nil {\n\t\treturn errors.New(\"glVertexAttrib2d\")\n\t}\n\tgpVertexAttrib2dv = (C.GPVERTEXATTRIB2DV)(getProcAddr(\"glVertexAttrib2dv\"))\n\tif gpVertexAttrib2dv == nil {\n\t\treturn errors.New(\"glVertexAttrib2dv\")\n\t}\n\tgpVertexAttrib2f = (C.GPVERTEXATTRIB2F)(getProcAddr(\"glVertexAttrib2f\"))\n\tif gpVertexAttrib2f == nil {\n\t\treturn errors.New(\"glVertexAttrib2f\")\n\t}\n\tgpVertexAttrib2fv = (C.GPVERTEXATTRIB2FV)(getProcAddr(\"glVertexAttrib2fv\"))\n\tif gpVertexAttrib2fv == nil {\n\t\treturn errors.New(\"glVertexAttrib2fv\")\n\t}\n\tgpVertexAttrib2s = (C.GPVERTEXATTRIB2S)(getProcAddr(\"glVertexAttrib2s\"))\n\tif gpVertexAttrib2s == nil {\n\t\treturn errors.New(\"glVertexAttrib2s\")\n\t}\n\tgpVertexAttrib2sv = (C.GPVERTEXATTRIB2SV)(getProcAddr(\"glVertexAttrib2sv\"))\n\tif gpVertexAttrib2sv == nil {\n\t\treturn errors.New(\"glVertexAttrib2sv\")\n\t}\n\tgpVertexAttrib3d = (C.GPVERTEXATTRIB3D)(getProcAddr(\"glVertexAttrib3d\"))\n\tif gpVertexAttrib3d == nil {\n\t\treturn errors.New(\"glVertexAttrib3d\")\n\t}\n\tgpVertexAttrib3dv = (C.GPVERTEXATTRIB3DV)(getProcAddr(\"glVertexAttrib3dv\"))\n\tif gpVertexAttrib3dv == nil {\n\t\treturn errors.New(\"glVertexAttrib3dv\")\n\t}\n\tgpVertexAttrib3f = (C.GPVERTEXATTRIB3F)(getProcAddr(\"glVertexAttrib3f\"))\n\tif gpVertexAttrib3f == nil {\n\t\treturn errors.New(\"glVertexAttrib3f\")\n\t}\n\tgpVertexAttrib3fv = (C.GPVERTEXATTRIB3FV)(getProcAddr(\"glVertexAttrib3fv\"))\n\tif gpVertexAttrib3fv == nil {\n\t\treturn errors.New(\"glVertexAttrib3fv\")\n\t}\n\tgpVertexAttrib3s = (C.GPVERTEXATTRIB3S)(getProcAddr(\"glVertexAttrib3s\"))\n\tif gpVertexAttrib3s == nil {\n\t\treturn errors.New(\"glVertexAttrib3s\")\n\t}\n\tgpVertexAttrib3sv = (C.GPVERTEXATTRIB3SV)(getProcAddr(\"glVertexAttrib3sv\"))\n\tif gpVertexAttrib3sv == nil {\n\t\treturn errors.New(\"glVertexAttrib3sv\")\n\t}\n\tgpVertexAttrib4Nbv = (C.GPVERTEXATTRIB4NBV)(getProcAddr(\"glVertexAttrib4Nbv\"))\n\tif gpVertexAttrib4Nbv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nbv\")\n\t}\n\tgpVertexAttrib4Niv = (C.GPVERTEXATTRIB4NIV)(getProcAddr(\"glVertexAttrib4Niv\"))\n\tif gpVertexAttrib4Niv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Niv\")\n\t}\n\tgpVertexAttrib4Nsv = (C.GPVERTEXATTRIB4NSV)(getProcAddr(\"glVertexAttrib4Nsv\"))\n\tif gpVertexAttrib4Nsv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nsv\")\n\t}\n\tgpVertexAttrib4Nub = (C.GPVERTEXATTRIB4NUB)(getProcAddr(\"glVertexAttrib4Nub\"))\n\tif gpVertexAttrib4Nub == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nub\")\n\t}\n\tgpVertexAttrib4Nubv = (C.GPVERTEXATTRIB4NUBV)(getProcAddr(\"glVertexAttrib4Nubv\"))\n\tif gpVertexAttrib4Nubv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nubv\")\n\t}\n\tgpVertexAttrib4Nuiv = (C.GPVERTEXATTRIB4NUIV)(getProcAddr(\"glVertexAttrib4Nuiv\"))\n\tif gpVertexAttrib4Nuiv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nuiv\")\n\t}\n\tgpVertexAttrib4Nusv = (C.GPVERTEXATTRIB4NUSV)(getProcAddr(\"glVertexAttrib4Nusv\"))\n\tif gpVertexAttrib4Nusv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nusv\")\n\t}\n\tgpVertexAttrib4bv = (C.GPVERTEXATTRIB4BV)(getProcAddr(\"glVertexAttrib4bv\"))\n\tif gpVertexAttrib4bv == nil {\n\t\treturn errors.New(\"glVertexAttrib4bv\")\n\t}\n\tgpVertexAttrib4d = (C.GPVERTEXATTRIB4D)(getProcAddr(\"glVertexAttrib4d\"))\n\tif gpVertexAttrib4d == nil {\n\t\treturn errors.New(\"glVertexAttrib4d\")\n\t}\n\tgpVertexAttrib4dv = (C.GPVERTEXATTRIB4DV)(getProcAddr(\"glVertexAttrib4dv\"))\n\tif gpVertexAttrib4dv == nil {\n\t\treturn errors.New(\"glVertexAttrib4dv\")\n\t}\n\tgpVertexAttrib4f = (C.GPVERTEXATTRIB4F)(getProcAddr(\"glVertexAttrib4f\"))\n\tif gpVertexAttrib4f == nil {\n\t\treturn errors.New(\"glVertexAttrib4f\")\n\t}\n\tgpVertexAttrib4fv = (C.GPVERTEXATTRIB4FV)(getProcAddr(\"glVertexAttrib4fv\"))\n\tif gpVertexAttrib4fv == nil {\n\t\treturn errors.New(\"glVertexAttrib4fv\")\n\t}\n\tgpVertexAttrib4iv = (C.GPVERTEXATTRIB4IV)(getProcAddr(\"glVertexAttrib4iv\"))\n\tif gpVertexAttrib4iv == nil {\n\t\treturn errors.New(\"glVertexAttrib4iv\")\n\t}\n\tgpVertexAttrib4s = (C.GPVERTEXATTRIB4S)(getProcAddr(\"glVertexAttrib4s\"))\n\tif gpVertexAttrib4s == nil {\n\t\treturn errors.New(\"glVertexAttrib4s\")\n\t}\n\tgpVertexAttrib4sv = (C.GPVERTEXATTRIB4SV)(getProcAddr(\"glVertexAttrib4sv\"))\n\tif gpVertexAttrib4sv == nil {\n\t\treturn errors.New(\"glVertexAttrib4sv\")\n\t}\n\tgpVertexAttrib4ubv = (C.GPVERTEXATTRIB4UBV)(getProcAddr(\"glVertexAttrib4ubv\"))\n\tif gpVertexAttrib4ubv == nil {\n\t\treturn errors.New(\"glVertexAttrib4ubv\")\n\t}\n\tgpVertexAttrib4uiv = (C.GPVERTEXATTRIB4UIV)(getProcAddr(\"glVertexAttrib4uiv\"))\n\tif gpVertexAttrib4uiv == nil {\n\t\treturn errors.New(\"glVertexAttrib4uiv\")\n\t}\n\tgpVertexAttrib4usv = (C.GPVERTEXATTRIB4USV)(getProcAddr(\"glVertexAttrib4usv\"))\n\tif gpVertexAttrib4usv == nil {\n\t\treturn errors.New(\"glVertexAttrib4usv\")\n\t}\n\tgpVertexAttribBinding = (C.GPVERTEXATTRIBBINDING)(getProcAddr(\"glVertexAttribBinding\"))\n\tgpVertexAttribDivisor = (C.GPVERTEXATTRIBDIVISOR)(getProcAddr(\"glVertexAttribDivisor\"))\n\tif gpVertexAttribDivisor == nil {\n\t\treturn errors.New(\"glVertexAttribDivisor\")\n\t}\n\tgpVertexAttribDivisorARB = (C.GPVERTEXATTRIBDIVISORARB)(getProcAddr(\"glVertexAttribDivisorARB\"))\n\tgpVertexAttribFormat = (C.GPVERTEXATTRIBFORMAT)(getProcAddr(\"glVertexAttribFormat\"))\n\tgpVertexAttribFormatNV = (C.GPVERTEXATTRIBFORMATNV)(getProcAddr(\"glVertexAttribFormatNV\"))\n\tgpVertexAttribI1i = (C.GPVERTEXATTRIBI1I)(getProcAddr(\"glVertexAttribI1i\"))\n\tif gpVertexAttribI1i == nil {\n\t\treturn errors.New(\"glVertexAttribI1i\")\n\t}\n\tgpVertexAttribI1iv = (C.GPVERTEXATTRIBI1IV)(getProcAddr(\"glVertexAttribI1iv\"))\n\tif gpVertexAttribI1iv == nil {\n\t\treturn errors.New(\"glVertexAttribI1iv\")\n\t}\n\tgpVertexAttribI1ui = (C.GPVERTEXATTRIBI1UI)(getProcAddr(\"glVertexAttribI1ui\"))\n\tif gpVertexAttribI1ui == nil {\n\t\treturn errors.New(\"glVertexAttribI1ui\")\n\t}\n\tgpVertexAttribI1uiv = (C.GPVERTEXATTRIBI1UIV)(getProcAddr(\"glVertexAttribI1uiv\"))\n\tif gpVertexAttribI1uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI1uiv\")\n\t}\n\tgpVertexAttribI2i = (C.GPVERTEXATTRIBI2I)(getProcAddr(\"glVertexAttribI2i\"))\n\tif gpVertexAttribI2i == nil {\n\t\treturn errors.New(\"glVertexAttribI2i\")\n\t}\n\tgpVertexAttribI2iv = (C.GPVERTEXATTRIBI2IV)(getProcAddr(\"glVertexAttribI2iv\"))\n\tif gpVertexAttribI2iv == nil {\n\t\treturn errors.New(\"glVertexAttribI2iv\")\n\t}\n\tgpVertexAttribI2ui = (C.GPVERTEXATTRIBI2UI)(getProcAddr(\"glVertexAttribI2ui\"))\n\tif gpVertexAttribI2ui == nil {\n\t\treturn errors.New(\"glVertexAttribI2ui\")\n\t}\n\tgpVertexAttribI2uiv = (C.GPVERTEXATTRIBI2UIV)(getProcAddr(\"glVertexAttribI2uiv\"))\n\tif gpVertexAttribI2uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI2uiv\")\n\t}\n\tgpVertexAttribI3i = (C.GPVERTEXATTRIBI3I)(getProcAddr(\"glVertexAttribI3i\"))\n\tif gpVertexAttribI3i == nil {\n\t\treturn errors.New(\"glVertexAttribI3i\")\n\t}\n\tgpVertexAttribI3iv = (C.GPVERTEXATTRIBI3IV)(getProcAddr(\"glVertexAttribI3iv\"))\n\tif gpVertexAttribI3iv == nil {\n\t\treturn errors.New(\"glVertexAttribI3iv\")\n\t}\n\tgpVertexAttribI3ui = (C.GPVERTEXATTRIBI3UI)(getProcAddr(\"glVertexAttribI3ui\"))\n\tif gpVertexAttribI3ui == nil {\n\t\treturn errors.New(\"glVertexAttribI3ui\")\n\t}\n\tgpVertexAttribI3uiv = (C.GPVERTEXATTRIBI3UIV)(getProcAddr(\"glVertexAttribI3uiv\"))\n\tif gpVertexAttribI3uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI3uiv\")\n\t}\n\tgpVertexAttribI4bv = (C.GPVERTEXATTRIBI4BV)(getProcAddr(\"glVertexAttribI4bv\"))\n\tif gpVertexAttribI4bv == nil {\n\t\treturn errors.New(\"glVertexAttribI4bv\")\n\t}\n\tgpVertexAttribI4i = (C.GPVERTEXATTRIBI4I)(getProcAddr(\"glVertexAttribI4i\"))\n\tif gpVertexAttribI4i == nil {\n\t\treturn errors.New(\"glVertexAttribI4i\")\n\t}\n\tgpVertexAttribI4iv = (C.GPVERTEXATTRIBI4IV)(getProcAddr(\"glVertexAttribI4iv\"))\n\tif gpVertexAttribI4iv == nil {\n\t\treturn errors.New(\"glVertexAttribI4iv\")\n\t}\n\tgpVertexAttribI4sv = (C.GPVERTEXATTRIBI4SV)(getProcAddr(\"glVertexAttribI4sv\"))\n\tif gpVertexAttribI4sv == nil {\n\t\treturn errors.New(\"glVertexAttribI4sv\")\n\t}\n\tgpVertexAttribI4ubv = (C.GPVERTEXATTRIBI4UBV)(getProcAddr(\"glVertexAttribI4ubv\"))\n\tif gpVertexAttribI4ubv == nil {\n\t\treturn errors.New(\"glVertexAttribI4ubv\")\n\t}\n\tgpVertexAttribI4ui = (C.GPVERTEXATTRIBI4UI)(getProcAddr(\"glVertexAttribI4ui\"))\n\tif gpVertexAttribI4ui == nil {\n\t\treturn errors.New(\"glVertexAttribI4ui\")\n\t}\n\tgpVertexAttribI4uiv = (C.GPVERTEXATTRIBI4UIV)(getProcAddr(\"glVertexAttribI4uiv\"))\n\tif gpVertexAttribI4uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI4uiv\")\n\t}\n\tgpVertexAttribI4usv = (C.GPVERTEXATTRIBI4USV)(getProcAddr(\"glVertexAttribI4usv\"))\n\tif gpVertexAttribI4usv == nil {\n\t\treturn errors.New(\"glVertexAttribI4usv\")\n\t}\n\tgpVertexAttribIFormat = (C.GPVERTEXATTRIBIFORMAT)(getProcAddr(\"glVertexAttribIFormat\"))\n\tgpVertexAttribIFormatNV = (C.GPVERTEXATTRIBIFORMATNV)(getProcAddr(\"glVertexAttribIFormatNV\"))\n\tgpVertexAttribIPointer = (C.GPVERTEXATTRIBIPOINTER)(getProcAddr(\"glVertexAttribIPointer\"))\n\tif gpVertexAttribIPointer == nil {\n\t\treturn errors.New(\"glVertexAttribIPointer\")\n\t}\n\tgpVertexAttribL1d = (C.GPVERTEXATTRIBL1D)(getProcAddr(\"glVertexAttribL1d\"))\n\tif gpVertexAttribL1d == nil {\n\t\treturn errors.New(\"glVertexAttribL1d\")\n\t}\n\tgpVertexAttribL1dv = (C.GPVERTEXATTRIBL1DV)(getProcAddr(\"glVertexAttribL1dv\"))\n\tif gpVertexAttribL1dv == nil {\n\t\treturn errors.New(\"glVertexAttribL1dv\")\n\t}\n\tgpVertexAttribL1i64NV = (C.GPVERTEXATTRIBL1I64NV)(getProcAddr(\"glVertexAttribL1i64NV\"))\n\tgpVertexAttribL1i64vNV = (C.GPVERTEXATTRIBL1I64VNV)(getProcAddr(\"glVertexAttribL1i64vNV\"))\n\tgpVertexAttribL1ui64ARB = (C.GPVERTEXATTRIBL1UI64ARB)(getProcAddr(\"glVertexAttribL1ui64ARB\"))\n\tgpVertexAttribL1ui64NV = (C.GPVERTEXATTRIBL1UI64NV)(getProcAddr(\"glVertexAttribL1ui64NV\"))\n\tgpVertexAttribL1ui64vARB = (C.GPVERTEXATTRIBL1UI64VARB)(getProcAddr(\"glVertexAttribL1ui64vARB\"))\n\tgpVertexAttribL1ui64vNV = (C.GPVERTEXATTRIBL1UI64VNV)(getProcAddr(\"glVertexAttribL1ui64vNV\"))\n\tgpVertexAttribL2d = (C.GPVERTEXATTRIBL2D)(getProcAddr(\"glVertexAttribL2d\"))\n\tif gpVertexAttribL2d == nil {\n\t\treturn errors.New(\"glVertexAttribL2d\")\n\t}\n\tgpVertexAttribL2dv = (C.GPVERTEXATTRIBL2DV)(getProcAddr(\"glVertexAttribL2dv\"))\n\tif gpVertexAttribL2dv == nil {\n\t\treturn errors.New(\"glVertexAttribL2dv\")\n\t}\n\tgpVertexAttribL2i64NV = (C.GPVERTEXATTRIBL2I64NV)(getProcAddr(\"glVertexAttribL2i64NV\"))\n\tgpVertexAttribL2i64vNV = (C.GPVERTEXATTRIBL2I64VNV)(getProcAddr(\"glVertexAttribL2i64vNV\"))\n\tgpVertexAttribL2ui64NV = (C.GPVERTEXATTRIBL2UI64NV)(getProcAddr(\"glVertexAttribL2ui64NV\"))\n\tgpVertexAttribL2ui64vNV = (C.GPVERTEXATTRIBL2UI64VNV)(getProcAddr(\"glVertexAttribL2ui64vNV\"))\n\tgpVertexAttribL3d = (C.GPVERTEXATTRIBL3D)(getProcAddr(\"glVertexAttribL3d\"))\n\tif gpVertexAttribL3d == nil {\n\t\treturn errors.New(\"glVertexAttribL3d\")\n\t}\n\tgpVertexAttribL3dv = (C.GPVERTEXATTRIBL3DV)(getProcAddr(\"glVertexAttribL3dv\"))\n\tif gpVertexAttribL3dv == nil {\n\t\treturn errors.New(\"glVertexAttribL3dv\")\n\t}\n\tgpVertexAttribL3i64NV = (C.GPVERTEXATTRIBL3I64NV)(getProcAddr(\"glVertexAttribL3i64NV\"))\n\tgpVertexAttribL3i64vNV = (C.GPVERTEXATTRIBL3I64VNV)(getProcAddr(\"glVertexAttribL3i64vNV\"))\n\tgpVertexAttribL3ui64NV = (C.GPVERTEXATTRIBL3UI64NV)(getProcAddr(\"glVertexAttribL3ui64NV\"))\n\tgpVertexAttribL3ui64vNV = (C.GPVERTEXATTRIBL3UI64VNV)(getProcAddr(\"glVertexAttribL3ui64vNV\"))\n\tgpVertexAttribL4d = (C.GPVERTEXATTRIBL4D)(getProcAddr(\"glVertexAttribL4d\"))\n\tif gpVertexAttribL4d == nil {\n\t\treturn errors.New(\"glVertexAttribL4d\")\n\t}\n\tgpVertexAttribL4dv = (C.GPVERTEXATTRIBL4DV)(getProcAddr(\"glVertexAttribL4dv\"))\n\tif gpVertexAttribL4dv == nil {\n\t\treturn errors.New(\"glVertexAttribL4dv\")\n\t}\n\tgpVertexAttribL4i64NV = (C.GPVERTEXATTRIBL4I64NV)(getProcAddr(\"glVertexAttribL4i64NV\"))\n\tgpVertexAttribL4i64vNV = (C.GPVERTEXATTRIBL4I64VNV)(getProcAddr(\"glVertexAttribL4i64vNV\"))\n\tgpVertexAttribL4ui64NV = (C.GPVERTEXATTRIBL4UI64NV)(getProcAddr(\"glVertexAttribL4ui64NV\"))\n\tgpVertexAttribL4ui64vNV = (C.GPVERTEXATTRIBL4UI64VNV)(getProcAddr(\"glVertexAttribL4ui64vNV\"))\n\tgpVertexAttribLFormat = (C.GPVERTEXATTRIBLFORMAT)(getProcAddr(\"glVertexAttribLFormat\"))\n\tgpVertexAttribLFormatNV = (C.GPVERTEXATTRIBLFORMATNV)(getProcAddr(\"glVertexAttribLFormatNV\"))\n\tgpVertexAttribLPointer = (C.GPVERTEXATTRIBLPOINTER)(getProcAddr(\"glVertexAttribLPointer\"))\n\tif gpVertexAttribLPointer == nil {\n\t\treturn errors.New(\"glVertexAttribLPointer\")\n\t}\n\tgpVertexAttribP1ui = (C.GPVERTEXATTRIBP1UI)(getProcAddr(\"glVertexAttribP1ui\"))\n\tif gpVertexAttribP1ui == nil {\n\t\treturn errors.New(\"glVertexAttribP1ui\")\n\t}\n\tgpVertexAttribP1uiv = (C.GPVERTEXATTRIBP1UIV)(getProcAddr(\"glVertexAttribP1uiv\"))\n\tif gpVertexAttribP1uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP1uiv\")\n\t}\n\tgpVertexAttribP2ui = (C.GPVERTEXATTRIBP2UI)(getProcAddr(\"glVertexAttribP2ui\"))\n\tif gpVertexAttribP2ui == nil {\n\t\treturn errors.New(\"glVertexAttribP2ui\")\n\t}\n\tgpVertexAttribP2uiv = (C.GPVERTEXATTRIBP2UIV)(getProcAddr(\"glVertexAttribP2uiv\"))\n\tif gpVertexAttribP2uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP2uiv\")\n\t}\n\tgpVertexAttribP3ui = (C.GPVERTEXATTRIBP3UI)(getProcAddr(\"glVertexAttribP3ui\"))\n\tif gpVertexAttribP3ui == nil {\n\t\treturn errors.New(\"glVertexAttribP3ui\")\n\t}\n\tgpVertexAttribP3uiv = (C.GPVERTEXATTRIBP3UIV)(getProcAddr(\"glVertexAttribP3uiv\"))\n\tif gpVertexAttribP3uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP3uiv\")\n\t}\n\tgpVertexAttribP4ui = (C.GPVERTEXATTRIBP4UI)(getProcAddr(\"glVertexAttribP4ui\"))\n\tif gpVertexAttribP4ui == nil {\n\t\treturn errors.New(\"glVertexAttribP4ui\")\n\t}\n\tgpVertexAttribP4uiv = (C.GPVERTEXATTRIBP4UIV)(getProcAddr(\"glVertexAttribP4uiv\"))\n\tif gpVertexAttribP4uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP4uiv\")\n\t}\n\tgpVertexAttribPointer = (C.GPVERTEXATTRIBPOINTER)(getProcAddr(\"glVertexAttribPointer\"))\n\tif gpVertexAttribPointer == nil {\n\t\treturn errors.New(\"glVertexAttribPointer\")\n\t}\n\tgpVertexBindingDivisor = (C.GPVERTEXBINDINGDIVISOR)(getProcAddr(\"glVertexBindingDivisor\"))\n\tgpVertexFormatNV = (C.GPVERTEXFORMATNV)(getProcAddr(\"glVertexFormatNV\"))\n\tgpViewport = (C.GPVIEWPORT)(getProcAddr(\"glViewport\"))\n\tif gpViewport == nil {\n\t\treturn errors.New(\"glViewport\")\n\t}\n\tgpViewportArrayv = (C.GPVIEWPORTARRAYV)(getProcAddr(\"glViewportArrayv\"))\n\tif gpViewportArrayv == nil {\n\t\treturn errors.New(\"glViewportArrayv\")\n\t}\n\tgpViewportIndexedf = (C.GPVIEWPORTINDEXEDF)(getProcAddr(\"glViewportIndexedf\"))\n\tif gpViewportIndexedf == nil {\n\t\treturn errors.New(\"glViewportIndexedf\")\n\t}\n\tgpViewportIndexedfv = (C.GPVIEWPORTINDEXEDFV)(getProcAddr(\"glViewportIndexedfv\"))\n\tif gpViewportIndexedfv == nil {\n\t\treturn errors.New(\"glViewportIndexedfv\")\n\t}\n\tgpViewportPositionWScaleNV = (C.GPVIEWPORTPOSITIONWSCALENV)(getProcAddr(\"glViewportPositionWScaleNV\"))\n\tgpViewportSwizzleNV = (C.GPVIEWPORTSWIZZLENV)(getProcAddr(\"glViewportSwizzleNV\"))\n\tgpWaitSync = (C.GPWAITSYNC)(getProcAddr(\"glWaitSync\"))\n\tif gpWaitSync == nil {\n\t\treturn errors.New(\"glWaitSync\")\n\t}\n\tgpWaitVkSemaphoreNV = (C.GPWAITVKSEMAPHORENV)(getProcAddr(\"glWaitVkSemaphoreNV\"))\n\tgpWeightPathsNV = (C.GPWEIGHTPATHSNV)(getProcAddr(\"glWeightPathsNV\"))\n\tgpWindowRectanglesEXT = (C.GPWINDOWRECTANGLESEXT)(getProcAddr(\"glWindowRectanglesEXT\"))\n\treturn nil\n}", "func DebugMessageCallbackARB(callback unsafe.Pointer, userParam unsafe.Pointer) {\n\tsyscall.Syscall(gpDebugMessageCallbackARB, 2, syscall.NewCallback(callback), uintptr(userParam), 0)\n}", "func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {\n\tgpAccum = uintptr(getProcAddr(\"glAccum\"))\n\tif gpAccum == 0 {\n\t\treturn errors.New(\"glAccum\")\n\t}\n\tgpAccumxOES = uintptr(getProcAddr(\"glAccumxOES\"))\n\tgpAcquireKeyedMutexWin32EXT = uintptr(getProcAddr(\"glAcquireKeyedMutexWin32EXT\"))\n\tgpActiveProgramEXT = uintptr(getProcAddr(\"glActiveProgramEXT\"))\n\tgpActiveShaderProgram = uintptr(getProcAddr(\"glActiveShaderProgram\"))\n\tgpActiveShaderProgramEXT = uintptr(getProcAddr(\"glActiveShaderProgramEXT\"))\n\tgpActiveStencilFaceEXT = uintptr(getProcAddr(\"glActiveStencilFaceEXT\"))\n\tgpActiveTexture = uintptr(getProcAddr(\"glActiveTexture\"))\n\tif gpActiveTexture == 0 {\n\t\treturn errors.New(\"glActiveTexture\")\n\t}\n\tgpActiveTextureARB = uintptr(getProcAddr(\"glActiveTextureARB\"))\n\tgpActiveVaryingNV = uintptr(getProcAddr(\"glActiveVaryingNV\"))\n\tgpAlphaFragmentOp1ATI = uintptr(getProcAddr(\"glAlphaFragmentOp1ATI\"))\n\tgpAlphaFragmentOp2ATI = uintptr(getProcAddr(\"glAlphaFragmentOp2ATI\"))\n\tgpAlphaFragmentOp3ATI = uintptr(getProcAddr(\"glAlphaFragmentOp3ATI\"))\n\tgpAlphaFunc = uintptr(getProcAddr(\"glAlphaFunc\"))\n\tif gpAlphaFunc == 0 {\n\t\treturn errors.New(\"glAlphaFunc\")\n\t}\n\tgpAlphaFuncxOES = uintptr(getProcAddr(\"glAlphaFuncxOES\"))\n\tgpAlphaToCoverageDitherControlNV = uintptr(getProcAddr(\"glAlphaToCoverageDitherControlNV\"))\n\tgpApplyFramebufferAttachmentCMAAINTEL = uintptr(getProcAddr(\"glApplyFramebufferAttachmentCMAAINTEL\"))\n\tgpApplyTextureEXT = uintptr(getProcAddr(\"glApplyTextureEXT\"))\n\tgpAreProgramsResidentNV = uintptr(getProcAddr(\"glAreProgramsResidentNV\"))\n\tgpAreTexturesResident = uintptr(getProcAddr(\"glAreTexturesResident\"))\n\tif gpAreTexturesResident == 0 {\n\t\treturn errors.New(\"glAreTexturesResident\")\n\t}\n\tgpAreTexturesResidentEXT = uintptr(getProcAddr(\"glAreTexturesResidentEXT\"))\n\tgpArrayElement = uintptr(getProcAddr(\"glArrayElement\"))\n\tif gpArrayElement == 0 {\n\t\treturn errors.New(\"glArrayElement\")\n\t}\n\tgpArrayElementEXT = uintptr(getProcAddr(\"glArrayElementEXT\"))\n\tgpArrayObjectATI = uintptr(getProcAddr(\"glArrayObjectATI\"))\n\tgpAsyncMarkerSGIX = uintptr(getProcAddr(\"glAsyncMarkerSGIX\"))\n\tgpAttachObjectARB = uintptr(getProcAddr(\"glAttachObjectARB\"))\n\tgpAttachShader = uintptr(getProcAddr(\"glAttachShader\"))\n\tif gpAttachShader == 0 {\n\t\treturn errors.New(\"glAttachShader\")\n\t}\n\tgpBegin = uintptr(getProcAddr(\"glBegin\"))\n\tif gpBegin == 0 {\n\t\treturn errors.New(\"glBegin\")\n\t}\n\tgpBeginConditionalRenderNV = uintptr(getProcAddr(\"glBeginConditionalRenderNV\"))\n\tgpBeginConditionalRenderNVX = uintptr(getProcAddr(\"glBeginConditionalRenderNVX\"))\n\tgpBeginFragmentShaderATI = uintptr(getProcAddr(\"glBeginFragmentShaderATI\"))\n\tgpBeginOcclusionQueryNV = uintptr(getProcAddr(\"glBeginOcclusionQueryNV\"))\n\tgpBeginPerfMonitorAMD = uintptr(getProcAddr(\"glBeginPerfMonitorAMD\"))\n\tgpBeginPerfQueryINTEL = uintptr(getProcAddr(\"glBeginPerfQueryINTEL\"))\n\tgpBeginQuery = uintptr(getProcAddr(\"glBeginQuery\"))\n\tif gpBeginQuery == 0 {\n\t\treturn errors.New(\"glBeginQuery\")\n\t}\n\tgpBeginQueryARB = uintptr(getProcAddr(\"glBeginQueryARB\"))\n\tgpBeginQueryIndexed = uintptr(getProcAddr(\"glBeginQueryIndexed\"))\n\tgpBeginTransformFeedbackEXT = uintptr(getProcAddr(\"glBeginTransformFeedbackEXT\"))\n\tgpBeginTransformFeedbackNV = uintptr(getProcAddr(\"glBeginTransformFeedbackNV\"))\n\tgpBeginVertexShaderEXT = uintptr(getProcAddr(\"glBeginVertexShaderEXT\"))\n\tgpBeginVideoCaptureNV = uintptr(getProcAddr(\"glBeginVideoCaptureNV\"))\n\tgpBindAttribLocation = uintptr(getProcAddr(\"glBindAttribLocation\"))\n\tif gpBindAttribLocation == 0 {\n\t\treturn errors.New(\"glBindAttribLocation\")\n\t}\n\tgpBindAttribLocationARB = uintptr(getProcAddr(\"glBindAttribLocationARB\"))\n\tgpBindBuffer = uintptr(getProcAddr(\"glBindBuffer\"))\n\tif gpBindBuffer == 0 {\n\t\treturn errors.New(\"glBindBuffer\")\n\t}\n\tgpBindBufferARB = uintptr(getProcAddr(\"glBindBufferARB\"))\n\tgpBindBufferBase = uintptr(getProcAddr(\"glBindBufferBase\"))\n\tgpBindBufferBaseEXT = uintptr(getProcAddr(\"glBindBufferBaseEXT\"))\n\tgpBindBufferBaseNV = uintptr(getProcAddr(\"glBindBufferBaseNV\"))\n\tgpBindBufferOffsetEXT = uintptr(getProcAddr(\"glBindBufferOffsetEXT\"))\n\tgpBindBufferOffsetNV = uintptr(getProcAddr(\"glBindBufferOffsetNV\"))\n\tgpBindBufferRange = uintptr(getProcAddr(\"glBindBufferRange\"))\n\tgpBindBufferRangeEXT = uintptr(getProcAddr(\"glBindBufferRangeEXT\"))\n\tgpBindBufferRangeNV = uintptr(getProcAddr(\"glBindBufferRangeNV\"))\n\tgpBindBuffersBase = uintptr(getProcAddr(\"glBindBuffersBase\"))\n\tgpBindBuffersRange = uintptr(getProcAddr(\"glBindBuffersRange\"))\n\tgpBindFragDataLocationEXT = uintptr(getProcAddr(\"glBindFragDataLocationEXT\"))\n\tgpBindFragDataLocationIndexed = uintptr(getProcAddr(\"glBindFragDataLocationIndexed\"))\n\tgpBindFragmentShaderATI = uintptr(getProcAddr(\"glBindFragmentShaderATI\"))\n\tgpBindFramebuffer = uintptr(getProcAddr(\"glBindFramebuffer\"))\n\tgpBindFramebufferEXT = uintptr(getProcAddr(\"glBindFramebufferEXT\"))\n\tgpBindImageTexture = uintptr(getProcAddr(\"glBindImageTexture\"))\n\tgpBindImageTextureEXT = uintptr(getProcAddr(\"glBindImageTextureEXT\"))\n\tgpBindImageTextures = uintptr(getProcAddr(\"glBindImageTextures\"))\n\tgpBindLightParameterEXT = uintptr(getProcAddr(\"glBindLightParameterEXT\"))\n\tgpBindMaterialParameterEXT = uintptr(getProcAddr(\"glBindMaterialParameterEXT\"))\n\tgpBindMultiTextureEXT = uintptr(getProcAddr(\"glBindMultiTextureEXT\"))\n\tgpBindParameterEXT = uintptr(getProcAddr(\"glBindParameterEXT\"))\n\tgpBindProgramARB = uintptr(getProcAddr(\"glBindProgramARB\"))\n\tgpBindProgramNV = uintptr(getProcAddr(\"glBindProgramNV\"))\n\tgpBindProgramPipeline = uintptr(getProcAddr(\"glBindProgramPipeline\"))\n\tgpBindProgramPipelineEXT = uintptr(getProcAddr(\"glBindProgramPipelineEXT\"))\n\tgpBindRenderbuffer = uintptr(getProcAddr(\"glBindRenderbuffer\"))\n\tgpBindRenderbufferEXT = uintptr(getProcAddr(\"glBindRenderbufferEXT\"))\n\tgpBindSampler = uintptr(getProcAddr(\"glBindSampler\"))\n\tgpBindSamplers = uintptr(getProcAddr(\"glBindSamplers\"))\n\tgpBindTexGenParameterEXT = uintptr(getProcAddr(\"glBindTexGenParameterEXT\"))\n\tgpBindTexture = uintptr(getProcAddr(\"glBindTexture\"))\n\tif gpBindTexture == 0 {\n\t\treturn errors.New(\"glBindTexture\")\n\t}\n\tgpBindTextureEXT = uintptr(getProcAddr(\"glBindTextureEXT\"))\n\tgpBindTextureUnit = uintptr(getProcAddr(\"glBindTextureUnit\"))\n\tgpBindTextureUnitParameterEXT = uintptr(getProcAddr(\"glBindTextureUnitParameterEXT\"))\n\tgpBindTextures = uintptr(getProcAddr(\"glBindTextures\"))\n\tgpBindTransformFeedback = uintptr(getProcAddr(\"glBindTransformFeedback\"))\n\tgpBindTransformFeedbackNV = uintptr(getProcAddr(\"glBindTransformFeedbackNV\"))\n\tgpBindVertexArray = uintptr(getProcAddr(\"glBindVertexArray\"))\n\tgpBindVertexArrayAPPLE = uintptr(getProcAddr(\"glBindVertexArrayAPPLE\"))\n\tgpBindVertexBuffer = uintptr(getProcAddr(\"glBindVertexBuffer\"))\n\tgpBindVertexBuffers = uintptr(getProcAddr(\"glBindVertexBuffers\"))\n\tgpBindVertexShaderEXT = uintptr(getProcAddr(\"glBindVertexShaderEXT\"))\n\tgpBindVideoCaptureStreamBufferNV = uintptr(getProcAddr(\"glBindVideoCaptureStreamBufferNV\"))\n\tgpBindVideoCaptureStreamTextureNV = uintptr(getProcAddr(\"glBindVideoCaptureStreamTextureNV\"))\n\tgpBinormal3bEXT = uintptr(getProcAddr(\"glBinormal3bEXT\"))\n\tgpBinormal3bvEXT = uintptr(getProcAddr(\"glBinormal3bvEXT\"))\n\tgpBinormal3dEXT = uintptr(getProcAddr(\"glBinormal3dEXT\"))\n\tgpBinormal3dvEXT = uintptr(getProcAddr(\"glBinormal3dvEXT\"))\n\tgpBinormal3fEXT = uintptr(getProcAddr(\"glBinormal3fEXT\"))\n\tgpBinormal3fvEXT = uintptr(getProcAddr(\"glBinormal3fvEXT\"))\n\tgpBinormal3iEXT = uintptr(getProcAddr(\"glBinormal3iEXT\"))\n\tgpBinormal3ivEXT = uintptr(getProcAddr(\"glBinormal3ivEXT\"))\n\tgpBinormal3sEXT = uintptr(getProcAddr(\"glBinormal3sEXT\"))\n\tgpBinormal3svEXT = uintptr(getProcAddr(\"glBinormal3svEXT\"))\n\tgpBinormalPointerEXT = uintptr(getProcAddr(\"glBinormalPointerEXT\"))\n\tgpBitmap = uintptr(getProcAddr(\"glBitmap\"))\n\tif gpBitmap == 0 {\n\t\treturn errors.New(\"glBitmap\")\n\t}\n\tgpBitmapxOES = uintptr(getProcAddr(\"glBitmapxOES\"))\n\tgpBlendBarrierKHR = uintptr(getProcAddr(\"glBlendBarrierKHR\"))\n\tgpBlendBarrierNV = uintptr(getProcAddr(\"glBlendBarrierNV\"))\n\tgpBlendColor = uintptr(getProcAddr(\"glBlendColor\"))\n\tif gpBlendColor == 0 {\n\t\treturn errors.New(\"glBlendColor\")\n\t}\n\tgpBlendColorEXT = uintptr(getProcAddr(\"glBlendColorEXT\"))\n\tgpBlendColorxOES = uintptr(getProcAddr(\"glBlendColorxOES\"))\n\tgpBlendEquation = uintptr(getProcAddr(\"glBlendEquation\"))\n\tif gpBlendEquation == 0 {\n\t\treturn errors.New(\"glBlendEquation\")\n\t}\n\tgpBlendEquationEXT = uintptr(getProcAddr(\"glBlendEquationEXT\"))\n\tgpBlendEquationIndexedAMD = uintptr(getProcAddr(\"glBlendEquationIndexedAMD\"))\n\tgpBlendEquationSeparate = uintptr(getProcAddr(\"glBlendEquationSeparate\"))\n\tif gpBlendEquationSeparate == 0 {\n\t\treturn errors.New(\"glBlendEquationSeparate\")\n\t}\n\tgpBlendEquationSeparateEXT = uintptr(getProcAddr(\"glBlendEquationSeparateEXT\"))\n\tgpBlendEquationSeparateIndexedAMD = uintptr(getProcAddr(\"glBlendEquationSeparateIndexedAMD\"))\n\tgpBlendEquationSeparateiARB = uintptr(getProcAddr(\"glBlendEquationSeparateiARB\"))\n\tgpBlendEquationiARB = uintptr(getProcAddr(\"glBlendEquationiARB\"))\n\tgpBlendFunc = uintptr(getProcAddr(\"glBlendFunc\"))\n\tif gpBlendFunc == 0 {\n\t\treturn errors.New(\"glBlendFunc\")\n\t}\n\tgpBlendFuncIndexedAMD = uintptr(getProcAddr(\"glBlendFuncIndexedAMD\"))\n\tgpBlendFuncSeparate = uintptr(getProcAddr(\"glBlendFuncSeparate\"))\n\tif gpBlendFuncSeparate == 0 {\n\t\treturn errors.New(\"glBlendFuncSeparate\")\n\t}\n\tgpBlendFuncSeparateEXT = uintptr(getProcAddr(\"glBlendFuncSeparateEXT\"))\n\tgpBlendFuncSeparateINGR = uintptr(getProcAddr(\"glBlendFuncSeparateINGR\"))\n\tgpBlendFuncSeparateIndexedAMD = uintptr(getProcAddr(\"glBlendFuncSeparateIndexedAMD\"))\n\tgpBlendFuncSeparateiARB = uintptr(getProcAddr(\"glBlendFuncSeparateiARB\"))\n\tgpBlendFunciARB = uintptr(getProcAddr(\"glBlendFunciARB\"))\n\tgpBlendParameteriNV = uintptr(getProcAddr(\"glBlendParameteriNV\"))\n\tgpBlitFramebuffer = uintptr(getProcAddr(\"glBlitFramebuffer\"))\n\tgpBlitFramebufferEXT = uintptr(getProcAddr(\"glBlitFramebufferEXT\"))\n\tgpBlitNamedFramebuffer = uintptr(getProcAddr(\"glBlitNamedFramebuffer\"))\n\tgpBufferAddressRangeNV = uintptr(getProcAddr(\"glBufferAddressRangeNV\"))\n\tgpBufferData = uintptr(getProcAddr(\"glBufferData\"))\n\tif gpBufferData == 0 {\n\t\treturn errors.New(\"glBufferData\")\n\t}\n\tgpBufferDataARB = uintptr(getProcAddr(\"glBufferDataARB\"))\n\tgpBufferPageCommitmentARB = uintptr(getProcAddr(\"glBufferPageCommitmentARB\"))\n\tgpBufferParameteriAPPLE = uintptr(getProcAddr(\"glBufferParameteriAPPLE\"))\n\tgpBufferStorage = uintptr(getProcAddr(\"glBufferStorage\"))\n\tgpBufferStorageExternalEXT = uintptr(getProcAddr(\"glBufferStorageExternalEXT\"))\n\tgpBufferStorageMemEXT = uintptr(getProcAddr(\"glBufferStorageMemEXT\"))\n\tgpBufferSubData = uintptr(getProcAddr(\"glBufferSubData\"))\n\tif gpBufferSubData == 0 {\n\t\treturn errors.New(\"glBufferSubData\")\n\t}\n\tgpBufferSubDataARB = uintptr(getProcAddr(\"glBufferSubDataARB\"))\n\tgpCallCommandListNV = uintptr(getProcAddr(\"glCallCommandListNV\"))\n\tgpCallList = uintptr(getProcAddr(\"glCallList\"))\n\tif gpCallList == 0 {\n\t\treturn errors.New(\"glCallList\")\n\t}\n\tgpCallLists = uintptr(getProcAddr(\"glCallLists\"))\n\tif gpCallLists == 0 {\n\t\treturn errors.New(\"glCallLists\")\n\t}\n\tgpCheckFramebufferStatus = uintptr(getProcAddr(\"glCheckFramebufferStatus\"))\n\tgpCheckFramebufferStatusEXT = uintptr(getProcAddr(\"glCheckFramebufferStatusEXT\"))\n\tgpCheckNamedFramebufferStatus = uintptr(getProcAddr(\"glCheckNamedFramebufferStatus\"))\n\tgpCheckNamedFramebufferStatusEXT = uintptr(getProcAddr(\"glCheckNamedFramebufferStatusEXT\"))\n\tgpClampColorARB = uintptr(getProcAddr(\"glClampColorARB\"))\n\tgpClear = uintptr(getProcAddr(\"glClear\"))\n\tif gpClear == 0 {\n\t\treturn errors.New(\"glClear\")\n\t}\n\tgpClearAccum = uintptr(getProcAddr(\"glClearAccum\"))\n\tif gpClearAccum == 0 {\n\t\treturn errors.New(\"glClearAccum\")\n\t}\n\tgpClearAccumxOES = uintptr(getProcAddr(\"glClearAccumxOES\"))\n\tgpClearBufferData = uintptr(getProcAddr(\"glClearBufferData\"))\n\tgpClearBufferSubData = uintptr(getProcAddr(\"glClearBufferSubData\"))\n\tgpClearColor = uintptr(getProcAddr(\"glClearColor\"))\n\tif gpClearColor == 0 {\n\t\treturn errors.New(\"glClearColor\")\n\t}\n\tgpClearColorIiEXT = uintptr(getProcAddr(\"glClearColorIiEXT\"))\n\tgpClearColorIuiEXT = uintptr(getProcAddr(\"glClearColorIuiEXT\"))\n\tgpClearColorxOES = uintptr(getProcAddr(\"glClearColorxOES\"))\n\tgpClearDepth = uintptr(getProcAddr(\"glClearDepth\"))\n\tif gpClearDepth == 0 {\n\t\treturn errors.New(\"glClearDepth\")\n\t}\n\tgpClearDepthdNV = uintptr(getProcAddr(\"glClearDepthdNV\"))\n\tgpClearDepthf = uintptr(getProcAddr(\"glClearDepthf\"))\n\tgpClearDepthfOES = uintptr(getProcAddr(\"glClearDepthfOES\"))\n\tgpClearDepthxOES = uintptr(getProcAddr(\"glClearDepthxOES\"))\n\tgpClearIndex = uintptr(getProcAddr(\"glClearIndex\"))\n\tif gpClearIndex == 0 {\n\t\treturn errors.New(\"glClearIndex\")\n\t}\n\tgpClearNamedBufferData = uintptr(getProcAddr(\"glClearNamedBufferData\"))\n\tgpClearNamedBufferDataEXT = uintptr(getProcAddr(\"glClearNamedBufferDataEXT\"))\n\tgpClearNamedBufferSubData = uintptr(getProcAddr(\"glClearNamedBufferSubData\"))\n\tgpClearNamedBufferSubDataEXT = uintptr(getProcAddr(\"glClearNamedBufferSubDataEXT\"))\n\tgpClearNamedFramebufferfi = uintptr(getProcAddr(\"glClearNamedFramebufferfi\"))\n\tgpClearNamedFramebufferfv = uintptr(getProcAddr(\"glClearNamedFramebufferfv\"))\n\tgpClearNamedFramebufferiv = uintptr(getProcAddr(\"glClearNamedFramebufferiv\"))\n\tgpClearNamedFramebufferuiv = uintptr(getProcAddr(\"glClearNamedFramebufferuiv\"))\n\tgpClearStencil = uintptr(getProcAddr(\"glClearStencil\"))\n\tif gpClearStencil == 0 {\n\t\treturn errors.New(\"glClearStencil\")\n\t}\n\tgpClearTexImage = uintptr(getProcAddr(\"glClearTexImage\"))\n\tgpClearTexSubImage = uintptr(getProcAddr(\"glClearTexSubImage\"))\n\tgpClientActiveTexture = uintptr(getProcAddr(\"glClientActiveTexture\"))\n\tif gpClientActiveTexture == 0 {\n\t\treturn errors.New(\"glClientActiveTexture\")\n\t}\n\tgpClientActiveTextureARB = uintptr(getProcAddr(\"glClientActiveTextureARB\"))\n\tgpClientActiveVertexStreamATI = uintptr(getProcAddr(\"glClientActiveVertexStreamATI\"))\n\tgpClientAttribDefaultEXT = uintptr(getProcAddr(\"glClientAttribDefaultEXT\"))\n\tgpClientWaitSync = uintptr(getProcAddr(\"glClientWaitSync\"))\n\tgpClipControl = uintptr(getProcAddr(\"glClipControl\"))\n\tgpClipPlane = uintptr(getProcAddr(\"glClipPlane\"))\n\tif gpClipPlane == 0 {\n\t\treturn errors.New(\"glClipPlane\")\n\t}\n\tgpClipPlanefOES = uintptr(getProcAddr(\"glClipPlanefOES\"))\n\tgpClipPlanexOES = uintptr(getProcAddr(\"glClipPlanexOES\"))\n\tgpColor3b = uintptr(getProcAddr(\"glColor3b\"))\n\tif gpColor3b == 0 {\n\t\treturn errors.New(\"glColor3b\")\n\t}\n\tgpColor3bv = uintptr(getProcAddr(\"glColor3bv\"))\n\tif gpColor3bv == 0 {\n\t\treturn errors.New(\"glColor3bv\")\n\t}\n\tgpColor3d = uintptr(getProcAddr(\"glColor3d\"))\n\tif gpColor3d == 0 {\n\t\treturn errors.New(\"glColor3d\")\n\t}\n\tgpColor3dv = uintptr(getProcAddr(\"glColor3dv\"))\n\tif gpColor3dv == 0 {\n\t\treturn errors.New(\"glColor3dv\")\n\t}\n\tgpColor3f = uintptr(getProcAddr(\"glColor3f\"))\n\tif gpColor3f == 0 {\n\t\treturn errors.New(\"glColor3f\")\n\t}\n\tgpColor3fVertex3fSUN = uintptr(getProcAddr(\"glColor3fVertex3fSUN\"))\n\tgpColor3fVertex3fvSUN = uintptr(getProcAddr(\"glColor3fVertex3fvSUN\"))\n\tgpColor3fv = uintptr(getProcAddr(\"glColor3fv\"))\n\tif gpColor3fv == 0 {\n\t\treturn errors.New(\"glColor3fv\")\n\t}\n\tgpColor3hNV = uintptr(getProcAddr(\"glColor3hNV\"))\n\tgpColor3hvNV = uintptr(getProcAddr(\"glColor3hvNV\"))\n\tgpColor3i = uintptr(getProcAddr(\"glColor3i\"))\n\tif gpColor3i == 0 {\n\t\treturn errors.New(\"glColor3i\")\n\t}\n\tgpColor3iv = uintptr(getProcAddr(\"glColor3iv\"))\n\tif gpColor3iv == 0 {\n\t\treturn errors.New(\"glColor3iv\")\n\t}\n\tgpColor3s = uintptr(getProcAddr(\"glColor3s\"))\n\tif gpColor3s == 0 {\n\t\treturn errors.New(\"glColor3s\")\n\t}\n\tgpColor3sv = uintptr(getProcAddr(\"glColor3sv\"))\n\tif gpColor3sv == 0 {\n\t\treturn errors.New(\"glColor3sv\")\n\t}\n\tgpColor3ub = uintptr(getProcAddr(\"glColor3ub\"))\n\tif gpColor3ub == 0 {\n\t\treturn errors.New(\"glColor3ub\")\n\t}\n\tgpColor3ubv = uintptr(getProcAddr(\"glColor3ubv\"))\n\tif gpColor3ubv == 0 {\n\t\treturn errors.New(\"glColor3ubv\")\n\t}\n\tgpColor3ui = uintptr(getProcAddr(\"glColor3ui\"))\n\tif gpColor3ui == 0 {\n\t\treturn errors.New(\"glColor3ui\")\n\t}\n\tgpColor3uiv = uintptr(getProcAddr(\"glColor3uiv\"))\n\tif gpColor3uiv == 0 {\n\t\treturn errors.New(\"glColor3uiv\")\n\t}\n\tgpColor3us = uintptr(getProcAddr(\"glColor3us\"))\n\tif gpColor3us == 0 {\n\t\treturn errors.New(\"glColor3us\")\n\t}\n\tgpColor3usv = uintptr(getProcAddr(\"glColor3usv\"))\n\tif gpColor3usv == 0 {\n\t\treturn errors.New(\"glColor3usv\")\n\t}\n\tgpColor3xOES = uintptr(getProcAddr(\"glColor3xOES\"))\n\tgpColor3xvOES = uintptr(getProcAddr(\"glColor3xvOES\"))\n\tgpColor4b = uintptr(getProcAddr(\"glColor4b\"))\n\tif gpColor4b == 0 {\n\t\treturn errors.New(\"glColor4b\")\n\t}\n\tgpColor4bv = uintptr(getProcAddr(\"glColor4bv\"))\n\tif gpColor4bv == 0 {\n\t\treturn errors.New(\"glColor4bv\")\n\t}\n\tgpColor4d = uintptr(getProcAddr(\"glColor4d\"))\n\tif gpColor4d == 0 {\n\t\treturn errors.New(\"glColor4d\")\n\t}\n\tgpColor4dv = uintptr(getProcAddr(\"glColor4dv\"))\n\tif gpColor4dv == 0 {\n\t\treturn errors.New(\"glColor4dv\")\n\t}\n\tgpColor4f = uintptr(getProcAddr(\"glColor4f\"))\n\tif gpColor4f == 0 {\n\t\treturn errors.New(\"glColor4f\")\n\t}\n\tgpColor4fNormal3fVertex3fSUN = uintptr(getProcAddr(\"glColor4fNormal3fVertex3fSUN\"))\n\tgpColor4fNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glColor4fNormal3fVertex3fvSUN\"))\n\tgpColor4fv = uintptr(getProcAddr(\"glColor4fv\"))\n\tif gpColor4fv == 0 {\n\t\treturn errors.New(\"glColor4fv\")\n\t}\n\tgpColor4hNV = uintptr(getProcAddr(\"glColor4hNV\"))\n\tgpColor4hvNV = uintptr(getProcAddr(\"glColor4hvNV\"))\n\tgpColor4i = uintptr(getProcAddr(\"glColor4i\"))\n\tif gpColor4i == 0 {\n\t\treturn errors.New(\"glColor4i\")\n\t}\n\tgpColor4iv = uintptr(getProcAddr(\"glColor4iv\"))\n\tif gpColor4iv == 0 {\n\t\treturn errors.New(\"glColor4iv\")\n\t}\n\tgpColor4s = uintptr(getProcAddr(\"glColor4s\"))\n\tif gpColor4s == 0 {\n\t\treturn errors.New(\"glColor4s\")\n\t}\n\tgpColor4sv = uintptr(getProcAddr(\"glColor4sv\"))\n\tif gpColor4sv == 0 {\n\t\treturn errors.New(\"glColor4sv\")\n\t}\n\tgpColor4ub = uintptr(getProcAddr(\"glColor4ub\"))\n\tif gpColor4ub == 0 {\n\t\treturn errors.New(\"glColor4ub\")\n\t}\n\tgpColor4ubVertex2fSUN = uintptr(getProcAddr(\"glColor4ubVertex2fSUN\"))\n\tgpColor4ubVertex2fvSUN = uintptr(getProcAddr(\"glColor4ubVertex2fvSUN\"))\n\tgpColor4ubVertex3fSUN = uintptr(getProcAddr(\"glColor4ubVertex3fSUN\"))\n\tgpColor4ubVertex3fvSUN = uintptr(getProcAddr(\"glColor4ubVertex3fvSUN\"))\n\tgpColor4ubv = uintptr(getProcAddr(\"glColor4ubv\"))\n\tif gpColor4ubv == 0 {\n\t\treturn errors.New(\"glColor4ubv\")\n\t}\n\tgpColor4ui = uintptr(getProcAddr(\"glColor4ui\"))\n\tif gpColor4ui == 0 {\n\t\treturn errors.New(\"glColor4ui\")\n\t}\n\tgpColor4uiv = uintptr(getProcAddr(\"glColor4uiv\"))\n\tif gpColor4uiv == 0 {\n\t\treturn errors.New(\"glColor4uiv\")\n\t}\n\tgpColor4us = uintptr(getProcAddr(\"glColor4us\"))\n\tif gpColor4us == 0 {\n\t\treturn errors.New(\"glColor4us\")\n\t}\n\tgpColor4usv = uintptr(getProcAddr(\"glColor4usv\"))\n\tif gpColor4usv == 0 {\n\t\treturn errors.New(\"glColor4usv\")\n\t}\n\tgpColor4xOES = uintptr(getProcAddr(\"glColor4xOES\"))\n\tgpColor4xvOES = uintptr(getProcAddr(\"glColor4xvOES\"))\n\tgpColorFormatNV = uintptr(getProcAddr(\"glColorFormatNV\"))\n\tgpColorFragmentOp1ATI = uintptr(getProcAddr(\"glColorFragmentOp1ATI\"))\n\tgpColorFragmentOp2ATI = uintptr(getProcAddr(\"glColorFragmentOp2ATI\"))\n\tgpColorFragmentOp3ATI = uintptr(getProcAddr(\"glColorFragmentOp3ATI\"))\n\tgpColorMask = uintptr(getProcAddr(\"glColorMask\"))\n\tif gpColorMask == 0 {\n\t\treturn errors.New(\"glColorMask\")\n\t}\n\tgpColorMaskIndexedEXT = uintptr(getProcAddr(\"glColorMaskIndexedEXT\"))\n\tgpColorMaterial = uintptr(getProcAddr(\"glColorMaterial\"))\n\tif gpColorMaterial == 0 {\n\t\treturn errors.New(\"glColorMaterial\")\n\t}\n\tgpColorPointer = uintptr(getProcAddr(\"glColorPointer\"))\n\tif gpColorPointer == 0 {\n\t\treturn errors.New(\"glColorPointer\")\n\t}\n\tgpColorPointerEXT = uintptr(getProcAddr(\"glColorPointerEXT\"))\n\tgpColorPointerListIBM = uintptr(getProcAddr(\"glColorPointerListIBM\"))\n\tgpColorPointervINTEL = uintptr(getProcAddr(\"glColorPointervINTEL\"))\n\tgpColorSubTableEXT = uintptr(getProcAddr(\"glColorSubTableEXT\"))\n\tgpColorTableEXT = uintptr(getProcAddr(\"glColorTableEXT\"))\n\tgpColorTableParameterfvSGI = uintptr(getProcAddr(\"glColorTableParameterfvSGI\"))\n\tgpColorTableParameterivSGI = uintptr(getProcAddr(\"glColorTableParameterivSGI\"))\n\tgpColorTableSGI = uintptr(getProcAddr(\"glColorTableSGI\"))\n\tgpCombinerInputNV = uintptr(getProcAddr(\"glCombinerInputNV\"))\n\tgpCombinerOutputNV = uintptr(getProcAddr(\"glCombinerOutputNV\"))\n\tgpCombinerParameterfNV = uintptr(getProcAddr(\"glCombinerParameterfNV\"))\n\tgpCombinerParameterfvNV = uintptr(getProcAddr(\"glCombinerParameterfvNV\"))\n\tgpCombinerParameteriNV = uintptr(getProcAddr(\"glCombinerParameteriNV\"))\n\tgpCombinerParameterivNV = uintptr(getProcAddr(\"glCombinerParameterivNV\"))\n\tgpCombinerStageParameterfvNV = uintptr(getProcAddr(\"glCombinerStageParameterfvNV\"))\n\tgpCommandListSegmentsNV = uintptr(getProcAddr(\"glCommandListSegmentsNV\"))\n\tgpCompileCommandListNV = uintptr(getProcAddr(\"glCompileCommandListNV\"))\n\tgpCompileShader = uintptr(getProcAddr(\"glCompileShader\"))\n\tif gpCompileShader == 0 {\n\t\treturn errors.New(\"glCompileShader\")\n\t}\n\tgpCompileShaderARB = uintptr(getProcAddr(\"glCompileShaderARB\"))\n\tgpCompileShaderIncludeARB = uintptr(getProcAddr(\"glCompileShaderIncludeARB\"))\n\tgpCompressedMultiTexImage1DEXT = uintptr(getProcAddr(\"glCompressedMultiTexImage1DEXT\"))\n\tgpCompressedMultiTexImage2DEXT = uintptr(getProcAddr(\"glCompressedMultiTexImage2DEXT\"))\n\tgpCompressedMultiTexImage3DEXT = uintptr(getProcAddr(\"glCompressedMultiTexImage3DEXT\"))\n\tgpCompressedMultiTexSubImage1DEXT = uintptr(getProcAddr(\"glCompressedMultiTexSubImage1DEXT\"))\n\tgpCompressedMultiTexSubImage2DEXT = uintptr(getProcAddr(\"glCompressedMultiTexSubImage2DEXT\"))\n\tgpCompressedMultiTexSubImage3DEXT = uintptr(getProcAddr(\"glCompressedMultiTexSubImage3DEXT\"))\n\tgpCompressedTexImage1D = uintptr(getProcAddr(\"glCompressedTexImage1D\"))\n\tif gpCompressedTexImage1D == 0 {\n\t\treturn errors.New(\"glCompressedTexImage1D\")\n\t}\n\tgpCompressedTexImage1DARB = uintptr(getProcAddr(\"glCompressedTexImage1DARB\"))\n\tgpCompressedTexImage2D = uintptr(getProcAddr(\"glCompressedTexImage2D\"))\n\tif gpCompressedTexImage2D == 0 {\n\t\treturn errors.New(\"glCompressedTexImage2D\")\n\t}\n\tgpCompressedTexImage2DARB = uintptr(getProcAddr(\"glCompressedTexImage2DARB\"))\n\tgpCompressedTexImage3D = uintptr(getProcAddr(\"glCompressedTexImage3D\"))\n\tif gpCompressedTexImage3D == 0 {\n\t\treturn errors.New(\"glCompressedTexImage3D\")\n\t}\n\tgpCompressedTexImage3DARB = uintptr(getProcAddr(\"glCompressedTexImage3DARB\"))\n\tgpCompressedTexSubImage1D = uintptr(getProcAddr(\"glCompressedTexSubImage1D\"))\n\tif gpCompressedTexSubImage1D == 0 {\n\t\treturn errors.New(\"glCompressedTexSubImage1D\")\n\t}\n\tgpCompressedTexSubImage1DARB = uintptr(getProcAddr(\"glCompressedTexSubImage1DARB\"))\n\tgpCompressedTexSubImage2D = uintptr(getProcAddr(\"glCompressedTexSubImage2D\"))\n\tif gpCompressedTexSubImage2D == 0 {\n\t\treturn errors.New(\"glCompressedTexSubImage2D\")\n\t}\n\tgpCompressedTexSubImage2DARB = uintptr(getProcAddr(\"glCompressedTexSubImage2DARB\"))\n\tgpCompressedTexSubImage3D = uintptr(getProcAddr(\"glCompressedTexSubImage3D\"))\n\tif gpCompressedTexSubImage3D == 0 {\n\t\treturn errors.New(\"glCompressedTexSubImage3D\")\n\t}\n\tgpCompressedTexSubImage3DARB = uintptr(getProcAddr(\"glCompressedTexSubImage3DARB\"))\n\tgpCompressedTextureImage1DEXT = uintptr(getProcAddr(\"glCompressedTextureImage1DEXT\"))\n\tgpCompressedTextureImage2DEXT = uintptr(getProcAddr(\"glCompressedTextureImage2DEXT\"))\n\tgpCompressedTextureImage3DEXT = uintptr(getProcAddr(\"glCompressedTextureImage3DEXT\"))\n\tgpCompressedTextureSubImage1D = uintptr(getProcAddr(\"glCompressedTextureSubImage1D\"))\n\tgpCompressedTextureSubImage1DEXT = uintptr(getProcAddr(\"glCompressedTextureSubImage1DEXT\"))\n\tgpCompressedTextureSubImage2D = uintptr(getProcAddr(\"glCompressedTextureSubImage2D\"))\n\tgpCompressedTextureSubImage2DEXT = uintptr(getProcAddr(\"glCompressedTextureSubImage2DEXT\"))\n\tgpCompressedTextureSubImage3D = uintptr(getProcAddr(\"glCompressedTextureSubImage3D\"))\n\tgpCompressedTextureSubImage3DEXT = uintptr(getProcAddr(\"glCompressedTextureSubImage3DEXT\"))\n\tgpConservativeRasterParameterfNV = uintptr(getProcAddr(\"glConservativeRasterParameterfNV\"))\n\tgpConservativeRasterParameteriNV = uintptr(getProcAddr(\"glConservativeRasterParameteriNV\"))\n\tgpConvolutionFilter1DEXT = uintptr(getProcAddr(\"glConvolutionFilter1DEXT\"))\n\tgpConvolutionFilter2DEXT = uintptr(getProcAddr(\"glConvolutionFilter2DEXT\"))\n\tgpConvolutionParameterfEXT = uintptr(getProcAddr(\"glConvolutionParameterfEXT\"))\n\tgpConvolutionParameterfvEXT = uintptr(getProcAddr(\"glConvolutionParameterfvEXT\"))\n\tgpConvolutionParameteriEXT = uintptr(getProcAddr(\"glConvolutionParameteriEXT\"))\n\tgpConvolutionParameterivEXT = uintptr(getProcAddr(\"glConvolutionParameterivEXT\"))\n\tgpConvolutionParameterxOES = uintptr(getProcAddr(\"glConvolutionParameterxOES\"))\n\tgpConvolutionParameterxvOES = uintptr(getProcAddr(\"glConvolutionParameterxvOES\"))\n\tgpCopyBufferSubData = uintptr(getProcAddr(\"glCopyBufferSubData\"))\n\tgpCopyColorSubTableEXT = uintptr(getProcAddr(\"glCopyColorSubTableEXT\"))\n\tgpCopyColorTableSGI = uintptr(getProcAddr(\"glCopyColorTableSGI\"))\n\tgpCopyConvolutionFilter1DEXT = uintptr(getProcAddr(\"glCopyConvolutionFilter1DEXT\"))\n\tgpCopyConvolutionFilter2DEXT = uintptr(getProcAddr(\"glCopyConvolutionFilter2DEXT\"))\n\tgpCopyImageSubData = uintptr(getProcAddr(\"glCopyImageSubData\"))\n\tgpCopyImageSubDataNV = uintptr(getProcAddr(\"glCopyImageSubDataNV\"))\n\tgpCopyMultiTexImage1DEXT = uintptr(getProcAddr(\"glCopyMultiTexImage1DEXT\"))\n\tgpCopyMultiTexImage2DEXT = uintptr(getProcAddr(\"glCopyMultiTexImage2DEXT\"))\n\tgpCopyMultiTexSubImage1DEXT = uintptr(getProcAddr(\"glCopyMultiTexSubImage1DEXT\"))\n\tgpCopyMultiTexSubImage2DEXT = uintptr(getProcAddr(\"glCopyMultiTexSubImage2DEXT\"))\n\tgpCopyMultiTexSubImage3DEXT = uintptr(getProcAddr(\"glCopyMultiTexSubImage3DEXT\"))\n\tgpCopyNamedBufferSubData = uintptr(getProcAddr(\"glCopyNamedBufferSubData\"))\n\tgpCopyPathNV = uintptr(getProcAddr(\"glCopyPathNV\"))\n\tgpCopyPixels = uintptr(getProcAddr(\"glCopyPixels\"))\n\tif gpCopyPixels == 0 {\n\t\treturn errors.New(\"glCopyPixels\")\n\t}\n\tgpCopyTexImage1D = uintptr(getProcAddr(\"glCopyTexImage1D\"))\n\tif gpCopyTexImage1D == 0 {\n\t\treturn errors.New(\"glCopyTexImage1D\")\n\t}\n\tgpCopyTexImage1DEXT = uintptr(getProcAddr(\"glCopyTexImage1DEXT\"))\n\tgpCopyTexImage2D = uintptr(getProcAddr(\"glCopyTexImage2D\"))\n\tif gpCopyTexImage2D == 0 {\n\t\treturn errors.New(\"glCopyTexImage2D\")\n\t}\n\tgpCopyTexImage2DEXT = uintptr(getProcAddr(\"glCopyTexImage2DEXT\"))\n\tgpCopyTexSubImage1D = uintptr(getProcAddr(\"glCopyTexSubImage1D\"))\n\tif gpCopyTexSubImage1D == 0 {\n\t\treturn errors.New(\"glCopyTexSubImage1D\")\n\t}\n\tgpCopyTexSubImage1DEXT = uintptr(getProcAddr(\"glCopyTexSubImage1DEXT\"))\n\tgpCopyTexSubImage2D = uintptr(getProcAddr(\"glCopyTexSubImage2D\"))\n\tif gpCopyTexSubImage2D == 0 {\n\t\treturn errors.New(\"glCopyTexSubImage2D\")\n\t}\n\tgpCopyTexSubImage2DEXT = uintptr(getProcAddr(\"glCopyTexSubImage2DEXT\"))\n\tgpCopyTexSubImage3D = uintptr(getProcAddr(\"glCopyTexSubImage3D\"))\n\tif gpCopyTexSubImage3D == 0 {\n\t\treturn errors.New(\"glCopyTexSubImage3D\")\n\t}\n\tgpCopyTexSubImage3DEXT = uintptr(getProcAddr(\"glCopyTexSubImage3DEXT\"))\n\tgpCopyTextureImage1DEXT = uintptr(getProcAddr(\"glCopyTextureImage1DEXT\"))\n\tgpCopyTextureImage2DEXT = uintptr(getProcAddr(\"glCopyTextureImage2DEXT\"))\n\tgpCopyTextureSubImage1D = uintptr(getProcAddr(\"glCopyTextureSubImage1D\"))\n\tgpCopyTextureSubImage1DEXT = uintptr(getProcAddr(\"glCopyTextureSubImage1DEXT\"))\n\tgpCopyTextureSubImage2D = uintptr(getProcAddr(\"glCopyTextureSubImage2D\"))\n\tgpCopyTextureSubImage2DEXT = uintptr(getProcAddr(\"glCopyTextureSubImage2DEXT\"))\n\tgpCopyTextureSubImage3D = uintptr(getProcAddr(\"glCopyTextureSubImage3D\"))\n\tgpCopyTextureSubImage3DEXT = uintptr(getProcAddr(\"glCopyTextureSubImage3DEXT\"))\n\tgpCoverFillPathInstancedNV = uintptr(getProcAddr(\"glCoverFillPathInstancedNV\"))\n\tgpCoverFillPathNV = uintptr(getProcAddr(\"glCoverFillPathNV\"))\n\tgpCoverStrokePathInstancedNV = uintptr(getProcAddr(\"glCoverStrokePathInstancedNV\"))\n\tgpCoverStrokePathNV = uintptr(getProcAddr(\"glCoverStrokePathNV\"))\n\tgpCoverageModulationNV = uintptr(getProcAddr(\"glCoverageModulationNV\"))\n\tgpCoverageModulationTableNV = uintptr(getProcAddr(\"glCoverageModulationTableNV\"))\n\tgpCreateBuffers = uintptr(getProcAddr(\"glCreateBuffers\"))\n\tgpCreateCommandListsNV = uintptr(getProcAddr(\"glCreateCommandListsNV\"))\n\tgpCreateFramebuffers = uintptr(getProcAddr(\"glCreateFramebuffers\"))\n\tgpCreateMemoryObjectsEXT = uintptr(getProcAddr(\"glCreateMemoryObjectsEXT\"))\n\tgpCreatePerfQueryINTEL = uintptr(getProcAddr(\"glCreatePerfQueryINTEL\"))\n\tgpCreateProgram = uintptr(getProcAddr(\"glCreateProgram\"))\n\tif gpCreateProgram == 0 {\n\t\treturn errors.New(\"glCreateProgram\")\n\t}\n\tgpCreateProgramObjectARB = uintptr(getProcAddr(\"glCreateProgramObjectARB\"))\n\tgpCreateProgramPipelines = uintptr(getProcAddr(\"glCreateProgramPipelines\"))\n\tgpCreateQueries = uintptr(getProcAddr(\"glCreateQueries\"))\n\tgpCreateRenderbuffers = uintptr(getProcAddr(\"glCreateRenderbuffers\"))\n\tgpCreateSamplers = uintptr(getProcAddr(\"glCreateSamplers\"))\n\tgpCreateShader = uintptr(getProcAddr(\"glCreateShader\"))\n\tif gpCreateShader == 0 {\n\t\treturn errors.New(\"glCreateShader\")\n\t}\n\tgpCreateShaderObjectARB = uintptr(getProcAddr(\"glCreateShaderObjectARB\"))\n\tgpCreateShaderProgramEXT = uintptr(getProcAddr(\"glCreateShaderProgramEXT\"))\n\tgpCreateShaderProgramv = uintptr(getProcAddr(\"glCreateShaderProgramv\"))\n\tgpCreateShaderProgramvEXT = uintptr(getProcAddr(\"glCreateShaderProgramvEXT\"))\n\tgpCreateStatesNV = uintptr(getProcAddr(\"glCreateStatesNV\"))\n\tgpCreateSyncFromCLeventARB = uintptr(getProcAddr(\"glCreateSyncFromCLeventARB\"))\n\tgpCreateTextures = uintptr(getProcAddr(\"glCreateTextures\"))\n\tgpCreateTransformFeedbacks = uintptr(getProcAddr(\"glCreateTransformFeedbacks\"))\n\tgpCreateVertexArrays = uintptr(getProcAddr(\"glCreateVertexArrays\"))\n\tgpCullFace = uintptr(getProcAddr(\"glCullFace\"))\n\tif gpCullFace == 0 {\n\t\treturn errors.New(\"glCullFace\")\n\t}\n\tgpCullParameterdvEXT = uintptr(getProcAddr(\"glCullParameterdvEXT\"))\n\tgpCullParameterfvEXT = uintptr(getProcAddr(\"glCullParameterfvEXT\"))\n\tgpCurrentPaletteMatrixARB = uintptr(getProcAddr(\"glCurrentPaletteMatrixARB\"))\n\tgpDebugMessageCallback = uintptr(getProcAddr(\"glDebugMessageCallback\"))\n\tgpDebugMessageCallbackAMD = uintptr(getProcAddr(\"glDebugMessageCallbackAMD\"))\n\tgpDebugMessageCallbackARB = uintptr(getProcAddr(\"glDebugMessageCallbackARB\"))\n\tgpDebugMessageCallbackKHR = uintptr(getProcAddr(\"glDebugMessageCallbackKHR\"))\n\tgpDebugMessageControl = uintptr(getProcAddr(\"glDebugMessageControl\"))\n\tgpDebugMessageControlARB = uintptr(getProcAddr(\"glDebugMessageControlARB\"))\n\tgpDebugMessageControlKHR = uintptr(getProcAddr(\"glDebugMessageControlKHR\"))\n\tgpDebugMessageEnableAMD = uintptr(getProcAddr(\"glDebugMessageEnableAMD\"))\n\tgpDebugMessageInsert = uintptr(getProcAddr(\"glDebugMessageInsert\"))\n\tgpDebugMessageInsertAMD = uintptr(getProcAddr(\"glDebugMessageInsertAMD\"))\n\tgpDebugMessageInsertARB = uintptr(getProcAddr(\"glDebugMessageInsertARB\"))\n\tgpDebugMessageInsertKHR = uintptr(getProcAddr(\"glDebugMessageInsertKHR\"))\n\tgpDeformSGIX = uintptr(getProcAddr(\"glDeformSGIX\"))\n\tgpDeformationMap3dSGIX = uintptr(getProcAddr(\"glDeformationMap3dSGIX\"))\n\tgpDeformationMap3fSGIX = uintptr(getProcAddr(\"glDeformationMap3fSGIX\"))\n\tgpDeleteAsyncMarkersSGIX = uintptr(getProcAddr(\"glDeleteAsyncMarkersSGIX\"))\n\tgpDeleteBuffers = uintptr(getProcAddr(\"glDeleteBuffers\"))\n\tif gpDeleteBuffers == 0 {\n\t\treturn errors.New(\"glDeleteBuffers\")\n\t}\n\tgpDeleteBuffersARB = uintptr(getProcAddr(\"glDeleteBuffersARB\"))\n\tgpDeleteCommandListsNV = uintptr(getProcAddr(\"glDeleteCommandListsNV\"))\n\tgpDeleteFencesAPPLE = uintptr(getProcAddr(\"glDeleteFencesAPPLE\"))\n\tgpDeleteFencesNV = uintptr(getProcAddr(\"glDeleteFencesNV\"))\n\tgpDeleteFragmentShaderATI = uintptr(getProcAddr(\"glDeleteFragmentShaderATI\"))\n\tgpDeleteFramebuffers = uintptr(getProcAddr(\"glDeleteFramebuffers\"))\n\tgpDeleteFramebuffersEXT = uintptr(getProcAddr(\"glDeleteFramebuffersEXT\"))\n\tgpDeleteLists = uintptr(getProcAddr(\"glDeleteLists\"))\n\tif gpDeleteLists == 0 {\n\t\treturn errors.New(\"glDeleteLists\")\n\t}\n\tgpDeleteMemoryObjectsEXT = uintptr(getProcAddr(\"glDeleteMemoryObjectsEXT\"))\n\tgpDeleteNamedStringARB = uintptr(getProcAddr(\"glDeleteNamedStringARB\"))\n\tgpDeleteNamesAMD = uintptr(getProcAddr(\"glDeleteNamesAMD\"))\n\tgpDeleteObjectARB = uintptr(getProcAddr(\"glDeleteObjectARB\"))\n\tgpDeleteOcclusionQueriesNV = uintptr(getProcAddr(\"glDeleteOcclusionQueriesNV\"))\n\tgpDeletePathsNV = uintptr(getProcAddr(\"glDeletePathsNV\"))\n\tgpDeletePerfMonitorsAMD = uintptr(getProcAddr(\"glDeletePerfMonitorsAMD\"))\n\tgpDeletePerfQueryINTEL = uintptr(getProcAddr(\"glDeletePerfQueryINTEL\"))\n\tgpDeleteProgram = uintptr(getProcAddr(\"glDeleteProgram\"))\n\tif gpDeleteProgram == 0 {\n\t\treturn errors.New(\"glDeleteProgram\")\n\t}\n\tgpDeleteProgramPipelines = uintptr(getProcAddr(\"glDeleteProgramPipelines\"))\n\tgpDeleteProgramPipelinesEXT = uintptr(getProcAddr(\"glDeleteProgramPipelinesEXT\"))\n\tgpDeleteProgramsARB = uintptr(getProcAddr(\"glDeleteProgramsARB\"))\n\tgpDeleteProgramsNV = uintptr(getProcAddr(\"glDeleteProgramsNV\"))\n\tgpDeleteQueries = uintptr(getProcAddr(\"glDeleteQueries\"))\n\tif gpDeleteQueries == 0 {\n\t\treturn errors.New(\"glDeleteQueries\")\n\t}\n\tgpDeleteQueriesARB = uintptr(getProcAddr(\"glDeleteQueriesARB\"))\n\tgpDeleteQueryResourceTagNV = uintptr(getProcAddr(\"glDeleteQueryResourceTagNV\"))\n\tgpDeleteRenderbuffers = uintptr(getProcAddr(\"glDeleteRenderbuffers\"))\n\tgpDeleteRenderbuffersEXT = uintptr(getProcAddr(\"glDeleteRenderbuffersEXT\"))\n\tgpDeleteSamplers = uintptr(getProcAddr(\"glDeleteSamplers\"))\n\tgpDeleteSemaphoresEXT = uintptr(getProcAddr(\"glDeleteSemaphoresEXT\"))\n\tgpDeleteShader = uintptr(getProcAddr(\"glDeleteShader\"))\n\tif gpDeleteShader == 0 {\n\t\treturn errors.New(\"glDeleteShader\")\n\t}\n\tgpDeleteStatesNV = uintptr(getProcAddr(\"glDeleteStatesNV\"))\n\tgpDeleteSync = uintptr(getProcAddr(\"glDeleteSync\"))\n\tgpDeleteTextures = uintptr(getProcAddr(\"glDeleteTextures\"))\n\tif gpDeleteTextures == 0 {\n\t\treturn errors.New(\"glDeleteTextures\")\n\t}\n\tgpDeleteTexturesEXT = uintptr(getProcAddr(\"glDeleteTexturesEXT\"))\n\tgpDeleteTransformFeedbacks = uintptr(getProcAddr(\"glDeleteTransformFeedbacks\"))\n\tgpDeleteTransformFeedbacksNV = uintptr(getProcAddr(\"glDeleteTransformFeedbacksNV\"))\n\tgpDeleteVertexArrays = uintptr(getProcAddr(\"glDeleteVertexArrays\"))\n\tgpDeleteVertexArraysAPPLE = uintptr(getProcAddr(\"glDeleteVertexArraysAPPLE\"))\n\tgpDeleteVertexShaderEXT = uintptr(getProcAddr(\"glDeleteVertexShaderEXT\"))\n\tgpDepthBoundsEXT = uintptr(getProcAddr(\"glDepthBoundsEXT\"))\n\tgpDepthBoundsdNV = uintptr(getProcAddr(\"glDepthBoundsdNV\"))\n\tgpDepthFunc = uintptr(getProcAddr(\"glDepthFunc\"))\n\tif gpDepthFunc == 0 {\n\t\treturn errors.New(\"glDepthFunc\")\n\t}\n\tgpDepthMask = uintptr(getProcAddr(\"glDepthMask\"))\n\tif gpDepthMask == 0 {\n\t\treturn errors.New(\"glDepthMask\")\n\t}\n\tgpDepthRange = uintptr(getProcAddr(\"glDepthRange\"))\n\tif gpDepthRange == 0 {\n\t\treturn errors.New(\"glDepthRange\")\n\t}\n\tgpDepthRangeArrayv = uintptr(getProcAddr(\"glDepthRangeArrayv\"))\n\tgpDepthRangeIndexed = uintptr(getProcAddr(\"glDepthRangeIndexed\"))\n\tgpDepthRangedNV = uintptr(getProcAddr(\"glDepthRangedNV\"))\n\tgpDepthRangef = uintptr(getProcAddr(\"glDepthRangef\"))\n\tgpDepthRangefOES = uintptr(getProcAddr(\"glDepthRangefOES\"))\n\tgpDepthRangexOES = uintptr(getProcAddr(\"glDepthRangexOES\"))\n\tgpDetachObjectARB = uintptr(getProcAddr(\"glDetachObjectARB\"))\n\tgpDetachShader = uintptr(getProcAddr(\"glDetachShader\"))\n\tif gpDetachShader == 0 {\n\t\treturn errors.New(\"glDetachShader\")\n\t}\n\tgpDetailTexFuncSGIS = uintptr(getProcAddr(\"glDetailTexFuncSGIS\"))\n\tgpDisable = uintptr(getProcAddr(\"glDisable\"))\n\tif gpDisable == 0 {\n\t\treturn errors.New(\"glDisable\")\n\t}\n\tgpDisableClientState = uintptr(getProcAddr(\"glDisableClientState\"))\n\tif gpDisableClientState == 0 {\n\t\treturn errors.New(\"glDisableClientState\")\n\t}\n\tgpDisableClientStateIndexedEXT = uintptr(getProcAddr(\"glDisableClientStateIndexedEXT\"))\n\tgpDisableClientStateiEXT = uintptr(getProcAddr(\"glDisableClientStateiEXT\"))\n\tgpDisableIndexedEXT = uintptr(getProcAddr(\"glDisableIndexedEXT\"))\n\tgpDisableVariantClientStateEXT = uintptr(getProcAddr(\"glDisableVariantClientStateEXT\"))\n\tgpDisableVertexArrayAttrib = uintptr(getProcAddr(\"glDisableVertexArrayAttrib\"))\n\tgpDisableVertexArrayAttribEXT = uintptr(getProcAddr(\"glDisableVertexArrayAttribEXT\"))\n\tgpDisableVertexArrayEXT = uintptr(getProcAddr(\"glDisableVertexArrayEXT\"))\n\tgpDisableVertexAttribAPPLE = uintptr(getProcAddr(\"glDisableVertexAttribAPPLE\"))\n\tgpDisableVertexAttribArray = uintptr(getProcAddr(\"glDisableVertexAttribArray\"))\n\tif gpDisableVertexAttribArray == 0 {\n\t\treturn errors.New(\"glDisableVertexAttribArray\")\n\t}\n\tgpDisableVertexAttribArrayARB = uintptr(getProcAddr(\"glDisableVertexAttribArrayARB\"))\n\tgpDispatchCompute = uintptr(getProcAddr(\"glDispatchCompute\"))\n\tgpDispatchComputeGroupSizeARB = uintptr(getProcAddr(\"glDispatchComputeGroupSizeARB\"))\n\tgpDispatchComputeIndirect = uintptr(getProcAddr(\"glDispatchComputeIndirect\"))\n\tgpDrawArrays = uintptr(getProcAddr(\"glDrawArrays\"))\n\tif gpDrawArrays == 0 {\n\t\treturn errors.New(\"glDrawArrays\")\n\t}\n\tgpDrawArraysEXT = uintptr(getProcAddr(\"glDrawArraysEXT\"))\n\tgpDrawArraysIndirect = uintptr(getProcAddr(\"glDrawArraysIndirect\"))\n\tgpDrawArraysInstancedARB = uintptr(getProcAddr(\"glDrawArraysInstancedARB\"))\n\tgpDrawArraysInstancedBaseInstance = uintptr(getProcAddr(\"glDrawArraysInstancedBaseInstance\"))\n\tgpDrawArraysInstancedEXT = uintptr(getProcAddr(\"glDrawArraysInstancedEXT\"))\n\tgpDrawBuffer = uintptr(getProcAddr(\"glDrawBuffer\"))\n\tif gpDrawBuffer == 0 {\n\t\treturn errors.New(\"glDrawBuffer\")\n\t}\n\tgpDrawBuffers = uintptr(getProcAddr(\"glDrawBuffers\"))\n\tif gpDrawBuffers == 0 {\n\t\treturn errors.New(\"glDrawBuffers\")\n\t}\n\tgpDrawBuffersARB = uintptr(getProcAddr(\"glDrawBuffersARB\"))\n\tgpDrawBuffersATI = uintptr(getProcAddr(\"glDrawBuffersATI\"))\n\tgpDrawCommandsAddressNV = uintptr(getProcAddr(\"glDrawCommandsAddressNV\"))\n\tgpDrawCommandsNV = uintptr(getProcAddr(\"glDrawCommandsNV\"))\n\tgpDrawCommandsStatesAddressNV = uintptr(getProcAddr(\"glDrawCommandsStatesAddressNV\"))\n\tgpDrawCommandsStatesNV = uintptr(getProcAddr(\"glDrawCommandsStatesNV\"))\n\tgpDrawElementArrayAPPLE = uintptr(getProcAddr(\"glDrawElementArrayAPPLE\"))\n\tgpDrawElementArrayATI = uintptr(getProcAddr(\"glDrawElementArrayATI\"))\n\tgpDrawElements = uintptr(getProcAddr(\"glDrawElements\"))\n\tif gpDrawElements == 0 {\n\t\treturn errors.New(\"glDrawElements\")\n\t}\n\tgpDrawElementsBaseVertex = uintptr(getProcAddr(\"glDrawElementsBaseVertex\"))\n\tgpDrawElementsIndirect = uintptr(getProcAddr(\"glDrawElementsIndirect\"))\n\tgpDrawElementsInstancedARB = uintptr(getProcAddr(\"glDrawElementsInstancedARB\"))\n\tgpDrawElementsInstancedBaseInstance = uintptr(getProcAddr(\"glDrawElementsInstancedBaseInstance\"))\n\tgpDrawElementsInstancedBaseVertex = uintptr(getProcAddr(\"glDrawElementsInstancedBaseVertex\"))\n\tgpDrawElementsInstancedBaseVertexBaseInstance = uintptr(getProcAddr(\"glDrawElementsInstancedBaseVertexBaseInstance\"))\n\tgpDrawElementsInstancedEXT = uintptr(getProcAddr(\"glDrawElementsInstancedEXT\"))\n\tgpDrawMeshArraysSUN = uintptr(getProcAddr(\"glDrawMeshArraysSUN\"))\n\tgpDrawPixels = uintptr(getProcAddr(\"glDrawPixels\"))\n\tif gpDrawPixels == 0 {\n\t\treturn errors.New(\"glDrawPixels\")\n\t}\n\tgpDrawRangeElementArrayAPPLE = uintptr(getProcAddr(\"glDrawRangeElementArrayAPPLE\"))\n\tgpDrawRangeElementArrayATI = uintptr(getProcAddr(\"glDrawRangeElementArrayATI\"))\n\tgpDrawRangeElements = uintptr(getProcAddr(\"glDrawRangeElements\"))\n\tif gpDrawRangeElements == 0 {\n\t\treturn errors.New(\"glDrawRangeElements\")\n\t}\n\tgpDrawRangeElementsBaseVertex = uintptr(getProcAddr(\"glDrawRangeElementsBaseVertex\"))\n\tgpDrawRangeElementsEXT = uintptr(getProcAddr(\"glDrawRangeElementsEXT\"))\n\tgpDrawTextureNV = uintptr(getProcAddr(\"glDrawTextureNV\"))\n\tgpDrawTransformFeedback = uintptr(getProcAddr(\"glDrawTransformFeedback\"))\n\tgpDrawTransformFeedbackInstanced = uintptr(getProcAddr(\"glDrawTransformFeedbackInstanced\"))\n\tgpDrawTransformFeedbackNV = uintptr(getProcAddr(\"glDrawTransformFeedbackNV\"))\n\tgpDrawTransformFeedbackStream = uintptr(getProcAddr(\"glDrawTransformFeedbackStream\"))\n\tgpDrawTransformFeedbackStreamInstanced = uintptr(getProcAddr(\"glDrawTransformFeedbackStreamInstanced\"))\n\tgpDrawVkImageNV = uintptr(getProcAddr(\"glDrawVkImageNV\"))\n\tgpEGLImageTargetTexStorageEXT = uintptr(getProcAddr(\"glEGLImageTargetTexStorageEXT\"))\n\tgpEGLImageTargetTextureStorageEXT = uintptr(getProcAddr(\"glEGLImageTargetTextureStorageEXT\"))\n\tgpEdgeFlag = uintptr(getProcAddr(\"glEdgeFlag\"))\n\tif gpEdgeFlag == 0 {\n\t\treturn errors.New(\"glEdgeFlag\")\n\t}\n\tgpEdgeFlagFormatNV = uintptr(getProcAddr(\"glEdgeFlagFormatNV\"))\n\tgpEdgeFlagPointer = uintptr(getProcAddr(\"glEdgeFlagPointer\"))\n\tif gpEdgeFlagPointer == 0 {\n\t\treturn errors.New(\"glEdgeFlagPointer\")\n\t}\n\tgpEdgeFlagPointerEXT = uintptr(getProcAddr(\"glEdgeFlagPointerEXT\"))\n\tgpEdgeFlagPointerListIBM = uintptr(getProcAddr(\"glEdgeFlagPointerListIBM\"))\n\tgpEdgeFlagv = uintptr(getProcAddr(\"glEdgeFlagv\"))\n\tif gpEdgeFlagv == 0 {\n\t\treturn errors.New(\"glEdgeFlagv\")\n\t}\n\tgpElementPointerAPPLE = uintptr(getProcAddr(\"glElementPointerAPPLE\"))\n\tgpElementPointerATI = uintptr(getProcAddr(\"glElementPointerATI\"))\n\tgpEnable = uintptr(getProcAddr(\"glEnable\"))\n\tif gpEnable == 0 {\n\t\treturn errors.New(\"glEnable\")\n\t}\n\tgpEnableClientState = uintptr(getProcAddr(\"glEnableClientState\"))\n\tif gpEnableClientState == 0 {\n\t\treturn errors.New(\"glEnableClientState\")\n\t}\n\tgpEnableClientStateIndexedEXT = uintptr(getProcAddr(\"glEnableClientStateIndexedEXT\"))\n\tgpEnableClientStateiEXT = uintptr(getProcAddr(\"glEnableClientStateiEXT\"))\n\tgpEnableIndexedEXT = uintptr(getProcAddr(\"glEnableIndexedEXT\"))\n\tgpEnableVariantClientStateEXT = uintptr(getProcAddr(\"glEnableVariantClientStateEXT\"))\n\tgpEnableVertexArrayAttrib = uintptr(getProcAddr(\"glEnableVertexArrayAttrib\"))\n\tgpEnableVertexArrayAttribEXT = uintptr(getProcAddr(\"glEnableVertexArrayAttribEXT\"))\n\tgpEnableVertexArrayEXT = uintptr(getProcAddr(\"glEnableVertexArrayEXT\"))\n\tgpEnableVertexAttribAPPLE = uintptr(getProcAddr(\"glEnableVertexAttribAPPLE\"))\n\tgpEnableVertexAttribArray = uintptr(getProcAddr(\"glEnableVertexAttribArray\"))\n\tif gpEnableVertexAttribArray == 0 {\n\t\treturn errors.New(\"glEnableVertexAttribArray\")\n\t}\n\tgpEnableVertexAttribArrayARB = uintptr(getProcAddr(\"glEnableVertexAttribArrayARB\"))\n\tgpEnd = uintptr(getProcAddr(\"glEnd\"))\n\tif gpEnd == 0 {\n\t\treturn errors.New(\"glEnd\")\n\t}\n\tgpEndConditionalRenderNV = uintptr(getProcAddr(\"glEndConditionalRenderNV\"))\n\tgpEndConditionalRenderNVX = uintptr(getProcAddr(\"glEndConditionalRenderNVX\"))\n\tgpEndFragmentShaderATI = uintptr(getProcAddr(\"glEndFragmentShaderATI\"))\n\tgpEndList = uintptr(getProcAddr(\"glEndList\"))\n\tif gpEndList == 0 {\n\t\treturn errors.New(\"glEndList\")\n\t}\n\tgpEndOcclusionQueryNV = uintptr(getProcAddr(\"glEndOcclusionQueryNV\"))\n\tgpEndPerfMonitorAMD = uintptr(getProcAddr(\"glEndPerfMonitorAMD\"))\n\tgpEndPerfQueryINTEL = uintptr(getProcAddr(\"glEndPerfQueryINTEL\"))\n\tgpEndQuery = uintptr(getProcAddr(\"glEndQuery\"))\n\tif gpEndQuery == 0 {\n\t\treturn errors.New(\"glEndQuery\")\n\t}\n\tgpEndQueryARB = uintptr(getProcAddr(\"glEndQueryARB\"))\n\tgpEndQueryIndexed = uintptr(getProcAddr(\"glEndQueryIndexed\"))\n\tgpEndTransformFeedbackEXT = uintptr(getProcAddr(\"glEndTransformFeedbackEXT\"))\n\tgpEndTransformFeedbackNV = uintptr(getProcAddr(\"glEndTransformFeedbackNV\"))\n\tgpEndVertexShaderEXT = uintptr(getProcAddr(\"glEndVertexShaderEXT\"))\n\tgpEndVideoCaptureNV = uintptr(getProcAddr(\"glEndVideoCaptureNV\"))\n\tgpEvalCoord1d = uintptr(getProcAddr(\"glEvalCoord1d\"))\n\tif gpEvalCoord1d == 0 {\n\t\treturn errors.New(\"glEvalCoord1d\")\n\t}\n\tgpEvalCoord1dv = uintptr(getProcAddr(\"glEvalCoord1dv\"))\n\tif gpEvalCoord1dv == 0 {\n\t\treturn errors.New(\"glEvalCoord1dv\")\n\t}\n\tgpEvalCoord1f = uintptr(getProcAddr(\"glEvalCoord1f\"))\n\tif gpEvalCoord1f == 0 {\n\t\treturn errors.New(\"glEvalCoord1f\")\n\t}\n\tgpEvalCoord1fv = uintptr(getProcAddr(\"glEvalCoord1fv\"))\n\tif gpEvalCoord1fv == 0 {\n\t\treturn errors.New(\"glEvalCoord1fv\")\n\t}\n\tgpEvalCoord1xOES = uintptr(getProcAddr(\"glEvalCoord1xOES\"))\n\tgpEvalCoord1xvOES = uintptr(getProcAddr(\"glEvalCoord1xvOES\"))\n\tgpEvalCoord2d = uintptr(getProcAddr(\"glEvalCoord2d\"))\n\tif gpEvalCoord2d == 0 {\n\t\treturn errors.New(\"glEvalCoord2d\")\n\t}\n\tgpEvalCoord2dv = uintptr(getProcAddr(\"glEvalCoord2dv\"))\n\tif gpEvalCoord2dv == 0 {\n\t\treturn errors.New(\"glEvalCoord2dv\")\n\t}\n\tgpEvalCoord2f = uintptr(getProcAddr(\"glEvalCoord2f\"))\n\tif gpEvalCoord2f == 0 {\n\t\treturn errors.New(\"glEvalCoord2f\")\n\t}\n\tgpEvalCoord2fv = uintptr(getProcAddr(\"glEvalCoord2fv\"))\n\tif gpEvalCoord2fv == 0 {\n\t\treturn errors.New(\"glEvalCoord2fv\")\n\t}\n\tgpEvalCoord2xOES = uintptr(getProcAddr(\"glEvalCoord2xOES\"))\n\tgpEvalCoord2xvOES = uintptr(getProcAddr(\"glEvalCoord2xvOES\"))\n\tgpEvalMapsNV = uintptr(getProcAddr(\"glEvalMapsNV\"))\n\tgpEvalMesh1 = uintptr(getProcAddr(\"glEvalMesh1\"))\n\tif gpEvalMesh1 == 0 {\n\t\treturn errors.New(\"glEvalMesh1\")\n\t}\n\tgpEvalMesh2 = uintptr(getProcAddr(\"glEvalMesh2\"))\n\tif gpEvalMesh2 == 0 {\n\t\treturn errors.New(\"glEvalMesh2\")\n\t}\n\tgpEvalPoint1 = uintptr(getProcAddr(\"glEvalPoint1\"))\n\tif gpEvalPoint1 == 0 {\n\t\treturn errors.New(\"glEvalPoint1\")\n\t}\n\tgpEvalPoint2 = uintptr(getProcAddr(\"glEvalPoint2\"))\n\tif gpEvalPoint2 == 0 {\n\t\treturn errors.New(\"glEvalPoint2\")\n\t}\n\tgpEvaluateDepthValuesARB = uintptr(getProcAddr(\"glEvaluateDepthValuesARB\"))\n\tgpExecuteProgramNV = uintptr(getProcAddr(\"glExecuteProgramNV\"))\n\tgpExtractComponentEXT = uintptr(getProcAddr(\"glExtractComponentEXT\"))\n\tgpFeedbackBuffer = uintptr(getProcAddr(\"glFeedbackBuffer\"))\n\tif gpFeedbackBuffer == 0 {\n\t\treturn errors.New(\"glFeedbackBuffer\")\n\t}\n\tgpFeedbackBufferxOES = uintptr(getProcAddr(\"glFeedbackBufferxOES\"))\n\tgpFenceSync = uintptr(getProcAddr(\"glFenceSync\"))\n\tgpFinalCombinerInputNV = uintptr(getProcAddr(\"glFinalCombinerInputNV\"))\n\tgpFinish = uintptr(getProcAddr(\"glFinish\"))\n\tif gpFinish == 0 {\n\t\treturn errors.New(\"glFinish\")\n\t}\n\tgpFinishAsyncSGIX = uintptr(getProcAddr(\"glFinishAsyncSGIX\"))\n\tgpFinishFenceAPPLE = uintptr(getProcAddr(\"glFinishFenceAPPLE\"))\n\tgpFinishFenceNV = uintptr(getProcAddr(\"glFinishFenceNV\"))\n\tgpFinishObjectAPPLE = uintptr(getProcAddr(\"glFinishObjectAPPLE\"))\n\tgpFinishTextureSUNX = uintptr(getProcAddr(\"glFinishTextureSUNX\"))\n\tgpFlush = uintptr(getProcAddr(\"glFlush\"))\n\tif gpFlush == 0 {\n\t\treturn errors.New(\"glFlush\")\n\t}\n\tgpFlushMappedBufferRange = uintptr(getProcAddr(\"glFlushMappedBufferRange\"))\n\tgpFlushMappedBufferRangeAPPLE = uintptr(getProcAddr(\"glFlushMappedBufferRangeAPPLE\"))\n\tgpFlushMappedNamedBufferRange = uintptr(getProcAddr(\"glFlushMappedNamedBufferRange\"))\n\tgpFlushMappedNamedBufferRangeEXT = uintptr(getProcAddr(\"glFlushMappedNamedBufferRangeEXT\"))\n\tgpFlushPixelDataRangeNV = uintptr(getProcAddr(\"glFlushPixelDataRangeNV\"))\n\tgpFlushRasterSGIX = uintptr(getProcAddr(\"glFlushRasterSGIX\"))\n\tgpFlushStaticDataIBM = uintptr(getProcAddr(\"glFlushStaticDataIBM\"))\n\tgpFlushVertexArrayRangeAPPLE = uintptr(getProcAddr(\"glFlushVertexArrayRangeAPPLE\"))\n\tgpFlushVertexArrayRangeNV = uintptr(getProcAddr(\"glFlushVertexArrayRangeNV\"))\n\tgpFogCoordFormatNV = uintptr(getProcAddr(\"glFogCoordFormatNV\"))\n\tgpFogCoordPointer = uintptr(getProcAddr(\"glFogCoordPointer\"))\n\tif gpFogCoordPointer == 0 {\n\t\treturn errors.New(\"glFogCoordPointer\")\n\t}\n\tgpFogCoordPointerEXT = uintptr(getProcAddr(\"glFogCoordPointerEXT\"))\n\tgpFogCoordPointerListIBM = uintptr(getProcAddr(\"glFogCoordPointerListIBM\"))\n\tgpFogCoordd = uintptr(getProcAddr(\"glFogCoordd\"))\n\tif gpFogCoordd == 0 {\n\t\treturn errors.New(\"glFogCoordd\")\n\t}\n\tgpFogCoorddEXT = uintptr(getProcAddr(\"glFogCoorddEXT\"))\n\tgpFogCoorddv = uintptr(getProcAddr(\"glFogCoorddv\"))\n\tif gpFogCoorddv == 0 {\n\t\treturn errors.New(\"glFogCoorddv\")\n\t}\n\tgpFogCoorddvEXT = uintptr(getProcAddr(\"glFogCoorddvEXT\"))\n\tgpFogCoordf = uintptr(getProcAddr(\"glFogCoordf\"))\n\tif gpFogCoordf == 0 {\n\t\treturn errors.New(\"glFogCoordf\")\n\t}\n\tgpFogCoordfEXT = uintptr(getProcAddr(\"glFogCoordfEXT\"))\n\tgpFogCoordfv = uintptr(getProcAddr(\"glFogCoordfv\"))\n\tif gpFogCoordfv == 0 {\n\t\treturn errors.New(\"glFogCoordfv\")\n\t}\n\tgpFogCoordfvEXT = uintptr(getProcAddr(\"glFogCoordfvEXT\"))\n\tgpFogCoordhNV = uintptr(getProcAddr(\"glFogCoordhNV\"))\n\tgpFogCoordhvNV = uintptr(getProcAddr(\"glFogCoordhvNV\"))\n\tgpFogFuncSGIS = uintptr(getProcAddr(\"glFogFuncSGIS\"))\n\tgpFogf = uintptr(getProcAddr(\"glFogf\"))\n\tif gpFogf == 0 {\n\t\treturn errors.New(\"glFogf\")\n\t}\n\tgpFogfv = uintptr(getProcAddr(\"glFogfv\"))\n\tif gpFogfv == 0 {\n\t\treturn errors.New(\"glFogfv\")\n\t}\n\tgpFogi = uintptr(getProcAddr(\"glFogi\"))\n\tif gpFogi == 0 {\n\t\treturn errors.New(\"glFogi\")\n\t}\n\tgpFogiv = uintptr(getProcAddr(\"glFogiv\"))\n\tif gpFogiv == 0 {\n\t\treturn errors.New(\"glFogiv\")\n\t}\n\tgpFogxOES = uintptr(getProcAddr(\"glFogxOES\"))\n\tgpFogxvOES = uintptr(getProcAddr(\"glFogxvOES\"))\n\tgpFragmentColorMaterialSGIX = uintptr(getProcAddr(\"glFragmentColorMaterialSGIX\"))\n\tgpFragmentCoverageColorNV = uintptr(getProcAddr(\"glFragmentCoverageColorNV\"))\n\tgpFragmentLightModelfSGIX = uintptr(getProcAddr(\"glFragmentLightModelfSGIX\"))\n\tgpFragmentLightModelfvSGIX = uintptr(getProcAddr(\"glFragmentLightModelfvSGIX\"))\n\tgpFragmentLightModeliSGIX = uintptr(getProcAddr(\"glFragmentLightModeliSGIX\"))\n\tgpFragmentLightModelivSGIX = uintptr(getProcAddr(\"glFragmentLightModelivSGIX\"))\n\tgpFragmentLightfSGIX = uintptr(getProcAddr(\"glFragmentLightfSGIX\"))\n\tgpFragmentLightfvSGIX = uintptr(getProcAddr(\"glFragmentLightfvSGIX\"))\n\tgpFragmentLightiSGIX = uintptr(getProcAddr(\"glFragmentLightiSGIX\"))\n\tgpFragmentLightivSGIX = uintptr(getProcAddr(\"glFragmentLightivSGIX\"))\n\tgpFragmentMaterialfSGIX = uintptr(getProcAddr(\"glFragmentMaterialfSGIX\"))\n\tgpFragmentMaterialfvSGIX = uintptr(getProcAddr(\"glFragmentMaterialfvSGIX\"))\n\tgpFragmentMaterialiSGIX = uintptr(getProcAddr(\"glFragmentMaterialiSGIX\"))\n\tgpFragmentMaterialivSGIX = uintptr(getProcAddr(\"glFragmentMaterialivSGIX\"))\n\tgpFrameTerminatorGREMEDY = uintptr(getProcAddr(\"glFrameTerminatorGREMEDY\"))\n\tgpFrameZoomSGIX = uintptr(getProcAddr(\"glFrameZoomSGIX\"))\n\tgpFramebufferDrawBufferEXT = uintptr(getProcAddr(\"glFramebufferDrawBufferEXT\"))\n\tgpFramebufferDrawBuffersEXT = uintptr(getProcAddr(\"glFramebufferDrawBuffersEXT\"))\n\tgpFramebufferFetchBarrierEXT = uintptr(getProcAddr(\"glFramebufferFetchBarrierEXT\"))\n\tgpFramebufferParameteri = uintptr(getProcAddr(\"glFramebufferParameteri\"))\n\tgpFramebufferReadBufferEXT = uintptr(getProcAddr(\"glFramebufferReadBufferEXT\"))\n\tgpFramebufferRenderbuffer = uintptr(getProcAddr(\"glFramebufferRenderbuffer\"))\n\tgpFramebufferRenderbufferEXT = uintptr(getProcAddr(\"glFramebufferRenderbufferEXT\"))\n\tgpFramebufferSampleLocationsfvARB = uintptr(getProcAddr(\"glFramebufferSampleLocationsfvARB\"))\n\tgpFramebufferSampleLocationsfvNV = uintptr(getProcAddr(\"glFramebufferSampleLocationsfvNV\"))\n\tgpFramebufferSamplePositionsfvAMD = uintptr(getProcAddr(\"glFramebufferSamplePositionsfvAMD\"))\n\tgpFramebufferTexture1D = uintptr(getProcAddr(\"glFramebufferTexture1D\"))\n\tgpFramebufferTexture1DEXT = uintptr(getProcAddr(\"glFramebufferTexture1DEXT\"))\n\tgpFramebufferTexture2D = uintptr(getProcAddr(\"glFramebufferTexture2D\"))\n\tgpFramebufferTexture2DEXT = uintptr(getProcAddr(\"glFramebufferTexture2DEXT\"))\n\tgpFramebufferTexture3D = uintptr(getProcAddr(\"glFramebufferTexture3D\"))\n\tgpFramebufferTexture3DEXT = uintptr(getProcAddr(\"glFramebufferTexture3DEXT\"))\n\tgpFramebufferTextureARB = uintptr(getProcAddr(\"glFramebufferTextureARB\"))\n\tgpFramebufferTextureEXT = uintptr(getProcAddr(\"glFramebufferTextureEXT\"))\n\tgpFramebufferTextureFaceARB = uintptr(getProcAddr(\"glFramebufferTextureFaceARB\"))\n\tgpFramebufferTextureFaceEXT = uintptr(getProcAddr(\"glFramebufferTextureFaceEXT\"))\n\tgpFramebufferTextureLayer = uintptr(getProcAddr(\"glFramebufferTextureLayer\"))\n\tgpFramebufferTextureLayerARB = uintptr(getProcAddr(\"glFramebufferTextureLayerARB\"))\n\tgpFramebufferTextureLayerEXT = uintptr(getProcAddr(\"glFramebufferTextureLayerEXT\"))\n\tgpFramebufferTextureMultiviewOVR = uintptr(getProcAddr(\"glFramebufferTextureMultiviewOVR\"))\n\tgpFreeObjectBufferATI = uintptr(getProcAddr(\"glFreeObjectBufferATI\"))\n\tgpFrontFace = uintptr(getProcAddr(\"glFrontFace\"))\n\tif gpFrontFace == 0 {\n\t\treturn errors.New(\"glFrontFace\")\n\t}\n\tgpFrustum = uintptr(getProcAddr(\"glFrustum\"))\n\tif gpFrustum == 0 {\n\t\treturn errors.New(\"glFrustum\")\n\t}\n\tgpFrustumfOES = uintptr(getProcAddr(\"glFrustumfOES\"))\n\tgpFrustumxOES = uintptr(getProcAddr(\"glFrustumxOES\"))\n\tgpGenAsyncMarkersSGIX = uintptr(getProcAddr(\"glGenAsyncMarkersSGIX\"))\n\tgpGenBuffers = uintptr(getProcAddr(\"glGenBuffers\"))\n\tif gpGenBuffers == 0 {\n\t\treturn errors.New(\"glGenBuffers\")\n\t}\n\tgpGenBuffersARB = uintptr(getProcAddr(\"glGenBuffersARB\"))\n\tgpGenFencesAPPLE = uintptr(getProcAddr(\"glGenFencesAPPLE\"))\n\tgpGenFencesNV = uintptr(getProcAddr(\"glGenFencesNV\"))\n\tgpGenFragmentShadersATI = uintptr(getProcAddr(\"glGenFragmentShadersATI\"))\n\tgpGenFramebuffers = uintptr(getProcAddr(\"glGenFramebuffers\"))\n\tgpGenFramebuffersEXT = uintptr(getProcAddr(\"glGenFramebuffersEXT\"))\n\tgpGenLists = uintptr(getProcAddr(\"glGenLists\"))\n\tif gpGenLists == 0 {\n\t\treturn errors.New(\"glGenLists\")\n\t}\n\tgpGenNamesAMD = uintptr(getProcAddr(\"glGenNamesAMD\"))\n\tgpGenOcclusionQueriesNV = uintptr(getProcAddr(\"glGenOcclusionQueriesNV\"))\n\tgpGenPathsNV = uintptr(getProcAddr(\"glGenPathsNV\"))\n\tgpGenPerfMonitorsAMD = uintptr(getProcAddr(\"glGenPerfMonitorsAMD\"))\n\tgpGenProgramPipelines = uintptr(getProcAddr(\"glGenProgramPipelines\"))\n\tgpGenProgramPipelinesEXT = uintptr(getProcAddr(\"glGenProgramPipelinesEXT\"))\n\tgpGenProgramsARB = uintptr(getProcAddr(\"glGenProgramsARB\"))\n\tgpGenProgramsNV = uintptr(getProcAddr(\"glGenProgramsNV\"))\n\tgpGenQueries = uintptr(getProcAddr(\"glGenQueries\"))\n\tif gpGenQueries == 0 {\n\t\treturn errors.New(\"glGenQueries\")\n\t}\n\tgpGenQueriesARB = uintptr(getProcAddr(\"glGenQueriesARB\"))\n\tgpGenQueryResourceTagNV = uintptr(getProcAddr(\"glGenQueryResourceTagNV\"))\n\tgpGenRenderbuffers = uintptr(getProcAddr(\"glGenRenderbuffers\"))\n\tgpGenRenderbuffersEXT = uintptr(getProcAddr(\"glGenRenderbuffersEXT\"))\n\tgpGenSamplers = uintptr(getProcAddr(\"glGenSamplers\"))\n\tgpGenSemaphoresEXT = uintptr(getProcAddr(\"glGenSemaphoresEXT\"))\n\tgpGenSymbolsEXT = uintptr(getProcAddr(\"glGenSymbolsEXT\"))\n\tgpGenTextures = uintptr(getProcAddr(\"glGenTextures\"))\n\tif gpGenTextures == 0 {\n\t\treturn errors.New(\"glGenTextures\")\n\t}\n\tgpGenTexturesEXT = uintptr(getProcAddr(\"glGenTexturesEXT\"))\n\tgpGenTransformFeedbacks = uintptr(getProcAddr(\"glGenTransformFeedbacks\"))\n\tgpGenTransformFeedbacksNV = uintptr(getProcAddr(\"glGenTransformFeedbacksNV\"))\n\tgpGenVertexArrays = uintptr(getProcAddr(\"glGenVertexArrays\"))\n\tgpGenVertexArraysAPPLE = uintptr(getProcAddr(\"glGenVertexArraysAPPLE\"))\n\tgpGenVertexShadersEXT = uintptr(getProcAddr(\"glGenVertexShadersEXT\"))\n\tgpGenerateMipmap = uintptr(getProcAddr(\"glGenerateMipmap\"))\n\tgpGenerateMipmapEXT = uintptr(getProcAddr(\"glGenerateMipmapEXT\"))\n\tgpGenerateMultiTexMipmapEXT = uintptr(getProcAddr(\"glGenerateMultiTexMipmapEXT\"))\n\tgpGenerateTextureMipmap = uintptr(getProcAddr(\"glGenerateTextureMipmap\"))\n\tgpGenerateTextureMipmapEXT = uintptr(getProcAddr(\"glGenerateTextureMipmapEXT\"))\n\tgpGetActiveAtomicCounterBufferiv = uintptr(getProcAddr(\"glGetActiveAtomicCounterBufferiv\"))\n\tgpGetActiveAttrib = uintptr(getProcAddr(\"glGetActiveAttrib\"))\n\tif gpGetActiveAttrib == 0 {\n\t\treturn errors.New(\"glGetActiveAttrib\")\n\t}\n\tgpGetActiveAttribARB = uintptr(getProcAddr(\"glGetActiveAttribARB\"))\n\tgpGetActiveSubroutineName = uintptr(getProcAddr(\"glGetActiveSubroutineName\"))\n\tgpGetActiveSubroutineUniformName = uintptr(getProcAddr(\"glGetActiveSubroutineUniformName\"))\n\tgpGetActiveSubroutineUniformiv = uintptr(getProcAddr(\"glGetActiveSubroutineUniformiv\"))\n\tgpGetActiveUniform = uintptr(getProcAddr(\"glGetActiveUniform\"))\n\tif gpGetActiveUniform == 0 {\n\t\treturn errors.New(\"glGetActiveUniform\")\n\t}\n\tgpGetActiveUniformARB = uintptr(getProcAddr(\"glGetActiveUniformARB\"))\n\tgpGetActiveUniformBlockName = uintptr(getProcAddr(\"glGetActiveUniformBlockName\"))\n\tgpGetActiveUniformBlockiv = uintptr(getProcAddr(\"glGetActiveUniformBlockiv\"))\n\tgpGetActiveUniformName = uintptr(getProcAddr(\"glGetActiveUniformName\"))\n\tgpGetActiveUniformsiv = uintptr(getProcAddr(\"glGetActiveUniformsiv\"))\n\tgpGetActiveVaryingNV = uintptr(getProcAddr(\"glGetActiveVaryingNV\"))\n\tgpGetArrayObjectfvATI = uintptr(getProcAddr(\"glGetArrayObjectfvATI\"))\n\tgpGetArrayObjectivATI = uintptr(getProcAddr(\"glGetArrayObjectivATI\"))\n\tgpGetAttachedObjectsARB = uintptr(getProcAddr(\"glGetAttachedObjectsARB\"))\n\tgpGetAttachedShaders = uintptr(getProcAddr(\"glGetAttachedShaders\"))\n\tif gpGetAttachedShaders == 0 {\n\t\treturn errors.New(\"glGetAttachedShaders\")\n\t}\n\tgpGetAttribLocation = uintptr(getProcAddr(\"glGetAttribLocation\"))\n\tif gpGetAttribLocation == 0 {\n\t\treturn errors.New(\"glGetAttribLocation\")\n\t}\n\tgpGetAttribLocationARB = uintptr(getProcAddr(\"glGetAttribLocationARB\"))\n\tgpGetBooleanIndexedvEXT = uintptr(getProcAddr(\"glGetBooleanIndexedvEXT\"))\n\tgpGetBooleanv = uintptr(getProcAddr(\"glGetBooleanv\"))\n\tif gpGetBooleanv == 0 {\n\t\treturn errors.New(\"glGetBooleanv\")\n\t}\n\tgpGetBufferParameteriv = uintptr(getProcAddr(\"glGetBufferParameteriv\"))\n\tif gpGetBufferParameteriv == 0 {\n\t\treturn errors.New(\"glGetBufferParameteriv\")\n\t}\n\tgpGetBufferParameterivARB = uintptr(getProcAddr(\"glGetBufferParameterivARB\"))\n\tgpGetBufferParameterui64vNV = uintptr(getProcAddr(\"glGetBufferParameterui64vNV\"))\n\tgpGetBufferPointerv = uintptr(getProcAddr(\"glGetBufferPointerv\"))\n\tif gpGetBufferPointerv == 0 {\n\t\treturn errors.New(\"glGetBufferPointerv\")\n\t}\n\tgpGetBufferPointervARB = uintptr(getProcAddr(\"glGetBufferPointervARB\"))\n\tgpGetBufferSubData = uintptr(getProcAddr(\"glGetBufferSubData\"))\n\tif gpGetBufferSubData == 0 {\n\t\treturn errors.New(\"glGetBufferSubData\")\n\t}\n\tgpGetBufferSubDataARB = uintptr(getProcAddr(\"glGetBufferSubDataARB\"))\n\tgpGetClipPlane = uintptr(getProcAddr(\"glGetClipPlane\"))\n\tif gpGetClipPlane == 0 {\n\t\treturn errors.New(\"glGetClipPlane\")\n\t}\n\tgpGetClipPlanefOES = uintptr(getProcAddr(\"glGetClipPlanefOES\"))\n\tgpGetClipPlanexOES = uintptr(getProcAddr(\"glGetClipPlanexOES\"))\n\tgpGetColorTableEXT = uintptr(getProcAddr(\"glGetColorTableEXT\"))\n\tgpGetColorTableParameterfvEXT = uintptr(getProcAddr(\"glGetColorTableParameterfvEXT\"))\n\tgpGetColorTableParameterfvSGI = uintptr(getProcAddr(\"glGetColorTableParameterfvSGI\"))\n\tgpGetColorTableParameterivEXT = uintptr(getProcAddr(\"glGetColorTableParameterivEXT\"))\n\tgpGetColorTableParameterivSGI = uintptr(getProcAddr(\"glGetColorTableParameterivSGI\"))\n\tgpGetColorTableSGI = uintptr(getProcAddr(\"glGetColorTableSGI\"))\n\tgpGetCombinerInputParameterfvNV = uintptr(getProcAddr(\"glGetCombinerInputParameterfvNV\"))\n\tgpGetCombinerInputParameterivNV = uintptr(getProcAddr(\"glGetCombinerInputParameterivNV\"))\n\tgpGetCombinerOutputParameterfvNV = uintptr(getProcAddr(\"glGetCombinerOutputParameterfvNV\"))\n\tgpGetCombinerOutputParameterivNV = uintptr(getProcAddr(\"glGetCombinerOutputParameterivNV\"))\n\tgpGetCombinerStageParameterfvNV = uintptr(getProcAddr(\"glGetCombinerStageParameterfvNV\"))\n\tgpGetCommandHeaderNV = uintptr(getProcAddr(\"glGetCommandHeaderNV\"))\n\tgpGetCompressedMultiTexImageEXT = uintptr(getProcAddr(\"glGetCompressedMultiTexImageEXT\"))\n\tgpGetCompressedTexImage = uintptr(getProcAddr(\"glGetCompressedTexImage\"))\n\tif gpGetCompressedTexImage == 0 {\n\t\treturn errors.New(\"glGetCompressedTexImage\")\n\t}\n\tgpGetCompressedTexImageARB = uintptr(getProcAddr(\"glGetCompressedTexImageARB\"))\n\tgpGetCompressedTextureImage = uintptr(getProcAddr(\"glGetCompressedTextureImage\"))\n\tgpGetCompressedTextureImageEXT = uintptr(getProcAddr(\"glGetCompressedTextureImageEXT\"))\n\tgpGetCompressedTextureSubImage = uintptr(getProcAddr(\"glGetCompressedTextureSubImage\"))\n\tgpGetConvolutionFilterEXT = uintptr(getProcAddr(\"glGetConvolutionFilterEXT\"))\n\tgpGetConvolutionParameterfvEXT = uintptr(getProcAddr(\"glGetConvolutionParameterfvEXT\"))\n\tgpGetConvolutionParameterivEXT = uintptr(getProcAddr(\"glGetConvolutionParameterivEXT\"))\n\tgpGetConvolutionParameterxvOES = uintptr(getProcAddr(\"glGetConvolutionParameterxvOES\"))\n\tgpGetCoverageModulationTableNV = uintptr(getProcAddr(\"glGetCoverageModulationTableNV\"))\n\tgpGetDebugMessageLog = uintptr(getProcAddr(\"glGetDebugMessageLog\"))\n\tgpGetDebugMessageLogAMD = uintptr(getProcAddr(\"glGetDebugMessageLogAMD\"))\n\tgpGetDebugMessageLogARB = uintptr(getProcAddr(\"glGetDebugMessageLogARB\"))\n\tgpGetDebugMessageLogKHR = uintptr(getProcAddr(\"glGetDebugMessageLogKHR\"))\n\tgpGetDetailTexFuncSGIS = uintptr(getProcAddr(\"glGetDetailTexFuncSGIS\"))\n\tgpGetDoubleIndexedvEXT = uintptr(getProcAddr(\"glGetDoubleIndexedvEXT\"))\n\tgpGetDoublei_v = uintptr(getProcAddr(\"glGetDoublei_v\"))\n\tgpGetDoublei_vEXT = uintptr(getProcAddr(\"glGetDoublei_vEXT\"))\n\tgpGetDoublev = uintptr(getProcAddr(\"glGetDoublev\"))\n\tif gpGetDoublev == 0 {\n\t\treturn errors.New(\"glGetDoublev\")\n\t}\n\tgpGetError = uintptr(getProcAddr(\"glGetError\"))\n\tif gpGetError == 0 {\n\t\treturn errors.New(\"glGetError\")\n\t}\n\tgpGetFenceivNV = uintptr(getProcAddr(\"glGetFenceivNV\"))\n\tgpGetFinalCombinerInputParameterfvNV = uintptr(getProcAddr(\"glGetFinalCombinerInputParameterfvNV\"))\n\tgpGetFinalCombinerInputParameterivNV = uintptr(getProcAddr(\"glGetFinalCombinerInputParameterivNV\"))\n\tgpGetFirstPerfQueryIdINTEL = uintptr(getProcAddr(\"glGetFirstPerfQueryIdINTEL\"))\n\tgpGetFixedvOES = uintptr(getProcAddr(\"glGetFixedvOES\"))\n\tgpGetFloatIndexedvEXT = uintptr(getProcAddr(\"glGetFloatIndexedvEXT\"))\n\tgpGetFloati_v = uintptr(getProcAddr(\"glGetFloati_v\"))\n\tgpGetFloati_vEXT = uintptr(getProcAddr(\"glGetFloati_vEXT\"))\n\tgpGetFloatv = uintptr(getProcAddr(\"glGetFloatv\"))\n\tif gpGetFloatv == 0 {\n\t\treturn errors.New(\"glGetFloatv\")\n\t}\n\tgpGetFogFuncSGIS = uintptr(getProcAddr(\"glGetFogFuncSGIS\"))\n\tgpGetFragDataIndex = uintptr(getProcAddr(\"glGetFragDataIndex\"))\n\tgpGetFragDataLocationEXT = uintptr(getProcAddr(\"glGetFragDataLocationEXT\"))\n\tgpGetFragmentLightfvSGIX = uintptr(getProcAddr(\"glGetFragmentLightfvSGIX\"))\n\tgpGetFragmentLightivSGIX = uintptr(getProcAddr(\"glGetFragmentLightivSGIX\"))\n\tgpGetFragmentMaterialfvSGIX = uintptr(getProcAddr(\"glGetFragmentMaterialfvSGIX\"))\n\tgpGetFragmentMaterialivSGIX = uintptr(getProcAddr(\"glGetFragmentMaterialivSGIX\"))\n\tgpGetFramebufferAttachmentParameteriv = uintptr(getProcAddr(\"glGetFramebufferAttachmentParameteriv\"))\n\tgpGetFramebufferAttachmentParameterivEXT = uintptr(getProcAddr(\"glGetFramebufferAttachmentParameterivEXT\"))\n\tgpGetFramebufferParameterfvAMD = uintptr(getProcAddr(\"glGetFramebufferParameterfvAMD\"))\n\tgpGetFramebufferParameteriv = uintptr(getProcAddr(\"glGetFramebufferParameteriv\"))\n\tgpGetFramebufferParameterivEXT = uintptr(getProcAddr(\"glGetFramebufferParameterivEXT\"))\n\tgpGetGraphicsResetStatus = uintptr(getProcAddr(\"glGetGraphicsResetStatus\"))\n\tgpGetGraphicsResetStatusARB = uintptr(getProcAddr(\"glGetGraphicsResetStatusARB\"))\n\tgpGetGraphicsResetStatusKHR = uintptr(getProcAddr(\"glGetGraphicsResetStatusKHR\"))\n\tgpGetHandleARB = uintptr(getProcAddr(\"glGetHandleARB\"))\n\tgpGetHistogramEXT = uintptr(getProcAddr(\"glGetHistogramEXT\"))\n\tgpGetHistogramParameterfvEXT = uintptr(getProcAddr(\"glGetHistogramParameterfvEXT\"))\n\tgpGetHistogramParameterivEXT = uintptr(getProcAddr(\"glGetHistogramParameterivEXT\"))\n\tgpGetHistogramParameterxvOES = uintptr(getProcAddr(\"glGetHistogramParameterxvOES\"))\n\tgpGetImageHandleARB = uintptr(getProcAddr(\"glGetImageHandleARB\"))\n\tgpGetImageHandleNV = uintptr(getProcAddr(\"glGetImageHandleNV\"))\n\tgpGetImageTransformParameterfvHP = uintptr(getProcAddr(\"glGetImageTransformParameterfvHP\"))\n\tgpGetImageTransformParameterivHP = uintptr(getProcAddr(\"glGetImageTransformParameterivHP\"))\n\tgpGetInfoLogARB = uintptr(getProcAddr(\"glGetInfoLogARB\"))\n\tgpGetInstrumentsSGIX = uintptr(getProcAddr(\"glGetInstrumentsSGIX\"))\n\tgpGetInteger64v = uintptr(getProcAddr(\"glGetInteger64v\"))\n\tgpGetIntegerIndexedvEXT = uintptr(getProcAddr(\"glGetIntegerIndexedvEXT\"))\n\tgpGetIntegeri_v = uintptr(getProcAddr(\"glGetIntegeri_v\"))\n\tgpGetIntegerui64i_vNV = uintptr(getProcAddr(\"glGetIntegerui64i_vNV\"))\n\tgpGetIntegerui64vNV = uintptr(getProcAddr(\"glGetIntegerui64vNV\"))\n\tgpGetIntegerv = uintptr(getProcAddr(\"glGetIntegerv\"))\n\tif gpGetIntegerv == 0 {\n\t\treturn errors.New(\"glGetIntegerv\")\n\t}\n\tgpGetInternalformatSampleivNV = uintptr(getProcAddr(\"glGetInternalformatSampleivNV\"))\n\tgpGetInternalformati64v = uintptr(getProcAddr(\"glGetInternalformati64v\"))\n\tgpGetInternalformativ = uintptr(getProcAddr(\"glGetInternalformativ\"))\n\tgpGetInvariantBooleanvEXT = uintptr(getProcAddr(\"glGetInvariantBooleanvEXT\"))\n\tgpGetInvariantFloatvEXT = uintptr(getProcAddr(\"glGetInvariantFloatvEXT\"))\n\tgpGetInvariantIntegervEXT = uintptr(getProcAddr(\"glGetInvariantIntegervEXT\"))\n\tgpGetLightfv = uintptr(getProcAddr(\"glGetLightfv\"))\n\tif gpGetLightfv == 0 {\n\t\treturn errors.New(\"glGetLightfv\")\n\t}\n\tgpGetLightiv = uintptr(getProcAddr(\"glGetLightiv\"))\n\tif gpGetLightiv == 0 {\n\t\treturn errors.New(\"glGetLightiv\")\n\t}\n\tgpGetLightxOES = uintptr(getProcAddr(\"glGetLightxOES\"))\n\tgpGetLightxvOES = uintptr(getProcAddr(\"glGetLightxvOES\"))\n\tgpGetListParameterfvSGIX = uintptr(getProcAddr(\"glGetListParameterfvSGIX\"))\n\tgpGetListParameterivSGIX = uintptr(getProcAddr(\"glGetListParameterivSGIX\"))\n\tgpGetLocalConstantBooleanvEXT = uintptr(getProcAddr(\"glGetLocalConstantBooleanvEXT\"))\n\tgpGetLocalConstantFloatvEXT = uintptr(getProcAddr(\"glGetLocalConstantFloatvEXT\"))\n\tgpGetLocalConstantIntegervEXT = uintptr(getProcAddr(\"glGetLocalConstantIntegervEXT\"))\n\tgpGetMapAttribParameterfvNV = uintptr(getProcAddr(\"glGetMapAttribParameterfvNV\"))\n\tgpGetMapAttribParameterivNV = uintptr(getProcAddr(\"glGetMapAttribParameterivNV\"))\n\tgpGetMapControlPointsNV = uintptr(getProcAddr(\"glGetMapControlPointsNV\"))\n\tgpGetMapParameterfvNV = uintptr(getProcAddr(\"glGetMapParameterfvNV\"))\n\tgpGetMapParameterivNV = uintptr(getProcAddr(\"glGetMapParameterivNV\"))\n\tgpGetMapdv = uintptr(getProcAddr(\"glGetMapdv\"))\n\tif gpGetMapdv == 0 {\n\t\treturn errors.New(\"glGetMapdv\")\n\t}\n\tgpGetMapfv = uintptr(getProcAddr(\"glGetMapfv\"))\n\tif gpGetMapfv == 0 {\n\t\treturn errors.New(\"glGetMapfv\")\n\t}\n\tgpGetMapiv = uintptr(getProcAddr(\"glGetMapiv\"))\n\tif gpGetMapiv == 0 {\n\t\treturn errors.New(\"glGetMapiv\")\n\t}\n\tgpGetMapxvOES = uintptr(getProcAddr(\"glGetMapxvOES\"))\n\tgpGetMaterialfv = uintptr(getProcAddr(\"glGetMaterialfv\"))\n\tif gpGetMaterialfv == 0 {\n\t\treturn errors.New(\"glGetMaterialfv\")\n\t}\n\tgpGetMaterialiv = uintptr(getProcAddr(\"glGetMaterialiv\"))\n\tif gpGetMaterialiv == 0 {\n\t\treturn errors.New(\"glGetMaterialiv\")\n\t}\n\tgpGetMaterialxOES = uintptr(getProcAddr(\"glGetMaterialxOES\"))\n\tgpGetMaterialxvOES = uintptr(getProcAddr(\"glGetMaterialxvOES\"))\n\tgpGetMemoryObjectParameterivEXT = uintptr(getProcAddr(\"glGetMemoryObjectParameterivEXT\"))\n\tgpGetMinmaxEXT = uintptr(getProcAddr(\"glGetMinmaxEXT\"))\n\tgpGetMinmaxParameterfvEXT = uintptr(getProcAddr(\"glGetMinmaxParameterfvEXT\"))\n\tgpGetMinmaxParameterivEXT = uintptr(getProcAddr(\"glGetMinmaxParameterivEXT\"))\n\tgpGetMultiTexEnvfvEXT = uintptr(getProcAddr(\"glGetMultiTexEnvfvEXT\"))\n\tgpGetMultiTexEnvivEXT = uintptr(getProcAddr(\"glGetMultiTexEnvivEXT\"))\n\tgpGetMultiTexGendvEXT = uintptr(getProcAddr(\"glGetMultiTexGendvEXT\"))\n\tgpGetMultiTexGenfvEXT = uintptr(getProcAddr(\"glGetMultiTexGenfvEXT\"))\n\tgpGetMultiTexGenivEXT = uintptr(getProcAddr(\"glGetMultiTexGenivEXT\"))\n\tgpGetMultiTexImageEXT = uintptr(getProcAddr(\"glGetMultiTexImageEXT\"))\n\tgpGetMultiTexLevelParameterfvEXT = uintptr(getProcAddr(\"glGetMultiTexLevelParameterfvEXT\"))\n\tgpGetMultiTexLevelParameterivEXT = uintptr(getProcAddr(\"glGetMultiTexLevelParameterivEXT\"))\n\tgpGetMultiTexParameterIivEXT = uintptr(getProcAddr(\"glGetMultiTexParameterIivEXT\"))\n\tgpGetMultiTexParameterIuivEXT = uintptr(getProcAddr(\"glGetMultiTexParameterIuivEXT\"))\n\tgpGetMultiTexParameterfvEXT = uintptr(getProcAddr(\"glGetMultiTexParameterfvEXT\"))\n\tgpGetMultiTexParameterivEXT = uintptr(getProcAddr(\"glGetMultiTexParameterivEXT\"))\n\tgpGetMultisamplefv = uintptr(getProcAddr(\"glGetMultisamplefv\"))\n\tgpGetMultisamplefvNV = uintptr(getProcAddr(\"glGetMultisamplefvNV\"))\n\tgpGetNamedBufferParameteri64v = uintptr(getProcAddr(\"glGetNamedBufferParameteri64v\"))\n\tgpGetNamedBufferParameteriv = uintptr(getProcAddr(\"glGetNamedBufferParameteriv\"))\n\tgpGetNamedBufferParameterivEXT = uintptr(getProcAddr(\"glGetNamedBufferParameterivEXT\"))\n\tgpGetNamedBufferParameterui64vNV = uintptr(getProcAddr(\"glGetNamedBufferParameterui64vNV\"))\n\tgpGetNamedBufferPointerv = uintptr(getProcAddr(\"glGetNamedBufferPointerv\"))\n\tgpGetNamedBufferPointervEXT = uintptr(getProcAddr(\"glGetNamedBufferPointervEXT\"))\n\tgpGetNamedBufferSubData = uintptr(getProcAddr(\"glGetNamedBufferSubData\"))\n\tgpGetNamedBufferSubDataEXT = uintptr(getProcAddr(\"glGetNamedBufferSubDataEXT\"))\n\tgpGetNamedFramebufferAttachmentParameteriv = uintptr(getProcAddr(\"glGetNamedFramebufferAttachmentParameteriv\"))\n\tgpGetNamedFramebufferAttachmentParameterivEXT = uintptr(getProcAddr(\"glGetNamedFramebufferAttachmentParameterivEXT\"))\n\tgpGetNamedFramebufferParameterfvAMD = uintptr(getProcAddr(\"glGetNamedFramebufferParameterfvAMD\"))\n\tgpGetNamedFramebufferParameteriv = uintptr(getProcAddr(\"glGetNamedFramebufferParameteriv\"))\n\tgpGetNamedFramebufferParameterivEXT = uintptr(getProcAddr(\"glGetNamedFramebufferParameterivEXT\"))\n\tgpGetNamedProgramLocalParameterIivEXT = uintptr(getProcAddr(\"glGetNamedProgramLocalParameterIivEXT\"))\n\tgpGetNamedProgramLocalParameterIuivEXT = uintptr(getProcAddr(\"glGetNamedProgramLocalParameterIuivEXT\"))\n\tgpGetNamedProgramLocalParameterdvEXT = uintptr(getProcAddr(\"glGetNamedProgramLocalParameterdvEXT\"))\n\tgpGetNamedProgramLocalParameterfvEXT = uintptr(getProcAddr(\"glGetNamedProgramLocalParameterfvEXT\"))\n\tgpGetNamedProgramStringEXT = uintptr(getProcAddr(\"glGetNamedProgramStringEXT\"))\n\tgpGetNamedProgramivEXT = uintptr(getProcAddr(\"glGetNamedProgramivEXT\"))\n\tgpGetNamedRenderbufferParameteriv = uintptr(getProcAddr(\"glGetNamedRenderbufferParameteriv\"))\n\tgpGetNamedRenderbufferParameterivEXT = uintptr(getProcAddr(\"glGetNamedRenderbufferParameterivEXT\"))\n\tgpGetNamedStringARB = uintptr(getProcAddr(\"glGetNamedStringARB\"))\n\tgpGetNamedStringivARB = uintptr(getProcAddr(\"glGetNamedStringivARB\"))\n\tgpGetNextPerfQueryIdINTEL = uintptr(getProcAddr(\"glGetNextPerfQueryIdINTEL\"))\n\tgpGetObjectBufferfvATI = uintptr(getProcAddr(\"glGetObjectBufferfvATI\"))\n\tgpGetObjectBufferivATI = uintptr(getProcAddr(\"glGetObjectBufferivATI\"))\n\tgpGetObjectLabel = uintptr(getProcAddr(\"glGetObjectLabel\"))\n\tgpGetObjectLabelEXT = uintptr(getProcAddr(\"glGetObjectLabelEXT\"))\n\tgpGetObjectLabelKHR = uintptr(getProcAddr(\"glGetObjectLabelKHR\"))\n\tgpGetObjectParameterfvARB = uintptr(getProcAddr(\"glGetObjectParameterfvARB\"))\n\tgpGetObjectParameterivAPPLE = uintptr(getProcAddr(\"glGetObjectParameterivAPPLE\"))\n\tgpGetObjectParameterivARB = uintptr(getProcAddr(\"glGetObjectParameterivARB\"))\n\tgpGetObjectPtrLabel = uintptr(getProcAddr(\"glGetObjectPtrLabel\"))\n\tgpGetObjectPtrLabelKHR = uintptr(getProcAddr(\"glGetObjectPtrLabelKHR\"))\n\tgpGetOcclusionQueryivNV = uintptr(getProcAddr(\"glGetOcclusionQueryivNV\"))\n\tgpGetOcclusionQueryuivNV = uintptr(getProcAddr(\"glGetOcclusionQueryuivNV\"))\n\tgpGetPathCommandsNV = uintptr(getProcAddr(\"glGetPathCommandsNV\"))\n\tgpGetPathCoordsNV = uintptr(getProcAddr(\"glGetPathCoordsNV\"))\n\tgpGetPathDashArrayNV = uintptr(getProcAddr(\"glGetPathDashArrayNV\"))\n\tgpGetPathLengthNV = uintptr(getProcAddr(\"glGetPathLengthNV\"))\n\tgpGetPathMetricRangeNV = uintptr(getProcAddr(\"glGetPathMetricRangeNV\"))\n\tgpGetPathMetricsNV = uintptr(getProcAddr(\"glGetPathMetricsNV\"))\n\tgpGetPathParameterfvNV = uintptr(getProcAddr(\"glGetPathParameterfvNV\"))\n\tgpGetPathParameterivNV = uintptr(getProcAddr(\"glGetPathParameterivNV\"))\n\tgpGetPathSpacingNV = uintptr(getProcAddr(\"glGetPathSpacingNV\"))\n\tgpGetPerfCounterInfoINTEL = uintptr(getProcAddr(\"glGetPerfCounterInfoINTEL\"))\n\tgpGetPerfMonitorCounterDataAMD = uintptr(getProcAddr(\"glGetPerfMonitorCounterDataAMD\"))\n\tgpGetPerfMonitorCounterInfoAMD = uintptr(getProcAddr(\"glGetPerfMonitorCounterInfoAMD\"))\n\tgpGetPerfMonitorCounterStringAMD = uintptr(getProcAddr(\"glGetPerfMonitorCounterStringAMD\"))\n\tgpGetPerfMonitorCountersAMD = uintptr(getProcAddr(\"glGetPerfMonitorCountersAMD\"))\n\tgpGetPerfMonitorGroupStringAMD = uintptr(getProcAddr(\"glGetPerfMonitorGroupStringAMD\"))\n\tgpGetPerfMonitorGroupsAMD = uintptr(getProcAddr(\"glGetPerfMonitorGroupsAMD\"))\n\tgpGetPerfQueryDataINTEL = uintptr(getProcAddr(\"glGetPerfQueryDataINTEL\"))\n\tgpGetPerfQueryIdByNameINTEL = uintptr(getProcAddr(\"glGetPerfQueryIdByNameINTEL\"))\n\tgpGetPerfQueryInfoINTEL = uintptr(getProcAddr(\"glGetPerfQueryInfoINTEL\"))\n\tgpGetPixelMapfv = uintptr(getProcAddr(\"glGetPixelMapfv\"))\n\tif gpGetPixelMapfv == 0 {\n\t\treturn errors.New(\"glGetPixelMapfv\")\n\t}\n\tgpGetPixelMapuiv = uintptr(getProcAddr(\"glGetPixelMapuiv\"))\n\tif gpGetPixelMapuiv == 0 {\n\t\treturn errors.New(\"glGetPixelMapuiv\")\n\t}\n\tgpGetPixelMapusv = uintptr(getProcAddr(\"glGetPixelMapusv\"))\n\tif gpGetPixelMapusv == 0 {\n\t\treturn errors.New(\"glGetPixelMapusv\")\n\t}\n\tgpGetPixelMapxv = uintptr(getProcAddr(\"glGetPixelMapxv\"))\n\tgpGetPixelTexGenParameterfvSGIS = uintptr(getProcAddr(\"glGetPixelTexGenParameterfvSGIS\"))\n\tgpGetPixelTexGenParameterivSGIS = uintptr(getProcAddr(\"glGetPixelTexGenParameterivSGIS\"))\n\tgpGetPixelTransformParameterfvEXT = uintptr(getProcAddr(\"glGetPixelTransformParameterfvEXT\"))\n\tgpGetPixelTransformParameterivEXT = uintptr(getProcAddr(\"glGetPixelTransformParameterivEXT\"))\n\tgpGetPointerIndexedvEXT = uintptr(getProcAddr(\"glGetPointerIndexedvEXT\"))\n\tgpGetPointeri_vEXT = uintptr(getProcAddr(\"glGetPointeri_vEXT\"))\n\tgpGetPointerv = uintptr(getProcAddr(\"glGetPointerv\"))\n\tif gpGetPointerv == 0 {\n\t\treturn errors.New(\"glGetPointerv\")\n\t}\n\tgpGetPointervEXT = uintptr(getProcAddr(\"glGetPointervEXT\"))\n\tgpGetPointervKHR = uintptr(getProcAddr(\"glGetPointervKHR\"))\n\tgpGetPolygonStipple = uintptr(getProcAddr(\"glGetPolygonStipple\"))\n\tif gpGetPolygonStipple == 0 {\n\t\treturn errors.New(\"glGetPolygonStipple\")\n\t}\n\tgpGetProgramBinary = uintptr(getProcAddr(\"glGetProgramBinary\"))\n\tgpGetProgramEnvParameterIivNV = uintptr(getProcAddr(\"glGetProgramEnvParameterIivNV\"))\n\tgpGetProgramEnvParameterIuivNV = uintptr(getProcAddr(\"glGetProgramEnvParameterIuivNV\"))\n\tgpGetProgramEnvParameterdvARB = uintptr(getProcAddr(\"glGetProgramEnvParameterdvARB\"))\n\tgpGetProgramEnvParameterfvARB = uintptr(getProcAddr(\"glGetProgramEnvParameterfvARB\"))\n\tgpGetProgramInfoLog = uintptr(getProcAddr(\"glGetProgramInfoLog\"))\n\tif gpGetProgramInfoLog == 0 {\n\t\treturn errors.New(\"glGetProgramInfoLog\")\n\t}\n\tgpGetProgramInterfaceiv = uintptr(getProcAddr(\"glGetProgramInterfaceiv\"))\n\tgpGetProgramLocalParameterIivNV = uintptr(getProcAddr(\"glGetProgramLocalParameterIivNV\"))\n\tgpGetProgramLocalParameterIuivNV = uintptr(getProcAddr(\"glGetProgramLocalParameterIuivNV\"))\n\tgpGetProgramLocalParameterdvARB = uintptr(getProcAddr(\"glGetProgramLocalParameterdvARB\"))\n\tgpGetProgramLocalParameterfvARB = uintptr(getProcAddr(\"glGetProgramLocalParameterfvARB\"))\n\tgpGetProgramNamedParameterdvNV = uintptr(getProcAddr(\"glGetProgramNamedParameterdvNV\"))\n\tgpGetProgramNamedParameterfvNV = uintptr(getProcAddr(\"glGetProgramNamedParameterfvNV\"))\n\tgpGetProgramParameterdvNV = uintptr(getProcAddr(\"glGetProgramParameterdvNV\"))\n\tgpGetProgramParameterfvNV = uintptr(getProcAddr(\"glGetProgramParameterfvNV\"))\n\tgpGetProgramPipelineInfoLog = uintptr(getProcAddr(\"glGetProgramPipelineInfoLog\"))\n\tgpGetProgramPipelineInfoLogEXT = uintptr(getProcAddr(\"glGetProgramPipelineInfoLogEXT\"))\n\tgpGetProgramPipelineiv = uintptr(getProcAddr(\"glGetProgramPipelineiv\"))\n\tgpGetProgramPipelineivEXT = uintptr(getProcAddr(\"glGetProgramPipelineivEXT\"))\n\tgpGetProgramResourceIndex = uintptr(getProcAddr(\"glGetProgramResourceIndex\"))\n\tgpGetProgramResourceLocation = uintptr(getProcAddr(\"glGetProgramResourceLocation\"))\n\tgpGetProgramResourceLocationIndex = uintptr(getProcAddr(\"glGetProgramResourceLocationIndex\"))\n\tgpGetProgramResourceName = uintptr(getProcAddr(\"glGetProgramResourceName\"))\n\tgpGetProgramResourcefvNV = uintptr(getProcAddr(\"glGetProgramResourcefvNV\"))\n\tgpGetProgramResourceiv = uintptr(getProcAddr(\"glGetProgramResourceiv\"))\n\tgpGetProgramStageiv = uintptr(getProcAddr(\"glGetProgramStageiv\"))\n\tgpGetProgramStringARB = uintptr(getProcAddr(\"glGetProgramStringARB\"))\n\tgpGetProgramStringNV = uintptr(getProcAddr(\"glGetProgramStringNV\"))\n\tgpGetProgramSubroutineParameteruivNV = uintptr(getProcAddr(\"glGetProgramSubroutineParameteruivNV\"))\n\tgpGetProgramiv = uintptr(getProcAddr(\"glGetProgramiv\"))\n\tif gpGetProgramiv == 0 {\n\t\treturn errors.New(\"glGetProgramiv\")\n\t}\n\tgpGetProgramivARB = uintptr(getProcAddr(\"glGetProgramivARB\"))\n\tgpGetProgramivNV = uintptr(getProcAddr(\"glGetProgramivNV\"))\n\tgpGetQueryBufferObjecti64v = uintptr(getProcAddr(\"glGetQueryBufferObjecti64v\"))\n\tgpGetQueryBufferObjectiv = uintptr(getProcAddr(\"glGetQueryBufferObjectiv\"))\n\tgpGetQueryBufferObjectui64v = uintptr(getProcAddr(\"glGetQueryBufferObjectui64v\"))\n\tgpGetQueryBufferObjectuiv = uintptr(getProcAddr(\"glGetQueryBufferObjectuiv\"))\n\tgpGetQueryIndexediv = uintptr(getProcAddr(\"glGetQueryIndexediv\"))\n\tgpGetQueryObjecti64v = uintptr(getProcAddr(\"glGetQueryObjecti64v\"))\n\tgpGetQueryObjecti64vEXT = uintptr(getProcAddr(\"glGetQueryObjecti64vEXT\"))\n\tgpGetQueryObjectiv = uintptr(getProcAddr(\"glGetQueryObjectiv\"))\n\tif gpGetQueryObjectiv == 0 {\n\t\treturn errors.New(\"glGetQueryObjectiv\")\n\t}\n\tgpGetQueryObjectivARB = uintptr(getProcAddr(\"glGetQueryObjectivARB\"))\n\tgpGetQueryObjectui64v = uintptr(getProcAddr(\"glGetQueryObjectui64v\"))\n\tgpGetQueryObjectui64vEXT = uintptr(getProcAddr(\"glGetQueryObjectui64vEXT\"))\n\tgpGetQueryObjectuiv = uintptr(getProcAddr(\"glGetQueryObjectuiv\"))\n\tif gpGetQueryObjectuiv == 0 {\n\t\treturn errors.New(\"glGetQueryObjectuiv\")\n\t}\n\tgpGetQueryObjectuivARB = uintptr(getProcAddr(\"glGetQueryObjectuivARB\"))\n\tgpGetQueryiv = uintptr(getProcAddr(\"glGetQueryiv\"))\n\tif gpGetQueryiv == 0 {\n\t\treturn errors.New(\"glGetQueryiv\")\n\t}\n\tgpGetQueryivARB = uintptr(getProcAddr(\"glGetQueryivARB\"))\n\tgpGetRenderbufferParameteriv = uintptr(getProcAddr(\"glGetRenderbufferParameteriv\"))\n\tgpGetRenderbufferParameterivEXT = uintptr(getProcAddr(\"glGetRenderbufferParameterivEXT\"))\n\tgpGetSamplerParameterIiv = uintptr(getProcAddr(\"glGetSamplerParameterIiv\"))\n\tgpGetSamplerParameterIuiv = uintptr(getProcAddr(\"glGetSamplerParameterIuiv\"))\n\tgpGetSamplerParameterfv = uintptr(getProcAddr(\"glGetSamplerParameterfv\"))\n\tgpGetSamplerParameteriv = uintptr(getProcAddr(\"glGetSamplerParameteriv\"))\n\tgpGetSemaphoreParameterui64vEXT = uintptr(getProcAddr(\"glGetSemaphoreParameterui64vEXT\"))\n\tgpGetSeparableFilterEXT = uintptr(getProcAddr(\"glGetSeparableFilterEXT\"))\n\tgpGetShaderInfoLog = uintptr(getProcAddr(\"glGetShaderInfoLog\"))\n\tif gpGetShaderInfoLog == 0 {\n\t\treturn errors.New(\"glGetShaderInfoLog\")\n\t}\n\tgpGetShaderPrecisionFormat = uintptr(getProcAddr(\"glGetShaderPrecisionFormat\"))\n\tgpGetShaderSource = uintptr(getProcAddr(\"glGetShaderSource\"))\n\tif gpGetShaderSource == 0 {\n\t\treturn errors.New(\"glGetShaderSource\")\n\t}\n\tgpGetShaderSourceARB = uintptr(getProcAddr(\"glGetShaderSourceARB\"))\n\tgpGetShaderiv = uintptr(getProcAddr(\"glGetShaderiv\"))\n\tif gpGetShaderiv == 0 {\n\t\treturn errors.New(\"glGetShaderiv\")\n\t}\n\tgpGetSharpenTexFuncSGIS = uintptr(getProcAddr(\"glGetSharpenTexFuncSGIS\"))\n\tgpGetStageIndexNV = uintptr(getProcAddr(\"glGetStageIndexNV\"))\n\tgpGetString = uintptr(getProcAddr(\"glGetString\"))\n\tif gpGetString == 0 {\n\t\treturn errors.New(\"glGetString\")\n\t}\n\tgpGetSubroutineIndex = uintptr(getProcAddr(\"glGetSubroutineIndex\"))\n\tgpGetSubroutineUniformLocation = uintptr(getProcAddr(\"glGetSubroutineUniformLocation\"))\n\tgpGetSynciv = uintptr(getProcAddr(\"glGetSynciv\"))\n\tgpGetTexBumpParameterfvATI = uintptr(getProcAddr(\"glGetTexBumpParameterfvATI\"))\n\tgpGetTexBumpParameterivATI = uintptr(getProcAddr(\"glGetTexBumpParameterivATI\"))\n\tgpGetTexEnvfv = uintptr(getProcAddr(\"glGetTexEnvfv\"))\n\tif gpGetTexEnvfv == 0 {\n\t\treturn errors.New(\"glGetTexEnvfv\")\n\t}\n\tgpGetTexEnviv = uintptr(getProcAddr(\"glGetTexEnviv\"))\n\tif gpGetTexEnviv == 0 {\n\t\treturn errors.New(\"glGetTexEnviv\")\n\t}\n\tgpGetTexEnvxvOES = uintptr(getProcAddr(\"glGetTexEnvxvOES\"))\n\tgpGetTexFilterFuncSGIS = uintptr(getProcAddr(\"glGetTexFilterFuncSGIS\"))\n\tgpGetTexGendv = uintptr(getProcAddr(\"glGetTexGendv\"))\n\tif gpGetTexGendv == 0 {\n\t\treturn errors.New(\"glGetTexGendv\")\n\t}\n\tgpGetTexGenfv = uintptr(getProcAddr(\"glGetTexGenfv\"))\n\tif gpGetTexGenfv == 0 {\n\t\treturn errors.New(\"glGetTexGenfv\")\n\t}\n\tgpGetTexGeniv = uintptr(getProcAddr(\"glGetTexGeniv\"))\n\tif gpGetTexGeniv == 0 {\n\t\treturn errors.New(\"glGetTexGeniv\")\n\t}\n\tgpGetTexGenxvOES = uintptr(getProcAddr(\"glGetTexGenxvOES\"))\n\tgpGetTexImage = uintptr(getProcAddr(\"glGetTexImage\"))\n\tif gpGetTexImage == 0 {\n\t\treturn errors.New(\"glGetTexImage\")\n\t}\n\tgpGetTexLevelParameterfv = uintptr(getProcAddr(\"glGetTexLevelParameterfv\"))\n\tif gpGetTexLevelParameterfv == 0 {\n\t\treturn errors.New(\"glGetTexLevelParameterfv\")\n\t}\n\tgpGetTexLevelParameteriv = uintptr(getProcAddr(\"glGetTexLevelParameteriv\"))\n\tif gpGetTexLevelParameteriv == 0 {\n\t\treturn errors.New(\"glGetTexLevelParameteriv\")\n\t}\n\tgpGetTexLevelParameterxvOES = uintptr(getProcAddr(\"glGetTexLevelParameterxvOES\"))\n\tgpGetTexParameterIivEXT = uintptr(getProcAddr(\"glGetTexParameterIivEXT\"))\n\tgpGetTexParameterIuivEXT = uintptr(getProcAddr(\"glGetTexParameterIuivEXT\"))\n\tgpGetTexParameterPointervAPPLE = uintptr(getProcAddr(\"glGetTexParameterPointervAPPLE\"))\n\tgpGetTexParameterfv = uintptr(getProcAddr(\"glGetTexParameterfv\"))\n\tif gpGetTexParameterfv == 0 {\n\t\treturn errors.New(\"glGetTexParameterfv\")\n\t}\n\tgpGetTexParameteriv = uintptr(getProcAddr(\"glGetTexParameteriv\"))\n\tif gpGetTexParameteriv == 0 {\n\t\treturn errors.New(\"glGetTexParameteriv\")\n\t}\n\tgpGetTexParameterxvOES = uintptr(getProcAddr(\"glGetTexParameterxvOES\"))\n\tgpGetTextureHandleARB = uintptr(getProcAddr(\"glGetTextureHandleARB\"))\n\tgpGetTextureHandleNV = uintptr(getProcAddr(\"glGetTextureHandleNV\"))\n\tgpGetTextureImage = uintptr(getProcAddr(\"glGetTextureImage\"))\n\tgpGetTextureImageEXT = uintptr(getProcAddr(\"glGetTextureImageEXT\"))\n\tgpGetTextureLevelParameterfv = uintptr(getProcAddr(\"glGetTextureLevelParameterfv\"))\n\tgpGetTextureLevelParameterfvEXT = uintptr(getProcAddr(\"glGetTextureLevelParameterfvEXT\"))\n\tgpGetTextureLevelParameteriv = uintptr(getProcAddr(\"glGetTextureLevelParameteriv\"))\n\tgpGetTextureLevelParameterivEXT = uintptr(getProcAddr(\"glGetTextureLevelParameterivEXT\"))\n\tgpGetTextureParameterIiv = uintptr(getProcAddr(\"glGetTextureParameterIiv\"))\n\tgpGetTextureParameterIivEXT = uintptr(getProcAddr(\"glGetTextureParameterIivEXT\"))\n\tgpGetTextureParameterIuiv = uintptr(getProcAddr(\"glGetTextureParameterIuiv\"))\n\tgpGetTextureParameterIuivEXT = uintptr(getProcAddr(\"glGetTextureParameterIuivEXT\"))\n\tgpGetTextureParameterfv = uintptr(getProcAddr(\"glGetTextureParameterfv\"))\n\tgpGetTextureParameterfvEXT = uintptr(getProcAddr(\"glGetTextureParameterfvEXT\"))\n\tgpGetTextureParameteriv = uintptr(getProcAddr(\"glGetTextureParameteriv\"))\n\tgpGetTextureParameterivEXT = uintptr(getProcAddr(\"glGetTextureParameterivEXT\"))\n\tgpGetTextureSamplerHandleARB = uintptr(getProcAddr(\"glGetTextureSamplerHandleARB\"))\n\tgpGetTextureSamplerHandleNV = uintptr(getProcAddr(\"glGetTextureSamplerHandleNV\"))\n\tgpGetTextureSubImage = uintptr(getProcAddr(\"glGetTextureSubImage\"))\n\tgpGetTrackMatrixivNV = uintptr(getProcAddr(\"glGetTrackMatrixivNV\"))\n\tgpGetTransformFeedbackVaryingEXT = uintptr(getProcAddr(\"glGetTransformFeedbackVaryingEXT\"))\n\tgpGetTransformFeedbackVaryingNV = uintptr(getProcAddr(\"glGetTransformFeedbackVaryingNV\"))\n\tgpGetTransformFeedbacki64_v = uintptr(getProcAddr(\"glGetTransformFeedbacki64_v\"))\n\tgpGetTransformFeedbacki_v = uintptr(getProcAddr(\"glGetTransformFeedbacki_v\"))\n\tgpGetTransformFeedbackiv = uintptr(getProcAddr(\"glGetTransformFeedbackiv\"))\n\tgpGetUniformBlockIndex = uintptr(getProcAddr(\"glGetUniformBlockIndex\"))\n\tgpGetUniformBufferSizeEXT = uintptr(getProcAddr(\"glGetUniformBufferSizeEXT\"))\n\tgpGetUniformIndices = uintptr(getProcAddr(\"glGetUniformIndices\"))\n\tgpGetUniformLocation = uintptr(getProcAddr(\"glGetUniformLocation\"))\n\tif gpGetUniformLocation == 0 {\n\t\treturn errors.New(\"glGetUniformLocation\")\n\t}\n\tgpGetUniformLocationARB = uintptr(getProcAddr(\"glGetUniformLocationARB\"))\n\tgpGetUniformOffsetEXT = uintptr(getProcAddr(\"glGetUniformOffsetEXT\"))\n\tgpGetUniformSubroutineuiv = uintptr(getProcAddr(\"glGetUniformSubroutineuiv\"))\n\tgpGetUniformdv = uintptr(getProcAddr(\"glGetUniformdv\"))\n\tgpGetUniformfv = uintptr(getProcAddr(\"glGetUniformfv\"))\n\tif gpGetUniformfv == 0 {\n\t\treturn errors.New(\"glGetUniformfv\")\n\t}\n\tgpGetUniformfvARB = uintptr(getProcAddr(\"glGetUniformfvARB\"))\n\tgpGetUniformi64vARB = uintptr(getProcAddr(\"glGetUniformi64vARB\"))\n\tgpGetUniformi64vNV = uintptr(getProcAddr(\"glGetUniformi64vNV\"))\n\tgpGetUniformiv = uintptr(getProcAddr(\"glGetUniformiv\"))\n\tif gpGetUniformiv == 0 {\n\t\treturn errors.New(\"glGetUniformiv\")\n\t}\n\tgpGetUniformivARB = uintptr(getProcAddr(\"glGetUniformivARB\"))\n\tgpGetUniformui64vARB = uintptr(getProcAddr(\"glGetUniformui64vARB\"))\n\tgpGetUniformui64vNV = uintptr(getProcAddr(\"glGetUniformui64vNV\"))\n\tgpGetUniformuivEXT = uintptr(getProcAddr(\"glGetUniformuivEXT\"))\n\tgpGetUnsignedBytei_vEXT = uintptr(getProcAddr(\"glGetUnsignedBytei_vEXT\"))\n\tgpGetUnsignedBytevEXT = uintptr(getProcAddr(\"glGetUnsignedBytevEXT\"))\n\tgpGetVariantArrayObjectfvATI = uintptr(getProcAddr(\"glGetVariantArrayObjectfvATI\"))\n\tgpGetVariantArrayObjectivATI = uintptr(getProcAddr(\"glGetVariantArrayObjectivATI\"))\n\tgpGetVariantBooleanvEXT = uintptr(getProcAddr(\"glGetVariantBooleanvEXT\"))\n\tgpGetVariantFloatvEXT = uintptr(getProcAddr(\"glGetVariantFloatvEXT\"))\n\tgpGetVariantIntegervEXT = uintptr(getProcAddr(\"glGetVariantIntegervEXT\"))\n\tgpGetVariantPointervEXT = uintptr(getProcAddr(\"glGetVariantPointervEXT\"))\n\tgpGetVaryingLocationNV = uintptr(getProcAddr(\"glGetVaryingLocationNV\"))\n\tgpGetVertexArrayIndexed64iv = uintptr(getProcAddr(\"glGetVertexArrayIndexed64iv\"))\n\tgpGetVertexArrayIndexediv = uintptr(getProcAddr(\"glGetVertexArrayIndexediv\"))\n\tgpGetVertexArrayIntegeri_vEXT = uintptr(getProcAddr(\"glGetVertexArrayIntegeri_vEXT\"))\n\tgpGetVertexArrayIntegervEXT = uintptr(getProcAddr(\"glGetVertexArrayIntegervEXT\"))\n\tgpGetVertexArrayPointeri_vEXT = uintptr(getProcAddr(\"glGetVertexArrayPointeri_vEXT\"))\n\tgpGetVertexArrayPointervEXT = uintptr(getProcAddr(\"glGetVertexArrayPointervEXT\"))\n\tgpGetVertexArrayiv = uintptr(getProcAddr(\"glGetVertexArrayiv\"))\n\tgpGetVertexAttribArrayObjectfvATI = uintptr(getProcAddr(\"glGetVertexAttribArrayObjectfvATI\"))\n\tgpGetVertexAttribArrayObjectivATI = uintptr(getProcAddr(\"glGetVertexAttribArrayObjectivATI\"))\n\tgpGetVertexAttribIivEXT = uintptr(getProcAddr(\"glGetVertexAttribIivEXT\"))\n\tgpGetVertexAttribIuivEXT = uintptr(getProcAddr(\"glGetVertexAttribIuivEXT\"))\n\tgpGetVertexAttribLdv = uintptr(getProcAddr(\"glGetVertexAttribLdv\"))\n\tgpGetVertexAttribLdvEXT = uintptr(getProcAddr(\"glGetVertexAttribLdvEXT\"))\n\tgpGetVertexAttribLi64vNV = uintptr(getProcAddr(\"glGetVertexAttribLi64vNV\"))\n\tgpGetVertexAttribLui64vARB = uintptr(getProcAddr(\"glGetVertexAttribLui64vARB\"))\n\tgpGetVertexAttribLui64vNV = uintptr(getProcAddr(\"glGetVertexAttribLui64vNV\"))\n\tgpGetVertexAttribPointerv = uintptr(getProcAddr(\"glGetVertexAttribPointerv\"))\n\tif gpGetVertexAttribPointerv == 0 {\n\t\treturn errors.New(\"glGetVertexAttribPointerv\")\n\t}\n\tgpGetVertexAttribPointervARB = uintptr(getProcAddr(\"glGetVertexAttribPointervARB\"))\n\tgpGetVertexAttribPointervNV = uintptr(getProcAddr(\"glGetVertexAttribPointervNV\"))\n\tgpGetVertexAttribdv = uintptr(getProcAddr(\"glGetVertexAttribdv\"))\n\tif gpGetVertexAttribdv == 0 {\n\t\treturn errors.New(\"glGetVertexAttribdv\")\n\t}\n\tgpGetVertexAttribdvARB = uintptr(getProcAddr(\"glGetVertexAttribdvARB\"))\n\tgpGetVertexAttribdvNV = uintptr(getProcAddr(\"glGetVertexAttribdvNV\"))\n\tgpGetVertexAttribfv = uintptr(getProcAddr(\"glGetVertexAttribfv\"))\n\tif gpGetVertexAttribfv == 0 {\n\t\treturn errors.New(\"glGetVertexAttribfv\")\n\t}\n\tgpGetVertexAttribfvARB = uintptr(getProcAddr(\"glGetVertexAttribfvARB\"))\n\tgpGetVertexAttribfvNV = uintptr(getProcAddr(\"glGetVertexAttribfvNV\"))\n\tgpGetVertexAttribiv = uintptr(getProcAddr(\"glGetVertexAttribiv\"))\n\tif gpGetVertexAttribiv == 0 {\n\t\treturn errors.New(\"glGetVertexAttribiv\")\n\t}\n\tgpGetVertexAttribivARB = uintptr(getProcAddr(\"glGetVertexAttribivARB\"))\n\tgpGetVertexAttribivNV = uintptr(getProcAddr(\"glGetVertexAttribivNV\"))\n\tgpGetVideoCaptureStreamdvNV = uintptr(getProcAddr(\"glGetVideoCaptureStreamdvNV\"))\n\tgpGetVideoCaptureStreamfvNV = uintptr(getProcAddr(\"glGetVideoCaptureStreamfvNV\"))\n\tgpGetVideoCaptureStreamivNV = uintptr(getProcAddr(\"glGetVideoCaptureStreamivNV\"))\n\tgpGetVideoCaptureivNV = uintptr(getProcAddr(\"glGetVideoCaptureivNV\"))\n\tgpGetVideoi64vNV = uintptr(getProcAddr(\"glGetVideoi64vNV\"))\n\tgpGetVideoivNV = uintptr(getProcAddr(\"glGetVideoivNV\"))\n\tgpGetVideoui64vNV = uintptr(getProcAddr(\"glGetVideoui64vNV\"))\n\tgpGetVideouivNV = uintptr(getProcAddr(\"glGetVideouivNV\"))\n\tgpGetVkProcAddrNV = uintptr(getProcAddr(\"glGetVkProcAddrNV\"))\n\tgpGetnCompressedTexImageARB = uintptr(getProcAddr(\"glGetnCompressedTexImageARB\"))\n\tgpGetnTexImageARB = uintptr(getProcAddr(\"glGetnTexImageARB\"))\n\tgpGetnUniformdvARB = uintptr(getProcAddr(\"glGetnUniformdvARB\"))\n\tgpGetnUniformfv = uintptr(getProcAddr(\"glGetnUniformfv\"))\n\tgpGetnUniformfvARB = uintptr(getProcAddr(\"glGetnUniformfvARB\"))\n\tgpGetnUniformfvKHR = uintptr(getProcAddr(\"glGetnUniformfvKHR\"))\n\tgpGetnUniformi64vARB = uintptr(getProcAddr(\"glGetnUniformi64vARB\"))\n\tgpGetnUniformiv = uintptr(getProcAddr(\"glGetnUniformiv\"))\n\tgpGetnUniformivARB = uintptr(getProcAddr(\"glGetnUniformivARB\"))\n\tgpGetnUniformivKHR = uintptr(getProcAddr(\"glGetnUniformivKHR\"))\n\tgpGetnUniformui64vARB = uintptr(getProcAddr(\"glGetnUniformui64vARB\"))\n\tgpGetnUniformuiv = uintptr(getProcAddr(\"glGetnUniformuiv\"))\n\tgpGetnUniformuivARB = uintptr(getProcAddr(\"glGetnUniformuivARB\"))\n\tgpGetnUniformuivKHR = uintptr(getProcAddr(\"glGetnUniformuivKHR\"))\n\tgpGlobalAlphaFactorbSUN = uintptr(getProcAddr(\"glGlobalAlphaFactorbSUN\"))\n\tgpGlobalAlphaFactordSUN = uintptr(getProcAddr(\"glGlobalAlphaFactordSUN\"))\n\tgpGlobalAlphaFactorfSUN = uintptr(getProcAddr(\"glGlobalAlphaFactorfSUN\"))\n\tgpGlobalAlphaFactoriSUN = uintptr(getProcAddr(\"glGlobalAlphaFactoriSUN\"))\n\tgpGlobalAlphaFactorsSUN = uintptr(getProcAddr(\"glGlobalAlphaFactorsSUN\"))\n\tgpGlobalAlphaFactorubSUN = uintptr(getProcAddr(\"glGlobalAlphaFactorubSUN\"))\n\tgpGlobalAlphaFactoruiSUN = uintptr(getProcAddr(\"glGlobalAlphaFactoruiSUN\"))\n\tgpGlobalAlphaFactorusSUN = uintptr(getProcAddr(\"glGlobalAlphaFactorusSUN\"))\n\tgpHint = uintptr(getProcAddr(\"glHint\"))\n\tif gpHint == 0 {\n\t\treturn errors.New(\"glHint\")\n\t}\n\tgpHintPGI = uintptr(getProcAddr(\"glHintPGI\"))\n\tgpHistogramEXT = uintptr(getProcAddr(\"glHistogramEXT\"))\n\tgpIglooInterfaceSGIX = uintptr(getProcAddr(\"glIglooInterfaceSGIX\"))\n\tgpImageTransformParameterfHP = uintptr(getProcAddr(\"glImageTransformParameterfHP\"))\n\tgpImageTransformParameterfvHP = uintptr(getProcAddr(\"glImageTransformParameterfvHP\"))\n\tgpImageTransformParameteriHP = uintptr(getProcAddr(\"glImageTransformParameteriHP\"))\n\tgpImageTransformParameterivHP = uintptr(getProcAddr(\"glImageTransformParameterivHP\"))\n\tgpImportMemoryFdEXT = uintptr(getProcAddr(\"glImportMemoryFdEXT\"))\n\tgpImportMemoryWin32HandleEXT = uintptr(getProcAddr(\"glImportMemoryWin32HandleEXT\"))\n\tgpImportMemoryWin32NameEXT = uintptr(getProcAddr(\"glImportMemoryWin32NameEXT\"))\n\tgpImportSemaphoreFdEXT = uintptr(getProcAddr(\"glImportSemaphoreFdEXT\"))\n\tgpImportSemaphoreWin32HandleEXT = uintptr(getProcAddr(\"glImportSemaphoreWin32HandleEXT\"))\n\tgpImportSemaphoreWin32NameEXT = uintptr(getProcAddr(\"glImportSemaphoreWin32NameEXT\"))\n\tgpImportSyncEXT = uintptr(getProcAddr(\"glImportSyncEXT\"))\n\tgpIndexFormatNV = uintptr(getProcAddr(\"glIndexFormatNV\"))\n\tgpIndexFuncEXT = uintptr(getProcAddr(\"glIndexFuncEXT\"))\n\tgpIndexMask = uintptr(getProcAddr(\"glIndexMask\"))\n\tif gpIndexMask == 0 {\n\t\treturn errors.New(\"glIndexMask\")\n\t}\n\tgpIndexMaterialEXT = uintptr(getProcAddr(\"glIndexMaterialEXT\"))\n\tgpIndexPointer = uintptr(getProcAddr(\"glIndexPointer\"))\n\tif gpIndexPointer == 0 {\n\t\treturn errors.New(\"glIndexPointer\")\n\t}\n\tgpIndexPointerEXT = uintptr(getProcAddr(\"glIndexPointerEXT\"))\n\tgpIndexPointerListIBM = uintptr(getProcAddr(\"glIndexPointerListIBM\"))\n\tgpIndexd = uintptr(getProcAddr(\"glIndexd\"))\n\tif gpIndexd == 0 {\n\t\treturn errors.New(\"glIndexd\")\n\t}\n\tgpIndexdv = uintptr(getProcAddr(\"glIndexdv\"))\n\tif gpIndexdv == 0 {\n\t\treturn errors.New(\"glIndexdv\")\n\t}\n\tgpIndexf = uintptr(getProcAddr(\"glIndexf\"))\n\tif gpIndexf == 0 {\n\t\treturn errors.New(\"glIndexf\")\n\t}\n\tgpIndexfv = uintptr(getProcAddr(\"glIndexfv\"))\n\tif gpIndexfv == 0 {\n\t\treturn errors.New(\"glIndexfv\")\n\t}\n\tgpIndexi = uintptr(getProcAddr(\"glIndexi\"))\n\tif gpIndexi == 0 {\n\t\treturn errors.New(\"glIndexi\")\n\t}\n\tgpIndexiv = uintptr(getProcAddr(\"glIndexiv\"))\n\tif gpIndexiv == 0 {\n\t\treturn errors.New(\"glIndexiv\")\n\t}\n\tgpIndexs = uintptr(getProcAddr(\"glIndexs\"))\n\tif gpIndexs == 0 {\n\t\treturn errors.New(\"glIndexs\")\n\t}\n\tgpIndexsv = uintptr(getProcAddr(\"glIndexsv\"))\n\tif gpIndexsv == 0 {\n\t\treturn errors.New(\"glIndexsv\")\n\t}\n\tgpIndexub = uintptr(getProcAddr(\"glIndexub\"))\n\tif gpIndexub == 0 {\n\t\treturn errors.New(\"glIndexub\")\n\t}\n\tgpIndexubv = uintptr(getProcAddr(\"glIndexubv\"))\n\tif gpIndexubv == 0 {\n\t\treturn errors.New(\"glIndexubv\")\n\t}\n\tgpIndexxOES = uintptr(getProcAddr(\"glIndexxOES\"))\n\tgpIndexxvOES = uintptr(getProcAddr(\"glIndexxvOES\"))\n\tgpInitNames = uintptr(getProcAddr(\"glInitNames\"))\n\tif gpInitNames == 0 {\n\t\treturn errors.New(\"glInitNames\")\n\t}\n\tgpInsertComponentEXT = uintptr(getProcAddr(\"glInsertComponentEXT\"))\n\tgpInsertEventMarkerEXT = uintptr(getProcAddr(\"glInsertEventMarkerEXT\"))\n\tgpInstrumentsBufferSGIX = uintptr(getProcAddr(\"glInstrumentsBufferSGIX\"))\n\tgpInterleavedArrays = uintptr(getProcAddr(\"glInterleavedArrays\"))\n\tif gpInterleavedArrays == 0 {\n\t\treturn errors.New(\"glInterleavedArrays\")\n\t}\n\tgpInterpolatePathsNV = uintptr(getProcAddr(\"glInterpolatePathsNV\"))\n\tgpInvalidateBufferData = uintptr(getProcAddr(\"glInvalidateBufferData\"))\n\tgpInvalidateBufferSubData = uintptr(getProcAddr(\"glInvalidateBufferSubData\"))\n\tgpInvalidateFramebuffer = uintptr(getProcAddr(\"glInvalidateFramebuffer\"))\n\tgpInvalidateNamedFramebufferData = uintptr(getProcAddr(\"glInvalidateNamedFramebufferData\"))\n\tgpInvalidateNamedFramebufferSubData = uintptr(getProcAddr(\"glInvalidateNamedFramebufferSubData\"))\n\tgpInvalidateSubFramebuffer = uintptr(getProcAddr(\"glInvalidateSubFramebuffer\"))\n\tgpInvalidateTexImage = uintptr(getProcAddr(\"glInvalidateTexImage\"))\n\tgpInvalidateTexSubImage = uintptr(getProcAddr(\"glInvalidateTexSubImage\"))\n\tgpIsAsyncMarkerSGIX = uintptr(getProcAddr(\"glIsAsyncMarkerSGIX\"))\n\tgpIsBuffer = uintptr(getProcAddr(\"glIsBuffer\"))\n\tif gpIsBuffer == 0 {\n\t\treturn errors.New(\"glIsBuffer\")\n\t}\n\tgpIsBufferARB = uintptr(getProcAddr(\"glIsBufferARB\"))\n\tgpIsBufferResidentNV = uintptr(getProcAddr(\"glIsBufferResidentNV\"))\n\tgpIsCommandListNV = uintptr(getProcAddr(\"glIsCommandListNV\"))\n\tgpIsEnabled = uintptr(getProcAddr(\"glIsEnabled\"))\n\tif gpIsEnabled == 0 {\n\t\treturn errors.New(\"glIsEnabled\")\n\t}\n\tgpIsEnabledIndexedEXT = uintptr(getProcAddr(\"glIsEnabledIndexedEXT\"))\n\tgpIsFenceAPPLE = uintptr(getProcAddr(\"glIsFenceAPPLE\"))\n\tgpIsFenceNV = uintptr(getProcAddr(\"glIsFenceNV\"))\n\tgpIsFramebuffer = uintptr(getProcAddr(\"glIsFramebuffer\"))\n\tgpIsFramebufferEXT = uintptr(getProcAddr(\"glIsFramebufferEXT\"))\n\tgpIsImageHandleResidentARB = uintptr(getProcAddr(\"glIsImageHandleResidentARB\"))\n\tgpIsImageHandleResidentNV = uintptr(getProcAddr(\"glIsImageHandleResidentNV\"))\n\tgpIsList = uintptr(getProcAddr(\"glIsList\"))\n\tif gpIsList == 0 {\n\t\treturn errors.New(\"glIsList\")\n\t}\n\tgpIsMemoryObjectEXT = uintptr(getProcAddr(\"glIsMemoryObjectEXT\"))\n\tgpIsNameAMD = uintptr(getProcAddr(\"glIsNameAMD\"))\n\tgpIsNamedBufferResidentNV = uintptr(getProcAddr(\"glIsNamedBufferResidentNV\"))\n\tgpIsNamedStringARB = uintptr(getProcAddr(\"glIsNamedStringARB\"))\n\tgpIsObjectBufferATI = uintptr(getProcAddr(\"glIsObjectBufferATI\"))\n\tgpIsOcclusionQueryNV = uintptr(getProcAddr(\"glIsOcclusionQueryNV\"))\n\tgpIsPathNV = uintptr(getProcAddr(\"glIsPathNV\"))\n\tgpIsPointInFillPathNV = uintptr(getProcAddr(\"glIsPointInFillPathNV\"))\n\tgpIsPointInStrokePathNV = uintptr(getProcAddr(\"glIsPointInStrokePathNV\"))\n\tgpIsProgram = uintptr(getProcAddr(\"glIsProgram\"))\n\tif gpIsProgram == 0 {\n\t\treturn errors.New(\"glIsProgram\")\n\t}\n\tgpIsProgramARB = uintptr(getProcAddr(\"glIsProgramARB\"))\n\tgpIsProgramNV = uintptr(getProcAddr(\"glIsProgramNV\"))\n\tgpIsProgramPipeline = uintptr(getProcAddr(\"glIsProgramPipeline\"))\n\tgpIsProgramPipelineEXT = uintptr(getProcAddr(\"glIsProgramPipelineEXT\"))\n\tgpIsQuery = uintptr(getProcAddr(\"glIsQuery\"))\n\tif gpIsQuery == 0 {\n\t\treturn errors.New(\"glIsQuery\")\n\t}\n\tgpIsQueryARB = uintptr(getProcAddr(\"glIsQueryARB\"))\n\tgpIsRenderbuffer = uintptr(getProcAddr(\"glIsRenderbuffer\"))\n\tgpIsRenderbufferEXT = uintptr(getProcAddr(\"glIsRenderbufferEXT\"))\n\tgpIsSampler = uintptr(getProcAddr(\"glIsSampler\"))\n\tgpIsSemaphoreEXT = uintptr(getProcAddr(\"glIsSemaphoreEXT\"))\n\tgpIsShader = uintptr(getProcAddr(\"glIsShader\"))\n\tif gpIsShader == 0 {\n\t\treturn errors.New(\"glIsShader\")\n\t}\n\tgpIsStateNV = uintptr(getProcAddr(\"glIsStateNV\"))\n\tgpIsSync = uintptr(getProcAddr(\"glIsSync\"))\n\tgpIsTexture = uintptr(getProcAddr(\"glIsTexture\"))\n\tif gpIsTexture == 0 {\n\t\treturn errors.New(\"glIsTexture\")\n\t}\n\tgpIsTextureEXT = uintptr(getProcAddr(\"glIsTextureEXT\"))\n\tgpIsTextureHandleResidentARB = uintptr(getProcAddr(\"glIsTextureHandleResidentARB\"))\n\tgpIsTextureHandleResidentNV = uintptr(getProcAddr(\"glIsTextureHandleResidentNV\"))\n\tgpIsTransformFeedback = uintptr(getProcAddr(\"glIsTransformFeedback\"))\n\tgpIsTransformFeedbackNV = uintptr(getProcAddr(\"glIsTransformFeedbackNV\"))\n\tgpIsVariantEnabledEXT = uintptr(getProcAddr(\"glIsVariantEnabledEXT\"))\n\tgpIsVertexArray = uintptr(getProcAddr(\"glIsVertexArray\"))\n\tgpIsVertexArrayAPPLE = uintptr(getProcAddr(\"glIsVertexArrayAPPLE\"))\n\tgpIsVertexAttribEnabledAPPLE = uintptr(getProcAddr(\"glIsVertexAttribEnabledAPPLE\"))\n\tgpLGPUCopyImageSubDataNVX = uintptr(getProcAddr(\"glLGPUCopyImageSubDataNVX\"))\n\tgpLGPUInterlockNVX = uintptr(getProcAddr(\"glLGPUInterlockNVX\"))\n\tgpLGPUNamedBufferSubDataNVX = uintptr(getProcAddr(\"glLGPUNamedBufferSubDataNVX\"))\n\tgpLabelObjectEXT = uintptr(getProcAddr(\"glLabelObjectEXT\"))\n\tgpLightEnviSGIX = uintptr(getProcAddr(\"glLightEnviSGIX\"))\n\tgpLightModelf = uintptr(getProcAddr(\"glLightModelf\"))\n\tif gpLightModelf == 0 {\n\t\treturn errors.New(\"glLightModelf\")\n\t}\n\tgpLightModelfv = uintptr(getProcAddr(\"glLightModelfv\"))\n\tif gpLightModelfv == 0 {\n\t\treturn errors.New(\"glLightModelfv\")\n\t}\n\tgpLightModeli = uintptr(getProcAddr(\"glLightModeli\"))\n\tif gpLightModeli == 0 {\n\t\treturn errors.New(\"glLightModeli\")\n\t}\n\tgpLightModeliv = uintptr(getProcAddr(\"glLightModeliv\"))\n\tif gpLightModeliv == 0 {\n\t\treturn errors.New(\"glLightModeliv\")\n\t}\n\tgpLightModelxOES = uintptr(getProcAddr(\"glLightModelxOES\"))\n\tgpLightModelxvOES = uintptr(getProcAddr(\"glLightModelxvOES\"))\n\tgpLightf = uintptr(getProcAddr(\"glLightf\"))\n\tif gpLightf == 0 {\n\t\treturn errors.New(\"glLightf\")\n\t}\n\tgpLightfv = uintptr(getProcAddr(\"glLightfv\"))\n\tif gpLightfv == 0 {\n\t\treturn errors.New(\"glLightfv\")\n\t}\n\tgpLighti = uintptr(getProcAddr(\"glLighti\"))\n\tif gpLighti == 0 {\n\t\treturn errors.New(\"glLighti\")\n\t}\n\tgpLightiv = uintptr(getProcAddr(\"glLightiv\"))\n\tif gpLightiv == 0 {\n\t\treturn errors.New(\"glLightiv\")\n\t}\n\tgpLightxOES = uintptr(getProcAddr(\"glLightxOES\"))\n\tgpLightxvOES = uintptr(getProcAddr(\"glLightxvOES\"))\n\tgpLineStipple = uintptr(getProcAddr(\"glLineStipple\"))\n\tif gpLineStipple == 0 {\n\t\treturn errors.New(\"glLineStipple\")\n\t}\n\tgpLineWidth = uintptr(getProcAddr(\"glLineWidth\"))\n\tif gpLineWidth == 0 {\n\t\treturn errors.New(\"glLineWidth\")\n\t}\n\tgpLineWidthxOES = uintptr(getProcAddr(\"glLineWidthxOES\"))\n\tgpLinkProgram = uintptr(getProcAddr(\"glLinkProgram\"))\n\tif gpLinkProgram == 0 {\n\t\treturn errors.New(\"glLinkProgram\")\n\t}\n\tgpLinkProgramARB = uintptr(getProcAddr(\"glLinkProgramARB\"))\n\tgpListBase = uintptr(getProcAddr(\"glListBase\"))\n\tif gpListBase == 0 {\n\t\treturn errors.New(\"glListBase\")\n\t}\n\tgpListDrawCommandsStatesClientNV = uintptr(getProcAddr(\"glListDrawCommandsStatesClientNV\"))\n\tgpListParameterfSGIX = uintptr(getProcAddr(\"glListParameterfSGIX\"))\n\tgpListParameterfvSGIX = uintptr(getProcAddr(\"glListParameterfvSGIX\"))\n\tgpListParameteriSGIX = uintptr(getProcAddr(\"glListParameteriSGIX\"))\n\tgpListParameterivSGIX = uintptr(getProcAddr(\"glListParameterivSGIX\"))\n\tgpLoadIdentity = uintptr(getProcAddr(\"glLoadIdentity\"))\n\tif gpLoadIdentity == 0 {\n\t\treturn errors.New(\"glLoadIdentity\")\n\t}\n\tgpLoadIdentityDeformationMapSGIX = uintptr(getProcAddr(\"glLoadIdentityDeformationMapSGIX\"))\n\tgpLoadMatrixd = uintptr(getProcAddr(\"glLoadMatrixd\"))\n\tif gpLoadMatrixd == 0 {\n\t\treturn errors.New(\"glLoadMatrixd\")\n\t}\n\tgpLoadMatrixf = uintptr(getProcAddr(\"glLoadMatrixf\"))\n\tif gpLoadMatrixf == 0 {\n\t\treturn errors.New(\"glLoadMatrixf\")\n\t}\n\tgpLoadMatrixxOES = uintptr(getProcAddr(\"glLoadMatrixxOES\"))\n\tgpLoadName = uintptr(getProcAddr(\"glLoadName\"))\n\tif gpLoadName == 0 {\n\t\treturn errors.New(\"glLoadName\")\n\t}\n\tgpLoadProgramNV = uintptr(getProcAddr(\"glLoadProgramNV\"))\n\tgpLoadTransposeMatrixd = uintptr(getProcAddr(\"glLoadTransposeMatrixd\"))\n\tif gpLoadTransposeMatrixd == 0 {\n\t\treturn errors.New(\"glLoadTransposeMatrixd\")\n\t}\n\tgpLoadTransposeMatrixdARB = uintptr(getProcAddr(\"glLoadTransposeMatrixdARB\"))\n\tgpLoadTransposeMatrixf = uintptr(getProcAddr(\"glLoadTransposeMatrixf\"))\n\tif gpLoadTransposeMatrixf == 0 {\n\t\treturn errors.New(\"glLoadTransposeMatrixf\")\n\t}\n\tgpLoadTransposeMatrixfARB = uintptr(getProcAddr(\"glLoadTransposeMatrixfARB\"))\n\tgpLoadTransposeMatrixxOES = uintptr(getProcAddr(\"glLoadTransposeMatrixxOES\"))\n\tgpLockArraysEXT = uintptr(getProcAddr(\"glLockArraysEXT\"))\n\tgpLogicOp = uintptr(getProcAddr(\"glLogicOp\"))\n\tif gpLogicOp == 0 {\n\t\treturn errors.New(\"glLogicOp\")\n\t}\n\tgpMakeBufferNonResidentNV = uintptr(getProcAddr(\"glMakeBufferNonResidentNV\"))\n\tgpMakeBufferResidentNV = uintptr(getProcAddr(\"glMakeBufferResidentNV\"))\n\tgpMakeImageHandleNonResidentARB = uintptr(getProcAddr(\"glMakeImageHandleNonResidentARB\"))\n\tgpMakeImageHandleNonResidentNV = uintptr(getProcAddr(\"glMakeImageHandleNonResidentNV\"))\n\tgpMakeImageHandleResidentARB = uintptr(getProcAddr(\"glMakeImageHandleResidentARB\"))\n\tgpMakeImageHandleResidentNV = uintptr(getProcAddr(\"glMakeImageHandleResidentNV\"))\n\tgpMakeNamedBufferNonResidentNV = uintptr(getProcAddr(\"glMakeNamedBufferNonResidentNV\"))\n\tgpMakeNamedBufferResidentNV = uintptr(getProcAddr(\"glMakeNamedBufferResidentNV\"))\n\tgpMakeTextureHandleNonResidentARB = uintptr(getProcAddr(\"glMakeTextureHandleNonResidentARB\"))\n\tgpMakeTextureHandleNonResidentNV = uintptr(getProcAddr(\"glMakeTextureHandleNonResidentNV\"))\n\tgpMakeTextureHandleResidentARB = uintptr(getProcAddr(\"glMakeTextureHandleResidentARB\"))\n\tgpMakeTextureHandleResidentNV = uintptr(getProcAddr(\"glMakeTextureHandleResidentNV\"))\n\tgpMap1d = uintptr(getProcAddr(\"glMap1d\"))\n\tif gpMap1d == 0 {\n\t\treturn errors.New(\"glMap1d\")\n\t}\n\tgpMap1f = uintptr(getProcAddr(\"glMap1f\"))\n\tif gpMap1f == 0 {\n\t\treturn errors.New(\"glMap1f\")\n\t}\n\tgpMap1xOES = uintptr(getProcAddr(\"glMap1xOES\"))\n\tgpMap2d = uintptr(getProcAddr(\"glMap2d\"))\n\tif gpMap2d == 0 {\n\t\treturn errors.New(\"glMap2d\")\n\t}\n\tgpMap2f = uintptr(getProcAddr(\"glMap2f\"))\n\tif gpMap2f == 0 {\n\t\treturn errors.New(\"glMap2f\")\n\t}\n\tgpMap2xOES = uintptr(getProcAddr(\"glMap2xOES\"))\n\tgpMapBuffer = uintptr(getProcAddr(\"glMapBuffer\"))\n\tif gpMapBuffer == 0 {\n\t\treturn errors.New(\"glMapBuffer\")\n\t}\n\tgpMapBufferARB = uintptr(getProcAddr(\"glMapBufferARB\"))\n\tgpMapBufferRange = uintptr(getProcAddr(\"glMapBufferRange\"))\n\tgpMapControlPointsNV = uintptr(getProcAddr(\"glMapControlPointsNV\"))\n\tgpMapGrid1d = uintptr(getProcAddr(\"glMapGrid1d\"))\n\tif gpMapGrid1d == 0 {\n\t\treturn errors.New(\"glMapGrid1d\")\n\t}\n\tgpMapGrid1f = uintptr(getProcAddr(\"glMapGrid1f\"))\n\tif gpMapGrid1f == 0 {\n\t\treturn errors.New(\"glMapGrid1f\")\n\t}\n\tgpMapGrid1xOES = uintptr(getProcAddr(\"glMapGrid1xOES\"))\n\tgpMapGrid2d = uintptr(getProcAddr(\"glMapGrid2d\"))\n\tif gpMapGrid2d == 0 {\n\t\treturn errors.New(\"glMapGrid2d\")\n\t}\n\tgpMapGrid2f = uintptr(getProcAddr(\"glMapGrid2f\"))\n\tif gpMapGrid2f == 0 {\n\t\treturn errors.New(\"glMapGrid2f\")\n\t}\n\tgpMapGrid2xOES = uintptr(getProcAddr(\"glMapGrid2xOES\"))\n\tgpMapNamedBuffer = uintptr(getProcAddr(\"glMapNamedBuffer\"))\n\tgpMapNamedBufferEXT = uintptr(getProcAddr(\"glMapNamedBufferEXT\"))\n\tgpMapNamedBufferRange = uintptr(getProcAddr(\"glMapNamedBufferRange\"))\n\tgpMapNamedBufferRangeEXT = uintptr(getProcAddr(\"glMapNamedBufferRangeEXT\"))\n\tgpMapObjectBufferATI = uintptr(getProcAddr(\"glMapObjectBufferATI\"))\n\tgpMapParameterfvNV = uintptr(getProcAddr(\"glMapParameterfvNV\"))\n\tgpMapParameterivNV = uintptr(getProcAddr(\"glMapParameterivNV\"))\n\tgpMapTexture2DINTEL = uintptr(getProcAddr(\"glMapTexture2DINTEL\"))\n\tgpMapVertexAttrib1dAPPLE = uintptr(getProcAddr(\"glMapVertexAttrib1dAPPLE\"))\n\tgpMapVertexAttrib1fAPPLE = uintptr(getProcAddr(\"glMapVertexAttrib1fAPPLE\"))\n\tgpMapVertexAttrib2dAPPLE = uintptr(getProcAddr(\"glMapVertexAttrib2dAPPLE\"))\n\tgpMapVertexAttrib2fAPPLE = uintptr(getProcAddr(\"glMapVertexAttrib2fAPPLE\"))\n\tgpMaterialf = uintptr(getProcAddr(\"glMaterialf\"))\n\tif gpMaterialf == 0 {\n\t\treturn errors.New(\"glMaterialf\")\n\t}\n\tgpMaterialfv = uintptr(getProcAddr(\"glMaterialfv\"))\n\tif gpMaterialfv == 0 {\n\t\treturn errors.New(\"glMaterialfv\")\n\t}\n\tgpMateriali = uintptr(getProcAddr(\"glMateriali\"))\n\tif gpMateriali == 0 {\n\t\treturn errors.New(\"glMateriali\")\n\t}\n\tgpMaterialiv = uintptr(getProcAddr(\"glMaterialiv\"))\n\tif gpMaterialiv == 0 {\n\t\treturn errors.New(\"glMaterialiv\")\n\t}\n\tgpMaterialxOES = uintptr(getProcAddr(\"glMaterialxOES\"))\n\tgpMaterialxvOES = uintptr(getProcAddr(\"glMaterialxvOES\"))\n\tgpMatrixFrustumEXT = uintptr(getProcAddr(\"glMatrixFrustumEXT\"))\n\tgpMatrixIndexPointerARB = uintptr(getProcAddr(\"glMatrixIndexPointerARB\"))\n\tgpMatrixIndexubvARB = uintptr(getProcAddr(\"glMatrixIndexubvARB\"))\n\tgpMatrixIndexuivARB = uintptr(getProcAddr(\"glMatrixIndexuivARB\"))\n\tgpMatrixIndexusvARB = uintptr(getProcAddr(\"glMatrixIndexusvARB\"))\n\tgpMatrixLoad3x2fNV = uintptr(getProcAddr(\"glMatrixLoad3x2fNV\"))\n\tgpMatrixLoad3x3fNV = uintptr(getProcAddr(\"glMatrixLoad3x3fNV\"))\n\tgpMatrixLoadIdentityEXT = uintptr(getProcAddr(\"glMatrixLoadIdentityEXT\"))\n\tgpMatrixLoadTranspose3x3fNV = uintptr(getProcAddr(\"glMatrixLoadTranspose3x3fNV\"))\n\tgpMatrixLoadTransposedEXT = uintptr(getProcAddr(\"glMatrixLoadTransposedEXT\"))\n\tgpMatrixLoadTransposefEXT = uintptr(getProcAddr(\"glMatrixLoadTransposefEXT\"))\n\tgpMatrixLoaddEXT = uintptr(getProcAddr(\"glMatrixLoaddEXT\"))\n\tgpMatrixLoadfEXT = uintptr(getProcAddr(\"glMatrixLoadfEXT\"))\n\tgpMatrixMode = uintptr(getProcAddr(\"glMatrixMode\"))\n\tif gpMatrixMode == 0 {\n\t\treturn errors.New(\"glMatrixMode\")\n\t}\n\tgpMatrixMult3x2fNV = uintptr(getProcAddr(\"glMatrixMult3x2fNV\"))\n\tgpMatrixMult3x3fNV = uintptr(getProcAddr(\"glMatrixMult3x3fNV\"))\n\tgpMatrixMultTranspose3x3fNV = uintptr(getProcAddr(\"glMatrixMultTranspose3x3fNV\"))\n\tgpMatrixMultTransposedEXT = uintptr(getProcAddr(\"glMatrixMultTransposedEXT\"))\n\tgpMatrixMultTransposefEXT = uintptr(getProcAddr(\"glMatrixMultTransposefEXT\"))\n\tgpMatrixMultdEXT = uintptr(getProcAddr(\"glMatrixMultdEXT\"))\n\tgpMatrixMultfEXT = uintptr(getProcAddr(\"glMatrixMultfEXT\"))\n\tgpMatrixOrthoEXT = uintptr(getProcAddr(\"glMatrixOrthoEXT\"))\n\tgpMatrixPopEXT = uintptr(getProcAddr(\"glMatrixPopEXT\"))\n\tgpMatrixPushEXT = uintptr(getProcAddr(\"glMatrixPushEXT\"))\n\tgpMatrixRotatedEXT = uintptr(getProcAddr(\"glMatrixRotatedEXT\"))\n\tgpMatrixRotatefEXT = uintptr(getProcAddr(\"glMatrixRotatefEXT\"))\n\tgpMatrixScaledEXT = uintptr(getProcAddr(\"glMatrixScaledEXT\"))\n\tgpMatrixScalefEXT = uintptr(getProcAddr(\"glMatrixScalefEXT\"))\n\tgpMatrixTranslatedEXT = uintptr(getProcAddr(\"glMatrixTranslatedEXT\"))\n\tgpMatrixTranslatefEXT = uintptr(getProcAddr(\"glMatrixTranslatefEXT\"))\n\tgpMaxShaderCompilerThreadsARB = uintptr(getProcAddr(\"glMaxShaderCompilerThreadsARB\"))\n\tgpMaxShaderCompilerThreadsKHR = uintptr(getProcAddr(\"glMaxShaderCompilerThreadsKHR\"))\n\tgpMemoryBarrier = uintptr(getProcAddr(\"glMemoryBarrier\"))\n\tgpMemoryBarrierByRegion = uintptr(getProcAddr(\"glMemoryBarrierByRegion\"))\n\tgpMemoryBarrierEXT = uintptr(getProcAddr(\"glMemoryBarrierEXT\"))\n\tgpMemoryObjectParameterivEXT = uintptr(getProcAddr(\"glMemoryObjectParameterivEXT\"))\n\tgpMinSampleShadingARB = uintptr(getProcAddr(\"glMinSampleShadingARB\"))\n\tgpMinmaxEXT = uintptr(getProcAddr(\"glMinmaxEXT\"))\n\tgpMultMatrixd = uintptr(getProcAddr(\"glMultMatrixd\"))\n\tif gpMultMatrixd == 0 {\n\t\treturn errors.New(\"glMultMatrixd\")\n\t}\n\tgpMultMatrixf = uintptr(getProcAddr(\"glMultMatrixf\"))\n\tif gpMultMatrixf == 0 {\n\t\treturn errors.New(\"glMultMatrixf\")\n\t}\n\tgpMultMatrixxOES = uintptr(getProcAddr(\"glMultMatrixxOES\"))\n\tgpMultTransposeMatrixd = uintptr(getProcAddr(\"glMultTransposeMatrixd\"))\n\tif gpMultTransposeMatrixd == 0 {\n\t\treturn errors.New(\"glMultTransposeMatrixd\")\n\t}\n\tgpMultTransposeMatrixdARB = uintptr(getProcAddr(\"glMultTransposeMatrixdARB\"))\n\tgpMultTransposeMatrixf = uintptr(getProcAddr(\"glMultTransposeMatrixf\"))\n\tif gpMultTransposeMatrixf == 0 {\n\t\treturn errors.New(\"glMultTransposeMatrixf\")\n\t}\n\tgpMultTransposeMatrixfARB = uintptr(getProcAddr(\"glMultTransposeMatrixfARB\"))\n\tgpMultTransposeMatrixxOES = uintptr(getProcAddr(\"glMultTransposeMatrixxOES\"))\n\tgpMultiDrawArrays = uintptr(getProcAddr(\"glMultiDrawArrays\"))\n\tif gpMultiDrawArrays == 0 {\n\t\treturn errors.New(\"glMultiDrawArrays\")\n\t}\n\tgpMultiDrawArraysEXT = uintptr(getProcAddr(\"glMultiDrawArraysEXT\"))\n\tgpMultiDrawArraysIndirect = uintptr(getProcAddr(\"glMultiDrawArraysIndirect\"))\n\tgpMultiDrawArraysIndirectAMD = uintptr(getProcAddr(\"glMultiDrawArraysIndirectAMD\"))\n\tgpMultiDrawArraysIndirectBindlessCountNV = uintptr(getProcAddr(\"glMultiDrawArraysIndirectBindlessCountNV\"))\n\tgpMultiDrawArraysIndirectBindlessNV = uintptr(getProcAddr(\"glMultiDrawArraysIndirectBindlessNV\"))\n\tgpMultiDrawArraysIndirectCountARB = uintptr(getProcAddr(\"glMultiDrawArraysIndirectCountARB\"))\n\tgpMultiDrawElementArrayAPPLE = uintptr(getProcAddr(\"glMultiDrawElementArrayAPPLE\"))\n\tgpMultiDrawElements = uintptr(getProcAddr(\"glMultiDrawElements\"))\n\tif gpMultiDrawElements == 0 {\n\t\treturn errors.New(\"glMultiDrawElements\")\n\t}\n\tgpMultiDrawElementsBaseVertex = uintptr(getProcAddr(\"glMultiDrawElementsBaseVertex\"))\n\tgpMultiDrawElementsEXT = uintptr(getProcAddr(\"glMultiDrawElementsEXT\"))\n\tgpMultiDrawElementsIndirect = uintptr(getProcAddr(\"glMultiDrawElementsIndirect\"))\n\tgpMultiDrawElementsIndirectAMD = uintptr(getProcAddr(\"glMultiDrawElementsIndirectAMD\"))\n\tgpMultiDrawElementsIndirectBindlessCountNV = uintptr(getProcAddr(\"glMultiDrawElementsIndirectBindlessCountNV\"))\n\tgpMultiDrawElementsIndirectBindlessNV = uintptr(getProcAddr(\"glMultiDrawElementsIndirectBindlessNV\"))\n\tgpMultiDrawElementsIndirectCountARB = uintptr(getProcAddr(\"glMultiDrawElementsIndirectCountARB\"))\n\tgpMultiDrawRangeElementArrayAPPLE = uintptr(getProcAddr(\"glMultiDrawRangeElementArrayAPPLE\"))\n\tgpMultiModeDrawArraysIBM = uintptr(getProcAddr(\"glMultiModeDrawArraysIBM\"))\n\tgpMultiModeDrawElementsIBM = uintptr(getProcAddr(\"glMultiModeDrawElementsIBM\"))\n\tgpMultiTexBufferEXT = uintptr(getProcAddr(\"glMultiTexBufferEXT\"))\n\tgpMultiTexCoord1bOES = uintptr(getProcAddr(\"glMultiTexCoord1bOES\"))\n\tgpMultiTexCoord1bvOES = uintptr(getProcAddr(\"glMultiTexCoord1bvOES\"))\n\tgpMultiTexCoord1d = uintptr(getProcAddr(\"glMultiTexCoord1d\"))\n\tif gpMultiTexCoord1d == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1d\")\n\t}\n\tgpMultiTexCoord1dARB = uintptr(getProcAddr(\"glMultiTexCoord1dARB\"))\n\tgpMultiTexCoord1dv = uintptr(getProcAddr(\"glMultiTexCoord1dv\"))\n\tif gpMultiTexCoord1dv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1dv\")\n\t}\n\tgpMultiTexCoord1dvARB = uintptr(getProcAddr(\"glMultiTexCoord1dvARB\"))\n\tgpMultiTexCoord1f = uintptr(getProcAddr(\"glMultiTexCoord1f\"))\n\tif gpMultiTexCoord1f == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1f\")\n\t}\n\tgpMultiTexCoord1fARB = uintptr(getProcAddr(\"glMultiTexCoord1fARB\"))\n\tgpMultiTexCoord1fv = uintptr(getProcAddr(\"glMultiTexCoord1fv\"))\n\tif gpMultiTexCoord1fv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1fv\")\n\t}\n\tgpMultiTexCoord1fvARB = uintptr(getProcAddr(\"glMultiTexCoord1fvARB\"))\n\tgpMultiTexCoord1hNV = uintptr(getProcAddr(\"glMultiTexCoord1hNV\"))\n\tgpMultiTexCoord1hvNV = uintptr(getProcAddr(\"glMultiTexCoord1hvNV\"))\n\tgpMultiTexCoord1i = uintptr(getProcAddr(\"glMultiTexCoord1i\"))\n\tif gpMultiTexCoord1i == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1i\")\n\t}\n\tgpMultiTexCoord1iARB = uintptr(getProcAddr(\"glMultiTexCoord1iARB\"))\n\tgpMultiTexCoord1iv = uintptr(getProcAddr(\"glMultiTexCoord1iv\"))\n\tif gpMultiTexCoord1iv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1iv\")\n\t}\n\tgpMultiTexCoord1ivARB = uintptr(getProcAddr(\"glMultiTexCoord1ivARB\"))\n\tgpMultiTexCoord1s = uintptr(getProcAddr(\"glMultiTexCoord1s\"))\n\tif gpMultiTexCoord1s == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1s\")\n\t}\n\tgpMultiTexCoord1sARB = uintptr(getProcAddr(\"glMultiTexCoord1sARB\"))\n\tgpMultiTexCoord1sv = uintptr(getProcAddr(\"glMultiTexCoord1sv\"))\n\tif gpMultiTexCoord1sv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord1sv\")\n\t}\n\tgpMultiTexCoord1svARB = uintptr(getProcAddr(\"glMultiTexCoord1svARB\"))\n\tgpMultiTexCoord1xOES = uintptr(getProcAddr(\"glMultiTexCoord1xOES\"))\n\tgpMultiTexCoord1xvOES = uintptr(getProcAddr(\"glMultiTexCoord1xvOES\"))\n\tgpMultiTexCoord2bOES = uintptr(getProcAddr(\"glMultiTexCoord2bOES\"))\n\tgpMultiTexCoord2bvOES = uintptr(getProcAddr(\"glMultiTexCoord2bvOES\"))\n\tgpMultiTexCoord2d = uintptr(getProcAddr(\"glMultiTexCoord2d\"))\n\tif gpMultiTexCoord2d == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2d\")\n\t}\n\tgpMultiTexCoord2dARB = uintptr(getProcAddr(\"glMultiTexCoord2dARB\"))\n\tgpMultiTexCoord2dv = uintptr(getProcAddr(\"glMultiTexCoord2dv\"))\n\tif gpMultiTexCoord2dv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2dv\")\n\t}\n\tgpMultiTexCoord2dvARB = uintptr(getProcAddr(\"glMultiTexCoord2dvARB\"))\n\tgpMultiTexCoord2f = uintptr(getProcAddr(\"glMultiTexCoord2f\"))\n\tif gpMultiTexCoord2f == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2f\")\n\t}\n\tgpMultiTexCoord2fARB = uintptr(getProcAddr(\"glMultiTexCoord2fARB\"))\n\tgpMultiTexCoord2fv = uintptr(getProcAddr(\"glMultiTexCoord2fv\"))\n\tif gpMultiTexCoord2fv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2fv\")\n\t}\n\tgpMultiTexCoord2fvARB = uintptr(getProcAddr(\"glMultiTexCoord2fvARB\"))\n\tgpMultiTexCoord2hNV = uintptr(getProcAddr(\"glMultiTexCoord2hNV\"))\n\tgpMultiTexCoord2hvNV = uintptr(getProcAddr(\"glMultiTexCoord2hvNV\"))\n\tgpMultiTexCoord2i = uintptr(getProcAddr(\"glMultiTexCoord2i\"))\n\tif gpMultiTexCoord2i == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2i\")\n\t}\n\tgpMultiTexCoord2iARB = uintptr(getProcAddr(\"glMultiTexCoord2iARB\"))\n\tgpMultiTexCoord2iv = uintptr(getProcAddr(\"glMultiTexCoord2iv\"))\n\tif gpMultiTexCoord2iv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2iv\")\n\t}\n\tgpMultiTexCoord2ivARB = uintptr(getProcAddr(\"glMultiTexCoord2ivARB\"))\n\tgpMultiTexCoord2s = uintptr(getProcAddr(\"glMultiTexCoord2s\"))\n\tif gpMultiTexCoord2s == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2s\")\n\t}\n\tgpMultiTexCoord2sARB = uintptr(getProcAddr(\"glMultiTexCoord2sARB\"))\n\tgpMultiTexCoord2sv = uintptr(getProcAddr(\"glMultiTexCoord2sv\"))\n\tif gpMultiTexCoord2sv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord2sv\")\n\t}\n\tgpMultiTexCoord2svARB = uintptr(getProcAddr(\"glMultiTexCoord2svARB\"))\n\tgpMultiTexCoord2xOES = uintptr(getProcAddr(\"glMultiTexCoord2xOES\"))\n\tgpMultiTexCoord2xvOES = uintptr(getProcAddr(\"glMultiTexCoord2xvOES\"))\n\tgpMultiTexCoord3bOES = uintptr(getProcAddr(\"glMultiTexCoord3bOES\"))\n\tgpMultiTexCoord3bvOES = uintptr(getProcAddr(\"glMultiTexCoord3bvOES\"))\n\tgpMultiTexCoord3d = uintptr(getProcAddr(\"glMultiTexCoord3d\"))\n\tif gpMultiTexCoord3d == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3d\")\n\t}\n\tgpMultiTexCoord3dARB = uintptr(getProcAddr(\"glMultiTexCoord3dARB\"))\n\tgpMultiTexCoord3dv = uintptr(getProcAddr(\"glMultiTexCoord3dv\"))\n\tif gpMultiTexCoord3dv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3dv\")\n\t}\n\tgpMultiTexCoord3dvARB = uintptr(getProcAddr(\"glMultiTexCoord3dvARB\"))\n\tgpMultiTexCoord3f = uintptr(getProcAddr(\"glMultiTexCoord3f\"))\n\tif gpMultiTexCoord3f == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3f\")\n\t}\n\tgpMultiTexCoord3fARB = uintptr(getProcAddr(\"glMultiTexCoord3fARB\"))\n\tgpMultiTexCoord3fv = uintptr(getProcAddr(\"glMultiTexCoord3fv\"))\n\tif gpMultiTexCoord3fv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3fv\")\n\t}\n\tgpMultiTexCoord3fvARB = uintptr(getProcAddr(\"glMultiTexCoord3fvARB\"))\n\tgpMultiTexCoord3hNV = uintptr(getProcAddr(\"glMultiTexCoord3hNV\"))\n\tgpMultiTexCoord3hvNV = uintptr(getProcAddr(\"glMultiTexCoord3hvNV\"))\n\tgpMultiTexCoord3i = uintptr(getProcAddr(\"glMultiTexCoord3i\"))\n\tif gpMultiTexCoord3i == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3i\")\n\t}\n\tgpMultiTexCoord3iARB = uintptr(getProcAddr(\"glMultiTexCoord3iARB\"))\n\tgpMultiTexCoord3iv = uintptr(getProcAddr(\"glMultiTexCoord3iv\"))\n\tif gpMultiTexCoord3iv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3iv\")\n\t}\n\tgpMultiTexCoord3ivARB = uintptr(getProcAddr(\"glMultiTexCoord3ivARB\"))\n\tgpMultiTexCoord3s = uintptr(getProcAddr(\"glMultiTexCoord3s\"))\n\tif gpMultiTexCoord3s == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3s\")\n\t}\n\tgpMultiTexCoord3sARB = uintptr(getProcAddr(\"glMultiTexCoord3sARB\"))\n\tgpMultiTexCoord3sv = uintptr(getProcAddr(\"glMultiTexCoord3sv\"))\n\tif gpMultiTexCoord3sv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord3sv\")\n\t}\n\tgpMultiTexCoord3svARB = uintptr(getProcAddr(\"glMultiTexCoord3svARB\"))\n\tgpMultiTexCoord3xOES = uintptr(getProcAddr(\"glMultiTexCoord3xOES\"))\n\tgpMultiTexCoord3xvOES = uintptr(getProcAddr(\"glMultiTexCoord3xvOES\"))\n\tgpMultiTexCoord4bOES = uintptr(getProcAddr(\"glMultiTexCoord4bOES\"))\n\tgpMultiTexCoord4bvOES = uintptr(getProcAddr(\"glMultiTexCoord4bvOES\"))\n\tgpMultiTexCoord4d = uintptr(getProcAddr(\"glMultiTexCoord4d\"))\n\tif gpMultiTexCoord4d == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4d\")\n\t}\n\tgpMultiTexCoord4dARB = uintptr(getProcAddr(\"glMultiTexCoord4dARB\"))\n\tgpMultiTexCoord4dv = uintptr(getProcAddr(\"glMultiTexCoord4dv\"))\n\tif gpMultiTexCoord4dv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4dv\")\n\t}\n\tgpMultiTexCoord4dvARB = uintptr(getProcAddr(\"glMultiTexCoord4dvARB\"))\n\tgpMultiTexCoord4f = uintptr(getProcAddr(\"glMultiTexCoord4f\"))\n\tif gpMultiTexCoord4f == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4f\")\n\t}\n\tgpMultiTexCoord4fARB = uintptr(getProcAddr(\"glMultiTexCoord4fARB\"))\n\tgpMultiTexCoord4fv = uintptr(getProcAddr(\"glMultiTexCoord4fv\"))\n\tif gpMultiTexCoord4fv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4fv\")\n\t}\n\tgpMultiTexCoord4fvARB = uintptr(getProcAddr(\"glMultiTexCoord4fvARB\"))\n\tgpMultiTexCoord4hNV = uintptr(getProcAddr(\"glMultiTexCoord4hNV\"))\n\tgpMultiTexCoord4hvNV = uintptr(getProcAddr(\"glMultiTexCoord4hvNV\"))\n\tgpMultiTexCoord4i = uintptr(getProcAddr(\"glMultiTexCoord4i\"))\n\tif gpMultiTexCoord4i == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4i\")\n\t}\n\tgpMultiTexCoord4iARB = uintptr(getProcAddr(\"glMultiTexCoord4iARB\"))\n\tgpMultiTexCoord4iv = uintptr(getProcAddr(\"glMultiTexCoord4iv\"))\n\tif gpMultiTexCoord4iv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4iv\")\n\t}\n\tgpMultiTexCoord4ivARB = uintptr(getProcAddr(\"glMultiTexCoord4ivARB\"))\n\tgpMultiTexCoord4s = uintptr(getProcAddr(\"glMultiTexCoord4s\"))\n\tif gpMultiTexCoord4s == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4s\")\n\t}\n\tgpMultiTexCoord4sARB = uintptr(getProcAddr(\"glMultiTexCoord4sARB\"))\n\tgpMultiTexCoord4sv = uintptr(getProcAddr(\"glMultiTexCoord4sv\"))\n\tif gpMultiTexCoord4sv == 0 {\n\t\treturn errors.New(\"glMultiTexCoord4sv\")\n\t}\n\tgpMultiTexCoord4svARB = uintptr(getProcAddr(\"glMultiTexCoord4svARB\"))\n\tgpMultiTexCoord4xOES = uintptr(getProcAddr(\"glMultiTexCoord4xOES\"))\n\tgpMultiTexCoord4xvOES = uintptr(getProcAddr(\"glMultiTexCoord4xvOES\"))\n\tgpMultiTexCoordPointerEXT = uintptr(getProcAddr(\"glMultiTexCoordPointerEXT\"))\n\tgpMultiTexEnvfEXT = uintptr(getProcAddr(\"glMultiTexEnvfEXT\"))\n\tgpMultiTexEnvfvEXT = uintptr(getProcAddr(\"glMultiTexEnvfvEXT\"))\n\tgpMultiTexEnviEXT = uintptr(getProcAddr(\"glMultiTexEnviEXT\"))\n\tgpMultiTexEnvivEXT = uintptr(getProcAddr(\"glMultiTexEnvivEXT\"))\n\tgpMultiTexGendEXT = uintptr(getProcAddr(\"glMultiTexGendEXT\"))\n\tgpMultiTexGendvEXT = uintptr(getProcAddr(\"glMultiTexGendvEXT\"))\n\tgpMultiTexGenfEXT = uintptr(getProcAddr(\"glMultiTexGenfEXT\"))\n\tgpMultiTexGenfvEXT = uintptr(getProcAddr(\"glMultiTexGenfvEXT\"))\n\tgpMultiTexGeniEXT = uintptr(getProcAddr(\"glMultiTexGeniEXT\"))\n\tgpMultiTexGenivEXT = uintptr(getProcAddr(\"glMultiTexGenivEXT\"))\n\tgpMultiTexImage1DEXT = uintptr(getProcAddr(\"glMultiTexImage1DEXT\"))\n\tgpMultiTexImage2DEXT = uintptr(getProcAddr(\"glMultiTexImage2DEXT\"))\n\tgpMultiTexImage3DEXT = uintptr(getProcAddr(\"glMultiTexImage3DEXT\"))\n\tgpMultiTexParameterIivEXT = uintptr(getProcAddr(\"glMultiTexParameterIivEXT\"))\n\tgpMultiTexParameterIuivEXT = uintptr(getProcAddr(\"glMultiTexParameterIuivEXT\"))\n\tgpMultiTexParameterfEXT = uintptr(getProcAddr(\"glMultiTexParameterfEXT\"))\n\tgpMultiTexParameterfvEXT = uintptr(getProcAddr(\"glMultiTexParameterfvEXT\"))\n\tgpMultiTexParameteriEXT = uintptr(getProcAddr(\"glMultiTexParameteriEXT\"))\n\tgpMultiTexParameterivEXT = uintptr(getProcAddr(\"glMultiTexParameterivEXT\"))\n\tgpMultiTexRenderbufferEXT = uintptr(getProcAddr(\"glMultiTexRenderbufferEXT\"))\n\tgpMultiTexSubImage1DEXT = uintptr(getProcAddr(\"glMultiTexSubImage1DEXT\"))\n\tgpMultiTexSubImage2DEXT = uintptr(getProcAddr(\"glMultiTexSubImage2DEXT\"))\n\tgpMultiTexSubImage3DEXT = uintptr(getProcAddr(\"glMultiTexSubImage3DEXT\"))\n\tgpMulticastBarrierNV = uintptr(getProcAddr(\"glMulticastBarrierNV\"))\n\tgpMulticastBlitFramebufferNV = uintptr(getProcAddr(\"glMulticastBlitFramebufferNV\"))\n\tgpMulticastBufferSubDataNV = uintptr(getProcAddr(\"glMulticastBufferSubDataNV\"))\n\tgpMulticastCopyBufferSubDataNV = uintptr(getProcAddr(\"glMulticastCopyBufferSubDataNV\"))\n\tgpMulticastCopyImageSubDataNV = uintptr(getProcAddr(\"glMulticastCopyImageSubDataNV\"))\n\tgpMulticastFramebufferSampleLocationsfvNV = uintptr(getProcAddr(\"glMulticastFramebufferSampleLocationsfvNV\"))\n\tgpMulticastGetQueryObjecti64vNV = uintptr(getProcAddr(\"glMulticastGetQueryObjecti64vNV\"))\n\tgpMulticastGetQueryObjectivNV = uintptr(getProcAddr(\"glMulticastGetQueryObjectivNV\"))\n\tgpMulticastGetQueryObjectui64vNV = uintptr(getProcAddr(\"glMulticastGetQueryObjectui64vNV\"))\n\tgpMulticastGetQueryObjectuivNV = uintptr(getProcAddr(\"glMulticastGetQueryObjectuivNV\"))\n\tgpMulticastWaitSyncNV = uintptr(getProcAddr(\"glMulticastWaitSyncNV\"))\n\tgpNamedBufferData = uintptr(getProcAddr(\"glNamedBufferData\"))\n\tgpNamedBufferDataEXT = uintptr(getProcAddr(\"glNamedBufferDataEXT\"))\n\tgpNamedBufferPageCommitmentARB = uintptr(getProcAddr(\"glNamedBufferPageCommitmentARB\"))\n\tgpNamedBufferPageCommitmentEXT = uintptr(getProcAddr(\"glNamedBufferPageCommitmentEXT\"))\n\tgpNamedBufferStorage = uintptr(getProcAddr(\"glNamedBufferStorage\"))\n\tgpNamedBufferStorageEXT = uintptr(getProcAddr(\"glNamedBufferStorageEXT\"))\n\tgpNamedBufferStorageExternalEXT = uintptr(getProcAddr(\"glNamedBufferStorageExternalEXT\"))\n\tgpNamedBufferStorageMemEXT = uintptr(getProcAddr(\"glNamedBufferStorageMemEXT\"))\n\tgpNamedBufferSubData = uintptr(getProcAddr(\"glNamedBufferSubData\"))\n\tgpNamedBufferSubDataEXT = uintptr(getProcAddr(\"glNamedBufferSubDataEXT\"))\n\tgpNamedCopyBufferSubDataEXT = uintptr(getProcAddr(\"glNamedCopyBufferSubDataEXT\"))\n\tgpNamedFramebufferDrawBuffer = uintptr(getProcAddr(\"glNamedFramebufferDrawBuffer\"))\n\tgpNamedFramebufferDrawBuffers = uintptr(getProcAddr(\"glNamedFramebufferDrawBuffers\"))\n\tgpNamedFramebufferParameteri = uintptr(getProcAddr(\"glNamedFramebufferParameteri\"))\n\tgpNamedFramebufferParameteriEXT = uintptr(getProcAddr(\"glNamedFramebufferParameteriEXT\"))\n\tgpNamedFramebufferReadBuffer = uintptr(getProcAddr(\"glNamedFramebufferReadBuffer\"))\n\tgpNamedFramebufferRenderbuffer = uintptr(getProcAddr(\"glNamedFramebufferRenderbuffer\"))\n\tgpNamedFramebufferRenderbufferEXT = uintptr(getProcAddr(\"glNamedFramebufferRenderbufferEXT\"))\n\tgpNamedFramebufferSampleLocationsfvARB = uintptr(getProcAddr(\"glNamedFramebufferSampleLocationsfvARB\"))\n\tgpNamedFramebufferSampleLocationsfvNV = uintptr(getProcAddr(\"glNamedFramebufferSampleLocationsfvNV\"))\n\tgpNamedFramebufferSamplePositionsfvAMD = uintptr(getProcAddr(\"glNamedFramebufferSamplePositionsfvAMD\"))\n\tgpNamedFramebufferTexture = uintptr(getProcAddr(\"glNamedFramebufferTexture\"))\n\tgpNamedFramebufferTexture1DEXT = uintptr(getProcAddr(\"glNamedFramebufferTexture1DEXT\"))\n\tgpNamedFramebufferTexture2DEXT = uintptr(getProcAddr(\"glNamedFramebufferTexture2DEXT\"))\n\tgpNamedFramebufferTexture3DEXT = uintptr(getProcAddr(\"glNamedFramebufferTexture3DEXT\"))\n\tgpNamedFramebufferTextureEXT = uintptr(getProcAddr(\"glNamedFramebufferTextureEXT\"))\n\tgpNamedFramebufferTextureFaceEXT = uintptr(getProcAddr(\"glNamedFramebufferTextureFaceEXT\"))\n\tgpNamedFramebufferTextureLayer = uintptr(getProcAddr(\"glNamedFramebufferTextureLayer\"))\n\tgpNamedFramebufferTextureLayerEXT = uintptr(getProcAddr(\"glNamedFramebufferTextureLayerEXT\"))\n\tgpNamedProgramLocalParameter4dEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameter4dEXT\"))\n\tgpNamedProgramLocalParameter4dvEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameter4dvEXT\"))\n\tgpNamedProgramLocalParameter4fEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameter4fEXT\"))\n\tgpNamedProgramLocalParameter4fvEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameter4fvEXT\"))\n\tgpNamedProgramLocalParameterI4iEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameterI4iEXT\"))\n\tgpNamedProgramLocalParameterI4ivEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameterI4ivEXT\"))\n\tgpNamedProgramLocalParameterI4uiEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameterI4uiEXT\"))\n\tgpNamedProgramLocalParameterI4uivEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameterI4uivEXT\"))\n\tgpNamedProgramLocalParameters4fvEXT = uintptr(getProcAddr(\"glNamedProgramLocalParameters4fvEXT\"))\n\tgpNamedProgramLocalParametersI4ivEXT = uintptr(getProcAddr(\"glNamedProgramLocalParametersI4ivEXT\"))\n\tgpNamedProgramLocalParametersI4uivEXT = uintptr(getProcAddr(\"glNamedProgramLocalParametersI4uivEXT\"))\n\tgpNamedProgramStringEXT = uintptr(getProcAddr(\"glNamedProgramStringEXT\"))\n\tgpNamedRenderbufferStorage = uintptr(getProcAddr(\"glNamedRenderbufferStorage\"))\n\tgpNamedRenderbufferStorageEXT = uintptr(getProcAddr(\"glNamedRenderbufferStorageEXT\"))\n\tgpNamedRenderbufferStorageMultisample = uintptr(getProcAddr(\"glNamedRenderbufferStorageMultisample\"))\n\tgpNamedRenderbufferStorageMultisampleCoverageEXT = uintptr(getProcAddr(\"glNamedRenderbufferStorageMultisampleCoverageEXT\"))\n\tgpNamedRenderbufferStorageMultisampleEXT = uintptr(getProcAddr(\"glNamedRenderbufferStorageMultisampleEXT\"))\n\tgpNamedStringARB = uintptr(getProcAddr(\"glNamedStringARB\"))\n\tgpNewList = uintptr(getProcAddr(\"glNewList\"))\n\tif gpNewList == 0 {\n\t\treturn errors.New(\"glNewList\")\n\t}\n\tgpNewObjectBufferATI = uintptr(getProcAddr(\"glNewObjectBufferATI\"))\n\tgpNormal3b = uintptr(getProcAddr(\"glNormal3b\"))\n\tif gpNormal3b == 0 {\n\t\treturn errors.New(\"glNormal3b\")\n\t}\n\tgpNormal3bv = uintptr(getProcAddr(\"glNormal3bv\"))\n\tif gpNormal3bv == 0 {\n\t\treturn errors.New(\"glNormal3bv\")\n\t}\n\tgpNormal3d = uintptr(getProcAddr(\"glNormal3d\"))\n\tif gpNormal3d == 0 {\n\t\treturn errors.New(\"glNormal3d\")\n\t}\n\tgpNormal3dv = uintptr(getProcAddr(\"glNormal3dv\"))\n\tif gpNormal3dv == 0 {\n\t\treturn errors.New(\"glNormal3dv\")\n\t}\n\tgpNormal3f = uintptr(getProcAddr(\"glNormal3f\"))\n\tif gpNormal3f == 0 {\n\t\treturn errors.New(\"glNormal3f\")\n\t}\n\tgpNormal3fVertex3fSUN = uintptr(getProcAddr(\"glNormal3fVertex3fSUN\"))\n\tgpNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glNormal3fVertex3fvSUN\"))\n\tgpNormal3fv = uintptr(getProcAddr(\"glNormal3fv\"))\n\tif gpNormal3fv == 0 {\n\t\treturn errors.New(\"glNormal3fv\")\n\t}\n\tgpNormal3hNV = uintptr(getProcAddr(\"glNormal3hNV\"))\n\tgpNormal3hvNV = uintptr(getProcAddr(\"glNormal3hvNV\"))\n\tgpNormal3i = uintptr(getProcAddr(\"glNormal3i\"))\n\tif gpNormal3i == 0 {\n\t\treturn errors.New(\"glNormal3i\")\n\t}\n\tgpNormal3iv = uintptr(getProcAddr(\"glNormal3iv\"))\n\tif gpNormal3iv == 0 {\n\t\treturn errors.New(\"glNormal3iv\")\n\t}\n\tgpNormal3s = uintptr(getProcAddr(\"glNormal3s\"))\n\tif gpNormal3s == 0 {\n\t\treturn errors.New(\"glNormal3s\")\n\t}\n\tgpNormal3sv = uintptr(getProcAddr(\"glNormal3sv\"))\n\tif gpNormal3sv == 0 {\n\t\treturn errors.New(\"glNormal3sv\")\n\t}\n\tgpNormal3xOES = uintptr(getProcAddr(\"glNormal3xOES\"))\n\tgpNormal3xvOES = uintptr(getProcAddr(\"glNormal3xvOES\"))\n\tgpNormalFormatNV = uintptr(getProcAddr(\"glNormalFormatNV\"))\n\tgpNormalPointer = uintptr(getProcAddr(\"glNormalPointer\"))\n\tif gpNormalPointer == 0 {\n\t\treturn errors.New(\"glNormalPointer\")\n\t}\n\tgpNormalPointerEXT = uintptr(getProcAddr(\"glNormalPointerEXT\"))\n\tgpNormalPointerListIBM = uintptr(getProcAddr(\"glNormalPointerListIBM\"))\n\tgpNormalPointervINTEL = uintptr(getProcAddr(\"glNormalPointervINTEL\"))\n\tgpNormalStream3bATI = uintptr(getProcAddr(\"glNormalStream3bATI\"))\n\tgpNormalStream3bvATI = uintptr(getProcAddr(\"glNormalStream3bvATI\"))\n\tgpNormalStream3dATI = uintptr(getProcAddr(\"glNormalStream3dATI\"))\n\tgpNormalStream3dvATI = uintptr(getProcAddr(\"glNormalStream3dvATI\"))\n\tgpNormalStream3fATI = uintptr(getProcAddr(\"glNormalStream3fATI\"))\n\tgpNormalStream3fvATI = uintptr(getProcAddr(\"glNormalStream3fvATI\"))\n\tgpNormalStream3iATI = uintptr(getProcAddr(\"glNormalStream3iATI\"))\n\tgpNormalStream3ivATI = uintptr(getProcAddr(\"glNormalStream3ivATI\"))\n\tgpNormalStream3sATI = uintptr(getProcAddr(\"glNormalStream3sATI\"))\n\tgpNormalStream3svATI = uintptr(getProcAddr(\"glNormalStream3svATI\"))\n\tgpObjectLabel = uintptr(getProcAddr(\"glObjectLabel\"))\n\tgpObjectLabelKHR = uintptr(getProcAddr(\"glObjectLabelKHR\"))\n\tgpObjectPtrLabel = uintptr(getProcAddr(\"glObjectPtrLabel\"))\n\tgpObjectPtrLabelKHR = uintptr(getProcAddr(\"glObjectPtrLabelKHR\"))\n\tgpObjectPurgeableAPPLE = uintptr(getProcAddr(\"glObjectPurgeableAPPLE\"))\n\tgpObjectUnpurgeableAPPLE = uintptr(getProcAddr(\"glObjectUnpurgeableAPPLE\"))\n\tgpOrtho = uintptr(getProcAddr(\"glOrtho\"))\n\tif gpOrtho == 0 {\n\t\treturn errors.New(\"glOrtho\")\n\t}\n\tgpOrthofOES = uintptr(getProcAddr(\"glOrthofOES\"))\n\tgpOrthoxOES = uintptr(getProcAddr(\"glOrthoxOES\"))\n\tgpPNTrianglesfATI = uintptr(getProcAddr(\"glPNTrianglesfATI\"))\n\tgpPNTrianglesiATI = uintptr(getProcAddr(\"glPNTrianglesiATI\"))\n\tgpPassTexCoordATI = uintptr(getProcAddr(\"glPassTexCoordATI\"))\n\tgpPassThrough = uintptr(getProcAddr(\"glPassThrough\"))\n\tif gpPassThrough == 0 {\n\t\treturn errors.New(\"glPassThrough\")\n\t}\n\tgpPassThroughxOES = uintptr(getProcAddr(\"glPassThroughxOES\"))\n\tgpPatchParameterfv = uintptr(getProcAddr(\"glPatchParameterfv\"))\n\tgpPatchParameteri = uintptr(getProcAddr(\"glPatchParameteri\"))\n\tgpPathCommandsNV = uintptr(getProcAddr(\"glPathCommandsNV\"))\n\tgpPathCoordsNV = uintptr(getProcAddr(\"glPathCoordsNV\"))\n\tgpPathCoverDepthFuncNV = uintptr(getProcAddr(\"glPathCoverDepthFuncNV\"))\n\tgpPathDashArrayNV = uintptr(getProcAddr(\"glPathDashArrayNV\"))\n\tgpPathGlyphIndexArrayNV = uintptr(getProcAddr(\"glPathGlyphIndexArrayNV\"))\n\tgpPathGlyphIndexRangeNV = uintptr(getProcAddr(\"glPathGlyphIndexRangeNV\"))\n\tgpPathGlyphRangeNV = uintptr(getProcAddr(\"glPathGlyphRangeNV\"))\n\tgpPathGlyphsNV = uintptr(getProcAddr(\"glPathGlyphsNV\"))\n\tgpPathMemoryGlyphIndexArrayNV = uintptr(getProcAddr(\"glPathMemoryGlyphIndexArrayNV\"))\n\tgpPathParameterfNV = uintptr(getProcAddr(\"glPathParameterfNV\"))\n\tgpPathParameterfvNV = uintptr(getProcAddr(\"glPathParameterfvNV\"))\n\tgpPathParameteriNV = uintptr(getProcAddr(\"glPathParameteriNV\"))\n\tgpPathParameterivNV = uintptr(getProcAddr(\"glPathParameterivNV\"))\n\tgpPathStencilDepthOffsetNV = uintptr(getProcAddr(\"glPathStencilDepthOffsetNV\"))\n\tgpPathStencilFuncNV = uintptr(getProcAddr(\"glPathStencilFuncNV\"))\n\tgpPathStringNV = uintptr(getProcAddr(\"glPathStringNV\"))\n\tgpPathSubCommandsNV = uintptr(getProcAddr(\"glPathSubCommandsNV\"))\n\tgpPathSubCoordsNV = uintptr(getProcAddr(\"glPathSubCoordsNV\"))\n\tgpPauseTransformFeedback = uintptr(getProcAddr(\"glPauseTransformFeedback\"))\n\tgpPauseTransformFeedbackNV = uintptr(getProcAddr(\"glPauseTransformFeedbackNV\"))\n\tgpPixelDataRangeNV = uintptr(getProcAddr(\"glPixelDataRangeNV\"))\n\tgpPixelMapfv = uintptr(getProcAddr(\"glPixelMapfv\"))\n\tif gpPixelMapfv == 0 {\n\t\treturn errors.New(\"glPixelMapfv\")\n\t}\n\tgpPixelMapuiv = uintptr(getProcAddr(\"glPixelMapuiv\"))\n\tif gpPixelMapuiv == 0 {\n\t\treturn errors.New(\"glPixelMapuiv\")\n\t}\n\tgpPixelMapusv = uintptr(getProcAddr(\"glPixelMapusv\"))\n\tif gpPixelMapusv == 0 {\n\t\treturn errors.New(\"glPixelMapusv\")\n\t}\n\tgpPixelMapx = uintptr(getProcAddr(\"glPixelMapx\"))\n\tgpPixelStoref = uintptr(getProcAddr(\"glPixelStoref\"))\n\tif gpPixelStoref == 0 {\n\t\treturn errors.New(\"glPixelStoref\")\n\t}\n\tgpPixelStorei = uintptr(getProcAddr(\"glPixelStorei\"))\n\tif gpPixelStorei == 0 {\n\t\treturn errors.New(\"glPixelStorei\")\n\t}\n\tgpPixelStorex = uintptr(getProcAddr(\"glPixelStorex\"))\n\tgpPixelTexGenParameterfSGIS = uintptr(getProcAddr(\"glPixelTexGenParameterfSGIS\"))\n\tgpPixelTexGenParameterfvSGIS = uintptr(getProcAddr(\"glPixelTexGenParameterfvSGIS\"))\n\tgpPixelTexGenParameteriSGIS = uintptr(getProcAddr(\"glPixelTexGenParameteriSGIS\"))\n\tgpPixelTexGenParameterivSGIS = uintptr(getProcAddr(\"glPixelTexGenParameterivSGIS\"))\n\tgpPixelTexGenSGIX = uintptr(getProcAddr(\"glPixelTexGenSGIX\"))\n\tgpPixelTransferf = uintptr(getProcAddr(\"glPixelTransferf\"))\n\tif gpPixelTransferf == 0 {\n\t\treturn errors.New(\"glPixelTransferf\")\n\t}\n\tgpPixelTransferi = uintptr(getProcAddr(\"glPixelTransferi\"))\n\tif gpPixelTransferi == 0 {\n\t\treturn errors.New(\"glPixelTransferi\")\n\t}\n\tgpPixelTransferxOES = uintptr(getProcAddr(\"glPixelTransferxOES\"))\n\tgpPixelTransformParameterfEXT = uintptr(getProcAddr(\"glPixelTransformParameterfEXT\"))\n\tgpPixelTransformParameterfvEXT = uintptr(getProcAddr(\"glPixelTransformParameterfvEXT\"))\n\tgpPixelTransformParameteriEXT = uintptr(getProcAddr(\"glPixelTransformParameteriEXT\"))\n\tgpPixelTransformParameterivEXT = uintptr(getProcAddr(\"glPixelTransformParameterivEXT\"))\n\tgpPixelZoom = uintptr(getProcAddr(\"glPixelZoom\"))\n\tif gpPixelZoom == 0 {\n\t\treturn errors.New(\"glPixelZoom\")\n\t}\n\tgpPixelZoomxOES = uintptr(getProcAddr(\"glPixelZoomxOES\"))\n\tgpPointAlongPathNV = uintptr(getProcAddr(\"glPointAlongPathNV\"))\n\tgpPointParameterf = uintptr(getProcAddr(\"glPointParameterf\"))\n\tif gpPointParameterf == 0 {\n\t\treturn errors.New(\"glPointParameterf\")\n\t}\n\tgpPointParameterfARB = uintptr(getProcAddr(\"glPointParameterfARB\"))\n\tgpPointParameterfEXT = uintptr(getProcAddr(\"glPointParameterfEXT\"))\n\tgpPointParameterfSGIS = uintptr(getProcAddr(\"glPointParameterfSGIS\"))\n\tgpPointParameterfv = uintptr(getProcAddr(\"glPointParameterfv\"))\n\tif gpPointParameterfv == 0 {\n\t\treturn errors.New(\"glPointParameterfv\")\n\t}\n\tgpPointParameterfvARB = uintptr(getProcAddr(\"glPointParameterfvARB\"))\n\tgpPointParameterfvEXT = uintptr(getProcAddr(\"glPointParameterfvEXT\"))\n\tgpPointParameterfvSGIS = uintptr(getProcAddr(\"glPointParameterfvSGIS\"))\n\tgpPointParameteri = uintptr(getProcAddr(\"glPointParameteri\"))\n\tif gpPointParameteri == 0 {\n\t\treturn errors.New(\"glPointParameteri\")\n\t}\n\tgpPointParameteriNV = uintptr(getProcAddr(\"glPointParameteriNV\"))\n\tgpPointParameteriv = uintptr(getProcAddr(\"glPointParameteriv\"))\n\tif gpPointParameteriv == 0 {\n\t\treturn errors.New(\"glPointParameteriv\")\n\t}\n\tgpPointParameterivNV = uintptr(getProcAddr(\"glPointParameterivNV\"))\n\tgpPointParameterxOES = uintptr(getProcAddr(\"glPointParameterxOES\"))\n\tgpPointParameterxvOES = uintptr(getProcAddr(\"glPointParameterxvOES\"))\n\tgpPointSize = uintptr(getProcAddr(\"glPointSize\"))\n\tif gpPointSize == 0 {\n\t\treturn errors.New(\"glPointSize\")\n\t}\n\tgpPointSizexOES = uintptr(getProcAddr(\"glPointSizexOES\"))\n\tgpPollAsyncSGIX = uintptr(getProcAddr(\"glPollAsyncSGIX\"))\n\tgpPollInstrumentsSGIX = uintptr(getProcAddr(\"glPollInstrumentsSGIX\"))\n\tgpPolygonMode = uintptr(getProcAddr(\"glPolygonMode\"))\n\tif gpPolygonMode == 0 {\n\t\treturn errors.New(\"glPolygonMode\")\n\t}\n\tgpPolygonOffset = uintptr(getProcAddr(\"glPolygonOffset\"))\n\tif gpPolygonOffset == 0 {\n\t\treturn errors.New(\"glPolygonOffset\")\n\t}\n\tgpPolygonOffsetClamp = uintptr(getProcAddr(\"glPolygonOffsetClamp\"))\n\tgpPolygonOffsetClampEXT = uintptr(getProcAddr(\"glPolygonOffsetClampEXT\"))\n\tgpPolygonOffsetEXT = uintptr(getProcAddr(\"glPolygonOffsetEXT\"))\n\tgpPolygonOffsetxOES = uintptr(getProcAddr(\"glPolygonOffsetxOES\"))\n\tgpPolygonStipple = uintptr(getProcAddr(\"glPolygonStipple\"))\n\tif gpPolygonStipple == 0 {\n\t\treturn errors.New(\"glPolygonStipple\")\n\t}\n\tgpPopAttrib = uintptr(getProcAddr(\"glPopAttrib\"))\n\tif gpPopAttrib == 0 {\n\t\treturn errors.New(\"glPopAttrib\")\n\t}\n\tgpPopClientAttrib = uintptr(getProcAddr(\"glPopClientAttrib\"))\n\tif gpPopClientAttrib == 0 {\n\t\treturn errors.New(\"glPopClientAttrib\")\n\t}\n\tgpPopDebugGroup = uintptr(getProcAddr(\"glPopDebugGroup\"))\n\tgpPopDebugGroupKHR = uintptr(getProcAddr(\"glPopDebugGroupKHR\"))\n\tgpPopGroupMarkerEXT = uintptr(getProcAddr(\"glPopGroupMarkerEXT\"))\n\tgpPopMatrix = uintptr(getProcAddr(\"glPopMatrix\"))\n\tif gpPopMatrix == 0 {\n\t\treturn errors.New(\"glPopMatrix\")\n\t}\n\tgpPopName = uintptr(getProcAddr(\"glPopName\"))\n\tif gpPopName == 0 {\n\t\treturn errors.New(\"glPopName\")\n\t}\n\tgpPresentFrameDualFillNV = uintptr(getProcAddr(\"glPresentFrameDualFillNV\"))\n\tgpPresentFrameKeyedNV = uintptr(getProcAddr(\"glPresentFrameKeyedNV\"))\n\tgpPrimitiveBoundingBoxARB = uintptr(getProcAddr(\"glPrimitiveBoundingBoxARB\"))\n\tgpPrimitiveRestartIndexNV = uintptr(getProcAddr(\"glPrimitiveRestartIndexNV\"))\n\tgpPrimitiveRestartNV = uintptr(getProcAddr(\"glPrimitiveRestartNV\"))\n\tgpPrioritizeTextures = uintptr(getProcAddr(\"glPrioritizeTextures\"))\n\tif gpPrioritizeTextures == 0 {\n\t\treturn errors.New(\"glPrioritizeTextures\")\n\t}\n\tgpPrioritizeTexturesEXT = uintptr(getProcAddr(\"glPrioritizeTexturesEXT\"))\n\tgpPrioritizeTexturesxOES = uintptr(getProcAddr(\"glPrioritizeTexturesxOES\"))\n\tgpProgramBinary = uintptr(getProcAddr(\"glProgramBinary\"))\n\tgpProgramBufferParametersIivNV = uintptr(getProcAddr(\"glProgramBufferParametersIivNV\"))\n\tgpProgramBufferParametersIuivNV = uintptr(getProcAddr(\"glProgramBufferParametersIuivNV\"))\n\tgpProgramBufferParametersfvNV = uintptr(getProcAddr(\"glProgramBufferParametersfvNV\"))\n\tgpProgramEnvParameter4dARB = uintptr(getProcAddr(\"glProgramEnvParameter4dARB\"))\n\tgpProgramEnvParameter4dvARB = uintptr(getProcAddr(\"glProgramEnvParameter4dvARB\"))\n\tgpProgramEnvParameter4fARB = uintptr(getProcAddr(\"glProgramEnvParameter4fARB\"))\n\tgpProgramEnvParameter4fvARB = uintptr(getProcAddr(\"glProgramEnvParameter4fvARB\"))\n\tgpProgramEnvParameterI4iNV = uintptr(getProcAddr(\"glProgramEnvParameterI4iNV\"))\n\tgpProgramEnvParameterI4ivNV = uintptr(getProcAddr(\"glProgramEnvParameterI4ivNV\"))\n\tgpProgramEnvParameterI4uiNV = uintptr(getProcAddr(\"glProgramEnvParameterI4uiNV\"))\n\tgpProgramEnvParameterI4uivNV = uintptr(getProcAddr(\"glProgramEnvParameterI4uivNV\"))\n\tgpProgramEnvParameters4fvEXT = uintptr(getProcAddr(\"glProgramEnvParameters4fvEXT\"))\n\tgpProgramEnvParametersI4ivNV = uintptr(getProcAddr(\"glProgramEnvParametersI4ivNV\"))\n\tgpProgramEnvParametersI4uivNV = uintptr(getProcAddr(\"glProgramEnvParametersI4uivNV\"))\n\tgpProgramLocalParameter4dARB = uintptr(getProcAddr(\"glProgramLocalParameter4dARB\"))\n\tgpProgramLocalParameter4dvARB = uintptr(getProcAddr(\"glProgramLocalParameter4dvARB\"))\n\tgpProgramLocalParameter4fARB = uintptr(getProcAddr(\"glProgramLocalParameter4fARB\"))\n\tgpProgramLocalParameter4fvARB = uintptr(getProcAddr(\"glProgramLocalParameter4fvARB\"))\n\tgpProgramLocalParameterI4iNV = uintptr(getProcAddr(\"glProgramLocalParameterI4iNV\"))\n\tgpProgramLocalParameterI4ivNV = uintptr(getProcAddr(\"glProgramLocalParameterI4ivNV\"))\n\tgpProgramLocalParameterI4uiNV = uintptr(getProcAddr(\"glProgramLocalParameterI4uiNV\"))\n\tgpProgramLocalParameterI4uivNV = uintptr(getProcAddr(\"glProgramLocalParameterI4uivNV\"))\n\tgpProgramLocalParameters4fvEXT = uintptr(getProcAddr(\"glProgramLocalParameters4fvEXT\"))\n\tgpProgramLocalParametersI4ivNV = uintptr(getProcAddr(\"glProgramLocalParametersI4ivNV\"))\n\tgpProgramLocalParametersI4uivNV = uintptr(getProcAddr(\"glProgramLocalParametersI4uivNV\"))\n\tgpProgramNamedParameter4dNV = uintptr(getProcAddr(\"glProgramNamedParameter4dNV\"))\n\tgpProgramNamedParameter4dvNV = uintptr(getProcAddr(\"glProgramNamedParameter4dvNV\"))\n\tgpProgramNamedParameter4fNV = uintptr(getProcAddr(\"glProgramNamedParameter4fNV\"))\n\tgpProgramNamedParameter4fvNV = uintptr(getProcAddr(\"glProgramNamedParameter4fvNV\"))\n\tgpProgramParameter4dNV = uintptr(getProcAddr(\"glProgramParameter4dNV\"))\n\tgpProgramParameter4dvNV = uintptr(getProcAddr(\"glProgramParameter4dvNV\"))\n\tgpProgramParameter4fNV = uintptr(getProcAddr(\"glProgramParameter4fNV\"))\n\tgpProgramParameter4fvNV = uintptr(getProcAddr(\"glProgramParameter4fvNV\"))\n\tgpProgramParameteri = uintptr(getProcAddr(\"glProgramParameteri\"))\n\tgpProgramParameteriARB = uintptr(getProcAddr(\"glProgramParameteriARB\"))\n\tgpProgramParameteriEXT = uintptr(getProcAddr(\"glProgramParameteriEXT\"))\n\tgpProgramParameters4dvNV = uintptr(getProcAddr(\"glProgramParameters4dvNV\"))\n\tgpProgramParameters4fvNV = uintptr(getProcAddr(\"glProgramParameters4fvNV\"))\n\tgpProgramPathFragmentInputGenNV = uintptr(getProcAddr(\"glProgramPathFragmentInputGenNV\"))\n\tgpProgramStringARB = uintptr(getProcAddr(\"glProgramStringARB\"))\n\tgpProgramSubroutineParametersuivNV = uintptr(getProcAddr(\"glProgramSubroutineParametersuivNV\"))\n\tgpProgramUniform1d = uintptr(getProcAddr(\"glProgramUniform1d\"))\n\tgpProgramUniform1dEXT = uintptr(getProcAddr(\"glProgramUniform1dEXT\"))\n\tgpProgramUniform1dv = uintptr(getProcAddr(\"glProgramUniform1dv\"))\n\tgpProgramUniform1dvEXT = uintptr(getProcAddr(\"glProgramUniform1dvEXT\"))\n\tgpProgramUniform1f = uintptr(getProcAddr(\"glProgramUniform1f\"))\n\tgpProgramUniform1fEXT = uintptr(getProcAddr(\"glProgramUniform1fEXT\"))\n\tgpProgramUniform1fv = uintptr(getProcAddr(\"glProgramUniform1fv\"))\n\tgpProgramUniform1fvEXT = uintptr(getProcAddr(\"glProgramUniform1fvEXT\"))\n\tgpProgramUniform1i = uintptr(getProcAddr(\"glProgramUniform1i\"))\n\tgpProgramUniform1i64ARB = uintptr(getProcAddr(\"glProgramUniform1i64ARB\"))\n\tgpProgramUniform1i64NV = uintptr(getProcAddr(\"glProgramUniform1i64NV\"))\n\tgpProgramUniform1i64vARB = uintptr(getProcAddr(\"glProgramUniform1i64vARB\"))\n\tgpProgramUniform1i64vNV = uintptr(getProcAddr(\"glProgramUniform1i64vNV\"))\n\tgpProgramUniform1iEXT = uintptr(getProcAddr(\"glProgramUniform1iEXT\"))\n\tgpProgramUniform1iv = uintptr(getProcAddr(\"glProgramUniform1iv\"))\n\tgpProgramUniform1ivEXT = uintptr(getProcAddr(\"glProgramUniform1ivEXT\"))\n\tgpProgramUniform1ui = uintptr(getProcAddr(\"glProgramUniform1ui\"))\n\tgpProgramUniform1ui64ARB = uintptr(getProcAddr(\"glProgramUniform1ui64ARB\"))\n\tgpProgramUniform1ui64NV = uintptr(getProcAddr(\"glProgramUniform1ui64NV\"))\n\tgpProgramUniform1ui64vARB = uintptr(getProcAddr(\"glProgramUniform1ui64vARB\"))\n\tgpProgramUniform1ui64vNV = uintptr(getProcAddr(\"glProgramUniform1ui64vNV\"))\n\tgpProgramUniform1uiEXT = uintptr(getProcAddr(\"glProgramUniform1uiEXT\"))\n\tgpProgramUniform1uiv = uintptr(getProcAddr(\"glProgramUniform1uiv\"))\n\tgpProgramUniform1uivEXT = uintptr(getProcAddr(\"glProgramUniform1uivEXT\"))\n\tgpProgramUniform2d = uintptr(getProcAddr(\"glProgramUniform2d\"))\n\tgpProgramUniform2dEXT = uintptr(getProcAddr(\"glProgramUniform2dEXT\"))\n\tgpProgramUniform2dv = uintptr(getProcAddr(\"glProgramUniform2dv\"))\n\tgpProgramUniform2dvEXT = uintptr(getProcAddr(\"glProgramUniform2dvEXT\"))\n\tgpProgramUniform2f = uintptr(getProcAddr(\"glProgramUniform2f\"))\n\tgpProgramUniform2fEXT = uintptr(getProcAddr(\"glProgramUniform2fEXT\"))\n\tgpProgramUniform2fv = uintptr(getProcAddr(\"glProgramUniform2fv\"))\n\tgpProgramUniform2fvEXT = uintptr(getProcAddr(\"glProgramUniform2fvEXT\"))\n\tgpProgramUniform2i = uintptr(getProcAddr(\"glProgramUniform2i\"))\n\tgpProgramUniform2i64ARB = uintptr(getProcAddr(\"glProgramUniform2i64ARB\"))\n\tgpProgramUniform2i64NV = uintptr(getProcAddr(\"glProgramUniform2i64NV\"))\n\tgpProgramUniform2i64vARB = uintptr(getProcAddr(\"glProgramUniform2i64vARB\"))\n\tgpProgramUniform2i64vNV = uintptr(getProcAddr(\"glProgramUniform2i64vNV\"))\n\tgpProgramUniform2iEXT = uintptr(getProcAddr(\"glProgramUniform2iEXT\"))\n\tgpProgramUniform2iv = uintptr(getProcAddr(\"glProgramUniform2iv\"))\n\tgpProgramUniform2ivEXT = uintptr(getProcAddr(\"glProgramUniform2ivEXT\"))\n\tgpProgramUniform2ui = uintptr(getProcAddr(\"glProgramUniform2ui\"))\n\tgpProgramUniform2ui64ARB = uintptr(getProcAddr(\"glProgramUniform2ui64ARB\"))\n\tgpProgramUniform2ui64NV = uintptr(getProcAddr(\"glProgramUniform2ui64NV\"))\n\tgpProgramUniform2ui64vARB = uintptr(getProcAddr(\"glProgramUniform2ui64vARB\"))\n\tgpProgramUniform2ui64vNV = uintptr(getProcAddr(\"glProgramUniform2ui64vNV\"))\n\tgpProgramUniform2uiEXT = uintptr(getProcAddr(\"glProgramUniform2uiEXT\"))\n\tgpProgramUniform2uiv = uintptr(getProcAddr(\"glProgramUniform2uiv\"))\n\tgpProgramUniform2uivEXT = uintptr(getProcAddr(\"glProgramUniform2uivEXT\"))\n\tgpProgramUniform3d = uintptr(getProcAddr(\"glProgramUniform3d\"))\n\tgpProgramUniform3dEXT = uintptr(getProcAddr(\"glProgramUniform3dEXT\"))\n\tgpProgramUniform3dv = uintptr(getProcAddr(\"glProgramUniform3dv\"))\n\tgpProgramUniform3dvEXT = uintptr(getProcAddr(\"glProgramUniform3dvEXT\"))\n\tgpProgramUniform3f = uintptr(getProcAddr(\"glProgramUniform3f\"))\n\tgpProgramUniform3fEXT = uintptr(getProcAddr(\"glProgramUniform3fEXT\"))\n\tgpProgramUniform3fv = uintptr(getProcAddr(\"glProgramUniform3fv\"))\n\tgpProgramUniform3fvEXT = uintptr(getProcAddr(\"glProgramUniform3fvEXT\"))\n\tgpProgramUniform3i = uintptr(getProcAddr(\"glProgramUniform3i\"))\n\tgpProgramUniform3i64ARB = uintptr(getProcAddr(\"glProgramUniform3i64ARB\"))\n\tgpProgramUniform3i64NV = uintptr(getProcAddr(\"glProgramUniform3i64NV\"))\n\tgpProgramUniform3i64vARB = uintptr(getProcAddr(\"glProgramUniform3i64vARB\"))\n\tgpProgramUniform3i64vNV = uintptr(getProcAddr(\"glProgramUniform3i64vNV\"))\n\tgpProgramUniform3iEXT = uintptr(getProcAddr(\"glProgramUniform3iEXT\"))\n\tgpProgramUniform3iv = uintptr(getProcAddr(\"glProgramUniform3iv\"))\n\tgpProgramUniform3ivEXT = uintptr(getProcAddr(\"glProgramUniform3ivEXT\"))\n\tgpProgramUniform3ui = uintptr(getProcAddr(\"glProgramUniform3ui\"))\n\tgpProgramUniform3ui64ARB = uintptr(getProcAddr(\"glProgramUniform3ui64ARB\"))\n\tgpProgramUniform3ui64NV = uintptr(getProcAddr(\"glProgramUniform3ui64NV\"))\n\tgpProgramUniform3ui64vARB = uintptr(getProcAddr(\"glProgramUniform3ui64vARB\"))\n\tgpProgramUniform3ui64vNV = uintptr(getProcAddr(\"glProgramUniform3ui64vNV\"))\n\tgpProgramUniform3uiEXT = uintptr(getProcAddr(\"glProgramUniform3uiEXT\"))\n\tgpProgramUniform3uiv = uintptr(getProcAddr(\"glProgramUniform3uiv\"))\n\tgpProgramUniform3uivEXT = uintptr(getProcAddr(\"glProgramUniform3uivEXT\"))\n\tgpProgramUniform4d = uintptr(getProcAddr(\"glProgramUniform4d\"))\n\tgpProgramUniform4dEXT = uintptr(getProcAddr(\"glProgramUniform4dEXT\"))\n\tgpProgramUniform4dv = uintptr(getProcAddr(\"glProgramUniform4dv\"))\n\tgpProgramUniform4dvEXT = uintptr(getProcAddr(\"glProgramUniform4dvEXT\"))\n\tgpProgramUniform4f = uintptr(getProcAddr(\"glProgramUniform4f\"))\n\tgpProgramUniform4fEXT = uintptr(getProcAddr(\"glProgramUniform4fEXT\"))\n\tgpProgramUniform4fv = uintptr(getProcAddr(\"glProgramUniform4fv\"))\n\tgpProgramUniform4fvEXT = uintptr(getProcAddr(\"glProgramUniform4fvEXT\"))\n\tgpProgramUniform4i = uintptr(getProcAddr(\"glProgramUniform4i\"))\n\tgpProgramUniform4i64ARB = uintptr(getProcAddr(\"glProgramUniform4i64ARB\"))\n\tgpProgramUniform4i64NV = uintptr(getProcAddr(\"glProgramUniform4i64NV\"))\n\tgpProgramUniform4i64vARB = uintptr(getProcAddr(\"glProgramUniform4i64vARB\"))\n\tgpProgramUniform4i64vNV = uintptr(getProcAddr(\"glProgramUniform4i64vNV\"))\n\tgpProgramUniform4iEXT = uintptr(getProcAddr(\"glProgramUniform4iEXT\"))\n\tgpProgramUniform4iv = uintptr(getProcAddr(\"glProgramUniform4iv\"))\n\tgpProgramUniform4ivEXT = uintptr(getProcAddr(\"glProgramUniform4ivEXT\"))\n\tgpProgramUniform4ui = uintptr(getProcAddr(\"glProgramUniform4ui\"))\n\tgpProgramUniform4ui64ARB = uintptr(getProcAddr(\"glProgramUniform4ui64ARB\"))\n\tgpProgramUniform4ui64NV = uintptr(getProcAddr(\"glProgramUniform4ui64NV\"))\n\tgpProgramUniform4ui64vARB = uintptr(getProcAddr(\"glProgramUniform4ui64vARB\"))\n\tgpProgramUniform4ui64vNV = uintptr(getProcAddr(\"glProgramUniform4ui64vNV\"))\n\tgpProgramUniform4uiEXT = uintptr(getProcAddr(\"glProgramUniform4uiEXT\"))\n\tgpProgramUniform4uiv = uintptr(getProcAddr(\"glProgramUniform4uiv\"))\n\tgpProgramUniform4uivEXT = uintptr(getProcAddr(\"glProgramUniform4uivEXT\"))\n\tgpProgramUniformHandleui64ARB = uintptr(getProcAddr(\"glProgramUniformHandleui64ARB\"))\n\tgpProgramUniformHandleui64NV = uintptr(getProcAddr(\"glProgramUniformHandleui64NV\"))\n\tgpProgramUniformHandleui64vARB = uintptr(getProcAddr(\"glProgramUniformHandleui64vARB\"))\n\tgpProgramUniformHandleui64vNV = uintptr(getProcAddr(\"glProgramUniformHandleui64vNV\"))\n\tgpProgramUniformMatrix2dv = uintptr(getProcAddr(\"glProgramUniformMatrix2dv\"))\n\tgpProgramUniformMatrix2dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix2dvEXT\"))\n\tgpProgramUniformMatrix2fv = uintptr(getProcAddr(\"glProgramUniformMatrix2fv\"))\n\tgpProgramUniformMatrix2fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix2fvEXT\"))\n\tgpProgramUniformMatrix2x3dv = uintptr(getProcAddr(\"glProgramUniformMatrix2x3dv\"))\n\tgpProgramUniformMatrix2x3dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix2x3dvEXT\"))\n\tgpProgramUniformMatrix2x3fv = uintptr(getProcAddr(\"glProgramUniformMatrix2x3fv\"))\n\tgpProgramUniformMatrix2x3fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix2x3fvEXT\"))\n\tgpProgramUniformMatrix2x4dv = uintptr(getProcAddr(\"glProgramUniformMatrix2x4dv\"))\n\tgpProgramUniformMatrix2x4dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix2x4dvEXT\"))\n\tgpProgramUniformMatrix2x4fv = uintptr(getProcAddr(\"glProgramUniformMatrix2x4fv\"))\n\tgpProgramUniformMatrix2x4fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix2x4fvEXT\"))\n\tgpProgramUniformMatrix3dv = uintptr(getProcAddr(\"glProgramUniformMatrix3dv\"))\n\tgpProgramUniformMatrix3dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix3dvEXT\"))\n\tgpProgramUniformMatrix3fv = uintptr(getProcAddr(\"glProgramUniformMatrix3fv\"))\n\tgpProgramUniformMatrix3fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix3fvEXT\"))\n\tgpProgramUniformMatrix3x2dv = uintptr(getProcAddr(\"glProgramUniformMatrix3x2dv\"))\n\tgpProgramUniformMatrix3x2dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix3x2dvEXT\"))\n\tgpProgramUniformMatrix3x2fv = uintptr(getProcAddr(\"glProgramUniformMatrix3x2fv\"))\n\tgpProgramUniformMatrix3x2fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix3x2fvEXT\"))\n\tgpProgramUniformMatrix3x4dv = uintptr(getProcAddr(\"glProgramUniformMatrix3x4dv\"))\n\tgpProgramUniformMatrix3x4dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix3x4dvEXT\"))\n\tgpProgramUniformMatrix3x4fv = uintptr(getProcAddr(\"glProgramUniformMatrix3x4fv\"))\n\tgpProgramUniformMatrix3x4fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix3x4fvEXT\"))\n\tgpProgramUniformMatrix4dv = uintptr(getProcAddr(\"glProgramUniformMatrix4dv\"))\n\tgpProgramUniformMatrix4dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix4dvEXT\"))\n\tgpProgramUniformMatrix4fv = uintptr(getProcAddr(\"glProgramUniformMatrix4fv\"))\n\tgpProgramUniformMatrix4fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix4fvEXT\"))\n\tgpProgramUniformMatrix4x2dv = uintptr(getProcAddr(\"glProgramUniformMatrix4x2dv\"))\n\tgpProgramUniformMatrix4x2dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix4x2dvEXT\"))\n\tgpProgramUniformMatrix4x2fv = uintptr(getProcAddr(\"glProgramUniformMatrix4x2fv\"))\n\tgpProgramUniformMatrix4x2fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix4x2fvEXT\"))\n\tgpProgramUniformMatrix4x3dv = uintptr(getProcAddr(\"glProgramUniformMatrix4x3dv\"))\n\tgpProgramUniformMatrix4x3dvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix4x3dvEXT\"))\n\tgpProgramUniformMatrix4x3fv = uintptr(getProcAddr(\"glProgramUniformMatrix4x3fv\"))\n\tgpProgramUniformMatrix4x3fvEXT = uintptr(getProcAddr(\"glProgramUniformMatrix4x3fvEXT\"))\n\tgpProgramUniformui64NV = uintptr(getProcAddr(\"glProgramUniformui64NV\"))\n\tgpProgramUniformui64vNV = uintptr(getProcAddr(\"glProgramUniformui64vNV\"))\n\tgpProgramVertexLimitNV = uintptr(getProcAddr(\"glProgramVertexLimitNV\"))\n\tgpProvokingVertex = uintptr(getProcAddr(\"glProvokingVertex\"))\n\tgpProvokingVertexEXT = uintptr(getProcAddr(\"glProvokingVertexEXT\"))\n\tgpPushAttrib = uintptr(getProcAddr(\"glPushAttrib\"))\n\tif gpPushAttrib == 0 {\n\t\treturn errors.New(\"glPushAttrib\")\n\t}\n\tgpPushClientAttrib = uintptr(getProcAddr(\"glPushClientAttrib\"))\n\tif gpPushClientAttrib == 0 {\n\t\treturn errors.New(\"glPushClientAttrib\")\n\t}\n\tgpPushClientAttribDefaultEXT = uintptr(getProcAddr(\"glPushClientAttribDefaultEXT\"))\n\tgpPushDebugGroup = uintptr(getProcAddr(\"glPushDebugGroup\"))\n\tgpPushDebugGroupKHR = uintptr(getProcAddr(\"glPushDebugGroupKHR\"))\n\tgpPushGroupMarkerEXT = uintptr(getProcAddr(\"glPushGroupMarkerEXT\"))\n\tgpPushMatrix = uintptr(getProcAddr(\"glPushMatrix\"))\n\tif gpPushMatrix == 0 {\n\t\treturn errors.New(\"glPushMatrix\")\n\t}\n\tgpPushName = uintptr(getProcAddr(\"glPushName\"))\n\tif gpPushName == 0 {\n\t\treturn errors.New(\"glPushName\")\n\t}\n\tgpQueryCounter = uintptr(getProcAddr(\"glQueryCounter\"))\n\tgpQueryMatrixxOES = uintptr(getProcAddr(\"glQueryMatrixxOES\"))\n\tgpQueryObjectParameteruiAMD = uintptr(getProcAddr(\"glQueryObjectParameteruiAMD\"))\n\tgpQueryResourceNV = uintptr(getProcAddr(\"glQueryResourceNV\"))\n\tgpQueryResourceTagNV = uintptr(getProcAddr(\"glQueryResourceTagNV\"))\n\tgpRasterPos2d = uintptr(getProcAddr(\"glRasterPos2d\"))\n\tif gpRasterPos2d == 0 {\n\t\treturn errors.New(\"glRasterPos2d\")\n\t}\n\tgpRasterPos2dv = uintptr(getProcAddr(\"glRasterPos2dv\"))\n\tif gpRasterPos2dv == 0 {\n\t\treturn errors.New(\"glRasterPos2dv\")\n\t}\n\tgpRasterPos2f = uintptr(getProcAddr(\"glRasterPos2f\"))\n\tif gpRasterPos2f == 0 {\n\t\treturn errors.New(\"glRasterPos2f\")\n\t}\n\tgpRasterPos2fv = uintptr(getProcAddr(\"glRasterPos2fv\"))\n\tif gpRasterPos2fv == 0 {\n\t\treturn errors.New(\"glRasterPos2fv\")\n\t}\n\tgpRasterPos2i = uintptr(getProcAddr(\"glRasterPos2i\"))\n\tif gpRasterPos2i == 0 {\n\t\treturn errors.New(\"glRasterPos2i\")\n\t}\n\tgpRasterPos2iv = uintptr(getProcAddr(\"glRasterPos2iv\"))\n\tif gpRasterPos2iv == 0 {\n\t\treturn errors.New(\"glRasterPos2iv\")\n\t}\n\tgpRasterPos2s = uintptr(getProcAddr(\"glRasterPos2s\"))\n\tif gpRasterPos2s == 0 {\n\t\treturn errors.New(\"glRasterPos2s\")\n\t}\n\tgpRasterPos2sv = uintptr(getProcAddr(\"glRasterPos2sv\"))\n\tif gpRasterPos2sv == 0 {\n\t\treturn errors.New(\"glRasterPos2sv\")\n\t}\n\tgpRasterPos2xOES = uintptr(getProcAddr(\"glRasterPos2xOES\"))\n\tgpRasterPos2xvOES = uintptr(getProcAddr(\"glRasterPos2xvOES\"))\n\tgpRasterPos3d = uintptr(getProcAddr(\"glRasterPos3d\"))\n\tif gpRasterPos3d == 0 {\n\t\treturn errors.New(\"glRasterPos3d\")\n\t}\n\tgpRasterPos3dv = uintptr(getProcAddr(\"glRasterPos3dv\"))\n\tif gpRasterPos3dv == 0 {\n\t\treturn errors.New(\"glRasterPos3dv\")\n\t}\n\tgpRasterPos3f = uintptr(getProcAddr(\"glRasterPos3f\"))\n\tif gpRasterPos3f == 0 {\n\t\treturn errors.New(\"glRasterPos3f\")\n\t}\n\tgpRasterPos3fv = uintptr(getProcAddr(\"glRasterPos3fv\"))\n\tif gpRasterPos3fv == 0 {\n\t\treturn errors.New(\"glRasterPos3fv\")\n\t}\n\tgpRasterPos3i = uintptr(getProcAddr(\"glRasterPos3i\"))\n\tif gpRasterPos3i == 0 {\n\t\treturn errors.New(\"glRasterPos3i\")\n\t}\n\tgpRasterPos3iv = uintptr(getProcAddr(\"glRasterPos3iv\"))\n\tif gpRasterPos3iv == 0 {\n\t\treturn errors.New(\"glRasterPos3iv\")\n\t}\n\tgpRasterPos3s = uintptr(getProcAddr(\"glRasterPos3s\"))\n\tif gpRasterPos3s == 0 {\n\t\treturn errors.New(\"glRasterPos3s\")\n\t}\n\tgpRasterPos3sv = uintptr(getProcAddr(\"glRasterPos3sv\"))\n\tif gpRasterPos3sv == 0 {\n\t\treturn errors.New(\"glRasterPos3sv\")\n\t}\n\tgpRasterPos3xOES = uintptr(getProcAddr(\"glRasterPos3xOES\"))\n\tgpRasterPos3xvOES = uintptr(getProcAddr(\"glRasterPos3xvOES\"))\n\tgpRasterPos4d = uintptr(getProcAddr(\"glRasterPos4d\"))\n\tif gpRasterPos4d == 0 {\n\t\treturn errors.New(\"glRasterPos4d\")\n\t}\n\tgpRasterPos4dv = uintptr(getProcAddr(\"glRasterPos4dv\"))\n\tif gpRasterPos4dv == 0 {\n\t\treturn errors.New(\"glRasterPos4dv\")\n\t}\n\tgpRasterPos4f = uintptr(getProcAddr(\"glRasterPos4f\"))\n\tif gpRasterPos4f == 0 {\n\t\treturn errors.New(\"glRasterPos4f\")\n\t}\n\tgpRasterPos4fv = uintptr(getProcAddr(\"glRasterPos4fv\"))\n\tif gpRasterPos4fv == 0 {\n\t\treturn errors.New(\"glRasterPos4fv\")\n\t}\n\tgpRasterPos4i = uintptr(getProcAddr(\"glRasterPos4i\"))\n\tif gpRasterPos4i == 0 {\n\t\treturn errors.New(\"glRasterPos4i\")\n\t}\n\tgpRasterPos4iv = uintptr(getProcAddr(\"glRasterPos4iv\"))\n\tif gpRasterPos4iv == 0 {\n\t\treturn errors.New(\"glRasterPos4iv\")\n\t}\n\tgpRasterPos4s = uintptr(getProcAddr(\"glRasterPos4s\"))\n\tif gpRasterPos4s == 0 {\n\t\treturn errors.New(\"glRasterPos4s\")\n\t}\n\tgpRasterPos4sv = uintptr(getProcAddr(\"glRasterPos4sv\"))\n\tif gpRasterPos4sv == 0 {\n\t\treturn errors.New(\"glRasterPos4sv\")\n\t}\n\tgpRasterPos4xOES = uintptr(getProcAddr(\"glRasterPos4xOES\"))\n\tgpRasterPos4xvOES = uintptr(getProcAddr(\"glRasterPos4xvOES\"))\n\tgpRasterSamplesEXT = uintptr(getProcAddr(\"glRasterSamplesEXT\"))\n\tgpReadBuffer = uintptr(getProcAddr(\"glReadBuffer\"))\n\tif gpReadBuffer == 0 {\n\t\treturn errors.New(\"glReadBuffer\")\n\t}\n\tgpReadInstrumentsSGIX = uintptr(getProcAddr(\"glReadInstrumentsSGIX\"))\n\tgpReadPixels = uintptr(getProcAddr(\"glReadPixels\"))\n\tif gpReadPixels == 0 {\n\t\treturn errors.New(\"glReadPixels\")\n\t}\n\tgpReadnPixels = uintptr(getProcAddr(\"glReadnPixels\"))\n\tgpReadnPixelsARB = uintptr(getProcAddr(\"glReadnPixelsARB\"))\n\tgpReadnPixelsKHR = uintptr(getProcAddr(\"glReadnPixelsKHR\"))\n\tgpRectd = uintptr(getProcAddr(\"glRectd\"))\n\tif gpRectd == 0 {\n\t\treturn errors.New(\"glRectd\")\n\t}\n\tgpRectdv = uintptr(getProcAddr(\"glRectdv\"))\n\tif gpRectdv == 0 {\n\t\treturn errors.New(\"glRectdv\")\n\t}\n\tgpRectf = uintptr(getProcAddr(\"glRectf\"))\n\tif gpRectf == 0 {\n\t\treturn errors.New(\"glRectf\")\n\t}\n\tgpRectfv = uintptr(getProcAddr(\"glRectfv\"))\n\tif gpRectfv == 0 {\n\t\treturn errors.New(\"glRectfv\")\n\t}\n\tgpRecti = uintptr(getProcAddr(\"glRecti\"))\n\tif gpRecti == 0 {\n\t\treturn errors.New(\"glRecti\")\n\t}\n\tgpRectiv = uintptr(getProcAddr(\"glRectiv\"))\n\tif gpRectiv == 0 {\n\t\treturn errors.New(\"glRectiv\")\n\t}\n\tgpRects = uintptr(getProcAddr(\"glRects\"))\n\tif gpRects == 0 {\n\t\treturn errors.New(\"glRects\")\n\t}\n\tgpRectsv = uintptr(getProcAddr(\"glRectsv\"))\n\tif gpRectsv == 0 {\n\t\treturn errors.New(\"glRectsv\")\n\t}\n\tgpRectxOES = uintptr(getProcAddr(\"glRectxOES\"))\n\tgpRectxvOES = uintptr(getProcAddr(\"glRectxvOES\"))\n\tgpReferencePlaneSGIX = uintptr(getProcAddr(\"glReferencePlaneSGIX\"))\n\tgpReleaseKeyedMutexWin32EXT = uintptr(getProcAddr(\"glReleaseKeyedMutexWin32EXT\"))\n\tgpReleaseShaderCompiler = uintptr(getProcAddr(\"glReleaseShaderCompiler\"))\n\tgpRenderGpuMaskNV = uintptr(getProcAddr(\"glRenderGpuMaskNV\"))\n\tgpRenderMode = uintptr(getProcAddr(\"glRenderMode\"))\n\tif gpRenderMode == 0 {\n\t\treturn errors.New(\"glRenderMode\")\n\t}\n\tgpRenderbufferStorage = uintptr(getProcAddr(\"glRenderbufferStorage\"))\n\tgpRenderbufferStorageEXT = uintptr(getProcAddr(\"glRenderbufferStorageEXT\"))\n\tgpRenderbufferStorageMultisample = uintptr(getProcAddr(\"glRenderbufferStorageMultisample\"))\n\tgpRenderbufferStorageMultisampleCoverageNV = uintptr(getProcAddr(\"glRenderbufferStorageMultisampleCoverageNV\"))\n\tgpRenderbufferStorageMultisampleEXT = uintptr(getProcAddr(\"glRenderbufferStorageMultisampleEXT\"))\n\tgpReplacementCodePointerSUN = uintptr(getProcAddr(\"glReplacementCodePointerSUN\"))\n\tgpReplacementCodeubSUN = uintptr(getProcAddr(\"glReplacementCodeubSUN\"))\n\tgpReplacementCodeubvSUN = uintptr(getProcAddr(\"glReplacementCodeubvSUN\"))\n\tgpReplacementCodeuiColor3fVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiColor3fVertex3fSUN\"))\n\tgpReplacementCodeuiColor3fVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiColor3fVertex3fvSUN\"))\n\tgpReplacementCodeuiColor4fNormal3fVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiColor4fNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiColor4fNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiColor4fNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiColor4ubVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiColor4ubVertex3fSUN\"))\n\tgpReplacementCodeuiColor4ubVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiColor4ubVertex3fvSUN\"))\n\tgpReplacementCodeuiNormal3fVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiSUN = uintptr(getProcAddr(\"glReplacementCodeuiSUN\"))\n\tgpReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiTexCoord2fVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiTexCoord2fVertex3fSUN\"))\n\tgpReplacementCodeuiTexCoord2fVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiTexCoord2fVertex3fvSUN\"))\n\tgpReplacementCodeuiVertex3fSUN = uintptr(getProcAddr(\"glReplacementCodeuiVertex3fSUN\"))\n\tgpReplacementCodeuiVertex3fvSUN = uintptr(getProcAddr(\"glReplacementCodeuiVertex3fvSUN\"))\n\tgpReplacementCodeuivSUN = uintptr(getProcAddr(\"glReplacementCodeuivSUN\"))\n\tgpReplacementCodeusSUN = uintptr(getProcAddr(\"glReplacementCodeusSUN\"))\n\tgpReplacementCodeusvSUN = uintptr(getProcAddr(\"glReplacementCodeusvSUN\"))\n\tgpRequestResidentProgramsNV = uintptr(getProcAddr(\"glRequestResidentProgramsNV\"))\n\tgpResetHistogramEXT = uintptr(getProcAddr(\"glResetHistogramEXT\"))\n\tgpResetMinmaxEXT = uintptr(getProcAddr(\"glResetMinmaxEXT\"))\n\tgpResizeBuffersMESA = uintptr(getProcAddr(\"glResizeBuffersMESA\"))\n\tgpResolveDepthValuesNV = uintptr(getProcAddr(\"glResolveDepthValuesNV\"))\n\tgpResumeTransformFeedback = uintptr(getProcAddr(\"glResumeTransformFeedback\"))\n\tgpResumeTransformFeedbackNV = uintptr(getProcAddr(\"glResumeTransformFeedbackNV\"))\n\tgpRotated = uintptr(getProcAddr(\"glRotated\"))\n\tif gpRotated == 0 {\n\t\treturn errors.New(\"glRotated\")\n\t}\n\tgpRotatef = uintptr(getProcAddr(\"glRotatef\"))\n\tif gpRotatef == 0 {\n\t\treturn errors.New(\"glRotatef\")\n\t}\n\tgpRotatexOES = uintptr(getProcAddr(\"glRotatexOES\"))\n\tgpSampleCoverage = uintptr(getProcAddr(\"glSampleCoverage\"))\n\tif gpSampleCoverage == 0 {\n\t\treturn errors.New(\"glSampleCoverage\")\n\t}\n\tgpSampleCoverageARB = uintptr(getProcAddr(\"glSampleCoverageARB\"))\n\tgpSampleCoveragexOES = uintptr(getProcAddr(\"glSampleCoveragexOES\"))\n\tgpSampleMapATI = uintptr(getProcAddr(\"glSampleMapATI\"))\n\tgpSampleMaskEXT = uintptr(getProcAddr(\"glSampleMaskEXT\"))\n\tgpSampleMaskIndexedNV = uintptr(getProcAddr(\"glSampleMaskIndexedNV\"))\n\tgpSampleMaskSGIS = uintptr(getProcAddr(\"glSampleMaskSGIS\"))\n\tgpSampleMaski = uintptr(getProcAddr(\"glSampleMaski\"))\n\tgpSamplePatternEXT = uintptr(getProcAddr(\"glSamplePatternEXT\"))\n\tgpSamplePatternSGIS = uintptr(getProcAddr(\"glSamplePatternSGIS\"))\n\tgpSamplerParameterIiv = uintptr(getProcAddr(\"glSamplerParameterIiv\"))\n\tgpSamplerParameterIuiv = uintptr(getProcAddr(\"glSamplerParameterIuiv\"))\n\tgpSamplerParameterf = uintptr(getProcAddr(\"glSamplerParameterf\"))\n\tgpSamplerParameterfv = uintptr(getProcAddr(\"glSamplerParameterfv\"))\n\tgpSamplerParameteri = uintptr(getProcAddr(\"glSamplerParameteri\"))\n\tgpSamplerParameteriv = uintptr(getProcAddr(\"glSamplerParameteriv\"))\n\tgpScaled = uintptr(getProcAddr(\"glScaled\"))\n\tif gpScaled == 0 {\n\t\treturn errors.New(\"glScaled\")\n\t}\n\tgpScalef = uintptr(getProcAddr(\"glScalef\"))\n\tif gpScalef == 0 {\n\t\treturn errors.New(\"glScalef\")\n\t}\n\tgpScalexOES = uintptr(getProcAddr(\"glScalexOES\"))\n\tgpScissor = uintptr(getProcAddr(\"glScissor\"))\n\tif gpScissor == 0 {\n\t\treturn errors.New(\"glScissor\")\n\t}\n\tgpScissorArrayv = uintptr(getProcAddr(\"glScissorArrayv\"))\n\tgpScissorIndexed = uintptr(getProcAddr(\"glScissorIndexed\"))\n\tgpScissorIndexedv = uintptr(getProcAddr(\"glScissorIndexedv\"))\n\tgpSecondaryColor3b = uintptr(getProcAddr(\"glSecondaryColor3b\"))\n\tif gpSecondaryColor3b == 0 {\n\t\treturn errors.New(\"glSecondaryColor3b\")\n\t}\n\tgpSecondaryColor3bEXT = uintptr(getProcAddr(\"glSecondaryColor3bEXT\"))\n\tgpSecondaryColor3bv = uintptr(getProcAddr(\"glSecondaryColor3bv\"))\n\tif gpSecondaryColor3bv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3bv\")\n\t}\n\tgpSecondaryColor3bvEXT = uintptr(getProcAddr(\"glSecondaryColor3bvEXT\"))\n\tgpSecondaryColor3d = uintptr(getProcAddr(\"glSecondaryColor3d\"))\n\tif gpSecondaryColor3d == 0 {\n\t\treturn errors.New(\"glSecondaryColor3d\")\n\t}\n\tgpSecondaryColor3dEXT = uintptr(getProcAddr(\"glSecondaryColor3dEXT\"))\n\tgpSecondaryColor3dv = uintptr(getProcAddr(\"glSecondaryColor3dv\"))\n\tif gpSecondaryColor3dv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3dv\")\n\t}\n\tgpSecondaryColor3dvEXT = uintptr(getProcAddr(\"glSecondaryColor3dvEXT\"))\n\tgpSecondaryColor3f = uintptr(getProcAddr(\"glSecondaryColor3f\"))\n\tif gpSecondaryColor3f == 0 {\n\t\treturn errors.New(\"glSecondaryColor3f\")\n\t}\n\tgpSecondaryColor3fEXT = uintptr(getProcAddr(\"glSecondaryColor3fEXT\"))\n\tgpSecondaryColor3fv = uintptr(getProcAddr(\"glSecondaryColor3fv\"))\n\tif gpSecondaryColor3fv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3fv\")\n\t}\n\tgpSecondaryColor3fvEXT = uintptr(getProcAddr(\"glSecondaryColor3fvEXT\"))\n\tgpSecondaryColor3hNV = uintptr(getProcAddr(\"glSecondaryColor3hNV\"))\n\tgpSecondaryColor3hvNV = uintptr(getProcAddr(\"glSecondaryColor3hvNV\"))\n\tgpSecondaryColor3i = uintptr(getProcAddr(\"glSecondaryColor3i\"))\n\tif gpSecondaryColor3i == 0 {\n\t\treturn errors.New(\"glSecondaryColor3i\")\n\t}\n\tgpSecondaryColor3iEXT = uintptr(getProcAddr(\"glSecondaryColor3iEXT\"))\n\tgpSecondaryColor3iv = uintptr(getProcAddr(\"glSecondaryColor3iv\"))\n\tif gpSecondaryColor3iv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3iv\")\n\t}\n\tgpSecondaryColor3ivEXT = uintptr(getProcAddr(\"glSecondaryColor3ivEXT\"))\n\tgpSecondaryColor3s = uintptr(getProcAddr(\"glSecondaryColor3s\"))\n\tif gpSecondaryColor3s == 0 {\n\t\treturn errors.New(\"glSecondaryColor3s\")\n\t}\n\tgpSecondaryColor3sEXT = uintptr(getProcAddr(\"glSecondaryColor3sEXT\"))\n\tgpSecondaryColor3sv = uintptr(getProcAddr(\"glSecondaryColor3sv\"))\n\tif gpSecondaryColor3sv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3sv\")\n\t}\n\tgpSecondaryColor3svEXT = uintptr(getProcAddr(\"glSecondaryColor3svEXT\"))\n\tgpSecondaryColor3ub = uintptr(getProcAddr(\"glSecondaryColor3ub\"))\n\tif gpSecondaryColor3ub == 0 {\n\t\treturn errors.New(\"glSecondaryColor3ub\")\n\t}\n\tgpSecondaryColor3ubEXT = uintptr(getProcAddr(\"glSecondaryColor3ubEXT\"))\n\tgpSecondaryColor3ubv = uintptr(getProcAddr(\"glSecondaryColor3ubv\"))\n\tif gpSecondaryColor3ubv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3ubv\")\n\t}\n\tgpSecondaryColor3ubvEXT = uintptr(getProcAddr(\"glSecondaryColor3ubvEXT\"))\n\tgpSecondaryColor3ui = uintptr(getProcAddr(\"glSecondaryColor3ui\"))\n\tif gpSecondaryColor3ui == 0 {\n\t\treturn errors.New(\"glSecondaryColor3ui\")\n\t}\n\tgpSecondaryColor3uiEXT = uintptr(getProcAddr(\"glSecondaryColor3uiEXT\"))\n\tgpSecondaryColor3uiv = uintptr(getProcAddr(\"glSecondaryColor3uiv\"))\n\tif gpSecondaryColor3uiv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3uiv\")\n\t}\n\tgpSecondaryColor3uivEXT = uintptr(getProcAddr(\"glSecondaryColor3uivEXT\"))\n\tgpSecondaryColor3us = uintptr(getProcAddr(\"glSecondaryColor3us\"))\n\tif gpSecondaryColor3us == 0 {\n\t\treturn errors.New(\"glSecondaryColor3us\")\n\t}\n\tgpSecondaryColor3usEXT = uintptr(getProcAddr(\"glSecondaryColor3usEXT\"))\n\tgpSecondaryColor3usv = uintptr(getProcAddr(\"glSecondaryColor3usv\"))\n\tif gpSecondaryColor3usv == 0 {\n\t\treturn errors.New(\"glSecondaryColor3usv\")\n\t}\n\tgpSecondaryColor3usvEXT = uintptr(getProcAddr(\"glSecondaryColor3usvEXT\"))\n\tgpSecondaryColorFormatNV = uintptr(getProcAddr(\"glSecondaryColorFormatNV\"))\n\tgpSecondaryColorPointer = uintptr(getProcAddr(\"glSecondaryColorPointer\"))\n\tif gpSecondaryColorPointer == 0 {\n\t\treturn errors.New(\"glSecondaryColorPointer\")\n\t}\n\tgpSecondaryColorPointerEXT = uintptr(getProcAddr(\"glSecondaryColorPointerEXT\"))\n\tgpSecondaryColorPointerListIBM = uintptr(getProcAddr(\"glSecondaryColorPointerListIBM\"))\n\tgpSelectBuffer = uintptr(getProcAddr(\"glSelectBuffer\"))\n\tif gpSelectBuffer == 0 {\n\t\treturn errors.New(\"glSelectBuffer\")\n\t}\n\tgpSelectPerfMonitorCountersAMD = uintptr(getProcAddr(\"glSelectPerfMonitorCountersAMD\"))\n\tgpSemaphoreParameterui64vEXT = uintptr(getProcAddr(\"glSemaphoreParameterui64vEXT\"))\n\tgpSeparableFilter2DEXT = uintptr(getProcAddr(\"glSeparableFilter2DEXT\"))\n\tgpSetFenceAPPLE = uintptr(getProcAddr(\"glSetFenceAPPLE\"))\n\tgpSetFenceNV = uintptr(getProcAddr(\"glSetFenceNV\"))\n\tgpSetFragmentShaderConstantATI = uintptr(getProcAddr(\"glSetFragmentShaderConstantATI\"))\n\tgpSetInvariantEXT = uintptr(getProcAddr(\"glSetInvariantEXT\"))\n\tgpSetLocalConstantEXT = uintptr(getProcAddr(\"glSetLocalConstantEXT\"))\n\tgpSetMultisamplefvAMD = uintptr(getProcAddr(\"glSetMultisamplefvAMD\"))\n\tgpShadeModel = uintptr(getProcAddr(\"glShadeModel\"))\n\tif gpShadeModel == 0 {\n\t\treturn errors.New(\"glShadeModel\")\n\t}\n\tgpShaderBinary = uintptr(getProcAddr(\"glShaderBinary\"))\n\tgpShaderOp1EXT = uintptr(getProcAddr(\"glShaderOp1EXT\"))\n\tgpShaderOp2EXT = uintptr(getProcAddr(\"glShaderOp2EXT\"))\n\tgpShaderOp3EXT = uintptr(getProcAddr(\"glShaderOp3EXT\"))\n\tgpShaderSource = uintptr(getProcAddr(\"glShaderSource\"))\n\tif gpShaderSource == 0 {\n\t\treturn errors.New(\"glShaderSource\")\n\t}\n\tgpShaderSourceARB = uintptr(getProcAddr(\"glShaderSourceARB\"))\n\tgpShaderStorageBlockBinding = uintptr(getProcAddr(\"glShaderStorageBlockBinding\"))\n\tgpSharpenTexFuncSGIS = uintptr(getProcAddr(\"glSharpenTexFuncSGIS\"))\n\tgpSignalSemaphoreEXT = uintptr(getProcAddr(\"glSignalSemaphoreEXT\"))\n\tgpSignalVkFenceNV = uintptr(getProcAddr(\"glSignalVkFenceNV\"))\n\tgpSignalVkSemaphoreNV = uintptr(getProcAddr(\"glSignalVkSemaphoreNV\"))\n\tgpSpecializeShaderARB = uintptr(getProcAddr(\"glSpecializeShaderARB\"))\n\tgpSpriteParameterfSGIX = uintptr(getProcAddr(\"glSpriteParameterfSGIX\"))\n\tgpSpriteParameterfvSGIX = uintptr(getProcAddr(\"glSpriteParameterfvSGIX\"))\n\tgpSpriteParameteriSGIX = uintptr(getProcAddr(\"glSpriteParameteriSGIX\"))\n\tgpSpriteParameterivSGIX = uintptr(getProcAddr(\"glSpriteParameterivSGIX\"))\n\tgpStartInstrumentsSGIX = uintptr(getProcAddr(\"glStartInstrumentsSGIX\"))\n\tgpStateCaptureNV = uintptr(getProcAddr(\"glStateCaptureNV\"))\n\tgpStencilClearTagEXT = uintptr(getProcAddr(\"glStencilClearTagEXT\"))\n\tgpStencilFillPathInstancedNV = uintptr(getProcAddr(\"glStencilFillPathInstancedNV\"))\n\tgpStencilFillPathNV = uintptr(getProcAddr(\"glStencilFillPathNV\"))\n\tgpStencilFunc = uintptr(getProcAddr(\"glStencilFunc\"))\n\tif gpStencilFunc == 0 {\n\t\treturn errors.New(\"glStencilFunc\")\n\t}\n\tgpStencilFuncSeparate = uintptr(getProcAddr(\"glStencilFuncSeparate\"))\n\tif gpStencilFuncSeparate == 0 {\n\t\treturn errors.New(\"glStencilFuncSeparate\")\n\t}\n\tgpStencilFuncSeparateATI = uintptr(getProcAddr(\"glStencilFuncSeparateATI\"))\n\tgpStencilMask = uintptr(getProcAddr(\"glStencilMask\"))\n\tif gpStencilMask == 0 {\n\t\treturn errors.New(\"glStencilMask\")\n\t}\n\tgpStencilMaskSeparate = uintptr(getProcAddr(\"glStencilMaskSeparate\"))\n\tif gpStencilMaskSeparate == 0 {\n\t\treturn errors.New(\"glStencilMaskSeparate\")\n\t}\n\tgpStencilOp = uintptr(getProcAddr(\"glStencilOp\"))\n\tif gpStencilOp == 0 {\n\t\treturn errors.New(\"glStencilOp\")\n\t}\n\tgpStencilOpSeparate = uintptr(getProcAddr(\"glStencilOpSeparate\"))\n\tif gpStencilOpSeparate == 0 {\n\t\treturn errors.New(\"glStencilOpSeparate\")\n\t}\n\tgpStencilOpSeparateATI = uintptr(getProcAddr(\"glStencilOpSeparateATI\"))\n\tgpStencilOpValueAMD = uintptr(getProcAddr(\"glStencilOpValueAMD\"))\n\tgpStencilStrokePathInstancedNV = uintptr(getProcAddr(\"glStencilStrokePathInstancedNV\"))\n\tgpStencilStrokePathNV = uintptr(getProcAddr(\"glStencilStrokePathNV\"))\n\tgpStencilThenCoverFillPathInstancedNV = uintptr(getProcAddr(\"glStencilThenCoverFillPathInstancedNV\"))\n\tgpStencilThenCoverFillPathNV = uintptr(getProcAddr(\"glStencilThenCoverFillPathNV\"))\n\tgpStencilThenCoverStrokePathInstancedNV = uintptr(getProcAddr(\"glStencilThenCoverStrokePathInstancedNV\"))\n\tgpStencilThenCoverStrokePathNV = uintptr(getProcAddr(\"glStencilThenCoverStrokePathNV\"))\n\tgpStopInstrumentsSGIX = uintptr(getProcAddr(\"glStopInstrumentsSGIX\"))\n\tgpStringMarkerGREMEDY = uintptr(getProcAddr(\"glStringMarkerGREMEDY\"))\n\tgpSubpixelPrecisionBiasNV = uintptr(getProcAddr(\"glSubpixelPrecisionBiasNV\"))\n\tgpSwizzleEXT = uintptr(getProcAddr(\"glSwizzleEXT\"))\n\tgpSyncTextureINTEL = uintptr(getProcAddr(\"glSyncTextureINTEL\"))\n\tgpTagSampleBufferSGIX = uintptr(getProcAddr(\"glTagSampleBufferSGIX\"))\n\tgpTangent3bEXT = uintptr(getProcAddr(\"glTangent3bEXT\"))\n\tgpTangent3bvEXT = uintptr(getProcAddr(\"glTangent3bvEXT\"))\n\tgpTangent3dEXT = uintptr(getProcAddr(\"glTangent3dEXT\"))\n\tgpTangent3dvEXT = uintptr(getProcAddr(\"glTangent3dvEXT\"))\n\tgpTangent3fEXT = uintptr(getProcAddr(\"glTangent3fEXT\"))\n\tgpTangent3fvEXT = uintptr(getProcAddr(\"glTangent3fvEXT\"))\n\tgpTangent3iEXT = uintptr(getProcAddr(\"glTangent3iEXT\"))\n\tgpTangent3ivEXT = uintptr(getProcAddr(\"glTangent3ivEXT\"))\n\tgpTangent3sEXT = uintptr(getProcAddr(\"glTangent3sEXT\"))\n\tgpTangent3svEXT = uintptr(getProcAddr(\"glTangent3svEXT\"))\n\tgpTangentPointerEXT = uintptr(getProcAddr(\"glTangentPointerEXT\"))\n\tgpTbufferMask3DFX = uintptr(getProcAddr(\"glTbufferMask3DFX\"))\n\tgpTessellationFactorAMD = uintptr(getProcAddr(\"glTessellationFactorAMD\"))\n\tgpTessellationModeAMD = uintptr(getProcAddr(\"glTessellationModeAMD\"))\n\tgpTestFenceAPPLE = uintptr(getProcAddr(\"glTestFenceAPPLE\"))\n\tgpTestFenceNV = uintptr(getProcAddr(\"glTestFenceNV\"))\n\tgpTestObjectAPPLE = uintptr(getProcAddr(\"glTestObjectAPPLE\"))\n\tgpTexBufferARB = uintptr(getProcAddr(\"glTexBufferARB\"))\n\tgpTexBufferEXT = uintptr(getProcAddr(\"glTexBufferEXT\"))\n\tgpTexBufferRange = uintptr(getProcAddr(\"glTexBufferRange\"))\n\tgpTexBumpParameterfvATI = uintptr(getProcAddr(\"glTexBumpParameterfvATI\"))\n\tgpTexBumpParameterivATI = uintptr(getProcAddr(\"glTexBumpParameterivATI\"))\n\tgpTexCoord1bOES = uintptr(getProcAddr(\"glTexCoord1bOES\"))\n\tgpTexCoord1bvOES = uintptr(getProcAddr(\"glTexCoord1bvOES\"))\n\tgpTexCoord1d = uintptr(getProcAddr(\"glTexCoord1d\"))\n\tif gpTexCoord1d == 0 {\n\t\treturn errors.New(\"glTexCoord1d\")\n\t}\n\tgpTexCoord1dv = uintptr(getProcAddr(\"glTexCoord1dv\"))\n\tif gpTexCoord1dv == 0 {\n\t\treturn errors.New(\"glTexCoord1dv\")\n\t}\n\tgpTexCoord1f = uintptr(getProcAddr(\"glTexCoord1f\"))\n\tif gpTexCoord1f == 0 {\n\t\treturn errors.New(\"glTexCoord1f\")\n\t}\n\tgpTexCoord1fv = uintptr(getProcAddr(\"glTexCoord1fv\"))\n\tif gpTexCoord1fv == 0 {\n\t\treturn errors.New(\"glTexCoord1fv\")\n\t}\n\tgpTexCoord1hNV = uintptr(getProcAddr(\"glTexCoord1hNV\"))\n\tgpTexCoord1hvNV = uintptr(getProcAddr(\"glTexCoord1hvNV\"))\n\tgpTexCoord1i = uintptr(getProcAddr(\"glTexCoord1i\"))\n\tif gpTexCoord1i == 0 {\n\t\treturn errors.New(\"glTexCoord1i\")\n\t}\n\tgpTexCoord1iv = uintptr(getProcAddr(\"glTexCoord1iv\"))\n\tif gpTexCoord1iv == 0 {\n\t\treturn errors.New(\"glTexCoord1iv\")\n\t}\n\tgpTexCoord1s = uintptr(getProcAddr(\"glTexCoord1s\"))\n\tif gpTexCoord1s == 0 {\n\t\treturn errors.New(\"glTexCoord1s\")\n\t}\n\tgpTexCoord1sv = uintptr(getProcAddr(\"glTexCoord1sv\"))\n\tif gpTexCoord1sv == 0 {\n\t\treturn errors.New(\"glTexCoord1sv\")\n\t}\n\tgpTexCoord1xOES = uintptr(getProcAddr(\"glTexCoord1xOES\"))\n\tgpTexCoord1xvOES = uintptr(getProcAddr(\"glTexCoord1xvOES\"))\n\tgpTexCoord2bOES = uintptr(getProcAddr(\"glTexCoord2bOES\"))\n\tgpTexCoord2bvOES = uintptr(getProcAddr(\"glTexCoord2bvOES\"))\n\tgpTexCoord2d = uintptr(getProcAddr(\"glTexCoord2d\"))\n\tif gpTexCoord2d == 0 {\n\t\treturn errors.New(\"glTexCoord2d\")\n\t}\n\tgpTexCoord2dv = uintptr(getProcAddr(\"glTexCoord2dv\"))\n\tif gpTexCoord2dv == 0 {\n\t\treturn errors.New(\"glTexCoord2dv\")\n\t}\n\tgpTexCoord2f = uintptr(getProcAddr(\"glTexCoord2f\"))\n\tif gpTexCoord2f == 0 {\n\t\treturn errors.New(\"glTexCoord2f\")\n\t}\n\tgpTexCoord2fColor3fVertex3fSUN = uintptr(getProcAddr(\"glTexCoord2fColor3fVertex3fSUN\"))\n\tgpTexCoord2fColor3fVertex3fvSUN = uintptr(getProcAddr(\"glTexCoord2fColor3fVertex3fvSUN\"))\n\tgpTexCoord2fColor4fNormal3fVertex3fSUN = uintptr(getProcAddr(\"glTexCoord2fColor4fNormal3fVertex3fSUN\"))\n\tgpTexCoord2fColor4fNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glTexCoord2fColor4fNormal3fVertex3fvSUN\"))\n\tgpTexCoord2fColor4ubVertex3fSUN = uintptr(getProcAddr(\"glTexCoord2fColor4ubVertex3fSUN\"))\n\tgpTexCoord2fColor4ubVertex3fvSUN = uintptr(getProcAddr(\"glTexCoord2fColor4ubVertex3fvSUN\"))\n\tgpTexCoord2fNormal3fVertex3fSUN = uintptr(getProcAddr(\"glTexCoord2fNormal3fVertex3fSUN\"))\n\tgpTexCoord2fNormal3fVertex3fvSUN = uintptr(getProcAddr(\"glTexCoord2fNormal3fVertex3fvSUN\"))\n\tgpTexCoord2fVertex3fSUN = uintptr(getProcAddr(\"glTexCoord2fVertex3fSUN\"))\n\tgpTexCoord2fVertex3fvSUN = uintptr(getProcAddr(\"glTexCoord2fVertex3fvSUN\"))\n\tgpTexCoord2fv = uintptr(getProcAddr(\"glTexCoord2fv\"))\n\tif gpTexCoord2fv == 0 {\n\t\treturn errors.New(\"glTexCoord2fv\")\n\t}\n\tgpTexCoord2hNV = uintptr(getProcAddr(\"glTexCoord2hNV\"))\n\tgpTexCoord2hvNV = uintptr(getProcAddr(\"glTexCoord2hvNV\"))\n\tgpTexCoord2i = uintptr(getProcAddr(\"glTexCoord2i\"))\n\tif gpTexCoord2i == 0 {\n\t\treturn errors.New(\"glTexCoord2i\")\n\t}\n\tgpTexCoord2iv = uintptr(getProcAddr(\"glTexCoord2iv\"))\n\tif gpTexCoord2iv == 0 {\n\t\treturn errors.New(\"glTexCoord2iv\")\n\t}\n\tgpTexCoord2s = uintptr(getProcAddr(\"glTexCoord2s\"))\n\tif gpTexCoord2s == 0 {\n\t\treturn errors.New(\"glTexCoord2s\")\n\t}\n\tgpTexCoord2sv = uintptr(getProcAddr(\"glTexCoord2sv\"))\n\tif gpTexCoord2sv == 0 {\n\t\treturn errors.New(\"glTexCoord2sv\")\n\t}\n\tgpTexCoord2xOES = uintptr(getProcAddr(\"glTexCoord2xOES\"))\n\tgpTexCoord2xvOES = uintptr(getProcAddr(\"glTexCoord2xvOES\"))\n\tgpTexCoord3bOES = uintptr(getProcAddr(\"glTexCoord3bOES\"))\n\tgpTexCoord3bvOES = uintptr(getProcAddr(\"glTexCoord3bvOES\"))\n\tgpTexCoord3d = uintptr(getProcAddr(\"glTexCoord3d\"))\n\tif gpTexCoord3d == 0 {\n\t\treturn errors.New(\"glTexCoord3d\")\n\t}\n\tgpTexCoord3dv = uintptr(getProcAddr(\"glTexCoord3dv\"))\n\tif gpTexCoord3dv == 0 {\n\t\treturn errors.New(\"glTexCoord3dv\")\n\t}\n\tgpTexCoord3f = uintptr(getProcAddr(\"glTexCoord3f\"))\n\tif gpTexCoord3f == 0 {\n\t\treturn errors.New(\"glTexCoord3f\")\n\t}\n\tgpTexCoord3fv = uintptr(getProcAddr(\"glTexCoord3fv\"))\n\tif gpTexCoord3fv == 0 {\n\t\treturn errors.New(\"glTexCoord3fv\")\n\t}\n\tgpTexCoord3hNV = uintptr(getProcAddr(\"glTexCoord3hNV\"))\n\tgpTexCoord3hvNV = uintptr(getProcAddr(\"glTexCoord3hvNV\"))\n\tgpTexCoord3i = uintptr(getProcAddr(\"glTexCoord3i\"))\n\tif gpTexCoord3i == 0 {\n\t\treturn errors.New(\"glTexCoord3i\")\n\t}\n\tgpTexCoord3iv = uintptr(getProcAddr(\"glTexCoord3iv\"))\n\tif gpTexCoord3iv == 0 {\n\t\treturn errors.New(\"glTexCoord3iv\")\n\t}\n\tgpTexCoord3s = uintptr(getProcAddr(\"glTexCoord3s\"))\n\tif gpTexCoord3s == 0 {\n\t\treturn errors.New(\"glTexCoord3s\")\n\t}\n\tgpTexCoord3sv = uintptr(getProcAddr(\"glTexCoord3sv\"))\n\tif gpTexCoord3sv == 0 {\n\t\treturn errors.New(\"glTexCoord3sv\")\n\t}\n\tgpTexCoord3xOES = uintptr(getProcAddr(\"glTexCoord3xOES\"))\n\tgpTexCoord3xvOES = uintptr(getProcAddr(\"glTexCoord3xvOES\"))\n\tgpTexCoord4bOES = uintptr(getProcAddr(\"glTexCoord4bOES\"))\n\tgpTexCoord4bvOES = uintptr(getProcAddr(\"glTexCoord4bvOES\"))\n\tgpTexCoord4d = uintptr(getProcAddr(\"glTexCoord4d\"))\n\tif gpTexCoord4d == 0 {\n\t\treturn errors.New(\"glTexCoord4d\")\n\t}\n\tgpTexCoord4dv = uintptr(getProcAddr(\"glTexCoord4dv\"))\n\tif gpTexCoord4dv == 0 {\n\t\treturn errors.New(\"glTexCoord4dv\")\n\t}\n\tgpTexCoord4f = uintptr(getProcAddr(\"glTexCoord4f\"))\n\tif gpTexCoord4f == 0 {\n\t\treturn errors.New(\"glTexCoord4f\")\n\t}\n\tgpTexCoord4fColor4fNormal3fVertex4fSUN = uintptr(getProcAddr(\"glTexCoord4fColor4fNormal3fVertex4fSUN\"))\n\tgpTexCoord4fColor4fNormal3fVertex4fvSUN = uintptr(getProcAddr(\"glTexCoord4fColor4fNormal3fVertex4fvSUN\"))\n\tgpTexCoord4fVertex4fSUN = uintptr(getProcAddr(\"glTexCoord4fVertex4fSUN\"))\n\tgpTexCoord4fVertex4fvSUN = uintptr(getProcAddr(\"glTexCoord4fVertex4fvSUN\"))\n\tgpTexCoord4fv = uintptr(getProcAddr(\"glTexCoord4fv\"))\n\tif gpTexCoord4fv == 0 {\n\t\treturn errors.New(\"glTexCoord4fv\")\n\t}\n\tgpTexCoord4hNV = uintptr(getProcAddr(\"glTexCoord4hNV\"))\n\tgpTexCoord4hvNV = uintptr(getProcAddr(\"glTexCoord4hvNV\"))\n\tgpTexCoord4i = uintptr(getProcAddr(\"glTexCoord4i\"))\n\tif gpTexCoord4i == 0 {\n\t\treturn errors.New(\"glTexCoord4i\")\n\t}\n\tgpTexCoord4iv = uintptr(getProcAddr(\"glTexCoord4iv\"))\n\tif gpTexCoord4iv == 0 {\n\t\treturn errors.New(\"glTexCoord4iv\")\n\t}\n\tgpTexCoord4s = uintptr(getProcAddr(\"glTexCoord4s\"))\n\tif gpTexCoord4s == 0 {\n\t\treturn errors.New(\"glTexCoord4s\")\n\t}\n\tgpTexCoord4sv = uintptr(getProcAddr(\"glTexCoord4sv\"))\n\tif gpTexCoord4sv == 0 {\n\t\treturn errors.New(\"glTexCoord4sv\")\n\t}\n\tgpTexCoord4xOES = uintptr(getProcAddr(\"glTexCoord4xOES\"))\n\tgpTexCoord4xvOES = uintptr(getProcAddr(\"glTexCoord4xvOES\"))\n\tgpTexCoordFormatNV = uintptr(getProcAddr(\"glTexCoordFormatNV\"))\n\tgpTexCoordPointer = uintptr(getProcAddr(\"glTexCoordPointer\"))\n\tif gpTexCoordPointer == 0 {\n\t\treturn errors.New(\"glTexCoordPointer\")\n\t}\n\tgpTexCoordPointerEXT = uintptr(getProcAddr(\"glTexCoordPointerEXT\"))\n\tgpTexCoordPointerListIBM = uintptr(getProcAddr(\"glTexCoordPointerListIBM\"))\n\tgpTexCoordPointervINTEL = uintptr(getProcAddr(\"glTexCoordPointervINTEL\"))\n\tgpTexEnvf = uintptr(getProcAddr(\"glTexEnvf\"))\n\tif gpTexEnvf == 0 {\n\t\treturn errors.New(\"glTexEnvf\")\n\t}\n\tgpTexEnvfv = uintptr(getProcAddr(\"glTexEnvfv\"))\n\tif gpTexEnvfv == 0 {\n\t\treturn errors.New(\"glTexEnvfv\")\n\t}\n\tgpTexEnvi = uintptr(getProcAddr(\"glTexEnvi\"))\n\tif gpTexEnvi == 0 {\n\t\treturn errors.New(\"glTexEnvi\")\n\t}\n\tgpTexEnviv = uintptr(getProcAddr(\"glTexEnviv\"))\n\tif gpTexEnviv == 0 {\n\t\treturn errors.New(\"glTexEnviv\")\n\t}\n\tgpTexEnvxOES = uintptr(getProcAddr(\"glTexEnvxOES\"))\n\tgpTexEnvxvOES = uintptr(getProcAddr(\"glTexEnvxvOES\"))\n\tgpTexFilterFuncSGIS = uintptr(getProcAddr(\"glTexFilterFuncSGIS\"))\n\tgpTexGend = uintptr(getProcAddr(\"glTexGend\"))\n\tif gpTexGend == 0 {\n\t\treturn errors.New(\"glTexGend\")\n\t}\n\tgpTexGendv = uintptr(getProcAddr(\"glTexGendv\"))\n\tif gpTexGendv == 0 {\n\t\treturn errors.New(\"glTexGendv\")\n\t}\n\tgpTexGenf = uintptr(getProcAddr(\"glTexGenf\"))\n\tif gpTexGenf == 0 {\n\t\treturn errors.New(\"glTexGenf\")\n\t}\n\tgpTexGenfv = uintptr(getProcAddr(\"glTexGenfv\"))\n\tif gpTexGenfv == 0 {\n\t\treturn errors.New(\"glTexGenfv\")\n\t}\n\tgpTexGeni = uintptr(getProcAddr(\"glTexGeni\"))\n\tif gpTexGeni == 0 {\n\t\treturn errors.New(\"glTexGeni\")\n\t}\n\tgpTexGeniv = uintptr(getProcAddr(\"glTexGeniv\"))\n\tif gpTexGeniv == 0 {\n\t\treturn errors.New(\"glTexGeniv\")\n\t}\n\tgpTexGenxOES = uintptr(getProcAddr(\"glTexGenxOES\"))\n\tgpTexGenxvOES = uintptr(getProcAddr(\"glTexGenxvOES\"))\n\tgpTexImage1D = uintptr(getProcAddr(\"glTexImage1D\"))\n\tif gpTexImage1D == 0 {\n\t\treturn errors.New(\"glTexImage1D\")\n\t}\n\tgpTexImage2D = uintptr(getProcAddr(\"glTexImage2D\"))\n\tif gpTexImage2D == 0 {\n\t\treturn errors.New(\"glTexImage2D\")\n\t}\n\tgpTexImage2DMultisample = uintptr(getProcAddr(\"glTexImage2DMultisample\"))\n\tgpTexImage2DMultisampleCoverageNV = uintptr(getProcAddr(\"glTexImage2DMultisampleCoverageNV\"))\n\tgpTexImage3D = uintptr(getProcAddr(\"glTexImage3D\"))\n\tif gpTexImage3D == 0 {\n\t\treturn errors.New(\"glTexImage3D\")\n\t}\n\tgpTexImage3DEXT = uintptr(getProcAddr(\"glTexImage3DEXT\"))\n\tgpTexImage3DMultisample = uintptr(getProcAddr(\"glTexImage3DMultisample\"))\n\tgpTexImage3DMultisampleCoverageNV = uintptr(getProcAddr(\"glTexImage3DMultisampleCoverageNV\"))\n\tgpTexImage4DSGIS = uintptr(getProcAddr(\"glTexImage4DSGIS\"))\n\tgpTexPageCommitmentARB = uintptr(getProcAddr(\"glTexPageCommitmentARB\"))\n\tgpTexParameterIivEXT = uintptr(getProcAddr(\"glTexParameterIivEXT\"))\n\tgpTexParameterIuivEXT = uintptr(getProcAddr(\"glTexParameterIuivEXT\"))\n\tgpTexParameterf = uintptr(getProcAddr(\"glTexParameterf\"))\n\tif gpTexParameterf == 0 {\n\t\treturn errors.New(\"glTexParameterf\")\n\t}\n\tgpTexParameterfv = uintptr(getProcAddr(\"glTexParameterfv\"))\n\tif gpTexParameterfv == 0 {\n\t\treturn errors.New(\"glTexParameterfv\")\n\t}\n\tgpTexParameteri = uintptr(getProcAddr(\"glTexParameteri\"))\n\tif gpTexParameteri == 0 {\n\t\treturn errors.New(\"glTexParameteri\")\n\t}\n\tgpTexParameteriv = uintptr(getProcAddr(\"glTexParameteriv\"))\n\tif gpTexParameteriv == 0 {\n\t\treturn errors.New(\"glTexParameteriv\")\n\t}\n\tgpTexParameterxOES = uintptr(getProcAddr(\"glTexParameterxOES\"))\n\tgpTexParameterxvOES = uintptr(getProcAddr(\"glTexParameterxvOES\"))\n\tgpTexRenderbufferNV = uintptr(getProcAddr(\"glTexRenderbufferNV\"))\n\tgpTexStorage1D = uintptr(getProcAddr(\"glTexStorage1D\"))\n\tgpTexStorage2D = uintptr(getProcAddr(\"glTexStorage2D\"))\n\tgpTexStorage2DMultisample = uintptr(getProcAddr(\"glTexStorage2DMultisample\"))\n\tgpTexStorage3D = uintptr(getProcAddr(\"glTexStorage3D\"))\n\tgpTexStorage3DMultisample = uintptr(getProcAddr(\"glTexStorage3DMultisample\"))\n\tgpTexStorageMem1DEXT = uintptr(getProcAddr(\"glTexStorageMem1DEXT\"))\n\tgpTexStorageMem2DEXT = uintptr(getProcAddr(\"glTexStorageMem2DEXT\"))\n\tgpTexStorageMem2DMultisampleEXT = uintptr(getProcAddr(\"glTexStorageMem2DMultisampleEXT\"))\n\tgpTexStorageMem3DEXT = uintptr(getProcAddr(\"glTexStorageMem3DEXT\"))\n\tgpTexStorageMem3DMultisampleEXT = uintptr(getProcAddr(\"glTexStorageMem3DMultisampleEXT\"))\n\tgpTexStorageSparseAMD = uintptr(getProcAddr(\"glTexStorageSparseAMD\"))\n\tgpTexSubImage1D = uintptr(getProcAddr(\"glTexSubImage1D\"))\n\tif gpTexSubImage1D == 0 {\n\t\treturn errors.New(\"glTexSubImage1D\")\n\t}\n\tgpTexSubImage1DEXT = uintptr(getProcAddr(\"glTexSubImage1DEXT\"))\n\tgpTexSubImage2D = uintptr(getProcAddr(\"glTexSubImage2D\"))\n\tif gpTexSubImage2D == 0 {\n\t\treturn errors.New(\"glTexSubImage2D\")\n\t}\n\tgpTexSubImage2DEXT = uintptr(getProcAddr(\"glTexSubImage2DEXT\"))\n\tgpTexSubImage3D = uintptr(getProcAddr(\"glTexSubImage3D\"))\n\tif gpTexSubImage3D == 0 {\n\t\treturn errors.New(\"glTexSubImage3D\")\n\t}\n\tgpTexSubImage3DEXT = uintptr(getProcAddr(\"glTexSubImage3DEXT\"))\n\tgpTexSubImage4DSGIS = uintptr(getProcAddr(\"glTexSubImage4DSGIS\"))\n\tgpTextureBarrier = uintptr(getProcAddr(\"glTextureBarrier\"))\n\tgpTextureBarrierNV = uintptr(getProcAddr(\"glTextureBarrierNV\"))\n\tgpTextureBuffer = uintptr(getProcAddr(\"glTextureBuffer\"))\n\tgpTextureBufferEXT = uintptr(getProcAddr(\"glTextureBufferEXT\"))\n\tgpTextureBufferRange = uintptr(getProcAddr(\"glTextureBufferRange\"))\n\tgpTextureBufferRangeEXT = uintptr(getProcAddr(\"glTextureBufferRangeEXT\"))\n\tgpTextureColorMaskSGIS = uintptr(getProcAddr(\"glTextureColorMaskSGIS\"))\n\tgpTextureImage1DEXT = uintptr(getProcAddr(\"glTextureImage1DEXT\"))\n\tgpTextureImage2DEXT = uintptr(getProcAddr(\"glTextureImage2DEXT\"))\n\tgpTextureImage2DMultisampleCoverageNV = uintptr(getProcAddr(\"glTextureImage2DMultisampleCoverageNV\"))\n\tgpTextureImage2DMultisampleNV = uintptr(getProcAddr(\"glTextureImage2DMultisampleNV\"))\n\tgpTextureImage3DEXT = uintptr(getProcAddr(\"glTextureImage3DEXT\"))\n\tgpTextureImage3DMultisampleCoverageNV = uintptr(getProcAddr(\"glTextureImage3DMultisampleCoverageNV\"))\n\tgpTextureImage3DMultisampleNV = uintptr(getProcAddr(\"glTextureImage3DMultisampleNV\"))\n\tgpTextureLightEXT = uintptr(getProcAddr(\"glTextureLightEXT\"))\n\tgpTextureMaterialEXT = uintptr(getProcAddr(\"glTextureMaterialEXT\"))\n\tgpTextureNormalEXT = uintptr(getProcAddr(\"glTextureNormalEXT\"))\n\tgpTexturePageCommitmentEXT = uintptr(getProcAddr(\"glTexturePageCommitmentEXT\"))\n\tgpTextureParameterIiv = uintptr(getProcAddr(\"glTextureParameterIiv\"))\n\tgpTextureParameterIivEXT = uintptr(getProcAddr(\"glTextureParameterIivEXT\"))\n\tgpTextureParameterIuiv = uintptr(getProcAddr(\"glTextureParameterIuiv\"))\n\tgpTextureParameterIuivEXT = uintptr(getProcAddr(\"glTextureParameterIuivEXT\"))\n\tgpTextureParameterf = uintptr(getProcAddr(\"glTextureParameterf\"))\n\tgpTextureParameterfEXT = uintptr(getProcAddr(\"glTextureParameterfEXT\"))\n\tgpTextureParameterfv = uintptr(getProcAddr(\"glTextureParameterfv\"))\n\tgpTextureParameterfvEXT = uintptr(getProcAddr(\"glTextureParameterfvEXT\"))\n\tgpTextureParameteri = uintptr(getProcAddr(\"glTextureParameteri\"))\n\tgpTextureParameteriEXT = uintptr(getProcAddr(\"glTextureParameteriEXT\"))\n\tgpTextureParameteriv = uintptr(getProcAddr(\"glTextureParameteriv\"))\n\tgpTextureParameterivEXT = uintptr(getProcAddr(\"glTextureParameterivEXT\"))\n\tgpTextureRangeAPPLE = uintptr(getProcAddr(\"glTextureRangeAPPLE\"))\n\tgpTextureRenderbufferEXT = uintptr(getProcAddr(\"glTextureRenderbufferEXT\"))\n\tgpTextureStorage1D = uintptr(getProcAddr(\"glTextureStorage1D\"))\n\tgpTextureStorage1DEXT = uintptr(getProcAddr(\"glTextureStorage1DEXT\"))\n\tgpTextureStorage2D = uintptr(getProcAddr(\"glTextureStorage2D\"))\n\tgpTextureStorage2DEXT = uintptr(getProcAddr(\"glTextureStorage2DEXT\"))\n\tgpTextureStorage2DMultisample = uintptr(getProcAddr(\"glTextureStorage2DMultisample\"))\n\tgpTextureStorage2DMultisampleEXT = uintptr(getProcAddr(\"glTextureStorage2DMultisampleEXT\"))\n\tgpTextureStorage3D = uintptr(getProcAddr(\"glTextureStorage3D\"))\n\tgpTextureStorage3DEXT = uintptr(getProcAddr(\"glTextureStorage3DEXT\"))\n\tgpTextureStorage3DMultisample = uintptr(getProcAddr(\"glTextureStorage3DMultisample\"))\n\tgpTextureStorage3DMultisampleEXT = uintptr(getProcAddr(\"glTextureStorage3DMultisampleEXT\"))\n\tgpTextureStorageMem1DEXT = uintptr(getProcAddr(\"glTextureStorageMem1DEXT\"))\n\tgpTextureStorageMem2DEXT = uintptr(getProcAddr(\"glTextureStorageMem2DEXT\"))\n\tgpTextureStorageMem2DMultisampleEXT = uintptr(getProcAddr(\"glTextureStorageMem2DMultisampleEXT\"))\n\tgpTextureStorageMem3DEXT = uintptr(getProcAddr(\"glTextureStorageMem3DEXT\"))\n\tgpTextureStorageMem3DMultisampleEXT = uintptr(getProcAddr(\"glTextureStorageMem3DMultisampleEXT\"))\n\tgpTextureStorageSparseAMD = uintptr(getProcAddr(\"glTextureStorageSparseAMD\"))\n\tgpTextureSubImage1D = uintptr(getProcAddr(\"glTextureSubImage1D\"))\n\tgpTextureSubImage1DEXT = uintptr(getProcAddr(\"glTextureSubImage1DEXT\"))\n\tgpTextureSubImage2D = uintptr(getProcAddr(\"glTextureSubImage2D\"))\n\tgpTextureSubImage2DEXT = uintptr(getProcAddr(\"glTextureSubImage2DEXT\"))\n\tgpTextureSubImage3D = uintptr(getProcAddr(\"glTextureSubImage3D\"))\n\tgpTextureSubImage3DEXT = uintptr(getProcAddr(\"glTextureSubImage3DEXT\"))\n\tgpTextureView = uintptr(getProcAddr(\"glTextureView\"))\n\tgpTrackMatrixNV = uintptr(getProcAddr(\"glTrackMatrixNV\"))\n\tgpTransformFeedbackAttribsNV = uintptr(getProcAddr(\"glTransformFeedbackAttribsNV\"))\n\tgpTransformFeedbackBufferBase = uintptr(getProcAddr(\"glTransformFeedbackBufferBase\"))\n\tgpTransformFeedbackBufferRange = uintptr(getProcAddr(\"glTransformFeedbackBufferRange\"))\n\tgpTransformFeedbackStreamAttribsNV = uintptr(getProcAddr(\"glTransformFeedbackStreamAttribsNV\"))\n\tgpTransformFeedbackVaryingsEXT = uintptr(getProcAddr(\"glTransformFeedbackVaryingsEXT\"))\n\tgpTransformFeedbackVaryingsNV = uintptr(getProcAddr(\"glTransformFeedbackVaryingsNV\"))\n\tgpTransformPathNV = uintptr(getProcAddr(\"glTransformPathNV\"))\n\tgpTranslated = uintptr(getProcAddr(\"glTranslated\"))\n\tif gpTranslated == 0 {\n\t\treturn errors.New(\"glTranslated\")\n\t}\n\tgpTranslatef = uintptr(getProcAddr(\"glTranslatef\"))\n\tif gpTranslatef == 0 {\n\t\treturn errors.New(\"glTranslatef\")\n\t}\n\tgpTranslatexOES = uintptr(getProcAddr(\"glTranslatexOES\"))\n\tgpUniform1d = uintptr(getProcAddr(\"glUniform1d\"))\n\tgpUniform1dv = uintptr(getProcAddr(\"glUniform1dv\"))\n\tgpUniform1f = uintptr(getProcAddr(\"glUniform1f\"))\n\tif gpUniform1f == 0 {\n\t\treturn errors.New(\"glUniform1f\")\n\t}\n\tgpUniform1fARB = uintptr(getProcAddr(\"glUniform1fARB\"))\n\tgpUniform1fv = uintptr(getProcAddr(\"glUniform1fv\"))\n\tif gpUniform1fv == 0 {\n\t\treturn errors.New(\"glUniform1fv\")\n\t}\n\tgpUniform1fvARB = uintptr(getProcAddr(\"glUniform1fvARB\"))\n\tgpUniform1i = uintptr(getProcAddr(\"glUniform1i\"))\n\tif gpUniform1i == 0 {\n\t\treturn errors.New(\"glUniform1i\")\n\t}\n\tgpUniform1i64ARB = uintptr(getProcAddr(\"glUniform1i64ARB\"))\n\tgpUniform1i64NV = uintptr(getProcAddr(\"glUniform1i64NV\"))\n\tgpUniform1i64vARB = uintptr(getProcAddr(\"glUniform1i64vARB\"))\n\tgpUniform1i64vNV = uintptr(getProcAddr(\"glUniform1i64vNV\"))\n\tgpUniform1iARB = uintptr(getProcAddr(\"glUniform1iARB\"))\n\tgpUniform1iv = uintptr(getProcAddr(\"glUniform1iv\"))\n\tif gpUniform1iv == 0 {\n\t\treturn errors.New(\"glUniform1iv\")\n\t}\n\tgpUniform1ivARB = uintptr(getProcAddr(\"glUniform1ivARB\"))\n\tgpUniform1ui64ARB = uintptr(getProcAddr(\"glUniform1ui64ARB\"))\n\tgpUniform1ui64NV = uintptr(getProcAddr(\"glUniform1ui64NV\"))\n\tgpUniform1ui64vARB = uintptr(getProcAddr(\"glUniform1ui64vARB\"))\n\tgpUniform1ui64vNV = uintptr(getProcAddr(\"glUniform1ui64vNV\"))\n\tgpUniform1uiEXT = uintptr(getProcAddr(\"glUniform1uiEXT\"))\n\tgpUniform1uivEXT = uintptr(getProcAddr(\"glUniform1uivEXT\"))\n\tgpUniform2d = uintptr(getProcAddr(\"glUniform2d\"))\n\tgpUniform2dv = uintptr(getProcAddr(\"glUniform2dv\"))\n\tgpUniform2f = uintptr(getProcAddr(\"glUniform2f\"))\n\tif gpUniform2f == 0 {\n\t\treturn errors.New(\"glUniform2f\")\n\t}\n\tgpUniform2fARB = uintptr(getProcAddr(\"glUniform2fARB\"))\n\tgpUniform2fv = uintptr(getProcAddr(\"glUniform2fv\"))\n\tif gpUniform2fv == 0 {\n\t\treturn errors.New(\"glUniform2fv\")\n\t}\n\tgpUniform2fvARB = uintptr(getProcAddr(\"glUniform2fvARB\"))\n\tgpUniform2i = uintptr(getProcAddr(\"glUniform2i\"))\n\tif gpUniform2i == 0 {\n\t\treturn errors.New(\"glUniform2i\")\n\t}\n\tgpUniform2i64ARB = uintptr(getProcAddr(\"glUniform2i64ARB\"))\n\tgpUniform2i64NV = uintptr(getProcAddr(\"glUniform2i64NV\"))\n\tgpUniform2i64vARB = uintptr(getProcAddr(\"glUniform2i64vARB\"))\n\tgpUniform2i64vNV = uintptr(getProcAddr(\"glUniform2i64vNV\"))\n\tgpUniform2iARB = uintptr(getProcAddr(\"glUniform2iARB\"))\n\tgpUniform2iv = uintptr(getProcAddr(\"glUniform2iv\"))\n\tif gpUniform2iv == 0 {\n\t\treturn errors.New(\"glUniform2iv\")\n\t}\n\tgpUniform2ivARB = uintptr(getProcAddr(\"glUniform2ivARB\"))\n\tgpUniform2ui64ARB = uintptr(getProcAddr(\"glUniform2ui64ARB\"))\n\tgpUniform2ui64NV = uintptr(getProcAddr(\"glUniform2ui64NV\"))\n\tgpUniform2ui64vARB = uintptr(getProcAddr(\"glUniform2ui64vARB\"))\n\tgpUniform2ui64vNV = uintptr(getProcAddr(\"glUniform2ui64vNV\"))\n\tgpUniform2uiEXT = uintptr(getProcAddr(\"glUniform2uiEXT\"))\n\tgpUniform2uivEXT = uintptr(getProcAddr(\"glUniform2uivEXT\"))\n\tgpUniform3d = uintptr(getProcAddr(\"glUniform3d\"))\n\tgpUniform3dv = uintptr(getProcAddr(\"glUniform3dv\"))\n\tgpUniform3f = uintptr(getProcAddr(\"glUniform3f\"))\n\tif gpUniform3f == 0 {\n\t\treturn errors.New(\"glUniform3f\")\n\t}\n\tgpUniform3fARB = uintptr(getProcAddr(\"glUniform3fARB\"))\n\tgpUniform3fv = uintptr(getProcAddr(\"glUniform3fv\"))\n\tif gpUniform3fv == 0 {\n\t\treturn errors.New(\"glUniform3fv\")\n\t}\n\tgpUniform3fvARB = uintptr(getProcAddr(\"glUniform3fvARB\"))\n\tgpUniform3i = uintptr(getProcAddr(\"glUniform3i\"))\n\tif gpUniform3i == 0 {\n\t\treturn errors.New(\"glUniform3i\")\n\t}\n\tgpUniform3i64ARB = uintptr(getProcAddr(\"glUniform3i64ARB\"))\n\tgpUniform3i64NV = uintptr(getProcAddr(\"glUniform3i64NV\"))\n\tgpUniform3i64vARB = uintptr(getProcAddr(\"glUniform3i64vARB\"))\n\tgpUniform3i64vNV = uintptr(getProcAddr(\"glUniform3i64vNV\"))\n\tgpUniform3iARB = uintptr(getProcAddr(\"glUniform3iARB\"))\n\tgpUniform3iv = uintptr(getProcAddr(\"glUniform3iv\"))\n\tif gpUniform3iv == 0 {\n\t\treturn errors.New(\"glUniform3iv\")\n\t}\n\tgpUniform3ivARB = uintptr(getProcAddr(\"glUniform3ivARB\"))\n\tgpUniform3ui64ARB = uintptr(getProcAddr(\"glUniform3ui64ARB\"))\n\tgpUniform3ui64NV = uintptr(getProcAddr(\"glUniform3ui64NV\"))\n\tgpUniform3ui64vARB = uintptr(getProcAddr(\"glUniform3ui64vARB\"))\n\tgpUniform3ui64vNV = uintptr(getProcAddr(\"glUniform3ui64vNV\"))\n\tgpUniform3uiEXT = uintptr(getProcAddr(\"glUniform3uiEXT\"))\n\tgpUniform3uivEXT = uintptr(getProcAddr(\"glUniform3uivEXT\"))\n\tgpUniform4d = uintptr(getProcAddr(\"glUniform4d\"))\n\tgpUniform4dv = uintptr(getProcAddr(\"glUniform4dv\"))\n\tgpUniform4f = uintptr(getProcAddr(\"glUniform4f\"))\n\tif gpUniform4f == 0 {\n\t\treturn errors.New(\"glUniform4f\")\n\t}\n\tgpUniform4fARB = uintptr(getProcAddr(\"glUniform4fARB\"))\n\tgpUniform4fv = uintptr(getProcAddr(\"glUniform4fv\"))\n\tif gpUniform4fv == 0 {\n\t\treturn errors.New(\"glUniform4fv\")\n\t}\n\tgpUniform4fvARB = uintptr(getProcAddr(\"glUniform4fvARB\"))\n\tgpUniform4i = uintptr(getProcAddr(\"glUniform4i\"))\n\tif gpUniform4i == 0 {\n\t\treturn errors.New(\"glUniform4i\")\n\t}\n\tgpUniform4i64ARB = uintptr(getProcAddr(\"glUniform4i64ARB\"))\n\tgpUniform4i64NV = uintptr(getProcAddr(\"glUniform4i64NV\"))\n\tgpUniform4i64vARB = uintptr(getProcAddr(\"glUniform4i64vARB\"))\n\tgpUniform4i64vNV = uintptr(getProcAddr(\"glUniform4i64vNV\"))\n\tgpUniform4iARB = uintptr(getProcAddr(\"glUniform4iARB\"))\n\tgpUniform4iv = uintptr(getProcAddr(\"glUniform4iv\"))\n\tif gpUniform4iv == 0 {\n\t\treturn errors.New(\"glUniform4iv\")\n\t}\n\tgpUniform4ivARB = uintptr(getProcAddr(\"glUniform4ivARB\"))\n\tgpUniform4ui64ARB = uintptr(getProcAddr(\"glUniform4ui64ARB\"))\n\tgpUniform4ui64NV = uintptr(getProcAddr(\"glUniform4ui64NV\"))\n\tgpUniform4ui64vARB = uintptr(getProcAddr(\"glUniform4ui64vARB\"))\n\tgpUniform4ui64vNV = uintptr(getProcAddr(\"glUniform4ui64vNV\"))\n\tgpUniform4uiEXT = uintptr(getProcAddr(\"glUniform4uiEXT\"))\n\tgpUniform4uivEXT = uintptr(getProcAddr(\"glUniform4uivEXT\"))\n\tgpUniformBlockBinding = uintptr(getProcAddr(\"glUniformBlockBinding\"))\n\tgpUniformBufferEXT = uintptr(getProcAddr(\"glUniformBufferEXT\"))\n\tgpUniformHandleui64ARB = uintptr(getProcAddr(\"glUniformHandleui64ARB\"))\n\tgpUniformHandleui64NV = uintptr(getProcAddr(\"glUniformHandleui64NV\"))\n\tgpUniformHandleui64vARB = uintptr(getProcAddr(\"glUniformHandleui64vARB\"))\n\tgpUniformHandleui64vNV = uintptr(getProcAddr(\"glUniformHandleui64vNV\"))\n\tgpUniformMatrix2dv = uintptr(getProcAddr(\"glUniformMatrix2dv\"))\n\tgpUniformMatrix2fv = uintptr(getProcAddr(\"glUniformMatrix2fv\"))\n\tif gpUniformMatrix2fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix2fv\")\n\t}\n\tgpUniformMatrix2fvARB = uintptr(getProcAddr(\"glUniformMatrix2fvARB\"))\n\tgpUniformMatrix2x3dv = uintptr(getProcAddr(\"glUniformMatrix2x3dv\"))\n\tgpUniformMatrix2x3fv = uintptr(getProcAddr(\"glUniformMatrix2x3fv\"))\n\tif gpUniformMatrix2x3fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix2x3fv\")\n\t}\n\tgpUniformMatrix2x4dv = uintptr(getProcAddr(\"glUniformMatrix2x4dv\"))\n\tgpUniformMatrix2x4fv = uintptr(getProcAddr(\"glUniformMatrix2x4fv\"))\n\tif gpUniformMatrix2x4fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix2x4fv\")\n\t}\n\tgpUniformMatrix3dv = uintptr(getProcAddr(\"glUniformMatrix3dv\"))\n\tgpUniformMatrix3fv = uintptr(getProcAddr(\"glUniformMatrix3fv\"))\n\tif gpUniformMatrix3fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix3fv\")\n\t}\n\tgpUniformMatrix3fvARB = uintptr(getProcAddr(\"glUniformMatrix3fvARB\"))\n\tgpUniformMatrix3x2dv = uintptr(getProcAddr(\"glUniformMatrix3x2dv\"))\n\tgpUniformMatrix3x2fv = uintptr(getProcAddr(\"glUniformMatrix3x2fv\"))\n\tif gpUniformMatrix3x2fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix3x2fv\")\n\t}\n\tgpUniformMatrix3x4dv = uintptr(getProcAddr(\"glUniformMatrix3x4dv\"))\n\tgpUniformMatrix3x4fv = uintptr(getProcAddr(\"glUniformMatrix3x4fv\"))\n\tif gpUniformMatrix3x4fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix3x4fv\")\n\t}\n\tgpUniformMatrix4dv = uintptr(getProcAddr(\"glUniformMatrix4dv\"))\n\tgpUniformMatrix4fv = uintptr(getProcAddr(\"glUniformMatrix4fv\"))\n\tif gpUniformMatrix4fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix4fv\")\n\t}\n\tgpUniformMatrix4fvARB = uintptr(getProcAddr(\"glUniformMatrix4fvARB\"))\n\tgpUniformMatrix4x2dv = uintptr(getProcAddr(\"glUniformMatrix4x2dv\"))\n\tgpUniformMatrix4x2fv = uintptr(getProcAddr(\"glUniformMatrix4x2fv\"))\n\tif gpUniformMatrix4x2fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix4x2fv\")\n\t}\n\tgpUniformMatrix4x3dv = uintptr(getProcAddr(\"glUniformMatrix4x3dv\"))\n\tgpUniformMatrix4x3fv = uintptr(getProcAddr(\"glUniformMatrix4x3fv\"))\n\tif gpUniformMatrix4x3fv == 0 {\n\t\treturn errors.New(\"glUniformMatrix4x3fv\")\n\t}\n\tgpUniformSubroutinesuiv = uintptr(getProcAddr(\"glUniformSubroutinesuiv\"))\n\tgpUniformui64NV = uintptr(getProcAddr(\"glUniformui64NV\"))\n\tgpUniformui64vNV = uintptr(getProcAddr(\"glUniformui64vNV\"))\n\tgpUnlockArraysEXT = uintptr(getProcAddr(\"glUnlockArraysEXT\"))\n\tgpUnmapBuffer = uintptr(getProcAddr(\"glUnmapBuffer\"))\n\tif gpUnmapBuffer == 0 {\n\t\treturn errors.New(\"glUnmapBuffer\")\n\t}\n\tgpUnmapBufferARB = uintptr(getProcAddr(\"glUnmapBufferARB\"))\n\tgpUnmapNamedBuffer = uintptr(getProcAddr(\"glUnmapNamedBuffer\"))\n\tgpUnmapNamedBufferEXT = uintptr(getProcAddr(\"glUnmapNamedBufferEXT\"))\n\tgpUnmapObjectBufferATI = uintptr(getProcAddr(\"glUnmapObjectBufferATI\"))\n\tgpUnmapTexture2DINTEL = uintptr(getProcAddr(\"glUnmapTexture2DINTEL\"))\n\tgpUpdateObjectBufferATI = uintptr(getProcAddr(\"glUpdateObjectBufferATI\"))\n\tgpUseProgram = uintptr(getProcAddr(\"glUseProgram\"))\n\tif gpUseProgram == 0 {\n\t\treturn errors.New(\"glUseProgram\")\n\t}\n\tgpUseProgramObjectARB = uintptr(getProcAddr(\"glUseProgramObjectARB\"))\n\tgpUseProgramStages = uintptr(getProcAddr(\"glUseProgramStages\"))\n\tgpUseProgramStagesEXT = uintptr(getProcAddr(\"glUseProgramStagesEXT\"))\n\tgpUseShaderProgramEXT = uintptr(getProcAddr(\"glUseShaderProgramEXT\"))\n\tgpVDPAUFiniNV = uintptr(getProcAddr(\"glVDPAUFiniNV\"))\n\tgpVDPAUGetSurfaceivNV = uintptr(getProcAddr(\"glVDPAUGetSurfaceivNV\"))\n\tgpVDPAUInitNV = uintptr(getProcAddr(\"glVDPAUInitNV\"))\n\tgpVDPAUIsSurfaceNV = uintptr(getProcAddr(\"glVDPAUIsSurfaceNV\"))\n\tgpVDPAUMapSurfacesNV = uintptr(getProcAddr(\"glVDPAUMapSurfacesNV\"))\n\tgpVDPAURegisterOutputSurfaceNV = uintptr(getProcAddr(\"glVDPAURegisterOutputSurfaceNV\"))\n\tgpVDPAURegisterVideoSurfaceNV = uintptr(getProcAddr(\"glVDPAURegisterVideoSurfaceNV\"))\n\tgpVDPAUSurfaceAccessNV = uintptr(getProcAddr(\"glVDPAUSurfaceAccessNV\"))\n\tgpVDPAUUnmapSurfacesNV = uintptr(getProcAddr(\"glVDPAUUnmapSurfacesNV\"))\n\tgpVDPAUUnregisterSurfaceNV = uintptr(getProcAddr(\"glVDPAUUnregisterSurfaceNV\"))\n\tgpValidateProgram = uintptr(getProcAddr(\"glValidateProgram\"))\n\tif gpValidateProgram == 0 {\n\t\treturn errors.New(\"glValidateProgram\")\n\t}\n\tgpValidateProgramARB = uintptr(getProcAddr(\"glValidateProgramARB\"))\n\tgpValidateProgramPipeline = uintptr(getProcAddr(\"glValidateProgramPipeline\"))\n\tgpValidateProgramPipelineEXT = uintptr(getProcAddr(\"glValidateProgramPipelineEXT\"))\n\tgpVariantArrayObjectATI = uintptr(getProcAddr(\"glVariantArrayObjectATI\"))\n\tgpVariantPointerEXT = uintptr(getProcAddr(\"glVariantPointerEXT\"))\n\tgpVariantbvEXT = uintptr(getProcAddr(\"glVariantbvEXT\"))\n\tgpVariantdvEXT = uintptr(getProcAddr(\"glVariantdvEXT\"))\n\tgpVariantfvEXT = uintptr(getProcAddr(\"glVariantfvEXT\"))\n\tgpVariantivEXT = uintptr(getProcAddr(\"glVariantivEXT\"))\n\tgpVariantsvEXT = uintptr(getProcAddr(\"glVariantsvEXT\"))\n\tgpVariantubvEXT = uintptr(getProcAddr(\"glVariantubvEXT\"))\n\tgpVariantuivEXT = uintptr(getProcAddr(\"glVariantuivEXT\"))\n\tgpVariantusvEXT = uintptr(getProcAddr(\"glVariantusvEXT\"))\n\tgpVertex2bOES = uintptr(getProcAddr(\"glVertex2bOES\"))\n\tgpVertex2bvOES = uintptr(getProcAddr(\"glVertex2bvOES\"))\n\tgpVertex2d = uintptr(getProcAddr(\"glVertex2d\"))\n\tif gpVertex2d == 0 {\n\t\treturn errors.New(\"glVertex2d\")\n\t}\n\tgpVertex2dv = uintptr(getProcAddr(\"glVertex2dv\"))\n\tif gpVertex2dv == 0 {\n\t\treturn errors.New(\"glVertex2dv\")\n\t}\n\tgpVertex2f = uintptr(getProcAddr(\"glVertex2f\"))\n\tif gpVertex2f == 0 {\n\t\treturn errors.New(\"glVertex2f\")\n\t}\n\tgpVertex2fv = uintptr(getProcAddr(\"glVertex2fv\"))\n\tif gpVertex2fv == 0 {\n\t\treturn errors.New(\"glVertex2fv\")\n\t}\n\tgpVertex2hNV = uintptr(getProcAddr(\"glVertex2hNV\"))\n\tgpVertex2hvNV = uintptr(getProcAddr(\"glVertex2hvNV\"))\n\tgpVertex2i = uintptr(getProcAddr(\"glVertex2i\"))\n\tif gpVertex2i == 0 {\n\t\treturn errors.New(\"glVertex2i\")\n\t}\n\tgpVertex2iv = uintptr(getProcAddr(\"glVertex2iv\"))\n\tif gpVertex2iv == 0 {\n\t\treturn errors.New(\"glVertex2iv\")\n\t}\n\tgpVertex2s = uintptr(getProcAddr(\"glVertex2s\"))\n\tif gpVertex2s == 0 {\n\t\treturn errors.New(\"glVertex2s\")\n\t}\n\tgpVertex2sv = uintptr(getProcAddr(\"glVertex2sv\"))\n\tif gpVertex2sv == 0 {\n\t\treturn errors.New(\"glVertex2sv\")\n\t}\n\tgpVertex2xOES = uintptr(getProcAddr(\"glVertex2xOES\"))\n\tgpVertex2xvOES = uintptr(getProcAddr(\"glVertex2xvOES\"))\n\tgpVertex3bOES = uintptr(getProcAddr(\"glVertex3bOES\"))\n\tgpVertex3bvOES = uintptr(getProcAddr(\"glVertex3bvOES\"))\n\tgpVertex3d = uintptr(getProcAddr(\"glVertex3d\"))\n\tif gpVertex3d == 0 {\n\t\treturn errors.New(\"glVertex3d\")\n\t}\n\tgpVertex3dv = uintptr(getProcAddr(\"glVertex3dv\"))\n\tif gpVertex3dv == 0 {\n\t\treturn errors.New(\"glVertex3dv\")\n\t}\n\tgpVertex3f = uintptr(getProcAddr(\"glVertex3f\"))\n\tif gpVertex3f == 0 {\n\t\treturn errors.New(\"glVertex3f\")\n\t}\n\tgpVertex3fv = uintptr(getProcAddr(\"glVertex3fv\"))\n\tif gpVertex3fv == 0 {\n\t\treturn errors.New(\"glVertex3fv\")\n\t}\n\tgpVertex3hNV = uintptr(getProcAddr(\"glVertex3hNV\"))\n\tgpVertex3hvNV = uintptr(getProcAddr(\"glVertex3hvNV\"))\n\tgpVertex3i = uintptr(getProcAddr(\"glVertex3i\"))\n\tif gpVertex3i == 0 {\n\t\treturn errors.New(\"glVertex3i\")\n\t}\n\tgpVertex3iv = uintptr(getProcAddr(\"glVertex3iv\"))\n\tif gpVertex3iv == 0 {\n\t\treturn errors.New(\"glVertex3iv\")\n\t}\n\tgpVertex3s = uintptr(getProcAddr(\"glVertex3s\"))\n\tif gpVertex3s == 0 {\n\t\treturn errors.New(\"glVertex3s\")\n\t}\n\tgpVertex3sv = uintptr(getProcAddr(\"glVertex3sv\"))\n\tif gpVertex3sv == 0 {\n\t\treturn errors.New(\"glVertex3sv\")\n\t}\n\tgpVertex3xOES = uintptr(getProcAddr(\"glVertex3xOES\"))\n\tgpVertex3xvOES = uintptr(getProcAddr(\"glVertex3xvOES\"))\n\tgpVertex4bOES = uintptr(getProcAddr(\"glVertex4bOES\"))\n\tgpVertex4bvOES = uintptr(getProcAddr(\"glVertex4bvOES\"))\n\tgpVertex4d = uintptr(getProcAddr(\"glVertex4d\"))\n\tif gpVertex4d == 0 {\n\t\treturn errors.New(\"glVertex4d\")\n\t}\n\tgpVertex4dv = uintptr(getProcAddr(\"glVertex4dv\"))\n\tif gpVertex4dv == 0 {\n\t\treturn errors.New(\"glVertex4dv\")\n\t}\n\tgpVertex4f = uintptr(getProcAddr(\"glVertex4f\"))\n\tif gpVertex4f == 0 {\n\t\treturn errors.New(\"glVertex4f\")\n\t}\n\tgpVertex4fv = uintptr(getProcAddr(\"glVertex4fv\"))\n\tif gpVertex4fv == 0 {\n\t\treturn errors.New(\"glVertex4fv\")\n\t}\n\tgpVertex4hNV = uintptr(getProcAddr(\"glVertex4hNV\"))\n\tgpVertex4hvNV = uintptr(getProcAddr(\"glVertex4hvNV\"))\n\tgpVertex4i = uintptr(getProcAddr(\"glVertex4i\"))\n\tif gpVertex4i == 0 {\n\t\treturn errors.New(\"glVertex4i\")\n\t}\n\tgpVertex4iv = uintptr(getProcAddr(\"glVertex4iv\"))\n\tif gpVertex4iv == 0 {\n\t\treturn errors.New(\"glVertex4iv\")\n\t}\n\tgpVertex4s = uintptr(getProcAddr(\"glVertex4s\"))\n\tif gpVertex4s == 0 {\n\t\treturn errors.New(\"glVertex4s\")\n\t}\n\tgpVertex4sv = uintptr(getProcAddr(\"glVertex4sv\"))\n\tif gpVertex4sv == 0 {\n\t\treturn errors.New(\"glVertex4sv\")\n\t}\n\tgpVertex4xOES = uintptr(getProcAddr(\"glVertex4xOES\"))\n\tgpVertex4xvOES = uintptr(getProcAddr(\"glVertex4xvOES\"))\n\tgpVertexArrayAttribBinding = uintptr(getProcAddr(\"glVertexArrayAttribBinding\"))\n\tgpVertexArrayAttribFormat = uintptr(getProcAddr(\"glVertexArrayAttribFormat\"))\n\tgpVertexArrayAttribIFormat = uintptr(getProcAddr(\"glVertexArrayAttribIFormat\"))\n\tgpVertexArrayAttribLFormat = uintptr(getProcAddr(\"glVertexArrayAttribLFormat\"))\n\tgpVertexArrayBindVertexBufferEXT = uintptr(getProcAddr(\"glVertexArrayBindVertexBufferEXT\"))\n\tgpVertexArrayBindingDivisor = uintptr(getProcAddr(\"glVertexArrayBindingDivisor\"))\n\tgpVertexArrayColorOffsetEXT = uintptr(getProcAddr(\"glVertexArrayColorOffsetEXT\"))\n\tgpVertexArrayEdgeFlagOffsetEXT = uintptr(getProcAddr(\"glVertexArrayEdgeFlagOffsetEXT\"))\n\tgpVertexArrayElementBuffer = uintptr(getProcAddr(\"glVertexArrayElementBuffer\"))\n\tgpVertexArrayFogCoordOffsetEXT = uintptr(getProcAddr(\"glVertexArrayFogCoordOffsetEXT\"))\n\tgpVertexArrayIndexOffsetEXT = uintptr(getProcAddr(\"glVertexArrayIndexOffsetEXT\"))\n\tgpVertexArrayMultiTexCoordOffsetEXT = uintptr(getProcAddr(\"glVertexArrayMultiTexCoordOffsetEXT\"))\n\tgpVertexArrayNormalOffsetEXT = uintptr(getProcAddr(\"glVertexArrayNormalOffsetEXT\"))\n\tgpVertexArrayParameteriAPPLE = uintptr(getProcAddr(\"glVertexArrayParameteriAPPLE\"))\n\tgpVertexArrayRangeAPPLE = uintptr(getProcAddr(\"glVertexArrayRangeAPPLE\"))\n\tgpVertexArrayRangeNV = uintptr(getProcAddr(\"glVertexArrayRangeNV\"))\n\tgpVertexArraySecondaryColorOffsetEXT = uintptr(getProcAddr(\"glVertexArraySecondaryColorOffsetEXT\"))\n\tgpVertexArrayTexCoordOffsetEXT = uintptr(getProcAddr(\"glVertexArrayTexCoordOffsetEXT\"))\n\tgpVertexArrayVertexAttribBindingEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribBindingEXT\"))\n\tgpVertexArrayVertexAttribDivisorEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribDivisorEXT\"))\n\tgpVertexArrayVertexAttribFormatEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribFormatEXT\"))\n\tgpVertexArrayVertexAttribIFormatEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribIFormatEXT\"))\n\tgpVertexArrayVertexAttribIOffsetEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribIOffsetEXT\"))\n\tgpVertexArrayVertexAttribLFormatEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribLFormatEXT\"))\n\tgpVertexArrayVertexAttribLOffsetEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribLOffsetEXT\"))\n\tgpVertexArrayVertexAttribOffsetEXT = uintptr(getProcAddr(\"glVertexArrayVertexAttribOffsetEXT\"))\n\tgpVertexArrayVertexBindingDivisorEXT = uintptr(getProcAddr(\"glVertexArrayVertexBindingDivisorEXT\"))\n\tgpVertexArrayVertexBuffer = uintptr(getProcAddr(\"glVertexArrayVertexBuffer\"))\n\tgpVertexArrayVertexBuffers = uintptr(getProcAddr(\"glVertexArrayVertexBuffers\"))\n\tgpVertexArrayVertexOffsetEXT = uintptr(getProcAddr(\"glVertexArrayVertexOffsetEXT\"))\n\tgpVertexAttrib1d = uintptr(getProcAddr(\"glVertexAttrib1d\"))\n\tif gpVertexAttrib1d == 0 {\n\t\treturn errors.New(\"glVertexAttrib1d\")\n\t}\n\tgpVertexAttrib1dARB = uintptr(getProcAddr(\"glVertexAttrib1dARB\"))\n\tgpVertexAttrib1dNV = uintptr(getProcAddr(\"glVertexAttrib1dNV\"))\n\tgpVertexAttrib1dv = uintptr(getProcAddr(\"glVertexAttrib1dv\"))\n\tif gpVertexAttrib1dv == 0 {\n\t\treturn errors.New(\"glVertexAttrib1dv\")\n\t}\n\tgpVertexAttrib1dvARB = uintptr(getProcAddr(\"glVertexAttrib1dvARB\"))\n\tgpVertexAttrib1dvNV = uintptr(getProcAddr(\"glVertexAttrib1dvNV\"))\n\tgpVertexAttrib1f = uintptr(getProcAddr(\"glVertexAttrib1f\"))\n\tif gpVertexAttrib1f == 0 {\n\t\treturn errors.New(\"glVertexAttrib1f\")\n\t}\n\tgpVertexAttrib1fARB = uintptr(getProcAddr(\"glVertexAttrib1fARB\"))\n\tgpVertexAttrib1fNV = uintptr(getProcAddr(\"glVertexAttrib1fNV\"))\n\tgpVertexAttrib1fv = uintptr(getProcAddr(\"glVertexAttrib1fv\"))\n\tif gpVertexAttrib1fv == 0 {\n\t\treturn errors.New(\"glVertexAttrib1fv\")\n\t}\n\tgpVertexAttrib1fvARB = uintptr(getProcAddr(\"glVertexAttrib1fvARB\"))\n\tgpVertexAttrib1fvNV = uintptr(getProcAddr(\"glVertexAttrib1fvNV\"))\n\tgpVertexAttrib1hNV = uintptr(getProcAddr(\"glVertexAttrib1hNV\"))\n\tgpVertexAttrib1hvNV = uintptr(getProcAddr(\"glVertexAttrib1hvNV\"))\n\tgpVertexAttrib1s = uintptr(getProcAddr(\"glVertexAttrib1s\"))\n\tif gpVertexAttrib1s == 0 {\n\t\treturn errors.New(\"glVertexAttrib1s\")\n\t}\n\tgpVertexAttrib1sARB = uintptr(getProcAddr(\"glVertexAttrib1sARB\"))\n\tgpVertexAttrib1sNV = uintptr(getProcAddr(\"glVertexAttrib1sNV\"))\n\tgpVertexAttrib1sv = uintptr(getProcAddr(\"glVertexAttrib1sv\"))\n\tif gpVertexAttrib1sv == 0 {\n\t\treturn errors.New(\"glVertexAttrib1sv\")\n\t}\n\tgpVertexAttrib1svARB = uintptr(getProcAddr(\"glVertexAttrib1svARB\"))\n\tgpVertexAttrib1svNV = uintptr(getProcAddr(\"glVertexAttrib1svNV\"))\n\tgpVertexAttrib2d = uintptr(getProcAddr(\"glVertexAttrib2d\"))\n\tif gpVertexAttrib2d == 0 {\n\t\treturn errors.New(\"glVertexAttrib2d\")\n\t}\n\tgpVertexAttrib2dARB = uintptr(getProcAddr(\"glVertexAttrib2dARB\"))\n\tgpVertexAttrib2dNV = uintptr(getProcAddr(\"glVertexAttrib2dNV\"))\n\tgpVertexAttrib2dv = uintptr(getProcAddr(\"glVertexAttrib2dv\"))\n\tif gpVertexAttrib2dv == 0 {\n\t\treturn errors.New(\"glVertexAttrib2dv\")\n\t}\n\tgpVertexAttrib2dvARB = uintptr(getProcAddr(\"glVertexAttrib2dvARB\"))\n\tgpVertexAttrib2dvNV = uintptr(getProcAddr(\"glVertexAttrib2dvNV\"))\n\tgpVertexAttrib2f = uintptr(getProcAddr(\"glVertexAttrib2f\"))\n\tif gpVertexAttrib2f == 0 {\n\t\treturn errors.New(\"glVertexAttrib2f\")\n\t}\n\tgpVertexAttrib2fARB = uintptr(getProcAddr(\"glVertexAttrib2fARB\"))\n\tgpVertexAttrib2fNV = uintptr(getProcAddr(\"glVertexAttrib2fNV\"))\n\tgpVertexAttrib2fv = uintptr(getProcAddr(\"glVertexAttrib2fv\"))\n\tif gpVertexAttrib2fv == 0 {\n\t\treturn errors.New(\"glVertexAttrib2fv\")\n\t}\n\tgpVertexAttrib2fvARB = uintptr(getProcAddr(\"glVertexAttrib2fvARB\"))\n\tgpVertexAttrib2fvNV = uintptr(getProcAddr(\"glVertexAttrib2fvNV\"))\n\tgpVertexAttrib2hNV = uintptr(getProcAddr(\"glVertexAttrib2hNV\"))\n\tgpVertexAttrib2hvNV = uintptr(getProcAddr(\"glVertexAttrib2hvNV\"))\n\tgpVertexAttrib2s = uintptr(getProcAddr(\"glVertexAttrib2s\"))\n\tif gpVertexAttrib2s == 0 {\n\t\treturn errors.New(\"glVertexAttrib2s\")\n\t}\n\tgpVertexAttrib2sARB = uintptr(getProcAddr(\"glVertexAttrib2sARB\"))\n\tgpVertexAttrib2sNV = uintptr(getProcAddr(\"glVertexAttrib2sNV\"))\n\tgpVertexAttrib2sv = uintptr(getProcAddr(\"glVertexAttrib2sv\"))\n\tif gpVertexAttrib2sv == 0 {\n\t\treturn errors.New(\"glVertexAttrib2sv\")\n\t}\n\tgpVertexAttrib2svARB = uintptr(getProcAddr(\"glVertexAttrib2svARB\"))\n\tgpVertexAttrib2svNV = uintptr(getProcAddr(\"glVertexAttrib2svNV\"))\n\tgpVertexAttrib3d = uintptr(getProcAddr(\"glVertexAttrib3d\"))\n\tif gpVertexAttrib3d == 0 {\n\t\treturn errors.New(\"glVertexAttrib3d\")\n\t}\n\tgpVertexAttrib3dARB = uintptr(getProcAddr(\"glVertexAttrib3dARB\"))\n\tgpVertexAttrib3dNV = uintptr(getProcAddr(\"glVertexAttrib3dNV\"))\n\tgpVertexAttrib3dv = uintptr(getProcAddr(\"glVertexAttrib3dv\"))\n\tif gpVertexAttrib3dv == 0 {\n\t\treturn errors.New(\"glVertexAttrib3dv\")\n\t}\n\tgpVertexAttrib3dvARB = uintptr(getProcAddr(\"glVertexAttrib3dvARB\"))\n\tgpVertexAttrib3dvNV = uintptr(getProcAddr(\"glVertexAttrib3dvNV\"))\n\tgpVertexAttrib3f = uintptr(getProcAddr(\"glVertexAttrib3f\"))\n\tif gpVertexAttrib3f == 0 {\n\t\treturn errors.New(\"glVertexAttrib3f\")\n\t}\n\tgpVertexAttrib3fARB = uintptr(getProcAddr(\"glVertexAttrib3fARB\"))\n\tgpVertexAttrib3fNV = uintptr(getProcAddr(\"glVertexAttrib3fNV\"))\n\tgpVertexAttrib3fv = uintptr(getProcAddr(\"glVertexAttrib3fv\"))\n\tif gpVertexAttrib3fv == 0 {\n\t\treturn errors.New(\"glVertexAttrib3fv\")\n\t}\n\tgpVertexAttrib3fvARB = uintptr(getProcAddr(\"glVertexAttrib3fvARB\"))\n\tgpVertexAttrib3fvNV = uintptr(getProcAddr(\"glVertexAttrib3fvNV\"))\n\tgpVertexAttrib3hNV = uintptr(getProcAddr(\"glVertexAttrib3hNV\"))\n\tgpVertexAttrib3hvNV = uintptr(getProcAddr(\"glVertexAttrib3hvNV\"))\n\tgpVertexAttrib3s = uintptr(getProcAddr(\"glVertexAttrib3s\"))\n\tif gpVertexAttrib3s == 0 {\n\t\treturn errors.New(\"glVertexAttrib3s\")\n\t}\n\tgpVertexAttrib3sARB = uintptr(getProcAddr(\"glVertexAttrib3sARB\"))\n\tgpVertexAttrib3sNV = uintptr(getProcAddr(\"glVertexAttrib3sNV\"))\n\tgpVertexAttrib3sv = uintptr(getProcAddr(\"glVertexAttrib3sv\"))\n\tif gpVertexAttrib3sv == 0 {\n\t\treturn errors.New(\"glVertexAttrib3sv\")\n\t}\n\tgpVertexAttrib3svARB = uintptr(getProcAddr(\"glVertexAttrib3svARB\"))\n\tgpVertexAttrib3svNV = uintptr(getProcAddr(\"glVertexAttrib3svNV\"))\n\tgpVertexAttrib4Nbv = uintptr(getProcAddr(\"glVertexAttrib4Nbv\"))\n\tif gpVertexAttrib4Nbv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Nbv\")\n\t}\n\tgpVertexAttrib4NbvARB = uintptr(getProcAddr(\"glVertexAttrib4NbvARB\"))\n\tgpVertexAttrib4Niv = uintptr(getProcAddr(\"glVertexAttrib4Niv\"))\n\tif gpVertexAttrib4Niv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Niv\")\n\t}\n\tgpVertexAttrib4NivARB = uintptr(getProcAddr(\"glVertexAttrib4NivARB\"))\n\tgpVertexAttrib4Nsv = uintptr(getProcAddr(\"glVertexAttrib4Nsv\"))\n\tif gpVertexAttrib4Nsv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Nsv\")\n\t}\n\tgpVertexAttrib4NsvARB = uintptr(getProcAddr(\"glVertexAttrib4NsvARB\"))\n\tgpVertexAttrib4Nub = uintptr(getProcAddr(\"glVertexAttrib4Nub\"))\n\tif gpVertexAttrib4Nub == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Nub\")\n\t}\n\tgpVertexAttrib4NubARB = uintptr(getProcAddr(\"glVertexAttrib4NubARB\"))\n\tgpVertexAttrib4Nubv = uintptr(getProcAddr(\"glVertexAttrib4Nubv\"))\n\tif gpVertexAttrib4Nubv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Nubv\")\n\t}\n\tgpVertexAttrib4NubvARB = uintptr(getProcAddr(\"glVertexAttrib4NubvARB\"))\n\tgpVertexAttrib4Nuiv = uintptr(getProcAddr(\"glVertexAttrib4Nuiv\"))\n\tif gpVertexAttrib4Nuiv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Nuiv\")\n\t}\n\tgpVertexAttrib4NuivARB = uintptr(getProcAddr(\"glVertexAttrib4NuivARB\"))\n\tgpVertexAttrib4Nusv = uintptr(getProcAddr(\"glVertexAttrib4Nusv\"))\n\tif gpVertexAttrib4Nusv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4Nusv\")\n\t}\n\tgpVertexAttrib4NusvARB = uintptr(getProcAddr(\"glVertexAttrib4NusvARB\"))\n\tgpVertexAttrib4bv = uintptr(getProcAddr(\"glVertexAttrib4bv\"))\n\tif gpVertexAttrib4bv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4bv\")\n\t}\n\tgpVertexAttrib4bvARB = uintptr(getProcAddr(\"glVertexAttrib4bvARB\"))\n\tgpVertexAttrib4d = uintptr(getProcAddr(\"glVertexAttrib4d\"))\n\tif gpVertexAttrib4d == 0 {\n\t\treturn errors.New(\"glVertexAttrib4d\")\n\t}\n\tgpVertexAttrib4dARB = uintptr(getProcAddr(\"glVertexAttrib4dARB\"))\n\tgpVertexAttrib4dNV = uintptr(getProcAddr(\"glVertexAttrib4dNV\"))\n\tgpVertexAttrib4dv = uintptr(getProcAddr(\"glVertexAttrib4dv\"))\n\tif gpVertexAttrib4dv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4dv\")\n\t}\n\tgpVertexAttrib4dvARB = uintptr(getProcAddr(\"glVertexAttrib4dvARB\"))\n\tgpVertexAttrib4dvNV = uintptr(getProcAddr(\"glVertexAttrib4dvNV\"))\n\tgpVertexAttrib4f = uintptr(getProcAddr(\"glVertexAttrib4f\"))\n\tif gpVertexAttrib4f == 0 {\n\t\treturn errors.New(\"glVertexAttrib4f\")\n\t}\n\tgpVertexAttrib4fARB = uintptr(getProcAddr(\"glVertexAttrib4fARB\"))\n\tgpVertexAttrib4fNV = uintptr(getProcAddr(\"glVertexAttrib4fNV\"))\n\tgpVertexAttrib4fv = uintptr(getProcAddr(\"glVertexAttrib4fv\"))\n\tif gpVertexAttrib4fv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4fv\")\n\t}\n\tgpVertexAttrib4fvARB = uintptr(getProcAddr(\"glVertexAttrib4fvARB\"))\n\tgpVertexAttrib4fvNV = uintptr(getProcAddr(\"glVertexAttrib4fvNV\"))\n\tgpVertexAttrib4hNV = uintptr(getProcAddr(\"glVertexAttrib4hNV\"))\n\tgpVertexAttrib4hvNV = uintptr(getProcAddr(\"glVertexAttrib4hvNV\"))\n\tgpVertexAttrib4iv = uintptr(getProcAddr(\"glVertexAttrib4iv\"))\n\tif gpVertexAttrib4iv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4iv\")\n\t}\n\tgpVertexAttrib4ivARB = uintptr(getProcAddr(\"glVertexAttrib4ivARB\"))\n\tgpVertexAttrib4s = uintptr(getProcAddr(\"glVertexAttrib4s\"))\n\tif gpVertexAttrib4s == 0 {\n\t\treturn errors.New(\"glVertexAttrib4s\")\n\t}\n\tgpVertexAttrib4sARB = uintptr(getProcAddr(\"glVertexAttrib4sARB\"))\n\tgpVertexAttrib4sNV = uintptr(getProcAddr(\"glVertexAttrib4sNV\"))\n\tgpVertexAttrib4sv = uintptr(getProcAddr(\"glVertexAttrib4sv\"))\n\tif gpVertexAttrib4sv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4sv\")\n\t}\n\tgpVertexAttrib4svARB = uintptr(getProcAddr(\"glVertexAttrib4svARB\"))\n\tgpVertexAttrib4svNV = uintptr(getProcAddr(\"glVertexAttrib4svNV\"))\n\tgpVertexAttrib4ubNV = uintptr(getProcAddr(\"glVertexAttrib4ubNV\"))\n\tgpVertexAttrib4ubv = uintptr(getProcAddr(\"glVertexAttrib4ubv\"))\n\tif gpVertexAttrib4ubv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4ubv\")\n\t}\n\tgpVertexAttrib4ubvARB = uintptr(getProcAddr(\"glVertexAttrib4ubvARB\"))\n\tgpVertexAttrib4ubvNV = uintptr(getProcAddr(\"glVertexAttrib4ubvNV\"))\n\tgpVertexAttrib4uiv = uintptr(getProcAddr(\"glVertexAttrib4uiv\"))\n\tif gpVertexAttrib4uiv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4uiv\")\n\t}\n\tgpVertexAttrib4uivARB = uintptr(getProcAddr(\"glVertexAttrib4uivARB\"))\n\tgpVertexAttrib4usv = uintptr(getProcAddr(\"glVertexAttrib4usv\"))\n\tif gpVertexAttrib4usv == 0 {\n\t\treturn errors.New(\"glVertexAttrib4usv\")\n\t}\n\tgpVertexAttrib4usvARB = uintptr(getProcAddr(\"glVertexAttrib4usvARB\"))\n\tgpVertexAttribArrayObjectATI = uintptr(getProcAddr(\"glVertexAttribArrayObjectATI\"))\n\tgpVertexAttribBinding = uintptr(getProcAddr(\"glVertexAttribBinding\"))\n\tgpVertexAttribDivisorARB = uintptr(getProcAddr(\"glVertexAttribDivisorARB\"))\n\tgpVertexAttribFormat = uintptr(getProcAddr(\"glVertexAttribFormat\"))\n\tgpVertexAttribFormatNV = uintptr(getProcAddr(\"glVertexAttribFormatNV\"))\n\tgpVertexAttribI1iEXT = uintptr(getProcAddr(\"glVertexAttribI1iEXT\"))\n\tgpVertexAttribI1ivEXT = uintptr(getProcAddr(\"glVertexAttribI1ivEXT\"))\n\tgpVertexAttribI1uiEXT = uintptr(getProcAddr(\"glVertexAttribI1uiEXT\"))\n\tgpVertexAttribI1uivEXT = uintptr(getProcAddr(\"glVertexAttribI1uivEXT\"))\n\tgpVertexAttribI2iEXT = uintptr(getProcAddr(\"glVertexAttribI2iEXT\"))\n\tgpVertexAttribI2ivEXT = uintptr(getProcAddr(\"glVertexAttribI2ivEXT\"))\n\tgpVertexAttribI2uiEXT = uintptr(getProcAddr(\"glVertexAttribI2uiEXT\"))\n\tgpVertexAttribI2uivEXT = uintptr(getProcAddr(\"glVertexAttribI2uivEXT\"))\n\tgpVertexAttribI3iEXT = uintptr(getProcAddr(\"glVertexAttribI3iEXT\"))\n\tgpVertexAttribI3ivEXT = uintptr(getProcAddr(\"glVertexAttribI3ivEXT\"))\n\tgpVertexAttribI3uiEXT = uintptr(getProcAddr(\"glVertexAttribI3uiEXT\"))\n\tgpVertexAttribI3uivEXT = uintptr(getProcAddr(\"glVertexAttribI3uivEXT\"))\n\tgpVertexAttribI4bvEXT = uintptr(getProcAddr(\"glVertexAttribI4bvEXT\"))\n\tgpVertexAttribI4iEXT = uintptr(getProcAddr(\"glVertexAttribI4iEXT\"))\n\tgpVertexAttribI4ivEXT = uintptr(getProcAddr(\"glVertexAttribI4ivEXT\"))\n\tgpVertexAttribI4svEXT = uintptr(getProcAddr(\"glVertexAttribI4svEXT\"))\n\tgpVertexAttribI4ubvEXT = uintptr(getProcAddr(\"glVertexAttribI4ubvEXT\"))\n\tgpVertexAttribI4uiEXT = uintptr(getProcAddr(\"glVertexAttribI4uiEXT\"))\n\tgpVertexAttribI4uivEXT = uintptr(getProcAddr(\"glVertexAttribI4uivEXT\"))\n\tgpVertexAttribI4usvEXT = uintptr(getProcAddr(\"glVertexAttribI4usvEXT\"))\n\tgpVertexAttribIFormat = uintptr(getProcAddr(\"glVertexAttribIFormat\"))\n\tgpVertexAttribIFormatNV = uintptr(getProcAddr(\"glVertexAttribIFormatNV\"))\n\tgpVertexAttribIPointerEXT = uintptr(getProcAddr(\"glVertexAttribIPointerEXT\"))\n\tgpVertexAttribL1d = uintptr(getProcAddr(\"glVertexAttribL1d\"))\n\tgpVertexAttribL1dEXT = uintptr(getProcAddr(\"glVertexAttribL1dEXT\"))\n\tgpVertexAttribL1dv = uintptr(getProcAddr(\"glVertexAttribL1dv\"))\n\tgpVertexAttribL1dvEXT = uintptr(getProcAddr(\"glVertexAttribL1dvEXT\"))\n\tgpVertexAttribL1i64NV = uintptr(getProcAddr(\"glVertexAttribL1i64NV\"))\n\tgpVertexAttribL1i64vNV = uintptr(getProcAddr(\"glVertexAttribL1i64vNV\"))\n\tgpVertexAttribL1ui64ARB = uintptr(getProcAddr(\"glVertexAttribL1ui64ARB\"))\n\tgpVertexAttribL1ui64NV = uintptr(getProcAddr(\"glVertexAttribL1ui64NV\"))\n\tgpVertexAttribL1ui64vARB = uintptr(getProcAddr(\"glVertexAttribL1ui64vARB\"))\n\tgpVertexAttribL1ui64vNV = uintptr(getProcAddr(\"glVertexAttribL1ui64vNV\"))\n\tgpVertexAttribL2d = uintptr(getProcAddr(\"glVertexAttribL2d\"))\n\tgpVertexAttribL2dEXT = uintptr(getProcAddr(\"glVertexAttribL2dEXT\"))\n\tgpVertexAttribL2dv = uintptr(getProcAddr(\"glVertexAttribL2dv\"))\n\tgpVertexAttribL2dvEXT = uintptr(getProcAddr(\"glVertexAttribL2dvEXT\"))\n\tgpVertexAttribL2i64NV = uintptr(getProcAddr(\"glVertexAttribL2i64NV\"))\n\tgpVertexAttribL2i64vNV = uintptr(getProcAddr(\"glVertexAttribL2i64vNV\"))\n\tgpVertexAttribL2ui64NV = uintptr(getProcAddr(\"glVertexAttribL2ui64NV\"))\n\tgpVertexAttribL2ui64vNV = uintptr(getProcAddr(\"glVertexAttribL2ui64vNV\"))\n\tgpVertexAttribL3d = uintptr(getProcAddr(\"glVertexAttribL3d\"))\n\tgpVertexAttribL3dEXT = uintptr(getProcAddr(\"glVertexAttribL3dEXT\"))\n\tgpVertexAttribL3dv = uintptr(getProcAddr(\"glVertexAttribL3dv\"))\n\tgpVertexAttribL3dvEXT = uintptr(getProcAddr(\"glVertexAttribL3dvEXT\"))\n\tgpVertexAttribL3i64NV = uintptr(getProcAddr(\"glVertexAttribL3i64NV\"))\n\tgpVertexAttribL3i64vNV = uintptr(getProcAddr(\"glVertexAttribL3i64vNV\"))\n\tgpVertexAttribL3ui64NV = uintptr(getProcAddr(\"glVertexAttribL3ui64NV\"))\n\tgpVertexAttribL3ui64vNV = uintptr(getProcAddr(\"glVertexAttribL3ui64vNV\"))\n\tgpVertexAttribL4d = uintptr(getProcAddr(\"glVertexAttribL4d\"))\n\tgpVertexAttribL4dEXT = uintptr(getProcAddr(\"glVertexAttribL4dEXT\"))\n\tgpVertexAttribL4dv = uintptr(getProcAddr(\"glVertexAttribL4dv\"))\n\tgpVertexAttribL4dvEXT = uintptr(getProcAddr(\"glVertexAttribL4dvEXT\"))\n\tgpVertexAttribL4i64NV = uintptr(getProcAddr(\"glVertexAttribL4i64NV\"))\n\tgpVertexAttribL4i64vNV = uintptr(getProcAddr(\"glVertexAttribL4i64vNV\"))\n\tgpVertexAttribL4ui64NV = uintptr(getProcAddr(\"glVertexAttribL4ui64NV\"))\n\tgpVertexAttribL4ui64vNV = uintptr(getProcAddr(\"glVertexAttribL4ui64vNV\"))\n\tgpVertexAttribLFormat = uintptr(getProcAddr(\"glVertexAttribLFormat\"))\n\tgpVertexAttribLFormatNV = uintptr(getProcAddr(\"glVertexAttribLFormatNV\"))\n\tgpVertexAttribLPointer = uintptr(getProcAddr(\"glVertexAttribLPointer\"))\n\tgpVertexAttribLPointerEXT = uintptr(getProcAddr(\"glVertexAttribLPointerEXT\"))\n\tgpVertexAttribP1ui = uintptr(getProcAddr(\"glVertexAttribP1ui\"))\n\tgpVertexAttribP1uiv = uintptr(getProcAddr(\"glVertexAttribP1uiv\"))\n\tgpVertexAttribP2ui = uintptr(getProcAddr(\"glVertexAttribP2ui\"))\n\tgpVertexAttribP2uiv = uintptr(getProcAddr(\"glVertexAttribP2uiv\"))\n\tgpVertexAttribP3ui = uintptr(getProcAddr(\"glVertexAttribP3ui\"))\n\tgpVertexAttribP3uiv = uintptr(getProcAddr(\"glVertexAttribP3uiv\"))\n\tgpVertexAttribP4ui = uintptr(getProcAddr(\"glVertexAttribP4ui\"))\n\tgpVertexAttribP4uiv = uintptr(getProcAddr(\"glVertexAttribP4uiv\"))\n\tgpVertexAttribParameteriAMD = uintptr(getProcAddr(\"glVertexAttribParameteriAMD\"))\n\tgpVertexAttribPointer = uintptr(getProcAddr(\"glVertexAttribPointer\"))\n\tif gpVertexAttribPointer == 0 {\n\t\treturn errors.New(\"glVertexAttribPointer\")\n\t}\n\tgpVertexAttribPointerARB = uintptr(getProcAddr(\"glVertexAttribPointerARB\"))\n\tgpVertexAttribPointerNV = uintptr(getProcAddr(\"glVertexAttribPointerNV\"))\n\tgpVertexAttribs1dvNV = uintptr(getProcAddr(\"glVertexAttribs1dvNV\"))\n\tgpVertexAttribs1fvNV = uintptr(getProcAddr(\"glVertexAttribs1fvNV\"))\n\tgpVertexAttribs1hvNV = uintptr(getProcAddr(\"glVertexAttribs1hvNV\"))\n\tgpVertexAttribs1svNV = uintptr(getProcAddr(\"glVertexAttribs1svNV\"))\n\tgpVertexAttribs2dvNV = uintptr(getProcAddr(\"glVertexAttribs2dvNV\"))\n\tgpVertexAttribs2fvNV = uintptr(getProcAddr(\"glVertexAttribs2fvNV\"))\n\tgpVertexAttribs2hvNV = uintptr(getProcAddr(\"glVertexAttribs2hvNV\"))\n\tgpVertexAttribs2svNV = uintptr(getProcAddr(\"glVertexAttribs2svNV\"))\n\tgpVertexAttribs3dvNV = uintptr(getProcAddr(\"glVertexAttribs3dvNV\"))\n\tgpVertexAttribs3fvNV = uintptr(getProcAddr(\"glVertexAttribs3fvNV\"))\n\tgpVertexAttribs3hvNV = uintptr(getProcAddr(\"glVertexAttribs3hvNV\"))\n\tgpVertexAttribs3svNV = uintptr(getProcAddr(\"glVertexAttribs3svNV\"))\n\tgpVertexAttribs4dvNV = uintptr(getProcAddr(\"glVertexAttribs4dvNV\"))\n\tgpVertexAttribs4fvNV = uintptr(getProcAddr(\"glVertexAttribs4fvNV\"))\n\tgpVertexAttribs4hvNV = uintptr(getProcAddr(\"glVertexAttribs4hvNV\"))\n\tgpVertexAttribs4svNV = uintptr(getProcAddr(\"glVertexAttribs4svNV\"))\n\tgpVertexAttribs4ubvNV = uintptr(getProcAddr(\"glVertexAttribs4ubvNV\"))\n\tgpVertexBindingDivisor = uintptr(getProcAddr(\"glVertexBindingDivisor\"))\n\tgpVertexBlendARB = uintptr(getProcAddr(\"glVertexBlendARB\"))\n\tgpVertexBlendEnvfATI = uintptr(getProcAddr(\"glVertexBlendEnvfATI\"))\n\tgpVertexBlendEnviATI = uintptr(getProcAddr(\"glVertexBlendEnviATI\"))\n\tgpVertexFormatNV = uintptr(getProcAddr(\"glVertexFormatNV\"))\n\tgpVertexPointer = uintptr(getProcAddr(\"glVertexPointer\"))\n\tif gpVertexPointer == 0 {\n\t\treturn errors.New(\"glVertexPointer\")\n\t}\n\tgpVertexPointerEXT = uintptr(getProcAddr(\"glVertexPointerEXT\"))\n\tgpVertexPointerListIBM = uintptr(getProcAddr(\"glVertexPointerListIBM\"))\n\tgpVertexPointervINTEL = uintptr(getProcAddr(\"glVertexPointervINTEL\"))\n\tgpVertexStream1dATI = uintptr(getProcAddr(\"glVertexStream1dATI\"))\n\tgpVertexStream1dvATI = uintptr(getProcAddr(\"glVertexStream1dvATI\"))\n\tgpVertexStream1fATI = uintptr(getProcAddr(\"glVertexStream1fATI\"))\n\tgpVertexStream1fvATI = uintptr(getProcAddr(\"glVertexStream1fvATI\"))\n\tgpVertexStream1iATI = uintptr(getProcAddr(\"glVertexStream1iATI\"))\n\tgpVertexStream1ivATI = uintptr(getProcAddr(\"glVertexStream1ivATI\"))\n\tgpVertexStream1sATI = uintptr(getProcAddr(\"glVertexStream1sATI\"))\n\tgpVertexStream1svATI = uintptr(getProcAddr(\"glVertexStream1svATI\"))\n\tgpVertexStream2dATI = uintptr(getProcAddr(\"glVertexStream2dATI\"))\n\tgpVertexStream2dvATI = uintptr(getProcAddr(\"glVertexStream2dvATI\"))\n\tgpVertexStream2fATI = uintptr(getProcAddr(\"glVertexStream2fATI\"))\n\tgpVertexStream2fvATI = uintptr(getProcAddr(\"glVertexStream2fvATI\"))\n\tgpVertexStream2iATI = uintptr(getProcAddr(\"glVertexStream2iATI\"))\n\tgpVertexStream2ivATI = uintptr(getProcAddr(\"glVertexStream2ivATI\"))\n\tgpVertexStream2sATI = uintptr(getProcAddr(\"glVertexStream2sATI\"))\n\tgpVertexStream2svATI = uintptr(getProcAddr(\"glVertexStream2svATI\"))\n\tgpVertexStream3dATI = uintptr(getProcAddr(\"glVertexStream3dATI\"))\n\tgpVertexStream3dvATI = uintptr(getProcAddr(\"glVertexStream3dvATI\"))\n\tgpVertexStream3fATI = uintptr(getProcAddr(\"glVertexStream3fATI\"))\n\tgpVertexStream3fvATI = uintptr(getProcAddr(\"glVertexStream3fvATI\"))\n\tgpVertexStream3iATI = uintptr(getProcAddr(\"glVertexStream3iATI\"))\n\tgpVertexStream3ivATI = uintptr(getProcAddr(\"glVertexStream3ivATI\"))\n\tgpVertexStream3sATI = uintptr(getProcAddr(\"glVertexStream3sATI\"))\n\tgpVertexStream3svATI = uintptr(getProcAddr(\"glVertexStream3svATI\"))\n\tgpVertexStream4dATI = uintptr(getProcAddr(\"glVertexStream4dATI\"))\n\tgpVertexStream4dvATI = uintptr(getProcAddr(\"glVertexStream4dvATI\"))\n\tgpVertexStream4fATI = uintptr(getProcAddr(\"glVertexStream4fATI\"))\n\tgpVertexStream4fvATI = uintptr(getProcAddr(\"glVertexStream4fvATI\"))\n\tgpVertexStream4iATI = uintptr(getProcAddr(\"glVertexStream4iATI\"))\n\tgpVertexStream4ivATI = uintptr(getProcAddr(\"glVertexStream4ivATI\"))\n\tgpVertexStream4sATI = uintptr(getProcAddr(\"glVertexStream4sATI\"))\n\tgpVertexStream4svATI = uintptr(getProcAddr(\"glVertexStream4svATI\"))\n\tgpVertexWeightPointerEXT = uintptr(getProcAddr(\"glVertexWeightPointerEXT\"))\n\tgpVertexWeightfEXT = uintptr(getProcAddr(\"glVertexWeightfEXT\"))\n\tgpVertexWeightfvEXT = uintptr(getProcAddr(\"glVertexWeightfvEXT\"))\n\tgpVertexWeighthNV = uintptr(getProcAddr(\"glVertexWeighthNV\"))\n\tgpVertexWeighthvNV = uintptr(getProcAddr(\"glVertexWeighthvNV\"))\n\tgpVideoCaptureNV = uintptr(getProcAddr(\"glVideoCaptureNV\"))\n\tgpVideoCaptureStreamParameterdvNV = uintptr(getProcAddr(\"glVideoCaptureStreamParameterdvNV\"))\n\tgpVideoCaptureStreamParameterfvNV = uintptr(getProcAddr(\"glVideoCaptureStreamParameterfvNV\"))\n\tgpVideoCaptureStreamParameterivNV = uintptr(getProcAddr(\"glVideoCaptureStreamParameterivNV\"))\n\tgpViewport = uintptr(getProcAddr(\"glViewport\"))\n\tif gpViewport == 0 {\n\t\treturn errors.New(\"glViewport\")\n\t}\n\tgpViewportArrayv = uintptr(getProcAddr(\"glViewportArrayv\"))\n\tgpViewportIndexedf = uintptr(getProcAddr(\"glViewportIndexedf\"))\n\tgpViewportIndexedfv = uintptr(getProcAddr(\"glViewportIndexedfv\"))\n\tgpViewportPositionWScaleNV = uintptr(getProcAddr(\"glViewportPositionWScaleNV\"))\n\tgpViewportSwizzleNV = uintptr(getProcAddr(\"glViewportSwizzleNV\"))\n\tgpWaitSemaphoreEXT = uintptr(getProcAddr(\"glWaitSemaphoreEXT\"))\n\tgpWaitSync = uintptr(getProcAddr(\"glWaitSync\"))\n\tgpWaitVkSemaphoreNV = uintptr(getProcAddr(\"glWaitVkSemaphoreNV\"))\n\tgpWeightPathsNV = uintptr(getProcAddr(\"glWeightPathsNV\"))\n\tgpWeightPointerARB = uintptr(getProcAddr(\"glWeightPointerARB\"))\n\tgpWeightbvARB = uintptr(getProcAddr(\"glWeightbvARB\"))\n\tgpWeightdvARB = uintptr(getProcAddr(\"glWeightdvARB\"))\n\tgpWeightfvARB = uintptr(getProcAddr(\"glWeightfvARB\"))\n\tgpWeightivARB = uintptr(getProcAddr(\"glWeightivARB\"))\n\tgpWeightsvARB = uintptr(getProcAddr(\"glWeightsvARB\"))\n\tgpWeightubvARB = uintptr(getProcAddr(\"glWeightubvARB\"))\n\tgpWeightuivARB = uintptr(getProcAddr(\"glWeightuivARB\"))\n\tgpWeightusvARB = uintptr(getProcAddr(\"glWeightusvARB\"))\n\tgpWindowPos2d = uintptr(getProcAddr(\"glWindowPos2d\"))\n\tif gpWindowPos2d == 0 {\n\t\treturn errors.New(\"glWindowPos2d\")\n\t}\n\tgpWindowPos2dARB = uintptr(getProcAddr(\"glWindowPos2dARB\"))\n\tgpWindowPos2dMESA = uintptr(getProcAddr(\"glWindowPos2dMESA\"))\n\tgpWindowPos2dv = uintptr(getProcAddr(\"glWindowPos2dv\"))\n\tif gpWindowPos2dv == 0 {\n\t\treturn errors.New(\"glWindowPos2dv\")\n\t}\n\tgpWindowPos2dvARB = uintptr(getProcAddr(\"glWindowPos2dvARB\"))\n\tgpWindowPos2dvMESA = uintptr(getProcAddr(\"glWindowPos2dvMESA\"))\n\tgpWindowPos2f = uintptr(getProcAddr(\"glWindowPos2f\"))\n\tif gpWindowPos2f == 0 {\n\t\treturn errors.New(\"glWindowPos2f\")\n\t}\n\tgpWindowPos2fARB = uintptr(getProcAddr(\"glWindowPos2fARB\"))\n\tgpWindowPos2fMESA = uintptr(getProcAddr(\"glWindowPos2fMESA\"))\n\tgpWindowPos2fv = uintptr(getProcAddr(\"glWindowPos2fv\"))\n\tif gpWindowPos2fv == 0 {\n\t\treturn errors.New(\"glWindowPos2fv\")\n\t}\n\tgpWindowPos2fvARB = uintptr(getProcAddr(\"glWindowPos2fvARB\"))\n\tgpWindowPos2fvMESA = uintptr(getProcAddr(\"glWindowPos2fvMESA\"))\n\tgpWindowPos2i = uintptr(getProcAddr(\"glWindowPos2i\"))\n\tif gpWindowPos2i == 0 {\n\t\treturn errors.New(\"glWindowPos2i\")\n\t}\n\tgpWindowPos2iARB = uintptr(getProcAddr(\"glWindowPos2iARB\"))\n\tgpWindowPos2iMESA = uintptr(getProcAddr(\"glWindowPos2iMESA\"))\n\tgpWindowPos2iv = uintptr(getProcAddr(\"glWindowPos2iv\"))\n\tif gpWindowPos2iv == 0 {\n\t\treturn errors.New(\"glWindowPos2iv\")\n\t}\n\tgpWindowPos2ivARB = uintptr(getProcAddr(\"glWindowPos2ivARB\"))\n\tgpWindowPos2ivMESA = uintptr(getProcAddr(\"glWindowPos2ivMESA\"))\n\tgpWindowPos2s = uintptr(getProcAddr(\"glWindowPos2s\"))\n\tif gpWindowPos2s == 0 {\n\t\treturn errors.New(\"glWindowPos2s\")\n\t}\n\tgpWindowPos2sARB = uintptr(getProcAddr(\"glWindowPos2sARB\"))\n\tgpWindowPos2sMESA = uintptr(getProcAddr(\"glWindowPos2sMESA\"))\n\tgpWindowPos2sv = uintptr(getProcAddr(\"glWindowPos2sv\"))\n\tif gpWindowPos2sv == 0 {\n\t\treturn errors.New(\"glWindowPos2sv\")\n\t}\n\tgpWindowPos2svARB = uintptr(getProcAddr(\"glWindowPos2svARB\"))\n\tgpWindowPos2svMESA = uintptr(getProcAddr(\"glWindowPos2svMESA\"))\n\tgpWindowPos3d = uintptr(getProcAddr(\"glWindowPos3d\"))\n\tif gpWindowPos3d == 0 {\n\t\treturn errors.New(\"glWindowPos3d\")\n\t}\n\tgpWindowPos3dARB = uintptr(getProcAddr(\"glWindowPos3dARB\"))\n\tgpWindowPos3dMESA = uintptr(getProcAddr(\"glWindowPos3dMESA\"))\n\tgpWindowPos3dv = uintptr(getProcAddr(\"glWindowPos3dv\"))\n\tif gpWindowPos3dv == 0 {\n\t\treturn errors.New(\"glWindowPos3dv\")\n\t}\n\tgpWindowPos3dvARB = uintptr(getProcAddr(\"glWindowPos3dvARB\"))\n\tgpWindowPos3dvMESA = uintptr(getProcAddr(\"glWindowPos3dvMESA\"))\n\tgpWindowPos3f = uintptr(getProcAddr(\"glWindowPos3f\"))\n\tif gpWindowPos3f == 0 {\n\t\treturn errors.New(\"glWindowPos3f\")\n\t}\n\tgpWindowPos3fARB = uintptr(getProcAddr(\"glWindowPos3fARB\"))\n\tgpWindowPos3fMESA = uintptr(getProcAddr(\"glWindowPos3fMESA\"))\n\tgpWindowPos3fv = uintptr(getProcAddr(\"glWindowPos3fv\"))\n\tif gpWindowPos3fv == 0 {\n\t\treturn errors.New(\"glWindowPos3fv\")\n\t}\n\tgpWindowPos3fvARB = uintptr(getProcAddr(\"glWindowPos3fvARB\"))\n\tgpWindowPos3fvMESA = uintptr(getProcAddr(\"glWindowPos3fvMESA\"))\n\tgpWindowPos3i = uintptr(getProcAddr(\"glWindowPos3i\"))\n\tif gpWindowPos3i == 0 {\n\t\treturn errors.New(\"glWindowPos3i\")\n\t}\n\tgpWindowPos3iARB = uintptr(getProcAddr(\"glWindowPos3iARB\"))\n\tgpWindowPos3iMESA = uintptr(getProcAddr(\"glWindowPos3iMESA\"))\n\tgpWindowPos3iv = uintptr(getProcAddr(\"glWindowPos3iv\"))\n\tif gpWindowPos3iv == 0 {\n\t\treturn errors.New(\"glWindowPos3iv\")\n\t}\n\tgpWindowPos3ivARB = uintptr(getProcAddr(\"glWindowPos3ivARB\"))\n\tgpWindowPos3ivMESA = uintptr(getProcAddr(\"glWindowPos3ivMESA\"))\n\tgpWindowPos3s = uintptr(getProcAddr(\"glWindowPos3s\"))\n\tif gpWindowPos3s == 0 {\n\t\treturn errors.New(\"glWindowPos3s\")\n\t}\n\tgpWindowPos3sARB = uintptr(getProcAddr(\"glWindowPos3sARB\"))\n\tgpWindowPos3sMESA = uintptr(getProcAddr(\"glWindowPos3sMESA\"))\n\tgpWindowPos3sv = uintptr(getProcAddr(\"glWindowPos3sv\"))\n\tif gpWindowPos3sv == 0 {\n\t\treturn errors.New(\"glWindowPos3sv\")\n\t}\n\tgpWindowPos3svARB = uintptr(getProcAddr(\"glWindowPos3svARB\"))\n\tgpWindowPos3svMESA = uintptr(getProcAddr(\"glWindowPos3svMESA\"))\n\tgpWindowPos4dMESA = uintptr(getProcAddr(\"glWindowPos4dMESA\"))\n\tgpWindowPos4dvMESA = uintptr(getProcAddr(\"glWindowPos4dvMESA\"))\n\tgpWindowPos4fMESA = uintptr(getProcAddr(\"glWindowPos4fMESA\"))\n\tgpWindowPos4fvMESA = uintptr(getProcAddr(\"glWindowPos4fvMESA\"))\n\tgpWindowPos4iMESA = uintptr(getProcAddr(\"glWindowPos4iMESA\"))\n\tgpWindowPos4ivMESA = uintptr(getProcAddr(\"glWindowPos4ivMESA\"))\n\tgpWindowPos4sMESA = uintptr(getProcAddr(\"glWindowPos4sMESA\"))\n\tgpWindowPos4svMESA = uintptr(getProcAddr(\"glWindowPos4svMESA\"))\n\tgpWindowRectanglesEXT = uintptr(getProcAddr(\"glWindowRectanglesEXT\"))\n\tgpWriteMaskEXT = uintptr(getProcAddr(\"glWriteMaskEXT\"))\n\treturn nil\n}", "func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {\n\tgpAccum = (C.GPACCUM)(getProcAddr(\"glAccum\"))\n\tif gpAccum == nil {\n\t\treturn errors.New(\"glAccum\")\n\t}\n\tgpAccumxOES = (C.GPACCUMXOES)(getProcAddr(\"glAccumxOES\"))\n\tgpAcquireKeyedMutexWin32EXT = (C.GPACQUIREKEYEDMUTEXWIN32EXT)(getProcAddr(\"glAcquireKeyedMutexWin32EXT\"))\n\tgpActiveProgramEXT = (C.GPACTIVEPROGRAMEXT)(getProcAddr(\"glActiveProgramEXT\"))\n\tgpActiveShaderProgram = (C.GPACTIVESHADERPROGRAM)(getProcAddr(\"glActiveShaderProgram\"))\n\tif gpActiveShaderProgram == nil {\n\t\treturn errors.New(\"glActiveShaderProgram\")\n\t}\n\tgpActiveShaderProgramEXT = (C.GPACTIVESHADERPROGRAMEXT)(getProcAddr(\"glActiveShaderProgramEXT\"))\n\tgpActiveStencilFaceEXT = (C.GPACTIVESTENCILFACEEXT)(getProcAddr(\"glActiveStencilFaceEXT\"))\n\tgpActiveTexture = (C.GPACTIVETEXTURE)(getProcAddr(\"glActiveTexture\"))\n\tif gpActiveTexture == nil {\n\t\treturn errors.New(\"glActiveTexture\")\n\t}\n\tgpActiveTextureARB = (C.GPACTIVETEXTUREARB)(getProcAddr(\"glActiveTextureARB\"))\n\tgpActiveVaryingNV = (C.GPACTIVEVARYINGNV)(getProcAddr(\"glActiveVaryingNV\"))\n\tgpAlphaFragmentOp1ATI = (C.GPALPHAFRAGMENTOP1ATI)(getProcAddr(\"glAlphaFragmentOp1ATI\"))\n\tgpAlphaFragmentOp2ATI = (C.GPALPHAFRAGMENTOP2ATI)(getProcAddr(\"glAlphaFragmentOp2ATI\"))\n\tgpAlphaFragmentOp3ATI = (C.GPALPHAFRAGMENTOP3ATI)(getProcAddr(\"glAlphaFragmentOp3ATI\"))\n\tgpAlphaFunc = (C.GPALPHAFUNC)(getProcAddr(\"glAlphaFunc\"))\n\tif gpAlphaFunc == nil {\n\t\treturn errors.New(\"glAlphaFunc\")\n\t}\n\tgpAlphaFuncxOES = (C.GPALPHAFUNCXOES)(getProcAddr(\"glAlphaFuncxOES\"))\n\tgpAlphaToCoverageDitherControlNV = (C.GPALPHATOCOVERAGEDITHERCONTROLNV)(getProcAddr(\"glAlphaToCoverageDitherControlNV\"))\n\tgpApplyFramebufferAttachmentCMAAINTEL = (C.GPAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL)(getProcAddr(\"glApplyFramebufferAttachmentCMAAINTEL\"))\n\tgpApplyTextureEXT = (C.GPAPPLYTEXTUREEXT)(getProcAddr(\"glApplyTextureEXT\"))\n\tgpAreProgramsResidentNV = (C.GPAREPROGRAMSRESIDENTNV)(getProcAddr(\"glAreProgramsResidentNV\"))\n\tgpAreTexturesResident = (C.GPARETEXTURESRESIDENT)(getProcAddr(\"glAreTexturesResident\"))\n\tif gpAreTexturesResident == nil {\n\t\treturn errors.New(\"glAreTexturesResident\")\n\t}\n\tgpAreTexturesResidentEXT = (C.GPARETEXTURESRESIDENTEXT)(getProcAddr(\"glAreTexturesResidentEXT\"))\n\tgpArrayElement = (C.GPARRAYELEMENT)(getProcAddr(\"glArrayElement\"))\n\tif gpArrayElement == nil {\n\t\treturn errors.New(\"glArrayElement\")\n\t}\n\tgpArrayElementEXT = (C.GPARRAYELEMENTEXT)(getProcAddr(\"glArrayElementEXT\"))\n\tgpArrayObjectATI = (C.GPARRAYOBJECTATI)(getProcAddr(\"glArrayObjectATI\"))\n\tgpAsyncCopyBufferSubDataNVX = (C.GPASYNCCOPYBUFFERSUBDATANVX)(getProcAddr(\"glAsyncCopyBufferSubDataNVX\"))\n\tgpAsyncCopyImageSubDataNVX = (C.GPASYNCCOPYIMAGESUBDATANVX)(getProcAddr(\"glAsyncCopyImageSubDataNVX\"))\n\tgpAsyncMarkerSGIX = (C.GPASYNCMARKERSGIX)(getProcAddr(\"glAsyncMarkerSGIX\"))\n\tgpAttachObjectARB = (C.GPATTACHOBJECTARB)(getProcAddr(\"glAttachObjectARB\"))\n\tgpAttachShader = (C.GPATTACHSHADER)(getProcAddr(\"glAttachShader\"))\n\tif gpAttachShader == nil {\n\t\treturn errors.New(\"glAttachShader\")\n\t}\n\tgpBegin = (C.GPBEGIN)(getProcAddr(\"glBegin\"))\n\tif gpBegin == nil {\n\t\treturn errors.New(\"glBegin\")\n\t}\n\tgpBeginConditionalRender = (C.GPBEGINCONDITIONALRENDER)(getProcAddr(\"glBeginConditionalRender\"))\n\tif gpBeginConditionalRender == nil {\n\t\treturn errors.New(\"glBeginConditionalRender\")\n\t}\n\tgpBeginConditionalRenderNV = (C.GPBEGINCONDITIONALRENDERNV)(getProcAddr(\"glBeginConditionalRenderNV\"))\n\tgpBeginConditionalRenderNVX = (C.GPBEGINCONDITIONALRENDERNVX)(getProcAddr(\"glBeginConditionalRenderNVX\"))\n\tgpBeginFragmentShaderATI = (C.GPBEGINFRAGMENTSHADERATI)(getProcAddr(\"glBeginFragmentShaderATI\"))\n\tgpBeginOcclusionQueryNV = (C.GPBEGINOCCLUSIONQUERYNV)(getProcAddr(\"glBeginOcclusionQueryNV\"))\n\tgpBeginPerfMonitorAMD = (C.GPBEGINPERFMONITORAMD)(getProcAddr(\"glBeginPerfMonitorAMD\"))\n\tgpBeginPerfQueryINTEL = (C.GPBEGINPERFQUERYINTEL)(getProcAddr(\"glBeginPerfQueryINTEL\"))\n\tgpBeginQuery = (C.GPBEGINQUERY)(getProcAddr(\"glBeginQuery\"))\n\tif gpBeginQuery == nil {\n\t\treturn errors.New(\"glBeginQuery\")\n\t}\n\tgpBeginQueryARB = (C.GPBEGINQUERYARB)(getProcAddr(\"glBeginQueryARB\"))\n\tgpBeginQueryIndexed = (C.GPBEGINQUERYINDEXED)(getProcAddr(\"glBeginQueryIndexed\"))\n\tif gpBeginQueryIndexed == nil {\n\t\treturn errors.New(\"glBeginQueryIndexed\")\n\t}\n\tgpBeginTransformFeedback = (C.GPBEGINTRANSFORMFEEDBACK)(getProcAddr(\"glBeginTransformFeedback\"))\n\tif gpBeginTransformFeedback == nil {\n\t\treturn errors.New(\"glBeginTransformFeedback\")\n\t}\n\tgpBeginTransformFeedbackEXT = (C.GPBEGINTRANSFORMFEEDBACKEXT)(getProcAddr(\"glBeginTransformFeedbackEXT\"))\n\tgpBeginTransformFeedbackNV = (C.GPBEGINTRANSFORMFEEDBACKNV)(getProcAddr(\"glBeginTransformFeedbackNV\"))\n\tgpBeginVertexShaderEXT = (C.GPBEGINVERTEXSHADEREXT)(getProcAddr(\"glBeginVertexShaderEXT\"))\n\tgpBeginVideoCaptureNV = (C.GPBEGINVIDEOCAPTURENV)(getProcAddr(\"glBeginVideoCaptureNV\"))\n\tgpBindAttribLocation = (C.GPBINDATTRIBLOCATION)(getProcAddr(\"glBindAttribLocation\"))\n\tif gpBindAttribLocation == nil {\n\t\treturn errors.New(\"glBindAttribLocation\")\n\t}\n\tgpBindAttribLocationARB = (C.GPBINDATTRIBLOCATIONARB)(getProcAddr(\"glBindAttribLocationARB\"))\n\tgpBindBuffer = (C.GPBINDBUFFER)(getProcAddr(\"glBindBuffer\"))\n\tif gpBindBuffer == nil {\n\t\treturn errors.New(\"glBindBuffer\")\n\t}\n\tgpBindBufferARB = (C.GPBINDBUFFERARB)(getProcAddr(\"glBindBufferARB\"))\n\tgpBindBufferBase = (C.GPBINDBUFFERBASE)(getProcAddr(\"glBindBufferBase\"))\n\tif gpBindBufferBase == nil {\n\t\treturn errors.New(\"glBindBufferBase\")\n\t}\n\tgpBindBufferBaseEXT = (C.GPBINDBUFFERBASEEXT)(getProcAddr(\"glBindBufferBaseEXT\"))\n\tgpBindBufferBaseNV = (C.GPBINDBUFFERBASENV)(getProcAddr(\"glBindBufferBaseNV\"))\n\tgpBindBufferOffsetEXT = (C.GPBINDBUFFEROFFSETEXT)(getProcAddr(\"glBindBufferOffsetEXT\"))\n\tgpBindBufferOffsetNV = (C.GPBINDBUFFEROFFSETNV)(getProcAddr(\"glBindBufferOffsetNV\"))\n\tgpBindBufferRange = (C.GPBINDBUFFERRANGE)(getProcAddr(\"glBindBufferRange\"))\n\tif gpBindBufferRange == nil {\n\t\treturn errors.New(\"glBindBufferRange\")\n\t}\n\tgpBindBufferRangeEXT = (C.GPBINDBUFFERRANGEEXT)(getProcAddr(\"glBindBufferRangeEXT\"))\n\tgpBindBufferRangeNV = (C.GPBINDBUFFERRANGENV)(getProcAddr(\"glBindBufferRangeNV\"))\n\tgpBindBuffersBase = (C.GPBINDBUFFERSBASE)(getProcAddr(\"glBindBuffersBase\"))\n\tif gpBindBuffersBase == nil {\n\t\treturn errors.New(\"glBindBuffersBase\")\n\t}\n\tgpBindBuffersRange = (C.GPBINDBUFFERSRANGE)(getProcAddr(\"glBindBuffersRange\"))\n\tif gpBindBuffersRange == nil {\n\t\treturn errors.New(\"glBindBuffersRange\")\n\t}\n\tgpBindFragDataLocation = (C.GPBINDFRAGDATALOCATION)(getProcAddr(\"glBindFragDataLocation\"))\n\tif gpBindFragDataLocation == nil {\n\t\treturn errors.New(\"glBindFragDataLocation\")\n\t}\n\tgpBindFragDataLocationEXT = (C.GPBINDFRAGDATALOCATIONEXT)(getProcAddr(\"glBindFragDataLocationEXT\"))\n\tgpBindFragDataLocationIndexed = (C.GPBINDFRAGDATALOCATIONINDEXED)(getProcAddr(\"glBindFragDataLocationIndexed\"))\n\tif gpBindFragDataLocationIndexed == nil {\n\t\treturn errors.New(\"glBindFragDataLocationIndexed\")\n\t}\n\tgpBindFragmentShaderATI = (C.GPBINDFRAGMENTSHADERATI)(getProcAddr(\"glBindFragmentShaderATI\"))\n\tgpBindFramebuffer = (C.GPBINDFRAMEBUFFER)(getProcAddr(\"glBindFramebuffer\"))\n\tif gpBindFramebuffer == nil {\n\t\treturn errors.New(\"glBindFramebuffer\")\n\t}\n\tgpBindFramebufferEXT = (C.GPBINDFRAMEBUFFEREXT)(getProcAddr(\"glBindFramebufferEXT\"))\n\tgpBindImageTexture = (C.GPBINDIMAGETEXTURE)(getProcAddr(\"glBindImageTexture\"))\n\tif gpBindImageTexture == nil {\n\t\treturn errors.New(\"glBindImageTexture\")\n\t}\n\tgpBindImageTextureEXT = (C.GPBINDIMAGETEXTUREEXT)(getProcAddr(\"glBindImageTextureEXT\"))\n\tgpBindImageTextures = (C.GPBINDIMAGETEXTURES)(getProcAddr(\"glBindImageTextures\"))\n\tif gpBindImageTextures == nil {\n\t\treturn errors.New(\"glBindImageTextures\")\n\t}\n\tgpBindLightParameterEXT = (C.GPBINDLIGHTPARAMETEREXT)(getProcAddr(\"glBindLightParameterEXT\"))\n\tgpBindMaterialParameterEXT = (C.GPBINDMATERIALPARAMETEREXT)(getProcAddr(\"glBindMaterialParameterEXT\"))\n\tgpBindMultiTextureEXT = (C.GPBINDMULTITEXTUREEXT)(getProcAddr(\"glBindMultiTextureEXT\"))\n\tgpBindParameterEXT = (C.GPBINDPARAMETEREXT)(getProcAddr(\"glBindParameterEXT\"))\n\tgpBindProgramARB = (C.GPBINDPROGRAMARB)(getProcAddr(\"glBindProgramARB\"))\n\tgpBindProgramNV = (C.GPBINDPROGRAMNV)(getProcAddr(\"glBindProgramNV\"))\n\tgpBindProgramPipeline = (C.GPBINDPROGRAMPIPELINE)(getProcAddr(\"glBindProgramPipeline\"))\n\tif gpBindProgramPipeline == nil {\n\t\treturn errors.New(\"glBindProgramPipeline\")\n\t}\n\tgpBindProgramPipelineEXT = (C.GPBINDPROGRAMPIPELINEEXT)(getProcAddr(\"glBindProgramPipelineEXT\"))\n\tgpBindRenderbuffer = (C.GPBINDRENDERBUFFER)(getProcAddr(\"glBindRenderbuffer\"))\n\tif gpBindRenderbuffer == nil {\n\t\treturn errors.New(\"glBindRenderbuffer\")\n\t}\n\tgpBindRenderbufferEXT = (C.GPBINDRENDERBUFFEREXT)(getProcAddr(\"glBindRenderbufferEXT\"))\n\tgpBindSampler = (C.GPBINDSAMPLER)(getProcAddr(\"glBindSampler\"))\n\tif gpBindSampler == nil {\n\t\treturn errors.New(\"glBindSampler\")\n\t}\n\tgpBindSamplers = (C.GPBINDSAMPLERS)(getProcAddr(\"glBindSamplers\"))\n\tif gpBindSamplers == nil {\n\t\treturn errors.New(\"glBindSamplers\")\n\t}\n\tgpBindShadingRateImageNV = (C.GPBINDSHADINGRATEIMAGENV)(getProcAddr(\"glBindShadingRateImageNV\"))\n\tgpBindTexGenParameterEXT = (C.GPBINDTEXGENPARAMETEREXT)(getProcAddr(\"glBindTexGenParameterEXT\"))\n\tgpBindTexture = (C.GPBINDTEXTURE)(getProcAddr(\"glBindTexture\"))\n\tif gpBindTexture == nil {\n\t\treturn errors.New(\"glBindTexture\")\n\t}\n\tgpBindTextureEXT = (C.GPBINDTEXTUREEXT)(getProcAddr(\"glBindTextureEXT\"))\n\tgpBindTextureUnit = (C.GPBINDTEXTUREUNIT)(getProcAddr(\"glBindTextureUnit\"))\n\tgpBindTextureUnitParameterEXT = (C.GPBINDTEXTUREUNITPARAMETEREXT)(getProcAddr(\"glBindTextureUnitParameterEXT\"))\n\tgpBindTextures = (C.GPBINDTEXTURES)(getProcAddr(\"glBindTextures\"))\n\tif gpBindTextures == nil {\n\t\treturn errors.New(\"glBindTextures\")\n\t}\n\tgpBindTransformFeedback = (C.GPBINDTRANSFORMFEEDBACK)(getProcAddr(\"glBindTransformFeedback\"))\n\tif gpBindTransformFeedback == nil {\n\t\treturn errors.New(\"glBindTransformFeedback\")\n\t}\n\tgpBindTransformFeedbackNV = (C.GPBINDTRANSFORMFEEDBACKNV)(getProcAddr(\"glBindTransformFeedbackNV\"))\n\tgpBindVertexArray = (C.GPBINDVERTEXARRAY)(getProcAddr(\"glBindVertexArray\"))\n\tif gpBindVertexArray == nil {\n\t\treturn errors.New(\"glBindVertexArray\")\n\t}\n\tgpBindVertexArrayAPPLE = (C.GPBINDVERTEXARRAYAPPLE)(getProcAddr(\"glBindVertexArrayAPPLE\"))\n\tgpBindVertexBuffer = (C.GPBINDVERTEXBUFFER)(getProcAddr(\"glBindVertexBuffer\"))\n\tif gpBindVertexBuffer == nil {\n\t\treturn errors.New(\"glBindVertexBuffer\")\n\t}\n\tgpBindVertexBuffers = (C.GPBINDVERTEXBUFFERS)(getProcAddr(\"glBindVertexBuffers\"))\n\tif gpBindVertexBuffers == nil {\n\t\treturn errors.New(\"glBindVertexBuffers\")\n\t}\n\tgpBindVertexShaderEXT = (C.GPBINDVERTEXSHADEREXT)(getProcAddr(\"glBindVertexShaderEXT\"))\n\tgpBindVideoCaptureStreamBufferNV = (C.GPBINDVIDEOCAPTURESTREAMBUFFERNV)(getProcAddr(\"glBindVideoCaptureStreamBufferNV\"))\n\tgpBindVideoCaptureStreamTextureNV = (C.GPBINDVIDEOCAPTURESTREAMTEXTURENV)(getProcAddr(\"glBindVideoCaptureStreamTextureNV\"))\n\tgpBinormal3bEXT = (C.GPBINORMAL3BEXT)(getProcAddr(\"glBinormal3bEXT\"))\n\tgpBinormal3bvEXT = (C.GPBINORMAL3BVEXT)(getProcAddr(\"glBinormal3bvEXT\"))\n\tgpBinormal3dEXT = (C.GPBINORMAL3DEXT)(getProcAddr(\"glBinormal3dEXT\"))\n\tgpBinormal3dvEXT = (C.GPBINORMAL3DVEXT)(getProcAddr(\"glBinormal3dvEXT\"))\n\tgpBinormal3fEXT = (C.GPBINORMAL3FEXT)(getProcAddr(\"glBinormal3fEXT\"))\n\tgpBinormal3fvEXT = (C.GPBINORMAL3FVEXT)(getProcAddr(\"glBinormal3fvEXT\"))\n\tgpBinormal3iEXT = (C.GPBINORMAL3IEXT)(getProcAddr(\"glBinormal3iEXT\"))\n\tgpBinormal3ivEXT = (C.GPBINORMAL3IVEXT)(getProcAddr(\"glBinormal3ivEXT\"))\n\tgpBinormal3sEXT = (C.GPBINORMAL3SEXT)(getProcAddr(\"glBinormal3sEXT\"))\n\tgpBinormal3svEXT = (C.GPBINORMAL3SVEXT)(getProcAddr(\"glBinormal3svEXT\"))\n\tgpBinormalPointerEXT = (C.GPBINORMALPOINTEREXT)(getProcAddr(\"glBinormalPointerEXT\"))\n\tgpBitmap = (C.GPBITMAP)(getProcAddr(\"glBitmap\"))\n\tif gpBitmap == nil {\n\t\treturn errors.New(\"glBitmap\")\n\t}\n\tgpBitmapxOES = (C.GPBITMAPXOES)(getProcAddr(\"glBitmapxOES\"))\n\tgpBlendBarrierKHR = (C.GPBLENDBARRIERKHR)(getProcAddr(\"glBlendBarrierKHR\"))\n\tgpBlendBarrierNV = (C.GPBLENDBARRIERNV)(getProcAddr(\"glBlendBarrierNV\"))\n\tgpBlendColor = (C.GPBLENDCOLOR)(getProcAddr(\"glBlendColor\"))\n\tif gpBlendColor == nil {\n\t\treturn errors.New(\"glBlendColor\")\n\t}\n\tgpBlendColorEXT = (C.GPBLENDCOLOREXT)(getProcAddr(\"glBlendColorEXT\"))\n\tgpBlendColorxOES = (C.GPBLENDCOLORXOES)(getProcAddr(\"glBlendColorxOES\"))\n\tgpBlendEquation = (C.GPBLENDEQUATION)(getProcAddr(\"glBlendEquation\"))\n\tif gpBlendEquation == nil {\n\t\treturn errors.New(\"glBlendEquation\")\n\t}\n\tgpBlendEquationEXT = (C.GPBLENDEQUATIONEXT)(getProcAddr(\"glBlendEquationEXT\"))\n\tgpBlendEquationIndexedAMD = (C.GPBLENDEQUATIONINDEXEDAMD)(getProcAddr(\"glBlendEquationIndexedAMD\"))\n\tgpBlendEquationSeparate = (C.GPBLENDEQUATIONSEPARATE)(getProcAddr(\"glBlendEquationSeparate\"))\n\tif gpBlendEquationSeparate == nil {\n\t\treturn errors.New(\"glBlendEquationSeparate\")\n\t}\n\tgpBlendEquationSeparateEXT = (C.GPBLENDEQUATIONSEPARATEEXT)(getProcAddr(\"glBlendEquationSeparateEXT\"))\n\tgpBlendEquationSeparateIndexedAMD = (C.GPBLENDEQUATIONSEPARATEINDEXEDAMD)(getProcAddr(\"glBlendEquationSeparateIndexedAMD\"))\n\tgpBlendEquationSeparatei = (C.GPBLENDEQUATIONSEPARATEI)(getProcAddr(\"glBlendEquationSeparatei\"))\n\tif gpBlendEquationSeparatei == nil {\n\t\treturn errors.New(\"glBlendEquationSeparatei\")\n\t}\n\tgpBlendEquationSeparateiARB = (C.GPBLENDEQUATIONSEPARATEIARB)(getProcAddr(\"glBlendEquationSeparateiARB\"))\n\tgpBlendEquationi = (C.GPBLENDEQUATIONI)(getProcAddr(\"glBlendEquationi\"))\n\tif gpBlendEquationi == nil {\n\t\treturn errors.New(\"glBlendEquationi\")\n\t}\n\tgpBlendEquationiARB = (C.GPBLENDEQUATIONIARB)(getProcAddr(\"glBlendEquationiARB\"))\n\tgpBlendFunc = (C.GPBLENDFUNC)(getProcAddr(\"glBlendFunc\"))\n\tif gpBlendFunc == nil {\n\t\treturn errors.New(\"glBlendFunc\")\n\t}\n\tgpBlendFuncIndexedAMD = (C.GPBLENDFUNCINDEXEDAMD)(getProcAddr(\"glBlendFuncIndexedAMD\"))\n\tgpBlendFuncSeparate = (C.GPBLENDFUNCSEPARATE)(getProcAddr(\"glBlendFuncSeparate\"))\n\tif gpBlendFuncSeparate == nil {\n\t\treturn errors.New(\"glBlendFuncSeparate\")\n\t}\n\tgpBlendFuncSeparateEXT = (C.GPBLENDFUNCSEPARATEEXT)(getProcAddr(\"glBlendFuncSeparateEXT\"))\n\tgpBlendFuncSeparateINGR = (C.GPBLENDFUNCSEPARATEINGR)(getProcAddr(\"glBlendFuncSeparateINGR\"))\n\tgpBlendFuncSeparateIndexedAMD = (C.GPBLENDFUNCSEPARATEINDEXEDAMD)(getProcAddr(\"glBlendFuncSeparateIndexedAMD\"))\n\tgpBlendFuncSeparatei = (C.GPBLENDFUNCSEPARATEI)(getProcAddr(\"glBlendFuncSeparatei\"))\n\tif gpBlendFuncSeparatei == nil {\n\t\treturn errors.New(\"glBlendFuncSeparatei\")\n\t}\n\tgpBlendFuncSeparateiARB = (C.GPBLENDFUNCSEPARATEIARB)(getProcAddr(\"glBlendFuncSeparateiARB\"))\n\tgpBlendFunci = (C.GPBLENDFUNCI)(getProcAddr(\"glBlendFunci\"))\n\tif gpBlendFunci == nil {\n\t\treturn errors.New(\"glBlendFunci\")\n\t}\n\tgpBlendFunciARB = (C.GPBLENDFUNCIARB)(getProcAddr(\"glBlendFunciARB\"))\n\tgpBlendParameteriNV = (C.GPBLENDPARAMETERINV)(getProcAddr(\"glBlendParameteriNV\"))\n\tgpBlitFramebuffer = (C.GPBLITFRAMEBUFFER)(getProcAddr(\"glBlitFramebuffer\"))\n\tif gpBlitFramebuffer == nil {\n\t\treturn errors.New(\"glBlitFramebuffer\")\n\t}\n\tgpBlitFramebufferEXT = (C.GPBLITFRAMEBUFFEREXT)(getProcAddr(\"glBlitFramebufferEXT\"))\n\tgpBlitNamedFramebuffer = (C.GPBLITNAMEDFRAMEBUFFER)(getProcAddr(\"glBlitNamedFramebuffer\"))\n\tgpBufferAddressRangeNV = (C.GPBUFFERADDRESSRANGENV)(getProcAddr(\"glBufferAddressRangeNV\"))\n\tgpBufferAttachMemoryNV = (C.GPBUFFERATTACHMEMORYNV)(getProcAddr(\"glBufferAttachMemoryNV\"))\n\tgpBufferData = (C.GPBUFFERDATA)(getProcAddr(\"glBufferData\"))\n\tif gpBufferData == nil {\n\t\treturn errors.New(\"glBufferData\")\n\t}\n\tgpBufferDataARB = (C.GPBUFFERDATAARB)(getProcAddr(\"glBufferDataARB\"))\n\tgpBufferPageCommitmentARB = (C.GPBUFFERPAGECOMMITMENTARB)(getProcAddr(\"glBufferPageCommitmentARB\"))\n\tgpBufferPageCommitmentMemNV = (C.GPBUFFERPAGECOMMITMENTMEMNV)(getProcAddr(\"glBufferPageCommitmentMemNV\"))\n\tgpBufferParameteriAPPLE = (C.GPBUFFERPARAMETERIAPPLE)(getProcAddr(\"glBufferParameteriAPPLE\"))\n\tgpBufferStorage = (C.GPBUFFERSTORAGE)(getProcAddr(\"glBufferStorage\"))\n\tif gpBufferStorage == nil {\n\t\treturn errors.New(\"glBufferStorage\")\n\t}\n\tgpBufferStorageExternalEXT = (C.GPBUFFERSTORAGEEXTERNALEXT)(getProcAddr(\"glBufferStorageExternalEXT\"))\n\tgpBufferStorageMemEXT = (C.GPBUFFERSTORAGEMEMEXT)(getProcAddr(\"glBufferStorageMemEXT\"))\n\tgpBufferSubData = (C.GPBUFFERSUBDATA)(getProcAddr(\"glBufferSubData\"))\n\tif gpBufferSubData == nil {\n\t\treturn errors.New(\"glBufferSubData\")\n\t}\n\tgpBufferSubDataARB = (C.GPBUFFERSUBDATAARB)(getProcAddr(\"glBufferSubDataARB\"))\n\tgpCallCommandListNV = (C.GPCALLCOMMANDLISTNV)(getProcAddr(\"glCallCommandListNV\"))\n\tgpCallList = (C.GPCALLLIST)(getProcAddr(\"glCallList\"))\n\tif gpCallList == nil {\n\t\treturn errors.New(\"glCallList\")\n\t}\n\tgpCallLists = (C.GPCALLLISTS)(getProcAddr(\"glCallLists\"))\n\tif gpCallLists == nil {\n\t\treturn errors.New(\"glCallLists\")\n\t}\n\tgpCheckFramebufferStatus = (C.GPCHECKFRAMEBUFFERSTATUS)(getProcAddr(\"glCheckFramebufferStatus\"))\n\tif gpCheckFramebufferStatus == nil {\n\t\treturn errors.New(\"glCheckFramebufferStatus\")\n\t}\n\tgpCheckFramebufferStatusEXT = (C.GPCHECKFRAMEBUFFERSTATUSEXT)(getProcAddr(\"glCheckFramebufferStatusEXT\"))\n\tgpCheckNamedFramebufferStatus = (C.GPCHECKNAMEDFRAMEBUFFERSTATUS)(getProcAddr(\"glCheckNamedFramebufferStatus\"))\n\tgpCheckNamedFramebufferStatusEXT = (C.GPCHECKNAMEDFRAMEBUFFERSTATUSEXT)(getProcAddr(\"glCheckNamedFramebufferStatusEXT\"))\n\tgpClampColor = (C.GPCLAMPCOLOR)(getProcAddr(\"glClampColor\"))\n\tif gpClampColor == nil {\n\t\treturn errors.New(\"glClampColor\")\n\t}\n\tgpClampColorARB = (C.GPCLAMPCOLORARB)(getProcAddr(\"glClampColorARB\"))\n\tgpClear = (C.GPCLEAR)(getProcAddr(\"glClear\"))\n\tif gpClear == nil {\n\t\treturn errors.New(\"glClear\")\n\t}\n\tgpClearAccum = (C.GPCLEARACCUM)(getProcAddr(\"glClearAccum\"))\n\tif gpClearAccum == nil {\n\t\treturn errors.New(\"glClearAccum\")\n\t}\n\tgpClearAccumxOES = (C.GPCLEARACCUMXOES)(getProcAddr(\"glClearAccumxOES\"))\n\tgpClearBufferData = (C.GPCLEARBUFFERDATA)(getProcAddr(\"glClearBufferData\"))\n\tif gpClearBufferData == nil {\n\t\treturn errors.New(\"glClearBufferData\")\n\t}\n\tgpClearBufferSubData = (C.GPCLEARBUFFERSUBDATA)(getProcAddr(\"glClearBufferSubData\"))\n\tif gpClearBufferSubData == nil {\n\t\treturn errors.New(\"glClearBufferSubData\")\n\t}\n\tgpClearBufferfi = (C.GPCLEARBUFFERFI)(getProcAddr(\"glClearBufferfi\"))\n\tif gpClearBufferfi == nil {\n\t\treturn errors.New(\"glClearBufferfi\")\n\t}\n\tgpClearBufferfv = (C.GPCLEARBUFFERFV)(getProcAddr(\"glClearBufferfv\"))\n\tif gpClearBufferfv == nil {\n\t\treturn errors.New(\"glClearBufferfv\")\n\t}\n\tgpClearBufferiv = (C.GPCLEARBUFFERIV)(getProcAddr(\"glClearBufferiv\"))\n\tif gpClearBufferiv == nil {\n\t\treturn errors.New(\"glClearBufferiv\")\n\t}\n\tgpClearBufferuiv = (C.GPCLEARBUFFERUIV)(getProcAddr(\"glClearBufferuiv\"))\n\tif gpClearBufferuiv == nil {\n\t\treturn errors.New(\"glClearBufferuiv\")\n\t}\n\tgpClearColor = (C.GPCLEARCOLOR)(getProcAddr(\"glClearColor\"))\n\tif gpClearColor == nil {\n\t\treturn errors.New(\"glClearColor\")\n\t}\n\tgpClearColorIiEXT = (C.GPCLEARCOLORIIEXT)(getProcAddr(\"glClearColorIiEXT\"))\n\tgpClearColorIuiEXT = (C.GPCLEARCOLORIUIEXT)(getProcAddr(\"glClearColorIuiEXT\"))\n\tgpClearColorxOES = (C.GPCLEARCOLORXOES)(getProcAddr(\"glClearColorxOES\"))\n\tgpClearDepth = (C.GPCLEARDEPTH)(getProcAddr(\"glClearDepth\"))\n\tif gpClearDepth == nil {\n\t\treturn errors.New(\"glClearDepth\")\n\t}\n\tgpClearDepthdNV = (C.GPCLEARDEPTHDNV)(getProcAddr(\"glClearDepthdNV\"))\n\tgpClearDepthf = (C.GPCLEARDEPTHF)(getProcAddr(\"glClearDepthf\"))\n\tif gpClearDepthf == nil {\n\t\treturn errors.New(\"glClearDepthf\")\n\t}\n\tgpClearDepthfOES = (C.GPCLEARDEPTHFOES)(getProcAddr(\"glClearDepthfOES\"))\n\tgpClearDepthxOES = (C.GPCLEARDEPTHXOES)(getProcAddr(\"glClearDepthxOES\"))\n\tgpClearIndex = (C.GPCLEARINDEX)(getProcAddr(\"glClearIndex\"))\n\tif gpClearIndex == nil {\n\t\treturn errors.New(\"glClearIndex\")\n\t}\n\tgpClearNamedBufferData = (C.GPCLEARNAMEDBUFFERDATA)(getProcAddr(\"glClearNamedBufferData\"))\n\tgpClearNamedBufferDataEXT = (C.GPCLEARNAMEDBUFFERDATAEXT)(getProcAddr(\"glClearNamedBufferDataEXT\"))\n\tgpClearNamedBufferSubData = (C.GPCLEARNAMEDBUFFERSUBDATA)(getProcAddr(\"glClearNamedBufferSubData\"))\n\tgpClearNamedBufferSubDataEXT = (C.GPCLEARNAMEDBUFFERSUBDATAEXT)(getProcAddr(\"glClearNamedBufferSubDataEXT\"))\n\tgpClearNamedFramebufferfi = (C.GPCLEARNAMEDFRAMEBUFFERFI)(getProcAddr(\"glClearNamedFramebufferfi\"))\n\tgpClearNamedFramebufferfv = (C.GPCLEARNAMEDFRAMEBUFFERFV)(getProcAddr(\"glClearNamedFramebufferfv\"))\n\tgpClearNamedFramebufferiv = (C.GPCLEARNAMEDFRAMEBUFFERIV)(getProcAddr(\"glClearNamedFramebufferiv\"))\n\tgpClearNamedFramebufferuiv = (C.GPCLEARNAMEDFRAMEBUFFERUIV)(getProcAddr(\"glClearNamedFramebufferuiv\"))\n\tgpClearStencil = (C.GPCLEARSTENCIL)(getProcAddr(\"glClearStencil\"))\n\tif gpClearStencil == nil {\n\t\treturn errors.New(\"glClearStencil\")\n\t}\n\tgpClearTexImage = (C.GPCLEARTEXIMAGE)(getProcAddr(\"glClearTexImage\"))\n\tif gpClearTexImage == nil {\n\t\treturn errors.New(\"glClearTexImage\")\n\t}\n\tgpClearTexSubImage = (C.GPCLEARTEXSUBIMAGE)(getProcAddr(\"glClearTexSubImage\"))\n\tif gpClearTexSubImage == nil {\n\t\treturn errors.New(\"glClearTexSubImage\")\n\t}\n\tgpClientActiveTexture = (C.GPCLIENTACTIVETEXTURE)(getProcAddr(\"glClientActiveTexture\"))\n\tif gpClientActiveTexture == nil {\n\t\treturn errors.New(\"glClientActiveTexture\")\n\t}\n\tgpClientActiveTextureARB = (C.GPCLIENTACTIVETEXTUREARB)(getProcAddr(\"glClientActiveTextureARB\"))\n\tgpClientActiveVertexStreamATI = (C.GPCLIENTACTIVEVERTEXSTREAMATI)(getProcAddr(\"glClientActiveVertexStreamATI\"))\n\tgpClientAttribDefaultEXT = (C.GPCLIENTATTRIBDEFAULTEXT)(getProcAddr(\"glClientAttribDefaultEXT\"))\n\tgpClientWaitSemaphoreui64NVX = (C.GPCLIENTWAITSEMAPHOREUI64NVX)(getProcAddr(\"glClientWaitSemaphoreui64NVX\"))\n\tgpClientWaitSync = (C.GPCLIENTWAITSYNC)(getProcAddr(\"glClientWaitSync\"))\n\tif gpClientWaitSync == nil {\n\t\treturn errors.New(\"glClientWaitSync\")\n\t}\n\tgpClipControl = (C.GPCLIPCONTROL)(getProcAddr(\"glClipControl\"))\n\tgpClipPlane = (C.GPCLIPPLANE)(getProcAddr(\"glClipPlane\"))\n\tif gpClipPlane == nil {\n\t\treturn errors.New(\"glClipPlane\")\n\t}\n\tgpClipPlanefOES = (C.GPCLIPPLANEFOES)(getProcAddr(\"glClipPlanefOES\"))\n\tgpClipPlanexOES = (C.GPCLIPPLANEXOES)(getProcAddr(\"glClipPlanexOES\"))\n\tgpColor3b = (C.GPCOLOR3B)(getProcAddr(\"glColor3b\"))\n\tif gpColor3b == nil {\n\t\treturn errors.New(\"glColor3b\")\n\t}\n\tgpColor3bv = (C.GPCOLOR3BV)(getProcAddr(\"glColor3bv\"))\n\tif gpColor3bv == nil {\n\t\treturn errors.New(\"glColor3bv\")\n\t}\n\tgpColor3d = (C.GPCOLOR3D)(getProcAddr(\"glColor3d\"))\n\tif gpColor3d == nil {\n\t\treturn errors.New(\"glColor3d\")\n\t}\n\tgpColor3dv = (C.GPCOLOR3DV)(getProcAddr(\"glColor3dv\"))\n\tif gpColor3dv == nil {\n\t\treturn errors.New(\"glColor3dv\")\n\t}\n\tgpColor3f = (C.GPCOLOR3F)(getProcAddr(\"glColor3f\"))\n\tif gpColor3f == nil {\n\t\treturn errors.New(\"glColor3f\")\n\t}\n\tgpColor3fVertex3fSUN = (C.GPCOLOR3FVERTEX3FSUN)(getProcAddr(\"glColor3fVertex3fSUN\"))\n\tgpColor3fVertex3fvSUN = (C.GPCOLOR3FVERTEX3FVSUN)(getProcAddr(\"glColor3fVertex3fvSUN\"))\n\tgpColor3fv = (C.GPCOLOR3FV)(getProcAddr(\"glColor3fv\"))\n\tif gpColor3fv == nil {\n\t\treturn errors.New(\"glColor3fv\")\n\t}\n\tgpColor3hNV = (C.GPCOLOR3HNV)(getProcAddr(\"glColor3hNV\"))\n\tgpColor3hvNV = (C.GPCOLOR3HVNV)(getProcAddr(\"glColor3hvNV\"))\n\tgpColor3i = (C.GPCOLOR3I)(getProcAddr(\"glColor3i\"))\n\tif gpColor3i == nil {\n\t\treturn errors.New(\"glColor3i\")\n\t}\n\tgpColor3iv = (C.GPCOLOR3IV)(getProcAddr(\"glColor3iv\"))\n\tif gpColor3iv == nil {\n\t\treturn errors.New(\"glColor3iv\")\n\t}\n\tgpColor3s = (C.GPCOLOR3S)(getProcAddr(\"glColor3s\"))\n\tif gpColor3s == nil {\n\t\treturn errors.New(\"glColor3s\")\n\t}\n\tgpColor3sv = (C.GPCOLOR3SV)(getProcAddr(\"glColor3sv\"))\n\tif gpColor3sv == nil {\n\t\treturn errors.New(\"glColor3sv\")\n\t}\n\tgpColor3ub = (C.GPCOLOR3UB)(getProcAddr(\"glColor3ub\"))\n\tif gpColor3ub == nil {\n\t\treturn errors.New(\"glColor3ub\")\n\t}\n\tgpColor3ubv = (C.GPCOLOR3UBV)(getProcAddr(\"glColor3ubv\"))\n\tif gpColor3ubv == nil {\n\t\treturn errors.New(\"glColor3ubv\")\n\t}\n\tgpColor3ui = (C.GPCOLOR3UI)(getProcAddr(\"glColor3ui\"))\n\tif gpColor3ui == nil {\n\t\treturn errors.New(\"glColor3ui\")\n\t}\n\tgpColor3uiv = (C.GPCOLOR3UIV)(getProcAddr(\"glColor3uiv\"))\n\tif gpColor3uiv == nil {\n\t\treturn errors.New(\"glColor3uiv\")\n\t}\n\tgpColor3us = (C.GPCOLOR3US)(getProcAddr(\"glColor3us\"))\n\tif gpColor3us == nil {\n\t\treturn errors.New(\"glColor3us\")\n\t}\n\tgpColor3usv = (C.GPCOLOR3USV)(getProcAddr(\"glColor3usv\"))\n\tif gpColor3usv == nil {\n\t\treturn errors.New(\"glColor3usv\")\n\t}\n\tgpColor3xOES = (C.GPCOLOR3XOES)(getProcAddr(\"glColor3xOES\"))\n\tgpColor3xvOES = (C.GPCOLOR3XVOES)(getProcAddr(\"glColor3xvOES\"))\n\tgpColor4b = (C.GPCOLOR4B)(getProcAddr(\"glColor4b\"))\n\tif gpColor4b == nil {\n\t\treturn errors.New(\"glColor4b\")\n\t}\n\tgpColor4bv = (C.GPCOLOR4BV)(getProcAddr(\"glColor4bv\"))\n\tif gpColor4bv == nil {\n\t\treturn errors.New(\"glColor4bv\")\n\t}\n\tgpColor4d = (C.GPCOLOR4D)(getProcAddr(\"glColor4d\"))\n\tif gpColor4d == nil {\n\t\treturn errors.New(\"glColor4d\")\n\t}\n\tgpColor4dv = (C.GPCOLOR4DV)(getProcAddr(\"glColor4dv\"))\n\tif gpColor4dv == nil {\n\t\treturn errors.New(\"glColor4dv\")\n\t}\n\tgpColor4f = (C.GPCOLOR4F)(getProcAddr(\"glColor4f\"))\n\tif gpColor4f == nil {\n\t\treturn errors.New(\"glColor4f\")\n\t}\n\tgpColor4fNormal3fVertex3fSUN = (C.GPCOLOR4FNORMAL3FVERTEX3FSUN)(getProcAddr(\"glColor4fNormal3fVertex3fSUN\"))\n\tgpColor4fNormal3fVertex3fvSUN = (C.GPCOLOR4FNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glColor4fNormal3fVertex3fvSUN\"))\n\tgpColor4fv = (C.GPCOLOR4FV)(getProcAddr(\"glColor4fv\"))\n\tif gpColor4fv == nil {\n\t\treturn errors.New(\"glColor4fv\")\n\t}\n\tgpColor4hNV = (C.GPCOLOR4HNV)(getProcAddr(\"glColor4hNV\"))\n\tgpColor4hvNV = (C.GPCOLOR4HVNV)(getProcAddr(\"glColor4hvNV\"))\n\tgpColor4i = (C.GPCOLOR4I)(getProcAddr(\"glColor4i\"))\n\tif gpColor4i == nil {\n\t\treturn errors.New(\"glColor4i\")\n\t}\n\tgpColor4iv = (C.GPCOLOR4IV)(getProcAddr(\"glColor4iv\"))\n\tif gpColor4iv == nil {\n\t\treturn errors.New(\"glColor4iv\")\n\t}\n\tgpColor4s = (C.GPCOLOR4S)(getProcAddr(\"glColor4s\"))\n\tif gpColor4s == nil {\n\t\treturn errors.New(\"glColor4s\")\n\t}\n\tgpColor4sv = (C.GPCOLOR4SV)(getProcAddr(\"glColor4sv\"))\n\tif gpColor4sv == nil {\n\t\treturn errors.New(\"glColor4sv\")\n\t}\n\tgpColor4ub = (C.GPCOLOR4UB)(getProcAddr(\"glColor4ub\"))\n\tif gpColor4ub == nil {\n\t\treturn errors.New(\"glColor4ub\")\n\t}\n\tgpColor4ubVertex2fSUN = (C.GPCOLOR4UBVERTEX2FSUN)(getProcAddr(\"glColor4ubVertex2fSUN\"))\n\tgpColor4ubVertex2fvSUN = (C.GPCOLOR4UBVERTEX2FVSUN)(getProcAddr(\"glColor4ubVertex2fvSUN\"))\n\tgpColor4ubVertex3fSUN = (C.GPCOLOR4UBVERTEX3FSUN)(getProcAddr(\"glColor4ubVertex3fSUN\"))\n\tgpColor4ubVertex3fvSUN = (C.GPCOLOR4UBVERTEX3FVSUN)(getProcAddr(\"glColor4ubVertex3fvSUN\"))\n\tgpColor4ubv = (C.GPCOLOR4UBV)(getProcAddr(\"glColor4ubv\"))\n\tif gpColor4ubv == nil {\n\t\treturn errors.New(\"glColor4ubv\")\n\t}\n\tgpColor4ui = (C.GPCOLOR4UI)(getProcAddr(\"glColor4ui\"))\n\tif gpColor4ui == nil {\n\t\treturn errors.New(\"glColor4ui\")\n\t}\n\tgpColor4uiv = (C.GPCOLOR4UIV)(getProcAddr(\"glColor4uiv\"))\n\tif gpColor4uiv == nil {\n\t\treturn errors.New(\"glColor4uiv\")\n\t}\n\tgpColor4us = (C.GPCOLOR4US)(getProcAddr(\"glColor4us\"))\n\tif gpColor4us == nil {\n\t\treturn errors.New(\"glColor4us\")\n\t}\n\tgpColor4usv = (C.GPCOLOR4USV)(getProcAddr(\"glColor4usv\"))\n\tif gpColor4usv == nil {\n\t\treturn errors.New(\"glColor4usv\")\n\t}\n\tgpColor4xOES = (C.GPCOLOR4XOES)(getProcAddr(\"glColor4xOES\"))\n\tgpColor4xvOES = (C.GPCOLOR4XVOES)(getProcAddr(\"glColor4xvOES\"))\n\tgpColorFormatNV = (C.GPCOLORFORMATNV)(getProcAddr(\"glColorFormatNV\"))\n\tgpColorFragmentOp1ATI = (C.GPCOLORFRAGMENTOP1ATI)(getProcAddr(\"glColorFragmentOp1ATI\"))\n\tgpColorFragmentOp2ATI = (C.GPCOLORFRAGMENTOP2ATI)(getProcAddr(\"glColorFragmentOp2ATI\"))\n\tgpColorFragmentOp3ATI = (C.GPCOLORFRAGMENTOP3ATI)(getProcAddr(\"glColorFragmentOp3ATI\"))\n\tgpColorMask = (C.GPCOLORMASK)(getProcAddr(\"glColorMask\"))\n\tif gpColorMask == nil {\n\t\treturn errors.New(\"glColorMask\")\n\t}\n\tgpColorMaskIndexedEXT = (C.GPCOLORMASKINDEXEDEXT)(getProcAddr(\"glColorMaskIndexedEXT\"))\n\tgpColorMaski = (C.GPCOLORMASKI)(getProcAddr(\"glColorMaski\"))\n\tif gpColorMaski == nil {\n\t\treturn errors.New(\"glColorMaski\")\n\t}\n\tgpColorMaterial = (C.GPCOLORMATERIAL)(getProcAddr(\"glColorMaterial\"))\n\tif gpColorMaterial == nil {\n\t\treturn errors.New(\"glColorMaterial\")\n\t}\n\tgpColorP3ui = (C.GPCOLORP3UI)(getProcAddr(\"glColorP3ui\"))\n\tif gpColorP3ui == nil {\n\t\treturn errors.New(\"glColorP3ui\")\n\t}\n\tgpColorP3uiv = (C.GPCOLORP3UIV)(getProcAddr(\"glColorP3uiv\"))\n\tif gpColorP3uiv == nil {\n\t\treturn errors.New(\"glColorP3uiv\")\n\t}\n\tgpColorP4ui = (C.GPCOLORP4UI)(getProcAddr(\"glColorP4ui\"))\n\tif gpColorP4ui == nil {\n\t\treturn errors.New(\"glColorP4ui\")\n\t}\n\tgpColorP4uiv = (C.GPCOLORP4UIV)(getProcAddr(\"glColorP4uiv\"))\n\tif gpColorP4uiv == nil {\n\t\treturn errors.New(\"glColorP4uiv\")\n\t}\n\tgpColorPointer = (C.GPCOLORPOINTER)(getProcAddr(\"glColorPointer\"))\n\tif gpColorPointer == nil {\n\t\treturn errors.New(\"glColorPointer\")\n\t}\n\tgpColorPointerEXT = (C.GPCOLORPOINTEREXT)(getProcAddr(\"glColorPointerEXT\"))\n\tgpColorPointerListIBM = (C.GPCOLORPOINTERLISTIBM)(getProcAddr(\"glColorPointerListIBM\"))\n\tgpColorPointervINTEL = (C.GPCOLORPOINTERVINTEL)(getProcAddr(\"glColorPointervINTEL\"))\n\tgpColorSubTable = (C.GPCOLORSUBTABLE)(getProcAddr(\"glColorSubTable\"))\n\tgpColorSubTableEXT = (C.GPCOLORSUBTABLEEXT)(getProcAddr(\"glColorSubTableEXT\"))\n\tgpColorTable = (C.GPCOLORTABLE)(getProcAddr(\"glColorTable\"))\n\tgpColorTableEXT = (C.GPCOLORTABLEEXT)(getProcAddr(\"glColorTableEXT\"))\n\tgpColorTableParameterfv = (C.GPCOLORTABLEPARAMETERFV)(getProcAddr(\"glColorTableParameterfv\"))\n\tgpColorTableParameterfvSGI = (C.GPCOLORTABLEPARAMETERFVSGI)(getProcAddr(\"glColorTableParameterfvSGI\"))\n\tgpColorTableParameteriv = (C.GPCOLORTABLEPARAMETERIV)(getProcAddr(\"glColorTableParameteriv\"))\n\tgpColorTableParameterivSGI = (C.GPCOLORTABLEPARAMETERIVSGI)(getProcAddr(\"glColorTableParameterivSGI\"))\n\tgpColorTableSGI = (C.GPCOLORTABLESGI)(getProcAddr(\"glColorTableSGI\"))\n\tgpCombinerInputNV = (C.GPCOMBINERINPUTNV)(getProcAddr(\"glCombinerInputNV\"))\n\tgpCombinerOutputNV = (C.GPCOMBINEROUTPUTNV)(getProcAddr(\"glCombinerOutputNV\"))\n\tgpCombinerParameterfNV = (C.GPCOMBINERPARAMETERFNV)(getProcAddr(\"glCombinerParameterfNV\"))\n\tgpCombinerParameterfvNV = (C.GPCOMBINERPARAMETERFVNV)(getProcAddr(\"glCombinerParameterfvNV\"))\n\tgpCombinerParameteriNV = (C.GPCOMBINERPARAMETERINV)(getProcAddr(\"glCombinerParameteriNV\"))\n\tgpCombinerParameterivNV = (C.GPCOMBINERPARAMETERIVNV)(getProcAddr(\"glCombinerParameterivNV\"))\n\tgpCombinerStageParameterfvNV = (C.GPCOMBINERSTAGEPARAMETERFVNV)(getProcAddr(\"glCombinerStageParameterfvNV\"))\n\tgpCommandListSegmentsNV = (C.GPCOMMANDLISTSEGMENTSNV)(getProcAddr(\"glCommandListSegmentsNV\"))\n\tgpCompileCommandListNV = (C.GPCOMPILECOMMANDLISTNV)(getProcAddr(\"glCompileCommandListNV\"))\n\tgpCompileShader = (C.GPCOMPILESHADER)(getProcAddr(\"glCompileShader\"))\n\tif gpCompileShader == nil {\n\t\treturn errors.New(\"glCompileShader\")\n\t}\n\tgpCompileShaderARB = (C.GPCOMPILESHADERARB)(getProcAddr(\"glCompileShaderARB\"))\n\tgpCompileShaderIncludeARB = (C.GPCOMPILESHADERINCLUDEARB)(getProcAddr(\"glCompileShaderIncludeARB\"))\n\tgpCompressedMultiTexImage1DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE1DEXT)(getProcAddr(\"glCompressedMultiTexImage1DEXT\"))\n\tgpCompressedMultiTexImage2DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE2DEXT)(getProcAddr(\"glCompressedMultiTexImage2DEXT\"))\n\tgpCompressedMultiTexImage3DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE3DEXT)(getProcAddr(\"glCompressedMultiTexImage3DEXT\"))\n\tgpCompressedMultiTexSubImage1DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE1DEXT)(getProcAddr(\"glCompressedMultiTexSubImage1DEXT\"))\n\tgpCompressedMultiTexSubImage2DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE2DEXT)(getProcAddr(\"glCompressedMultiTexSubImage2DEXT\"))\n\tgpCompressedMultiTexSubImage3DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE3DEXT)(getProcAddr(\"glCompressedMultiTexSubImage3DEXT\"))\n\tgpCompressedTexImage1D = (C.GPCOMPRESSEDTEXIMAGE1D)(getProcAddr(\"glCompressedTexImage1D\"))\n\tif gpCompressedTexImage1D == nil {\n\t\treturn errors.New(\"glCompressedTexImage1D\")\n\t}\n\tgpCompressedTexImage1DARB = (C.GPCOMPRESSEDTEXIMAGE1DARB)(getProcAddr(\"glCompressedTexImage1DARB\"))\n\tgpCompressedTexImage2D = (C.GPCOMPRESSEDTEXIMAGE2D)(getProcAddr(\"glCompressedTexImage2D\"))\n\tif gpCompressedTexImage2D == nil {\n\t\treturn errors.New(\"glCompressedTexImage2D\")\n\t}\n\tgpCompressedTexImage2DARB = (C.GPCOMPRESSEDTEXIMAGE2DARB)(getProcAddr(\"glCompressedTexImage2DARB\"))\n\tgpCompressedTexImage3D = (C.GPCOMPRESSEDTEXIMAGE3D)(getProcAddr(\"glCompressedTexImage3D\"))\n\tif gpCompressedTexImage3D == nil {\n\t\treturn errors.New(\"glCompressedTexImage3D\")\n\t}\n\tgpCompressedTexImage3DARB = (C.GPCOMPRESSEDTEXIMAGE3DARB)(getProcAddr(\"glCompressedTexImage3DARB\"))\n\tgpCompressedTexSubImage1D = (C.GPCOMPRESSEDTEXSUBIMAGE1D)(getProcAddr(\"glCompressedTexSubImage1D\"))\n\tif gpCompressedTexSubImage1D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage1D\")\n\t}\n\tgpCompressedTexSubImage1DARB = (C.GPCOMPRESSEDTEXSUBIMAGE1DARB)(getProcAddr(\"glCompressedTexSubImage1DARB\"))\n\tgpCompressedTexSubImage2D = (C.GPCOMPRESSEDTEXSUBIMAGE2D)(getProcAddr(\"glCompressedTexSubImage2D\"))\n\tif gpCompressedTexSubImage2D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage2D\")\n\t}\n\tgpCompressedTexSubImage2DARB = (C.GPCOMPRESSEDTEXSUBIMAGE2DARB)(getProcAddr(\"glCompressedTexSubImage2DARB\"))\n\tgpCompressedTexSubImage3D = (C.GPCOMPRESSEDTEXSUBIMAGE3D)(getProcAddr(\"glCompressedTexSubImage3D\"))\n\tif gpCompressedTexSubImage3D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage3D\")\n\t}\n\tgpCompressedTexSubImage3DARB = (C.GPCOMPRESSEDTEXSUBIMAGE3DARB)(getProcAddr(\"glCompressedTexSubImage3DARB\"))\n\tgpCompressedTextureImage1DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE1DEXT)(getProcAddr(\"glCompressedTextureImage1DEXT\"))\n\tgpCompressedTextureImage2DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE2DEXT)(getProcAddr(\"glCompressedTextureImage2DEXT\"))\n\tgpCompressedTextureImage3DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE3DEXT)(getProcAddr(\"glCompressedTextureImage3DEXT\"))\n\tgpCompressedTextureSubImage1D = (C.GPCOMPRESSEDTEXTURESUBIMAGE1D)(getProcAddr(\"glCompressedTextureSubImage1D\"))\n\tgpCompressedTextureSubImage1DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE1DEXT)(getProcAddr(\"glCompressedTextureSubImage1DEXT\"))\n\tgpCompressedTextureSubImage2D = (C.GPCOMPRESSEDTEXTURESUBIMAGE2D)(getProcAddr(\"glCompressedTextureSubImage2D\"))\n\tgpCompressedTextureSubImage2DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE2DEXT)(getProcAddr(\"glCompressedTextureSubImage2DEXT\"))\n\tgpCompressedTextureSubImage3D = (C.GPCOMPRESSEDTEXTURESUBIMAGE3D)(getProcAddr(\"glCompressedTextureSubImage3D\"))\n\tgpCompressedTextureSubImage3DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE3DEXT)(getProcAddr(\"glCompressedTextureSubImage3DEXT\"))\n\tgpConservativeRasterParameterfNV = (C.GPCONSERVATIVERASTERPARAMETERFNV)(getProcAddr(\"glConservativeRasterParameterfNV\"))\n\tgpConservativeRasterParameteriNV = (C.GPCONSERVATIVERASTERPARAMETERINV)(getProcAddr(\"glConservativeRasterParameteriNV\"))\n\tgpConvolutionFilter1D = (C.GPCONVOLUTIONFILTER1D)(getProcAddr(\"glConvolutionFilter1D\"))\n\tgpConvolutionFilter1DEXT = (C.GPCONVOLUTIONFILTER1DEXT)(getProcAddr(\"glConvolutionFilter1DEXT\"))\n\tgpConvolutionFilter2D = (C.GPCONVOLUTIONFILTER2D)(getProcAddr(\"glConvolutionFilter2D\"))\n\tgpConvolutionFilter2DEXT = (C.GPCONVOLUTIONFILTER2DEXT)(getProcAddr(\"glConvolutionFilter2DEXT\"))\n\tgpConvolutionParameterf = (C.GPCONVOLUTIONPARAMETERF)(getProcAddr(\"glConvolutionParameterf\"))\n\tgpConvolutionParameterfEXT = (C.GPCONVOLUTIONPARAMETERFEXT)(getProcAddr(\"glConvolutionParameterfEXT\"))\n\tgpConvolutionParameterfv = (C.GPCONVOLUTIONPARAMETERFV)(getProcAddr(\"glConvolutionParameterfv\"))\n\tgpConvolutionParameterfvEXT = (C.GPCONVOLUTIONPARAMETERFVEXT)(getProcAddr(\"glConvolutionParameterfvEXT\"))\n\tgpConvolutionParameteri = (C.GPCONVOLUTIONPARAMETERI)(getProcAddr(\"glConvolutionParameteri\"))\n\tgpConvolutionParameteriEXT = (C.GPCONVOLUTIONPARAMETERIEXT)(getProcAddr(\"glConvolutionParameteriEXT\"))\n\tgpConvolutionParameteriv = (C.GPCONVOLUTIONPARAMETERIV)(getProcAddr(\"glConvolutionParameteriv\"))\n\tgpConvolutionParameterivEXT = (C.GPCONVOLUTIONPARAMETERIVEXT)(getProcAddr(\"glConvolutionParameterivEXT\"))\n\tgpConvolutionParameterxOES = (C.GPCONVOLUTIONPARAMETERXOES)(getProcAddr(\"glConvolutionParameterxOES\"))\n\tgpConvolutionParameterxvOES = (C.GPCONVOLUTIONPARAMETERXVOES)(getProcAddr(\"glConvolutionParameterxvOES\"))\n\tgpCopyBufferSubData = (C.GPCOPYBUFFERSUBDATA)(getProcAddr(\"glCopyBufferSubData\"))\n\tif gpCopyBufferSubData == nil {\n\t\treturn errors.New(\"glCopyBufferSubData\")\n\t}\n\tgpCopyColorSubTable = (C.GPCOPYCOLORSUBTABLE)(getProcAddr(\"glCopyColorSubTable\"))\n\tgpCopyColorSubTableEXT = (C.GPCOPYCOLORSUBTABLEEXT)(getProcAddr(\"glCopyColorSubTableEXT\"))\n\tgpCopyColorTable = (C.GPCOPYCOLORTABLE)(getProcAddr(\"glCopyColorTable\"))\n\tgpCopyColorTableSGI = (C.GPCOPYCOLORTABLESGI)(getProcAddr(\"glCopyColorTableSGI\"))\n\tgpCopyConvolutionFilter1D = (C.GPCOPYCONVOLUTIONFILTER1D)(getProcAddr(\"glCopyConvolutionFilter1D\"))\n\tgpCopyConvolutionFilter1DEXT = (C.GPCOPYCONVOLUTIONFILTER1DEXT)(getProcAddr(\"glCopyConvolutionFilter1DEXT\"))\n\tgpCopyConvolutionFilter2D = (C.GPCOPYCONVOLUTIONFILTER2D)(getProcAddr(\"glCopyConvolutionFilter2D\"))\n\tgpCopyConvolutionFilter2DEXT = (C.GPCOPYCONVOLUTIONFILTER2DEXT)(getProcAddr(\"glCopyConvolutionFilter2DEXT\"))\n\tgpCopyImageSubData = (C.GPCOPYIMAGESUBDATA)(getProcAddr(\"glCopyImageSubData\"))\n\tif gpCopyImageSubData == nil {\n\t\treturn errors.New(\"glCopyImageSubData\")\n\t}\n\tgpCopyImageSubDataNV = (C.GPCOPYIMAGESUBDATANV)(getProcAddr(\"glCopyImageSubDataNV\"))\n\tgpCopyMultiTexImage1DEXT = (C.GPCOPYMULTITEXIMAGE1DEXT)(getProcAddr(\"glCopyMultiTexImage1DEXT\"))\n\tgpCopyMultiTexImage2DEXT = (C.GPCOPYMULTITEXIMAGE2DEXT)(getProcAddr(\"glCopyMultiTexImage2DEXT\"))\n\tgpCopyMultiTexSubImage1DEXT = (C.GPCOPYMULTITEXSUBIMAGE1DEXT)(getProcAddr(\"glCopyMultiTexSubImage1DEXT\"))\n\tgpCopyMultiTexSubImage2DEXT = (C.GPCOPYMULTITEXSUBIMAGE2DEXT)(getProcAddr(\"glCopyMultiTexSubImage2DEXT\"))\n\tgpCopyMultiTexSubImage3DEXT = (C.GPCOPYMULTITEXSUBIMAGE3DEXT)(getProcAddr(\"glCopyMultiTexSubImage3DEXT\"))\n\tgpCopyNamedBufferSubData = (C.GPCOPYNAMEDBUFFERSUBDATA)(getProcAddr(\"glCopyNamedBufferSubData\"))\n\tgpCopyPathNV = (C.GPCOPYPATHNV)(getProcAddr(\"glCopyPathNV\"))\n\tgpCopyPixels = (C.GPCOPYPIXELS)(getProcAddr(\"glCopyPixels\"))\n\tif gpCopyPixels == nil {\n\t\treturn errors.New(\"glCopyPixels\")\n\t}\n\tgpCopyTexImage1D = (C.GPCOPYTEXIMAGE1D)(getProcAddr(\"glCopyTexImage1D\"))\n\tif gpCopyTexImage1D == nil {\n\t\treturn errors.New(\"glCopyTexImage1D\")\n\t}\n\tgpCopyTexImage1DEXT = (C.GPCOPYTEXIMAGE1DEXT)(getProcAddr(\"glCopyTexImage1DEXT\"))\n\tgpCopyTexImage2D = (C.GPCOPYTEXIMAGE2D)(getProcAddr(\"glCopyTexImage2D\"))\n\tif gpCopyTexImage2D == nil {\n\t\treturn errors.New(\"glCopyTexImage2D\")\n\t}\n\tgpCopyTexImage2DEXT = (C.GPCOPYTEXIMAGE2DEXT)(getProcAddr(\"glCopyTexImage2DEXT\"))\n\tgpCopyTexSubImage1D = (C.GPCOPYTEXSUBIMAGE1D)(getProcAddr(\"glCopyTexSubImage1D\"))\n\tif gpCopyTexSubImage1D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage1D\")\n\t}\n\tgpCopyTexSubImage1DEXT = (C.GPCOPYTEXSUBIMAGE1DEXT)(getProcAddr(\"glCopyTexSubImage1DEXT\"))\n\tgpCopyTexSubImage2D = (C.GPCOPYTEXSUBIMAGE2D)(getProcAddr(\"glCopyTexSubImage2D\"))\n\tif gpCopyTexSubImage2D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage2D\")\n\t}\n\tgpCopyTexSubImage2DEXT = (C.GPCOPYTEXSUBIMAGE2DEXT)(getProcAddr(\"glCopyTexSubImage2DEXT\"))\n\tgpCopyTexSubImage3D = (C.GPCOPYTEXSUBIMAGE3D)(getProcAddr(\"glCopyTexSubImage3D\"))\n\tif gpCopyTexSubImage3D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage3D\")\n\t}\n\tgpCopyTexSubImage3DEXT = (C.GPCOPYTEXSUBIMAGE3DEXT)(getProcAddr(\"glCopyTexSubImage3DEXT\"))\n\tgpCopyTextureImage1DEXT = (C.GPCOPYTEXTUREIMAGE1DEXT)(getProcAddr(\"glCopyTextureImage1DEXT\"))\n\tgpCopyTextureImage2DEXT = (C.GPCOPYTEXTUREIMAGE2DEXT)(getProcAddr(\"glCopyTextureImage2DEXT\"))\n\tgpCopyTextureSubImage1D = (C.GPCOPYTEXTURESUBIMAGE1D)(getProcAddr(\"glCopyTextureSubImage1D\"))\n\tgpCopyTextureSubImage1DEXT = (C.GPCOPYTEXTURESUBIMAGE1DEXT)(getProcAddr(\"glCopyTextureSubImage1DEXT\"))\n\tgpCopyTextureSubImage2D = (C.GPCOPYTEXTURESUBIMAGE2D)(getProcAddr(\"glCopyTextureSubImage2D\"))\n\tgpCopyTextureSubImage2DEXT = (C.GPCOPYTEXTURESUBIMAGE2DEXT)(getProcAddr(\"glCopyTextureSubImage2DEXT\"))\n\tgpCopyTextureSubImage3D = (C.GPCOPYTEXTURESUBIMAGE3D)(getProcAddr(\"glCopyTextureSubImage3D\"))\n\tgpCopyTextureSubImage3DEXT = (C.GPCOPYTEXTURESUBIMAGE3DEXT)(getProcAddr(\"glCopyTextureSubImage3DEXT\"))\n\tgpCoverFillPathInstancedNV = (C.GPCOVERFILLPATHINSTANCEDNV)(getProcAddr(\"glCoverFillPathInstancedNV\"))\n\tgpCoverFillPathNV = (C.GPCOVERFILLPATHNV)(getProcAddr(\"glCoverFillPathNV\"))\n\tgpCoverStrokePathInstancedNV = (C.GPCOVERSTROKEPATHINSTANCEDNV)(getProcAddr(\"glCoverStrokePathInstancedNV\"))\n\tgpCoverStrokePathNV = (C.GPCOVERSTROKEPATHNV)(getProcAddr(\"glCoverStrokePathNV\"))\n\tgpCoverageModulationNV = (C.GPCOVERAGEMODULATIONNV)(getProcAddr(\"glCoverageModulationNV\"))\n\tgpCoverageModulationTableNV = (C.GPCOVERAGEMODULATIONTABLENV)(getProcAddr(\"glCoverageModulationTableNV\"))\n\tgpCreateBuffers = (C.GPCREATEBUFFERS)(getProcAddr(\"glCreateBuffers\"))\n\tgpCreateCommandListsNV = (C.GPCREATECOMMANDLISTSNV)(getProcAddr(\"glCreateCommandListsNV\"))\n\tgpCreateFramebuffers = (C.GPCREATEFRAMEBUFFERS)(getProcAddr(\"glCreateFramebuffers\"))\n\tgpCreateMemoryObjectsEXT = (C.GPCREATEMEMORYOBJECTSEXT)(getProcAddr(\"glCreateMemoryObjectsEXT\"))\n\tgpCreatePerfQueryINTEL = (C.GPCREATEPERFQUERYINTEL)(getProcAddr(\"glCreatePerfQueryINTEL\"))\n\tgpCreateProgram = (C.GPCREATEPROGRAM)(getProcAddr(\"glCreateProgram\"))\n\tif gpCreateProgram == nil {\n\t\treturn errors.New(\"glCreateProgram\")\n\t}\n\tgpCreateProgramObjectARB = (C.GPCREATEPROGRAMOBJECTARB)(getProcAddr(\"glCreateProgramObjectARB\"))\n\tgpCreateProgramPipelines = (C.GPCREATEPROGRAMPIPELINES)(getProcAddr(\"glCreateProgramPipelines\"))\n\tgpCreateProgressFenceNVX = (C.GPCREATEPROGRESSFENCENVX)(getProcAddr(\"glCreateProgressFenceNVX\"))\n\tgpCreateQueries = (C.GPCREATEQUERIES)(getProcAddr(\"glCreateQueries\"))\n\tgpCreateRenderbuffers = (C.GPCREATERENDERBUFFERS)(getProcAddr(\"glCreateRenderbuffers\"))\n\tgpCreateSamplers = (C.GPCREATESAMPLERS)(getProcAddr(\"glCreateSamplers\"))\n\tgpCreateSemaphoresNV = (C.GPCREATESEMAPHORESNV)(getProcAddr(\"glCreateSemaphoresNV\"))\n\tgpCreateShader = (C.GPCREATESHADER)(getProcAddr(\"glCreateShader\"))\n\tif gpCreateShader == nil {\n\t\treturn errors.New(\"glCreateShader\")\n\t}\n\tgpCreateShaderObjectARB = (C.GPCREATESHADEROBJECTARB)(getProcAddr(\"glCreateShaderObjectARB\"))\n\tgpCreateShaderProgramEXT = (C.GPCREATESHADERPROGRAMEXT)(getProcAddr(\"glCreateShaderProgramEXT\"))\n\tgpCreateShaderProgramv = (C.GPCREATESHADERPROGRAMV)(getProcAddr(\"glCreateShaderProgramv\"))\n\tif gpCreateShaderProgramv == nil {\n\t\treturn errors.New(\"glCreateShaderProgramv\")\n\t}\n\tgpCreateShaderProgramvEXT = (C.GPCREATESHADERPROGRAMVEXT)(getProcAddr(\"glCreateShaderProgramvEXT\"))\n\tgpCreateStatesNV = (C.GPCREATESTATESNV)(getProcAddr(\"glCreateStatesNV\"))\n\tgpCreateSyncFromCLeventARB = (C.GPCREATESYNCFROMCLEVENTARB)(getProcAddr(\"glCreateSyncFromCLeventARB\"))\n\tgpCreateTextures = (C.GPCREATETEXTURES)(getProcAddr(\"glCreateTextures\"))\n\tgpCreateTransformFeedbacks = (C.GPCREATETRANSFORMFEEDBACKS)(getProcAddr(\"glCreateTransformFeedbacks\"))\n\tgpCreateVertexArrays = (C.GPCREATEVERTEXARRAYS)(getProcAddr(\"glCreateVertexArrays\"))\n\tgpCullFace = (C.GPCULLFACE)(getProcAddr(\"glCullFace\"))\n\tif gpCullFace == nil {\n\t\treturn errors.New(\"glCullFace\")\n\t}\n\tgpCullParameterdvEXT = (C.GPCULLPARAMETERDVEXT)(getProcAddr(\"glCullParameterdvEXT\"))\n\tgpCullParameterfvEXT = (C.GPCULLPARAMETERFVEXT)(getProcAddr(\"glCullParameterfvEXT\"))\n\tgpCurrentPaletteMatrixARB = (C.GPCURRENTPALETTEMATRIXARB)(getProcAddr(\"glCurrentPaletteMatrixARB\"))\n\tgpDebugMessageCallback = (C.GPDEBUGMESSAGECALLBACK)(getProcAddr(\"glDebugMessageCallback\"))\n\tif gpDebugMessageCallback == nil {\n\t\treturn errors.New(\"glDebugMessageCallback\")\n\t}\n\tgpDebugMessageCallbackAMD = (C.GPDEBUGMESSAGECALLBACKAMD)(getProcAddr(\"glDebugMessageCallbackAMD\"))\n\tgpDebugMessageCallbackARB = (C.GPDEBUGMESSAGECALLBACKARB)(getProcAddr(\"glDebugMessageCallbackARB\"))\n\tgpDebugMessageCallbackKHR = (C.GPDEBUGMESSAGECALLBACKKHR)(getProcAddr(\"glDebugMessageCallbackKHR\"))\n\tgpDebugMessageControl = (C.GPDEBUGMESSAGECONTROL)(getProcAddr(\"glDebugMessageControl\"))\n\tif gpDebugMessageControl == nil {\n\t\treturn errors.New(\"glDebugMessageControl\")\n\t}\n\tgpDebugMessageControlARB = (C.GPDEBUGMESSAGECONTROLARB)(getProcAddr(\"glDebugMessageControlARB\"))\n\tgpDebugMessageControlKHR = (C.GPDEBUGMESSAGECONTROLKHR)(getProcAddr(\"glDebugMessageControlKHR\"))\n\tgpDebugMessageEnableAMD = (C.GPDEBUGMESSAGEENABLEAMD)(getProcAddr(\"glDebugMessageEnableAMD\"))\n\tgpDebugMessageInsert = (C.GPDEBUGMESSAGEINSERT)(getProcAddr(\"glDebugMessageInsert\"))\n\tif gpDebugMessageInsert == nil {\n\t\treturn errors.New(\"glDebugMessageInsert\")\n\t}\n\tgpDebugMessageInsertAMD = (C.GPDEBUGMESSAGEINSERTAMD)(getProcAddr(\"glDebugMessageInsertAMD\"))\n\tgpDebugMessageInsertARB = (C.GPDEBUGMESSAGEINSERTARB)(getProcAddr(\"glDebugMessageInsertARB\"))\n\tgpDebugMessageInsertKHR = (C.GPDEBUGMESSAGEINSERTKHR)(getProcAddr(\"glDebugMessageInsertKHR\"))\n\tgpDeformSGIX = (C.GPDEFORMSGIX)(getProcAddr(\"glDeformSGIX\"))\n\tgpDeformationMap3dSGIX = (C.GPDEFORMATIONMAP3DSGIX)(getProcAddr(\"glDeformationMap3dSGIX\"))\n\tgpDeformationMap3fSGIX = (C.GPDEFORMATIONMAP3FSGIX)(getProcAddr(\"glDeformationMap3fSGIX\"))\n\tgpDeleteAsyncMarkersSGIX = (C.GPDELETEASYNCMARKERSSGIX)(getProcAddr(\"glDeleteAsyncMarkersSGIX\"))\n\tgpDeleteBuffers = (C.GPDELETEBUFFERS)(getProcAddr(\"glDeleteBuffers\"))\n\tif gpDeleteBuffers == nil {\n\t\treturn errors.New(\"glDeleteBuffers\")\n\t}\n\tgpDeleteBuffersARB = (C.GPDELETEBUFFERSARB)(getProcAddr(\"glDeleteBuffersARB\"))\n\tgpDeleteCommandListsNV = (C.GPDELETECOMMANDLISTSNV)(getProcAddr(\"glDeleteCommandListsNV\"))\n\tgpDeleteFencesAPPLE = (C.GPDELETEFENCESAPPLE)(getProcAddr(\"glDeleteFencesAPPLE\"))\n\tgpDeleteFencesNV = (C.GPDELETEFENCESNV)(getProcAddr(\"glDeleteFencesNV\"))\n\tgpDeleteFragmentShaderATI = (C.GPDELETEFRAGMENTSHADERATI)(getProcAddr(\"glDeleteFragmentShaderATI\"))\n\tgpDeleteFramebuffers = (C.GPDELETEFRAMEBUFFERS)(getProcAddr(\"glDeleteFramebuffers\"))\n\tif gpDeleteFramebuffers == nil {\n\t\treturn errors.New(\"glDeleteFramebuffers\")\n\t}\n\tgpDeleteFramebuffersEXT = (C.GPDELETEFRAMEBUFFERSEXT)(getProcAddr(\"glDeleteFramebuffersEXT\"))\n\tgpDeleteLists = (C.GPDELETELISTS)(getProcAddr(\"glDeleteLists\"))\n\tif gpDeleteLists == nil {\n\t\treturn errors.New(\"glDeleteLists\")\n\t}\n\tgpDeleteMemoryObjectsEXT = (C.GPDELETEMEMORYOBJECTSEXT)(getProcAddr(\"glDeleteMemoryObjectsEXT\"))\n\tgpDeleteNamedStringARB = (C.GPDELETENAMEDSTRINGARB)(getProcAddr(\"glDeleteNamedStringARB\"))\n\tgpDeleteNamesAMD = (C.GPDELETENAMESAMD)(getProcAddr(\"glDeleteNamesAMD\"))\n\tgpDeleteObjectARB = (C.GPDELETEOBJECTARB)(getProcAddr(\"glDeleteObjectARB\"))\n\tgpDeleteOcclusionQueriesNV = (C.GPDELETEOCCLUSIONQUERIESNV)(getProcAddr(\"glDeleteOcclusionQueriesNV\"))\n\tgpDeletePathsNV = (C.GPDELETEPATHSNV)(getProcAddr(\"glDeletePathsNV\"))\n\tgpDeletePerfMonitorsAMD = (C.GPDELETEPERFMONITORSAMD)(getProcAddr(\"glDeletePerfMonitorsAMD\"))\n\tgpDeletePerfQueryINTEL = (C.GPDELETEPERFQUERYINTEL)(getProcAddr(\"glDeletePerfQueryINTEL\"))\n\tgpDeleteProgram = (C.GPDELETEPROGRAM)(getProcAddr(\"glDeleteProgram\"))\n\tif gpDeleteProgram == nil {\n\t\treturn errors.New(\"glDeleteProgram\")\n\t}\n\tgpDeleteProgramPipelines = (C.GPDELETEPROGRAMPIPELINES)(getProcAddr(\"glDeleteProgramPipelines\"))\n\tif gpDeleteProgramPipelines == nil {\n\t\treturn errors.New(\"glDeleteProgramPipelines\")\n\t}\n\tgpDeleteProgramPipelinesEXT = (C.GPDELETEPROGRAMPIPELINESEXT)(getProcAddr(\"glDeleteProgramPipelinesEXT\"))\n\tgpDeleteProgramsARB = (C.GPDELETEPROGRAMSARB)(getProcAddr(\"glDeleteProgramsARB\"))\n\tgpDeleteProgramsNV = (C.GPDELETEPROGRAMSNV)(getProcAddr(\"glDeleteProgramsNV\"))\n\tgpDeleteQueries = (C.GPDELETEQUERIES)(getProcAddr(\"glDeleteQueries\"))\n\tif gpDeleteQueries == nil {\n\t\treturn errors.New(\"glDeleteQueries\")\n\t}\n\tgpDeleteQueriesARB = (C.GPDELETEQUERIESARB)(getProcAddr(\"glDeleteQueriesARB\"))\n\tgpDeleteQueryResourceTagNV = (C.GPDELETEQUERYRESOURCETAGNV)(getProcAddr(\"glDeleteQueryResourceTagNV\"))\n\tgpDeleteRenderbuffers = (C.GPDELETERENDERBUFFERS)(getProcAddr(\"glDeleteRenderbuffers\"))\n\tif gpDeleteRenderbuffers == nil {\n\t\treturn errors.New(\"glDeleteRenderbuffers\")\n\t}\n\tgpDeleteRenderbuffersEXT = (C.GPDELETERENDERBUFFERSEXT)(getProcAddr(\"glDeleteRenderbuffersEXT\"))\n\tgpDeleteSamplers = (C.GPDELETESAMPLERS)(getProcAddr(\"glDeleteSamplers\"))\n\tif gpDeleteSamplers == nil {\n\t\treturn errors.New(\"glDeleteSamplers\")\n\t}\n\tgpDeleteSemaphoresEXT = (C.GPDELETESEMAPHORESEXT)(getProcAddr(\"glDeleteSemaphoresEXT\"))\n\tgpDeleteShader = (C.GPDELETESHADER)(getProcAddr(\"glDeleteShader\"))\n\tif gpDeleteShader == nil {\n\t\treturn errors.New(\"glDeleteShader\")\n\t}\n\tgpDeleteStatesNV = (C.GPDELETESTATESNV)(getProcAddr(\"glDeleteStatesNV\"))\n\tgpDeleteSync = (C.GPDELETESYNC)(getProcAddr(\"glDeleteSync\"))\n\tif gpDeleteSync == nil {\n\t\treturn errors.New(\"glDeleteSync\")\n\t}\n\tgpDeleteTextures = (C.GPDELETETEXTURES)(getProcAddr(\"glDeleteTextures\"))\n\tif gpDeleteTextures == nil {\n\t\treturn errors.New(\"glDeleteTextures\")\n\t}\n\tgpDeleteTexturesEXT = (C.GPDELETETEXTURESEXT)(getProcAddr(\"glDeleteTexturesEXT\"))\n\tgpDeleteTransformFeedbacks = (C.GPDELETETRANSFORMFEEDBACKS)(getProcAddr(\"glDeleteTransformFeedbacks\"))\n\tif gpDeleteTransformFeedbacks == nil {\n\t\treturn errors.New(\"glDeleteTransformFeedbacks\")\n\t}\n\tgpDeleteTransformFeedbacksNV = (C.GPDELETETRANSFORMFEEDBACKSNV)(getProcAddr(\"glDeleteTransformFeedbacksNV\"))\n\tgpDeleteVertexArrays = (C.GPDELETEVERTEXARRAYS)(getProcAddr(\"glDeleteVertexArrays\"))\n\tif gpDeleteVertexArrays == nil {\n\t\treturn errors.New(\"glDeleteVertexArrays\")\n\t}\n\tgpDeleteVertexArraysAPPLE = (C.GPDELETEVERTEXARRAYSAPPLE)(getProcAddr(\"glDeleteVertexArraysAPPLE\"))\n\tgpDeleteVertexShaderEXT = (C.GPDELETEVERTEXSHADEREXT)(getProcAddr(\"glDeleteVertexShaderEXT\"))\n\tgpDepthBoundsEXT = (C.GPDEPTHBOUNDSEXT)(getProcAddr(\"glDepthBoundsEXT\"))\n\tgpDepthBoundsdNV = (C.GPDEPTHBOUNDSDNV)(getProcAddr(\"glDepthBoundsdNV\"))\n\tgpDepthFunc = (C.GPDEPTHFUNC)(getProcAddr(\"glDepthFunc\"))\n\tif gpDepthFunc == nil {\n\t\treturn errors.New(\"glDepthFunc\")\n\t}\n\tgpDepthMask = (C.GPDEPTHMASK)(getProcAddr(\"glDepthMask\"))\n\tif gpDepthMask == nil {\n\t\treturn errors.New(\"glDepthMask\")\n\t}\n\tgpDepthRange = (C.GPDEPTHRANGE)(getProcAddr(\"glDepthRange\"))\n\tif gpDepthRange == nil {\n\t\treturn errors.New(\"glDepthRange\")\n\t}\n\tgpDepthRangeArraydvNV = (C.GPDEPTHRANGEARRAYDVNV)(getProcAddr(\"glDepthRangeArraydvNV\"))\n\tgpDepthRangeArrayv = (C.GPDEPTHRANGEARRAYV)(getProcAddr(\"glDepthRangeArrayv\"))\n\tif gpDepthRangeArrayv == nil {\n\t\treturn errors.New(\"glDepthRangeArrayv\")\n\t}\n\tgpDepthRangeIndexed = (C.GPDEPTHRANGEINDEXED)(getProcAddr(\"glDepthRangeIndexed\"))\n\tif gpDepthRangeIndexed == nil {\n\t\treturn errors.New(\"glDepthRangeIndexed\")\n\t}\n\tgpDepthRangeIndexeddNV = (C.GPDEPTHRANGEINDEXEDDNV)(getProcAddr(\"glDepthRangeIndexeddNV\"))\n\tgpDepthRangedNV = (C.GPDEPTHRANGEDNV)(getProcAddr(\"glDepthRangedNV\"))\n\tgpDepthRangef = (C.GPDEPTHRANGEF)(getProcAddr(\"glDepthRangef\"))\n\tif gpDepthRangef == nil {\n\t\treturn errors.New(\"glDepthRangef\")\n\t}\n\tgpDepthRangefOES = (C.GPDEPTHRANGEFOES)(getProcAddr(\"glDepthRangefOES\"))\n\tgpDepthRangexOES = (C.GPDEPTHRANGEXOES)(getProcAddr(\"glDepthRangexOES\"))\n\tgpDetachObjectARB = (C.GPDETACHOBJECTARB)(getProcAddr(\"glDetachObjectARB\"))\n\tgpDetachShader = (C.GPDETACHSHADER)(getProcAddr(\"glDetachShader\"))\n\tif gpDetachShader == nil {\n\t\treturn errors.New(\"glDetachShader\")\n\t}\n\tgpDetailTexFuncSGIS = (C.GPDETAILTEXFUNCSGIS)(getProcAddr(\"glDetailTexFuncSGIS\"))\n\tgpDisable = (C.GPDISABLE)(getProcAddr(\"glDisable\"))\n\tif gpDisable == nil {\n\t\treturn errors.New(\"glDisable\")\n\t}\n\tgpDisableClientState = (C.GPDISABLECLIENTSTATE)(getProcAddr(\"glDisableClientState\"))\n\tif gpDisableClientState == nil {\n\t\treturn errors.New(\"glDisableClientState\")\n\t}\n\tgpDisableClientStateIndexedEXT = (C.GPDISABLECLIENTSTATEINDEXEDEXT)(getProcAddr(\"glDisableClientStateIndexedEXT\"))\n\tgpDisableClientStateiEXT = (C.GPDISABLECLIENTSTATEIEXT)(getProcAddr(\"glDisableClientStateiEXT\"))\n\tgpDisableIndexedEXT = (C.GPDISABLEINDEXEDEXT)(getProcAddr(\"glDisableIndexedEXT\"))\n\tgpDisableVariantClientStateEXT = (C.GPDISABLEVARIANTCLIENTSTATEEXT)(getProcAddr(\"glDisableVariantClientStateEXT\"))\n\tgpDisableVertexArrayAttrib = (C.GPDISABLEVERTEXARRAYATTRIB)(getProcAddr(\"glDisableVertexArrayAttrib\"))\n\tgpDisableVertexArrayAttribEXT = (C.GPDISABLEVERTEXARRAYATTRIBEXT)(getProcAddr(\"glDisableVertexArrayAttribEXT\"))\n\tgpDisableVertexArrayEXT = (C.GPDISABLEVERTEXARRAYEXT)(getProcAddr(\"glDisableVertexArrayEXT\"))\n\tgpDisableVertexAttribAPPLE = (C.GPDISABLEVERTEXATTRIBAPPLE)(getProcAddr(\"glDisableVertexAttribAPPLE\"))\n\tgpDisableVertexAttribArray = (C.GPDISABLEVERTEXATTRIBARRAY)(getProcAddr(\"glDisableVertexAttribArray\"))\n\tif gpDisableVertexAttribArray == nil {\n\t\treturn errors.New(\"glDisableVertexAttribArray\")\n\t}\n\tgpDisableVertexAttribArrayARB = (C.GPDISABLEVERTEXATTRIBARRAYARB)(getProcAddr(\"glDisableVertexAttribArrayARB\"))\n\tgpDisablei = (C.GPDISABLEI)(getProcAddr(\"glDisablei\"))\n\tif gpDisablei == nil {\n\t\treturn errors.New(\"glDisablei\")\n\t}\n\tgpDispatchCompute = (C.GPDISPATCHCOMPUTE)(getProcAddr(\"glDispatchCompute\"))\n\tif gpDispatchCompute == nil {\n\t\treturn errors.New(\"glDispatchCompute\")\n\t}\n\tgpDispatchComputeGroupSizeARB = (C.GPDISPATCHCOMPUTEGROUPSIZEARB)(getProcAddr(\"glDispatchComputeGroupSizeARB\"))\n\tgpDispatchComputeIndirect = (C.GPDISPATCHCOMPUTEINDIRECT)(getProcAddr(\"glDispatchComputeIndirect\"))\n\tif gpDispatchComputeIndirect == nil {\n\t\treturn errors.New(\"glDispatchComputeIndirect\")\n\t}\n\tgpDrawArrays = (C.GPDRAWARRAYS)(getProcAddr(\"glDrawArrays\"))\n\tif gpDrawArrays == nil {\n\t\treturn errors.New(\"glDrawArrays\")\n\t}\n\tgpDrawArraysEXT = (C.GPDRAWARRAYSEXT)(getProcAddr(\"glDrawArraysEXT\"))\n\tgpDrawArraysIndirect = (C.GPDRAWARRAYSINDIRECT)(getProcAddr(\"glDrawArraysIndirect\"))\n\tif gpDrawArraysIndirect == nil {\n\t\treturn errors.New(\"glDrawArraysIndirect\")\n\t}\n\tgpDrawArraysInstanced = (C.GPDRAWARRAYSINSTANCED)(getProcAddr(\"glDrawArraysInstanced\"))\n\tif gpDrawArraysInstanced == nil {\n\t\treturn errors.New(\"glDrawArraysInstanced\")\n\t}\n\tgpDrawArraysInstancedARB = (C.GPDRAWARRAYSINSTANCEDARB)(getProcAddr(\"glDrawArraysInstancedARB\"))\n\tgpDrawArraysInstancedBaseInstance = (C.GPDRAWARRAYSINSTANCEDBASEINSTANCE)(getProcAddr(\"glDrawArraysInstancedBaseInstance\"))\n\tif gpDrawArraysInstancedBaseInstance == nil {\n\t\treturn errors.New(\"glDrawArraysInstancedBaseInstance\")\n\t}\n\tgpDrawArraysInstancedEXT = (C.GPDRAWARRAYSINSTANCEDEXT)(getProcAddr(\"glDrawArraysInstancedEXT\"))\n\tgpDrawBuffer = (C.GPDRAWBUFFER)(getProcAddr(\"glDrawBuffer\"))\n\tif gpDrawBuffer == nil {\n\t\treturn errors.New(\"glDrawBuffer\")\n\t}\n\tgpDrawBuffers = (C.GPDRAWBUFFERS)(getProcAddr(\"glDrawBuffers\"))\n\tif gpDrawBuffers == nil {\n\t\treturn errors.New(\"glDrawBuffers\")\n\t}\n\tgpDrawBuffersARB = (C.GPDRAWBUFFERSARB)(getProcAddr(\"glDrawBuffersARB\"))\n\tgpDrawBuffersATI = (C.GPDRAWBUFFERSATI)(getProcAddr(\"glDrawBuffersATI\"))\n\tgpDrawCommandsAddressNV = (C.GPDRAWCOMMANDSADDRESSNV)(getProcAddr(\"glDrawCommandsAddressNV\"))\n\tgpDrawCommandsNV = (C.GPDRAWCOMMANDSNV)(getProcAddr(\"glDrawCommandsNV\"))\n\tgpDrawCommandsStatesAddressNV = (C.GPDRAWCOMMANDSSTATESADDRESSNV)(getProcAddr(\"glDrawCommandsStatesAddressNV\"))\n\tgpDrawCommandsStatesNV = (C.GPDRAWCOMMANDSSTATESNV)(getProcAddr(\"glDrawCommandsStatesNV\"))\n\tgpDrawElementArrayAPPLE = (C.GPDRAWELEMENTARRAYAPPLE)(getProcAddr(\"glDrawElementArrayAPPLE\"))\n\tgpDrawElementArrayATI = (C.GPDRAWELEMENTARRAYATI)(getProcAddr(\"glDrawElementArrayATI\"))\n\tgpDrawElements = (C.GPDRAWELEMENTS)(getProcAddr(\"glDrawElements\"))\n\tif gpDrawElements == nil {\n\t\treturn errors.New(\"glDrawElements\")\n\t}\n\tgpDrawElementsBaseVertex = (C.GPDRAWELEMENTSBASEVERTEX)(getProcAddr(\"glDrawElementsBaseVertex\"))\n\tif gpDrawElementsBaseVertex == nil {\n\t\treturn errors.New(\"glDrawElementsBaseVertex\")\n\t}\n\tgpDrawElementsIndirect = (C.GPDRAWELEMENTSINDIRECT)(getProcAddr(\"glDrawElementsIndirect\"))\n\tif gpDrawElementsIndirect == nil {\n\t\treturn errors.New(\"glDrawElementsIndirect\")\n\t}\n\tgpDrawElementsInstanced = (C.GPDRAWELEMENTSINSTANCED)(getProcAddr(\"glDrawElementsInstanced\"))\n\tif gpDrawElementsInstanced == nil {\n\t\treturn errors.New(\"glDrawElementsInstanced\")\n\t}\n\tgpDrawElementsInstancedARB = (C.GPDRAWELEMENTSINSTANCEDARB)(getProcAddr(\"glDrawElementsInstancedARB\"))\n\tgpDrawElementsInstancedBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEINSTANCE)(getProcAddr(\"glDrawElementsInstancedBaseInstance\"))\n\tif gpDrawElementsInstancedBaseInstance == nil {\n\t\treturn errors.New(\"glDrawElementsInstancedBaseInstance\")\n\t}\n\tgpDrawElementsInstancedBaseVertex = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEX)(getProcAddr(\"glDrawElementsInstancedBaseVertex\"))\n\tif gpDrawElementsInstancedBaseVertex == nil {\n\t\treturn errors.New(\"glDrawElementsInstancedBaseVertex\")\n\t}\n\tgpDrawElementsInstancedBaseVertexBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(getProcAddr(\"glDrawElementsInstancedBaseVertexBaseInstance\"))\n\tif gpDrawElementsInstancedBaseVertexBaseInstance == nil {\n\t\treturn errors.New(\"glDrawElementsInstancedBaseVertexBaseInstance\")\n\t}\n\tgpDrawElementsInstancedEXT = (C.GPDRAWELEMENTSINSTANCEDEXT)(getProcAddr(\"glDrawElementsInstancedEXT\"))\n\tgpDrawMeshArraysSUN = (C.GPDRAWMESHARRAYSSUN)(getProcAddr(\"glDrawMeshArraysSUN\"))\n\tgpDrawMeshTasksIndirectNV = (C.GPDRAWMESHTASKSINDIRECTNV)(getProcAddr(\"glDrawMeshTasksIndirectNV\"))\n\tgpDrawMeshTasksNV = (C.GPDRAWMESHTASKSNV)(getProcAddr(\"glDrawMeshTasksNV\"))\n\tgpDrawPixels = (C.GPDRAWPIXELS)(getProcAddr(\"glDrawPixels\"))\n\tif gpDrawPixels == nil {\n\t\treturn errors.New(\"glDrawPixels\")\n\t}\n\tgpDrawRangeElementArrayAPPLE = (C.GPDRAWRANGEELEMENTARRAYAPPLE)(getProcAddr(\"glDrawRangeElementArrayAPPLE\"))\n\tgpDrawRangeElementArrayATI = (C.GPDRAWRANGEELEMENTARRAYATI)(getProcAddr(\"glDrawRangeElementArrayATI\"))\n\tgpDrawRangeElements = (C.GPDRAWRANGEELEMENTS)(getProcAddr(\"glDrawRangeElements\"))\n\tif gpDrawRangeElements == nil {\n\t\treturn errors.New(\"glDrawRangeElements\")\n\t}\n\tgpDrawRangeElementsBaseVertex = (C.GPDRAWRANGEELEMENTSBASEVERTEX)(getProcAddr(\"glDrawRangeElementsBaseVertex\"))\n\tif gpDrawRangeElementsBaseVertex == nil {\n\t\treturn errors.New(\"glDrawRangeElementsBaseVertex\")\n\t}\n\tgpDrawRangeElementsEXT = (C.GPDRAWRANGEELEMENTSEXT)(getProcAddr(\"glDrawRangeElementsEXT\"))\n\tgpDrawTextureNV = (C.GPDRAWTEXTURENV)(getProcAddr(\"glDrawTextureNV\"))\n\tgpDrawTransformFeedback = (C.GPDRAWTRANSFORMFEEDBACK)(getProcAddr(\"glDrawTransformFeedback\"))\n\tif gpDrawTransformFeedback == nil {\n\t\treturn errors.New(\"glDrawTransformFeedback\")\n\t}\n\tgpDrawTransformFeedbackInstanced = (C.GPDRAWTRANSFORMFEEDBACKINSTANCED)(getProcAddr(\"glDrawTransformFeedbackInstanced\"))\n\tif gpDrawTransformFeedbackInstanced == nil {\n\t\treturn errors.New(\"glDrawTransformFeedbackInstanced\")\n\t}\n\tgpDrawTransformFeedbackNV = (C.GPDRAWTRANSFORMFEEDBACKNV)(getProcAddr(\"glDrawTransformFeedbackNV\"))\n\tgpDrawTransformFeedbackStream = (C.GPDRAWTRANSFORMFEEDBACKSTREAM)(getProcAddr(\"glDrawTransformFeedbackStream\"))\n\tif gpDrawTransformFeedbackStream == nil {\n\t\treturn errors.New(\"glDrawTransformFeedbackStream\")\n\t}\n\tgpDrawTransformFeedbackStreamInstanced = (C.GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(getProcAddr(\"glDrawTransformFeedbackStreamInstanced\"))\n\tif gpDrawTransformFeedbackStreamInstanced == nil {\n\t\treturn errors.New(\"glDrawTransformFeedbackStreamInstanced\")\n\t}\n\tgpDrawVkImageNV = (C.GPDRAWVKIMAGENV)(getProcAddr(\"glDrawVkImageNV\"))\n\tgpEGLImageTargetTexStorageEXT = (C.GPEGLIMAGETARGETTEXSTORAGEEXT)(getProcAddr(\"glEGLImageTargetTexStorageEXT\"))\n\tgpEGLImageTargetTextureStorageEXT = (C.GPEGLIMAGETARGETTEXTURESTORAGEEXT)(getProcAddr(\"glEGLImageTargetTextureStorageEXT\"))\n\tgpEdgeFlag = (C.GPEDGEFLAG)(getProcAddr(\"glEdgeFlag\"))\n\tif gpEdgeFlag == nil {\n\t\treturn errors.New(\"glEdgeFlag\")\n\t}\n\tgpEdgeFlagFormatNV = (C.GPEDGEFLAGFORMATNV)(getProcAddr(\"glEdgeFlagFormatNV\"))\n\tgpEdgeFlagPointer = (C.GPEDGEFLAGPOINTER)(getProcAddr(\"glEdgeFlagPointer\"))\n\tif gpEdgeFlagPointer == nil {\n\t\treturn errors.New(\"glEdgeFlagPointer\")\n\t}\n\tgpEdgeFlagPointerEXT = (C.GPEDGEFLAGPOINTEREXT)(getProcAddr(\"glEdgeFlagPointerEXT\"))\n\tgpEdgeFlagPointerListIBM = (C.GPEDGEFLAGPOINTERLISTIBM)(getProcAddr(\"glEdgeFlagPointerListIBM\"))\n\tgpEdgeFlagv = (C.GPEDGEFLAGV)(getProcAddr(\"glEdgeFlagv\"))\n\tif gpEdgeFlagv == nil {\n\t\treturn errors.New(\"glEdgeFlagv\")\n\t}\n\tgpElementPointerAPPLE = (C.GPELEMENTPOINTERAPPLE)(getProcAddr(\"glElementPointerAPPLE\"))\n\tgpElementPointerATI = (C.GPELEMENTPOINTERATI)(getProcAddr(\"glElementPointerATI\"))\n\tgpEnable = (C.GPENABLE)(getProcAddr(\"glEnable\"))\n\tif gpEnable == nil {\n\t\treturn errors.New(\"glEnable\")\n\t}\n\tgpEnableClientState = (C.GPENABLECLIENTSTATE)(getProcAddr(\"glEnableClientState\"))\n\tif gpEnableClientState == nil {\n\t\treturn errors.New(\"glEnableClientState\")\n\t}\n\tgpEnableClientStateIndexedEXT = (C.GPENABLECLIENTSTATEINDEXEDEXT)(getProcAddr(\"glEnableClientStateIndexedEXT\"))\n\tgpEnableClientStateiEXT = (C.GPENABLECLIENTSTATEIEXT)(getProcAddr(\"glEnableClientStateiEXT\"))\n\tgpEnableIndexedEXT = (C.GPENABLEINDEXEDEXT)(getProcAddr(\"glEnableIndexedEXT\"))\n\tgpEnableVariantClientStateEXT = (C.GPENABLEVARIANTCLIENTSTATEEXT)(getProcAddr(\"glEnableVariantClientStateEXT\"))\n\tgpEnableVertexArrayAttrib = (C.GPENABLEVERTEXARRAYATTRIB)(getProcAddr(\"glEnableVertexArrayAttrib\"))\n\tgpEnableVertexArrayAttribEXT = (C.GPENABLEVERTEXARRAYATTRIBEXT)(getProcAddr(\"glEnableVertexArrayAttribEXT\"))\n\tgpEnableVertexArrayEXT = (C.GPENABLEVERTEXARRAYEXT)(getProcAddr(\"glEnableVertexArrayEXT\"))\n\tgpEnableVertexAttribAPPLE = (C.GPENABLEVERTEXATTRIBAPPLE)(getProcAddr(\"glEnableVertexAttribAPPLE\"))\n\tgpEnableVertexAttribArray = (C.GPENABLEVERTEXATTRIBARRAY)(getProcAddr(\"glEnableVertexAttribArray\"))\n\tif gpEnableVertexAttribArray == nil {\n\t\treturn errors.New(\"glEnableVertexAttribArray\")\n\t}\n\tgpEnableVertexAttribArrayARB = (C.GPENABLEVERTEXATTRIBARRAYARB)(getProcAddr(\"glEnableVertexAttribArrayARB\"))\n\tgpEnablei = (C.GPENABLEI)(getProcAddr(\"glEnablei\"))\n\tif gpEnablei == nil {\n\t\treturn errors.New(\"glEnablei\")\n\t}\n\tgpEnd = (C.GPEND)(getProcAddr(\"glEnd\"))\n\tif gpEnd == nil {\n\t\treturn errors.New(\"glEnd\")\n\t}\n\tgpEndConditionalRender = (C.GPENDCONDITIONALRENDER)(getProcAddr(\"glEndConditionalRender\"))\n\tif gpEndConditionalRender == nil {\n\t\treturn errors.New(\"glEndConditionalRender\")\n\t}\n\tgpEndConditionalRenderNV = (C.GPENDCONDITIONALRENDERNV)(getProcAddr(\"glEndConditionalRenderNV\"))\n\tgpEndConditionalRenderNVX = (C.GPENDCONDITIONALRENDERNVX)(getProcAddr(\"glEndConditionalRenderNVX\"))\n\tgpEndFragmentShaderATI = (C.GPENDFRAGMENTSHADERATI)(getProcAddr(\"glEndFragmentShaderATI\"))\n\tgpEndList = (C.GPENDLIST)(getProcAddr(\"glEndList\"))\n\tif gpEndList == nil {\n\t\treturn errors.New(\"glEndList\")\n\t}\n\tgpEndOcclusionQueryNV = (C.GPENDOCCLUSIONQUERYNV)(getProcAddr(\"glEndOcclusionQueryNV\"))\n\tgpEndPerfMonitorAMD = (C.GPENDPERFMONITORAMD)(getProcAddr(\"glEndPerfMonitorAMD\"))\n\tgpEndPerfQueryINTEL = (C.GPENDPERFQUERYINTEL)(getProcAddr(\"glEndPerfQueryINTEL\"))\n\tgpEndQuery = (C.GPENDQUERY)(getProcAddr(\"glEndQuery\"))\n\tif gpEndQuery == nil {\n\t\treturn errors.New(\"glEndQuery\")\n\t}\n\tgpEndQueryARB = (C.GPENDQUERYARB)(getProcAddr(\"glEndQueryARB\"))\n\tgpEndQueryIndexed = (C.GPENDQUERYINDEXED)(getProcAddr(\"glEndQueryIndexed\"))\n\tif gpEndQueryIndexed == nil {\n\t\treturn errors.New(\"glEndQueryIndexed\")\n\t}\n\tgpEndTransformFeedback = (C.GPENDTRANSFORMFEEDBACK)(getProcAddr(\"glEndTransformFeedback\"))\n\tif gpEndTransformFeedback == nil {\n\t\treturn errors.New(\"glEndTransformFeedback\")\n\t}\n\tgpEndTransformFeedbackEXT = (C.GPENDTRANSFORMFEEDBACKEXT)(getProcAddr(\"glEndTransformFeedbackEXT\"))\n\tgpEndTransformFeedbackNV = (C.GPENDTRANSFORMFEEDBACKNV)(getProcAddr(\"glEndTransformFeedbackNV\"))\n\tgpEndVertexShaderEXT = (C.GPENDVERTEXSHADEREXT)(getProcAddr(\"glEndVertexShaderEXT\"))\n\tgpEndVideoCaptureNV = (C.GPENDVIDEOCAPTURENV)(getProcAddr(\"glEndVideoCaptureNV\"))\n\tgpEvalCoord1d = (C.GPEVALCOORD1D)(getProcAddr(\"glEvalCoord1d\"))\n\tif gpEvalCoord1d == nil {\n\t\treturn errors.New(\"glEvalCoord1d\")\n\t}\n\tgpEvalCoord1dv = (C.GPEVALCOORD1DV)(getProcAddr(\"glEvalCoord1dv\"))\n\tif gpEvalCoord1dv == nil {\n\t\treturn errors.New(\"glEvalCoord1dv\")\n\t}\n\tgpEvalCoord1f = (C.GPEVALCOORD1F)(getProcAddr(\"glEvalCoord1f\"))\n\tif gpEvalCoord1f == nil {\n\t\treturn errors.New(\"glEvalCoord1f\")\n\t}\n\tgpEvalCoord1fv = (C.GPEVALCOORD1FV)(getProcAddr(\"glEvalCoord1fv\"))\n\tif gpEvalCoord1fv == nil {\n\t\treturn errors.New(\"glEvalCoord1fv\")\n\t}\n\tgpEvalCoord1xOES = (C.GPEVALCOORD1XOES)(getProcAddr(\"glEvalCoord1xOES\"))\n\tgpEvalCoord1xvOES = (C.GPEVALCOORD1XVOES)(getProcAddr(\"glEvalCoord1xvOES\"))\n\tgpEvalCoord2d = (C.GPEVALCOORD2D)(getProcAddr(\"glEvalCoord2d\"))\n\tif gpEvalCoord2d == nil {\n\t\treturn errors.New(\"glEvalCoord2d\")\n\t}\n\tgpEvalCoord2dv = (C.GPEVALCOORD2DV)(getProcAddr(\"glEvalCoord2dv\"))\n\tif gpEvalCoord2dv == nil {\n\t\treturn errors.New(\"glEvalCoord2dv\")\n\t}\n\tgpEvalCoord2f = (C.GPEVALCOORD2F)(getProcAddr(\"glEvalCoord2f\"))\n\tif gpEvalCoord2f == nil {\n\t\treturn errors.New(\"glEvalCoord2f\")\n\t}\n\tgpEvalCoord2fv = (C.GPEVALCOORD2FV)(getProcAddr(\"glEvalCoord2fv\"))\n\tif gpEvalCoord2fv == nil {\n\t\treturn errors.New(\"glEvalCoord2fv\")\n\t}\n\tgpEvalCoord2xOES = (C.GPEVALCOORD2XOES)(getProcAddr(\"glEvalCoord2xOES\"))\n\tgpEvalCoord2xvOES = (C.GPEVALCOORD2XVOES)(getProcAddr(\"glEvalCoord2xvOES\"))\n\tgpEvalMapsNV = (C.GPEVALMAPSNV)(getProcAddr(\"glEvalMapsNV\"))\n\tgpEvalMesh1 = (C.GPEVALMESH1)(getProcAddr(\"glEvalMesh1\"))\n\tif gpEvalMesh1 == nil {\n\t\treturn errors.New(\"glEvalMesh1\")\n\t}\n\tgpEvalMesh2 = (C.GPEVALMESH2)(getProcAddr(\"glEvalMesh2\"))\n\tif gpEvalMesh2 == nil {\n\t\treturn errors.New(\"glEvalMesh2\")\n\t}\n\tgpEvalPoint1 = (C.GPEVALPOINT1)(getProcAddr(\"glEvalPoint1\"))\n\tif gpEvalPoint1 == nil {\n\t\treturn errors.New(\"glEvalPoint1\")\n\t}\n\tgpEvalPoint2 = (C.GPEVALPOINT2)(getProcAddr(\"glEvalPoint2\"))\n\tif gpEvalPoint2 == nil {\n\t\treturn errors.New(\"glEvalPoint2\")\n\t}\n\tgpEvaluateDepthValuesARB = (C.GPEVALUATEDEPTHVALUESARB)(getProcAddr(\"glEvaluateDepthValuesARB\"))\n\tgpExecuteProgramNV = (C.GPEXECUTEPROGRAMNV)(getProcAddr(\"glExecuteProgramNV\"))\n\tgpExtractComponentEXT = (C.GPEXTRACTCOMPONENTEXT)(getProcAddr(\"glExtractComponentEXT\"))\n\tgpFeedbackBuffer = (C.GPFEEDBACKBUFFER)(getProcAddr(\"glFeedbackBuffer\"))\n\tif gpFeedbackBuffer == nil {\n\t\treturn errors.New(\"glFeedbackBuffer\")\n\t}\n\tgpFeedbackBufferxOES = (C.GPFEEDBACKBUFFERXOES)(getProcAddr(\"glFeedbackBufferxOES\"))\n\tgpFenceSync = (C.GPFENCESYNC)(getProcAddr(\"glFenceSync\"))\n\tif gpFenceSync == nil {\n\t\treturn errors.New(\"glFenceSync\")\n\t}\n\tgpFinalCombinerInputNV = (C.GPFINALCOMBINERINPUTNV)(getProcAddr(\"glFinalCombinerInputNV\"))\n\tgpFinish = (C.GPFINISH)(getProcAddr(\"glFinish\"))\n\tif gpFinish == nil {\n\t\treturn errors.New(\"glFinish\")\n\t}\n\tgpFinishAsyncSGIX = (C.GPFINISHASYNCSGIX)(getProcAddr(\"glFinishAsyncSGIX\"))\n\tgpFinishFenceAPPLE = (C.GPFINISHFENCEAPPLE)(getProcAddr(\"glFinishFenceAPPLE\"))\n\tgpFinishFenceNV = (C.GPFINISHFENCENV)(getProcAddr(\"glFinishFenceNV\"))\n\tgpFinishObjectAPPLE = (C.GPFINISHOBJECTAPPLE)(getProcAddr(\"glFinishObjectAPPLE\"))\n\tgpFinishTextureSUNX = (C.GPFINISHTEXTURESUNX)(getProcAddr(\"glFinishTextureSUNX\"))\n\tgpFlush = (C.GPFLUSH)(getProcAddr(\"glFlush\"))\n\tif gpFlush == nil {\n\t\treturn errors.New(\"glFlush\")\n\t}\n\tgpFlushMappedBufferRange = (C.GPFLUSHMAPPEDBUFFERRANGE)(getProcAddr(\"glFlushMappedBufferRange\"))\n\tif gpFlushMappedBufferRange == nil {\n\t\treturn errors.New(\"glFlushMappedBufferRange\")\n\t}\n\tgpFlushMappedBufferRangeAPPLE = (C.GPFLUSHMAPPEDBUFFERRANGEAPPLE)(getProcAddr(\"glFlushMappedBufferRangeAPPLE\"))\n\tgpFlushMappedNamedBufferRange = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGE)(getProcAddr(\"glFlushMappedNamedBufferRange\"))\n\tgpFlushMappedNamedBufferRangeEXT = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGEEXT)(getProcAddr(\"glFlushMappedNamedBufferRangeEXT\"))\n\tgpFlushPixelDataRangeNV = (C.GPFLUSHPIXELDATARANGENV)(getProcAddr(\"glFlushPixelDataRangeNV\"))\n\tgpFlushRasterSGIX = (C.GPFLUSHRASTERSGIX)(getProcAddr(\"glFlushRasterSGIX\"))\n\tgpFlushStaticDataIBM = (C.GPFLUSHSTATICDATAIBM)(getProcAddr(\"glFlushStaticDataIBM\"))\n\tgpFlushVertexArrayRangeAPPLE = (C.GPFLUSHVERTEXARRAYRANGEAPPLE)(getProcAddr(\"glFlushVertexArrayRangeAPPLE\"))\n\tgpFlushVertexArrayRangeNV = (C.GPFLUSHVERTEXARRAYRANGENV)(getProcAddr(\"glFlushVertexArrayRangeNV\"))\n\tgpFogCoordFormatNV = (C.GPFOGCOORDFORMATNV)(getProcAddr(\"glFogCoordFormatNV\"))\n\tgpFogCoordPointer = (C.GPFOGCOORDPOINTER)(getProcAddr(\"glFogCoordPointer\"))\n\tif gpFogCoordPointer == nil {\n\t\treturn errors.New(\"glFogCoordPointer\")\n\t}\n\tgpFogCoordPointerEXT = (C.GPFOGCOORDPOINTEREXT)(getProcAddr(\"glFogCoordPointerEXT\"))\n\tgpFogCoordPointerListIBM = (C.GPFOGCOORDPOINTERLISTIBM)(getProcAddr(\"glFogCoordPointerListIBM\"))\n\tgpFogCoordd = (C.GPFOGCOORDD)(getProcAddr(\"glFogCoordd\"))\n\tif gpFogCoordd == nil {\n\t\treturn errors.New(\"glFogCoordd\")\n\t}\n\tgpFogCoorddEXT = (C.GPFOGCOORDDEXT)(getProcAddr(\"glFogCoorddEXT\"))\n\tgpFogCoorddv = (C.GPFOGCOORDDV)(getProcAddr(\"glFogCoorddv\"))\n\tif gpFogCoorddv == nil {\n\t\treturn errors.New(\"glFogCoorddv\")\n\t}\n\tgpFogCoorddvEXT = (C.GPFOGCOORDDVEXT)(getProcAddr(\"glFogCoorddvEXT\"))\n\tgpFogCoordf = (C.GPFOGCOORDF)(getProcAddr(\"glFogCoordf\"))\n\tif gpFogCoordf == nil {\n\t\treturn errors.New(\"glFogCoordf\")\n\t}\n\tgpFogCoordfEXT = (C.GPFOGCOORDFEXT)(getProcAddr(\"glFogCoordfEXT\"))\n\tgpFogCoordfv = (C.GPFOGCOORDFV)(getProcAddr(\"glFogCoordfv\"))\n\tif gpFogCoordfv == nil {\n\t\treturn errors.New(\"glFogCoordfv\")\n\t}\n\tgpFogCoordfvEXT = (C.GPFOGCOORDFVEXT)(getProcAddr(\"glFogCoordfvEXT\"))\n\tgpFogCoordhNV = (C.GPFOGCOORDHNV)(getProcAddr(\"glFogCoordhNV\"))\n\tgpFogCoordhvNV = (C.GPFOGCOORDHVNV)(getProcAddr(\"glFogCoordhvNV\"))\n\tgpFogFuncSGIS = (C.GPFOGFUNCSGIS)(getProcAddr(\"glFogFuncSGIS\"))\n\tgpFogf = (C.GPFOGF)(getProcAddr(\"glFogf\"))\n\tif gpFogf == nil {\n\t\treturn errors.New(\"glFogf\")\n\t}\n\tgpFogfv = (C.GPFOGFV)(getProcAddr(\"glFogfv\"))\n\tif gpFogfv == nil {\n\t\treturn errors.New(\"glFogfv\")\n\t}\n\tgpFogi = (C.GPFOGI)(getProcAddr(\"glFogi\"))\n\tif gpFogi == nil {\n\t\treturn errors.New(\"glFogi\")\n\t}\n\tgpFogiv = (C.GPFOGIV)(getProcAddr(\"glFogiv\"))\n\tif gpFogiv == nil {\n\t\treturn errors.New(\"glFogiv\")\n\t}\n\tgpFogxOES = (C.GPFOGXOES)(getProcAddr(\"glFogxOES\"))\n\tgpFogxvOES = (C.GPFOGXVOES)(getProcAddr(\"glFogxvOES\"))\n\tgpFragmentColorMaterialSGIX = (C.GPFRAGMENTCOLORMATERIALSGIX)(getProcAddr(\"glFragmentColorMaterialSGIX\"))\n\tgpFragmentCoverageColorNV = (C.GPFRAGMENTCOVERAGECOLORNV)(getProcAddr(\"glFragmentCoverageColorNV\"))\n\tgpFragmentLightModelfSGIX = (C.GPFRAGMENTLIGHTMODELFSGIX)(getProcAddr(\"glFragmentLightModelfSGIX\"))\n\tgpFragmentLightModelfvSGIX = (C.GPFRAGMENTLIGHTMODELFVSGIX)(getProcAddr(\"glFragmentLightModelfvSGIX\"))\n\tgpFragmentLightModeliSGIX = (C.GPFRAGMENTLIGHTMODELISGIX)(getProcAddr(\"glFragmentLightModeliSGIX\"))\n\tgpFragmentLightModelivSGIX = (C.GPFRAGMENTLIGHTMODELIVSGIX)(getProcAddr(\"glFragmentLightModelivSGIX\"))\n\tgpFragmentLightfSGIX = (C.GPFRAGMENTLIGHTFSGIX)(getProcAddr(\"glFragmentLightfSGIX\"))\n\tgpFragmentLightfvSGIX = (C.GPFRAGMENTLIGHTFVSGIX)(getProcAddr(\"glFragmentLightfvSGIX\"))\n\tgpFragmentLightiSGIX = (C.GPFRAGMENTLIGHTISGIX)(getProcAddr(\"glFragmentLightiSGIX\"))\n\tgpFragmentLightivSGIX = (C.GPFRAGMENTLIGHTIVSGIX)(getProcAddr(\"glFragmentLightivSGIX\"))\n\tgpFragmentMaterialfSGIX = (C.GPFRAGMENTMATERIALFSGIX)(getProcAddr(\"glFragmentMaterialfSGIX\"))\n\tgpFragmentMaterialfvSGIX = (C.GPFRAGMENTMATERIALFVSGIX)(getProcAddr(\"glFragmentMaterialfvSGIX\"))\n\tgpFragmentMaterialiSGIX = (C.GPFRAGMENTMATERIALISGIX)(getProcAddr(\"glFragmentMaterialiSGIX\"))\n\tgpFragmentMaterialivSGIX = (C.GPFRAGMENTMATERIALIVSGIX)(getProcAddr(\"glFragmentMaterialivSGIX\"))\n\tgpFrameTerminatorGREMEDY = (C.GPFRAMETERMINATORGREMEDY)(getProcAddr(\"glFrameTerminatorGREMEDY\"))\n\tgpFrameZoomSGIX = (C.GPFRAMEZOOMSGIX)(getProcAddr(\"glFrameZoomSGIX\"))\n\tgpFramebufferDrawBufferEXT = (C.GPFRAMEBUFFERDRAWBUFFEREXT)(getProcAddr(\"glFramebufferDrawBufferEXT\"))\n\tgpFramebufferDrawBuffersEXT = (C.GPFRAMEBUFFERDRAWBUFFERSEXT)(getProcAddr(\"glFramebufferDrawBuffersEXT\"))\n\tgpFramebufferFetchBarrierEXT = (C.GPFRAMEBUFFERFETCHBARRIEREXT)(getProcAddr(\"glFramebufferFetchBarrierEXT\"))\n\tgpFramebufferParameteri = (C.GPFRAMEBUFFERPARAMETERI)(getProcAddr(\"glFramebufferParameteri\"))\n\tif gpFramebufferParameteri == nil {\n\t\treturn errors.New(\"glFramebufferParameteri\")\n\t}\n\tgpFramebufferParameteriMESA = (C.GPFRAMEBUFFERPARAMETERIMESA)(getProcAddr(\"glFramebufferParameteriMESA\"))\n\tgpFramebufferReadBufferEXT = (C.GPFRAMEBUFFERREADBUFFEREXT)(getProcAddr(\"glFramebufferReadBufferEXT\"))\n\tgpFramebufferRenderbuffer = (C.GPFRAMEBUFFERRENDERBUFFER)(getProcAddr(\"glFramebufferRenderbuffer\"))\n\tif gpFramebufferRenderbuffer == nil {\n\t\treturn errors.New(\"glFramebufferRenderbuffer\")\n\t}\n\tgpFramebufferRenderbufferEXT = (C.GPFRAMEBUFFERRENDERBUFFEREXT)(getProcAddr(\"glFramebufferRenderbufferEXT\"))\n\tgpFramebufferSampleLocationsfvARB = (C.GPFRAMEBUFFERSAMPLELOCATIONSFVARB)(getProcAddr(\"glFramebufferSampleLocationsfvARB\"))\n\tgpFramebufferSampleLocationsfvNV = (C.GPFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr(\"glFramebufferSampleLocationsfvNV\"))\n\tgpFramebufferSamplePositionsfvAMD = (C.GPFRAMEBUFFERSAMPLEPOSITIONSFVAMD)(getProcAddr(\"glFramebufferSamplePositionsfvAMD\"))\n\tgpFramebufferTexture = (C.GPFRAMEBUFFERTEXTURE)(getProcAddr(\"glFramebufferTexture\"))\n\tif gpFramebufferTexture == nil {\n\t\treturn errors.New(\"glFramebufferTexture\")\n\t}\n\tgpFramebufferTexture1D = (C.GPFRAMEBUFFERTEXTURE1D)(getProcAddr(\"glFramebufferTexture1D\"))\n\tif gpFramebufferTexture1D == nil {\n\t\treturn errors.New(\"glFramebufferTexture1D\")\n\t}\n\tgpFramebufferTexture1DEXT = (C.GPFRAMEBUFFERTEXTURE1DEXT)(getProcAddr(\"glFramebufferTexture1DEXT\"))\n\tgpFramebufferTexture2D = (C.GPFRAMEBUFFERTEXTURE2D)(getProcAddr(\"glFramebufferTexture2D\"))\n\tif gpFramebufferTexture2D == nil {\n\t\treturn errors.New(\"glFramebufferTexture2D\")\n\t}\n\tgpFramebufferTexture2DEXT = (C.GPFRAMEBUFFERTEXTURE2DEXT)(getProcAddr(\"glFramebufferTexture2DEXT\"))\n\tgpFramebufferTexture3D = (C.GPFRAMEBUFFERTEXTURE3D)(getProcAddr(\"glFramebufferTexture3D\"))\n\tif gpFramebufferTexture3D == nil {\n\t\treturn errors.New(\"glFramebufferTexture3D\")\n\t}\n\tgpFramebufferTexture3DEXT = (C.GPFRAMEBUFFERTEXTURE3DEXT)(getProcAddr(\"glFramebufferTexture3DEXT\"))\n\tgpFramebufferTextureARB = (C.GPFRAMEBUFFERTEXTUREARB)(getProcAddr(\"glFramebufferTextureARB\"))\n\tgpFramebufferTextureEXT = (C.GPFRAMEBUFFERTEXTUREEXT)(getProcAddr(\"glFramebufferTextureEXT\"))\n\tgpFramebufferTextureFaceARB = (C.GPFRAMEBUFFERTEXTUREFACEARB)(getProcAddr(\"glFramebufferTextureFaceARB\"))\n\tgpFramebufferTextureFaceEXT = (C.GPFRAMEBUFFERTEXTUREFACEEXT)(getProcAddr(\"glFramebufferTextureFaceEXT\"))\n\tgpFramebufferTextureLayer = (C.GPFRAMEBUFFERTEXTURELAYER)(getProcAddr(\"glFramebufferTextureLayer\"))\n\tif gpFramebufferTextureLayer == nil {\n\t\treturn errors.New(\"glFramebufferTextureLayer\")\n\t}\n\tgpFramebufferTextureLayerARB = (C.GPFRAMEBUFFERTEXTURELAYERARB)(getProcAddr(\"glFramebufferTextureLayerARB\"))\n\tgpFramebufferTextureLayerEXT = (C.GPFRAMEBUFFERTEXTURELAYEREXT)(getProcAddr(\"glFramebufferTextureLayerEXT\"))\n\tgpFramebufferTextureMultiviewOVR = (C.GPFRAMEBUFFERTEXTUREMULTIVIEWOVR)(getProcAddr(\"glFramebufferTextureMultiviewOVR\"))\n\tgpFreeObjectBufferATI = (C.GPFREEOBJECTBUFFERATI)(getProcAddr(\"glFreeObjectBufferATI\"))\n\tgpFrontFace = (C.GPFRONTFACE)(getProcAddr(\"glFrontFace\"))\n\tif gpFrontFace == nil {\n\t\treturn errors.New(\"glFrontFace\")\n\t}\n\tgpFrustum = (C.GPFRUSTUM)(getProcAddr(\"glFrustum\"))\n\tif gpFrustum == nil {\n\t\treturn errors.New(\"glFrustum\")\n\t}\n\tgpFrustumfOES = (C.GPFRUSTUMFOES)(getProcAddr(\"glFrustumfOES\"))\n\tgpFrustumxOES = (C.GPFRUSTUMXOES)(getProcAddr(\"glFrustumxOES\"))\n\tgpGenAsyncMarkersSGIX = (C.GPGENASYNCMARKERSSGIX)(getProcAddr(\"glGenAsyncMarkersSGIX\"))\n\tgpGenBuffers = (C.GPGENBUFFERS)(getProcAddr(\"glGenBuffers\"))\n\tif gpGenBuffers == nil {\n\t\treturn errors.New(\"glGenBuffers\")\n\t}\n\tgpGenBuffersARB = (C.GPGENBUFFERSARB)(getProcAddr(\"glGenBuffersARB\"))\n\tgpGenFencesAPPLE = (C.GPGENFENCESAPPLE)(getProcAddr(\"glGenFencesAPPLE\"))\n\tgpGenFencesNV = (C.GPGENFENCESNV)(getProcAddr(\"glGenFencesNV\"))\n\tgpGenFragmentShadersATI = (C.GPGENFRAGMENTSHADERSATI)(getProcAddr(\"glGenFragmentShadersATI\"))\n\tgpGenFramebuffers = (C.GPGENFRAMEBUFFERS)(getProcAddr(\"glGenFramebuffers\"))\n\tif gpGenFramebuffers == nil {\n\t\treturn errors.New(\"glGenFramebuffers\")\n\t}\n\tgpGenFramebuffersEXT = (C.GPGENFRAMEBUFFERSEXT)(getProcAddr(\"glGenFramebuffersEXT\"))\n\tgpGenLists = (C.GPGENLISTS)(getProcAddr(\"glGenLists\"))\n\tif gpGenLists == nil {\n\t\treturn errors.New(\"glGenLists\")\n\t}\n\tgpGenNamesAMD = (C.GPGENNAMESAMD)(getProcAddr(\"glGenNamesAMD\"))\n\tgpGenOcclusionQueriesNV = (C.GPGENOCCLUSIONQUERIESNV)(getProcAddr(\"glGenOcclusionQueriesNV\"))\n\tgpGenPathsNV = (C.GPGENPATHSNV)(getProcAddr(\"glGenPathsNV\"))\n\tgpGenPerfMonitorsAMD = (C.GPGENPERFMONITORSAMD)(getProcAddr(\"glGenPerfMonitorsAMD\"))\n\tgpGenProgramPipelines = (C.GPGENPROGRAMPIPELINES)(getProcAddr(\"glGenProgramPipelines\"))\n\tif gpGenProgramPipelines == nil {\n\t\treturn errors.New(\"glGenProgramPipelines\")\n\t}\n\tgpGenProgramPipelinesEXT = (C.GPGENPROGRAMPIPELINESEXT)(getProcAddr(\"glGenProgramPipelinesEXT\"))\n\tgpGenProgramsARB = (C.GPGENPROGRAMSARB)(getProcAddr(\"glGenProgramsARB\"))\n\tgpGenProgramsNV = (C.GPGENPROGRAMSNV)(getProcAddr(\"glGenProgramsNV\"))\n\tgpGenQueries = (C.GPGENQUERIES)(getProcAddr(\"glGenQueries\"))\n\tif gpGenQueries == nil {\n\t\treturn errors.New(\"glGenQueries\")\n\t}\n\tgpGenQueriesARB = (C.GPGENQUERIESARB)(getProcAddr(\"glGenQueriesARB\"))\n\tgpGenQueryResourceTagNV = (C.GPGENQUERYRESOURCETAGNV)(getProcAddr(\"glGenQueryResourceTagNV\"))\n\tgpGenRenderbuffers = (C.GPGENRENDERBUFFERS)(getProcAddr(\"glGenRenderbuffers\"))\n\tif gpGenRenderbuffers == nil {\n\t\treturn errors.New(\"glGenRenderbuffers\")\n\t}\n\tgpGenRenderbuffersEXT = (C.GPGENRENDERBUFFERSEXT)(getProcAddr(\"glGenRenderbuffersEXT\"))\n\tgpGenSamplers = (C.GPGENSAMPLERS)(getProcAddr(\"glGenSamplers\"))\n\tif gpGenSamplers == nil {\n\t\treturn errors.New(\"glGenSamplers\")\n\t}\n\tgpGenSemaphoresEXT = (C.GPGENSEMAPHORESEXT)(getProcAddr(\"glGenSemaphoresEXT\"))\n\tgpGenSymbolsEXT = (C.GPGENSYMBOLSEXT)(getProcAddr(\"glGenSymbolsEXT\"))\n\tgpGenTextures = (C.GPGENTEXTURES)(getProcAddr(\"glGenTextures\"))\n\tif gpGenTextures == nil {\n\t\treturn errors.New(\"glGenTextures\")\n\t}\n\tgpGenTexturesEXT = (C.GPGENTEXTURESEXT)(getProcAddr(\"glGenTexturesEXT\"))\n\tgpGenTransformFeedbacks = (C.GPGENTRANSFORMFEEDBACKS)(getProcAddr(\"glGenTransformFeedbacks\"))\n\tif gpGenTransformFeedbacks == nil {\n\t\treturn errors.New(\"glGenTransformFeedbacks\")\n\t}\n\tgpGenTransformFeedbacksNV = (C.GPGENTRANSFORMFEEDBACKSNV)(getProcAddr(\"glGenTransformFeedbacksNV\"))\n\tgpGenVertexArrays = (C.GPGENVERTEXARRAYS)(getProcAddr(\"glGenVertexArrays\"))\n\tif gpGenVertexArrays == nil {\n\t\treturn errors.New(\"glGenVertexArrays\")\n\t}\n\tgpGenVertexArraysAPPLE = (C.GPGENVERTEXARRAYSAPPLE)(getProcAddr(\"glGenVertexArraysAPPLE\"))\n\tgpGenVertexShadersEXT = (C.GPGENVERTEXSHADERSEXT)(getProcAddr(\"glGenVertexShadersEXT\"))\n\tgpGenerateMipmap = (C.GPGENERATEMIPMAP)(getProcAddr(\"glGenerateMipmap\"))\n\tif gpGenerateMipmap == nil {\n\t\treturn errors.New(\"glGenerateMipmap\")\n\t}\n\tgpGenerateMipmapEXT = (C.GPGENERATEMIPMAPEXT)(getProcAddr(\"glGenerateMipmapEXT\"))\n\tgpGenerateMultiTexMipmapEXT = (C.GPGENERATEMULTITEXMIPMAPEXT)(getProcAddr(\"glGenerateMultiTexMipmapEXT\"))\n\tgpGenerateTextureMipmap = (C.GPGENERATETEXTUREMIPMAP)(getProcAddr(\"glGenerateTextureMipmap\"))\n\tgpGenerateTextureMipmapEXT = (C.GPGENERATETEXTUREMIPMAPEXT)(getProcAddr(\"glGenerateTextureMipmapEXT\"))\n\tgpGetActiveAtomicCounterBufferiv = (C.GPGETACTIVEATOMICCOUNTERBUFFERIV)(getProcAddr(\"glGetActiveAtomicCounterBufferiv\"))\n\tif gpGetActiveAtomicCounterBufferiv == nil {\n\t\treturn errors.New(\"glGetActiveAtomicCounterBufferiv\")\n\t}\n\tgpGetActiveAttrib = (C.GPGETACTIVEATTRIB)(getProcAddr(\"glGetActiveAttrib\"))\n\tif gpGetActiveAttrib == nil {\n\t\treturn errors.New(\"glGetActiveAttrib\")\n\t}\n\tgpGetActiveAttribARB = (C.GPGETACTIVEATTRIBARB)(getProcAddr(\"glGetActiveAttribARB\"))\n\tgpGetActiveSubroutineName = (C.GPGETACTIVESUBROUTINENAME)(getProcAddr(\"glGetActiveSubroutineName\"))\n\tif gpGetActiveSubroutineName == nil {\n\t\treturn errors.New(\"glGetActiveSubroutineName\")\n\t}\n\tgpGetActiveSubroutineUniformName = (C.GPGETACTIVESUBROUTINEUNIFORMNAME)(getProcAddr(\"glGetActiveSubroutineUniformName\"))\n\tif gpGetActiveSubroutineUniformName == nil {\n\t\treturn errors.New(\"glGetActiveSubroutineUniformName\")\n\t}\n\tgpGetActiveSubroutineUniformiv = (C.GPGETACTIVESUBROUTINEUNIFORMIV)(getProcAddr(\"glGetActiveSubroutineUniformiv\"))\n\tif gpGetActiveSubroutineUniformiv == nil {\n\t\treturn errors.New(\"glGetActiveSubroutineUniformiv\")\n\t}\n\tgpGetActiveUniform = (C.GPGETACTIVEUNIFORM)(getProcAddr(\"glGetActiveUniform\"))\n\tif gpGetActiveUniform == nil {\n\t\treturn errors.New(\"glGetActiveUniform\")\n\t}\n\tgpGetActiveUniformARB = (C.GPGETACTIVEUNIFORMARB)(getProcAddr(\"glGetActiveUniformARB\"))\n\tgpGetActiveUniformBlockName = (C.GPGETACTIVEUNIFORMBLOCKNAME)(getProcAddr(\"glGetActiveUniformBlockName\"))\n\tif gpGetActiveUniformBlockName == nil {\n\t\treturn errors.New(\"glGetActiveUniformBlockName\")\n\t}\n\tgpGetActiveUniformBlockiv = (C.GPGETACTIVEUNIFORMBLOCKIV)(getProcAddr(\"glGetActiveUniformBlockiv\"))\n\tif gpGetActiveUniformBlockiv == nil {\n\t\treturn errors.New(\"glGetActiveUniformBlockiv\")\n\t}\n\tgpGetActiveUniformName = (C.GPGETACTIVEUNIFORMNAME)(getProcAddr(\"glGetActiveUniformName\"))\n\tif gpGetActiveUniformName == nil {\n\t\treturn errors.New(\"glGetActiveUniformName\")\n\t}\n\tgpGetActiveUniformsiv = (C.GPGETACTIVEUNIFORMSIV)(getProcAddr(\"glGetActiveUniformsiv\"))\n\tif gpGetActiveUniformsiv == nil {\n\t\treturn errors.New(\"glGetActiveUniformsiv\")\n\t}\n\tgpGetActiveVaryingNV = (C.GPGETACTIVEVARYINGNV)(getProcAddr(\"glGetActiveVaryingNV\"))\n\tgpGetArrayObjectfvATI = (C.GPGETARRAYOBJECTFVATI)(getProcAddr(\"glGetArrayObjectfvATI\"))\n\tgpGetArrayObjectivATI = (C.GPGETARRAYOBJECTIVATI)(getProcAddr(\"glGetArrayObjectivATI\"))\n\tgpGetAttachedObjectsARB = (C.GPGETATTACHEDOBJECTSARB)(getProcAddr(\"glGetAttachedObjectsARB\"))\n\tgpGetAttachedShaders = (C.GPGETATTACHEDSHADERS)(getProcAddr(\"glGetAttachedShaders\"))\n\tif gpGetAttachedShaders == nil {\n\t\treturn errors.New(\"glGetAttachedShaders\")\n\t}\n\tgpGetAttribLocation = (C.GPGETATTRIBLOCATION)(getProcAddr(\"glGetAttribLocation\"))\n\tif gpGetAttribLocation == nil {\n\t\treturn errors.New(\"glGetAttribLocation\")\n\t}\n\tgpGetAttribLocationARB = (C.GPGETATTRIBLOCATIONARB)(getProcAddr(\"glGetAttribLocationARB\"))\n\tgpGetBooleanIndexedvEXT = (C.GPGETBOOLEANINDEXEDVEXT)(getProcAddr(\"glGetBooleanIndexedvEXT\"))\n\tgpGetBooleani_v = (C.GPGETBOOLEANI_V)(getProcAddr(\"glGetBooleani_v\"))\n\tif gpGetBooleani_v == nil {\n\t\treturn errors.New(\"glGetBooleani_v\")\n\t}\n\tgpGetBooleanv = (C.GPGETBOOLEANV)(getProcAddr(\"glGetBooleanv\"))\n\tif gpGetBooleanv == nil {\n\t\treturn errors.New(\"glGetBooleanv\")\n\t}\n\tgpGetBufferParameteri64v = (C.GPGETBUFFERPARAMETERI64V)(getProcAddr(\"glGetBufferParameteri64v\"))\n\tif gpGetBufferParameteri64v == nil {\n\t\treturn errors.New(\"glGetBufferParameteri64v\")\n\t}\n\tgpGetBufferParameteriv = (C.GPGETBUFFERPARAMETERIV)(getProcAddr(\"glGetBufferParameteriv\"))\n\tif gpGetBufferParameteriv == nil {\n\t\treturn errors.New(\"glGetBufferParameteriv\")\n\t}\n\tgpGetBufferParameterivARB = (C.GPGETBUFFERPARAMETERIVARB)(getProcAddr(\"glGetBufferParameterivARB\"))\n\tgpGetBufferParameterui64vNV = (C.GPGETBUFFERPARAMETERUI64VNV)(getProcAddr(\"glGetBufferParameterui64vNV\"))\n\tgpGetBufferPointerv = (C.GPGETBUFFERPOINTERV)(getProcAddr(\"glGetBufferPointerv\"))\n\tif gpGetBufferPointerv == nil {\n\t\treturn errors.New(\"glGetBufferPointerv\")\n\t}\n\tgpGetBufferPointervARB = (C.GPGETBUFFERPOINTERVARB)(getProcAddr(\"glGetBufferPointervARB\"))\n\tgpGetBufferSubData = (C.GPGETBUFFERSUBDATA)(getProcAddr(\"glGetBufferSubData\"))\n\tif gpGetBufferSubData == nil {\n\t\treturn errors.New(\"glGetBufferSubData\")\n\t}\n\tgpGetBufferSubDataARB = (C.GPGETBUFFERSUBDATAARB)(getProcAddr(\"glGetBufferSubDataARB\"))\n\tgpGetClipPlane = (C.GPGETCLIPPLANE)(getProcAddr(\"glGetClipPlane\"))\n\tif gpGetClipPlane == nil {\n\t\treturn errors.New(\"glGetClipPlane\")\n\t}\n\tgpGetClipPlanefOES = (C.GPGETCLIPPLANEFOES)(getProcAddr(\"glGetClipPlanefOES\"))\n\tgpGetClipPlanexOES = (C.GPGETCLIPPLANEXOES)(getProcAddr(\"glGetClipPlanexOES\"))\n\tgpGetColorTable = (C.GPGETCOLORTABLE)(getProcAddr(\"glGetColorTable\"))\n\tgpGetColorTableEXT = (C.GPGETCOLORTABLEEXT)(getProcAddr(\"glGetColorTableEXT\"))\n\tgpGetColorTableParameterfv = (C.GPGETCOLORTABLEPARAMETERFV)(getProcAddr(\"glGetColorTableParameterfv\"))\n\tgpGetColorTableParameterfvEXT = (C.GPGETCOLORTABLEPARAMETERFVEXT)(getProcAddr(\"glGetColorTableParameterfvEXT\"))\n\tgpGetColorTableParameterfvSGI = (C.GPGETCOLORTABLEPARAMETERFVSGI)(getProcAddr(\"glGetColorTableParameterfvSGI\"))\n\tgpGetColorTableParameteriv = (C.GPGETCOLORTABLEPARAMETERIV)(getProcAddr(\"glGetColorTableParameteriv\"))\n\tgpGetColorTableParameterivEXT = (C.GPGETCOLORTABLEPARAMETERIVEXT)(getProcAddr(\"glGetColorTableParameterivEXT\"))\n\tgpGetColorTableParameterivSGI = (C.GPGETCOLORTABLEPARAMETERIVSGI)(getProcAddr(\"glGetColorTableParameterivSGI\"))\n\tgpGetColorTableSGI = (C.GPGETCOLORTABLESGI)(getProcAddr(\"glGetColorTableSGI\"))\n\tgpGetCombinerInputParameterfvNV = (C.GPGETCOMBINERINPUTPARAMETERFVNV)(getProcAddr(\"glGetCombinerInputParameterfvNV\"))\n\tgpGetCombinerInputParameterivNV = (C.GPGETCOMBINERINPUTPARAMETERIVNV)(getProcAddr(\"glGetCombinerInputParameterivNV\"))\n\tgpGetCombinerOutputParameterfvNV = (C.GPGETCOMBINEROUTPUTPARAMETERFVNV)(getProcAddr(\"glGetCombinerOutputParameterfvNV\"))\n\tgpGetCombinerOutputParameterivNV = (C.GPGETCOMBINEROUTPUTPARAMETERIVNV)(getProcAddr(\"glGetCombinerOutputParameterivNV\"))\n\tgpGetCombinerStageParameterfvNV = (C.GPGETCOMBINERSTAGEPARAMETERFVNV)(getProcAddr(\"glGetCombinerStageParameterfvNV\"))\n\tgpGetCommandHeaderNV = (C.GPGETCOMMANDHEADERNV)(getProcAddr(\"glGetCommandHeaderNV\"))\n\tgpGetCompressedMultiTexImageEXT = (C.GPGETCOMPRESSEDMULTITEXIMAGEEXT)(getProcAddr(\"glGetCompressedMultiTexImageEXT\"))\n\tgpGetCompressedTexImage = (C.GPGETCOMPRESSEDTEXIMAGE)(getProcAddr(\"glGetCompressedTexImage\"))\n\tif gpGetCompressedTexImage == nil {\n\t\treturn errors.New(\"glGetCompressedTexImage\")\n\t}\n\tgpGetCompressedTexImageARB = (C.GPGETCOMPRESSEDTEXIMAGEARB)(getProcAddr(\"glGetCompressedTexImageARB\"))\n\tgpGetCompressedTextureImage = (C.GPGETCOMPRESSEDTEXTUREIMAGE)(getProcAddr(\"glGetCompressedTextureImage\"))\n\tgpGetCompressedTextureImageEXT = (C.GPGETCOMPRESSEDTEXTUREIMAGEEXT)(getProcAddr(\"glGetCompressedTextureImageEXT\"))\n\tgpGetCompressedTextureSubImage = (C.GPGETCOMPRESSEDTEXTURESUBIMAGE)(getProcAddr(\"glGetCompressedTextureSubImage\"))\n\tgpGetConvolutionFilter = (C.GPGETCONVOLUTIONFILTER)(getProcAddr(\"glGetConvolutionFilter\"))\n\tgpGetConvolutionFilterEXT = (C.GPGETCONVOLUTIONFILTEREXT)(getProcAddr(\"glGetConvolutionFilterEXT\"))\n\tgpGetConvolutionParameterfv = (C.GPGETCONVOLUTIONPARAMETERFV)(getProcAddr(\"glGetConvolutionParameterfv\"))\n\tgpGetConvolutionParameterfvEXT = (C.GPGETCONVOLUTIONPARAMETERFVEXT)(getProcAddr(\"glGetConvolutionParameterfvEXT\"))\n\tgpGetConvolutionParameteriv = (C.GPGETCONVOLUTIONPARAMETERIV)(getProcAddr(\"glGetConvolutionParameteriv\"))\n\tgpGetConvolutionParameterivEXT = (C.GPGETCONVOLUTIONPARAMETERIVEXT)(getProcAddr(\"glGetConvolutionParameterivEXT\"))\n\tgpGetConvolutionParameterxvOES = (C.GPGETCONVOLUTIONPARAMETERXVOES)(getProcAddr(\"glGetConvolutionParameterxvOES\"))\n\tgpGetCoverageModulationTableNV = (C.GPGETCOVERAGEMODULATIONTABLENV)(getProcAddr(\"glGetCoverageModulationTableNV\"))\n\tgpGetDebugMessageLog = (C.GPGETDEBUGMESSAGELOG)(getProcAddr(\"glGetDebugMessageLog\"))\n\tif gpGetDebugMessageLog == nil {\n\t\treturn errors.New(\"glGetDebugMessageLog\")\n\t}\n\tgpGetDebugMessageLogAMD = (C.GPGETDEBUGMESSAGELOGAMD)(getProcAddr(\"glGetDebugMessageLogAMD\"))\n\tgpGetDebugMessageLogARB = (C.GPGETDEBUGMESSAGELOGARB)(getProcAddr(\"glGetDebugMessageLogARB\"))\n\tgpGetDebugMessageLogKHR = (C.GPGETDEBUGMESSAGELOGKHR)(getProcAddr(\"glGetDebugMessageLogKHR\"))\n\tgpGetDetailTexFuncSGIS = (C.GPGETDETAILTEXFUNCSGIS)(getProcAddr(\"glGetDetailTexFuncSGIS\"))\n\tgpGetDoubleIndexedvEXT = (C.GPGETDOUBLEINDEXEDVEXT)(getProcAddr(\"glGetDoubleIndexedvEXT\"))\n\tgpGetDoublei_v = (C.GPGETDOUBLEI_V)(getProcAddr(\"glGetDoublei_v\"))\n\tif gpGetDoublei_v == nil {\n\t\treturn errors.New(\"glGetDoublei_v\")\n\t}\n\tgpGetDoublei_vEXT = (C.GPGETDOUBLEI_VEXT)(getProcAddr(\"glGetDoublei_vEXT\"))\n\tgpGetDoublev = (C.GPGETDOUBLEV)(getProcAddr(\"glGetDoublev\"))\n\tif gpGetDoublev == nil {\n\t\treturn errors.New(\"glGetDoublev\")\n\t}\n\tgpGetError = (C.GPGETERROR)(getProcAddr(\"glGetError\"))\n\tif gpGetError == nil {\n\t\treturn errors.New(\"glGetError\")\n\t}\n\tgpGetFenceivNV = (C.GPGETFENCEIVNV)(getProcAddr(\"glGetFenceivNV\"))\n\tgpGetFinalCombinerInputParameterfvNV = (C.GPGETFINALCOMBINERINPUTPARAMETERFVNV)(getProcAddr(\"glGetFinalCombinerInputParameterfvNV\"))\n\tgpGetFinalCombinerInputParameterivNV = (C.GPGETFINALCOMBINERINPUTPARAMETERIVNV)(getProcAddr(\"glGetFinalCombinerInputParameterivNV\"))\n\tgpGetFirstPerfQueryIdINTEL = (C.GPGETFIRSTPERFQUERYIDINTEL)(getProcAddr(\"glGetFirstPerfQueryIdINTEL\"))\n\tgpGetFixedvOES = (C.GPGETFIXEDVOES)(getProcAddr(\"glGetFixedvOES\"))\n\tgpGetFloatIndexedvEXT = (C.GPGETFLOATINDEXEDVEXT)(getProcAddr(\"glGetFloatIndexedvEXT\"))\n\tgpGetFloati_v = (C.GPGETFLOATI_V)(getProcAddr(\"glGetFloati_v\"))\n\tif gpGetFloati_v == nil {\n\t\treturn errors.New(\"glGetFloati_v\")\n\t}\n\tgpGetFloati_vEXT = (C.GPGETFLOATI_VEXT)(getProcAddr(\"glGetFloati_vEXT\"))\n\tgpGetFloatv = (C.GPGETFLOATV)(getProcAddr(\"glGetFloatv\"))\n\tif gpGetFloatv == nil {\n\t\treturn errors.New(\"glGetFloatv\")\n\t}\n\tgpGetFogFuncSGIS = (C.GPGETFOGFUNCSGIS)(getProcAddr(\"glGetFogFuncSGIS\"))\n\tgpGetFragDataIndex = (C.GPGETFRAGDATAINDEX)(getProcAddr(\"glGetFragDataIndex\"))\n\tif gpGetFragDataIndex == nil {\n\t\treturn errors.New(\"glGetFragDataIndex\")\n\t}\n\tgpGetFragDataLocation = (C.GPGETFRAGDATALOCATION)(getProcAddr(\"glGetFragDataLocation\"))\n\tif gpGetFragDataLocation == nil {\n\t\treturn errors.New(\"glGetFragDataLocation\")\n\t}\n\tgpGetFragDataLocationEXT = (C.GPGETFRAGDATALOCATIONEXT)(getProcAddr(\"glGetFragDataLocationEXT\"))\n\tgpGetFragmentLightfvSGIX = (C.GPGETFRAGMENTLIGHTFVSGIX)(getProcAddr(\"glGetFragmentLightfvSGIX\"))\n\tgpGetFragmentLightivSGIX = (C.GPGETFRAGMENTLIGHTIVSGIX)(getProcAddr(\"glGetFragmentLightivSGIX\"))\n\tgpGetFragmentMaterialfvSGIX = (C.GPGETFRAGMENTMATERIALFVSGIX)(getProcAddr(\"glGetFragmentMaterialfvSGIX\"))\n\tgpGetFragmentMaterialivSGIX = (C.GPGETFRAGMENTMATERIALIVSGIX)(getProcAddr(\"glGetFragmentMaterialivSGIX\"))\n\tgpGetFramebufferAttachmentParameteriv = (C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr(\"glGetFramebufferAttachmentParameteriv\"))\n\tif gpGetFramebufferAttachmentParameteriv == nil {\n\t\treturn errors.New(\"glGetFramebufferAttachmentParameteriv\")\n\t}\n\tgpGetFramebufferAttachmentParameterivEXT = (C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIVEXT)(getProcAddr(\"glGetFramebufferAttachmentParameterivEXT\"))\n\tgpGetFramebufferParameterfvAMD = (C.GPGETFRAMEBUFFERPARAMETERFVAMD)(getProcAddr(\"glGetFramebufferParameterfvAMD\"))\n\tgpGetFramebufferParameteriv = (C.GPGETFRAMEBUFFERPARAMETERIV)(getProcAddr(\"glGetFramebufferParameteriv\"))\n\tif gpGetFramebufferParameteriv == nil {\n\t\treturn errors.New(\"glGetFramebufferParameteriv\")\n\t}\n\tgpGetFramebufferParameterivEXT = (C.GPGETFRAMEBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetFramebufferParameterivEXT\"))\n\tgpGetFramebufferParameterivMESA = (C.GPGETFRAMEBUFFERPARAMETERIVMESA)(getProcAddr(\"glGetFramebufferParameterivMESA\"))\n\tgpGetGraphicsResetStatus = (C.GPGETGRAPHICSRESETSTATUS)(getProcAddr(\"glGetGraphicsResetStatus\"))\n\tgpGetGraphicsResetStatusARB = (C.GPGETGRAPHICSRESETSTATUSARB)(getProcAddr(\"glGetGraphicsResetStatusARB\"))\n\tgpGetGraphicsResetStatusKHR = (C.GPGETGRAPHICSRESETSTATUSKHR)(getProcAddr(\"glGetGraphicsResetStatusKHR\"))\n\tgpGetHandleARB = (C.GPGETHANDLEARB)(getProcAddr(\"glGetHandleARB\"))\n\tgpGetHistogram = (C.GPGETHISTOGRAM)(getProcAddr(\"glGetHistogram\"))\n\tgpGetHistogramEXT = (C.GPGETHISTOGRAMEXT)(getProcAddr(\"glGetHistogramEXT\"))\n\tgpGetHistogramParameterfv = (C.GPGETHISTOGRAMPARAMETERFV)(getProcAddr(\"glGetHistogramParameterfv\"))\n\tgpGetHistogramParameterfvEXT = (C.GPGETHISTOGRAMPARAMETERFVEXT)(getProcAddr(\"glGetHistogramParameterfvEXT\"))\n\tgpGetHistogramParameteriv = (C.GPGETHISTOGRAMPARAMETERIV)(getProcAddr(\"glGetHistogramParameteriv\"))\n\tgpGetHistogramParameterivEXT = (C.GPGETHISTOGRAMPARAMETERIVEXT)(getProcAddr(\"glGetHistogramParameterivEXT\"))\n\tgpGetHistogramParameterxvOES = (C.GPGETHISTOGRAMPARAMETERXVOES)(getProcAddr(\"glGetHistogramParameterxvOES\"))\n\tgpGetImageHandleARB = (C.GPGETIMAGEHANDLEARB)(getProcAddr(\"glGetImageHandleARB\"))\n\tgpGetImageHandleNV = (C.GPGETIMAGEHANDLENV)(getProcAddr(\"glGetImageHandleNV\"))\n\tgpGetImageTransformParameterfvHP = (C.GPGETIMAGETRANSFORMPARAMETERFVHP)(getProcAddr(\"glGetImageTransformParameterfvHP\"))\n\tgpGetImageTransformParameterivHP = (C.GPGETIMAGETRANSFORMPARAMETERIVHP)(getProcAddr(\"glGetImageTransformParameterivHP\"))\n\tgpGetInfoLogARB = (C.GPGETINFOLOGARB)(getProcAddr(\"glGetInfoLogARB\"))\n\tgpGetInstrumentsSGIX = (C.GPGETINSTRUMENTSSGIX)(getProcAddr(\"glGetInstrumentsSGIX\"))\n\tgpGetInteger64i_v = (C.GPGETINTEGER64I_V)(getProcAddr(\"glGetInteger64i_v\"))\n\tif gpGetInteger64i_v == nil {\n\t\treturn errors.New(\"glGetInteger64i_v\")\n\t}\n\tgpGetInteger64v = (C.GPGETINTEGER64V)(getProcAddr(\"glGetInteger64v\"))\n\tif gpGetInteger64v == nil {\n\t\treturn errors.New(\"glGetInteger64v\")\n\t}\n\tgpGetIntegerIndexedvEXT = (C.GPGETINTEGERINDEXEDVEXT)(getProcAddr(\"glGetIntegerIndexedvEXT\"))\n\tgpGetIntegeri_v = (C.GPGETINTEGERI_V)(getProcAddr(\"glGetIntegeri_v\"))\n\tif gpGetIntegeri_v == nil {\n\t\treturn errors.New(\"glGetIntegeri_v\")\n\t}\n\tgpGetIntegerui64i_vNV = (C.GPGETINTEGERUI64I_VNV)(getProcAddr(\"glGetIntegerui64i_vNV\"))\n\tgpGetIntegerui64vNV = (C.GPGETINTEGERUI64VNV)(getProcAddr(\"glGetIntegerui64vNV\"))\n\tgpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr(\"glGetIntegerv\"))\n\tif gpGetIntegerv == nil {\n\t\treturn errors.New(\"glGetIntegerv\")\n\t}\n\tgpGetInternalformatSampleivNV = (C.GPGETINTERNALFORMATSAMPLEIVNV)(getProcAddr(\"glGetInternalformatSampleivNV\"))\n\tgpGetInternalformati64v = (C.GPGETINTERNALFORMATI64V)(getProcAddr(\"glGetInternalformati64v\"))\n\tif gpGetInternalformati64v == nil {\n\t\treturn errors.New(\"glGetInternalformati64v\")\n\t}\n\tgpGetInternalformativ = (C.GPGETINTERNALFORMATIV)(getProcAddr(\"glGetInternalformativ\"))\n\tif gpGetInternalformativ == nil {\n\t\treturn errors.New(\"glGetInternalformativ\")\n\t}\n\tgpGetInvariantBooleanvEXT = (C.GPGETINVARIANTBOOLEANVEXT)(getProcAddr(\"glGetInvariantBooleanvEXT\"))\n\tgpGetInvariantFloatvEXT = (C.GPGETINVARIANTFLOATVEXT)(getProcAddr(\"glGetInvariantFloatvEXT\"))\n\tgpGetInvariantIntegervEXT = (C.GPGETINVARIANTINTEGERVEXT)(getProcAddr(\"glGetInvariantIntegervEXT\"))\n\tgpGetLightfv = (C.GPGETLIGHTFV)(getProcAddr(\"glGetLightfv\"))\n\tif gpGetLightfv == nil {\n\t\treturn errors.New(\"glGetLightfv\")\n\t}\n\tgpGetLightiv = (C.GPGETLIGHTIV)(getProcAddr(\"glGetLightiv\"))\n\tif gpGetLightiv == nil {\n\t\treturn errors.New(\"glGetLightiv\")\n\t}\n\tgpGetLightxOES = (C.GPGETLIGHTXOES)(getProcAddr(\"glGetLightxOES\"))\n\tgpGetLightxvOES = (C.GPGETLIGHTXVOES)(getProcAddr(\"glGetLightxvOES\"))\n\tgpGetListParameterfvSGIX = (C.GPGETLISTPARAMETERFVSGIX)(getProcAddr(\"glGetListParameterfvSGIX\"))\n\tgpGetListParameterivSGIX = (C.GPGETLISTPARAMETERIVSGIX)(getProcAddr(\"glGetListParameterivSGIX\"))\n\tgpGetLocalConstantBooleanvEXT = (C.GPGETLOCALCONSTANTBOOLEANVEXT)(getProcAddr(\"glGetLocalConstantBooleanvEXT\"))\n\tgpGetLocalConstantFloatvEXT = (C.GPGETLOCALCONSTANTFLOATVEXT)(getProcAddr(\"glGetLocalConstantFloatvEXT\"))\n\tgpGetLocalConstantIntegervEXT = (C.GPGETLOCALCONSTANTINTEGERVEXT)(getProcAddr(\"glGetLocalConstantIntegervEXT\"))\n\tgpGetMapAttribParameterfvNV = (C.GPGETMAPATTRIBPARAMETERFVNV)(getProcAddr(\"glGetMapAttribParameterfvNV\"))\n\tgpGetMapAttribParameterivNV = (C.GPGETMAPATTRIBPARAMETERIVNV)(getProcAddr(\"glGetMapAttribParameterivNV\"))\n\tgpGetMapControlPointsNV = (C.GPGETMAPCONTROLPOINTSNV)(getProcAddr(\"glGetMapControlPointsNV\"))\n\tgpGetMapParameterfvNV = (C.GPGETMAPPARAMETERFVNV)(getProcAddr(\"glGetMapParameterfvNV\"))\n\tgpGetMapParameterivNV = (C.GPGETMAPPARAMETERIVNV)(getProcAddr(\"glGetMapParameterivNV\"))\n\tgpGetMapdv = (C.GPGETMAPDV)(getProcAddr(\"glGetMapdv\"))\n\tif gpGetMapdv == nil {\n\t\treturn errors.New(\"glGetMapdv\")\n\t}\n\tgpGetMapfv = (C.GPGETMAPFV)(getProcAddr(\"glGetMapfv\"))\n\tif gpGetMapfv == nil {\n\t\treturn errors.New(\"glGetMapfv\")\n\t}\n\tgpGetMapiv = (C.GPGETMAPIV)(getProcAddr(\"glGetMapiv\"))\n\tif gpGetMapiv == nil {\n\t\treturn errors.New(\"glGetMapiv\")\n\t}\n\tgpGetMapxvOES = (C.GPGETMAPXVOES)(getProcAddr(\"glGetMapxvOES\"))\n\tgpGetMaterialfv = (C.GPGETMATERIALFV)(getProcAddr(\"glGetMaterialfv\"))\n\tif gpGetMaterialfv == nil {\n\t\treturn errors.New(\"glGetMaterialfv\")\n\t}\n\tgpGetMaterialiv = (C.GPGETMATERIALIV)(getProcAddr(\"glGetMaterialiv\"))\n\tif gpGetMaterialiv == nil {\n\t\treturn errors.New(\"glGetMaterialiv\")\n\t}\n\tgpGetMaterialxOES = (C.GPGETMATERIALXOES)(getProcAddr(\"glGetMaterialxOES\"))\n\tgpGetMaterialxvOES = (C.GPGETMATERIALXVOES)(getProcAddr(\"glGetMaterialxvOES\"))\n\tgpGetMemoryObjectDetachedResourcesuivNV = (C.GPGETMEMORYOBJECTDETACHEDRESOURCESUIVNV)(getProcAddr(\"glGetMemoryObjectDetachedResourcesuivNV\"))\n\tgpGetMemoryObjectParameterivEXT = (C.GPGETMEMORYOBJECTPARAMETERIVEXT)(getProcAddr(\"glGetMemoryObjectParameterivEXT\"))\n\tgpGetMinmax = (C.GPGETMINMAX)(getProcAddr(\"glGetMinmax\"))\n\tgpGetMinmaxEXT = (C.GPGETMINMAXEXT)(getProcAddr(\"glGetMinmaxEXT\"))\n\tgpGetMinmaxParameterfv = (C.GPGETMINMAXPARAMETERFV)(getProcAddr(\"glGetMinmaxParameterfv\"))\n\tgpGetMinmaxParameterfvEXT = (C.GPGETMINMAXPARAMETERFVEXT)(getProcAddr(\"glGetMinmaxParameterfvEXT\"))\n\tgpGetMinmaxParameteriv = (C.GPGETMINMAXPARAMETERIV)(getProcAddr(\"glGetMinmaxParameteriv\"))\n\tgpGetMinmaxParameterivEXT = (C.GPGETMINMAXPARAMETERIVEXT)(getProcAddr(\"glGetMinmaxParameterivEXT\"))\n\tgpGetMultiTexEnvfvEXT = (C.GPGETMULTITEXENVFVEXT)(getProcAddr(\"glGetMultiTexEnvfvEXT\"))\n\tgpGetMultiTexEnvivEXT = (C.GPGETMULTITEXENVIVEXT)(getProcAddr(\"glGetMultiTexEnvivEXT\"))\n\tgpGetMultiTexGendvEXT = (C.GPGETMULTITEXGENDVEXT)(getProcAddr(\"glGetMultiTexGendvEXT\"))\n\tgpGetMultiTexGenfvEXT = (C.GPGETMULTITEXGENFVEXT)(getProcAddr(\"glGetMultiTexGenfvEXT\"))\n\tgpGetMultiTexGenivEXT = (C.GPGETMULTITEXGENIVEXT)(getProcAddr(\"glGetMultiTexGenivEXT\"))\n\tgpGetMultiTexImageEXT = (C.GPGETMULTITEXIMAGEEXT)(getProcAddr(\"glGetMultiTexImageEXT\"))\n\tgpGetMultiTexLevelParameterfvEXT = (C.GPGETMULTITEXLEVELPARAMETERFVEXT)(getProcAddr(\"glGetMultiTexLevelParameterfvEXT\"))\n\tgpGetMultiTexLevelParameterivEXT = (C.GPGETMULTITEXLEVELPARAMETERIVEXT)(getProcAddr(\"glGetMultiTexLevelParameterivEXT\"))\n\tgpGetMultiTexParameterIivEXT = (C.GPGETMULTITEXPARAMETERIIVEXT)(getProcAddr(\"glGetMultiTexParameterIivEXT\"))\n\tgpGetMultiTexParameterIuivEXT = (C.GPGETMULTITEXPARAMETERIUIVEXT)(getProcAddr(\"glGetMultiTexParameterIuivEXT\"))\n\tgpGetMultiTexParameterfvEXT = (C.GPGETMULTITEXPARAMETERFVEXT)(getProcAddr(\"glGetMultiTexParameterfvEXT\"))\n\tgpGetMultiTexParameterivEXT = (C.GPGETMULTITEXPARAMETERIVEXT)(getProcAddr(\"glGetMultiTexParameterivEXT\"))\n\tgpGetMultisamplefv = (C.GPGETMULTISAMPLEFV)(getProcAddr(\"glGetMultisamplefv\"))\n\tif gpGetMultisamplefv == nil {\n\t\treturn errors.New(\"glGetMultisamplefv\")\n\t}\n\tgpGetMultisamplefvNV = (C.GPGETMULTISAMPLEFVNV)(getProcAddr(\"glGetMultisamplefvNV\"))\n\tgpGetNamedBufferParameteri64v = (C.GPGETNAMEDBUFFERPARAMETERI64V)(getProcAddr(\"glGetNamedBufferParameteri64v\"))\n\tgpGetNamedBufferParameteriv = (C.GPGETNAMEDBUFFERPARAMETERIV)(getProcAddr(\"glGetNamedBufferParameteriv\"))\n\tgpGetNamedBufferParameterivEXT = (C.GPGETNAMEDBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetNamedBufferParameterivEXT\"))\n\tgpGetNamedBufferParameterui64vNV = (C.GPGETNAMEDBUFFERPARAMETERUI64VNV)(getProcAddr(\"glGetNamedBufferParameterui64vNV\"))\n\tgpGetNamedBufferPointerv = (C.GPGETNAMEDBUFFERPOINTERV)(getProcAddr(\"glGetNamedBufferPointerv\"))\n\tgpGetNamedBufferPointervEXT = (C.GPGETNAMEDBUFFERPOINTERVEXT)(getProcAddr(\"glGetNamedBufferPointervEXT\"))\n\tgpGetNamedBufferSubData = (C.GPGETNAMEDBUFFERSUBDATA)(getProcAddr(\"glGetNamedBufferSubData\"))\n\tgpGetNamedBufferSubDataEXT = (C.GPGETNAMEDBUFFERSUBDATAEXT)(getProcAddr(\"glGetNamedBufferSubDataEXT\"))\n\tgpGetNamedFramebufferAttachmentParameteriv = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr(\"glGetNamedFramebufferAttachmentParameteriv\"))\n\tgpGetNamedFramebufferAttachmentParameterivEXT = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXT)(getProcAddr(\"glGetNamedFramebufferAttachmentParameterivEXT\"))\n\tgpGetNamedFramebufferParameterfvAMD = (C.GPGETNAMEDFRAMEBUFFERPARAMETERFVAMD)(getProcAddr(\"glGetNamedFramebufferParameterfvAMD\"))\n\tgpGetNamedFramebufferParameteriv = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIV)(getProcAddr(\"glGetNamedFramebufferParameteriv\"))\n\tgpGetNamedFramebufferParameterivEXT = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetNamedFramebufferParameterivEXT\"))\n\tgpGetNamedProgramLocalParameterIivEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERIIVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterIivEXT\"))\n\tgpGetNamedProgramLocalParameterIuivEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERIUIVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterIuivEXT\"))\n\tgpGetNamedProgramLocalParameterdvEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERDVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterdvEXT\"))\n\tgpGetNamedProgramLocalParameterfvEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERFVEXT)(getProcAddr(\"glGetNamedProgramLocalParameterfvEXT\"))\n\tgpGetNamedProgramStringEXT = (C.GPGETNAMEDPROGRAMSTRINGEXT)(getProcAddr(\"glGetNamedProgramStringEXT\"))\n\tgpGetNamedProgramivEXT = (C.GPGETNAMEDPROGRAMIVEXT)(getProcAddr(\"glGetNamedProgramivEXT\"))\n\tgpGetNamedRenderbufferParameteriv = (C.GPGETNAMEDRENDERBUFFERPARAMETERIV)(getProcAddr(\"glGetNamedRenderbufferParameteriv\"))\n\tgpGetNamedRenderbufferParameterivEXT = (C.GPGETNAMEDRENDERBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetNamedRenderbufferParameterivEXT\"))\n\tgpGetNamedStringARB = (C.GPGETNAMEDSTRINGARB)(getProcAddr(\"glGetNamedStringARB\"))\n\tgpGetNamedStringivARB = (C.GPGETNAMEDSTRINGIVARB)(getProcAddr(\"glGetNamedStringivARB\"))\n\tgpGetNextPerfQueryIdINTEL = (C.GPGETNEXTPERFQUERYIDINTEL)(getProcAddr(\"glGetNextPerfQueryIdINTEL\"))\n\tgpGetObjectBufferfvATI = (C.GPGETOBJECTBUFFERFVATI)(getProcAddr(\"glGetObjectBufferfvATI\"))\n\tgpGetObjectBufferivATI = (C.GPGETOBJECTBUFFERIVATI)(getProcAddr(\"glGetObjectBufferivATI\"))\n\tgpGetObjectLabel = (C.GPGETOBJECTLABEL)(getProcAddr(\"glGetObjectLabel\"))\n\tif gpGetObjectLabel == nil {\n\t\treturn errors.New(\"glGetObjectLabel\")\n\t}\n\tgpGetObjectLabelEXT = (C.GPGETOBJECTLABELEXT)(getProcAddr(\"glGetObjectLabelEXT\"))\n\tgpGetObjectLabelKHR = (C.GPGETOBJECTLABELKHR)(getProcAddr(\"glGetObjectLabelKHR\"))\n\tgpGetObjectParameterfvARB = (C.GPGETOBJECTPARAMETERFVARB)(getProcAddr(\"glGetObjectParameterfvARB\"))\n\tgpGetObjectParameterivAPPLE = (C.GPGETOBJECTPARAMETERIVAPPLE)(getProcAddr(\"glGetObjectParameterivAPPLE\"))\n\tgpGetObjectParameterivARB = (C.GPGETOBJECTPARAMETERIVARB)(getProcAddr(\"glGetObjectParameterivARB\"))\n\tgpGetObjectPtrLabel = (C.GPGETOBJECTPTRLABEL)(getProcAddr(\"glGetObjectPtrLabel\"))\n\tif gpGetObjectPtrLabel == nil {\n\t\treturn errors.New(\"glGetObjectPtrLabel\")\n\t}\n\tgpGetObjectPtrLabelKHR = (C.GPGETOBJECTPTRLABELKHR)(getProcAddr(\"glGetObjectPtrLabelKHR\"))\n\tgpGetOcclusionQueryivNV = (C.GPGETOCCLUSIONQUERYIVNV)(getProcAddr(\"glGetOcclusionQueryivNV\"))\n\tgpGetOcclusionQueryuivNV = (C.GPGETOCCLUSIONQUERYUIVNV)(getProcAddr(\"glGetOcclusionQueryuivNV\"))\n\tgpGetPathColorGenfvNV = (C.GPGETPATHCOLORGENFVNV)(getProcAddr(\"glGetPathColorGenfvNV\"))\n\tgpGetPathColorGenivNV = (C.GPGETPATHCOLORGENIVNV)(getProcAddr(\"glGetPathColorGenivNV\"))\n\tgpGetPathCommandsNV = (C.GPGETPATHCOMMANDSNV)(getProcAddr(\"glGetPathCommandsNV\"))\n\tgpGetPathCoordsNV = (C.GPGETPATHCOORDSNV)(getProcAddr(\"glGetPathCoordsNV\"))\n\tgpGetPathDashArrayNV = (C.GPGETPATHDASHARRAYNV)(getProcAddr(\"glGetPathDashArrayNV\"))\n\tgpGetPathLengthNV = (C.GPGETPATHLENGTHNV)(getProcAddr(\"glGetPathLengthNV\"))\n\tgpGetPathMetricRangeNV = (C.GPGETPATHMETRICRANGENV)(getProcAddr(\"glGetPathMetricRangeNV\"))\n\tgpGetPathMetricsNV = (C.GPGETPATHMETRICSNV)(getProcAddr(\"glGetPathMetricsNV\"))\n\tgpGetPathParameterfvNV = (C.GPGETPATHPARAMETERFVNV)(getProcAddr(\"glGetPathParameterfvNV\"))\n\tgpGetPathParameterivNV = (C.GPGETPATHPARAMETERIVNV)(getProcAddr(\"glGetPathParameterivNV\"))\n\tgpGetPathSpacingNV = (C.GPGETPATHSPACINGNV)(getProcAddr(\"glGetPathSpacingNV\"))\n\tgpGetPathTexGenfvNV = (C.GPGETPATHTEXGENFVNV)(getProcAddr(\"glGetPathTexGenfvNV\"))\n\tgpGetPathTexGenivNV = (C.GPGETPATHTEXGENIVNV)(getProcAddr(\"glGetPathTexGenivNV\"))\n\tgpGetPerfCounterInfoINTEL = (C.GPGETPERFCOUNTERINFOINTEL)(getProcAddr(\"glGetPerfCounterInfoINTEL\"))\n\tgpGetPerfMonitorCounterDataAMD = (C.GPGETPERFMONITORCOUNTERDATAAMD)(getProcAddr(\"glGetPerfMonitorCounterDataAMD\"))\n\tgpGetPerfMonitorCounterInfoAMD = (C.GPGETPERFMONITORCOUNTERINFOAMD)(getProcAddr(\"glGetPerfMonitorCounterInfoAMD\"))\n\tgpGetPerfMonitorCounterStringAMD = (C.GPGETPERFMONITORCOUNTERSTRINGAMD)(getProcAddr(\"glGetPerfMonitorCounterStringAMD\"))\n\tgpGetPerfMonitorCountersAMD = (C.GPGETPERFMONITORCOUNTERSAMD)(getProcAddr(\"glGetPerfMonitorCountersAMD\"))\n\tgpGetPerfMonitorGroupStringAMD = (C.GPGETPERFMONITORGROUPSTRINGAMD)(getProcAddr(\"glGetPerfMonitorGroupStringAMD\"))\n\tgpGetPerfMonitorGroupsAMD = (C.GPGETPERFMONITORGROUPSAMD)(getProcAddr(\"glGetPerfMonitorGroupsAMD\"))\n\tgpGetPerfQueryDataINTEL = (C.GPGETPERFQUERYDATAINTEL)(getProcAddr(\"glGetPerfQueryDataINTEL\"))\n\tgpGetPerfQueryIdByNameINTEL = (C.GPGETPERFQUERYIDBYNAMEINTEL)(getProcAddr(\"glGetPerfQueryIdByNameINTEL\"))\n\tgpGetPerfQueryInfoINTEL = (C.GPGETPERFQUERYINFOINTEL)(getProcAddr(\"glGetPerfQueryInfoINTEL\"))\n\tgpGetPixelMapfv = (C.GPGETPIXELMAPFV)(getProcAddr(\"glGetPixelMapfv\"))\n\tif gpGetPixelMapfv == nil {\n\t\treturn errors.New(\"glGetPixelMapfv\")\n\t}\n\tgpGetPixelMapuiv = (C.GPGETPIXELMAPUIV)(getProcAddr(\"glGetPixelMapuiv\"))\n\tif gpGetPixelMapuiv == nil {\n\t\treturn errors.New(\"glGetPixelMapuiv\")\n\t}\n\tgpGetPixelMapusv = (C.GPGETPIXELMAPUSV)(getProcAddr(\"glGetPixelMapusv\"))\n\tif gpGetPixelMapusv == nil {\n\t\treturn errors.New(\"glGetPixelMapusv\")\n\t}\n\tgpGetPixelMapxv = (C.GPGETPIXELMAPXV)(getProcAddr(\"glGetPixelMapxv\"))\n\tgpGetPixelTexGenParameterfvSGIS = (C.GPGETPIXELTEXGENPARAMETERFVSGIS)(getProcAddr(\"glGetPixelTexGenParameterfvSGIS\"))\n\tgpGetPixelTexGenParameterivSGIS = (C.GPGETPIXELTEXGENPARAMETERIVSGIS)(getProcAddr(\"glGetPixelTexGenParameterivSGIS\"))\n\tgpGetPixelTransformParameterfvEXT = (C.GPGETPIXELTRANSFORMPARAMETERFVEXT)(getProcAddr(\"glGetPixelTransformParameterfvEXT\"))\n\tgpGetPixelTransformParameterivEXT = (C.GPGETPIXELTRANSFORMPARAMETERIVEXT)(getProcAddr(\"glGetPixelTransformParameterivEXT\"))\n\tgpGetPointerIndexedvEXT = (C.GPGETPOINTERINDEXEDVEXT)(getProcAddr(\"glGetPointerIndexedvEXT\"))\n\tgpGetPointeri_vEXT = (C.GPGETPOINTERI_VEXT)(getProcAddr(\"glGetPointeri_vEXT\"))\n\tgpGetPointerv = (C.GPGETPOINTERV)(getProcAddr(\"glGetPointerv\"))\n\tif gpGetPointerv == nil {\n\t\treturn errors.New(\"glGetPointerv\")\n\t}\n\tgpGetPointervEXT = (C.GPGETPOINTERVEXT)(getProcAddr(\"glGetPointervEXT\"))\n\tgpGetPointervKHR = (C.GPGETPOINTERVKHR)(getProcAddr(\"glGetPointervKHR\"))\n\tgpGetPolygonStipple = (C.GPGETPOLYGONSTIPPLE)(getProcAddr(\"glGetPolygonStipple\"))\n\tif gpGetPolygonStipple == nil {\n\t\treturn errors.New(\"glGetPolygonStipple\")\n\t}\n\tgpGetProgramBinary = (C.GPGETPROGRAMBINARY)(getProcAddr(\"glGetProgramBinary\"))\n\tif gpGetProgramBinary == nil {\n\t\treturn errors.New(\"glGetProgramBinary\")\n\t}\n\tgpGetProgramEnvParameterIivNV = (C.GPGETPROGRAMENVPARAMETERIIVNV)(getProcAddr(\"glGetProgramEnvParameterIivNV\"))\n\tgpGetProgramEnvParameterIuivNV = (C.GPGETPROGRAMENVPARAMETERIUIVNV)(getProcAddr(\"glGetProgramEnvParameterIuivNV\"))\n\tgpGetProgramEnvParameterdvARB = (C.GPGETPROGRAMENVPARAMETERDVARB)(getProcAddr(\"glGetProgramEnvParameterdvARB\"))\n\tgpGetProgramEnvParameterfvARB = (C.GPGETPROGRAMENVPARAMETERFVARB)(getProcAddr(\"glGetProgramEnvParameterfvARB\"))\n\tgpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr(\"glGetProgramInfoLog\"))\n\tif gpGetProgramInfoLog == nil {\n\t\treturn errors.New(\"glGetProgramInfoLog\")\n\t}\n\tgpGetProgramInterfaceiv = (C.GPGETPROGRAMINTERFACEIV)(getProcAddr(\"glGetProgramInterfaceiv\"))\n\tif gpGetProgramInterfaceiv == nil {\n\t\treturn errors.New(\"glGetProgramInterfaceiv\")\n\t}\n\tgpGetProgramLocalParameterIivNV = (C.GPGETPROGRAMLOCALPARAMETERIIVNV)(getProcAddr(\"glGetProgramLocalParameterIivNV\"))\n\tgpGetProgramLocalParameterIuivNV = (C.GPGETPROGRAMLOCALPARAMETERIUIVNV)(getProcAddr(\"glGetProgramLocalParameterIuivNV\"))\n\tgpGetProgramLocalParameterdvARB = (C.GPGETPROGRAMLOCALPARAMETERDVARB)(getProcAddr(\"glGetProgramLocalParameterdvARB\"))\n\tgpGetProgramLocalParameterfvARB = (C.GPGETPROGRAMLOCALPARAMETERFVARB)(getProcAddr(\"glGetProgramLocalParameterfvARB\"))\n\tgpGetProgramNamedParameterdvNV = (C.GPGETPROGRAMNAMEDPARAMETERDVNV)(getProcAddr(\"glGetProgramNamedParameterdvNV\"))\n\tgpGetProgramNamedParameterfvNV = (C.GPGETPROGRAMNAMEDPARAMETERFVNV)(getProcAddr(\"glGetProgramNamedParameterfvNV\"))\n\tgpGetProgramParameterdvNV = (C.GPGETPROGRAMPARAMETERDVNV)(getProcAddr(\"glGetProgramParameterdvNV\"))\n\tgpGetProgramParameterfvNV = (C.GPGETPROGRAMPARAMETERFVNV)(getProcAddr(\"glGetProgramParameterfvNV\"))\n\tgpGetProgramPipelineInfoLog = (C.GPGETPROGRAMPIPELINEINFOLOG)(getProcAddr(\"glGetProgramPipelineInfoLog\"))\n\tif gpGetProgramPipelineInfoLog == nil {\n\t\treturn errors.New(\"glGetProgramPipelineInfoLog\")\n\t}\n\tgpGetProgramPipelineInfoLogEXT = (C.GPGETPROGRAMPIPELINEINFOLOGEXT)(getProcAddr(\"glGetProgramPipelineInfoLogEXT\"))\n\tgpGetProgramPipelineiv = (C.GPGETPROGRAMPIPELINEIV)(getProcAddr(\"glGetProgramPipelineiv\"))\n\tif gpGetProgramPipelineiv == nil {\n\t\treturn errors.New(\"glGetProgramPipelineiv\")\n\t}\n\tgpGetProgramPipelineivEXT = (C.GPGETPROGRAMPIPELINEIVEXT)(getProcAddr(\"glGetProgramPipelineivEXT\"))\n\tgpGetProgramResourceIndex = (C.GPGETPROGRAMRESOURCEINDEX)(getProcAddr(\"glGetProgramResourceIndex\"))\n\tif gpGetProgramResourceIndex == nil {\n\t\treturn errors.New(\"glGetProgramResourceIndex\")\n\t}\n\tgpGetProgramResourceLocation = (C.GPGETPROGRAMRESOURCELOCATION)(getProcAddr(\"glGetProgramResourceLocation\"))\n\tif gpGetProgramResourceLocation == nil {\n\t\treturn errors.New(\"glGetProgramResourceLocation\")\n\t}\n\tgpGetProgramResourceLocationIndex = (C.GPGETPROGRAMRESOURCELOCATIONINDEX)(getProcAddr(\"glGetProgramResourceLocationIndex\"))\n\tif gpGetProgramResourceLocationIndex == nil {\n\t\treturn errors.New(\"glGetProgramResourceLocationIndex\")\n\t}\n\tgpGetProgramResourceName = (C.GPGETPROGRAMRESOURCENAME)(getProcAddr(\"glGetProgramResourceName\"))\n\tif gpGetProgramResourceName == nil {\n\t\treturn errors.New(\"glGetProgramResourceName\")\n\t}\n\tgpGetProgramResourcefvNV = (C.GPGETPROGRAMRESOURCEFVNV)(getProcAddr(\"glGetProgramResourcefvNV\"))\n\tgpGetProgramResourceiv = (C.GPGETPROGRAMRESOURCEIV)(getProcAddr(\"glGetProgramResourceiv\"))\n\tif gpGetProgramResourceiv == nil {\n\t\treturn errors.New(\"glGetProgramResourceiv\")\n\t}\n\tgpGetProgramStageiv = (C.GPGETPROGRAMSTAGEIV)(getProcAddr(\"glGetProgramStageiv\"))\n\tif gpGetProgramStageiv == nil {\n\t\treturn errors.New(\"glGetProgramStageiv\")\n\t}\n\tgpGetProgramStringARB = (C.GPGETPROGRAMSTRINGARB)(getProcAddr(\"glGetProgramStringARB\"))\n\tgpGetProgramStringNV = (C.GPGETPROGRAMSTRINGNV)(getProcAddr(\"glGetProgramStringNV\"))\n\tgpGetProgramSubroutineParameteruivNV = (C.GPGETPROGRAMSUBROUTINEPARAMETERUIVNV)(getProcAddr(\"glGetProgramSubroutineParameteruivNV\"))\n\tgpGetProgramiv = (C.GPGETPROGRAMIV)(getProcAddr(\"glGetProgramiv\"))\n\tif gpGetProgramiv == nil {\n\t\treturn errors.New(\"glGetProgramiv\")\n\t}\n\tgpGetProgramivARB = (C.GPGETPROGRAMIVARB)(getProcAddr(\"glGetProgramivARB\"))\n\tgpGetProgramivNV = (C.GPGETPROGRAMIVNV)(getProcAddr(\"glGetProgramivNV\"))\n\tgpGetQueryBufferObjecti64v = (C.GPGETQUERYBUFFEROBJECTI64V)(getProcAddr(\"glGetQueryBufferObjecti64v\"))\n\tgpGetQueryBufferObjectiv = (C.GPGETQUERYBUFFEROBJECTIV)(getProcAddr(\"glGetQueryBufferObjectiv\"))\n\tgpGetQueryBufferObjectui64v = (C.GPGETQUERYBUFFEROBJECTUI64V)(getProcAddr(\"glGetQueryBufferObjectui64v\"))\n\tgpGetQueryBufferObjectuiv = (C.GPGETQUERYBUFFEROBJECTUIV)(getProcAddr(\"glGetQueryBufferObjectuiv\"))\n\tgpGetQueryIndexediv = (C.GPGETQUERYINDEXEDIV)(getProcAddr(\"glGetQueryIndexediv\"))\n\tif gpGetQueryIndexediv == nil {\n\t\treturn errors.New(\"glGetQueryIndexediv\")\n\t}\n\tgpGetQueryObjecti64v = (C.GPGETQUERYOBJECTI64V)(getProcAddr(\"glGetQueryObjecti64v\"))\n\tif gpGetQueryObjecti64v == nil {\n\t\treturn errors.New(\"glGetQueryObjecti64v\")\n\t}\n\tgpGetQueryObjecti64vEXT = (C.GPGETQUERYOBJECTI64VEXT)(getProcAddr(\"glGetQueryObjecti64vEXT\"))\n\tgpGetQueryObjectiv = (C.GPGETQUERYOBJECTIV)(getProcAddr(\"glGetQueryObjectiv\"))\n\tif gpGetQueryObjectiv == nil {\n\t\treturn errors.New(\"glGetQueryObjectiv\")\n\t}\n\tgpGetQueryObjectivARB = (C.GPGETQUERYOBJECTIVARB)(getProcAddr(\"glGetQueryObjectivARB\"))\n\tgpGetQueryObjectui64v = (C.GPGETQUERYOBJECTUI64V)(getProcAddr(\"glGetQueryObjectui64v\"))\n\tif gpGetQueryObjectui64v == nil {\n\t\treturn errors.New(\"glGetQueryObjectui64v\")\n\t}\n\tgpGetQueryObjectui64vEXT = (C.GPGETQUERYOBJECTUI64VEXT)(getProcAddr(\"glGetQueryObjectui64vEXT\"))\n\tgpGetQueryObjectuiv = (C.GPGETQUERYOBJECTUIV)(getProcAddr(\"glGetQueryObjectuiv\"))\n\tif gpGetQueryObjectuiv == nil {\n\t\treturn errors.New(\"glGetQueryObjectuiv\")\n\t}\n\tgpGetQueryObjectuivARB = (C.GPGETQUERYOBJECTUIVARB)(getProcAddr(\"glGetQueryObjectuivARB\"))\n\tgpGetQueryiv = (C.GPGETQUERYIV)(getProcAddr(\"glGetQueryiv\"))\n\tif gpGetQueryiv == nil {\n\t\treturn errors.New(\"glGetQueryiv\")\n\t}\n\tgpGetQueryivARB = (C.GPGETQUERYIVARB)(getProcAddr(\"glGetQueryivARB\"))\n\tgpGetRenderbufferParameteriv = (C.GPGETRENDERBUFFERPARAMETERIV)(getProcAddr(\"glGetRenderbufferParameteriv\"))\n\tif gpGetRenderbufferParameteriv == nil {\n\t\treturn errors.New(\"glGetRenderbufferParameteriv\")\n\t}\n\tgpGetRenderbufferParameterivEXT = (C.GPGETRENDERBUFFERPARAMETERIVEXT)(getProcAddr(\"glGetRenderbufferParameterivEXT\"))\n\tgpGetSamplerParameterIiv = (C.GPGETSAMPLERPARAMETERIIV)(getProcAddr(\"glGetSamplerParameterIiv\"))\n\tif gpGetSamplerParameterIiv == nil {\n\t\treturn errors.New(\"glGetSamplerParameterIiv\")\n\t}\n\tgpGetSamplerParameterIuiv = (C.GPGETSAMPLERPARAMETERIUIV)(getProcAddr(\"glGetSamplerParameterIuiv\"))\n\tif gpGetSamplerParameterIuiv == nil {\n\t\treturn errors.New(\"glGetSamplerParameterIuiv\")\n\t}\n\tgpGetSamplerParameterfv = (C.GPGETSAMPLERPARAMETERFV)(getProcAddr(\"glGetSamplerParameterfv\"))\n\tif gpGetSamplerParameterfv == nil {\n\t\treturn errors.New(\"glGetSamplerParameterfv\")\n\t}\n\tgpGetSamplerParameteriv = (C.GPGETSAMPLERPARAMETERIV)(getProcAddr(\"glGetSamplerParameteriv\"))\n\tif gpGetSamplerParameteriv == nil {\n\t\treturn errors.New(\"glGetSamplerParameteriv\")\n\t}\n\tgpGetSemaphoreParameterivNV = (C.GPGETSEMAPHOREPARAMETERIVNV)(getProcAddr(\"glGetSemaphoreParameterivNV\"))\n\tgpGetSemaphoreParameterui64vEXT = (C.GPGETSEMAPHOREPARAMETERUI64VEXT)(getProcAddr(\"glGetSemaphoreParameterui64vEXT\"))\n\tgpGetSeparableFilter = (C.GPGETSEPARABLEFILTER)(getProcAddr(\"glGetSeparableFilter\"))\n\tgpGetSeparableFilterEXT = (C.GPGETSEPARABLEFILTEREXT)(getProcAddr(\"glGetSeparableFilterEXT\"))\n\tgpGetShaderInfoLog = (C.GPGETSHADERINFOLOG)(getProcAddr(\"glGetShaderInfoLog\"))\n\tif gpGetShaderInfoLog == nil {\n\t\treturn errors.New(\"glGetShaderInfoLog\")\n\t}\n\tgpGetShaderPrecisionFormat = (C.GPGETSHADERPRECISIONFORMAT)(getProcAddr(\"glGetShaderPrecisionFormat\"))\n\tif gpGetShaderPrecisionFormat == nil {\n\t\treturn errors.New(\"glGetShaderPrecisionFormat\")\n\t}\n\tgpGetShaderSource = (C.GPGETSHADERSOURCE)(getProcAddr(\"glGetShaderSource\"))\n\tif gpGetShaderSource == nil {\n\t\treturn errors.New(\"glGetShaderSource\")\n\t}\n\tgpGetShaderSourceARB = (C.GPGETSHADERSOURCEARB)(getProcAddr(\"glGetShaderSourceARB\"))\n\tgpGetShaderiv = (C.GPGETSHADERIV)(getProcAddr(\"glGetShaderiv\"))\n\tif gpGetShaderiv == nil {\n\t\treturn errors.New(\"glGetShaderiv\")\n\t}\n\tgpGetShadingRateImagePaletteNV = (C.GPGETSHADINGRATEIMAGEPALETTENV)(getProcAddr(\"glGetShadingRateImagePaletteNV\"))\n\tgpGetShadingRateSampleLocationivNV = (C.GPGETSHADINGRATESAMPLELOCATIONIVNV)(getProcAddr(\"glGetShadingRateSampleLocationivNV\"))\n\tgpGetSharpenTexFuncSGIS = (C.GPGETSHARPENTEXFUNCSGIS)(getProcAddr(\"glGetSharpenTexFuncSGIS\"))\n\tgpGetStageIndexNV = (C.GPGETSTAGEINDEXNV)(getProcAddr(\"glGetStageIndexNV\"))\n\tgpGetString = (C.GPGETSTRING)(getProcAddr(\"glGetString\"))\n\tif gpGetString == nil {\n\t\treturn errors.New(\"glGetString\")\n\t}\n\tgpGetStringi = (C.GPGETSTRINGI)(getProcAddr(\"glGetStringi\"))\n\tif gpGetStringi == nil {\n\t\treturn errors.New(\"glGetStringi\")\n\t}\n\tgpGetSubroutineIndex = (C.GPGETSUBROUTINEINDEX)(getProcAddr(\"glGetSubroutineIndex\"))\n\tif gpGetSubroutineIndex == nil {\n\t\treturn errors.New(\"glGetSubroutineIndex\")\n\t}\n\tgpGetSubroutineUniformLocation = (C.GPGETSUBROUTINEUNIFORMLOCATION)(getProcAddr(\"glGetSubroutineUniformLocation\"))\n\tif gpGetSubroutineUniformLocation == nil {\n\t\treturn errors.New(\"glGetSubroutineUniformLocation\")\n\t}\n\tgpGetSynciv = (C.GPGETSYNCIV)(getProcAddr(\"glGetSynciv\"))\n\tif gpGetSynciv == nil {\n\t\treturn errors.New(\"glGetSynciv\")\n\t}\n\tgpGetTexBumpParameterfvATI = (C.GPGETTEXBUMPPARAMETERFVATI)(getProcAddr(\"glGetTexBumpParameterfvATI\"))\n\tgpGetTexBumpParameterivATI = (C.GPGETTEXBUMPPARAMETERIVATI)(getProcAddr(\"glGetTexBumpParameterivATI\"))\n\tgpGetTexEnvfv = (C.GPGETTEXENVFV)(getProcAddr(\"glGetTexEnvfv\"))\n\tif gpGetTexEnvfv == nil {\n\t\treturn errors.New(\"glGetTexEnvfv\")\n\t}\n\tgpGetTexEnviv = (C.GPGETTEXENVIV)(getProcAddr(\"glGetTexEnviv\"))\n\tif gpGetTexEnviv == nil {\n\t\treturn errors.New(\"glGetTexEnviv\")\n\t}\n\tgpGetTexEnvxvOES = (C.GPGETTEXENVXVOES)(getProcAddr(\"glGetTexEnvxvOES\"))\n\tgpGetTexFilterFuncSGIS = (C.GPGETTEXFILTERFUNCSGIS)(getProcAddr(\"glGetTexFilterFuncSGIS\"))\n\tgpGetTexGendv = (C.GPGETTEXGENDV)(getProcAddr(\"glGetTexGendv\"))\n\tif gpGetTexGendv == nil {\n\t\treturn errors.New(\"glGetTexGendv\")\n\t}\n\tgpGetTexGenfv = (C.GPGETTEXGENFV)(getProcAddr(\"glGetTexGenfv\"))\n\tif gpGetTexGenfv == nil {\n\t\treturn errors.New(\"glGetTexGenfv\")\n\t}\n\tgpGetTexGeniv = (C.GPGETTEXGENIV)(getProcAddr(\"glGetTexGeniv\"))\n\tif gpGetTexGeniv == nil {\n\t\treturn errors.New(\"glGetTexGeniv\")\n\t}\n\tgpGetTexGenxvOES = (C.GPGETTEXGENXVOES)(getProcAddr(\"glGetTexGenxvOES\"))\n\tgpGetTexImage = (C.GPGETTEXIMAGE)(getProcAddr(\"glGetTexImage\"))\n\tif gpGetTexImage == nil {\n\t\treturn errors.New(\"glGetTexImage\")\n\t}\n\tgpGetTexLevelParameterfv = (C.GPGETTEXLEVELPARAMETERFV)(getProcAddr(\"glGetTexLevelParameterfv\"))\n\tif gpGetTexLevelParameterfv == nil {\n\t\treturn errors.New(\"glGetTexLevelParameterfv\")\n\t}\n\tgpGetTexLevelParameteriv = (C.GPGETTEXLEVELPARAMETERIV)(getProcAddr(\"glGetTexLevelParameteriv\"))\n\tif gpGetTexLevelParameteriv == nil {\n\t\treturn errors.New(\"glGetTexLevelParameteriv\")\n\t}\n\tgpGetTexLevelParameterxvOES = (C.GPGETTEXLEVELPARAMETERXVOES)(getProcAddr(\"glGetTexLevelParameterxvOES\"))\n\tgpGetTexParameterIiv = (C.GPGETTEXPARAMETERIIV)(getProcAddr(\"glGetTexParameterIiv\"))\n\tif gpGetTexParameterIiv == nil {\n\t\treturn errors.New(\"glGetTexParameterIiv\")\n\t}\n\tgpGetTexParameterIivEXT = (C.GPGETTEXPARAMETERIIVEXT)(getProcAddr(\"glGetTexParameterIivEXT\"))\n\tgpGetTexParameterIuiv = (C.GPGETTEXPARAMETERIUIV)(getProcAddr(\"glGetTexParameterIuiv\"))\n\tif gpGetTexParameterIuiv == nil {\n\t\treturn errors.New(\"glGetTexParameterIuiv\")\n\t}\n\tgpGetTexParameterIuivEXT = (C.GPGETTEXPARAMETERIUIVEXT)(getProcAddr(\"glGetTexParameterIuivEXT\"))\n\tgpGetTexParameterPointervAPPLE = (C.GPGETTEXPARAMETERPOINTERVAPPLE)(getProcAddr(\"glGetTexParameterPointervAPPLE\"))\n\tgpGetTexParameterfv = (C.GPGETTEXPARAMETERFV)(getProcAddr(\"glGetTexParameterfv\"))\n\tif gpGetTexParameterfv == nil {\n\t\treturn errors.New(\"glGetTexParameterfv\")\n\t}\n\tgpGetTexParameteriv = (C.GPGETTEXPARAMETERIV)(getProcAddr(\"glGetTexParameteriv\"))\n\tif gpGetTexParameteriv == nil {\n\t\treturn errors.New(\"glGetTexParameteriv\")\n\t}\n\tgpGetTexParameterxvOES = (C.GPGETTEXPARAMETERXVOES)(getProcAddr(\"glGetTexParameterxvOES\"))\n\tgpGetTextureHandleARB = (C.GPGETTEXTUREHANDLEARB)(getProcAddr(\"glGetTextureHandleARB\"))\n\tgpGetTextureHandleNV = (C.GPGETTEXTUREHANDLENV)(getProcAddr(\"glGetTextureHandleNV\"))\n\tgpGetTextureImage = (C.GPGETTEXTUREIMAGE)(getProcAddr(\"glGetTextureImage\"))\n\tgpGetTextureImageEXT = (C.GPGETTEXTUREIMAGEEXT)(getProcAddr(\"glGetTextureImageEXT\"))\n\tgpGetTextureLevelParameterfv = (C.GPGETTEXTURELEVELPARAMETERFV)(getProcAddr(\"glGetTextureLevelParameterfv\"))\n\tgpGetTextureLevelParameterfvEXT = (C.GPGETTEXTURELEVELPARAMETERFVEXT)(getProcAddr(\"glGetTextureLevelParameterfvEXT\"))\n\tgpGetTextureLevelParameteriv = (C.GPGETTEXTURELEVELPARAMETERIV)(getProcAddr(\"glGetTextureLevelParameteriv\"))\n\tgpGetTextureLevelParameterivEXT = (C.GPGETTEXTURELEVELPARAMETERIVEXT)(getProcAddr(\"glGetTextureLevelParameterivEXT\"))\n\tgpGetTextureParameterIiv = (C.GPGETTEXTUREPARAMETERIIV)(getProcAddr(\"glGetTextureParameterIiv\"))\n\tgpGetTextureParameterIivEXT = (C.GPGETTEXTUREPARAMETERIIVEXT)(getProcAddr(\"glGetTextureParameterIivEXT\"))\n\tgpGetTextureParameterIuiv = (C.GPGETTEXTUREPARAMETERIUIV)(getProcAddr(\"glGetTextureParameterIuiv\"))\n\tgpGetTextureParameterIuivEXT = (C.GPGETTEXTUREPARAMETERIUIVEXT)(getProcAddr(\"glGetTextureParameterIuivEXT\"))\n\tgpGetTextureParameterfv = (C.GPGETTEXTUREPARAMETERFV)(getProcAddr(\"glGetTextureParameterfv\"))\n\tgpGetTextureParameterfvEXT = (C.GPGETTEXTUREPARAMETERFVEXT)(getProcAddr(\"glGetTextureParameterfvEXT\"))\n\tgpGetTextureParameteriv = (C.GPGETTEXTUREPARAMETERIV)(getProcAddr(\"glGetTextureParameteriv\"))\n\tgpGetTextureParameterivEXT = (C.GPGETTEXTUREPARAMETERIVEXT)(getProcAddr(\"glGetTextureParameterivEXT\"))\n\tgpGetTextureSamplerHandleARB = (C.GPGETTEXTURESAMPLERHANDLEARB)(getProcAddr(\"glGetTextureSamplerHandleARB\"))\n\tgpGetTextureSamplerHandleNV = (C.GPGETTEXTURESAMPLERHANDLENV)(getProcAddr(\"glGetTextureSamplerHandleNV\"))\n\tgpGetTextureSubImage = (C.GPGETTEXTURESUBIMAGE)(getProcAddr(\"glGetTextureSubImage\"))\n\tgpGetTrackMatrixivNV = (C.GPGETTRACKMATRIXIVNV)(getProcAddr(\"glGetTrackMatrixivNV\"))\n\tgpGetTransformFeedbackVarying = (C.GPGETTRANSFORMFEEDBACKVARYING)(getProcAddr(\"glGetTransformFeedbackVarying\"))\n\tif gpGetTransformFeedbackVarying == nil {\n\t\treturn errors.New(\"glGetTransformFeedbackVarying\")\n\t}\n\tgpGetTransformFeedbackVaryingEXT = (C.GPGETTRANSFORMFEEDBACKVARYINGEXT)(getProcAddr(\"glGetTransformFeedbackVaryingEXT\"))\n\tgpGetTransformFeedbackVaryingNV = (C.GPGETTRANSFORMFEEDBACKVARYINGNV)(getProcAddr(\"glGetTransformFeedbackVaryingNV\"))\n\tgpGetTransformFeedbacki64_v = (C.GPGETTRANSFORMFEEDBACKI64_V)(getProcAddr(\"glGetTransformFeedbacki64_v\"))\n\tgpGetTransformFeedbacki_v = (C.GPGETTRANSFORMFEEDBACKI_V)(getProcAddr(\"glGetTransformFeedbacki_v\"))\n\tgpGetTransformFeedbackiv = (C.GPGETTRANSFORMFEEDBACKIV)(getProcAddr(\"glGetTransformFeedbackiv\"))\n\tgpGetUniformBlockIndex = (C.GPGETUNIFORMBLOCKINDEX)(getProcAddr(\"glGetUniformBlockIndex\"))\n\tif gpGetUniformBlockIndex == nil {\n\t\treturn errors.New(\"glGetUniformBlockIndex\")\n\t}\n\tgpGetUniformBufferSizeEXT = (C.GPGETUNIFORMBUFFERSIZEEXT)(getProcAddr(\"glGetUniformBufferSizeEXT\"))\n\tgpGetUniformIndices = (C.GPGETUNIFORMINDICES)(getProcAddr(\"glGetUniformIndices\"))\n\tif gpGetUniformIndices == nil {\n\t\treturn errors.New(\"glGetUniformIndices\")\n\t}\n\tgpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr(\"glGetUniformLocation\"))\n\tif gpGetUniformLocation == nil {\n\t\treturn errors.New(\"glGetUniformLocation\")\n\t}\n\tgpGetUniformLocationARB = (C.GPGETUNIFORMLOCATIONARB)(getProcAddr(\"glGetUniformLocationARB\"))\n\tgpGetUniformOffsetEXT = (C.GPGETUNIFORMOFFSETEXT)(getProcAddr(\"glGetUniformOffsetEXT\"))\n\tgpGetUniformSubroutineuiv = (C.GPGETUNIFORMSUBROUTINEUIV)(getProcAddr(\"glGetUniformSubroutineuiv\"))\n\tif gpGetUniformSubroutineuiv == nil {\n\t\treturn errors.New(\"glGetUniformSubroutineuiv\")\n\t}\n\tgpGetUniformdv = (C.GPGETUNIFORMDV)(getProcAddr(\"glGetUniformdv\"))\n\tif gpGetUniformdv == nil {\n\t\treturn errors.New(\"glGetUniformdv\")\n\t}\n\tgpGetUniformfv = (C.GPGETUNIFORMFV)(getProcAddr(\"glGetUniformfv\"))\n\tif gpGetUniformfv == nil {\n\t\treturn errors.New(\"glGetUniformfv\")\n\t}\n\tgpGetUniformfvARB = (C.GPGETUNIFORMFVARB)(getProcAddr(\"glGetUniformfvARB\"))\n\tgpGetUniformi64vARB = (C.GPGETUNIFORMI64VARB)(getProcAddr(\"glGetUniformi64vARB\"))\n\tgpGetUniformi64vNV = (C.GPGETUNIFORMI64VNV)(getProcAddr(\"glGetUniformi64vNV\"))\n\tgpGetUniformiv = (C.GPGETUNIFORMIV)(getProcAddr(\"glGetUniformiv\"))\n\tif gpGetUniformiv == nil {\n\t\treturn errors.New(\"glGetUniformiv\")\n\t}\n\tgpGetUniformivARB = (C.GPGETUNIFORMIVARB)(getProcAddr(\"glGetUniformivARB\"))\n\tgpGetUniformui64vARB = (C.GPGETUNIFORMUI64VARB)(getProcAddr(\"glGetUniformui64vARB\"))\n\tgpGetUniformui64vNV = (C.GPGETUNIFORMUI64VNV)(getProcAddr(\"glGetUniformui64vNV\"))\n\tgpGetUniformuiv = (C.GPGETUNIFORMUIV)(getProcAddr(\"glGetUniformuiv\"))\n\tif gpGetUniformuiv == nil {\n\t\treturn errors.New(\"glGetUniformuiv\")\n\t}\n\tgpGetUniformuivEXT = (C.GPGETUNIFORMUIVEXT)(getProcAddr(\"glGetUniformuivEXT\"))\n\tgpGetUnsignedBytei_vEXT = (C.GPGETUNSIGNEDBYTEI_VEXT)(getProcAddr(\"glGetUnsignedBytei_vEXT\"))\n\tgpGetUnsignedBytevEXT = (C.GPGETUNSIGNEDBYTEVEXT)(getProcAddr(\"glGetUnsignedBytevEXT\"))\n\tgpGetVariantArrayObjectfvATI = (C.GPGETVARIANTARRAYOBJECTFVATI)(getProcAddr(\"glGetVariantArrayObjectfvATI\"))\n\tgpGetVariantArrayObjectivATI = (C.GPGETVARIANTARRAYOBJECTIVATI)(getProcAddr(\"glGetVariantArrayObjectivATI\"))\n\tgpGetVariantBooleanvEXT = (C.GPGETVARIANTBOOLEANVEXT)(getProcAddr(\"glGetVariantBooleanvEXT\"))\n\tgpGetVariantFloatvEXT = (C.GPGETVARIANTFLOATVEXT)(getProcAddr(\"glGetVariantFloatvEXT\"))\n\tgpGetVariantIntegervEXT = (C.GPGETVARIANTINTEGERVEXT)(getProcAddr(\"glGetVariantIntegervEXT\"))\n\tgpGetVariantPointervEXT = (C.GPGETVARIANTPOINTERVEXT)(getProcAddr(\"glGetVariantPointervEXT\"))\n\tgpGetVaryingLocationNV = (C.GPGETVARYINGLOCATIONNV)(getProcAddr(\"glGetVaryingLocationNV\"))\n\tgpGetVertexArrayIndexed64iv = (C.GPGETVERTEXARRAYINDEXED64IV)(getProcAddr(\"glGetVertexArrayIndexed64iv\"))\n\tgpGetVertexArrayIndexediv = (C.GPGETVERTEXARRAYINDEXEDIV)(getProcAddr(\"glGetVertexArrayIndexediv\"))\n\tgpGetVertexArrayIntegeri_vEXT = (C.GPGETVERTEXARRAYINTEGERI_VEXT)(getProcAddr(\"glGetVertexArrayIntegeri_vEXT\"))\n\tgpGetVertexArrayIntegervEXT = (C.GPGETVERTEXARRAYINTEGERVEXT)(getProcAddr(\"glGetVertexArrayIntegervEXT\"))\n\tgpGetVertexArrayPointeri_vEXT = (C.GPGETVERTEXARRAYPOINTERI_VEXT)(getProcAddr(\"glGetVertexArrayPointeri_vEXT\"))\n\tgpGetVertexArrayPointervEXT = (C.GPGETVERTEXARRAYPOINTERVEXT)(getProcAddr(\"glGetVertexArrayPointervEXT\"))\n\tgpGetVertexArrayiv = (C.GPGETVERTEXARRAYIV)(getProcAddr(\"glGetVertexArrayiv\"))\n\tgpGetVertexAttribArrayObjectfvATI = (C.GPGETVERTEXATTRIBARRAYOBJECTFVATI)(getProcAddr(\"glGetVertexAttribArrayObjectfvATI\"))\n\tgpGetVertexAttribArrayObjectivATI = (C.GPGETVERTEXATTRIBARRAYOBJECTIVATI)(getProcAddr(\"glGetVertexAttribArrayObjectivATI\"))\n\tgpGetVertexAttribIiv = (C.GPGETVERTEXATTRIBIIV)(getProcAddr(\"glGetVertexAttribIiv\"))\n\tif gpGetVertexAttribIiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribIiv\")\n\t}\n\tgpGetVertexAttribIivEXT = (C.GPGETVERTEXATTRIBIIVEXT)(getProcAddr(\"glGetVertexAttribIivEXT\"))\n\tgpGetVertexAttribIuiv = (C.GPGETVERTEXATTRIBIUIV)(getProcAddr(\"glGetVertexAttribIuiv\"))\n\tif gpGetVertexAttribIuiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribIuiv\")\n\t}\n\tgpGetVertexAttribIuivEXT = (C.GPGETVERTEXATTRIBIUIVEXT)(getProcAddr(\"glGetVertexAttribIuivEXT\"))\n\tgpGetVertexAttribLdv = (C.GPGETVERTEXATTRIBLDV)(getProcAddr(\"glGetVertexAttribLdv\"))\n\tif gpGetVertexAttribLdv == nil {\n\t\treturn errors.New(\"glGetVertexAttribLdv\")\n\t}\n\tgpGetVertexAttribLdvEXT = (C.GPGETVERTEXATTRIBLDVEXT)(getProcAddr(\"glGetVertexAttribLdvEXT\"))\n\tgpGetVertexAttribLi64vNV = (C.GPGETVERTEXATTRIBLI64VNV)(getProcAddr(\"glGetVertexAttribLi64vNV\"))\n\tgpGetVertexAttribLui64vARB = (C.GPGETVERTEXATTRIBLUI64VARB)(getProcAddr(\"glGetVertexAttribLui64vARB\"))\n\tgpGetVertexAttribLui64vNV = (C.GPGETVERTEXATTRIBLUI64VNV)(getProcAddr(\"glGetVertexAttribLui64vNV\"))\n\tgpGetVertexAttribPointerv = (C.GPGETVERTEXATTRIBPOINTERV)(getProcAddr(\"glGetVertexAttribPointerv\"))\n\tif gpGetVertexAttribPointerv == nil {\n\t\treturn errors.New(\"glGetVertexAttribPointerv\")\n\t}\n\tgpGetVertexAttribPointervARB = (C.GPGETVERTEXATTRIBPOINTERVARB)(getProcAddr(\"glGetVertexAttribPointervARB\"))\n\tgpGetVertexAttribPointervNV = (C.GPGETVERTEXATTRIBPOINTERVNV)(getProcAddr(\"glGetVertexAttribPointervNV\"))\n\tgpGetVertexAttribdv = (C.GPGETVERTEXATTRIBDV)(getProcAddr(\"glGetVertexAttribdv\"))\n\tif gpGetVertexAttribdv == nil {\n\t\treturn errors.New(\"glGetVertexAttribdv\")\n\t}\n\tgpGetVertexAttribdvARB = (C.GPGETVERTEXATTRIBDVARB)(getProcAddr(\"glGetVertexAttribdvARB\"))\n\tgpGetVertexAttribdvNV = (C.GPGETVERTEXATTRIBDVNV)(getProcAddr(\"glGetVertexAttribdvNV\"))\n\tgpGetVertexAttribfv = (C.GPGETVERTEXATTRIBFV)(getProcAddr(\"glGetVertexAttribfv\"))\n\tif gpGetVertexAttribfv == nil {\n\t\treturn errors.New(\"glGetVertexAttribfv\")\n\t}\n\tgpGetVertexAttribfvARB = (C.GPGETVERTEXATTRIBFVARB)(getProcAddr(\"glGetVertexAttribfvARB\"))\n\tgpGetVertexAttribfvNV = (C.GPGETVERTEXATTRIBFVNV)(getProcAddr(\"glGetVertexAttribfvNV\"))\n\tgpGetVertexAttribiv = (C.GPGETVERTEXATTRIBIV)(getProcAddr(\"glGetVertexAttribiv\"))\n\tif gpGetVertexAttribiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribiv\")\n\t}\n\tgpGetVertexAttribivARB = (C.GPGETVERTEXATTRIBIVARB)(getProcAddr(\"glGetVertexAttribivARB\"))\n\tgpGetVertexAttribivNV = (C.GPGETVERTEXATTRIBIVNV)(getProcAddr(\"glGetVertexAttribivNV\"))\n\tgpGetVideoCaptureStreamdvNV = (C.GPGETVIDEOCAPTURESTREAMDVNV)(getProcAddr(\"glGetVideoCaptureStreamdvNV\"))\n\tgpGetVideoCaptureStreamfvNV = (C.GPGETVIDEOCAPTURESTREAMFVNV)(getProcAddr(\"glGetVideoCaptureStreamfvNV\"))\n\tgpGetVideoCaptureStreamivNV = (C.GPGETVIDEOCAPTURESTREAMIVNV)(getProcAddr(\"glGetVideoCaptureStreamivNV\"))\n\tgpGetVideoCaptureivNV = (C.GPGETVIDEOCAPTUREIVNV)(getProcAddr(\"glGetVideoCaptureivNV\"))\n\tgpGetVideoi64vNV = (C.GPGETVIDEOI64VNV)(getProcAddr(\"glGetVideoi64vNV\"))\n\tgpGetVideoivNV = (C.GPGETVIDEOIVNV)(getProcAddr(\"glGetVideoivNV\"))\n\tgpGetVideoui64vNV = (C.GPGETVIDEOUI64VNV)(getProcAddr(\"glGetVideoui64vNV\"))\n\tgpGetVideouivNV = (C.GPGETVIDEOUIVNV)(getProcAddr(\"glGetVideouivNV\"))\n\tgpGetVkProcAddrNV = (C.GPGETVKPROCADDRNV)(getProcAddr(\"glGetVkProcAddrNV\"))\n\tgpGetnColorTableARB = (C.GPGETNCOLORTABLEARB)(getProcAddr(\"glGetnColorTableARB\"))\n\tgpGetnCompressedTexImageARB = (C.GPGETNCOMPRESSEDTEXIMAGEARB)(getProcAddr(\"glGetnCompressedTexImageARB\"))\n\tgpGetnConvolutionFilterARB = (C.GPGETNCONVOLUTIONFILTERARB)(getProcAddr(\"glGetnConvolutionFilterARB\"))\n\tgpGetnHistogramARB = (C.GPGETNHISTOGRAMARB)(getProcAddr(\"glGetnHistogramARB\"))\n\tgpGetnMapdvARB = (C.GPGETNMAPDVARB)(getProcAddr(\"glGetnMapdvARB\"))\n\tgpGetnMapfvARB = (C.GPGETNMAPFVARB)(getProcAddr(\"glGetnMapfvARB\"))\n\tgpGetnMapivARB = (C.GPGETNMAPIVARB)(getProcAddr(\"glGetnMapivARB\"))\n\tgpGetnMinmaxARB = (C.GPGETNMINMAXARB)(getProcAddr(\"glGetnMinmaxARB\"))\n\tgpGetnPixelMapfvARB = (C.GPGETNPIXELMAPFVARB)(getProcAddr(\"glGetnPixelMapfvARB\"))\n\tgpGetnPixelMapuivARB = (C.GPGETNPIXELMAPUIVARB)(getProcAddr(\"glGetnPixelMapuivARB\"))\n\tgpGetnPixelMapusvARB = (C.GPGETNPIXELMAPUSVARB)(getProcAddr(\"glGetnPixelMapusvARB\"))\n\tgpGetnPolygonStippleARB = (C.GPGETNPOLYGONSTIPPLEARB)(getProcAddr(\"glGetnPolygonStippleARB\"))\n\tgpGetnSeparableFilterARB = (C.GPGETNSEPARABLEFILTERARB)(getProcAddr(\"glGetnSeparableFilterARB\"))\n\tgpGetnTexImageARB = (C.GPGETNTEXIMAGEARB)(getProcAddr(\"glGetnTexImageARB\"))\n\tgpGetnUniformdvARB = (C.GPGETNUNIFORMDVARB)(getProcAddr(\"glGetnUniformdvARB\"))\n\tgpGetnUniformfv = (C.GPGETNUNIFORMFV)(getProcAddr(\"glGetnUniformfv\"))\n\tgpGetnUniformfvARB = (C.GPGETNUNIFORMFVARB)(getProcAddr(\"glGetnUniformfvARB\"))\n\tgpGetnUniformfvKHR = (C.GPGETNUNIFORMFVKHR)(getProcAddr(\"glGetnUniformfvKHR\"))\n\tgpGetnUniformi64vARB = (C.GPGETNUNIFORMI64VARB)(getProcAddr(\"glGetnUniformi64vARB\"))\n\tgpGetnUniformiv = (C.GPGETNUNIFORMIV)(getProcAddr(\"glGetnUniformiv\"))\n\tgpGetnUniformivARB = (C.GPGETNUNIFORMIVARB)(getProcAddr(\"glGetnUniformivARB\"))\n\tgpGetnUniformivKHR = (C.GPGETNUNIFORMIVKHR)(getProcAddr(\"glGetnUniformivKHR\"))\n\tgpGetnUniformui64vARB = (C.GPGETNUNIFORMUI64VARB)(getProcAddr(\"glGetnUniformui64vARB\"))\n\tgpGetnUniformuiv = (C.GPGETNUNIFORMUIV)(getProcAddr(\"glGetnUniformuiv\"))\n\tgpGetnUniformuivARB = (C.GPGETNUNIFORMUIVARB)(getProcAddr(\"glGetnUniformuivARB\"))\n\tgpGetnUniformuivKHR = (C.GPGETNUNIFORMUIVKHR)(getProcAddr(\"glGetnUniformuivKHR\"))\n\tgpGlobalAlphaFactorbSUN = (C.GPGLOBALALPHAFACTORBSUN)(getProcAddr(\"glGlobalAlphaFactorbSUN\"))\n\tgpGlobalAlphaFactordSUN = (C.GPGLOBALALPHAFACTORDSUN)(getProcAddr(\"glGlobalAlphaFactordSUN\"))\n\tgpGlobalAlphaFactorfSUN = (C.GPGLOBALALPHAFACTORFSUN)(getProcAddr(\"glGlobalAlphaFactorfSUN\"))\n\tgpGlobalAlphaFactoriSUN = (C.GPGLOBALALPHAFACTORISUN)(getProcAddr(\"glGlobalAlphaFactoriSUN\"))\n\tgpGlobalAlphaFactorsSUN = (C.GPGLOBALALPHAFACTORSSUN)(getProcAddr(\"glGlobalAlphaFactorsSUN\"))\n\tgpGlobalAlphaFactorubSUN = (C.GPGLOBALALPHAFACTORUBSUN)(getProcAddr(\"glGlobalAlphaFactorubSUN\"))\n\tgpGlobalAlphaFactoruiSUN = (C.GPGLOBALALPHAFACTORUISUN)(getProcAddr(\"glGlobalAlphaFactoruiSUN\"))\n\tgpGlobalAlphaFactorusSUN = (C.GPGLOBALALPHAFACTORUSSUN)(getProcAddr(\"glGlobalAlphaFactorusSUN\"))\n\tgpHint = (C.GPHINT)(getProcAddr(\"glHint\"))\n\tif gpHint == nil {\n\t\treturn errors.New(\"glHint\")\n\t}\n\tgpHintPGI = (C.GPHINTPGI)(getProcAddr(\"glHintPGI\"))\n\tgpHistogram = (C.GPHISTOGRAM)(getProcAddr(\"glHistogram\"))\n\tgpHistogramEXT = (C.GPHISTOGRAMEXT)(getProcAddr(\"glHistogramEXT\"))\n\tgpIglooInterfaceSGIX = (C.GPIGLOOINTERFACESGIX)(getProcAddr(\"glIglooInterfaceSGIX\"))\n\tgpImageTransformParameterfHP = (C.GPIMAGETRANSFORMPARAMETERFHP)(getProcAddr(\"glImageTransformParameterfHP\"))\n\tgpImageTransformParameterfvHP = (C.GPIMAGETRANSFORMPARAMETERFVHP)(getProcAddr(\"glImageTransformParameterfvHP\"))\n\tgpImageTransformParameteriHP = (C.GPIMAGETRANSFORMPARAMETERIHP)(getProcAddr(\"glImageTransformParameteriHP\"))\n\tgpImageTransformParameterivHP = (C.GPIMAGETRANSFORMPARAMETERIVHP)(getProcAddr(\"glImageTransformParameterivHP\"))\n\tgpImportMemoryFdEXT = (C.GPIMPORTMEMORYFDEXT)(getProcAddr(\"glImportMemoryFdEXT\"))\n\tgpImportMemoryWin32HandleEXT = (C.GPIMPORTMEMORYWIN32HANDLEEXT)(getProcAddr(\"glImportMemoryWin32HandleEXT\"))\n\tgpImportMemoryWin32NameEXT = (C.GPIMPORTMEMORYWIN32NAMEEXT)(getProcAddr(\"glImportMemoryWin32NameEXT\"))\n\tgpImportSemaphoreFdEXT = (C.GPIMPORTSEMAPHOREFDEXT)(getProcAddr(\"glImportSemaphoreFdEXT\"))\n\tgpImportSemaphoreWin32HandleEXT = (C.GPIMPORTSEMAPHOREWIN32HANDLEEXT)(getProcAddr(\"glImportSemaphoreWin32HandleEXT\"))\n\tgpImportSemaphoreWin32NameEXT = (C.GPIMPORTSEMAPHOREWIN32NAMEEXT)(getProcAddr(\"glImportSemaphoreWin32NameEXT\"))\n\tgpImportSyncEXT = (C.GPIMPORTSYNCEXT)(getProcAddr(\"glImportSyncEXT\"))\n\tgpIndexFormatNV = (C.GPINDEXFORMATNV)(getProcAddr(\"glIndexFormatNV\"))\n\tgpIndexFuncEXT = (C.GPINDEXFUNCEXT)(getProcAddr(\"glIndexFuncEXT\"))\n\tgpIndexMask = (C.GPINDEXMASK)(getProcAddr(\"glIndexMask\"))\n\tif gpIndexMask == nil {\n\t\treturn errors.New(\"glIndexMask\")\n\t}\n\tgpIndexMaterialEXT = (C.GPINDEXMATERIALEXT)(getProcAddr(\"glIndexMaterialEXT\"))\n\tgpIndexPointer = (C.GPINDEXPOINTER)(getProcAddr(\"glIndexPointer\"))\n\tif gpIndexPointer == nil {\n\t\treturn errors.New(\"glIndexPointer\")\n\t}\n\tgpIndexPointerEXT = (C.GPINDEXPOINTEREXT)(getProcAddr(\"glIndexPointerEXT\"))\n\tgpIndexPointerListIBM = (C.GPINDEXPOINTERLISTIBM)(getProcAddr(\"glIndexPointerListIBM\"))\n\tgpIndexd = (C.GPINDEXD)(getProcAddr(\"glIndexd\"))\n\tif gpIndexd == nil {\n\t\treturn errors.New(\"glIndexd\")\n\t}\n\tgpIndexdv = (C.GPINDEXDV)(getProcAddr(\"glIndexdv\"))\n\tif gpIndexdv == nil {\n\t\treturn errors.New(\"glIndexdv\")\n\t}\n\tgpIndexf = (C.GPINDEXF)(getProcAddr(\"glIndexf\"))\n\tif gpIndexf == nil {\n\t\treturn errors.New(\"glIndexf\")\n\t}\n\tgpIndexfv = (C.GPINDEXFV)(getProcAddr(\"glIndexfv\"))\n\tif gpIndexfv == nil {\n\t\treturn errors.New(\"glIndexfv\")\n\t}\n\tgpIndexi = (C.GPINDEXI)(getProcAddr(\"glIndexi\"))\n\tif gpIndexi == nil {\n\t\treturn errors.New(\"glIndexi\")\n\t}\n\tgpIndexiv = (C.GPINDEXIV)(getProcAddr(\"glIndexiv\"))\n\tif gpIndexiv == nil {\n\t\treturn errors.New(\"glIndexiv\")\n\t}\n\tgpIndexs = (C.GPINDEXS)(getProcAddr(\"glIndexs\"))\n\tif gpIndexs == nil {\n\t\treturn errors.New(\"glIndexs\")\n\t}\n\tgpIndexsv = (C.GPINDEXSV)(getProcAddr(\"glIndexsv\"))\n\tif gpIndexsv == nil {\n\t\treturn errors.New(\"glIndexsv\")\n\t}\n\tgpIndexub = (C.GPINDEXUB)(getProcAddr(\"glIndexub\"))\n\tif gpIndexub == nil {\n\t\treturn errors.New(\"glIndexub\")\n\t}\n\tgpIndexubv = (C.GPINDEXUBV)(getProcAddr(\"glIndexubv\"))\n\tif gpIndexubv == nil {\n\t\treturn errors.New(\"glIndexubv\")\n\t}\n\tgpIndexxOES = (C.GPINDEXXOES)(getProcAddr(\"glIndexxOES\"))\n\tgpIndexxvOES = (C.GPINDEXXVOES)(getProcAddr(\"glIndexxvOES\"))\n\tgpInitNames = (C.GPINITNAMES)(getProcAddr(\"glInitNames\"))\n\tif gpInitNames == nil {\n\t\treturn errors.New(\"glInitNames\")\n\t}\n\tgpInsertComponentEXT = (C.GPINSERTCOMPONENTEXT)(getProcAddr(\"glInsertComponentEXT\"))\n\tgpInsertEventMarkerEXT = (C.GPINSERTEVENTMARKEREXT)(getProcAddr(\"glInsertEventMarkerEXT\"))\n\tgpInstrumentsBufferSGIX = (C.GPINSTRUMENTSBUFFERSGIX)(getProcAddr(\"glInstrumentsBufferSGIX\"))\n\tgpInterleavedArrays = (C.GPINTERLEAVEDARRAYS)(getProcAddr(\"glInterleavedArrays\"))\n\tif gpInterleavedArrays == nil {\n\t\treturn errors.New(\"glInterleavedArrays\")\n\t}\n\tgpInterpolatePathsNV = (C.GPINTERPOLATEPATHSNV)(getProcAddr(\"glInterpolatePathsNV\"))\n\tgpInvalidateBufferData = (C.GPINVALIDATEBUFFERDATA)(getProcAddr(\"glInvalidateBufferData\"))\n\tif gpInvalidateBufferData == nil {\n\t\treturn errors.New(\"glInvalidateBufferData\")\n\t}\n\tgpInvalidateBufferSubData = (C.GPINVALIDATEBUFFERSUBDATA)(getProcAddr(\"glInvalidateBufferSubData\"))\n\tif gpInvalidateBufferSubData == nil {\n\t\treturn errors.New(\"glInvalidateBufferSubData\")\n\t}\n\tgpInvalidateFramebuffer = (C.GPINVALIDATEFRAMEBUFFER)(getProcAddr(\"glInvalidateFramebuffer\"))\n\tif gpInvalidateFramebuffer == nil {\n\t\treturn errors.New(\"glInvalidateFramebuffer\")\n\t}\n\tgpInvalidateNamedFramebufferData = (C.GPINVALIDATENAMEDFRAMEBUFFERDATA)(getProcAddr(\"glInvalidateNamedFramebufferData\"))\n\tgpInvalidateNamedFramebufferSubData = (C.GPINVALIDATENAMEDFRAMEBUFFERSUBDATA)(getProcAddr(\"glInvalidateNamedFramebufferSubData\"))\n\tgpInvalidateSubFramebuffer = (C.GPINVALIDATESUBFRAMEBUFFER)(getProcAddr(\"glInvalidateSubFramebuffer\"))\n\tif gpInvalidateSubFramebuffer == nil {\n\t\treturn errors.New(\"glInvalidateSubFramebuffer\")\n\t}\n\tgpInvalidateTexImage = (C.GPINVALIDATETEXIMAGE)(getProcAddr(\"glInvalidateTexImage\"))\n\tif gpInvalidateTexImage == nil {\n\t\treturn errors.New(\"glInvalidateTexImage\")\n\t}\n\tgpInvalidateTexSubImage = (C.GPINVALIDATETEXSUBIMAGE)(getProcAddr(\"glInvalidateTexSubImage\"))\n\tif gpInvalidateTexSubImage == nil {\n\t\treturn errors.New(\"glInvalidateTexSubImage\")\n\t}\n\tgpIsAsyncMarkerSGIX = (C.GPISASYNCMARKERSGIX)(getProcAddr(\"glIsAsyncMarkerSGIX\"))\n\tgpIsBuffer = (C.GPISBUFFER)(getProcAddr(\"glIsBuffer\"))\n\tif gpIsBuffer == nil {\n\t\treturn errors.New(\"glIsBuffer\")\n\t}\n\tgpIsBufferARB = (C.GPISBUFFERARB)(getProcAddr(\"glIsBufferARB\"))\n\tgpIsBufferResidentNV = (C.GPISBUFFERRESIDENTNV)(getProcAddr(\"glIsBufferResidentNV\"))\n\tgpIsCommandListNV = (C.GPISCOMMANDLISTNV)(getProcAddr(\"glIsCommandListNV\"))\n\tgpIsEnabled = (C.GPISENABLED)(getProcAddr(\"glIsEnabled\"))\n\tif gpIsEnabled == nil {\n\t\treturn errors.New(\"glIsEnabled\")\n\t}\n\tgpIsEnabledIndexedEXT = (C.GPISENABLEDINDEXEDEXT)(getProcAddr(\"glIsEnabledIndexedEXT\"))\n\tgpIsEnabledi = (C.GPISENABLEDI)(getProcAddr(\"glIsEnabledi\"))\n\tif gpIsEnabledi == nil {\n\t\treturn errors.New(\"glIsEnabledi\")\n\t}\n\tgpIsFenceAPPLE = (C.GPISFENCEAPPLE)(getProcAddr(\"glIsFenceAPPLE\"))\n\tgpIsFenceNV = (C.GPISFENCENV)(getProcAddr(\"glIsFenceNV\"))\n\tgpIsFramebuffer = (C.GPISFRAMEBUFFER)(getProcAddr(\"glIsFramebuffer\"))\n\tif gpIsFramebuffer == nil {\n\t\treturn errors.New(\"glIsFramebuffer\")\n\t}\n\tgpIsFramebufferEXT = (C.GPISFRAMEBUFFEREXT)(getProcAddr(\"glIsFramebufferEXT\"))\n\tgpIsImageHandleResidentARB = (C.GPISIMAGEHANDLERESIDENTARB)(getProcAddr(\"glIsImageHandleResidentARB\"))\n\tgpIsImageHandleResidentNV = (C.GPISIMAGEHANDLERESIDENTNV)(getProcAddr(\"glIsImageHandleResidentNV\"))\n\tgpIsList = (C.GPISLIST)(getProcAddr(\"glIsList\"))\n\tif gpIsList == nil {\n\t\treturn errors.New(\"glIsList\")\n\t}\n\tgpIsMemoryObjectEXT = (C.GPISMEMORYOBJECTEXT)(getProcAddr(\"glIsMemoryObjectEXT\"))\n\tgpIsNameAMD = (C.GPISNAMEAMD)(getProcAddr(\"glIsNameAMD\"))\n\tgpIsNamedBufferResidentNV = (C.GPISNAMEDBUFFERRESIDENTNV)(getProcAddr(\"glIsNamedBufferResidentNV\"))\n\tgpIsNamedStringARB = (C.GPISNAMEDSTRINGARB)(getProcAddr(\"glIsNamedStringARB\"))\n\tgpIsObjectBufferATI = (C.GPISOBJECTBUFFERATI)(getProcAddr(\"glIsObjectBufferATI\"))\n\tgpIsOcclusionQueryNV = (C.GPISOCCLUSIONQUERYNV)(getProcAddr(\"glIsOcclusionQueryNV\"))\n\tgpIsPathNV = (C.GPISPATHNV)(getProcAddr(\"glIsPathNV\"))\n\tgpIsPointInFillPathNV = (C.GPISPOINTINFILLPATHNV)(getProcAddr(\"glIsPointInFillPathNV\"))\n\tgpIsPointInStrokePathNV = (C.GPISPOINTINSTROKEPATHNV)(getProcAddr(\"glIsPointInStrokePathNV\"))\n\tgpIsProgram = (C.GPISPROGRAM)(getProcAddr(\"glIsProgram\"))\n\tif gpIsProgram == nil {\n\t\treturn errors.New(\"glIsProgram\")\n\t}\n\tgpIsProgramARB = (C.GPISPROGRAMARB)(getProcAddr(\"glIsProgramARB\"))\n\tgpIsProgramNV = (C.GPISPROGRAMNV)(getProcAddr(\"glIsProgramNV\"))\n\tgpIsProgramPipeline = (C.GPISPROGRAMPIPELINE)(getProcAddr(\"glIsProgramPipeline\"))\n\tif gpIsProgramPipeline == nil {\n\t\treturn errors.New(\"glIsProgramPipeline\")\n\t}\n\tgpIsProgramPipelineEXT = (C.GPISPROGRAMPIPELINEEXT)(getProcAddr(\"glIsProgramPipelineEXT\"))\n\tgpIsQuery = (C.GPISQUERY)(getProcAddr(\"glIsQuery\"))\n\tif gpIsQuery == nil {\n\t\treturn errors.New(\"glIsQuery\")\n\t}\n\tgpIsQueryARB = (C.GPISQUERYARB)(getProcAddr(\"glIsQueryARB\"))\n\tgpIsRenderbuffer = (C.GPISRENDERBUFFER)(getProcAddr(\"glIsRenderbuffer\"))\n\tif gpIsRenderbuffer == nil {\n\t\treturn errors.New(\"glIsRenderbuffer\")\n\t}\n\tgpIsRenderbufferEXT = (C.GPISRENDERBUFFEREXT)(getProcAddr(\"glIsRenderbufferEXT\"))\n\tgpIsSampler = (C.GPISSAMPLER)(getProcAddr(\"glIsSampler\"))\n\tif gpIsSampler == nil {\n\t\treturn errors.New(\"glIsSampler\")\n\t}\n\tgpIsSemaphoreEXT = (C.GPISSEMAPHOREEXT)(getProcAddr(\"glIsSemaphoreEXT\"))\n\tgpIsShader = (C.GPISSHADER)(getProcAddr(\"glIsShader\"))\n\tif gpIsShader == nil {\n\t\treturn errors.New(\"glIsShader\")\n\t}\n\tgpIsStateNV = (C.GPISSTATENV)(getProcAddr(\"glIsStateNV\"))\n\tgpIsSync = (C.GPISSYNC)(getProcAddr(\"glIsSync\"))\n\tif gpIsSync == nil {\n\t\treturn errors.New(\"glIsSync\")\n\t}\n\tgpIsTexture = (C.GPISTEXTURE)(getProcAddr(\"glIsTexture\"))\n\tif gpIsTexture == nil {\n\t\treturn errors.New(\"glIsTexture\")\n\t}\n\tgpIsTextureEXT = (C.GPISTEXTUREEXT)(getProcAddr(\"glIsTextureEXT\"))\n\tgpIsTextureHandleResidentARB = (C.GPISTEXTUREHANDLERESIDENTARB)(getProcAddr(\"glIsTextureHandleResidentARB\"))\n\tgpIsTextureHandleResidentNV = (C.GPISTEXTUREHANDLERESIDENTNV)(getProcAddr(\"glIsTextureHandleResidentNV\"))\n\tgpIsTransformFeedback = (C.GPISTRANSFORMFEEDBACK)(getProcAddr(\"glIsTransformFeedback\"))\n\tif gpIsTransformFeedback == nil {\n\t\treturn errors.New(\"glIsTransformFeedback\")\n\t}\n\tgpIsTransformFeedbackNV = (C.GPISTRANSFORMFEEDBACKNV)(getProcAddr(\"glIsTransformFeedbackNV\"))\n\tgpIsVariantEnabledEXT = (C.GPISVARIANTENABLEDEXT)(getProcAddr(\"glIsVariantEnabledEXT\"))\n\tgpIsVertexArray = (C.GPISVERTEXARRAY)(getProcAddr(\"glIsVertexArray\"))\n\tif gpIsVertexArray == nil {\n\t\treturn errors.New(\"glIsVertexArray\")\n\t}\n\tgpIsVertexArrayAPPLE = (C.GPISVERTEXARRAYAPPLE)(getProcAddr(\"glIsVertexArrayAPPLE\"))\n\tgpIsVertexAttribEnabledAPPLE = (C.GPISVERTEXATTRIBENABLEDAPPLE)(getProcAddr(\"glIsVertexAttribEnabledAPPLE\"))\n\tgpLGPUCopyImageSubDataNVX = (C.GPLGPUCOPYIMAGESUBDATANVX)(getProcAddr(\"glLGPUCopyImageSubDataNVX\"))\n\tgpLGPUInterlockNVX = (C.GPLGPUINTERLOCKNVX)(getProcAddr(\"glLGPUInterlockNVX\"))\n\tgpLGPUNamedBufferSubDataNVX = (C.GPLGPUNAMEDBUFFERSUBDATANVX)(getProcAddr(\"glLGPUNamedBufferSubDataNVX\"))\n\tgpLabelObjectEXT = (C.GPLABELOBJECTEXT)(getProcAddr(\"glLabelObjectEXT\"))\n\tgpLightEnviSGIX = (C.GPLIGHTENVISGIX)(getProcAddr(\"glLightEnviSGIX\"))\n\tgpLightModelf = (C.GPLIGHTMODELF)(getProcAddr(\"glLightModelf\"))\n\tif gpLightModelf == nil {\n\t\treturn errors.New(\"glLightModelf\")\n\t}\n\tgpLightModelfv = (C.GPLIGHTMODELFV)(getProcAddr(\"glLightModelfv\"))\n\tif gpLightModelfv == nil {\n\t\treturn errors.New(\"glLightModelfv\")\n\t}\n\tgpLightModeli = (C.GPLIGHTMODELI)(getProcAddr(\"glLightModeli\"))\n\tif gpLightModeli == nil {\n\t\treturn errors.New(\"glLightModeli\")\n\t}\n\tgpLightModeliv = (C.GPLIGHTMODELIV)(getProcAddr(\"glLightModeliv\"))\n\tif gpLightModeliv == nil {\n\t\treturn errors.New(\"glLightModeliv\")\n\t}\n\tgpLightModelxOES = (C.GPLIGHTMODELXOES)(getProcAddr(\"glLightModelxOES\"))\n\tgpLightModelxvOES = (C.GPLIGHTMODELXVOES)(getProcAddr(\"glLightModelxvOES\"))\n\tgpLightf = (C.GPLIGHTF)(getProcAddr(\"glLightf\"))\n\tif gpLightf == nil {\n\t\treturn errors.New(\"glLightf\")\n\t}\n\tgpLightfv = (C.GPLIGHTFV)(getProcAddr(\"glLightfv\"))\n\tif gpLightfv == nil {\n\t\treturn errors.New(\"glLightfv\")\n\t}\n\tgpLighti = (C.GPLIGHTI)(getProcAddr(\"glLighti\"))\n\tif gpLighti == nil {\n\t\treturn errors.New(\"glLighti\")\n\t}\n\tgpLightiv = (C.GPLIGHTIV)(getProcAddr(\"glLightiv\"))\n\tif gpLightiv == nil {\n\t\treturn errors.New(\"glLightiv\")\n\t}\n\tgpLightxOES = (C.GPLIGHTXOES)(getProcAddr(\"glLightxOES\"))\n\tgpLightxvOES = (C.GPLIGHTXVOES)(getProcAddr(\"glLightxvOES\"))\n\tgpLineStipple = (C.GPLINESTIPPLE)(getProcAddr(\"glLineStipple\"))\n\tif gpLineStipple == nil {\n\t\treturn errors.New(\"glLineStipple\")\n\t}\n\tgpLineWidth = (C.GPLINEWIDTH)(getProcAddr(\"glLineWidth\"))\n\tif gpLineWidth == nil {\n\t\treturn errors.New(\"glLineWidth\")\n\t}\n\tgpLineWidthxOES = (C.GPLINEWIDTHXOES)(getProcAddr(\"glLineWidthxOES\"))\n\tgpLinkProgram = (C.GPLINKPROGRAM)(getProcAddr(\"glLinkProgram\"))\n\tif gpLinkProgram == nil {\n\t\treturn errors.New(\"glLinkProgram\")\n\t}\n\tgpLinkProgramARB = (C.GPLINKPROGRAMARB)(getProcAddr(\"glLinkProgramARB\"))\n\tgpListBase = (C.GPLISTBASE)(getProcAddr(\"glListBase\"))\n\tif gpListBase == nil {\n\t\treturn errors.New(\"glListBase\")\n\t}\n\tgpListDrawCommandsStatesClientNV = (C.GPLISTDRAWCOMMANDSSTATESCLIENTNV)(getProcAddr(\"glListDrawCommandsStatesClientNV\"))\n\tgpListParameterfSGIX = (C.GPLISTPARAMETERFSGIX)(getProcAddr(\"glListParameterfSGIX\"))\n\tgpListParameterfvSGIX = (C.GPLISTPARAMETERFVSGIX)(getProcAddr(\"glListParameterfvSGIX\"))\n\tgpListParameteriSGIX = (C.GPLISTPARAMETERISGIX)(getProcAddr(\"glListParameteriSGIX\"))\n\tgpListParameterivSGIX = (C.GPLISTPARAMETERIVSGIX)(getProcAddr(\"glListParameterivSGIX\"))\n\tgpLoadIdentity = (C.GPLOADIDENTITY)(getProcAddr(\"glLoadIdentity\"))\n\tif gpLoadIdentity == nil {\n\t\treturn errors.New(\"glLoadIdentity\")\n\t}\n\tgpLoadIdentityDeformationMapSGIX = (C.GPLOADIDENTITYDEFORMATIONMAPSGIX)(getProcAddr(\"glLoadIdentityDeformationMapSGIX\"))\n\tgpLoadMatrixd = (C.GPLOADMATRIXD)(getProcAddr(\"glLoadMatrixd\"))\n\tif gpLoadMatrixd == nil {\n\t\treturn errors.New(\"glLoadMatrixd\")\n\t}\n\tgpLoadMatrixf = (C.GPLOADMATRIXF)(getProcAddr(\"glLoadMatrixf\"))\n\tif gpLoadMatrixf == nil {\n\t\treturn errors.New(\"glLoadMatrixf\")\n\t}\n\tgpLoadMatrixxOES = (C.GPLOADMATRIXXOES)(getProcAddr(\"glLoadMatrixxOES\"))\n\tgpLoadName = (C.GPLOADNAME)(getProcAddr(\"glLoadName\"))\n\tif gpLoadName == nil {\n\t\treturn errors.New(\"glLoadName\")\n\t}\n\tgpLoadProgramNV = (C.GPLOADPROGRAMNV)(getProcAddr(\"glLoadProgramNV\"))\n\tgpLoadTransposeMatrixd = (C.GPLOADTRANSPOSEMATRIXD)(getProcAddr(\"glLoadTransposeMatrixd\"))\n\tif gpLoadTransposeMatrixd == nil {\n\t\treturn errors.New(\"glLoadTransposeMatrixd\")\n\t}\n\tgpLoadTransposeMatrixdARB = (C.GPLOADTRANSPOSEMATRIXDARB)(getProcAddr(\"glLoadTransposeMatrixdARB\"))\n\tgpLoadTransposeMatrixf = (C.GPLOADTRANSPOSEMATRIXF)(getProcAddr(\"glLoadTransposeMatrixf\"))\n\tif gpLoadTransposeMatrixf == nil {\n\t\treturn errors.New(\"glLoadTransposeMatrixf\")\n\t}\n\tgpLoadTransposeMatrixfARB = (C.GPLOADTRANSPOSEMATRIXFARB)(getProcAddr(\"glLoadTransposeMatrixfARB\"))\n\tgpLoadTransposeMatrixxOES = (C.GPLOADTRANSPOSEMATRIXXOES)(getProcAddr(\"glLoadTransposeMatrixxOES\"))\n\tgpLockArraysEXT = (C.GPLOCKARRAYSEXT)(getProcAddr(\"glLockArraysEXT\"))\n\tgpLogicOp = (C.GPLOGICOP)(getProcAddr(\"glLogicOp\"))\n\tif gpLogicOp == nil {\n\t\treturn errors.New(\"glLogicOp\")\n\t}\n\tgpMakeBufferNonResidentNV = (C.GPMAKEBUFFERNONRESIDENTNV)(getProcAddr(\"glMakeBufferNonResidentNV\"))\n\tgpMakeBufferResidentNV = (C.GPMAKEBUFFERRESIDENTNV)(getProcAddr(\"glMakeBufferResidentNV\"))\n\tgpMakeImageHandleNonResidentARB = (C.GPMAKEIMAGEHANDLENONRESIDENTARB)(getProcAddr(\"glMakeImageHandleNonResidentARB\"))\n\tgpMakeImageHandleNonResidentNV = (C.GPMAKEIMAGEHANDLENONRESIDENTNV)(getProcAddr(\"glMakeImageHandleNonResidentNV\"))\n\tgpMakeImageHandleResidentARB = (C.GPMAKEIMAGEHANDLERESIDENTARB)(getProcAddr(\"glMakeImageHandleResidentARB\"))\n\tgpMakeImageHandleResidentNV = (C.GPMAKEIMAGEHANDLERESIDENTNV)(getProcAddr(\"glMakeImageHandleResidentNV\"))\n\tgpMakeNamedBufferNonResidentNV = (C.GPMAKENAMEDBUFFERNONRESIDENTNV)(getProcAddr(\"glMakeNamedBufferNonResidentNV\"))\n\tgpMakeNamedBufferResidentNV = (C.GPMAKENAMEDBUFFERRESIDENTNV)(getProcAddr(\"glMakeNamedBufferResidentNV\"))\n\tgpMakeTextureHandleNonResidentARB = (C.GPMAKETEXTUREHANDLENONRESIDENTARB)(getProcAddr(\"glMakeTextureHandleNonResidentARB\"))\n\tgpMakeTextureHandleNonResidentNV = (C.GPMAKETEXTUREHANDLENONRESIDENTNV)(getProcAddr(\"glMakeTextureHandleNonResidentNV\"))\n\tgpMakeTextureHandleResidentARB = (C.GPMAKETEXTUREHANDLERESIDENTARB)(getProcAddr(\"glMakeTextureHandleResidentARB\"))\n\tgpMakeTextureHandleResidentNV = (C.GPMAKETEXTUREHANDLERESIDENTNV)(getProcAddr(\"glMakeTextureHandleResidentNV\"))\n\tgpMap1d = (C.GPMAP1D)(getProcAddr(\"glMap1d\"))\n\tif gpMap1d == nil {\n\t\treturn errors.New(\"glMap1d\")\n\t}\n\tgpMap1f = (C.GPMAP1F)(getProcAddr(\"glMap1f\"))\n\tif gpMap1f == nil {\n\t\treturn errors.New(\"glMap1f\")\n\t}\n\tgpMap1xOES = (C.GPMAP1XOES)(getProcAddr(\"glMap1xOES\"))\n\tgpMap2d = (C.GPMAP2D)(getProcAddr(\"glMap2d\"))\n\tif gpMap2d == nil {\n\t\treturn errors.New(\"glMap2d\")\n\t}\n\tgpMap2f = (C.GPMAP2F)(getProcAddr(\"glMap2f\"))\n\tif gpMap2f == nil {\n\t\treturn errors.New(\"glMap2f\")\n\t}\n\tgpMap2xOES = (C.GPMAP2XOES)(getProcAddr(\"glMap2xOES\"))\n\tgpMapBuffer = (C.GPMAPBUFFER)(getProcAddr(\"glMapBuffer\"))\n\tif gpMapBuffer == nil {\n\t\treturn errors.New(\"glMapBuffer\")\n\t}\n\tgpMapBufferARB = (C.GPMAPBUFFERARB)(getProcAddr(\"glMapBufferARB\"))\n\tgpMapBufferRange = (C.GPMAPBUFFERRANGE)(getProcAddr(\"glMapBufferRange\"))\n\tif gpMapBufferRange == nil {\n\t\treturn errors.New(\"glMapBufferRange\")\n\t}\n\tgpMapControlPointsNV = (C.GPMAPCONTROLPOINTSNV)(getProcAddr(\"glMapControlPointsNV\"))\n\tgpMapGrid1d = (C.GPMAPGRID1D)(getProcAddr(\"glMapGrid1d\"))\n\tif gpMapGrid1d == nil {\n\t\treturn errors.New(\"glMapGrid1d\")\n\t}\n\tgpMapGrid1f = (C.GPMAPGRID1F)(getProcAddr(\"glMapGrid1f\"))\n\tif gpMapGrid1f == nil {\n\t\treturn errors.New(\"glMapGrid1f\")\n\t}\n\tgpMapGrid1xOES = (C.GPMAPGRID1XOES)(getProcAddr(\"glMapGrid1xOES\"))\n\tgpMapGrid2d = (C.GPMAPGRID2D)(getProcAddr(\"glMapGrid2d\"))\n\tif gpMapGrid2d == nil {\n\t\treturn errors.New(\"glMapGrid2d\")\n\t}\n\tgpMapGrid2f = (C.GPMAPGRID2F)(getProcAddr(\"glMapGrid2f\"))\n\tif gpMapGrid2f == nil {\n\t\treturn errors.New(\"glMapGrid2f\")\n\t}\n\tgpMapGrid2xOES = (C.GPMAPGRID2XOES)(getProcAddr(\"glMapGrid2xOES\"))\n\tgpMapNamedBuffer = (C.GPMAPNAMEDBUFFER)(getProcAddr(\"glMapNamedBuffer\"))\n\tgpMapNamedBufferEXT = (C.GPMAPNAMEDBUFFEREXT)(getProcAddr(\"glMapNamedBufferEXT\"))\n\tgpMapNamedBufferRange = (C.GPMAPNAMEDBUFFERRANGE)(getProcAddr(\"glMapNamedBufferRange\"))\n\tgpMapNamedBufferRangeEXT = (C.GPMAPNAMEDBUFFERRANGEEXT)(getProcAddr(\"glMapNamedBufferRangeEXT\"))\n\tgpMapObjectBufferATI = (C.GPMAPOBJECTBUFFERATI)(getProcAddr(\"glMapObjectBufferATI\"))\n\tgpMapParameterfvNV = (C.GPMAPPARAMETERFVNV)(getProcAddr(\"glMapParameterfvNV\"))\n\tgpMapParameterivNV = (C.GPMAPPARAMETERIVNV)(getProcAddr(\"glMapParameterivNV\"))\n\tgpMapTexture2DINTEL = (C.GPMAPTEXTURE2DINTEL)(getProcAddr(\"glMapTexture2DINTEL\"))\n\tgpMapVertexAttrib1dAPPLE = (C.GPMAPVERTEXATTRIB1DAPPLE)(getProcAddr(\"glMapVertexAttrib1dAPPLE\"))\n\tgpMapVertexAttrib1fAPPLE = (C.GPMAPVERTEXATTRIB1FAPPLE)(getProcAddr(\"glMapVertexAttrib1fAPPLE\"))\n\tgpMapVertexAttrib2dAPPLE = (C.GPMAPVERTEXATTRIB2DAPPLE)(getProcAddr(\"glMapVertexAttrib2dAPPLE\"))\n\tgpMapVertexAttrib2fAPPLE = (C.GPMAPVERTEXATTRIB2FAPPLE)(getProcAddr(\"glMapVertexAttrib2fAPPLE\"))\n\tgpMaterialf = (C.GPMATERIALF)(getProcAddr(\"glMaterialf\"))\n\tif gpMaterialf == nil {\n\t\treturn errors.New(\"glMaterialf\")\n\t}\n\tgpMaterialfv = (C.GPMATERIALFV)(getProcAddr(\"glMaterialfv\"))\n\tif gpMaterialfv == nil {\n\t\treturn errors.New(\"glMaterialfv\")\n\t}\n\tgpMateriali = (C.GPMATERIALI)(getProcAddr(\"glMateriali\"))\n\tif gpMateriali == nil {\n\t\treturn errors.New(\"glMateriali\")\n\t}\n\tgpMaterialiv = (C.GPMATERIALIV)(getProcAddr(\"glMaterialiv\"))\n\tif gpMaterialiv == nil {\n\t\treturn errors.New(\"glMaterialiv\")\n\t}\n\tgpMaterialxOES = (C.GPMATERIALXOES)(getProcAddr(\"glMaterialxOES\"))\n\tgpMaterialxvOES = (C.GPMATERIALXVOES)(getProcAddr(\"glMaterialxvOES\"))\n\tgpMatrixFrustumEXT = (C.GPMATRIXFRUSTUMEXT)(getProcAddr(\"glMatrixFrustumEXT\"))\n\tgpMatrixIndexPointerARB = (C.GPMATRIXINDEXPOINTERARB)(getProcAddr(\"glMatrixIndexPointerARB\"))\n\tgpMatrixIndexubvARB = (C.GPMATRIXINDEXUBVARB)(getProcAddr(\"glMatrixIndexubvARB\"))\n\tgpMatrixIndexuivARB = (C.GPMATRIXINDEXUIVARB)(getProcAddr(\"glMatrixIndexuivARB\"))\n\tgpMatrixIndexusvARB = (C.GPMATRIXINDEXUSVARB)(getProcAddr(\"glMatrixIndexusvARB\"))\n\tgpMatrixLoad3x2fNV = (C.GPMATRIXLOAD3X2FNV)(getProcAddr(\"glMatrixLoad3x2fNV\"))\n\tgpMatrixLoad3x3fNV = (C.GPMATRIXLOAD3X3FNV)(getProcAddr(\"glMatrixLoad3x3fNV\"))\n\tgpMatrixLoadIdentityEXT = (C.GPMATRIXLOADIDENTITYEXT)(getProcAddr(\"glMatrixLoadIdentityEXT\"))\n\tgpMatrixLoadTranspose3x3fNV = (C.GPMATRIXLOADTRANSPOSE3X3FNV)(getProcAddr(\"glMatrixLoadTranspose3x3fNV\"))\n\tgpMatrixLoadTransposedEXT = (C.GPMATRIXLOADTRANSPOSEDEXT)(getProcAddr(\"glMatrixLoadTransposedEXT\"))\n\tgpMatrixLoadTransposefEXT = (C.GPMATRIXLOADTRANSPOSEFEXT)(getProcAddr(\"glMatrixLoadTransposefEXT\"))\n\tgpMatrixLoaddEXT = (C.GPMATRIXLOADDEXT)(getProcAddr(\"glMatrixLoaddEXT\"))\n\tgpMatrixLoadfEXT = (C.GPMATRIXLOADFEXT)(getProcAddr(\"glMatrixLoadfEXT\"))\n\tgpMatrixMode = (C.GPMATRIXMODE)(getProcAddr(\"glMatrixMode\"))\n\tif gpMatrixMode == nil {\n\t\treturn errors.New(\"glMatrixMode\")\n\t}\n\tgpMatrixMult3x2fNV = (C.GPMATRIXMULT3X2FNV)(getProcAddr(\"glMatrixMult3x2fNV\"))\n\tgpMatrixMult3x3fNV = (C.GPMATRIXMULT3X3FNV)(getProcAddr(\"glMatrixMult3x3fNV\"))\n\tgpMatrixMultTranspose3x3fNV = (C.GPMATRIXMULTTRANSPOSE3X3FNV)(getProcAddr(\"glMatrixMultTranspose3x3fNV\"))\n\tgpMatrixMultTransposedEXT = (C.GPMATRIXMULTTRANSPOSEDEXT)(getProcAddr(\"glMatrixMultTransposedEXT\"))\n\tgpMatrixMultTransposefEXT = (C.GPMATRIXMULTTRANSPOSEFEXT)(getProcAddr(\"glMatrixMultTransposefEXT\"))\n\tgpMatrixMultdEXT = (C.GPMATRIXMULTDEXT)(getProcAddr(\"glMatrixMultdEXT\"))\n\tgpMatrixMultfEXT = (C.GPMATRIXMULTFEXT)(getProcAddr(\"glMatrixMultfEXT\"))\n\tgpMatrixOrthoEXT = (C.GPMATRIXORTHOEXT)(getProcAddr(\"glMatrixOrthoEXT\"))\n\tgpMatrixPopEXT = (C.GPMATRIXPOPEXT)(getProcAddr(\"glMatrixPopEXT\"))\n\tgpMatrixPushEXT = (C.GPMATRIXPUSHEXT)(getProcAddr(\"glMatrixPushEXT\"))\n\tgpMatrixRotatedEXT = (C.GPMATRIXROTATEDEXT)(getProcAddr(\"glMatrixRotatedEXT\"))\n\tgpMatrixRotatefEXT = (C.GPMATRIXROTATEFEXT)(getProcAddr(\"glMatrixRotatefEXT\"))\n\tgpMatrixScaledEXT = (C.GPMATRIXSCALEDEXT)(getProcAddr(\"glMatrixScaledEXT\"))\n\tgpMatrixScalefEXT = (C.GPMATRIXSCALEFEXT)(getProcAddr(\"glMatrixScalefEXT\"))\n\tgpMatrixTranslatedEXT = (C.GPMATRIXTRANSLATEDEXT)(getProcAddr(\"glMatrixTranslatedEXT\"))\n\tgpMatrixTranslatefEXT = (C.GPMATRIXTRANSLATEFEXT)(getProcAddr(\"glMatrixTranslatefEXT\"))\n\tgpMaxShaderCompilerThreadsARB = (C.GPMAXSHADERCOMPILERTHREADSARB)(getProcAddr(\"glMaxShaderCompilerThreadsARB\"))\n\tgpMaxShaderCompilerThreadsKHR = (C.GPMAXSHADERCOMPILERTHREADSKHR)(getProcAddr(\"glMaxShaderCompilerThreadsKHR\"))\n\tgpMemoryBarrier = (C.GPMEMORYBARRIER)(getProcAddr(\"glMemoryBarrier\"))\n\tif gpMemoryBarrier == nil {\n\t\treturn errors.New(\"glMemoryBarrier\")\n\t}\n\tgpMemoryBarrierByRegion = (C.GPMEMORYBARRIERBYREGION)(getProcAddr(\"glMemoryBarrierByRegion\"))\n\tgpMemoryBarrierEXT = (C.GPMEMORYBARRIEREXT)(getProcAddr(\"glMemoryBarrierEXT\"))\n\tgpMemoryObjectParameterivEXT = (C.GPMEMORYOBJECTPARAMETERIVEXT)(getProcAddr(\"glMemoryObjectParameterivEXT\"))\n\tgpMinSampleShading = (C.GPMINSAMPLESHADING)(getProcAddr(\"glMinSampleShading\"))\n\tif gpMinSampleShading == nil {\n\t\treturn errors.New(\"glMinSampleShading\")\n\t}\n\tgpMinSampleShadingARB = (C.GPMINSAMPLESHADINGARB)(getProcAddr(\"glMinSampleShadingARB\"))\n\tgpMinmax = (C.GPMINMAX)(getProcAddr(\"glMinmax\"))\n\tgpMinmaxEXT = (C.GPMINMAXEXT)(getProcAddr(\"glMinmaxEXT\"))\n\tgpMultMatrixd = (C.GPMULTMATRIXD)(getProcAddr(\"glMultMatrixd\"))\n\tif gpMultMatrixd == nil {\n\t\treturn errors.New(\"glMultMatrixd\")\n\t}\n\tgpMultMatrixf = (C.GPMULTMATRIXF)(getProcAddr(\"glMultMatrixf\"))\n\tif gpMultMatrixf == nil {\n\t\treturn errors.New(\"glMultMatrixf\")\n\t}\n\tgpMultMatrixxOES = (C.GPMULTMATRIXXOES)(getProcAddr(\"glMultMatrixxOES\"))\n\tgpMultTransposeMatrixd = (C.GPMULTTRANSPOSEMATRIXD)(getProcAddr(\"glMultTransposeMatrixd\"))\n\tif gpMultTransposeMatrixd == nil {\n\t\treturn errors.New(\"glMultTransposeMatrixd\")\n\t}\n\tgpMultTransposeMatrixdARB = (C.GPMULTTRANSPOSEMATRIXDARB)(getProcAddr(\"glMultTransposeMatrixdARB\"))\n\tgpMultTransposeMatrixf = (C.GPMULTTRANSPOSEMATRIXF)(getProcAddr(\"glMultTransposeMatrixf\"))\n\tif gpMultTransposeMatrixf == nil {\n\t\treturn errors.New(\"glMultTransposeMatrixf\")\n\t}\n\tgpMultTransposeMatrixfARB = (C.GPMULTTRANSPOSEMATRIXFARB)(getProcAddr(\"glMultTransposeMatrixfARB\"))\n\tgpMultTransposeMatrixxOES = (C.GPMULTTRANSPOSEMATRIXXOES)(getProcAddr(\"glMultTransposeMatrixxOES\"))\n\tgpMultiDrawArrays = (C.GPMULTIDRAWARRAYS)(getProcAddr(\"glMultiDrawArrays\"))\n\tif gpMultiDrawArrays == nil {\n\t\treturn errors.New(\"glMultiDrawArrays\")\n\t}\n\tgpMultiDrawArraysEXT = (C.GPMULTIDRAWARRAYSEXT)(getProcAddr(\"glMultiDrawArraysEXT\"))\n\tgpMultiDrawArraysIndirect = (C.GPMULTIDRAWARRAYSINDIRECT)(getProcAddr(\"glMultiDrawArraysIndirect\"))\n\tif gpMultiDrawArraysIndirect == nil {\n\t\treturn errors.New(\"glMultiDrawArraysIndirect\")\n\t}\n\tgpMultiDrawArraysIndirectAMD = (C.GPMULTIDRAWARRAYSINDIRECTAMD)(getProcAddr(\"glMultiDrawArraysIndirectAMD\"))\n\tgpMultiDrawArraysIndirectBindlessCountNV = (C.GPMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNV)(getProcAddr(\"glMultiDrawArraysIndirectBindlessCountNV\"))\n\tgpMultiDrawArraysIndirectBindlessNV = (C.GPMULTIDRAWARRAYSINDIRECTBINDLESSNV)(getProcAddr(\"glMultiDrawArraysIndirectBindlessNV\"))\n\tgpMultiDrawArraysIndirectCountARB = (C.GPMULTIDRAWARRAYSINDIRECTCOUNTARB)(getProcAddr(\"glMultiDrawArraysIndirectCountARB\"))\n\tgpMultiDrawElementArrayAPPLE = (C.GPMULTIDRAWELEMENTARRAYAPPLE)(getProcAddr(\"glMultiDrawElementArrayAPPLE\"))\n\tgpMultiDrawElements = (C.GPMULTIDRAWELEMENTS)(getProcAddr(\"glMultiDrawElements\"))\n\tif gpMultiDrawElements == nil {\n\t\treturn errors.New(\"glMultiDrawElements\")\n\t}\n\tgpMultiDrawElementsBaseVertex = (C.GPMULTIDRAWELEMENTSBASEVERTEX)(getProcAddr(\"glMultiDrawElementsBaseVertex\"))\n\tif gpMultiDrawElementsBaseVertex == nil {\n\t\treturn errors.New(\"glMultiDrawElementsBaseVertex\")\n\t}\n\tgpMultiDrawElementsEXT = (C.GPMULTIDRAWELEMENTSEXT)(getProcAddr(\"glMultiDrawElementsEXT\"))\n\tgpMultiDrawElementsIndirect = (C.GPMULTIDRAWELEMENTSINDIRECT)(getProcAddr(\"glMultiDrawElementsIndirect\"))\n\tif gpMultiDrawElementsIndirect == nil {\n\t\treturn errors.New(\"glMultiDrawElementsIndirect\")\n\t}\n\tgpMultiDrawElementsIndirectAMD = (C.GPMULTIDRAWELEMENTSINDIRECTAMD)(getProcAddr(\"glMultiDrawElementsIndirectAMD\"))\n\tgpMultiDrawElementsIndirectBindlessCountNV = (C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNV)(getProcAddr(\"glMultiDrawElementsIndirectBindlessCountNV\"))\n\tgpMultiDrawElementsIndirectBindlessNV = (C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSNV)(getProcAddr(\"glMultiDrawElementsIndirectBindlessNV\"))\n\tgpMultiDrawElementsIndirectCountARB = (C.GPMULTIDRAWELEMENTSINDIRECTCOUNTARB)(getProcAddr(\"glMultiDrawElementsIndirectCountARB\"))\n\tgpMultiDrawMeshTasksIndirectCountNV = (C.GPMULTIDRAWMESHTASKSINDIRECTCOUNTNV)(getProcAddr(\"glMultiDrawMeshTasksIndirectCountNV\"))\n\tgpMultiDrawMeshTasksIndirectNV = (C.GPMULTIDRAWMESHTASKSINDIRECTNV)(getProcAddr(\"glMultiDrawMeshTasksIndirectNV\"))\n\tgpMultiDrawRangeElementArrayAPPLE = (C.GPMULTIDRAWRANGEELEMENTARRAYAPPLE)(getProcAddr(\"glMultiDrawRangeElementArrayAPPLE\"))\n\tgpMultiModeDrawArraysIBM = (C.GPMULTIMODEDRAWARRAYSIBM)(getProcAddr(\"glMultiModeDrawArraysIBM\"))\n\tgpMultiModeDrawElementsIBM = (C.GPMULTIMODEDRAWELEMENTSIBM)(getProcAddr(\"glMultiModeDrawElementsIBM\"))\n\tgpMultiTexBufferEXT = (C.GPMULTITEXBUFFEREXT)(getProcAddr(\"glMultiTexBufferEXT\"))\n\tgpMultiTexCoord1bOES = (C.GPMULTITEXCOORD1BOES)(getProcAddr(\"glMultiTexCoord1bOES\"))\n\tgpMultiTexCoord1bvOES = (C.GPMULTITEXCOORD1BVOES)(getProcAddr(\"glMultiTexCoord1bvOES\"))\n\tgpMultiTexCoord1d = (C.GPMULTITEXCOORD1D)(getProcAddr(\"glMultiTexCoord1d\"))\n\tif gpMultiTexCoord1d == nil {\n\t\treturn errors.New(\"glMultiTexCoord1d\")\n\t}\n\tgpMultiTexCoord1dARB = (C.GPMULTITEXCOORD1DARB)(getProcAddr(\"glMultiTexCoord1dARB\"))\n\tgpMultiTexCoord1dv = (C.GPMULTITEXCOORD1DV)(getProcAddr(\"glMultiTexCoord1dv\"))\n\tif gpMultiTexCoord1dv == nil {\n\t\treturn errors.New(\"glMultiTexCoord1dv\")\n\t}\n\tgpMultiTexCoord1dvARB = (C.GPMULTITEXCOORD1DVARB)(getProcAddr(\"glMultiTexCoord1dvARB\"))\n\tgpMultiTexCoord1f = (C.GPMULTITEXCOORD1F)(getProcAddr(\"glMultiTexCoord1f\"))\n\tif gpMultiTexCoord1f == nil {\n\t\treturn errors.New(\"glMultiTexCoord1f\")\n\t}\n\tgpMultiTexCoord1fARB = (C.GPMULTITEXCOORD1FARB)(getProcAddr(\"glMultiTexCoord1fARB\"))\n\tgpMultiTexCoord1fv = (C.GPMULTITEXCOORD1FV)(getProcAddr(\"glMultiTexCoord1fv\"))\n\tif gpMultiTexCoord1fv == nil {\n\t\treturn errors.New(\"glMultiTexCoord1fv\")\n\t}\n\tgpMultiTexCoord1fvARB = (C.GPMULTITEXCOORD1FVARB)(getProcAddr(\"glMultiTexCoord1fvARB\"))\n\tgpMultiTexCoord1hNV = (C.GPMULTITEXCOORD1HNV)(getProcAddr(\"glMultiTexCoord1hNV\"))\n\tgpMultiTexCoord1hvNV = (C.GPMULTITEXCOORD1HVNV)(getProcAddr(\"glMultiTexCoord1hvNV\"))\n\tgpMultiTexCoord1i = (C.GPMULTITEXCOORD1I)(getProcAddr(\"glMultiTexCoord1i\"))\n\tif gpMultiTexCoord1i == nil {\n\t\treturn errors.New(\"glMultiTexCoord1i\")\n\t}\n\tgpMultiTexCoord1iARB = (C.GPMULTITEXCOORD1IARB)(getProcAddr(\"glMultiTexCoord1iARB\"))\n\tgpMultiTexCoord1iv = (C.GPMULTITEXCOORD1IV)(getProcAddr(\"glMultiTexCoord1iv\"))\n\tif gpMultiTexCoord1iv == nil {\n\t\treturn errors.New(\"glMultiTexCoord1iv\")\n\t}\n\tgpMultiTexCoord1ivARB = (C.GPMULTITEXCOORD1IVARB)(getProcAddr(\"glMultiTexCoord1ivARB\"))\n\tgpMultiTexCoord1s = (C.GPMULTITEXCOORD1S)(getProcAddr(\"glMultiTexCoord1s\"))\n\tif gpMultiTexCoord1s == nil {\n\t\treturn errors.New(\"glMultiTexCoord1s\")\n\t}\n\tgpMultiTexCoord1sARB = (C.GPMULTITEXCOORD1SARB)(getProcAddr(\"glMultiTexCoord1sARB\"))\n\tgpMultiTexCoord1sv = (C.GPMULTITEXCOORD1SV)(getProcAddr(\"glMultiTexCoord1sv\"))\n\tif gpMultiTexCoord1sv == nil {\n\t\treturn errors.New(\"glMultiTexCoord1sv\")\n\t}\n\tgpMultiTexCoord1svARB = (C.GPMULTITEXCOORD1SVARB)(getProcAddr(\"glMultiTexCoord1svARB\"))\n\tgpMultiTexCoord1xOES = (C.GPMULTITEXCOORD1XOES)(getProcAddr(\"glMultiTexCoord1xOES\"))\n\tgpMultiTexCoord1xvOES = (C.GPMULTITEXCOORD1XVOES)(getProcAddr(\"glMultiTexCoord1xvOES\"))\n\tgpMultiTexCoord2bOES = (C.GPMULTITEXCOORD2BOES)(getProcAddr(\"glMultiTexCoord2bOES\"))\n\tgpMultiTexCoord2bvOES = (C.GPMULTITEXCOORD2BVOES)(getProcAddr(\"glMultiTexCoord2bvOES\"))\n\tgpMultiTexCoord2d = (C.GPMULTITEXCOORD2D)(getProcAddr(\"glMultiTexCoord2d\"))\n\tif gpMultiTexCoord2d == nil {\n\t\treturn errors.New(\"glMultiTexCoord2d\")\n\t}\n\tgpMultiTexCoord2dARB = (C.GPMULTITEXCOORD2DARB)(getProcAddr(\"glMultiTexCoord2dARB\"))\n\tgpMultiTexCoord2dv = (C.GPMULTITEXCOORD2DV)(getProcAddr(\"glMultiTexCoord2dv\"))\n\tif gpMultiTexCoord2dv == nil {\n\t\treturn errors.New(\"glMultiTexCoord2dv\")\n\t}\n\tgpMultiTexCoord2dvARB = (C.GPMULTITEXCOORD2DVARB)(getProcAddr(\"glMultiTexCoord2dvARB\"))\n\tgpMultiTexCoord2f = (C.GPMULTITEXCOORD2F)(getProcAddr(\"glMultiTexCoord2f\"))\n\tif gpMultiTexCoord2f == nil {\n\t\treturn errors.New(\"glMultiTexCoord2f\")\n\t}\n\tgpMultiTexCoord2fARB = (C.GPMULTITEXCOORD2FARB)(getProcAddr(\"glMultiTexCoord2fARB\"))\n\tgpMultiTexCoord2fv = (C.GPMULTITEXCOORD2FV)(getProcAddr(\"glMultiTexCoord2fv\"))\n\tif gpMultiTexCoord2fv == nil {\n\t\treturn errors.New(\"glMultiTexCoord2fv\")\n\t}\n\tgpMultiTexCoord2fvARB = (C.GPMULTITEXCOORD2FVARB)(getProcAddr(\"glMultiTexCoord2fvARB\"))\n\tgpMultiTexCoord2hNV = (C.GPMULTITEXCOORD2HNV)(getProcAddr(\"glMultiTexCoord2hNV\"))\n\tgpMultiTexCoord2hvNV = (C.GPMULTITEXCOORD2HVNV)(getProcAddr(\"glMultiTexCoord2hvNV\"))\n\tgpMultiTexCoord2i = (C.GPMULTITEXCOORD2I)(getProcAddr(\"glMultiTexCoord2i\"))\n\tif gpMultiTexCoord2i == nil {\n\t\treturn errors.New(\"glMultiTexCoord2i\")\n\t}\n\tgpMultiTexCoord2iARB = (C.GPMULTITEXCOORD2IARB)(getProcAddr(\"glMultiTexCoord2iARB\"))\n\tgpMultiTexCoord2iv = (C.GPMULTITEXCOORD2IV)(getProcAddr(\"glMultiTexCoord2iv\"))\n\tif gpMultiTexCoord2iv == nil {\n\t\treturn errors.New(\"glMultiTexCoord2iv\")\n\t}\n\tgpMultiTexCoord2ivARB = (C.GPMULTITEXCOORD2IVARB)(getProcAddr(\"glMultiTexCoord2ivARB\"))\n\tgpMultiTexCoord2s = (C.GPMULTITEXCOORD2S)(getProcAddr(\"glMultiTexCoord2s\"))\n\tif gpMultiTexCoord2s == nil {\n\t\treturn errors.New(\"glMultiTexCoord2s\")\n\t}\n\tgpMultiTexCoord2sARB = (C.GPMULTITEXCOORD2SARB)(getProcAddr(\"glMultiTexCoord2sARB\"))\n\tgpMultiTexCoord2sv = (C.GPMULTITEXCOORD2SV)(getProcAddr(\"glMultiTexCoord2sv\"))\n\tif gpMultiTexCoord2sv == nil {\n\t\treturn errors.New(\"glMultiTexCoord2sv\")\n\t}\n\tgpMultiTexCoord2svARB = (C.GPMULTITEXCOORD2SVARB)(getProcAddr(\"glMultiTexCoord2svARB\"))\n\tgpMultiTexCoord2xOES = (C.GPMULTITEXCOORD2XOES)(getProcAddr(\"glMultiTexCoord2xOES\"))\n\tgpMultiTexCoord2xvOES = (C.GPMULTITEXCOORD2XVOES)(getProcAddr(\"glMultiTexCoord2xvOES\"))\n\tgpMultiTexCoord3bOES = (C.GPMULTITEXCOORD3BOES)(getProcAddr(\"glMultiTexCoord3bOES\"))\n\tgpMultiTexCoord3bvOES = (C.GPMULTITEXCOORD3BVOES)(getProcAddr(\"glMultiTexCoord3bvOES\"))\n\tgpMultiTexCoord3d = (C.GPMULTITEXCOORD3D)(getProcAddr(\"glMultiTexCoord3d\"))\n\tif gpMultiTexCoord3d == nil {\n\t\treturn errors.New(\"glMultiTexCoord3d\")\n\t}\n\tgpMultiTexCoord3dARB = (C.GPMULTITEXCOORD3DARB)(getProcAddr(\"glMultiTexCoord3dARB\"))\n\tgpMultiTexCoord3dv = (C.GPMULTITEXCOORD3DV)(getProcAddr(\"glMultiTexCoord3dv\"))\n\tif gpMultiTexCoord3dv == nil {\n\t\treturn errors.New(\"glMultiTexCoord3dv\")\n\t}\n\tgpMultiTexCoord3dvARB = (C.GPMULTITEXCOORD3DVARB)(getProcAddr(\"glMultiTexCoord3dvARB\"))\n\tgpMultiTexCoord3f = (C.GPMULTITEXCOORD3F)(getProcAddr(\"glMultiTexCoord3f\"))\n\tif gpMultiTexCoord3f == nil {\n\t\treturn errors.New(\"glMultiTexCoord3f\")\n\t}\n\tgpMultiTexCoord3fARB = (C.GPMULTITEXCOORD3FARB)(getProcAddr(\"glMultiTexCoord3fARB\"))\n\tgpMultiTexCoord3fv = (C.GPMULTITEXCOORD3FV)(getProcAddr(\"glMultiTexCoord3fv\"))\n\tif gpMultiTexCoord3fv == nil {\n\t\treturn errors.New(\"glMultiTexCoord3fv\")\n\t}\n\tgpMultiTexCoord3fvARB = (C.GPMULTITEXCOORD3FVARB)(getProcAddr(\"glMultiTexCoord3fvARB\"))\n\tgpMultiTexCoord3hNV = (C.GPMULTITEXCOORD3HNV)(getProcAddr(\"glMultiTexCoord3hNV\"))\n\tgpMultiTexCoord3hvNV = (C.GPMULTITEXCOORD3HVNV)(getProcAddr(\"glMultiTexCoord3hvNV\"))\n\tgpMultiTexCoord3i = (C.GPMULTITEXCOORD3I)(getProcAddr(\"glMultiTexCoord3i\"))\n\tif gpMultiTexCoord3i == nil {\n\t\treturn errors.New(\"glMultiTexCoord3i\")\n\t}\n\tgpMultiTexCoord3iARB = (C.GPMULTITEXCOORD3IARB)(getProcAddr(\"glMultiTexCoord3iARB\"))\n\tgpMultiTexCoord3iv = (C.GPMULTITEXCOORD3IV)(getProcAddr(\"glMultiTexCoord3iv\"))\n\tif gpMultiTexCoord3iv == nil {\n\t\treturn errors.New(\"glMultiTexCoord3iv\")\n\t}\n\tgpMultiTexCoord3ivARB = (C.GPMULTITEXCOORD3IVARB)(getProcAddr(\"glMultiTexCoord3ivARB\"))\n\tgpMultiTexCoord3s = (C.GPMULTITEXCOORD3S)(getProcAddr(\"glMultiTexCoord3s\"))\n\tif gpMultiTexCoord3s == nil {\n\t\treturn errors.New(\"glMultiTexCoord3s\")\n\t}\n\tgpMultiTexCoord3sARB = (C.GPMULTITEXCOORD3SARB)(getProcAddr(\"glMultiTexCoord3sARB\"))\n\tgpMultiTexCoord3sv = (C.GPMULTITEXCOORD3SV)(getProcAddr(\"glMultiTexCoord3sv\"))\n\tif gpMultiTexCoord3sv == nil {\n\t\treturn errors.New(\"glMultiTexCoord3sv\")\n\t}\n\tgpMultiTexCoord3svARB = (C.GPMULTITEXCOORD3SVARB)(getProcAddr(\"glMultiTexCoord3svARB\"))\n\tgpMultiTexCoord3xOES = (C.GPMULTITEXCOORD3XOES)(getProcAddr(\"glMultiTexCoord3xOES\"))\n\tgpMultiTexCoord3xvOES = (C.GPMULTITEXCOORD3XVOES)(getProcAddr(\"glMultiTexCoord3xvOES\"))\n\tgpMultiTexCoord4bOES = (C.GPMULTITEXCOORD4BOES)(getProcAddr(\"glMultiTexCoord4bOES\"))\n\tgpMultiTexCoord4bvOES = (C.GPMULTITEXCOORD4BVOES)(getProcAddr(\"glMultiTexCoord4bvOES\"))\n\tgpMultiTexCoord4d = (C.GPMULTITEXCOORD4D)(getProcAddr(\"glMultiTexCoord4d\"))\n\tif gpMultiTexCoord4d == nil {\n\t\treturn errors.New(\"glMultiTexCoord4d\")\n\t}\n\tgpMultiTexCoord4dARB = (C.GPMULTITEXCOORD4DARB)(getProcAddr(\"glMultiTexCoord4dARB\"))\n\tgpMultiTexCoord4dv = (C.GPMULTITEXCOORD4DV)(getProcAddr(\"glMultiTexCoord4dv\"))\n\tif gpMultiTexCoord4dv == nil {\n\t\treturn errors.New(\"glMultiTexCoord4dv\")\n\t}\n\tgpMultiTexCoord4dvARB = (C.GPMULTITEXCOORD4DVARB)(getProcAddr(\"glMultiTexCoord4dvARB\"))\n\tgpMultiTexCoord4f = (C.GPMULTITEXCOORD4F)(getProcAddr(\"glMultiTexCoord4f\"))\n\tif gpMultiTexCoord4f == nil {\n\t\treturn errors.New(\"glMultiTexCoord4f\")\n\t}\n\tgpMultiTexCoord4fARB = (C.GPMULTITEXCOORD4FARB)(getProcAddr(\"glMultiTexCoord4fARB\"))\n\tgpMultiTexCoord4fv = (C.GPMULTITEXCOORD4FV)(getProcAddr(\"glMultiTexCoord4fv\"))\n\tif gpMultiTexCoord4fv == nil {\n\t\treturn errors.New(\"glMultiTexCoord4fv\")\n\t}\n\tgpMultiTexCoord4fvARB = (C.GPMULTITEXCOORD4FVARB)(getProcAddr(\"glMultiTexCoord4fvARB\"))\n\tgpMultiTexCoord4hNV = (C.GPMULTITEXCOORD4HNV)(getProcAddr(\"glMultiTexCoord4hNV\"))\n\tgpMultiTexCoord4hvNV = (C.GPMULTITEXCOORD4HVNV)(getProcAddr(\"glMultiTexCoord4hvNV\"))\n\tgpMultiTexCoord4i = (C.GPMULTITEXCOORD4I)(getProcAddr(\"glMultiTexCoord4i\"))\n\tif gpMultiTexCoord4i == nil {\n\t\treturn errors.New(\"glMultiTexCoord4i\")\n\t}\n\tgpMultiTexCoord4iARB = (C.GPMULTITEXCOORD4IARB)(getProcAddr(\"glMultiTexCoord4iARB\"))\n\tgpMultiTexCoord4iv = (C.GPMULTITEXCOORD4IV)(getProcAddr(\"glMultiTexCoord4iv\"))\n\tif gpMultiTexCoord4iv == nil {\n\t\treturn errors.New(\"glMultiTexCoord4iv\")\n\t}\n\tgpMultiTexCoord4ivARB = (C.GPMULTITEXCOORD4IVARB)(getProcAddr(\"glMultiTexCoord4ivARB\"))\n\tgpMultiTexCoord4s = (C.GPMULTITEXCOORD4S)(getProcAddr(\"glMultiTexCoord4s\"))\n\tif gpMultiTexCoord4s == nil {\n\t\treturn errors.New(\"glMultiTexCoord4s\")\n\t}\n\tgpMultiTexCoord4sARB = (C.GPMULTITEXCOORD4SARB)(getProcAddr(\"glMultiTexCoord4sARB\"))\n\tgpMultiTexCoord4sv = (C.GPMULTITEXCOORD4SV)(getProcAddr(\"glMultiTexCoord4sv\"))\n\tif gpMultiTexCoord4sv == nil {\n\t\treturn errors.New(\"glMultiTexCoord4sv\")\n\t}\n\tgpMultiTexCoord4svARB = (C.GPMULTITEXCOORD4SVARB)(getProcAddr(\"glMultiTexCoord4svARB\"))\n\tgpMultiTexCoord4xOES = (C.GPMULTITEXCOORD4XOES)(getProcAddr(\"glMultiTexCoord4xOES\"))\n\tgpMultiTexCoord4xvOES = (C.GPMULTITEXCOORD4XVOES)(getProcAddr(\"glMultiTexCoord4xvOES\"))\n\tgpMultiTexCoordP1ui = (C.GPMULTITEXCOORDP1UI)(getProcAddr(\"glMultiTexCoordP1ui\"))\n\tif gpMultiTexCoordP1ui == nil {\n\t\treturn errors.New(\"glMultiTexCoordP1ui\")\n\t}\n\tgpMultiTexCoordP1uiv = (C.GPMULTITEXCOORDP1UIV)(getProcAddr(\"glMultiTexCoordP1uiv\"))\n\tif gpMultiTexCoordP1uiv == nil {\n\t\treturn errors.New(\"glMultiTexCoordP1uiv\")\n\t}\n\tgpMultiTexCoordP2ui = (C.GPMULTITEXCOORDP2UI)(getProcAddr(\"glMultiTexCoordP2ui\"))\n\tif gpMultiTexCoordP2ui == nil {\n\t\treturn errors.New(\"glMultiTexCoordP2ui\")\n\t}\n\tgpMultiTexCoordP2uiv = (C.GPMULTITEXCOORDP2UIV)(getProcAddr(\"glMultiTexCoordP2uiv\"))\n\tif gpMultiTexCoordP2uiv == nil {\n\t\treturn errors.New(\"glMultiTexCoordP2uiv\")\n\t}\n\tgpMultiTexCoordP3ui = (C.GPMULTITEXCOORDP3UI)(getProcAddr(\"glMultiTexCoordP3ui\"))\n\tif gpMultiTexCoordP3ui == nil {\n\t\treturn errors.New(\"glMultiTexCoordP3ui\")\n\t}\n\tgpMultiTexCoordP3uiv = (C.GPMULTITEXCOORDP3UIV)(getProcAddr(\"glMultiTexCoordP3uiv\"))\n\tif gpMultiTexCoordP3uiv == nil {\n\t\treturn errors.New(\"glMultiTexCoordP3uiv\")\n\t}\n\tgpMultiTexCoordP4ui = (C.GPMULTITEXCOORDP4UI)(getProcAddr(\"glMultiTexCoordP4ui\"))\n\tif gpMultiTexCoordP4ui == nil {\n\t\treturn errors.New(\"glMultiTexCoordP4ui\")\n\t}\n\tgpMultiTexCoordP4uiv = (C.GPMULTITEXCOORDP4UIV)(getProcAddr(\"glMultiTexCoordP4uiv\"))\n\tif gpMultiTexCoordP4uiv == nil {\n\t\treturn errors.New(\"glMultiTexCoordP4uiv\")\n\t}\n\tgpMultiTexCoordPointerEXT = (C.GPMULTITEXCOORDPOINTEREXT)(getProcAddr(\"glMultiTexCoordPointerEXT\"))\n\tgpMultiTexEnvfEXT = (C.GPMULTITEXENVFEXT)(getProcAddr(\"glMultiTexEnvfEXT\"))\n\tgpMultiTexEnvfvEXT = (C.GPMULTITEXENVFVEXT)(getProcAddr(\"glMultiTexEnvfvEXT\"))\n\tgpMultiTexEnviEXT = (C.GPMULTITEXENVIEXT)(getProcAddr(\"glMultiTexEnviEXT\"))\n\tgpMultiTexEnvivEXT = (C.GPMULTITEXENVIVEXT)(getProcAddr(\"glMultiTexEnvivEXT\"))\n\tgpMultiTexGendEXT = (C.GPMULTITEXGENDEXT)(getProcAddr(\"glMultiTexGendEXT\"))\n\tgpMultiTexGendvEXT = (C.GPMULTITEXGENDVEXT)(getProcAddr(\"glMultiTexGendvEXT\"))\n\tgpMultiTexGenfEXT = (C.GPMULTITEXGENFEXT)(getProcAddr(\"glMultiTexGenfEXT\"))\n\tgpMultiTexGenfvEXT = (C.GPMULTITEXGENFVEXT)(getProcAddr(\"glMultiTexGenfvEXT\"))\n\tgpMultiTexGeniEXT = (C.GPMULTITEXGENIEXT)(getProcAddr(\"glMultiTexGeniEXT\"))\n\tgpMultiTexGenivEXT = (C.GPMULTITEXGENIVEXT)(getProcAddr(\"glMultiTexGenivEXT\"))\n\tgpMultiTexImage1DEXT = (C.GPMULTITEXIMAGE1DEXT)(getProcAddr(\"glMultiTexImage1DEXT\"))\n\tgpMultiTexImage2DEXT = (C.GPMULTITEXIMAGE2DEXT)(getProcAddr(\"glMultiTexImage2DEXT\"))\n\tgpMultiTexImage3DEXT = (C.GPMULTITEXIMAGE3DEXT)(getProcAddr(\"glMultiTexImage3DEXT\"))\n\tgpMultiTexParameterIivEXT = (C.GPMULTITEXPARAMETERIIVEXT)(getProcAddr(\"glMultiTexParameterIivEXT\"))\n\tgpMultiTexParameterIuivEXT = (C.GPMULTITEXPARAMETERIUIVEXT)(getProcAddr(\"glMultiTexParameterIuivEXT\"))\n\tgpMultiTexParameterfEXT = (C.GPMULTITEXPARAMETERFEXT)(getProcAddr(\"glMultiTexParameterfEXT\"))\n\tgpMultiTexParameterfvEXT = (C.GPMULTITEXPARAMETERFVEXT)(getProcAddr(\"glMultiTexParameterfvEXT\"))\n\tgpMultiTexParameteriEXT = (C.GPMULTITEXPARAMETERIEXT)(getProcAddr(\"glMultiTexParameteriEXT\"))\n\tgpMultiTexParameterivEXT = (C.GPMULTITEXPARAMETERIVEXT)(getProcAddr(\"glMultiTexParameterivEXT\"))\n\tgpMultiTexRenderbufferEXT = (C.GPMULTITEXRENDERBUFFEREXT)(getProcAddr(\"glMultiTexRenderbufferEXT\"))\n\tgpMultiTexSubImage1DEXT = (C.GPMULTITEXSUBIMAGE1DEXT)(getProcAddr(\"glMultiTexSubImage1DEXT\"))\n\tgpMultiTexSubImage2DEXT = (C.GPMULTITEXSUBIMAGE2DEXT)(getProcAddr(\"glMultiTexSubImage2DEXT\"))\n\tgpMultiTexSubImage3DEXT = (C.GPMULTITEXSUBIMAGE3DEXT)(getProcAddr(\"glMultiTexSubImage3DEXT\"))\n\tgpMulticastBarrierNV = (C.GPMULTICASTBARRIERNV)(getProcAddr(\"glMulticastBarrierNV\"))\n\tgpMulticastBlitFramebufferNV = (C.GPMULTICASTBLITFRAMEBUFFERNV)(getProcAddr(\"glMulticastBlitFramebufferNV\"))\n\tgpMulticastBufferSubDataNV = (C.GPMULTICASTBUFFERSUBDATANV)(getProcAddr(\"glMulticastBufferSubDataNV\"))\n\tgpMulticastCopyBufferSubDataNV = (C.GPMULTICASTCOPYBUFFERSUBDATANV)(getProcAddr(\"glMulticastCopyBufferSubDataNV\"))\n\tgpMulticastCopyImageSubDataNV = (C.GPMULTICASTCOPYIMAGESUBDATANV)(getProcAddr(\"glMulticastCopyImageSubDataNV\"))\n\tgpMulticastFramebufferSampleLocationsfvNV = (C.GPMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr(\"glMulticastFramebufferSampleLocationsfvNV\"))\n\tgpMulticastGetQueryObjecti64vNV = (C.GPMULTICASTGETQUERYOBJECTI64VNV)(getProcAddr(\"glMulticastGetQueryObjecti64vNV\"))\n\tgpMulticastGetQueryObjectivNV = (C.GPMULTICASTGETQUERYOBJECTIVNV)(getProcAddr(\"glMulticastGetQueryObjectivNV\"))\n\tgpMulticastGetQueryObjectui64vNV = (C.GPMULTICASTGETQUERYOBJECTUI64VNV)(getProcAddr(\"glMulticastGetQueryObjectui64vNV\"))\n\tgpMulticastGetQueryObjectuivNV = (C.GPMULTICASTGETQUERYOBJECTUIVNV)(getProcAddr(\"glMulticastGetQueryObjectuivNV\"))\n\tgpMulticastScissorArrayvNVX = (C.GPMULTICASTSCISSORARRAYVNVX)(getProcAddr(\"glMulticastScissorArrayvNVX\"))\n\tgpMulticastViewportArrayvNVX = (C.GPMULTICASTVIEWPORTARRAYVNVX)(getProcAddr(\"glMulticastViewportArrayvNVX\"))\n\tgpMulticastViewportPositionWScaleNVX = (C.GPMULTICASTVIEWPORTPOSITIONWSCALENVX)(getProcAddr(\"glMulticastViewportPositionWScaleNVX\"))\n\tgpMulticastWaitSyncNV = (C.GPMULTICASTWAITSYNCNV)(getProcAddr(\"glMulticastWaitSyncNV\"))\n\tgpNamedBufferAttachMemoryNV = (C.GPNAMEDBUFFERATTACHMEMORYNV)(getProcAddr(\"glNamedBufferAttachMemoryNV\"))\n\tgpNamedBufferData = (C.GPNAMEDBUFFERDATA)(getProcAddr(\"glNamedBufferData\"))\n\tgpNamedBufferDataEXT = (C.GPNAMEDBUFFERDATAEXT)(getProcAddr(\"glNamedBufferDataEXT\"))\n\tgpNamedBufferPageCommitmentARB = (C.GPNAMEDBUFFERPAGECOMMITMENTARB)(getProcAddr(\"glNamedBufferPageCommitmentARB\"))\n\tgpNamedBufferPageCommitmentEXT = (C.GPNAMEDBUFFERPAGECOMMITMENTEXT)(getProcAddr(\"glNamedBufferPageCommitmentEXT\"))\n\tgpNamedBufferPageCommitmentMemNV = (C.GPNAMEDBUFFERPAGECOMMITMENTMEMNV)(getProcAddr(\"glNamedBufferPageCommitmentMemNV\"))\n\tgpNamedBufferStorage = (C.GPNAMEDBUFFERSTORAGE)(getProcAddr(\"glNamedBufferStorage\"))\n\tgpNamedBufferStorageEXT = (C.GPNAMEDBUFFERSTORAGEEXT)(getProcAddr(\"glNamedBufferStorageEXT\"))\n\tgpNamedBufferStorageExternalEXT = (C.GPNAMEDBUFFERSTORAGEEXTERNALEXT)(getProcAddr(\"glNamedBufferStorageExternalEXT\"))\n\tgpNamedBufferStorageMemEXT = (C.GPNAMEDBUFFERSTORAGEMEMEXT)(getProcAddr(\"glNamedBufferStorageMemEXT\"))\n\tgpNamedBufferSubData = (C.GPNAMEDBUFFERSUBDATA)(getProcAddr(\"glNamedBufferSubData\"))\n\tgpNamedBufferSubDataEXT = (C.GPNAMEDBUFFERSUBDATAEXT)(getProcAddr(\"glNamedBufferSubDataEXT\"))\n\tgpNamedCopyBufferSubDataEXT = (C.GPNAMEDCOPYBUFFERSUBDATAEXT)(getProcAddr(\"glNamedCopyBufferSubDataEXT\"))\n\tgpNamedFramebufferDrawBuffer = (C.GPNAMEDFRAMEBUFFERDRAWBUFFER)(getProcAddr(\"glNamedFramebufferDrawBuffer\"))\n\tgpNamedFramebufferDrawBuffers = (C.GPNAMEDFRAMEBUFFERDRAWBUFFERS)(getProcAddr(\"glNamedFramebufferDrawBuffers\"))\n\tgpNamedFramebufferParameteri = (C.GPNAMEDFRAMEBUFFERPARAMETERI)(getProcAddr(\"glNamedFramebufferParameteri\"))\n\tgpNamedFramebufferParameteriEXT = (C.GPNAMEDFRAMEBUFFERPARAMETERIEXT)(getProcAddr(\"glNamedFramebufferParameteriEXT\"))\n\tgpNamedFramebufferReadBuffer = (C.GPNAMEDFRAMEBUFFERREADBUFFER)(getProcAddr(\"glNamedFramebufferReadBuffer\"))\n\tgpNamedFramebufferRenderbuffer = (C.GPNAMEDFRAMEBUFFERRENDERBUFFER)(getProcAddr(\"glNamedFramebufferRenderbuffer\"))\n\tgpNamedFramebufferRenderbufferEXT = (C.GPNAMEDFRAMEBUFFERRENDERBUFFEREXT)(getProcAddr(\"glNamedFramebufferRenderbufferEXT\"))\n\tgpNamedFramebufferSampleLocationsfvARB = (C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARB)(getProcAddr(\"glNamedFramebufferSampleLocationsfvARB\"))\n\tgpNamedFramebufferSampleLocationsfvNV = (C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr(\"glNamedFramebufferSampleLocationsfvNV\"))\n\tgpNamedFramebufferSamplePositionsfvAMD = (C.GPNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMD)(getProcAddr(\"glNamedFramebufferSamplePositionsfvAMD\"))\n\tgpNamedFramebufferTexture = (C.GPNAMEDFRAMEBUFFERTEXTURE)(getProcAddr(\"glNamedFramebufferTexture\"))\n\tgpNamedFramebufferTexture1DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE1DEXT)(getProcAddr(\"glNamedFramebufferTexture1DEXT\"))\n\tgpNamedFramebufferTexture2DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE2DEXT)(getProcAddr(\"glNamedFramebufferTexture2DEXT\"))\n\tgpNamedFramebufferTexture3DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE3DEXT)(getProcAddr(\"glNamedFramebufferTexture3DEXT\"))\n\tgpNamedFramebufferTextureEXT = (C.GPNAMEDFRAMEBUFFERTEXTUREEXT)(getProcAddr(\"glNamedFramebufferTextureEXT\"))\n\tgpNamedFramebufferTextureFaceEXT = (C.GPNAMEDFRAMEBUFFERTEXTUREFACEEXT)(getProcAddr(\"glNamedFramebufferTextureFaceEXT\"))\n\tgpNamedFramebufferTextureLayer = (C.GPNAMEDFRAMEBUFFERTEXTURELAYER)(getProcAddr(\"glNamedFramebufferTextureLayer\"))\n\tgpNamedFramebufferTextureLayerEXT = (C.GPNAMEDFRAMEBUFFERTEXTURELAYEREXT)(getProcAddr(\"glNamedFramebufferTextureLayerEXT\"))\n\tgpNamedProgramLocalParameter4dEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4DEXT)(getProcAddr(\"glNamedProgramLocalParameter4dEXT\"))\n\tgpNamedProgramLocalParameter4dvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4DVEXT)(getProcAddr(\"glNamedProgramLocalParameter4dvEXT\"))\n\tgpNamedProgramLocalParameter4fEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4FEXT)(getProcAddr(\"glNamedProgramLocalParameter4fEXT\"))\n\tgpNamedProgramLocalParameter4fvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4FVEXT)(getProcAddr(\"glNamedProgramLocalParameter4fvEXT\"))\n\tgpNamedProgramLocalParameterI4iEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4IEXT)(getProcAddr(\"glNamedProgramLocalParameterI4iEXT\"))\n\tgpNamedProgramLocalParameterI4ivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4IVEXT)(getProcAddr(\"glNamedProgramLocalParameterI4ivEXT\"))\n\tgpNamedProgramLocalParameterI4uiEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4UIEXT)(getProcAddr(\"glNamedProgramLocalParameterI4uiEXT\"))\n\tgpNamedProgramLocalParameterI4uivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4UIVEXT)(getProcAddr(\"glNamedProgramLocalParameterI4uivEXT\"))\n\tgpNamedProgramLocalParameters4fvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERS4FVEXT)(getProcAddr(\"glNamedProgramLocalParameters4fvEXT\"))\n\tgpNamedProgramLocalParametersI4ivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERSI4IVEXT)(getProcAddr(\"glNamedProgramLocalParametersI4ivEXT\"))\n\tgpNamedProgramLocalParametersI4uivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERSI4UIVEXT)(getProcAddr(\"glNamedProgramLocalParametersI4uivEXT\"))\n\tgpNamedProgramStringEXT = (C.GPNAMEDPROGRAMSTRINGEXT)(getProcAddr(\"glNamedProgramStringEXT\"))\n\tgpNamedRenderbufferStorage = (C.GPNAMEDRENDERBUFFERSTORAGE)(getProcAddr(\"glNamedRenderbufferStorage\"))\n\tgpNamedRenderbufferStorageEXT = (C.GPNAMEDRENDERBUFFERSTORAGEEXT)(getProcAddr(\"glNamedRenderbufferStorageEXT\"))\n\tgpNamedRenderbufferStorageMultisample = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr(\"glNamedRenderbufferStorageMultisample\"))\n\tgpNamedRenderbufferStorageMultisampleAdvancedAMD = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(getProcAddr(\"glNamedRenderbufferStorageMultisampleAdvancedAMD\"))\n\tgpNamedRenderbufferStorageMultisampleCoverageEXT = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXT)(getProcAddr(\"glNamedRenderbufferStorageMultisampleCoverageEXT\"))\n\tgpNamedRenderbufferStorageMultisampleEXT = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXT)(getProcAddr(\"glNamedRenderbufferStorageMultisampleEXT\"))\n\tgpNamedStringARB = (C.GPNAMEDSTRINGARB)(getProcAddr(\"glNamedStringARB\"))\n\tgpNewList = (C.GPNEWLIST)(getProcAddr(\"glNewList\"))\n\tif gpNewList == nil {\n\t\treturn errors.New(\"glNewList\")\n\t}\n\tgpNewObjectBufferATI = (C.GPNEWOBJECTBUFFERATI)(getProcAddr(\"glNewObjectBufferATI\"))\n\tgpNormal3b = (C.GPNORMAL3B)(getProcAddr(\"glNormal3b\"))\n\tif gpNormal3b == nil {\n\t\treturn errors.New(\"glNormal3b\")\n\t}\n\tgpNormal3bv = (C.GPNORMAL3BV)(getProcAddr(\"glNormal3bv\"))\n\tif gpNormal3bv == nil {\n\t\treturn errors.New(\"glNormal3bv\")\n\t}\n\tgpNormal3d = (C.GPNORMAL3D)(getProcAddr(\"glNormal3d\"))\n\tif gpNormal3d == nil {\n\t\treturn errors.New(\"glNormal3d\")\n\t}\n\tgpNormal3dv = (C.GPNORMAL3DV)(getProcAddr(\"glNormal3dv\"))\n\tif gpNormal3dv == nil {\n\t\treturn errors.New(\"glNormal3dv\")\n\t}\n\tgpNormal3f = (C.GPNORMAL3F)(getProcAddr(\"glNormal3f\"))\n\tif gpNormal3f == nil {\n\t\treturn errors.New(\"glNormal3f\")\n\t}\n\tgpNormal3fVertex3fSUN = (C.GPNORMAL3FVERTEX3FSUN)(getProcAddr(\"glNormal3fVertex3fSUN\"))\n\tgpNormal3fVertex3fvSUN = (C.GPNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glNormal3fVertex3fvSUN\"))\n\tgpNormal3fv = (C.GPNORMAL3FV)(getProcAddr(\"glNormal3fv\"))\n\tif gpNormal3fv == nil {\n\t\treturn errors.New(\"glNormal3fv\")\n\t}\n\tgpNormal3hNV = (C.GPNORMAL3HNV)(getProcAddr(\"glNormal3hNV\"))\n\tgpNormal3hvNV = (C.GPNORMAL3HVNV)(getProcAddr(\"glNormal3hvNV\"))\n\tgpNormal3i = (C.GPNORMAL3I)(getProcAddr(\"glNormal3i\"))\n\tif gpNormal3i == nil {\n\t\treturn errors.New(\"glNormal3i\")\n\t}\n\tgpNormal3iv = (C.GPNORMAL3IV)(getProcAddr(\"glNormal3iv\"))\n\tif gpNormal3iv == nil {\n\t\treturn errors.New(\"glNormal3iv\")\n\t}\n\tgpNormal3s = (C.GPNORMAL3S)(getProcAddr(\"glNormal3s\"))\n\tif gpNormal3s == nil {\n\t\treturn errors.New(\"glNormal3s\")\n\t}\n\tgpNormal3sv = (C.GPNORMAL3SV)(getProcAddr(\"glNormal3sv\"))\n\tif gpNormal3sv == nil {\n\t\treturn errors.New(\"glNormal3sv\")\n\t}\n\tgpNormal3xOES = (C.GPNORMAL3XOES)(getProcAddr(\"glNormal3xOES\"))\n\tgpNormal3xvOES = (C.GPNORMAL3XVOES)(getProcAddr(\"glNormal3xvOES\"))\n\tgpNormalFormatNV = (C.GPNORMALFORMATNV)(getProcAddr(\"glNormalFormatNV\"))\n\tgpNormalP3ui = (C.GPNORMALP3UI)(getProcAddr(\"glNormalP3ui\"))\n\tif gpNormalP3ui == nil {\n\t\treturn errors.New(\"glNormalP3ui\")\n\t}\n\tgpNormalP3uiv = (C.GPNORMALP3UIV)(getProcAddr(\"glNormalP3uiv\"))\n\tif gpNormalP3uiv == nil {\n\t\treturn errors.New(\"glNormalP3uiv\")\n\t}\n\tgpNormalPointer = (C.GPNORMALPOINTER)(getProcAddr(\"glNormalPointer\"))\n\tif gpNormalPointer == nil {\n\t\treturn errors.New(\"glNormalPointer\")\n\t}\n\tgpNormalPointerEXT = (C.GPNORMALPOINTEREXT)(getProcAddr(\"glNormalPointerEXT\"))\n\tgpNormalPointerListIBM = (C.GPNORMALPOINTERLISTIBM)(getProcAddr(\"glNormalPointerListIBM\"))\n\tgpNormalPointervINTEL = (C.GPNORMALPOINTERVINTEL)(getProcAddr(\"glNormalPointervINTEL\"))\n\tgpNormalStream3bATI = (C.GPNORMALSTREAM3BATI)(getProcAddr(\"glNormalStream3bATI\"))\n\tgpNormalStream3bvATI = (C.GPNORMALSTREAM3BVATI)(getProcAddr(\"glNormalStream3bvATI\"))\n\tgpNormalStream3dATI = (C.GPNORMALSTREAM3DATI)(getProcAddr(\"glNormalStream3dATI\"))\n\tgpNormalStream3dvATI = (C.GPNORMALSTREAM3DVATI)(getProcAddr(\"glNormalStream3dvATI\"))\n\tgpNormalStream3fATI = (C.GPNORMALSTREAM3FATI)(getProcAddr(\"glNormalStream3fATI\"))\n\tgpNormalStream3fvATI = (C.GPNORMALSTREAM3FVATI)(getProcAddr(\"glNormalStream3fvATI\"))\n\tgpNormalStream3iATI = (C.GPNORMALSTREAM3IATI)(getProcAddr(\"glNormalStream3iATI\"))\n\tgpNormalStream3ivATI = (C.GPNORMALSTREAM3IVATI)(getProcAddr(\"glNormalStream3ivATI\"))\n\tgpNormalStream3sATI = (C.GPNORMALSTREAM3SATI)(getProcAddr(\"glNormalStream3sATI\"))\n\tgpNormalStream3svATI = (C.GPNORMALSTREAM3SVATI)(getProcAddr(\"glNormalStream3svATI\"))\n\tgpObjectLabel = (C.GPOBJECTLABEL)(getProcAddr(\"glObjectLabel\"))\n\tif gpObjectLabel == nil {\n\t\treturn errors.New(\"glObjectLabel\")\n\t}\n\tgpObjectLabelKHR = (C.GPOBJECTLABELKHR)(getProcAddr(\"glObjectLabelKHR\"))\n\tgpObjectPtrLabel = (C.GPOBJECTPTRLABEL)(getProcAddr(\"glObjectPtrLabel\"))\n\tif gpObjectPtrLabel == nil {\n\t\treturn errors.New(\"glObjectPtrLabel\")\n\t}\n\tgpObjectPtrLabelKHR = (C.GPOBJECTPTRLABELKHR)(getProcAddr(\"glObjectPtrLabelKHR\"))\n\tgpObjectPurgeableAPPLE = (C.GPOBJECTPURGEABLEAPPLE)(getProcAddr(\"glObjectPurgeableAPPLE\"))\n\tgpObjectUnpurgeableAPPLE = (C.GPOBJECTUNPURGEABLEAPPLE)(getProcAddr(\"glObjectUnpurgeableAPPLE\"))\n\tgpOrtho = (C.GPORTHO)(getProcAddr(\"glOrtho\"))\n\tif gpOrtho == nil {\n\t\treturn errors.New(\"glOrtho\")\n\t}\n\tgpOrthofOES = (C.GPORTHOFOES)(getProcAddr(\"glOrthofOES\"))\n\tgpOrthoxOES = (C.GPORTHOXOES)(getProcAddr(\"glOrthoxOES\"))\n\tgpPNTrianglesfATI = (C.GPPNTRIANGLESFATI)(getProcAddr(\"glPNTrianglesfATI\"))\n\tgpPNTrianglesiATI = (C.GPPNTRIANGLESIATI)(getProcAddr(\"glPNTrianglesiATI\"))\n\tgpPassTexCoordATI = (C.GPPASSTEXCOORDATI)(getProcAddr(\"glPassTexCoordATI\"))\n\tgpPassThrough = (C.GPPASSTHROUGH)(getProcAddr(\"glPassThrough\"))\n\tif gpPassThrough == nil {\n\t\treturn errors.New(\"glPassThrough\")\n\t}\n\tgpPassThroughxOES = (C.GPPASSTHROUGHXOES)(getProcAddr(\"glPassThroughxOES\"))\n\tgpPatchParameterfv = (C.GPPATCHPARAMETERFV)(getProcAddr(\"glPatchParameterfv\"))\n\tif gpPatchParameterfv == nil {\n\t\treturn errors.New(\"glPatchParameterfv\")\n\t}\n\tgpPatchParameteri = (C.GPPATCHPARAMETERI)(getProcAddr(\"glPatchParameteri\"))\n\tif gpPatchParameteri == nil {\n\t\treturn errors.New(\"glPatchParameteri\")\n\t}\n\tgpPathColorGenNV = (C.GPPATHCOLORGENNV)(getProcAddr(\"glPathColorGenNV\"))\n\tgpPathCommandsNV = (C.GPPATHCOMMANDSNV)(getProcAddr(\"glPathCommandsNV\"))\n\tgpPathCoordsNV = (C.GPPATHCOORDSNV)(getProcAddr(\"glPathCoordsNV\"))\n\tgpPathCoverDepthFuncNV = (C.GPPATHCOVERDEPTHFUNCNV)(getProcAddr(\"glPathCoverDepthFuncNV\"))\n\tgpPathDashArrayNV = (C.GPPATHDASHARRAYNV)(getProcAddr(\"glPathDashArrayNV\"))\n\tgpPathFogGenNV = (C.GPPATHFOGGENNV)(getProcAddr(\"glPathFogGenNV\"))\n\tgpPathGlyphIndexArrayNV = (C.GPPATHGLYPHINDEXARRAYNV)(getProcAddr(\"glPathGlyphIndexArrayNV\"))\n\tgpPathGlyphIndexRangeNV = (C.GPPATHGLYPHINDEXRANGENV)(getProcAddr(\"glPathGlyphIndexRangeNV\"))\n\tgpPathGlyphRangeNV = (C.GPPATHGLYPHRANGENV)(getProcAddr(\"glPathGlyphRangeNV\"))\n\tgpPathGlyphsNV = (C.GPPATHGLYPHSNV)(getProcAddr(\"glPathGlyphsNV\"))\n\tgpPathMemoryGlyphIndexArrayNV = (C.GPPATHMEMORYGLYPHINDEXARRAYNV)(getProcAddr(\"glPathMemoryGlyphIndexArrayNV\"))\n\tgpPathParameterfNV = (C.GPPATHPARAMETERFNV)(getProcAddr(\"glPathParameterfNV\"))\n\tgpPathParameterfvNV = (C.GPPATHPARAMETERFVNV)(getProcAddr(\"glPathParameterfvNV\"))\n\tgpPathParameteriNV = (C.GPPATHPARAMETERINV)(getProcAddr(\"glPathParameteriNV\"))\n\tgpPathParameterivNV = (C.GPPATHPARAMETERIVNV)(getProcAddr(\"glPathParameterivNV\"))\n\tgpPathStencilDepthOffsetNV = (C.GPPATHSTENCILDEPTHOFFSETNV)(getProcAddr(\"glPathStencilDepthOffsetNV\"))\n\tgpPathStencilFuncNV = (C.GPPATHSTENCILFUNCNV)(getProcAddr(\"glPathStencilFuncNV\"))\n\tgpPathStringNV = (C.GPPATHSTRINGNV)(getProcAddr(\"glPathStringNV\"))\n\tgpPathSubCommandsNV = (C.GPPATHSUBCOMMANDSNV)(getProcAddr(\"glPathSubCommandsNV\"))\n\tgpPathSubCoordsNV = (C.GPPATHSUBCOORDSNV)(getProcAddr(\"glPathSubCoordsNV\"))\n\tgpPathTexGenNV = (C.GPPATHTEXGENNV)(getProcAddr(\"glPathTexGenNV\"))\n\tgpPauseTransformFeedback = (C.GPPAUSETRANSFORMFEEDBACK)(getProcAddr(\"glPauseTransformFeedback\"))\n\tif gpPauseTransformFeedback == nil {\n\t\treturn errors.New(\"glPauseTransformFeedback\")\n\t}\n\tgpPauseTransformFeedbackNV = (C.GPPAUSETRANSFORMFEEDBACKNV)(getProcAddr(\"glPauseTransformFeedbackNV\"))\n\tgpPixelDataRangeNV = (C.GPPIXELDATARANGENV)(getProcAddr(\"glPixelDataRangeNV\"))\n\tgpPixelMapfv = (C.GPPIXELMAPFV)(getProcAddr(\"glPixelMapfv\"))\n\tif gpPixelMapfv == nil {\n\t\treturn errors.New(\"glPixelMapfv\")\n\t}\n\tgpPixelMapuiv = (C.GPPIXELMAPUIV)(getProcAddr(\"glPixelMapuiv\"))\n\tif gpPixelMapuiv == nil {\n\t\treturn errors.New(\"glPixelMapuiv\")\n\t}\n\tgpPixelMapusv = (C.GPPIXELMAPUSV)(getProcAddr(\"glPixelMapusv\"))\n\tif gpPixelMapusv == nil {\n\t\treturn errors.New(\"glPixelMapusv\")\n\t}\n\tgpPixelMapx = (C.GPPIXELMAPX)(getProcAddr(\"glPixelMapx\"))\n\tgpPixelStoref = (C.GPPIXELSTOREF)(getProcAddr(\"glPixelStoref\"))\n\tif gpPixelStoref == nil {\n\t\treturn errors.New(\"glPixelStoref\")\n\t}\n\tgpPixelStorei = (C.GPPIXELSTOREI)(getProcAddr(\"glPixelStorei\"))\n\tif gpPixelStorei == nil {\n\t\treturn errors.New(\"glPixelStorei\")\n\t}\n\tgpPixelStorex = (C.GPPIXELSTOREX)(getProcAddr(\"glPixelStorex\"))\n\tgpPixelTexGenParameterfSGIS = (C.GPPIXELTEXGENPARAMETERFSGIS)(getProcAddr(\"glPixelTexGenParameterfSGIS\"))\n\tgpPixelTexGenParameterfvSGIS = (C.GPPIXELTEXGENPARAMETERFVSGIS)(getProcAddr(\"glPixelTexGenParameterfvSGIS\"))\n\tgpPixelTexGenParameteriSGIS = (C.GPPIXELTEXGENPARAMETERISGIS)(getProcAddr(\"glPixelTexGenParameteriSGIS\"))\n\tgpPixelTexGenParameterivSGIS = (C.GPPIXELTEXGENPARAMETERIVSGIS)(getProcAddr(\"glPixelTexGenParameterivSGIS\"))\n\tgpPixelTexGenSGIX = (C.GPPIXELTEXGENSGIX)(getProcAddr(\"glPixelTexGenSGIX\"))\n\tgpPixelTransferf = (C.GPPIXELTRANSFERF)(getProcAddr(\"glPixelTransferf\"))\n\tif gpPixelTransferf == nil {\n\t\treturn errors.New(\"glPixelTransferf\")\n\t}\n\tgpPixelTransferi = (C.GPPIXELTRANSFERI)(getProcAddr(\"glPixelTransferi\"))\n\tif gpPixelTransferi == nil {\n\t\treturn errors.New(\"glPixelTransferi\")\n\t}\n\tgpPixelTransferxOES = (C.GPPIXELTRANSFERXOES)(getProcAddr(\"glPixelTransferxOES\"))\n\tgpPixelTransformParameterfEXT = (C.GPPIXELTRANSFORMPARAMETERFEXT)(getProcAddr(\"glPixelTransformParameterfEXT\"))\n\tgpPixelTransformParameterfvEXT = (C.GPPIXELTRANSFORMPARAMETERFVEXT)(getProcAddr(\"glPixelTransformParameterfvEXT\"))\n\tgpPixelTransformParameteriEXT = (C.GPPIXELTRANSFORMPARAMETERIEXT)(getProcAddr(\"glPixelTransformParameteriEXT\"))\n\tgpPixelTransformParameterivEXT = (C.GPPIXELTRANSFORMPARAMETERIVEXT)(getProcAddr(\"glPixelTransformParameterivEXT\"))\n\tgpPixelZoom = (C.GPPIXELZOOM)(getProcAddr(\"glPixelZoom\"))\n\tif gpPixelZoom == nil {\n\t\treturn errors.New(\"glPixelZoom\")\n\t}\n\tgpPixelZoomxOES = (C.GPPIXELZOOMXOES)(getProcAddr(\"glPixelZoomxOES\"))\n\tgpPointAlongPathNV = (C.GPPOINTALONGPATHNV)(getProcAddr(\"glPointAlongPathNV\"))\n\tgpPointParameterf = (C.GPPOINTPARAMETERF)(getProcAddr(\"glPointParameterf\"))\n\tif gpPointParameterf == nil {\n\t\treturn errors.New(\"glPointParameterf\")\n\t}\n\tgpPointParameterfARB = (C.GPPOINTPARAMETERFARB)(getProcAddr(\"glPointParameterfARB\"))\n\tgpPointParameterfEXT = (C.GPPOINTPARAMETERFEXT)(getProcAddr(\"glPointParameterfEXT\"))\n\tgpPointParameterfSGIS = (C.GPPOINTPARAMETERFSGIS)(getProcAddr(\"glPointParameterfSGIS\"))\n\tgpPointParameterfv = (C.GPPOINTPARAMETERFV)(getProcAddr(\"glPointParameterfv\"))\n\tif gpPointParameterfv == nil {\n\t\treturn errors.New(\"glPointParameterfv\")\n\t}\n\tgpPointParameterfvARB = (C.GPPOINTPARAMETERFVARB)(getProcAddr(\"glPointParameterfvARB\"))\n\tgpPointParameterfvEXT = (C.GPPOINTPARAMETERFVEXT)(getProcAddr(\"glPointParameterfvEXT\"))\n\tgpPointParameterfvSGIS = (C.GPPOINTPARAMETERFVSGIS)(getProcAddr(\"glPointParameterfvSGIS\"))\n\tgpPointParameteri = (C.GPPOINTPARAMETERI)(getProcAddr(\"glPointParameteri\"))\n\tif gpPointParameteri == nil {\n\t\treturn errors.New(\"glPointParameteri\")\n\t}\n\tgpPointParameteriNV = (C.GPPOINTPARAMETERINV)(getProcAddr(\"glPointParameteriNV\"))\n\tgpPointParameteriv = (C.GPPOINTPARAMETERIV)(getProcAddr(\"glPointParameteriv\"))\n\tif gpPointParameteriv == nil {\n\t\treturn errors.New(\"glPointParameteriv\")\n\t}\n\tgpPointParameterivNV = (C.GPPOINTPARAMETERIVNV)(getProcAddr(\"glPointParameterivNV\"))\n\tgpPointParameterxOES = (C.GPPOINTPARAMETERXOES)(getProcAddr(\"glPointParameterxOES\"))\n\tgpPointParameterxvOES = (C.GPPOINTPARAMETERXVOES)(getProcAddr(\"glPointParameterxvOES\"))\n\tgpPointSize = (C.GPPOINTSIZE)(getProcAddr(\"glPointSize\"))\n\tif gpPointSize == nil {\n\t\treturn errors.New(\"glPointSize\")\n\t}\n\tgpPointSizexOES = (C.GPPOINTSIZEXOES)(getProcAddr(\"glPointSizexOES\"))\n\tgpPollAsyncSGIX = (C.GPPOLLASYNCSGIX)(getProcAddr(\"glPollAsyncSGIX\"))\n\tgpPollInstrumentsSGIX = (C.GPPOLLINSTRUMENTSSGIX)(getProcAddr(\"glPollInstrumentsSGIX\"))\n\tgpPolygonMode = (C.GPPOLYGONMODE)(getProcAddr(\"glPolygonMode\"))\n\tif gpPolygonMode == nil {\n\t\treturn errors.New(\"glPolygonMode\")\n\t}\n\tgpPolygonOffset = (C.GPPOLYGONOFFSET)(getProcAddr(\"glPolygonOffset\"))\n\tif gpPolygonOffset == nil {\n\t\treturn errors.New(\"glPolygonOffset\")\n\t}\n\tgpPolygonOffsetClamp = (C.GPPOLYGONOFFSETCLAMP)(getProcAddr(\"glPolygonOffsetClamp\"))\n\tgpPolygonOffsetClampEXT = (C.GPPOLYGONOFFSETCLAMPEXT)(getProcAddr(\"glPolygonOffsetClampEXT\"))\n\tgpPolygonOffsetEXT = (C.GPPOLYGONOFFSETEXT)(getProcAddr(\"glPolygonOffsetEXT\"))\n\tgpPolygonOffsetxOES = (C.GPPOLYGONOFFSETXOES)(getProcAddr(\"glPolygonOffsetxOES\"))\n\tgpPolygonStipple = (C.GPPOLYGONSTIPPLE)(getProcAddr(\"glPolygonStipple\"))\n\tif gpPolygonStipple == nil {\n\t\treturn errors.New(\"glPolygonStipple\")\n\t}\n\tgpPopAttrib = (C.GPPOPATTRIB)(getProcAddr(\"glPopAttrib\"))\n\tif gpPopAttrib == nil {\n\t\treturn errors.New(\"glPopAttrib\")\n\t}\n\tgpPopClientAttrib = (C.GPPOPCLIENTATTRIB)(getProcAddr(\"glPopClientAttrib\"))\n\tif gpPopClientAttrib == nil {\n\t\treturn errors.New(\"glPopClientAttrib\")\n\t}\n\tgpPopDebugGroup = (C.GPPOPDEBUGGROUP)(getProcAddr(\"glPopDebugGroup\"))\n\tif gpPopDebugGroup == nil {\n\t\treturn errors.New(\"glPopDebugGroup\")\n\t}\n\tgpPopDebugGroupKHR = (C.GPPOPDEBUGGROUPKHR)(getProcAddr(\"glPopDebugGroupKHR\"))\n\tgpPopGroupMarkerEXT = (C.GPPOPGROUPMARKEREXT)(getProcAddr(\"glPopGroupMarkerEXT\"))\n\tgpPopMatrix = (C.GPPOPMATRIX)(getProcAddr(\"glPopMatrix\"))\n\tif gpPopMatrix == nil {\n\t\treturn errors.New(\"glPopMatrix\")\n\t}\n\tgpPopName = (C.GPPOPNAME)(getProcAddr(\"glPopName\"))\n\tif gpPopName == nil {\n\t\treturn errors.New(\"glPopName\")\n\t}\n\tgpPresentFrameDualFillNV = (C.GPPRESENTFRAMEDUALFILLNV)(getProcAddr(\"glPresentFrameDualFillNV\"))\n\tgpPresentFrameKeyedNV = (C.GPPRESENTFRAMEKEYEDNV)(getProcAddr(\"glPresentFrameKeyedNV\"))\n\tgpPrimitiveBoundingBoxARB = (C.GPPRIMITIVEBOUNDINGBOXARB)(getProcAddr(\"glPrimitiveBoundingBoxARB\"))\n\tgpPrimitiveRestartIndex = (C.GPPRIMITIVERESTARTINDEX)(getProcAddr(\"glPrimitiveRestartIndex\"))\n\tif gpPrimitiveRestartIndex == nil {\n\t\treturn errors.New(\"glPrimitiveRestartIndex\")\n\t}\n\tgpPrimitiveRestartIndexNV = (C.GPPRIMITIVERESTARTINDEXNV)(getProcAddr(\"glPrimitiveRestartIndexNV\"))\n\tgpPrimitiveRestartNV = (C.GPPRIMITIVERESTARTNV)(getProcAddr(\"glPrimitiveRestartNV\"))\n\tgpPrioritizeTextures = (C.GPPRIORITIZETEXTURES)(getProcAddr(\"glPrioritizeTextures\"))\n\tif gpPrioritizeTextures == nil {\n\t\treturn errors.New(\"glPrioritizeTextures\")\n\t}\n\tgpPrioritizeTexturesEXT = (C.GPPRIORITIZETEXTURESEXT)(getProcAddr(\"glPrioritizeTexturesEXT\"))\n\tgpPrioritizeTexturesxOES = (C.GPPRIORITIZETEXTURESXOES)(getProcAddr(\"glPrioritizeTexturesxOES\"))\n\tgpProgramBinary = (C.GPPROGRAMBINARY)(getProcAddr(\"glProgramBinary\"))\n\tif gpProgramBinary == nil {\n\t\treturn errors.New(\"glProgramBinary\")\n\t}\n\tgpProgramBufferParametersIivNV = (C.GPPROGRAMBUFFERPARAMETERSIIVNV)(getProcAddr(\"glProgramBufferParametersIivNV\"))\n\tgpProgramBufferParametersIuivNV = (C.GPPROGRAMBUFFERPARAMETERSIUIVNV)(getProcAddr(\"glProgramBufferParametersIuivNV\"))\n\tgpProgramBufferParametersfvNV = (C.GPPROGRAMBUFFERPARAMETERSFVNV)(getProcAddr(\"glProgramBufferParametersfvNV\"))\n\tgpProgramEnvParameter4dARB = (C.GPPROGRAMENVPARAMETER4DARB)(getProcAddr(\"glProgramEnvParameter4dARB\"))\n\tgpProgramEnvParameter4dvARB = (C.GPPROGRAMENVPARAMETER4DVARB)(getProcAddr(\"glProgramEnvParameter4dvARB\"))\n\tgpProgramEnvParameter4fARB = (C.GPPROGRAMENVPARAMETER4FARB)(getProcAddr(\"glProgramEnvParameter4fARB\"))\n\tgpProgramEnvParameter4fvARB = (C.GPPROGRAMENVPARAMETER4FVARB)(getProcAddr(\"glProgramEnvParameter4fvARB\"))\n\tgpProgramEnvParameterI4iNV = (C.GPPROGRAMENVPARAMETERI4INV)(getProcAddr(\"glProgramEnvParameterI4iNV\"))\n\tgpProgramEnvParameterI4ivNV = (C.GPPROGRAMENVPARAMETERI4IVNV)(getProcAddr(\"glProgramEnvParameterI4ivNV\"))\n\tgpProgramEnvParameterI4uiNV = (C.GPPROGRAMENVPARAMETERI4UINV)(getProcAddr(\"glProgramEnvParameterI4uiNV\"))\n\tgpProgramEnvParameterI4uivNV = (C.GPPROGRAMENVPARAMETERI4UIVNV)(getProcAddr(\"glProgramEnvParameterI4uivNV\"))\n\tgpProgramEnvParameters4fvEXT = (C.GPPROGRAMENVPARAMETERS4FVEXT)(getProcAddr(\"glProgramEnvParameters4fvEXT\"))\n\tgpProgramEnvParametersI4ivNV = (C.GPPROGRAMENVPARAMETERSI4IVNV)(getProcAddr(\"glProgramEnvParametersI4ivNV\"))\n\tgpProgramEnvParametersI4uivNV = (C.GPPROGRAMENVPARAMETERSI4UIVNV)(getProcAddr(\"glProgramEnvParametersI4uivNV\"))\n\tgpProgramLocalParameter4dARB = (C.GPPROGRAMLOCALPARAMETER4DARB)(getProcAddr(\"glProgramLocalParameter4dARB\"))\n\tgpProgramLocalParameter4dvARB = (C.GPPROGRAMLOCALPARAMETER4DVARB)(getProcAddr(\"glProgramLocalParameter4dvARB\"))\n\tgpProgramLocalParameter4fARB = (C.GPPROGRAMLOCALPARAMETER4FARB)(getProcAddr(\"glProgramLocalParameter4fARB\"))\n\tgpProgramLocalParameter4fvARB = (C.GPPROGRAMLOCALPARAMETER4FVARB)(getProcAddr(\"glProgramLocalParameter4fvARB\"))\n\tgpProgramLocalParameterI4iNV = (C.GPPROGRAMLOCALPARAMETERI4INV)(getProcAddr(\"glProgramLocalParameterI4iNV\"))\n\tgpProgramLocalParameterI4ivNV = (C.GPPROGRAMLOCALPARAMETERI4IVNV)(getProcAddr(\"glProgramLocalParameterI4ivNV\"))\n\tgpProgramLocalParameterI4uiNV = (C.GPPROGRAMLOCALPARAMETERI4UINV)(getProcAddr(\"glProgramLocalParameterI4uiNV\"))\n\tgpProgramLocalParameterI4uivNV = (C.GPPROGRAMLOCALPARAMETERI4UIVNV)(getProcAddr(\"glProgramLocalParameterI4uivNV\"))\n\tgpProgramLocalParameters4fvEXT = (C.GPPROGRAMLOCALPARAMETERS4FVEXT)(getProcAddr(\"glProgramLocalParameters4fvEXT\"))\n\tgpProgramLocalParametersI4ivNV = (C.GPPROGRAMLOCALPARAMETERSI4IVNV)(getProcAddr(\"glProgramLocalParametersI4ivNV\"))\n\tgpProgramLocalParametersI4uivNV = (C.GPPROGRAMLOCALPARAMETERSI4UIVNV)(getProcAddr(\"glProgramLocalParametersI4uivNV\"))\n\tgpProgramNamedParameter4dNV = (C.GPPROGRAMNAMEDPARAMETER4DNV)(getProcAddr(\"glProgramNamedParameter4dNV\"))\n\tgpProgramNamedParameter4dvNV = (C.GPPROGRAMNAMEDPARAMETER4DVNV)(getProcAddr(\"glProgramNamedParameter4dvNV\"))\n\tgpProgramNamedParameter4fNV = (C.GPPROGRAMNAMEDPARAMETER4FNV)(getProcAddr(\"glProgramNamedParameter4fNV\"))\n\tgpProgramNamedParameter4fvNV = (C.GPPROGRAMNAMEDPARAMETER4FVNV)(getProcAddr(\"glProgramNamedParameter4fvNV\"))\n\tgpProgramParameter4dNV = (C.GPPROGRAMPARAMETER4DNV)(getProcAddr(\"glProgramParameter4dNV\"))\n\tgpProgramParameter4dvNV = (C.GPPROGRAMPARAMETER4DVNV)(getProcAddr(\"glProgramParameter4dvNV\"))\n\tgpProgramParameter4fNV = (C.GPPROGRAMPARAMETER4FNV)(getProcAddr(\"glProgramParameter4fNV\"))\n\tgpProgramParameter4fvNV = (C.GPPROGRAMPARAMETER4FVNV)(getProcAddr(\"glProgramParameter4fvNV\"))\n\tgpProgramParameteri = (C.GPPROGRAMPARAMETERI)(getProcAddr(\"glProgramParameteri\"))\n\tif gpProgramParameteri == nil {\n\t\treturn errors.New(\"glProgramParameteri\")\n\t}\n\tgpProgramParameteriARB = (C.GPPROGRAMPARAMETERIARB)(getProcAddr(\"glProgramParameteriARB\"))\n\tgpProgramParameteriEXT = (C.GPPROGRAMPARAMETERIEXT)(getProcAddr(\"glProgramParameteriEXT\"))\n\tgpProgramParameters4dvNV = (C.GPPROGRAMPARAMETERS4DVNV)(getProcAddr(\"glProgramParameters4dvNV\"))\n\tgpProgramParameters4fvNV = (C.GPPROGRAMPARAMETERS4FVNV)(getProcAddr(\"glProgramParameters4fvNV\"))\n\tgpProgramPathFragmentInputGenNV = (C.GPPROGRAMPATHFRAGMENTINPUTGENNV)(getProcAddr(\"glProgramPathFragmentInputGenNV\"))\n\tgpProgramStringARB = (C.GPPROGRAMSTRINGARB)(getProcAddr(\"glProgramStringARB\"))\n\tgpProgramSubroutineParametersuivNV = (C.GPPROGRAMSUBROUTINEPARAMETERSUIVNV)(getProcAddr(\"glProgramSubroutineParametersuivNV\"))\n\tgpProgramUniform1d = (C.GPPROGRAMUNIFORM1D)(getProcAddr(\"glProgramUniform1d\"))\n\tif gpProgramUniform1d == nil {\n\t\treturn errors.New(\"glProgramUniform1d\")\n\t}\n\tgpProgramUniform1dEXT = (C.GPPROGRAMUNIFORM1DEXT)(getProcAddr(\"glProgramUniform1dEXT\"))\n\tgpProgramUniform1dv = (C.GPPROGRAMUNIFORM1DV)(getProcAddr(\"glProgramUniform1dv\"))\n\tif gpProgramUniform1dv == nil {\n\t\treturn errors.New(\"glProgramUniform1dv\")\n\t}\n\tgpProgramUniform1dvEXT = (C.GPPROGRAMUNIFORM1DVEXT)(getProcAddr(\"glProgramUniform1dvEXT\"))\n\tgpProgramUniform1f = (C.GPPROGRAMUNIFORM1F)(getProcAddr(\"glProgramUniform1f\"))\n\tif gpProgramUniform1f == nil {\n\t\treturn errors.New(\"glProgramUniform1f\")\n\t}\n\tgpProgramUniform1fEXT = (C.GPPROGRAMUNIFORM1FEXT)(getProcAddr(\"glProgramUniform1fEXT\"))\n\tgpProgramUniform1fv = (C.GPPROGRAMUNIFORM1FV)(getProcAddr(\"glProgramUniform1fv\"))\n\tif gpProgramUniform1fv == nil {\n\t\treturn errors.New(\"glProgramUniform1fv\")\n\t}\n\tgpProgramUniform1fvEXT = (C.GPPROGRAMUNIFORM1FVEXT)(getProcAddr(\"glProgramUniform1fvEXT\"))\n\tgpProgramUniform1i = (C.GPPROGRAMUNIFORM1I)(getProcAddr(\"glProgramUniform1i\"))\n\tif gpProgramUniform1i == nil {\n\t\treturn errors.New(\"glProgramUniform1i\")\n\t}\n\tgpProgramUniform1i64ARB = (C.GPPROGRAMUNIFORM1I64ARB)(getProcAddr(\"glProgramUniform1i64ARB\"))\n\tgpProgramUniform1i64NV = (C.GPPROGRAMUNIFORM1I64NV)(getProcAddr(\"glProgramUniform1i64NV\"))\n\tgpProgramUniform1i64vARB = (C.GPPROGRAMUNIFORM1I64VARB)(getProcAddr(\"glProgramUniform1i64vARB\"))\n\tgpProgramUniform1i64vNV = (C.GPPROGRAMUNIFORM1I64VNV)(getProcAddr(\"glProgramUniform1i64vNV\"))\n\tgpProgramUniform1iEXT = (C.GPPROGRAMUNIFORM1IEXT)(getProcAddr(\"glProgramUniform1iEXT\"))\n\tgpProgramUniform1iv = (C.GPPROGRAMUNIFORM1IV)(getProcAddr(\"glProgramUniform1iv\"))\n\tif gpProgramUniform1iv == nil {\n\t\treturn errors.New(\"glProgramUniform1iv\")\n\t}\n\tgpProgramUniform1ivEXT = (C.GPPROGRAMUNIFORM1IVEXT)(getProcAddr(\"glProgramUniform1ivEXT\"))\n\tgpProgramUniform1ui = (C.GPPROGRAMUNIFORM1UI)(getProcAddr(\"glProgramUniform1ui\"))\n\tif gpProgramUniform1ui == nil {\n\t\treturn errors.New(\"glProgramUniform1ui\")\n\t}\n\tgpProgramUniform1ui64ARB = (C.GPPROGRAMUNIFORM1UI64ARB)(getProcAddr(\"glProgramUniform1ui64ARB\"))\n\tgpProgramUniform1ui64NV = (C.GPPROGRAMUNIFORM1UI64NV)(getProcAddr(\"glProgramUniform1ui64NV\"))\n\tgpProgramUniform1ui64vARB = (C.GPPROGRAMUNIFORM1UI64VARB)(getProcAddr(\"glProgramUniform1ui64vARB\"))\n\tgpProgramUniform1ui64vNV = (C.GPPROGRAMUNIFORM1UI64VNV)(getProcAddr(\"glProgramUniform1ui64vNV\"))\n\tgpProgramUniform1uiEXT = (C.GPPROGRAMUNIFORM1UIEXT)(getProcAddr(\"glProgramUniform1uiEXT\"))\n\tgpProgramUniform1uiv = (C.GPPROGRAMUNIFORM1UIV)(getProcAddr(\"glProgramUniform1uiv\"))\n\tif gpProgramUniform1uiv == nil {\n\t\treturn errors.New(\"glProgramUniform1uiv\")\n\t}\n\tgpProgramUniform1uivEXT = (C.GPPROGRAMUNIFORM1UIVEXT)(getProcAddr(\"glProgramUniform1uivEXT\"))\n\tgpProgramUniform2d = (C.GPPROGRAMUNIFORM2D)(getProcAddr(\"glProgramUniform2d\"))\n\tif gpProgramUniform2d == nil {\n\t\treturn errors.New(\"glProgramUniform2d\")\n\t}\n\tgpProgramUniform2dEXT = (C.GPPROGRAMUNIFORM2DEXT)(getProcAddr(\"glProgramUniform2dEXT\"))\n\tgpProgramUniform2dv = (C.GPPROGRAMUNIFORM2DV)(getProcAddr(\"glProgramUniform2dv\"))\n\tif gpProgramUniform2dv == nil {\n\t\treturn errors.New(\"glProgramUniform2dv\")\n\t}\n\tgpProgramUniform2dvEXT = (C.GPPROGRAMUNIFORM2DVEXT)(getProcAddr(\"glProgramUniform2dvEXT\"))\n\tgpProgramUniform2f = (C.GPPROGRAMUNIFORM2F)(getProcAddr(\"glProgramUniform2f\"))\n\tif gpProgramUniform2f == nil {\n\t\treturn errors.New(\"glProgramUniform2f\")\n\t}\n\tgpProgramUniform2fEXT = (C.GPPROGRAMUNIFORM2FEXT)(getProcAddr(\"glProgramUniform2fEXT\"))\n\tgpProgramUniform2fv = (C.GPPROGRAMUNIFORM2FV)(getProcAddr(\"glProgramUniform2fv\"))\n\tif gpProgramUniform2fv == nil {\n\t\treturn errors.New(\"glProgramUniform2fv\")\n\t}\n\tgpProgramUniform2fvEXT = (C.GPPROGRAMUNIFORM2FVEXT)(getProcAddr(\"glProgramUniform2fvEXT\"))\n\tgpProgramUniform2i = (C.GPPROGRAMUNIFORM2I)(getProcAddr(\"glProgramUniform2i\"))\n\tif gpProgramUniform2i == nil {\n\t\treturn errors.New(\"glProgramUniform2i\")\n\t}\n\tgpProgramUniform2i64ARB = (C.GPPROGRAMUNIFORM2I64ARB)(getProcAddr(\"glProgramUniform2i64ARB\"))\n\tgpProgramUniform2i64NV = (C.GPPROGRAMUNIFORM2I64NV)(getProcAddr(\"glProgramUniform2i64NV\"))\n\tgpProgramUniform2i64vARB = (C.GPPROGRAMUNIFORM2I64VARB)(getProcAddr(\"glProgramUniform2i64vARB\"))\n\tgpProgramUniform2i64vNV = (C.GPPROGRAMUNIFORM2I64VNV)(getProcAddr(\"glProgramUniform2i64vNV\"))\n\tgpProgramUniform2iEXT = (C.GPPROGRAMUNIFORM2IEXT)(getProcAddr(\"glProgramUniform2iEXT\"))\n\tgpProgramUniform2iv = (C.GPPROGRAMUNIFORM2IV)(getProcAddr(\"glProgramUniform2iv\"))\n\tif gpProgramUniform2iv == nil {\n\t\treturn errors.New(\"glProgramUniform2iv\")\n\t}\n\tgpProgramUniform2ivEXT = (C.GPPROGRAMUNIFORM2IVEXT)(getProcAddr(\"glProgramUniform2ivEXT\"))\n\tgpProgramUniform2ui = (C.GPPROGRAMUNIFORM2UI)(getProcAddr(\"glProgramUniform2ui\"))\n\tif gpProgramUniform2ui == nil {\n\t\treturn errors.New(\"glProgramUniform2ui\")\n\t}\n\tgpProgramUniform2ui64ARB = (C.GPPROGRAMUNIFORM2UI64ARB)(getProcAddr(\"glProgramUniform2ui64ARB\"))\n\tgpProgramUniform2ui64NV = (C.GPPROGRAMUNIFORM2UI64NV)(getProcAddr(\"glProgramUniform2ui64NV\"))\n\tgpProgramUniform2ui64vARB = (C.GPPROGRAMUNIFORM2UI64VARB)(getProcAddr(\"glProgramUniform2ui64vARB\"))\n\tgpProgramUniform2ui64vNV = (C.GPPROGRAMUNIFORM2UI64VNV)(getProcAddr(\"glProgramUniform2ui64vNV\"))\n\tgpProgramUniform2uiEXT = (C.GPPROGRAMUNIFORM2UIEXT)(getProcAddr(\"glProgramUniform2uiEXT\"))\n\tgpProgramUniform2uiv = (C.GPPROGRAMUNIFORM2UIV)(getProcAddr(\"glProgramUniform2uiv\"))\n\tif gpProgramUniform2uiv == nil {\n\t\treturn errors.New(\"glProgramUniform2uiv\")\n\t}\n\tgpProgramUniform2uivEXT = (C.GPPROGRAMUNIFORM2UIVEXT)(getProcAddr(\"glProgramUniform2uivEXT\"))\n\tgpProgramUniform3d = (C.GPPROGRAMUNIFORM3D)(getProcAddr(\"glProgramUniform3d\"))\n\tif gpProgramUniform3d == nil {\n\t\treturn errors.New(\"glProgramUniform3d\")\n\t}\n\tgpProgramUniform3dEXT = (C.GPPROGRAMUNIFORM3DEXT)(getProcAddr(\"glProgramUniform3dEXT\"))\n\tgpProgramUniform3dv = (C.GPPROGRAMUNIFORM3DV)(getProcAddr(\"glProgramUniform3dv\"))\n\tif gpProgramUniform3dv == nil {\n\t\treturn errors.New(\"glProgramUniform3dv\")\n\t}\n\tgpProgramUniform3dvEXT = (C.GPPROGRAMUNIFORM3DVEXT)(getProcAddr(\"glProgramUniform3dvEXT\"))\n\tgpProgramUniform3f = (C.GPPROGRAMUNIFORM3F)(getProcAddr(\"glProgramUniform3f\"))\n\tif gpProgramUniform3f == nil {\n\t\treturn errors.New(\"glProgramUniform3f\")\n\t}\n\tgpProgramUniform3fEXT = (C.GPPROGRAMUNIFORM3FEXT)(getProcAddr(\"glProgramUniform3fEXT\"))\n\tgpProgramUniform3fv = (C.GPPROGRAMUNIFORM3FV)(getProcAddr(\"glProgramUniform3fv\"))\n\tif gpProgramUniform3fv == nil {\n\t\treturn errors.New(\"glProgramUniform3fv\")\n\t}\n\tgpProgramUniform3fvEXT = (C.GPPROGRAMUNIFORM3FVEXT)(getProcAddr(\"glProgramUniform3fvEXT\"))\n\tgpProgramUniform3i = (C.GPPROGRAMUNIFORM3I)(getProcAddr(\"glProgramUniform3i\"))\n\tif gpProgramUniform3i == nil {\n\t\treturn errors.New(\"glProgramUniform3i\")\n\t}\n\tgpProgramUniform3i64ARB = (C.GPPROGRAMUNIFORM3I64ARB)(getProcAddr(\"glProgramUniform3i64ARB\"))\n\tgpProgramUniform3i64NV = (C.GPPROGRAMUNIFORM3I64NV)(getProcAddr(\"glProgramUniform3i64NV\"))\n\tgpProgramUniform3i64vARB = (C.GPPROGRAMUNIFORM3I64VARB)(getProcAddr(\"glProgramUniform3i64vARB\"))\n\tgpProgramUniform3i64vNV = (C.GPPROGRAMUNIFORM3I64VNV)(getProcAddr(\"glProgramUniform3i64vNV\"))\n\tgpProgramUniform3iEXT = (C.GPPROGRAMUNIFORM3IEXT)(getProcAddr(\"glProgramUniform3iEXT\"))\n\tgpProgramUniform3iv = (C.GPPROGRAMUNIFORM3IV)(getProcAddr(\"glProgramUniform3iv\"))\n\tif gpProgramUniform3iv == nil {\n\t\treturn errors.New(\"glProgramUniform3iv\")\n\t}\n\tgpProgramUniform3ivEXT = (C.GPPROGRAMUNIFORM3IVEXT)(getProcAddr(\"glProgramUniform3ivEXT\"))\n\tgpProgramUniform3ui = (C.GPPROGRAMUNIFORM3UI)(getProcAddr(\"glProgramUniform3ui\"))\n\tif gpProgramUniform3ui == nil {\n\t\treturn errors.New(\"glProgramUniform3ui\")\n\t}\n\tgpProgramUniform3ui64ARB = (C.GPPROGRAMUNIFORM3UI64ARB)(getProcAddr(\"glProgramUniform3ui64ARB\"))\n\tgpProgramUniform3ui64NV = (C.GPPROGRAMUNIFORM3UI64NV)(getProcAddr(\"glProgramUniform3ui64NV\"))\n\tgpProgramUniform3ui64vARB = (C.GPPROGRAMUNIFORM3UI64VARB)(getProcAddr(\"glProgramUniform3ui64vARB\"))\n\tgpProgramUniform3ui64vNV = (C.GPPROGRAMUNIFORM3UI64VNV)(getProcAddr(\"glProgramUniform3ui64vNV\"))\n\tgpProgramUniform3uiEXT = (C.GPPROGRAMUNIFORM3UIEXT)(getProcAddr(\"glProgramUniform3uiEXT\"))\n\tgpProgramUniform3uiv = (C.GPPROGRAMUNIFORM3UIV)(getProcAddr(\"glProgramUniform3uiv\"))\n\tif gpProgramUniform3uiv == nil {\n\t\treturn errors.New(\"glProgramUniform3uiv\")\n\t}\n\tgpProgramUniform3uivEXT = (C.GPPROGRAMUNIFORM3UIVEXT)(getProcAddr(\"glProgramUniform3uivEXT\"))\n\tgpProgramUniform4d = (C.GPPROGRAMUNIFORM4D)(getProcAddr(\"glProgramUniform4d\"))\n\tif gpProgramUniform4d == nil {\n\t\treturn errors.New(\"glProgramUniform4d\")\n\t}\n\tgpProgramUniform4dEXT = (C.GPPROGRAMUNIFORM4DEXT)(getProcAddr(\"glProgramUniform4dEXT\"))\n\tgpProgramUniform4dv = (C.GPPROGRAMUNIFORM4DV)(getProcAddr(\"glProgramUniform4dv\"))\n\tif gpProgramUniform4dv == nil {\n\t\treturn errors.New(\"glProgramUniform4dv\")\n\t}\n\tgpProgramUniform4dvEXT = (C.GPPROGRAMUNIFORM4DVEXT)(getProcAddr(\"glProgramUniform4dvEXT\"))\n\tgpProgramUniform4f = (C.GPPROGRAMUNIFORM4F)(getProcAddr(\"glProgramUniform4f\"))\n\tif gpProgramUniform4f == nil {\n\t\treturn errors.New(\"glProgramUniform4f\")\n\t}\n\tgpProgramUniform4fEXT = (C.GPPROGRAMUNIFORM4FEXT)(getProcAddr(\"glProgramUniform4fEXT\"))\n\tgpProgramUniform4fv = (C.GPPROGRAMUNIFORM4FV)(getProcAddr(\"glProgramUniform4fv\"))\n\tif gpProgramUniform4fv == nil {\n\t\treturn errors.New(\"glProgramUniform4fv\")\n\t}\n\tgpProgramUniform4fvEXT = (C.GPPROGRAMUNIFORM4FVEXT)(getProcAddr(\"glProgramUniform4fvEXT\"))\n\tgpProgramUniform4i = (C.GPPROGRAMUNIFORM4I)(getProcAddr(\"glProgramUniform4i\"))\n\tif gpProgramUniform4i == nil {\n\t\treturn errors.New(\"glProgramUniform4i\")\n\t}\n\tgpProgramUniform4i64ARB = (C.GPPROGRAMUNIFORM4I64ARB)(getProcAddr(\"glProgramUniform4i64ARB\"))\n\tgpProgramUniform4i64NV = (C.GPPROGRAMUNIFORM4I64NV)(getProcAddr(\"glProgramUniform4i64NV\"))\n\tgpProgramUniform4i64vARB = (C.GPPROGRAMUNIFORM4I64VARB)(getProcAddr(\"glProgramUniform4i64vARB\"))\n\tgpProgramUniform4i64vNV = (C.GPPROGRAMUNIFORM4I64VNV)(getProcAddr(\"glProgramUniform4i64vNV\"))\n\tgpProgramUniform4iEXT = (C.GPPROGRAMUNIFORM4IEXT)(getProcAddr(\"glProgramUniform4iEXT\"))\n\tgpProgramUniform4iv = (C.GPPROGRAMUNIFORM4IV)(getProcAddr(\"glProgramUniform4iv\"))\n\tif gpProgramUniform4iv == nil {\n\t\treturn errors.New(\"glProgramUniform4iv\")\n\t}\n\tgpProgramUniform4ivEXT = (C.GPPROGRAMUNIFORM4IVEXT)(getProcAddr(\"glProgramUniform4ivEXT\"))\n\tgpProgramUniform4ui = (C.GPPROGRAMUNIFORM4UI)(getProcAddr(\"glProgramUniform4ui\"))\n\tif gpProgramUniform4ui == nil {\n\t\treturn errors.New(\"glProgramUniform4ui\")\n\t}\n\tgpProgramUniform4ui64ARB = (C.GPPROGRAMUNIFORM4UI64ARB)(getProcAddr(\"glProgramUniform4ui64ARB\"))\n\tgpProgramUniform4ui64NV = (C.GPPROGRAMUNIFORM4UI64NV)(getProcAddr(\"glProgramUniform4ui64NV\"))\n\tgpProgramUniform4ui64vARB = (C.GPPROGRAMUNIFORM4UI64VARB)(getProcAddr(\"glProgramUniform4ui64vARB\"))\n\tgpProgramUniform4ui64vNV = (C.GPPROGRAMUNIFORM4UI64VNV)(getProcAddr(\"glProgramUniform4ui64vNV\"))\n\tgpProgramUniform4uiEXT = (C.GPPROGRAMUNIFORM4UIEXT)(getProcAddr(\"glProgramUniform4uiEXT\"))\n\tgpProgramUniform4uiv = (C.GPPROGRAMUNIFORM4UIV)(getProcAddr(\"glProgramUniform4uiv\"))\n\tif gpProgramUniform4uiv == nil {\n\t\treturn errors.New(\"glProgramUniform4uiv\")\n\t}\n\tgpProgramUniform4uivEXT = (C.GPPROGRAMUNIFORM4UIVEXT)(getProcAddr(\"glProgramUniform4uivEXT\"))\n\tgpProgramUniformHandleui64ARB = (C.GPPROGRAMUNIFORMHANDLEUI64ARB)(getProcAddr(\"glProgramUniformHandleui64ARB\"))\n\tgpProgramUniformHandleui64NV = (C.GPPROGRAMUNIFORMHANDLEUI64NV)(getProcAddr(\"glProgramUniformHandleui64NV\"))\n\tgpProgramUniformHandleui64vARB = (C.GPPROGRAMUNIFORMHANDLEUI64VARB)(getProcAddr(\"glProgramUniformHandleui64vARB\"))\n\tgpProgramUniformHandleui64vNV = (C.GPPROGRAMUNIFORMHANDLEUI64VNV)(getProcAddr(\"glProgramUniformHandleui64vNV\"))\n\tgpProgramUniformMatrix2dv = (C.GPPROGRAMUNIFORMMATRIX2DV)(getProcAddr(\"glProgramUniformMatrix2dv\"))\n\tif gpProgramUniformMatrix2dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2dv\")\n\t}\n\tgpProgramUniformMatrix2dvEXT = (C.GPPROGRAMUNIFORMMATRIX2DVEXT)(getProcAddr(\"glProgramUniformMatrix2dvEXT\"))\n\tgpProgramUniformMatrix2fv = (C.GPPROGRAMUNIFORMMATRIX2FV)(getProcAddr(\"glProgramUniformMatrix2fv\"))\n\tif gpProgramUniformMatrix2fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2fv\")\n\t}\n\tgpProgramUniformMatrix2fvEXT = (C.GPPROGRAMUNIFORMMATRIX2FVEXT)(getProcAddr(\"glProgramUniformMatrix2fvEXT\"))\n\tgpProgramUniformMatrix2x3dv = (C.GPPROGRAMUNIFORMMATRIX2X3DV)(getProcAddr(\"glProgramUniformMatrix2x3dv\"))\n\tif gpProgramUniformMatrix2x3dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x3dv\")\n\t}\n\tgpProgramUniformMatrix2x3dvEXT = (C.GPPROGRAMUNIFORMMATRIX2X3DVEXT)(getProcAddr(\"glProgramUniformMatrix2x3dvEXT\"))\n\tgpProgramUniformMatrix2x3fv = (C.GPPROGRAMUNIFORMMATRIX2X3FV)(getProcAddr(\"glProgramUniformMatrix2x3fv\"))\n\tif gpProgramUniformMatrix2x3fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x3fv\")\n\t}\n\tgpProgramUniformMatrix2x3fvEXT = (C.GPPROGRAMUNIFORMMATRIX2X3FVEXT)(getProcAddr(\"glProgramUniformMatrix2x3fvEXT\"))\n\tgpProgramUniformMatrix2x4dv = (C.GPPROGRAMUNIFORMMATRIX2X4DV)(getProcAddr(\"glProgramUniformMatrix2x4dv\"))\n\tif gpProgramUniformMatrix2x4dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x4dv\")\n\t}\n\tgpProgramUniformMatrix2x4dvEXT = (C.GPPROGRAMUNIFORMMATRIX2X4DVEXT)(getProcAddr(\"glProgramUniformMatrix2x4dvEXT\"))\n\tgpProgramUniformMatrix2x4fv = (C.GPPROGRAMUNIFORMMATRIX2X4FV)(getProcAddr(\"glProgramUniformMatrix2x4fv\"))\n\tif gpProgramUniformMatrix2x4fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix2x4fv\")\n\t}\n\tgpProgramUniformMatrix2x4fvEXT = (C.GPPROGRAMUNIFORMMATRIX2X4FVEXT)(getProcAddr(\"glProgramUniformMatrix2x4fvEXT\"))\n\tgpProgramUniformMatrix3dv = (C.GPPROGRAMUNIFORMMATRIX3DV)(getProcAddr(\"glProgramUniformMatrix3dv\"))\n\tif gpProgramUniformMatrix3dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3dv\")\n\t}\n\tgpProgramUniformMatrix3dvEXT = (C.GPPROGRAMUNIFORMMATRIX3DVEXT)(getProcAddr(\"glProgramUniformMatrix3dvEXT\"))\n\tgpProgramUniformMatrix3fv = (C.GPPROGRAMUNIFORMMATRIX3FV)(getProcAddr(\"glProgramUniformMatrix3fv\"))\n\tif gpProgramUniformMatrix3fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3fv\")\n\t}\n\tgpProgramUniformMatrix3fvEXT = (C.GPPROGRAMUNIFORMMATRIX3FVEXT)(getProcAddr(\"glProgramUniformMatrix3fvEXT\"))\n\tgpProgramUniformMatrix3x2dv = (C.GPPROGRAMUNIFORMMATRIX3X2DV)(getProcAddr(\"glProgramUniformMatrix3x2dv\"))\n\tif gpProgramUniformMatrix3x2dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x2dv\")\n\t}\n\tgpProgramUniformMatrix3x2dvEXT = (C.GPPROGRAMUNIFORMMATRIX3X2DVEXT)(getProcAddr(\"glProgramUniformMatrix3x2dvEXT\"))\n\tgpProgramUniformMatrix3x2fv = (C.GPPROGRAMUNIFORMMATRIX3X2FV)(getProcAddr(\"glProgramUniformMatrix3x2fv\"))\n\tif gpProgramUniformMatrix3x2fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x2fv\")\n\t}\n\tgpProgramUniformMatrix3x2fvEXT = (C.GPPROGRAMUNIFORMMATRIX3X2FVEXT)(getProcAddr(\"glProgramUniformMatrix3x2fvEXT\"))\n\tgpProgramUniformMatrix3x4dv = (C.GPPROGRAMUNIFORMMATRIX3X4DV)(getProcAddr(\"glProgramUniformMatrix3x4dv\"))\n\tif gpProgramUniformMatrix3x4dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x4dv\")\n\t}\n\tgpProgramUniformMatrix3x4dvEXT = (C.GPPROGRAMUNIFORMMATRIX3X4DVEXT)(getProcAddr(\"glProgramUniformMatrix3x4dvEXT\"))\n\tgpProgramUniformMatrix3x4fv = (C.GPPROGRAMUNIFORMMATRIX3X4FV)(getProcAddr(\"glProgramUniformMatrix3x4fv\"))\n\tif gpProgramUniformMatrix3x4fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix3x4fv\")\n\t}\n\tgpProgramUniformMatrix3x4fvEXT = (C.GPPROGRAMUNIFORMMATRIX3X4FVEXT)(getProcAddr(\"glProgramUniformMatrix3x4fvEXT\"))\n\tgpProgramUniformMatrix4dv = (C.GPPROGRAMUNIFORMMATRIX4DV)(getProcAddr(\"glProgramUniformMatrix4dv\"))\n\tif gpProgramUniformMatrix4dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4dv\")\n\t}\n\tgpProgramUniformMatrix4dvEXT = (C.GPPROGRAMUNIFORMMATRIX4DVEXT)(getProcAddr(\"glProgramUniformMatrix4dvEXT\"))\n\tgpProgramUniformMatrix4fv = (C.GPPROGRAMUNIFORMMATRIX4FV)(getProcAddr(\"glProgramUniformMatrix4fv\"))\n\tif gpProgramUniformMatrix4fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4fv\")\n\t}\n\tgpProgramUniformMatrix4fvEXT = (C.GPPROGRAMUNIFORMMATRIX4FVEXT)(getProcAddr(\"glProgramUniformMatrix4fvEXT\"))\n\tgpProgramUniformMatrix4x2dv = (C.GPPROGRAMUNIFORMMATRIX4X2DV)(getProcAddr(\"glProgramUniformMatrix4x2dv\"))\n\tif gpProgramUniformMatrix4x2dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x2dv\")\n\t}\n\tgpProgramUniformMatrix4x2dvEXT = (C.GPPROGRAMUNIFORMMATRIX4X2DVEXT)(getProcAddr(\"glProgramUniformMatrix4x2dvEXT\"))\n\tgpProgramUniformMatrix4x2fv = (C.GPPROGRAMUNIFORMMATRIX4X2FV)(getProcAddr(\"glProgramUniformMatrix4x2fv\"))\n\tif gpProgramUniformMatrix4x2fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x2fv\")\n\t}\n\tgpProgramUniformMatrix4x2fvEXT = (C.GPPROGRAMUNIFORMMATRIX4X2FVEXT)(getProcAddr(\"glProgramUniformMatrix4x2fvEXT\"))\n\tgpProgramUniformMatrix4x3dv = (C.GPPROGRAMUNIFORMMATRIX4X3DV)(getProcAddr(\"glProgramUniformMatrix4x3dv\"))\n\tif gpProgramUniformMatrix4x3dv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x3dv\")\n\t}\n\tgpProgramUniformMatrix4x3dvEXT = (C.GPPROGRAMUNIFORMMATRIX4X3DVEXT)(getProcAddr(\"glProgramUniformMatrix4x3dvEXT\"))\n\tgpProgramUniformMatrix4x3fv = (C.GPPROGRAMUNIFORMMATRIX4X3FV)(getProcAddr(\"glProgramUniformMatrix4x3fv\"))\n\tif gpProgramUniformMatrix4x3fv == nil {\n\t\treturn errors.New(\"glProgramUniformMatrix4x3fv\")\n\t}\n\tgpProgramUniformMatrix4x3fvEXT = (C.GPPROGRAMUNIFORMMATRIX4X3FVEXT)(getProcAddr(\"glProgramUniformMatrix4x3fvEXT\"))\n\tgpProgramUniformui64NV = (C.GPPROGRAMUNIFORMUI64NV)(getProcAddr(\"glProgramUniformui64NV\"))\n\tgpProgramUniformui64vNV = (C.GPPROGRAMUNIFORMUI64VNV)(getProcAddr(\"glProgramUniformui64vNV\"))\n\tgpProgramVertexLimitNV = (C.GPPROGRAMVERTEXLIMITNV)(getProcAddr(\"glProgramVertexLimitNV\"))\n\tgpProvokingVertex = (C.GPPROVOKINGVERTEX)(getProcAddr(\"glProvokingVertex\"))\n\tif gpProvokingVertex == nil {\n\t\treturn errors.New(\"glProvokingVertex\")\n\t}\n\tgpProvokingVertexEXT = (C.GPPROVOKINGVERTEXEXT)(getProcAddr(\"glProvokingVertexEXT\"))\n\tgpPushAttrib = (C.GPPUSHATTRIB)(getProcAddr(\"glPushAttrib\"))\n\tif gpPushAttrib == nil {\n\t\treturn errors.New(\"glPushAttrib\")\n\t}\n\tgpPushClientAttrib = (C.GPPUSHCLIENTATTRIB)(getProcAddr(\"glPushClientAttrib\"))\n\tif gpPushClientAttrib == nil {\n\t\treturn errors.New(\"glPushClientAttrib\")\n\t}\n\tgpPushClientAttribDefaultEXT = (C.GPPUSHCLIENTATTRIBDEFAULTEXT)(getProcAddr(\"glPushClientAttribDefaultEXT\"))\n\tgpPushDebugGroup = (C.GPPUSHDEBUGGROUP)(getProcAddr(\"glPushDebugGroup\"))\n\tif gpPushDebugGroup == nil {\n\t\treturn errors.New(\"glPushDebugGroup\")\n\t}\n\tgpPushDebugGroupKHR = (C.GPPUSHDEBUGGROUPKHR)(getProcAddr(\"glPushDebugGroupKHR\"))\n\tgpPushGroupMarkerEXT = (C.GPPUSHGROUPMARKEREXT)(getProcAddr(\"glPushGroupMarkerEXT\"))\n\tgpPushMatrix = (C.GPPUSHMATRIX)(getProcAddr(\"glPushMatrix\"))\n\tif gpPushMatrix == nil {\n\t\treturn errors.New(\"glPushMatrix\")\n\t}\n\tgpPushName = (C.GPPUSHNAME)(getProcAddr(\"glPushName\"))\n\tif gpPushName == nil {\n\t\treturn errors.New(\"glPushName\")\n\t}\n\tgpQueryCounter = (C.GPQUERYCOUNTER)(getProcAddr(\"glQueryCounter\"))\n\tif gpQueryCounter == nil {\n\t\treturn errors.New(\"glQueryCounter\")\n\t}\n\tgpQueryMatrixxOES = (C.GPQUERYMATRIXXOES)(getProcAddr(\"glQueryMatrixxOES\"))\n\tgpQueryObjectParameteruiAMD = (C.GPQUERYOBJECTPARAMETERUIAMD)(getProcAddr(\"glQueryObjectParameteruiAMD\"))\n\tgpQueryResourceNV = (C.GPQUERYRESOURCENV)(getProcAddr(\"glQueryResourceNV\"))\n\tgpQueryResourceTagNV = (C.GPQUERYRESOURCETAGNV)(getProcAddr(\"glQueryResourceTagNV\"))\n\tgpRasterPos2d = (C.GPRASTERPOS2D)(getProcAddr(\"glRasterPos2d\"))\n\tif gpRasterPos2d == nil {\n\t\treturn errors.New(\"glRasterPos2d\")\n\t}\n\tgpRasterPos2dv = (C.GPRASTERPOS2DV)(getProcAddr(\"glRasterPos2dv\"))\n\tif gpRasterPos2dv == nil {\n\t\treturn errors.New(\"glRasterPos2dv\")\n\t}\n\tgpRasterPos2f = (C.GPRASTERPOS2F)(getProcAddr(\"glRasterPos2f\"))\n\tif gpRasterPos2f == nil {\n\t\treturn errors.New(\"glRasterPos2f\")\n\t}\n\tgpRasterPos2fv = (C.GPRASTERPOS2FV)(getProcAddr(\"glRasterPos2fv\"))\n\tif gpRasterPos2fv == nil {\n\t\treturn errors.New(\"glRasterPos2fv\")\n\t}\n\tgpRasterPos2i = (C.GPRASTERPOS2I)(getProcAddr(\"glRasterPos2i\"))\n\tif gpRasterPos2i == nil {\n\t\treturn errors.New(\"glRasterPos2i\")\n\t}\n\tgpRasterPos2iv = (C.GPRASTERPOS2IV)(getProcAddr(\"glRasterPos2iv\"))\n\tif gpRasterPos2iv == nil {\n\t\treturn errors.New(\"glRasterPos2iv\")\n\t}\n\tgpRasterPos2s = (C.GPRASTERPOS2S)(getProcAddr(\"glRasterPos2s\"))\n\tif gpRasterPos2s == nil {\n\t\treturn errors.New(\"glRasterPos2s\")\n\t}\n\tgpRasterPos2sv = (C.GPRASTERPOS2SV)(getProcAddr(\"glRasterPos2sv\"))\n\tif gpRasterPos2sv == nil {\n\t\treturn errors.New(\"glRasterPos2sv\")\n\t}\n\tgpRasterPos2xOES = (C.GPRASTERPOS2XOES)(getProcAddr(\"glRasterPos2xOES\"))\n\tgpRasterPos2xvOES = (C.GPRASTERPOS2XVOES)(getProcAddr(\"glRasterPos2xvOES\"))\n\tgpRasterPos3d = (C.GPRASTERPOS3D)(getProcAddr(\"glRasterPos3d\"))\n\tif gpRasterPos3d == nil {\n\t\treturn errors.New(\"glRasterPos3d\")\n\t}\n\tgpRasterPos3dv = (C.GPRASTERPOS3DV)(getProcAddr(\"glRasterPos3dv\"))\n\tif gpRasterPos3dv == nil {\n\t\treturn errors.New(\"glRasterPos3dv\")\n\t}\n\tgpRasterPos3f = (C.GPRASTERPOS3F)(getProcAddr(\"glRasterPos3f\"))\n\tif gpRasterPos3f == nil {\n\t\treturn errors.New(\"glRasterPos3f\")\n\t}\n\tgpRasterPos3fv = (C.GPRASTERPOS3FV)(getProcAddr(\"glRasterPos3fv\"))\n\tif gpRasterPos3fv == nil {\n\t\treturn errors.New(\"glRasterPos3fv\")\n\t}\n\tgpRasterPos3i = (C.GPRASTERPOS3I)(getProcAddr(\"glRasterPos3i\"))\n\tif gpRasterPos3i == nil {\n\t\treturn errors.New(\"glRasterPos3i\")\n\t}\n\tgpRasterPos3iv = (C.GPRASTERPOS3IV)(getProcAddr(\"glRasterPos3iv\"))\n\tif gpRasterPos3iv == nil {\n\t\treturn errors.New(\"glRasterPos3iv\")\n\t}\n\tgpRasterPos3s = (C.GPRASTERPOS3S)(getProcAddr(\"glRasterPos3s\"))\n\tif gpRasterPos3s == nil {\n\t\treturn errors.New(\"glRasterPos3s\")\n\t}\n\tgpRasterPos3sv = (C.GPRASTERPOS3SV)(getProcAddr(\"glRasterPos3sv\"))\n\tif gpRasterPos3sv == nil {\n\t\treturn errors.New(\"glRasterPos3sv\")\n\t}\n\tgpRasterPos3xOES = (C.GPRASTERPOS3XOES)(getProcAddr(\"glRasterPos3xOES\"))\n\tgpRasterPos3xvOES = (C.GPRASTERPOS3XVOES)(getProcAddr(\"glRasterPos3xvOES\"))\n\tgpRasterPos4d = (C.GPRASTERPOS4D)(getProcAddr(\"glRasterPos4d\"))\n\tif gpRasterPos4d == nil {\n\t\treturn errors.New(\"glRasterPos4d\")\n\t}\n\tgpRasterPos4dv = (C.GPRASTERPOS4DV)(getProcAddr(\"glRasterPos4dv\"))\n\tif gpRasterPos4dv == nil {\n\t\treturn errors.New(\"glRasterPos4dv\")\n\t}\n\tgpRasterPos4f = (C.GPRASTERPOS4F)(getProcAddr(\"glRasterPos4f\"))\n\tif gpRasterPos4f == nil {\n\t\treturn errors.New(\"glRasterPos4f\")\n\t}\n\tgpRasterPos4fv = (C.GPRASTERPOS4FV)(getProcAddr(\"glRasterPos4fv\"))\n\tif gpRasterPos4fv == nil {\n\t\treturn errors.New(\"glRasterPos4fv\")\n\t}\n\tgpRasterPos4i = (C.GPRASTERPOS4I)(getProcAddr(\"glRasterPos4i\"))\n\tif gpRasterPos4i == nil {\n\t\treturn errors.New(\"glRasterPos4i\")\n\t}\n\tgpRasterPos4iv = (C.GPRASTERPOS4IV)(getProcAddr(\"glRasterPos4iv\"))\n\tif gpRasterPos4iv == nil {\n\t\treturn errors.New(\"glRasterPos4iv\")\n\t}\n\tgpRasterPos4s = (C.GPRASTERPOS4S)(getProcAddr(\"glRasterPos4s\"))\n\tif gpRasterPos4s == nil {\n\t\treturn errors.New(\"glRasterPos4s\")\n\t}\n\tgpRasterPos4sv = (C.GPRASTERPOS4SV)(getProcAddr(\"glRasterPos4sv\"))\n\tif gpRasterPos4sv == nil {\n\t\treturn errors.New(\"glRasterPos4sv\")\n\t}\n\tgpRasterPos4xOES = (C.GPRASTERPOS4XOES)(getProcAddr(\"glRasterPos4xOES\"))\n\tgpRasterPos4xvOES = (C.GPRASTERPOS4XVOES)(getProcAddr(\"glRasterPos4xvOES\"))\n\tgpRasterSamplesEXT = (C.GPRASTERSAMPLESEXT)(getProcAddr(\"glRasterSamplesEXT\"))\n\tgpReadBuffer = (C.GPREADBUFFER)(getProcAddr(\"glReadBuffer\"))\n\tif gpReadBuffer == nil {\n\t\treturn errors.New(\"glReadBuffer\")\n\t}\n\tgpReadInstrumentsSGIX = (C.GPREADINSTRUMENTSSGIX)(getProcAddr(\"glReadInstrumentsSGIX\"))\n\tgpReadPixels = (C.GPREADPIXELS)(getProcAddr(\"glReadPixels\"))\n\tif gpReadPixels == nil {\n\t\treturn errors.New(\"glReadPixels\")\n\t}\n\tgpReadnPixels = (C.GPREADNPIXELS)(getProcAddr(\"glReadnPixels\"))\n\tgpReadnPixelsARB = (C.GPREADNPIXELSARB)(getProcAddr(\"glReadnPixelsARB\"))\n\tgpReadnPixelsKHR = (C.GPREADNPIXELSKHR)(getProcAddr(\"glReadnPixelsKHR\"))\n\tgpRectd = (C.GPRECTD)(getProcAddr(\"glRectd\"))\n\tif gpRectd == nil {\n\t\treturn errors.New(\"glRectd\")\n\t}\n\tgpRectdv = (C.GPRECTDV)(getProcAddr(\"glRectdv\"))\n\tif gpRectdv == nil {\n\t\treturn errors.New(\"glRectdv\")\n\t}\n\tgpRectf = (C.GPRECTF)(getProcAddr(\"glRectf\"))\n\tif gpRectf == nil {\n\t\treturn errors.New(\"glRectf\")\n\t}\n\tgpRectfv = (C.GPRECTFV)(getProcAddr(\"glRectfv\"))\n\tif gpRectfv == nil {\n\t\treturn errors.New(\"glRectfv\")\n\t}\n\tgpRecti = (C.GPRECTI)(getProcAddr(\"glRecti\"))\n\tif gpRecti == nil {\n\t\treturn errors.New(\"glRecti\")\n\t}\n\tgpRectiv = (C.GPRECTIV)(getProcAddr(\"glRectiv\"))\n\tif gpRectiv == nil {\n\t\treturn errors.New(\"glRectiv\")\n\t}\n\tgpRects = (C.GPRECTS)(getProcAddr(\"glRects\"))\n\tif gpRects == nil {\n\t\treturn errors.New(\"glRects\")\n\t}\n\tgpRectsv = (C.GPRECTSV)(getProcAddr(\"glRectsv\"))\n\tif gpRectsv == nil {\n\t\treturn errors.New(\"glRectsv\")\n\t}\n\tgpRectxOES = (C.GPRECTXOES)(getProcAddr(\"glRectxOES\"))\n\tgpRectxvOES = (C.GPRECTXVOES)(getProcAddr(\"glRectxvOES\"))\n\tgpReferencePlaneSGIX = (C.GPREFERENCEPLANESGIX)(getProcAddr(\"glReferencePlaneSGIX\"))\n\tgpReleaseKeyedMutexWin32EXT = (C.GPRELEASEKEYEDMUTEXWIN32EXT)(getProcAddr(\"glReleaseKeyedMutexWin32EXT\"))\n\tgpReleaseShaderCompiler = (C.GPRELEASESHADERCOMPILER)(getProcAddr(\"glReleaseShaderCompiler\"))\n\tif gpReleaseShaderCompiler == nil {\n\t\treturn errors.New(\"glReleaseShaderCompiler\")\n\t}\n\tgpRenderGpuMaskNV = (C.GPRENDERGPUMASKNV)(getProcAddr(\"glRenderGpuMaskNV\"))\n\tgpRenderMode = (C.GPRENDERMODE)(getProcAddr(\"glRenderMode\"))\n\tif gpRenderMode == nil {\n\t\treturn errors.New(\"glRenderMode\")\n\t}\n\tgpRenderbufferStorage = (C.GPRENDERBUFFERSTORAGE)(getProcAddr(\"glRenderbufferStorage\"))\n\tif gpRenderbufferStorage == nil {\n\t\treturn errors.New(\"glRenderbufferStorage\")\n\t}\n\tgpRenderbufferStorageEXT = (C.GPRENDERBUFFERSTORAGEEXT)(getProcAddr(\"glRenderbufferStorageEXT\"))\n\tgpRenderbufferStorageMultisample = (C.GPRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr(\"glRenderbufferStorageMultisample\"))\n\tif gpRenderbufferStorageMultisample == nil {\n\t\treturn errors.New(\"glRenderbufferStorageMultisample\")\n\t}\n\tgpRenderbufferStorageMultisampleAdvancedAMD = (C.GPRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(getProcAddr(\"glRenderbufferStorageMultisampleAdvancedAMD\"))\n\tgpRenderbufferStorageMultisampleCoverageNV = (C.GPRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENV)(getProcAddr(\"glRenderbufferStorageMultisampleCoverageNV\"))\n\tgpRenderbufferStorageMultisampleEXT = (C.GPRENDERBUFFERSTORAGEMULTISAMPLEEXT)(getProcAddr(\"glRenderbufferStorageMultisampleEXT\"))\n\tgpReplacementCodePointerSUN = (C.GPREPLACEMENTCODEPOINTERSUN)(getProcAddr(\"glReplacementCodePointerSUN\"))\n\tgpReplacementCodeubSUN = (C.GPREPLACEMENTCODEUBSUN)(getProcAddr(\"glReplacementCodeubSUN\"))\n\tgpReplacementCodeubvSUN = (C.GPREPLACEMENTCODEUBVSUN)(getProcAddr(\"glReplacementCodeubvSUN\"))\n\tgpReplacementCodeuiColor3fVertex3fSUN = (C.GPREPLACEMENTCODEUICOLOR3FVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiColor3fVertex3fSUN\"))\n\tgpReplacementCodeuiColor3fVertex3fvSUN = (C.GPREPLACEMENTCODEUICOLOR3FVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiColor3fVertex3fvSUN\"))\n\tgpReplacementCodeuiColor4fNormal3fVertex3fSUN = (C.GPREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiColor4fNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiColor4fNormal3fVertex3fvSUN = (C.GPREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiColor4fNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiColor4ubVertex3fSUN = (C.GPREPLACEMENTCODEUICOLOR4UBVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiColor4ubVertex3fSUN\"))\n\tgpReplacementCodeuiColor4ubVertex3fvSUN = (C.GPREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiColor4ubVertex3fvSUN\"))\n\tgpReplacementCodeuiNormal3fVertex3fSUN = (C.GPREPLACEMENTCODEUINORMAL3FVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiNormal3fVertex3fvSUN = (C.GPREPLACEMENTCODEUINORMAL3FVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiSUN = (C.GPREPLACEMENTCODEUISUN)(getProcAddr(\"glReplacementCodeuiSUN\"))\n\tgpReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (C.GPREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (C.GPREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (C.GPREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\"))\n\tgpReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (C.GPREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\"))\n\tgpReplacementCodeuiTexCoord2fVertex3fSUN = (C.GPREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiTexCoord2fVertex3fSUN\"))\n\tgpReplacementCodeuiTexCoord2fVertex3fvSUN = (C.GPREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiTexCoord2fVertex3fvSUN\"))\n\tgpReplacementCodeuiVertex3fSUN = (C.GPREPLACEMENTCODEUIVERTEX3FSUN)(getProcAddr(\"glReplacementCodeuiVertex3fSUN\"))\n\tgpReplacementCodeuiVertex3fvSUN = (C.GPREPLACEMENTCODEUIVERTEX3FVSUN)(getProcAddr(\"glReplacementCodeuiVertex3fvSUN\"))\n\tgpReplacementCodeuivSUN = (C.GPREPLACEMENTCODEUIVSUN)(getProcAddr(\"glReplacementCodeuivSUN\"))\n\tgpReplacementCodeusSUN = (C.GPREPLACEMENTCODEUSSUN)(getProcAddr(\"glReplacementCodeusSUN\"))\n\tgpReplacementCodeusvSUN = (C.GPREPLACEMENTCODEUSVSUN)(getProcAddr(\"glReplacementCodeusvSUN\"))\n\tgpRequestResidentProgramsNV = (C.GPREQUESTRESIDENTPROGRAMSNV)(getProcAddr(\"glRequestResidentProgramsNV\"))\n\tgpResetHistogram = (C.GPRESETHISTOGRAM)(getProcAddr(\"glResetHistogram\"))\n\tgpResetHistogramEXT = (C.GPRESETHISTOGRAMEXT)(getProcAddr(\"glResetHistogramEXT\"))\n\tgpResetMemoryObjectParameterNV = (C.GPRESETMEMORYOBJECTPARAMETERNV)(getProcAddr(\"glResetMemoryObjectParameterNV\"))\n\tgpResetMinmax = (C.GPRESETMINMAX)(getProcAddr(\"glResetMinmax\"))\n\tgpResetMinmaxEXT = (C.GPRESETMINMAXEXT)(getProcAddr(\"glResetMinmaxEXT\"))\n\tgpResizeBuffersMESA = (C.GPRESIZEBUFFERSMESA)(getProcAddr(\"glResizeBuffersMESA\"))\n\tgpResolveDepthValuesNV = (C.GPRESOLVEDEPTHVALUESNV)(getProcAddr(\"glResolveDepthValuesNV\"))\n\tgpResumeTransformFeedback = (C.GPRESUMETRANSFORMFEEDBACK)(getProcAddr(\"glResumeTransformFeedback\"))\n\tif gpResumeTransformFeedback == nil {\n\t\treturn errors.New(\"glResumeTransformFeedback\")\n\t}\n\tgpResumeTransformFeedbackNV = (C.GPRESUMETRANSFORMFEEDBACKNV)(getProcAddr(\"glResumeTransformFeedbackNV\"))\n\tgpRotated = (C.GPROTATED)(getProcAddr(\"glRotated\"))\n\tif gpRotated == nil {\n\t\treturn errors.New(\"glRotated\")\n\t}\n\tgpRotatef = (C.GPROTATEF)(getProcAddr(\"glRotatef\"))\n\tif gpRotatef == nil {\n\t\treturn errors.New(\"glRotatef\")\n\t}\n\tgpRotatexOES = (C.GPROTATEXOES)(getProcAddr(\"glRotatexOES\"))\n\tgpSampleCoverage = (C.GPSAMPLECOVERAGE)(getProcAddr(\"glSampleCoverage\"))\n\tif gpSampleCoverage == nil {\n\t\treturn errors.New(\"glSampleCoverage\")\n\t}\n\tgpSampleCoverageARB = (C.GPSAMPLECOVERAGEARB)(getProcAddr(\"glSampleCoverageARB\"))\n\tgpSampleCoveragexOES = (C.GPSAMPLECOVERAGEXOES)(getProcAddr(\"glSampleCoveragexOES\"))\n\tgpSampleMapATI = (C.GPSAMPLEMAPATI)(getProcAddr(\"glSampleMapATI\"))\n\tgpSampleMaskEXT = (C.GPSAMPLEMASKEXT)(getProcAddr(\"glSampleMaskEXT\"))\n\tgpSampleMaskIndexedNV = (C.GPSAMPLEMASKINDEXEDNV)(getProcAddr(\"glSampleMaskIndexedNV\"))\n\tgpSampleMaskSGIS = (C.GPSAMPLEMASKSGIS)(getProcAddr(\"glSampleMaskSGIS\"))\n\tgpSampleMaski = (C.GPSAMPLEMASKI)(getProcAddr(\"glSampleMaski\"))\n\tif gpSampleMaski == nil {\n\t\treturn errors.New(\"glSampleMaski\")\n\t}\n\tgpSamplePatternEXT = (C.GPSAMPLEPATTERNEXT)(getProcAddr(\"glSamplePatternEXT\"))\n\tgpSamplePatternSGIS = (C.GPSAMPLEPATTERNSGIS)(getProcAddr(\"glSamplePatternSGIS\"))\n\tgpSamplerParameterIiv = (C.GPSAMPLERPARAMETERIIV)(getProcAddr(\"glSamplerParameterIiv\"))\n\tif gpSamplerParameterIiv == nil {\n\t\treturn errors.New(\"glSamplerParameterIiv\")\n\t}\n\tgpSamplerParameterIuiv = (C.GPSAMPLERPARAMETERIUIV)(getProcAddr(\"glSamplerParameterIuiv\"))\n\tif gpSamplerParameterIuiv == nil {\n\t\treturn errors.New(\"glSamplerParameterIuiv\")\n\t}\n\tgpSamplerParameterf = (C.GPSAMPLERPARAMETERF)(getProcAddr(\"glSamplerParameterf\"))\n\tif gpSamplerParameterf == nil {\n\t\treturn errors.New(\"glSamplerParameterf\")\n\t}\n\tgpSamplerParameterfv = (C.GPSAMPLERPARAMETERFV)(getProcAddr(\"glSamplerParameterfv\"))\n\tif gpSamplerParameterfv == nil {\n\t\treturn errors.New(\"glSamplerParameterfv\")\n\t}\n\tgpSamplerParameteri = (C.GPSAMPLERPARAMETERI)(getProcAddr(\"glSamplerParameteri\"))\n\tif gpSamplerParameteri == nil {\n\t\treturn errors.New(\"glSamplerParameteri\")\n\t}\n\tgpSamplerParameteriv = (C.GPSAMPLERPARAMETERIV)(getProcAddr(\"glSamplerParameteriv\"))\n\tif gpSamplerParameteriv == nil {\n\t\treturn errors.New(\"glSamplerParameteriv\")\n\t}\n\tgpScaled = (C.GPSCALED)(getProcAddr(\"glScaled\"))\n\tif gpScaled == nil {\n\t\treturn errors.New(\"glScaled\")\n\t}\n\tgpScalef = (C.GPSCALEF)(getProcAddr(\"glScalef\"))\n\tif gpScalef == nil {\n\t\treturn errors.New(\"glScalef\")\n\t}\n\tgpScalexOES = (C.GPSCALEXOES)(getProcAddr(\"glScalexOES\"))\n\tgpScissor = (C.GPSCISSOR)(getProcAddr(\"glScissor\"))\n\tif gpScissor == nil {\n\t\treturn errors.New(\"glScissor\")\n\t}\n\tgpScissorArrayv = (C.GPSCISSORARRAYV)(getProcAddr(\"glScissorArrayv\"))\n\tif gpScissorArrayv == nil {\n\t\treturn errors.New(\"glScissorArrayv\")\n\t}\n\tgpScissorExclusiveArrayvNV = (C.GPSCISSOREXCLUSIVEARRAYVNV)(getProcAddr(\"glScissorExclusiveArrayvNV\"))\n\tgpScissorExclusiveNV = (C.GPSCISSOREXCLUSIVENV)(getProcAddr(\"glScissorExclusiveNV\"))\n\tgpScissorIndexed = (C.GPSCISSORINDEXED)(getProcAddr(\"glScissorIndexed\"))\n\tif gpScissorIndexed == nil {\n\t\treturn errors.New(\"glScissorIndexed\")\n\t}\n\tgpScissorIndexedv = (C.GPSCISSORINDEXEDV)(getProcAddr(\"glScissorIndexedv\"))\n\tif gpScissorIndexedv == nil {\n\t\treturn errors.New(\"glScissorIndexedv\")\n\t}\n\tgpSecondaryColor3b = (C.GPSECONDARYCOLOR3B)(getProcAddr(\"glSecondaryColor3b\"))\n\tif gpSecondaryColor3b == nil {\n\t\treturn errors.New(\"glSecondaryColor3b\")\n\t}\n\tgpSecondaryColor3bEXT = (C.GPSECONDARYCOLOR3BEXT)(getProcAddr(\"glSecondaryColor3bEXT\"))\n\tgpSecondaryColor3bv = (C.GPSECONDARYCOLOR3BV)(getProcAddr(\"glSecondaryColor3bv\"))\n\tif gpSecondaryColor3bv == nil {\n\t\treturn errors.New(\"glSecondaryColor3bv\")\n\t}\n\tgpSecondaryColor3bvEXT = (C.GPSECONDARYCOLOR3BVEXT)(getProcAddr(\"glSecondaryColor3bvEXT\"))\n\tgpSecondaryColor3d = (C.GPSECONDARYCOLOR3D)(getProcAddr(\"glSecondaryColor3d\"))\n\tif gpSecondaryColor3d == nil {\n\t\treturn errors.New(\"glSecondaryColor3d\")\n\t}\n\tgpSecondaryColor3dEXT = (C.GPSECONDARYCOLOR3DEXT)(getProcAddr(\"glSecondaryColor3dEXT\"))\n\tgpSecondaryColor3dv = (C.GPSECONDARYCOLOR3DV)(getProcAddr(\"glSecondaryColor3dv\"))\n\tif gpSecondaryColor3dv == nil {\n\t\treturn errors.New(\"glSecondaryColor3dv\")\n\t}\n\tgpSecondaryColor3dvEXT = (C.GPSECONDARYCOLOR3DVEXT)(getProcAddr(\"glSecondaryColor3dvEXT\"))\n\tgpSecondaryColor3f = (C.GPSECONDARYCOLOR3F)(getProcAddr(\"glSecondaryColor3f\"))\n\tif gpSecondaryColor3f == nil {\n\t\treturn errors.New(\"glSecondaryColor3f\")\n\t}\n\tgpSecondaryColor3fEXT = (C.GPSECONDARYCOLOR3FEXT)(getProcAddr(\"glSecondaryColor3fEXT\"))\n\tgpSecondaryColor3fv = (C.GPSECONDARYCOLOR3FV)(getProcAddr(\"glSecondaryColor3fv\"))\n\tif gpSecondaryColor3fv == nil {\n\t\treturn errors.New(\"glSecondaryColor3fv\")\n\t}\n\tgpSecondaryColor3fvEXT = (C.GPSECONDARYCOLOR3FVEXT)(getProcAddr(\"glSecondaryColor3fvEXT\"))\n\tgpSecondaryColor3hNV = (C.GPSECONDARYCOLOR3HNV)(getProcAddr(\"glSecondaryColor3hNV\"))\n\tgpSecondaryColor3hvNV = (C.GPSECONDARYCOLOR3HVNV)(getProcAddr(\"glSecondaryColor3hvNV\"))\n\tgpSecondaryColor3i = (C.GPSECONDARYCOLOR3I)(getProcAddr(\"glSecondaryColor3i\"))\n\tif gpSecondaryColor3i == nil {\n\t\treturn errors.New(\"glSecondaryColor3i\")\n\t}\n\tgpSecondaryColor3iEXT = (C.GPSECONDARYCOLOR3IEXT)(getProcAddr(\"glSecondaryColor3iEXT\"))\n\tgpSecondaryColor3iv = (C.GPSECONDARYCOLOR3IV)(getProcAddr(\"glSecondaryColor3iv\"))\n\tif gpSecondaryColor3iv == nil {\n\t\treturn errors.New(\"glSecondaryColor3iv\")\n\t}\n\tgpSecondaryColor3ivEXT = (C.GPSECONDARYCOLOR3IVEXT)(getProcAddr(\"glSecondaryColor3ivEXT\"))\n\tgpSecondaryColor3s = (C.GPSECONDARYCOLOR3S)(getProcAddr(\"glSecondaryColor3s\"))\n\tif gpSecondaryColor3s == nil {\n\t\treturn errors.New(\"glSecondaryColor3s\")\n\t}\n\tgpSecondaryColor3sEXT = (C.GPSECONDARYCOLOR3SEXT)(getProcAddr(\"glSecondaryColor3sEXT\"))\n\tgpSecondaryColor3sv = (C.GPSECONDARYCOLOR3SV)(getProcAddr(\"glSecondaryColor3sv\"))\n\tif gpSecondaryColor3sv == nil {\n\t\treturn errors.New(\"glSecondaryColor3sv\")\n\t}\n\tgpSecondaryColor3svEXT = (C.GPSECONDARYCOLOR3SVEXT)(getProcAddr(\"glSecondaryColor3svEXT\"))\n\tgpSecondaryColor3ub = (C.GPSECONDARYCOLOR3UB)(getProcAddr(\"glSecondaryColor3ub\"))\n\tif gpSecondaryColor3ub == nil {\n\t\treturn errors.New(\"glSecondaryColor3ub\")\n\t}\n\tgpSecondaryColor3ubEXT = (C.GPSECONDARYCOLOR3UBEXT)(getProcAddr(\"glSecondaryColor3ubEXT\"))\n\tgpSecondaryColor3ubv = (C.GPSECONDARYCOLOR3UBV)(getProcAddr(\"glSecondaryColor3ubv\"))\n\tif gpSecondaryColor3ubv == nil {\n\t\treturn errors.New(\"glSecondaryColor3ubv\")\n\t}\n\tgpSecondaryColor3ubvEXT = (C.GPSECONDARYCOLOR3UBVEXT)(getProcAddr(\"glSecondaryColor3ubvEXT\"))\n\tgpSecondaryColor3ui = (C.GPSECONDARYCOLOR3UI)(getProcAddr(\"glSecondaryColor3ui\"))\n\tif gpSecondaryColor3ui == nil {\n\t\treturn errors.New(\"glSecondaryColor3ui\")\n\t}\n\tgpSecondaryColor3uiEXT = (C.GPSECONDARYCOLOR3UIEXT)(getProcAddr(\"glSecondaryColor3uiEXT\"))\n\tgpSecondaryColor3uiv = (C.GPSECONDARYCOLOR3UIV)(getProcAddr(\"glSecondaryColor3uiv\"))\n\tif gpSecondaryColor3uiv == nil {\n\t\treturn errors.New(\"glSecondaryColor3uiv\")\n\t}\n\tgpSecondaryColor3uivEXT = (C.GPSECONDARYCOLOR3UIVEXT)(getProcAddr(\"glSecondaryColor3uivEXT\"))\n\tgpSecondaryColor3us = (C.GPSECONDARYCOLOR3US)(getProcAddr(\"glSecondaryColor3us\"))\n\tif gpSecondaryColor3us == nil {\n\t\treturn errors.New(\"glSecondaryColor3us\")\n\t}\n\tgpSecondaryColor3usEXT = (C.GPSECONDARYCOLOR3USEXT)(getProcAddr(\"glSecondaryColor3usEXT\"))\n\tgpSecondaryColor3usv = (C.GPSECONDARYCOLOR3USV)(getProcAddr(\"glSecondaryColor3usv\"))\n\tif gpSecondaryColor3usv == nil {\n\t\treturn errors.New(\"glSecondaryColor3usv\")\n\t}\n\tgpSecondaryColor3usvEXT = (C.GPSECONDARYCOLOR3USVEXT)(getProcAddr(\"glSecondaryColor3usvEXT\"))\n\tgpSecondaryColorFormatNV = (C.GPSECONDARYCOLORFORMATNV)(getProcAddr(\"glSecondaryColorFormatNV\"))\n\tgpSecondaryColorP3ui = (C.GPSECONDARYCOLORP3UI)(getProcAddr(\"glSecondaryColorP3ui\"))\n\tif gpSecondaryColorP3ui == nil {\n\t\treturn errors.New(\"glSecondaryColorP3ui\")\n\t}\n\tgpSecondaryColorP3uiv = (C.GPSECONDARYCOLORP3UIV)(getProcAddr(\"glSecondaryColorP3uiv\"))\n\tif gpSecondaryColorP3uiv == nil {\n\t\treturn errors.New(\"glSecondaryColorP3uiv\")\n\t}\n\tgpSecondaryColorPointer = (C.GPSECONDARYCOLORPOINTER)(getProcAddr(\"glSecondaryColorPointer\"))\n\tif gpSecondaryColorPointer == nil {\n\t\treturn errors.New(\"glSecondaryColorPointer\")\n\t}\n\tgpSecondaryColorPointerEXT = (C.GPSECONDARYCOLORPOINTEREXT)(getProcAddr(\"glSecondaryColorPointerEXT\"))\n\tgpSecondaryColorPointerListIBM = (C.GPSECONDARYCOLORPOINTERLISTIBM)(getProcAddr(\"glSecondaryColorPointerListIBM\"))\n\tgpSelectBuffer = (C.GPSELECTBUFFER)(getProcAddr(\"glSelectBuffer\"))\n\tif gpSelectBuffer == nil {\n\t\treturn errors.New(\"glSelectBuffer\")\n\t}\n\tgpSelectPerfMonitorCountersAMD = (C.GPSELECTPERFMONITORCOUNTERSAMD)(getProcAddr(\"glSelectPerfMonitorCountersAMD\"))\n\tgpSemaphoreParameterivNV = (C.GPSEMAPHOREPARAMETERIVNV)(getProcAddr(\"glSemaphoreParameterivNV\"))\n\tgpSemaphoreParameterui64vEXT = (C.GPSEMAPHOREPARAMETERUI64VEXT)(getProcAddr(\"glSemaphoreParameterui64vEXT\"))\n\tgpSeparableFilter2D = (C.GPSEPARABLEFILTER2D)(getProcAddr(\"glSeparableFilter2D\"))\n\tgpSeparableFilter2DEXT = (C.GPSEPARABLEFILTER2DEXT)(getProcAddr(\"glSeparableFilter2DEXT\"))\n\tgpSetFenceAPPLE = (C.GPSETFENCEAPPLE)(getProcAddr(\"glSetFenceAPPLE\"))\n\tgpSetFenceNV = (C.GPSETFENCENV)(getProcAddr(\"glSetFenceNV\"))\n\tgpSetFragmentShaderConstantATI = (C.GPSETFRAGMENTSHADERCONSTANTATI)(getProcAddr(\"glSetFragmentShaderConstantATI\"))\n\tgpSetInvariantEXT = (C.GPSETINVARIANTEXT)(getProcAddr(\"glSetInvariantEXT\"))\n\tgpSetLocalConstantEXT = (C.GPSETLOCALCONSTANTEXT)(getProcAddr(\"glSetLocalConstantEXT\"))\n\tgpSetMultisamplefvAMD = (C.GPSETMULTISAMPLEFVAMD)(getProcAddr(\"glSetMultisamplefvAMD\"))\n\tgpShadeModel = (C.GPSHADEMODEL)(getProcAddr(\"glShadeModel\"))\n\tif gpShadeModel == nil {\n\t\treturn errors.New(\"glShadeModel\")\n\t}\n\tgpShaderBinary = (C.GPSHADERBINARY)(getProcAddr(\"glShaderBinary\"))\n\tif gpShaderBinary == nil {\n\t\treturn errors.New(\"glShaderBinary\")\n\t}\n\tgpShaderOp1EXT = (C.GPSHADEROP1EXT)(getProcAddr(\"glShaderOp1EXT\"))\n\tgpShaderOp2EXT = (C.GPSHADEROP2EXT)(getProcAddr(\"glShaderOp2EXT\"))\n\tgpShaderOp3EXT = (C.GPSHADEROP3EXT)(getProcAddr(\"glShaderOp3EXT\"))\n\tgpShaderSource = (C.GPSHADERSOURCE)(getProcAddr(\"glShaderSource\"))\n\tif gpShaderSource == nil {\n\t\treturn errors.New(\"glShaderSource\")\n\t}\n\tgpShaderSourceARB = (C.GPSHADERSOURCEARB)(getProcAddr(\"glShaderSourceARB\"))\n\tgpShaderStorageBlockBinding = (C.GPSHADERSTORAGEBLOCKBINDING)(getProcAddr(\"glShaderStorageBlockBinding\"))\n\tif gpShaderStorageBlockBinding == nil {\n\t\treturn errors.New(\"glShaderStorageBlockBinding\")\n\t}\n\tgpShadingRateImageBarrierNV = (C.GPSHADINGRATEIMAGEBARRIERNV)(getProcAddr(\"glShadingRateImageBarrierNV\"))\n\tgpShadingRateImagePaletteNV = (C.GPSHADINGRATEIMAGEPALETTENV)(getProcAddr(\"glShadingRateImagePaletteNV\"))\n\tgpShadingRateSampleOrderCustomNV = (C.GPSHADINGRATESAMPLEORDERCUSTOMNV)(getProcAddr(\"glShadingRateSampleOrderCustomNV\"))\n\tgpShadingRateSampleOrderNV = (C.GPSHADINGRATESAMPLEORDERNV)(getProcAddr(\"glShadingRateSampleOrderNV\"))\n\tgpSharpenTexFuncSGIS = (C.GPSHARPENTEXFUNCSGIS)(getProcAddr(\"glSharpenTexFuncSGIS\"))\n\tgpSignalSemaphoreEXT = (C.GPSIGNALSEMAPHOREEXT)(getProcAddr(\"glSignalSemaphoreEXT\"))\n\tgpSignalSemaphoreui64NVX = (C.GPSIGNALSEMAPHOREUI64NVX)(getProcAddr(\"glSignalSemaphoreui64NVX\"))\n\tgpSignalVkFenceNV = (C.GPSIGNALVKFENCENV)(getProcAddr(\"glSignalVkFenceNV\"))\n\tgpSignalVkSemaphoreNV = (C.GPSIGNALVKSEMAPHORENV)(getProcAddr(\"glSignalVkSemaphoreNV\"))\n\tgpSpecializeShaderARB = (C.GPSPECIALIZESHADERARB)(getProcAddr(\"glSpecializeShaderARB\"))\n\tgpSpriteParameterfSGIX = (C.GPSPRITEPARAMETERFSGIX)(getProcAddr(\"glSpriteParameterfSGIX\"))\n\tgpSpriteParameterfvSGIX = (C.GPSPRITEPARAMETERFVSGIX)(getProcAddr(\"glSpriteParameterfvSGIX\"))\n\tgpSpriteParameteriSGIX = (C.GPSPRITEPARAMETERISGIX)(getProcAddr(\"glSpriteParameteriSGIX\"))\n\tgpSpriteParameterivSGIX = (C.GPSPRITEPARAMETERIVSGIX)(getProcAddr(\"glSpriteParameterivSGIX\"))\n\tgpStartInstrumentsSGIX = (C.GPSTARTINSTRUMENTSSGIX)(getProcAddr(\"glStartInstrumentsSGIX\"))\n\tgpStateCaptureNV = (C.GPSTATECAPTURENV)(getProcAddr(\"glStateCaptureNV\"))\n\tgpStencilClearTagEXT = (C.GPSTENCILCLEARTAGEXT)(getProcAddr(\"glStencilClearTagEXT\"))\n\tgpStencilFillPathInstancedNV = (C.GPSTENCILFILLPATHINSTANCEDNV)(getProcAddr(\"glStencilFillPathInstancedNV\"))\n\tgpStencilFillPathNV = (C.GPSTENCILFILLPATHNV)(getProcAddr(\"glStencilFillPathNV\"))\n\tgpStencilFunc = (C.GPSTENCILFUNC)(getProcAddr(\"glStencilFunc\"))\n\tif gpStencilFunc == nil {\n\t\treturn errors.New(\"glStencilFunc\")\n\t}\n\tgpStencilFuncSeparate = (C.GPSTENCILFUNCSEPARATE)(getProcAddr(\"glStencilFuncSeparate\"))\n\tif gpStencilFuncSeparate == nil {\n\t\treturn errors.New(\"glStencilFuncSeparate\")\n\t}\n\tgpStencilFuncSeparateATI = (C.GPSTENCILFUNCSEPARATEATI)(getProcAddr(\"glStencilFuncSeparateATI\"))\n\tgpStencilMask = (C.GPSTENCILMASK)(getProcAddr(\"glStencilMask\"))\n\tif gpStencilMask == nil {\n\t\treturn errors.New(\"glStencilMask\")\n\t}\n\tgpStencilMaskSeparate = (C.GPSTENCILMASKSEPARATE)(getProcAddr(\"glStencilMaskSeparate\"))\n\tif gpStencilMaskSeparate == nil {\n\t\treturn errors.New(\"glStencilMaskSeparate\")\n\t}\n\tgpStencilOp = (C.GPSTENCILOP)(getProcAddr(\"glStencilOp\"))\n\tif gpStencilOp == nil {\n\t\treturn errors.New(\"glStencilOp\")\n\t}\n\tgpStencilOpSeparate = (C.GPSTENCILOPSEPARATE)(getProcAddr(\"glStencilOpSeparate\"))\n\tif gpStencilOpSeparate == nil {\n\t\treturn errors.New(\"glStencilOpSeparate\")\n\t}\n\tgpStencilOpSeparateATI = (C.GPSTENCILOPSEPARATEATI)(getProcAddr(\"glStencilOpSeparateATI\"))\n\tgpStencilOpValueAMD = (C.GPSTENCILOPVALUEAMD)(getProcAddr(\"glStencilOpValueAMD\"))\n\tgpStencilStrokePathInstancedNV = (C.GPSTENCILSTROKEPATHINSTANCEDNV)(getProcAddr(\"glStencilStrokePathInstancedNV\"))\n\tgpStencilStrokePathNV = (C.GPSTENCILSTROKEPATHNV)(getProcAddr(\"glStencilStrokePathNV\"))\n\tgpStencilThenCoverFillPathInstancedNV = (C.GPSTENCILTHENCOVERFILLPATHINSTANCEDNV)(getProcAddr(\"glStencilThenCoverFillPathInstancedNV\"))\n\tgpStencilThenCoverFillPathNV = (C.GPSTENCILTHENCOVERFILLPATHNV)(getProcAddr(\"glStencilThenCoverFillPathNV\"))\n\tgpStencilThenCoverStrokePathInstancedNV = (C.GPSTENCILTHENCOVERSTROKEPATHINSTANCEDNV)(getProcAddr(\"glStencilThenCoverStrokePathInstancedNV\"))\n\tgpStencilThenCoverStrokePathNV = (C.GPSTENCILTHENCOVERSTROKEPATHNV)(getProcAddr(\"glStencilThenCoverStrokePathNV\"))\n\tgpStopInstrumentsSGIX = (C.GPSTOPINSTRUMENTSSGIX)(getProcAddr(\"glStopInstrumentsSGIX\"))\n\tgpStringMarkerGREMEDY = (C.GPSTRINGMARKERGREMEDY)(getProcAddr(\"glStringMarkerGREMEDY\"))\n\tgpSubpixelPrecisionBiasNV = (C.GPSUBPIXELPRECISIONBIASNV)(getProcAddr(\"glSubpixelPrecisionBiasNV\"))\n\tgpSwizzleEXT = (C.GPSWIZZLEEXT)(getProcAddr(\"glSwizzleEXT\"))\n\tgpSyncTextureINTEL = (C.GPSYNCTEXTUREINTEL)(getProcAddr(\"glSyncTextureINTEL\"))\n\tgpTagSampleBufferSGIX = (C.GPTAGSAMPLEBUFFERSGIX)(getProcAddr(\"glTagSampleBufferSGIX\"))\n\tgpTangent3bEXT = (C.GPTANGENT3BEXT)(getProcAddr(\"glTangent3bEXT\"))\n\tgpTangent3bvEXT = (C.GPTANGENT3BVEXT)(getProcAddr(\"glTangent3bvEXT\"))\n\tgpTangent3dEXT = (C.GPTANGENT3DEXT)(getProcAddr(\"glTangent3dEXT\"))\n\tgpTangent3dvEXT = (C.GPTANGENT3DVEXT)(getProcAddr(\"glTangent3dvEXT\"))\n\tgpTangent3fEXT = (C.GPTANGENT3FEXT)(getProcAddr(\"glTangent3fEXT\"))\n\tgpTangent3fvEXT = (C.GPTANGENT3FVEXT)(getProcAddr(\"glTangent3fvEXT\"))\n\tgpTangent3iEXT = (C.GPTANGENT3IEXT)(getProcAddr(\"glTangent3iEXT\"))\n\tgpTangent3ivEXT = (C.GPTANGENT3IVEXT)(getProcAddr(\"glTangent3ivEXT\"))\n\tgpTangent3sEXT = (C.GPTANGENT3SEXT)(getProcAddr(\"glTangent3sEXT\"))\n\tgpTangent3svEXT = (C.GPTANGENT3SVEXT)(getProcAddr(\"glTangent3svEXT\"))\n\tgpTangentPointerEXT = (C.GPTANGENTPOINTEREXT)(getProcAddr(\"glTangentPointerEXT\"))\n\tgpTbufferMask3DFX = (C.GPTBUFFERMASK3DFX)(getProcAddr(\"glTbufferMask3DFX\"))\n\tgpTessellationFactorAMD = (C.GPTESSELLATIONFACTORAMD)(getProcAddr(\"glTessellationFactorAMD\"))\n\tgpTessellationModeAMD = (C.GPTESSELLATIONMODEAMD)(getProcAddr(\"glTessellationModeAMD\"))\n\tgpTestFenceAPPLE = (C.GPTESTFENCEAPPLE)(getProcAddr(\"glTestFenceAPPLE\"))\n\tgpTestFenceNV = (C.GPTESTFENCENV)(getProcAddr(\"glTestFenceNV\"))\n\tgpTestObjectAPPLE = (C.GPTESTOBJECTAPPLE)(getProcAddr(\"glTestObjectAPPLE\"))\n\tgpTexAttachMemoryNV = (C.GPTEXATTACHMEMORYNV)(getProcAddr(\"glTexAttachMemoryNV\"))\n\tgpTexBuffer = (C.GPTEXBUFFER)(getProcAddr(\"glTexBuffer\"))\n\tif gpTexBuffer == nil {\n\t\treturn errors.New(\"glTexBuffer\")\n\t}\n\tgpTexBufferARB = (C.GPTEXBUFFERARB)(getProcAddr(\"glTexBufferARB\"))\n\tgpTexBufferEXT = (C.GPTEXBUFFEREXT)(getProcAddr(\"glTexBufferEXT\"))\n\tgpTexBufferRange = (C.GPTEXBUFFERRANGE)(getProcAddr(\"glTexBufferRange\"))\n\tif gpTexBufferRange == nil {\n\t\treturn errors.New(\"glTexBufferRange\")\n\t}\n\tgpTexBumpParameterfvATI = (C.GPTEXBUMPPARAMETERFVATI)(getProcAddr(\"glTexBumpParameterfvATI\"))\n\tgpTexBumpParameterivATI = (C.GPTEXBUMPPARAMETERIVATI)(getProcAddr(\"glTexBumpParameterivATI\"))\n\tgpTexCoord1bOES = (C.GPTEXCOORD1BOES)(getProcAddr(\"glTexCoord1bOES\"))\n\tgpTexCoord1bvOES = (C.GPTEXCOORD1BVOES)(getProcAddr(\"glTexCoord1bvOES\"))\n\tgpTexCoord1d = (C.GPTEXCOORD1D)(getProcAddr(\"glTexCoord1d\"))\n\tif gpTexCoord1d == nil {\n\t\treturn errors.New(\"glTexCoord1d\")\n\t}\n\tgpTexCoord1dv = (C.GPTEXCOORD1DV)(getProcAddr(\"glTexCoord1dv\"))\n\tif gpTexCoord1dv == nil {\n\t\treturn errors.New(\"glTexCoord1dv\")\n\t}\n\tgpTexCoord1f = (C.GPTEXCOORD1F)(getProcAddr(\"glTexCoord1f\"))\n\tif gpTexCoord1f == nil {\n\t\treturn errors.New(\"glTexCoord1f\")\n\t}\n\tgpTexCoord1fv = (C.GPTEXCOORD1FV)(getProcAddr(\"glTexCoord1fv\"))\n\tif gpTexCoord1fv == nil {\n\t\treturn errors.New(\"glTexCoord1fv\")\n\t}\n\tgpTexCoord1hNV = (C.GPTEXCOORD1HNV)(getProcAddr(\"glTexCoord1hNV\"))\n\tgpTexCoord1hvNV = (C.GPTEXCOORD1HVNV)(getProcAddr(\"glTexCoord1hvNV\"))\n\tgpTexCoord1i = (C.GPTEXCOORD1I)(getProcAddr(\"glTexCoord1i\"))\n\tif gpTexCoord1i == nil {\n\t\treturn errors.New(\"glTexCoord1i\")\n\t}\n\tgpTexCoord1iv = (C.GPTEXCOORD1IV)(getProcAddr(\"glTexCoord1iv\"))\n\tif gpTexCoord1iv == nil {\n\t\treturn errors.New(\"glTexCoord1iv\")\n\t}\n\tgpTexCoord1s = (C.GPTEXCOORD1S)(getProcAddr(\"glTexCoord1s\"))\n\tif gpTexCoord1s == nil {\n\t\treturn errors.New(\"glTexCoord1s\")\n\t}\n\tgpTexCoord1sv = (C.GPTEXCOORD1SV)(getProcAddr(\"glTexCoord1sv\"))\n\tif gpTexCoord1sv == nil {\n\t\treturn errors.New(\"glTexCoord1sv\")\n\t}\n\tgpTexCoord1xOES = (C.GPTEXCOORD1XOES)(getProcAddr(\"glTexCoord1xOES\"))\n\tgpTexCoord1xvOES = (C.GPTEXCOORD1XVOES)(getProcAddr(\"glTexCoord1xvOES\"))\n\tgpTexCoord2bOES = (C.GPTEXCOORD2BOES)(getProcAddr(\"glTexCoord2bOES\"))\n\tgpTexCoord2bvOES = (C.GPTEXCOORD2BVOES)(getProcAddr(\"glTexCoord2bvOES\"))\n\tgpTexCoord2d = (C.GPTEXCOORD2D)(getProcAddr(\"glTexCoord2d\"))\n\tif gpTexCoord2d == nil {\n\t\treturn errors.New(\"glTexCoord2d\")\n\t}\n\tgpTexCoord2dv = (C.GPTEXCOORD2DV)(getProcAddr(\"glTexCoord2dv\"))\n\tif gpTexCoord2dv == nil {\n\t\treturn errors.New(\"glTexCoord2dv\")\n\t}\n\tgpTexCoord2f = (C.GPTEXCOORD2F)(getProcAddr(\"glTexCoord2f\"))\n\tif gpTexCoord2f == nil {\n\t\treturn errors.New(\"glTexCoord2f\")\n\t}\n\tgpTexCoord2fColor3fVertex3fSUN = (C.GPTEXCOORD2FCOLOR3FVERTEX3FSUN)(getProcAddr(\"glTexCoord2fColor3fVertex3fSUN\"))\n\tgpTexCoord2fColor3fVertex3fvSUN = (C.GPTEXCOORD2FCOLOR3FVERTEX3FVSUN)(getProcAddr(\"glTexCoord2fColor3fVertex3fvSUN\"))\n\tgpTexCoord2fColor4fNormal3fVertex3fSUN = (C.GPTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUN)(getProcAddr(\"glTexCoord2fColor4fNormal3fVertex3fSUN\"))\n\tgpTexCoord2fColor4fNormal3fVertex3fvSUN = (C.GPTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glTexCoord2fColor4fNormal3fVertex3fvSUN\"))\n\tgpTexCoord2fColor4ubVertex3fSUN = (C.GPTEXCOORD2FCOLOR4UBVERTEX3FSUN)(getProcAddr(\"glTexCoord2fColor4ubVertex3fSUN\"))\n\tgpTexCoord2fColor4ubVertex3fvSUN = (C.GPTEXCOORD2FCOLOR4UBVERTEX3FVSUN)(getProcAddr(\"glTexCoord2fColor4ubVertex3fvSUN\"))\n\tgpTexCoord2fNormal3fVertex3fSUN = (C.GPTEXCOORD2FNORMAL3FVERTEX3FSUN)(getProcAddr(\"glTexCoord2fNormal3fVertex3fSUN\"))\n\tgpTexCoord2fNormal3fVertex3fvSUN = (C.GPTEXCOORD2FNORMAL3FVERTEX3FVSUN)(getProcAddr(\"glTexCoord2fNormal3fVertex3fvSUN\"))\n\tgpTexCoord2fVertex3fSUN = (C.GPTEXCOORD2FVERTEX3FSUN)(getProcAddr(\"glTexCoord2fVertex3fSUN\"))\n\tgpTexCoord2fVertex3fvSUN = (C.GPTEXCOORD2FVERTEX3FVSUN)(getProcAddr(\"glTexCoord2fVertex3fvSUN\"))\n\tgpTexCoord2fv = (C.GPTEXCOORD2FV)(getProcAddr(\"glTexCoord2fv\"))\n\tif gpTexCoord2fv == nil {\n\t\treturn errors.New(\"glTexCoord2fv\")\n\t}\n\tgpTexCoord2hNV = (C.GPTEXCOORD2HNV)(getProcAddr(\"glTexCoord2hNV\"))\n\tgpTexCoord2hvNV = (C.GPTEXCOORD2HVNV)(getProcAddr(\"glTexCoord2hvNV\"))\n\tgpTexCoord2i = (C.GPTEXCOORD2I)(getProcAddr(\"glTexCoord2i\"))\n\tif gpTexCoord2i == nil {\n\t\treturn errors.New(\"glTexCoord2i\")\n\t}\n\tgpTexCoord2iv = (C.GPTEXCOORD2IV)(getProcAddr(\"glTexCoord2iv\"))\n\tif gpTexCoord2iv == nil {\n\t\treturn errors.New(\"glTexCoord2iv\")\n\t}\n\tgpTexCoord2s = (C.GPTEXCOORD2S)(getProcAddr(\"glTexCoord2s\"))\n\tif gpTexCoord2s == nil {\n\t\treturn errors.New(\"glTexCoord2s\")\n\t}\n\tgpTexCoord2sv = (C.GPTEXCOORD2SV)(getProcAddr(\"glTexCoord2sv\"))\n\tif gpTexCoord2sv == nil {\n\t\treturn errors.New(\"glTexCoord2sv\")\n\t}\n\tgpTexCoord2xOES = (C.GPTEXCOORD2XOES)(getProcAddr(\"glTexCoord2xOES\"))\n\tgpTexCoord2xvOES = (C.GPTEXCOORD2XVOES)(getProcAddr(\"glTexCoord2xvOES\"))\n\tgpTexCoord3bOES = (C.GPTEXCOORD3BOES)(getProcAddr(\"glTexCoord3bOES\"))\n\tgpTexCoord3bvOES = (C.GPTEXCOORD3BVOES)(getProcAddr(\"glTexCoord3bvOES\"))\n\tgpTexCoord3d = (C.GPTEXCOORD3D)(getProcAddr(\"glTexCoord3d\"))\n\tif gpTexCoord3d == nil {\n\t\treturn errors.New(\"glTexCoord3d\")\n\t}\n\tgpTexCoord3dv = (C.GPTEXCOORD3DV)(getProcAddr(\"glTexCoord3dv\"))\n\tif gpTexCoord3dv == nil {\n\t\treturn errors.New(\"glTexCoord3dv\")\n\t}\n\tgpTexCoord3f = (C.GPTEXCOORD3F)(getProcAddr(\"glTexCoord3f\"))\n\tif gpTexCoord3f == nil {\n\t\treturn errors.New(\"glTexCoord3f\")\n\t}\n\tgpTexCoord3fv = (C.GPTEXCOORD3FV)(getProcAddr(\"glTexCoord3fv\"))\n\tif gpTexCoord3fv == nil {\n\t\treturn errors.New(\"glTexCoord3fv\")\n\t}\n\tgpTexCoord3hNV = (C.GPTEXCOORD3HNV)(getProcAddr(\"glTexCoord3hNV\"))\n\tgpTexCoord3hvNV = (C.GPTEXCOORD3HVNV)(getProcAddr(\"glTexCoord3hvNV\"))\n\tgpTexCoord3i = (C.GPTEXCOORD3I)(getProcAddr(\"glTexCoord3i\"))\n\tif gpTexCoord3i == nil {\n\t\treturn errors.New(\"glTexCoord3i\")\n\t}\n\tgpTexCoord3iv = (C.GPTEXCOORD3IV)(getProcAddr(\"glTexCoord3iv\"))\n\tif gpTexCoord3iv == nil {\n\t\treturn errors.New(\"glTexCoord3iv\")\n\t}\n\tgpTexCoord3s = (C.GPTEXCOORD3S)(getProcAddr(\"glTexCoord3s\"))\n\tif gpTexCoord3s == nil {\n\t\treturn errors.New(\"glTexCoord3s\")\n\t}\n\tgpTexCoord3sv = (C.GPTEXCOORD3SV)(getProcAddr(\"glTexCoord3sv\"))\n\tif gpTexCoord3sv == nil {\n\t\treturn errors.New(\"glTexCoord3sv\")\n\t}\n\tgpTexCoord3xOES = (C.GPTEXCOORD3XOES)(getProcAddr(\"glTexCoord3xOES\"))\n\tgpTexCoord3xvOES = (C.GPTEXCOORD3XVOES)(getProcAddr(\"glTexCoord3xvOES\"))\n\tgpTexCoord4bOES = (C.GPTEXCOORD4BOES)(getProcAddr(\"glTexCoord4bOES\"))\n\tgpTexCoord4bvOES = (C.GPTEXCOORD4BVOES)(getProcAddr(\"glTexCoord4bvOES\"))\n\tgpTexCoord4d = (C.GPTEXCOORD4D)(getProcAddr(\"glTexCoord4d\"))\n\tif gpTexCoord4d == nil {\n\t\treturn errors.New(\"glTexCoord4d\")\n\t}\n\tgpTexCoord4dv = (C.GPTEXCOORD4DV)(getProcAddr(\"glTexCoord4dv\"))\n\tif gpTexCoord4dv == nil {\n\t\treturn errors.New(\"glTexCoord4dv\")\n\t}\n\tgpTexCoord4f = (C.GPTEXCOORD4F)(getProcAddr(\"glTexCoord4f\"))\n\tif gpTexCoord4f == nil {\n\t\treturn errors.New(\"glTexCoord4f\")\n\t}\n\tgpTexCoord4fColor4fNormal3fVertex4fSUN = (C.GPTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUN)(getProcAddr(\"glTexCoord4fColor4fNormal3fVertex4fSUN\"))\n\tgpTexCoord4fColor4fNormal3fVertex4fvSUN = (C.GPTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUN)(getProcAddr(\"glTexCoord4fColor4fNormal3fVertex4fvSUN\"))\n\tgpTexCoord4fVertex4fSUN = (C.GPTEXCOORD4FVERTEX4FSUN)(getProcAddr(\"glTexCoord4fVertex4fSUN\"))\n\tgpTexCoord4fVertex4fvSUN = (C.GPTEXCOORD4FVERTEX4FVSUN)(getProcAddr(\"glTexCoord4fVertex4fvSUN\"))\n\tgpTexCoord4fv = (C.GPTEXCOORD4FV)(getProcAddr(\"glTexCoord4fv\"))\n\tif gpTexCoord4fv == nil {\n\t\treturn errors.New(\"glTexCoord4fv\")\n\t}\n\tgpTexCoord4hNV = (C.GPTEXCOORD4HNV)(getProcAddr(\"glTexCoord4hNV\"))\n\tgpTexCoord4hvNV = (C.GPTEXCOORD4HVNV)(getProcAddr(\"glTexCoord4hvNV\"))\n\tgpTexCoord4i = (C.GPTEXCOORD4I)(getProcAddr(\"glTexCoord4i\"))\n\tif gpTexCoord4i == nil {\n\t\treturn errors.New(\"glTexCoord4i\")\n\t}\n\tgpTexCoord4iv = (C.GPTEXCOORD4IV)(getProcAddr(\"glTexCoord4iv\"))\n\tif gpTexCoord4iv == nil {\n\t\treturn errors.New(\"glTexCoord4iv\")\n\t}\n\tgpTexCoord4s = (C.GPTEXCOORD4S)(getProcAddr(\"glTexCoord4s\"))\n\tif gpTexCoord4s == nil {\n\t\treturn errors.New(\"glTexCoord4s\")\n\t}\n\tgpTexCoord4sv = (C.GPTEXCOORD4SV)(getProcAddr(\"glTexCoord4sv\"))\n\tif gpTexCoord4sv == nil {\n\t\treturn errors.New(\"glTexCoord4sv\")\n\t}\n\tgpTexCoord4xOES = (C.GPTEXCOORD4XOES)(getProcAddr(\"glTexCoord4xOES\"))\n\tgpTexCoord4xvOES = (C.GPTEXCOORD4XVOES)(getProcAddr(\"glTexCoord4xvOES\"))\n\tgpTexCoordFormatNV = (C.GPTEXCOORDFORMATNV)(getProcAddr(\"glTexCoordFormatNV\"))\n\tgpTexCoordP1ui = (C.GPTEXCOORDP1UI)(getProcAddr(\"glTexCoordP1ui\"))\n\tif gpTexCoordP1ui == nil {\n\t\treturn errors.New(\"glTexCoordP1ui\")\n\t}\n\tgpTexCoordP1uiv = (C.GPTEXCOORDP1UIV)(getProcAddr(\"glTexCoordP1uiv\"))\n\tif gpTexCoordP1uiv == nil {\n\t\treturn errors.New(\"glTexCoordP1uiv\")\n\t}\n\tgpTexCoordP2ui = (C.GPTEXCOORDP2UI)(getProcAddr(\"glTexCoordP2ui\"))\n\tif gpTexCoordP2ui == nil {\n\t\treturn errors.New(\"glTexCoordP2ui\")\n\t}\n\tgpTexCoordP2uiv = (C.GPTEXCOORDP2UIV)(getProcAddr(\"glTexCoordP2uiv\"))\n\tif gpTexCoordP2uiv == nil {\n\t\treturn errors.New(\"glTexCoordP2uiv\")\n\t}\n\tgpTexCoordP3ui = (C.GPTEXCOORDP3UI)(getProcAddr(\"glTexCoordP3ui\"))\n\tif gpTexCoordP3ui == nil {\n\t\treturn errors.New(\"glTexCoordP3ui\")\n\t}\n\tgpTexCoordP3uiv = (C.GPTEXCOORDP3UIV)(getProcAddr(\"glTexCoordP3uiv\"))\n\tif gpTexCoordP3uiv == nil {\n\t\treturn errors.New(\"glTexCoordP3uiv\")\n\t}\n\tgpTexCoordP4ui = (C.GPTEXCOORDP4UI)(getProcAddr(\"glTexCoordP4ui\"))\n\tif gpTexCoordP4ui == nil {\n\t\treturn errors.New(\"glTexCoordP4ui\")\n\t}\n\tgpTexCoordP4uiv = (C.GPTEXCOORDP4UIV)(getProcAddr(\"glTexCoordP4uiv\"))\n\tif gpTexCoordP4uiv == nil {\n\t\treturn errors.New(\"glTexCoordP4uiv\")\n\t}\n\tgpTexCoordPointer = (C.GPTEXCOORDPOINTER)(getProcAddr(\"glTexCoordPointer\"))\n\tif gpTexCoordPointer == nil {\n\t\treturn errors.New(\"glTexCoordPointer\")\n\t}\n\tgpTexCoordPointerEXT = (C.GPTEXCOORDPOINTEREXT)(getProcAddr(\"glTexCoordPointerEXT\"))\n\tgpTexCoordPointerListIBM = (C.GPTEXCOORDPOINTERLISTIBM)(getProcAddr(\"glTexCoordPointerListIBM\"))\n\tgpTexCoordPointervINTEL = (C.GPTEXCOORDPOINTERVINTEL)(getProcAddr(\"glTexCoordPointervINTEL\"))\n\tgpTexEnvf = (C.GPTEXENVF)(getProcAddr(\"glTexEnvf\"))\n\tif gpTexEnvf == nil {\n\t\treturn errors.New(\"glTexEnvf\")\n\t}\n\tgpTexEnvfv = (C.GPTEXENVFV)(getProcAddr(\"glTexEnvfv\"))\n\tif gpTexEnvfv == nil {\n\t\treturn errors.New(\"glTexEnvfv\")\n\t}\n\tgpTexEnvi = (C.GPTEXENVI)(getProcAddr(\"glTexEnvi\"))\n\tif gpTexEnvi == nil {\n\t\treturn errors.New(\"glTexEnvi\")\n\t}\n\tgpTexEnviv = (C.GPTEXENVIV)(getProcAddr(\"glTexEnviv\"))\n\tif gpTexEnviv == nil {\n\t\treturn errors.New(\"glTexEnviv\")\n\t}\n\tgpTexEnvxOES = (C.GPTEXENVXOES)(getProcAddr(\"glTexEnvxOES\"))\n\tgpTexEnvxvOES = (C.GPTEXENVXVOES)(getProcAddr(\"glTexEnvxvOES\"))\n\tgpTexFilterFuncSGIS = (C.GPTEXFILTERFUNCSGIS)(getProcAddr(\"glTexFilterFuncSGIS\"))\n\tgpTexGend = (C.GPTEXGEND)(getProcAddr(\"glTexGend\"))\n\tif gpTexGend == nil {\n\t\treturn errors.New(\"glTexGend\")\n\t}\n\tgpTexGendv = (C.GPTEXGENDV)(getProcAddr(\"glTexGendv\"))\n\tif gpTexGendv == nil {\n\t\treturn errors.New(\"glTexGendv\")\n\t}\n\tgpTexGenf = (C.GPTEXGENF)(getProcAddr(\"glTexGenf\"))\n\tif gpTexGenf == nil {\n\t\treturn errors.New(\"glTexGenf\")\n\t}\n\tgpTexGenfv = (C.GPTEXGENFV)(getProcAddr(\"glTexGenfv\"))\n\tif gpTexGenfv == nil {\n\t\treturn errors.New(\"glTexGenfv\")\n\t}\n\tgpTexGeni = (C.GPTEXGENI)(getProcAddr(\"glTexGeni\"))\n\tif gpTexGeni == nil {\n\t\treturn errors.New(\"glTexGeni\")\n\t}\n\tgpTexGeniv = (C.GPTEXGENIV)(getProcAddr(\"glTexGeniv\"))\n\tif gpTexGeniv == nil {\n\t\treturn errors.New(\"glTexGeniv\")\n\t}\n\tgpTexGenxOES = (C.GPTEXGENXOES)(getProcAddr(\"glTexGenxOES\"))\n\tgpTexGenxvOES = (C.GPTEXGENXVOES)(getProcAddr(\"glTexGenxvOES\"))\n\tgpTexImage1D = (C.GPTEXIMAGE1D)(getProcAddr(\"glTexImage1D\"))\n\tif gpTexImage1D == nil {\n\t\treturn errors.New(\"glTexImage1D\")\n\t}\n\tgpTexImage2D = (C.GPTEXIMAGE2D)(getProcAddr(\"glTexImage2D\"))\n\tif gpTexImage2D == nil {\n\t\treturn errors.New(\"glTexImage2D\")\n\t}\n\tgpTexImage2DMultisample = (C.GPTEXIMAGE2DMULTISAMPLE)(getProcAddr(\"glTexImage2DMultisample\"))\n\tif gpTexImage2DMultisample == nil {\n\t\treturn errors.New(\"glTexImage2DMultisample\")\n\t}\n\tgpTexImage2DMultisampleCoverageNV = (C.GPTEXIMAGE2DMULTISAMPLECOVERAGENV)(getProcAddr(\"glTexImage2DMultisampleCoverageNV\"))\n\tgpTexImage3D = (C.GPTEXIMAGE3D)(getProcAddr(\"glTexImage3D\"))\n\tif gpTexImage3D == nil {\n\t\treturn errors.New(\"glTexImage3D\")\n\t}\n\tgpTexImage3DEXT = (C.GPTEXIMAGE3DEXT)(getProcAddr(\"glTexImage3DEXT\"))\n\tgpTexImage3DMultisample = (C.GPTEXIMAGE3DMULTISAMPLE)(getProcAddr(\"glTexImage3DMultisample\"))\n\tif gpTexImage3DMultisample == nil {\n\t\treturn errors.New(\"glTexImage3DMultisample\")\n\t}\n\tgpTexImage3DMultisampleCoverageNV = (C.GPTEXIMAGE3DMULTISAMPLECOVERAGENV)(getProcAddr(\"glTexImage3DMultisampleCoverageNV\"))\n\tgpTexImage4DSGIS = (C.GPTEXIMAGE4DSGIS)(getProcAddr(\"glTexImage4DSGIS\"))\n\tgpTexPageCommitmentARB = (C.GPTEXPAGECOMMITMENTARB)(getProcAddr(\"glTexPageCommitmentARB\"))\n\tgpTexPageCommitmentMemNV = (C.GPTEXPAGECOMMITMENTMEMNV)(getProcAddr(\"glTexPageCommitmentMemNV\"))\n\tgpTexParameterIiv = (C.GPTEXPARAMETERIIV)(getProcAddr(\"glTexParameterIiv\"))\n\tif gpTexParameterIiv == nil {\n\t\treturn errors.New(\"glTexParameterIiv\")\n\t}\n\tgpTexParameterIivEXT = (C.GPTEXPARAMETERIIVEXT)(getProcAddr(\"glTexParameterIivEXT\"))\n\tgpTexParameterIuiv = (C.GPTEXPARAMETERIUIV)(getProcAddr(\"glTexParameterIuiv\"))\n\tif gpTexParameterIuiv == nil {\n\t\treturn errors.New(\"glTexParameterIuiv\")\n\t}\n\tgpTexParameterIuivEXT = (C.GPTEXPARAMETERIUIVEXT)(getProcAddr(\"glTexParameterIuivEXT\"))\n\tgpTexParameterf = (C.GPTEXPARAMETERF)(getProcAddr(\"glTexParameterf\"))\n\tif gpTexParameterf == nil {\n\t\treturn errors.New(\"glTexParameterf\")\n\t}\n\tgpTexParameterfv = (C.GPTEXPARAMETERFV)(getProcAddr(\"glTexParameterfv\"))\n\tif gpTexParameterfv == nil {\n\t\treturn errors.New(\"glTexParameterfv\")\n\t}\n\tgpTexParameteri = (C.GPTEXPARAMETERI)(getProcAddr(\"glTexParameteri\"))\n\tif gpTexParameteri == nil {\n\t\treturn errors.New(\"glTexParameteri\")\n\t}\n\tgpTexParameteriv = (C.GPTEXPARAMETERIV)(getProcAddr(\"glTexParameteriv\"))\n\tif gpTexParameteriv == nil {\n\t\treturn errors.New(\"glTexParameteriv\")\n\t}\n\tgpTexParameterxOES = (C.GPTEXPARAMETERXOES)(getProcAddr(\"glTexParameterxOES\"))\n\tgpTexParameterxvOES = (C.GPTEXPARAMETERXVOES)(getProcAddr(\"glTexParameterxvOES\"))\n\tgpTexRenderbufferNV = (C.GPTEXRENDERBUFFERNV)(getProcAddr(\"glTexRenderbufferNV\"))\n\tgpTexStorage1D = (C.GPTEXSTORAGE1D)(getProcAddr(\"glTexStorage1D\"))\n\tif gpTexStorage1D == nil {\n\t\treturn errors.New(\"glTexStorage1D\")\n\t}\n\tgpTexStorage2D = (C.GPTEXSTORAGE2D)(getProcAddr(\"glTexStorage2D\"))\n\tif gpTexStorage2D == nil {\n\t\treturn errors.New(\"glTexStorage2D\")\n\t}\n\tgpTexStorage2DMultisample = (C.GPTEXSTORAGE2DMULTISAMPLE)(getProcAddr(\"glTexStorage2DMultisample\"))\n\tif gpTexStorage2DMultisample == nil {\n\t\treturn errors.New(\"glTexStorage2DMultisample\")\n\t}\n\tgpTexStorage3D = (C.GPTEXSTORAGE3D)(getProcAddr(\"glTexStorage3D\"))\n\tif gpTexStorage3D == nil {\n\t\treturn errors.New(\"glTexStorage3D\")\n\t}\n\tgpTexStorage3DMultisample = (C.GPTEXSTORAGE3DMULTISAMPLE)(getProcAddr(\"glTexStorage3DMultisample\"))\n\tif gpTexStorage3DMultisample == nil {\n\t\treturn errors.New(\"glTexStorage3DMultisample\")\n\t}\n\tgpTexStorageMem1DEXT = (C.GPTEXSTORAGEMEM1DEXT)(getProcAddr(\"glTexStorageMem1DEXT\"))\n\tgpTexStorageMem2DEXT = (C.GPTEXSTORAGEMEM2DEXT)(getProcAddr(\"glTexStorageMem2DEXT\"))\n\tgpTexStorageMem2DMultisampleEXT = (C.GPTEXSTORAGEMEM2DMULTISAMPLEEXT)(getProcAddr(\"glTexStorageMem2DMultisampleEXT\"))\n\tgpTexStorageMem3DEXT = (C.GPTEXSTORAGEMEM3DEXT)(getProcAddr(\"glTexStorageMem3DEXT\"))\n\tgpTexStorageMem3DMultisampleEXT = (C.GPTEXSTORAGEMEM3DMULTISAMPLEEXT)(getProcAddr(\"glTexStorageMem3DMultisampleEXT\"))\n\tgpTexStorageSparseAMD = (C.GPTEXSTORAGESPARSEAMD)(getProcAddr(\"glTexStorageSparseAMD\"))\n\tgpTexSubImage1D = (C.GPTEXSUBIMAGE1D)(getProcAddr(\"glTexSubImage1D\"))\n\tif gpTexSubImage1D == nil {\n\t\treturn errors.New(\"glTexSubImage1D\")\n\t}\n\tgpTexSubImage1DEXT = (C.GPTEXSUBIMAGE1DEXT)(getProcAddr(\"glTexSubImage1DEXT\"))\n\tgpTexSubImage2D = (C.GPTEXSUBIMAGE2D)(getProcAddr(\"glTexSubImage2D\"))\n\tif gpTexSubImage2D == nil {\n\t\treturn errors.New(\"glTexSubImage2D\")\n\t}\n\tgpTexSubImage2DEXT = (C.GPTEXSUBIMAGE2DEXT)(getProcAddr(\"glTexSubImage2DEXT\"))\n\tgpTexSubImage3D = (C.GPTEXSUBIMAGE3D)(getProcAddr(\"glTexSubImage3D\"))\n\tif gpTexSubImage3D == nil {\n\t\treturn errors.New(\"glTexSubImage3D\")\n\t}\n\tgpTexSubImage3DEXT = (C.GPTEXSUBIMAGE3DEXT)(getProcAddr(\"glTexSubImage3DEXT\"))\n\tgpTexSubImage4DSGIS = (C.GPTEXSUBIMAGE4DSGIS)(getProcAddr(\"glTexSubImage4DSGIS\"))\n\tgpTextureAttachMemoryNV = (C.GPTEXTUREATTACHMEMORYNV)(getProcAddr(\"glTextureAttachMemoryNV\"))\n\tgpTextureBarrier = (C.GPTEXTUREBARRIER)(getProcAddr(\"glTextureBarrier\"))\n\tgpTextureBarrierNV = (C.GPTEXTUREBARRIERNV)(getProcAddr(\"glTextureBarrierNV\"))\n\tgpTextureBuffer = (C.GPTEXTUREBUFFER)(getProcAddr(\"glTextureBuffer\"))\n\tgpTextureBufferEXT = (C.GPTEXTUREBUFFEREXT)(getProcAddr(\"glTextureBufferEXT\"))\n\tgpTextureBufferRange = (C.GPTEXTUREBUFFERRANGE)(getProcAddr(\"glTextureBufferRange\"))\n\tgpTextureBufferRangeEXT = (C.GPTEXTUREBUFFERRANGEEXT)(getProcAddr(\"glTextureBufferRangeEXT\"))\n\tgpTextureColorMaskSGIS = (C.GPTEXTURECOLORMASKSGIS)(getProcAddr(\"glTextureColorMaskSGIS\"))\n\tgpTextureImage1DEXT = (C.GPTEXTUREIMAGE1DEXT)(getProcAddr(\"glTextureImage1DEXT\"))\n\tgpTextureImage2DEXT = (C.GPTEXTUREIMAGE2DEXT)(getProcAddr(\"glTextureImage2DEXT\"))\n\tgpTextureImage2DMultisampleCoverageNV = (C.GPTEXTUREIMAGE2DMULTISAMPLECOVERAGENV)(getProcAddr(\"glTextureImage2DMultisampleCoverageNV\"))\n\tgpTextureImage2DMultisampleNV = (C.GPTEXTUREIMAGE2DMULTISAMPLENV)(getProcAddr(\"glTextureImage2DMultisampleNV\"))\n\tgpTextureImage3DEXT = (C.GPTEXTUREIMAGE3DEXT)(getProcAddr(\"glTextureImage3DEXT\"))\n\tgpTextureImage3DMultisampleCoverageNV = (C.GPTEXTUREIMAGE3DMULTISAMPLECOVERAGENV)(getProcAddr(\"glTextureImage3DMultisampleCoverageNV\"))\n\tgpTextureImage3DMultisampleNV = (C.GPTEXTUREIMAGE3DMULTISAMPLENV)(getProcAddr(\"glTextureImage3DMultisampleNV\"))\n\tgpTextureLightEXT = (C.GPTEXTURELIGHTEXT)(getProcAddr(\"glTextureLightEXT\"))\n\tgpTextureMaterialEXT = (C.GPTEXTUREMATERIALEXT)(getProcAddr(\"glTextureMaterialEXT\"))\n\tgpTextureNormalEXT = (C.GPTEXTURENORMALEXT)(getProcAddr(\"glTextureNormalEXT\"))\n\tgpTexturePageCommitmentEXT = (C.GPTEXTUREPAGECOMMITMENTEXT)(getProcAddr(\"glTexturePageCommitmentEXT\"))\n\tgpTexturePageCommitmentMemNV = (C.GPTEXTUREPAGECOMMITMENTMEMNV)(getProcAddr(\"glTexturePageCommitmentMemNV\"))\n\tgpTextureParameterIiv = (C.GPTEXTUREPARAMETERIIV)(getProcAddr(\"glTextureParameterIiv\"))\n\tgpTextureParameterIivEXT = (C.GPTEXTUREPARAMETERIIVEXT)(getProcAddr(\"glTextureParameterIivEXT\"))\n\tgpTextureParameterIuiv = (C.GPTEXTUREPARAMETERIUIV)(getProcAddr(\"glTextureParameterIuiv\"))\n\tgpTextureParameterIuivEXT = (C.GPTEXTUREPARAMETERIUIVEXT)(getProcAddr(\"glTextureParameterIuivEXT\"))\n\tgpTextureParameterf = (C.GPTEXTUREPARAMETERF)(getProcAddr(\"glTextureParameterf\"))\n\tgpTextureParameterfEXT = (C.GPTEXTUREPARAMETERFEXT)(getProcAddr(\"glTextureParameterfEXT\"))\n\tgpTextureParameterfv = (C.GPTEXTUREPARAMETERFV)(getProcAddr(\"glTextureParameterfv\"))\n\tgpTextureParameterfvEXT = (C.GPTEXTUREPARAMETERFVEXT)(getProcAddr(\"glTextureParameterfvEXT\"))\n\tgpTextureParameteri = (C.GPTEXTUREPARAMETERI)(getProcAddr(\"glTextureParameteri\"))\n\tgpTextureParameteriEXT = (C.GPTEXTUREPARAMETERIEXT)(getProcAddr(\"glTextureParameteriEXT\"))\n\tgpTextureParameteriv = (C.GPTEXTUREPARAMETERIV)(getProcAddr(\"glTextureParameteriv\"))\n\tgpTextureParameterivEXT = (C.GPTEXTUREPARAMETERIVEXT)(getProcAddr(\"glTextureParameterivEXT\"))\n\tgpTextureRangeAPPLE = (C.GPTEXTURERANGEAPPLE)(getProcAddr(\"glTextureRangeAPPLE\"))\n\tgpTextureRenderbufferEXT = (C.GPTEXTURERENDERBUFFEREXT)(getProcAddr(\"glTextureRenderbufferEXT\"))\n\tgpTextureStorage1D = (C.GPTEXTURESTORAGE1D)(getProcAddr(\"glTextureStorage1D\"))\n\tgpTextureStorage1DEXT = (C.GPTEXTURESTORAGE1DEXT)(getProcAddr(\"glTextureStorage1DEXT\"))\n\tgpTextureStorage2D = (C.GPTEXTURESTORAGE2D)(getProcAddr(\"glTextureStorage2D\"))\n\tgpTextureStorage2DEXT = (C.GPTEXTURESTORAGE2DEXT)(getProcAddr(\"glTextureStorage2DEXT\"))\n\tgpTextureStorage2DMultisample = (C.GPTEXTURESTORAGE2DMULTISAMPLE)(getProcAddr(\"glTextureStorage2DMultisample\"))\n\tgpTextureStorage2DMultisampleEXT = (C.GPTEXTURESTORAGE2DMULTISAMPLEEXT)(getProcAddr(\"glTextureStorage2DMultisampleEXT\"))\n\tgpTextureStorage3D = (C.GPTEXTURESTORAGE3D)(getProcAddr(\"glTextureStorage3D\"))\n\tgpTextureStorage3DEXT = (C.GPTEXTURESTORAGE3DEXT)(getProcAddr(\"glTextureStorage3DEXT\"))\n\tgpTextureStorage3DMultisample = (C.GPTEXTURESTORAGE3DMULTISAMPLE)(getProcAddr(\"glTextureStorage3DMultisample\"))\n\tgpTextureStorage3DMultisampleEXT = (C.GPTEXTURESTORAGE3DMULTISAMPLEEXT)(getProcAddr(\"glTextureStorage3DMultisampleEXT\"))\n\tgpTextureStorageMem1DEXT = (C.GPTEXTURESTORAGEMEM1DEXT)(getProcAddr(\"glTextureStorageMem1DEXT\"))\n\tgpTextureStorageMem2DEXT = (C.GPTEXTURESTORAGEMEM2DEXT)(getProcAddr(\"glTextureStorageMem2DEXT\"))\n\tgpTextureStorageMem2DMultisampleEXT = (C.GPTEXTURESTORAGEMEM2DMULTISAMPLEEXT)(getProcAddr(\"glTextureStorageMem2DMultisampleEXT\"))\n\tgpTextureStorageMem3DEXT = (C.GPTEXTURESTORAGEMEM3DEXT)(getProcAddr(\"glTextureStorageMem3DEXT\"))\n\tgpTextureStorageMem3DMultisampleEXT = (C.GPTEXTURESTORAGEMEM3DMULTISAMPLEEXT)(getProcAddr(\"glTextureStorageMem3DMultisampleEXT\"))\n\tgpTextureStorageSparseAMD = (C.GPTEXTURESTORAGESPARSEAMD)(getProcAddr(\"glTextureStorageSparseAMD\"))\n\tgpTextureSubImage1D = (C.GPTEXTURESUBIMAGE1D)(getProcAddr(\"glTextureSubImage1D\"))\n\tgpTextureSubImage1DEXT = (C.GPTEXTURESUBIMAGE1DEXT)(getProcAddr(\"glTextureSubImage1DEXT\"))\n\tgpTextureSubImage2D = (C.GPTEXTURESUBIMAGE2D)(getProcAddr(\"glTextureSubImage2D\"))\n\tgpTextureSubImage2DEXT = (C.GPTEXTURESUBIMAGE2DEXT)(getProcAddr(\"glTextureSubImage2DEXT\"))\n\tgpTextureSubImage3D = (C.GPTEXTURESUBIMAGE3D)(getProcAddr(\"glTextureSubImage3D\"))\n\tgpTextureSubImage3DEXT = (C.GPTEXTURESUBIMAGE3DEXT)(getProcAddr(\"glTextureSubImage3DEXT\"))\n\tgpTextureView = (C.GPTEXTUREVIEW)(getProcAddr(\"glTextureView\"))\n\tif gpTextureView == nil {\n\t\treturn errors.New(\"glTextureView\")\n\t}\n\tgpTrackMatrixNV = (C.GPTRACKMATRIXNV)(getProcAddr(\"glTrackMatrixNV\"))\n\tgpTransformFeedbackAttribsNV = (C.GPTRANSFORMFEEDBACKATTRIBSNV)(getProcAddr(\"glTransformFeedbackAttribsNV\"))\n\tgpTransformFeedbackBufferBase = (C.GPTRANSFORMFEEDBACKBUFFERBASE)(getProcAddr(\"glTransformFeedbackBufferBase\"))\n\tgpTransformFeedbackBufferRange = (C.GPTRANSFORMFEEDBACKBUFFERRANGE)(getProcAddr(\"glTransformFeedbackBufferRange\"))\n\tgpTransformFeedbackStreamAttribsNV = (C.GPTRANSFORMFEEDBACKSTREAMATTRIBSNV)(getProcAddr(\"glTransformFeedbackStreamAttribsNV\"))\n\tgpTransformFeedbackVaryings = (C.GPTRANSFORMFEEDBACKVARYINGS)(getProcAddr(\"glTransformFeedbackVaryings\"))\n\tif gpTransformFeedbackVaryings == nil {\n\t\treturn errors.New(\"glTransformFeedbackVaryings\")\n\t}\n\tgpTransformFeedbackVaryingsEXT = (C.GPTRANSFORMFEEDBACKVARYINGSEXT)(getProcAddr(\"glTransformFeedbackVaryingsEXT\"))\n\tgpTransformFeedbackVaryingsNV = (C.GPTRANSFORMFEEDBACKVARYINGSNV)(getProcAddr(\"glTransformFeedbackVaryingsNV\"))\n\tgpTransformPathNV = (C.GPTRANSFORMPATHNV)(getProcAddr(\"glTransformPathNV\"))\n\tgpTranslated = (C.GPTRANSLATED)(getProcAddr(\"glTranslated\"))\n\tif gpTranslated == nil {\n\t\treturn errors.New(\"glTranslated\")\n\t}\n\tgpTranslatef = (C.GPTRANSLATEF)(getProcAddr(\"glTranslatef\"))\n\tif gpTranslatef == nil {\n\t\treturn errors.New(\"glTranslatef\")\n\t}\n\tgpTranslatexOES = (C.GPTRANSLATEXOES)(getProcAddr(\"glTranslatexOES\"))\n\tgpUniform1d = (C.GPUNIFORM1D)(getProcAddr(\"glUniform1d\"))\n\tif gpUniform1d == nil {\n\t\treturn errors.New(\"glUniform1d\")\n\t}\n\tgpUniform1dv = (C.GPUNIFORM1DV)(getProcAddr(\"glUniform1dv\"))\n\tif gpUniform1dv == nil {\n\t\treturn errors.New(\"glUniform1dv\")\n\t}\n\tgpUniform1f = (C.GPUNIFORM1F)(getProcAddr(\"glUniform1f\"))\n\tif gpUniform1f == nil {\n\t\treturn errors.New(\"glUniform1f\")\n\t}\n\tgpUniform1fARB = (C.GPUNIFORM1FARB)(getProcAddr(\"glUniform1fARB\"))\n\tgpUniform1fv = (C.GPUNIFORM1FV)(getProcAddr(\"glUniform1fv\"))\n\tif gpUniform1fv == nil {\n\t\treturn errors.New(\"glUniform1fv\")\n\t}\n\tgpUniform1fvARB = (C.GPUNIFORM1FVARB)(getProcAddr(\"glUniform1fvARB\"))\n\tgpUniform1i = (C.GPUNIFORM1I)(getProcAddr(\"glUniform1i\"))\n\tif gpUniform1i == nil {\n\t\treturn errors.New(\"glUniform1i\")\n\t}\n\tgpUniform1i64ARB = (C.GPUNIFORM1I64ARB)(getProcAddr(\"glUniform1i64ARB\"))\n\tgpUniform1i64NV = (C.GPUNIFORM1I64NV)(getProcAddr(\"glUniform1i64NV\"))\n\tgpUniform1i64vARB = (C.GPUNIFORM1I64VARB)(getProcAddr(\"glUniform1i64vARB\"))\n\tgpUniform1i64vNV = (C.GPUNIFORM1I64VNV)(getProcAddr(\"glUniform1i64vNV\"))\n\tgpUniform1iARB = (C.GPUNIFORM1IARB)(getProcAddr(\"glUniform1iARB\"))\n\tgpUniform1iv = (C.GPUNIFORM1IV)(getProcAddr(\"glUniform1iv\"))\n\tif gpUniform1iv == nil {\n\t\treturn errors.New(\"glUniform1iv\")\n\t}\n\tgpUniform1ivARB = (C.GPUNIFORM1IVARB)(getProcAddr(\"glUniform1ivARB\"))\n\tgpUniform1ui = (C.GPUNIFORM1UI)(getProcAddr(\"glUniform1ui\"))\n\tif gpUniform1ui == nil {\n\t\treturn errors.New(\"glUniform1ui\")\n\t}\n\tgpUniform1ui64ARB = (C.GPUNIFORM1UI64ARB)(getProcAddr(\"glUniform1ui64ARB\"))\n\tgpUniform1ui64NV = (C.GPUNIFORM1UI64NV)(getProcAddr(\"glUniform1ui64NV\"))\n\tgpUniform1ui64vARB = (C.GPUNIFORM1UI64VARB)(getProcAddr(\"glUniform1ui64vARB\"))\n\tgpUniform1ui64vNV = (C.GPUNIFORM1UI64VNV)(getProcAddr(\"glUniform1ui64vNV\"))\n\tgpUniform1uiEXT = (C.GPUNIFORM1UIEXT)(getProcAddr(\"glUniform1uiEXT\"))\n\tgpUniform1uiv = (C.GPUNIFORM1UIV)(getProcAddr(\"glUniform1uiv\"))\n\tif gpUniform1uiv == nil {\n\t\treturn errors.New(\"glUniform1uiv\")\n\t}\n\tgpUniform1uivEXT = (C.GPUNIFORM1UIVEXT)(getProcAddr(\"glUniform1uivEXT\"))\n\tgpUniform2d = (C.GPUNIFORM2D)(getProcAddr(\"glUniform2d\"))\n\tif gpUniform2d == nil {\n\t\treturn errors.New(\"glUniform2d\")\n\t}\n\tgpUniform2dv = (C.GPUNIFORM2DV)(getProcAddr(\"glUniform2dv\"))\n\tif gpUniform2dv == nil {\n\t\treturn errors.New(\"glUniform2dv\")\n\t}\n\tgpUniform2f = (C.GPUNIFORM2F)(getProcAddr(\"glUniform2f\"))\n\tif gpUniform2f == nil {\n\t\treturn errors.New(\"glUniform2f\")\n\t}\n\tgpUniform2fARB = (C.GPUNIFORM2FARB)(getProcAddr(\"glUniform2fARB\"))\n\tgpUniform2fv = (C.GPUNIFORM2FV)(getProcAddr(\"glUniform2fv\"))\n\tif gpUniform2fv == nil {\n\t\treturn errors.New(\"glUniform2fv\")\n\t}\n\tgpUniform2fvARB = (C.GPUNIFORM2FVARB)(getProcAddr(\"glUniform2fvARB\"))\n\tgpUniform2i = (C.GPUNIFORM2I)(getProcAddr(\"glUniform2i\"))\n\tif gpUniform2i == nil {\n\t\treturn errors.New(\"glUniform2i\")\n\t}\n\tgpUniform2i64ARB = (C.GPUNIFORM2I64ARB)(getProcAddr(\"glUniform2i64ARB\"))\n\tgpUniform2i64NV = (C.GPUNIFORM2I64NV)(getProcAddr(\"glUniform2i64NV\"))\n\tgpUniform2i64vARB = (C.GPUNIFORM2I64VARB)(getProcAddr(\"glUniform2i64vARB\"))\n\tgpUniform2i64vNV = (C.GPUNIFORM2I64VNV)(getProcAddr(\"glUniform2i64vNV\"))\n\tgpUniform2iARB = (C.GPUNIFORM2IARB)(getProcAddr(\"glUniform2iARB\"))\n\tgpUniform2iv = (C.GPUNIFORM2IV)(getProcAddr(\"glUniform2iv\"))\n\tif gpUniform2iv == nil {\n\t\treturn errors.New(\"glUniform2iv\")\n\t}\n\tgpUniform2ivARB = (C.GPUNIFORM2IVARB)(getProcAddr(\"glUniform2ivARB\"))\n\tgpUniform2ui = (C.GPUNIFORM2UI)(getProcAddr(\"glUniform2ui\"))\n\tif gpUniform2ui == nil {\n\t\treturn errors.New(\"glUniform2ui\")\n\t}\n\tgpUniform2ui64ARB = (C.GPUNIFORM2UI64ARB)(getProcAddr(\"glUniform2ui64ARB\"))\n\tgpUniform2ui64NV = (C.GPUNIFORM2UI64NV)(getProcAddr(\"glUniform2ui64NV\"))\n\tgpUniform2ui64vARB = (C.GPUNIFORM2UI64VARB)(getProcAddr(\"glUniform2ui64vARB\"))\n\tgpUniform2ui64vNV = (C.GPUNIFORM2UI64VNV)(getProcAddr(\"glUniform2ui64vNV\"))\n\tgpUniform2uiEXT = (C.GPUNIFORM2UIEXT)(getProcAddr(\"glUniform2uiEXT\"))\n\tgpUniform2uiv = (C.GPUNIFORM2UIV)(getProcAddr(\"glUniform2uiv\"))\n\tif gpUniform2uiv == nil {\n\t\treturn errors.New(\"glUniform2uiv\")\n\t}\n\tgpUniform2uivEXT = (C.GPUNIFORM2UIVEXT)(getProcAddr(\"glUniform2uivEXT\"))\n\tgpUniform3d = (C.GPUNIFORM3D)(getProcAddr(\"glUniform3d\"))\n\tif gpUniform3d == nil {\n\t\treturn errors.New(\"glUniform3d\")\n\t}\n\tgpUniform3dv = (C.GPUNIFORM3DV)(getProcAddr(\"glUniform3dv\"))\n\tif gpUniform3dv == nil {\n\t\treturn errors.New(\"glUniform3dv\")\n\t}\n\tgpUniform3f = (C.GPUNIFORM3F)(getProcAddr(\"glUniform3f\"))\n\tif gpUniform3f == nil {\n\t\treturn errors.New(\"glUniform3f\")\n\t}\n\tgpUniform3fARB = (C.GPUNIFORM3FARB)(getProcAddr(\"glUniform3fARB\"))\n\tgpUniform3fv = (C.GPUNIFORM3FV)(getProcAddr(\"glUniform3fv\"))\n\tif gpUniform3fv == nil {\n\t\treturn errors.New(\"glUniform3fv\")\n\t}\n\tgpUniform3fvARB = (C.GPUNIFORM3FVARB)(getProcAddr(\"glUniform3fvARB\"))\n\tgpUniform3i = (C.GPUNIFORM3I)(getProcAddr(\"glUniform3i\"))\n\tif gpUniform3i == nil {\n\t\treturn errors.New(\"glUniform3i\")\n\t}\n\tgpUniform3i64ARB = (C.GPUNIFORM3I64ARB)(getProcAddr(\"glUniform3i64ARB\"))\n\tgpUniform3i64NV = (C.GPUNIFORM3I64NV)(getProcAddr(\"glUniform3i64NV\"))\n\tgpUniform3i64vARB = (C.GPUNIFORM3I64VARB)(getProcAddr(\"glUniform3i64vARB\"))\n\tgpUniform3i64vNV = (C.GPUNIFORM3I64VNV)(getProcAddr(\"glUniform3i64vNV\"))\n\tgpUniform3iARB = (C.GPUNIFORM3IARB)(getProcAddr(\"glUniform3iARB\"))\n\tgpUniform3iv = (C.GPUNIFORM3IV)(getProcAddr(\"glUniform3iv\"))\n\tif gpUniform3iv == nil {\n\t\treturn errors.New(\"glUniform3iv\")\n\t}\n\tgpUniform3ivARB = (C.GPUNIFORM3IVARB)(getProcAddr(\"glUniform3ivARB\"))\n\tgpUniform3ui = (C.GPUNIFORM3UI)(getProcAddr(\"glUniform3ui\"))\n\tif gpUniform3ui == nil {\n\t\treturn errors.New(\"glUniform3ui\")\n\t}\n\tgpUniform3ui64ARB = (C.GPUNIFORM3UI64ARB)(getProcAddr(\"glUniform3ui64ARB\"))\n\tgpUniform3ui64NV = (C.GPUNIFORM3UI64NV)(getProcAddr(\"glUniform3ui64NV\"))\n\tgpUniform3ui64vARB = (C.GPUNIFORM3UI64VARB)(getProcAddr(\"glUniform3ui64vARB\"))\n\tgpUniform3ui64vNV = (C.GPUNIFORM3UI64VNV)(getProcAddr(\"glUniform3ui64vNV\"))\n\tgpUniform3uiEXT = (C.GPUNIFORM3UIEXT)(getProcAddr(\"glUniform3uiEXT\"))\n\tgpUniform3uiv = (C.GPUNIFORM3UIV)(getProcAddr(\"glUniform3uiv\"))\n\tif gpUniform3uiv == nil {\n\t\treturn errors.New(\"glUniform3uiv\")\n\t}\n\tgpUniform3uivEXT = (C.GPUNIFORM3UIVEXT)(getProcAddr(\"glUniform3uivEXT\"))\n\tgpUniform4d = (C.GPUNIFORM4D)(getProcAddr(\"glUniform4d\"))\n\tif gpUniform4d == nil {\n\t\treturn errors.New(\"glUniform4d\")\n\t}\n\tgpUniform4dv = (C.GPUNIFORM4DV)(getProcAddr(\"glUniform4dv\"))\n\tif gpUniform4dv == nil {\n\t\treturn errors.New(\"glUniform4dv\")\n\t}\n\tgpUniform4f = (C.GPUNIFORM4F)(getProcAddr(\"glUniform4f\"))\n\tif gpUniform4f == nil {\n\t\treturn errors.New(\"glUniform4f\")\n\t}\n\tgpUniform4fARB = (C.GPUNIFORM4FARB)(getProcAddr(\"glUniform4fARB\"))\n\tgpUniform4fv = (C.GPUNIFORM4FV)(getProcAddr(\"glUniform4fv\"))\n\tif gpUniform4fv == nil {\n\t\treturn errors.New(\"glUniform4fv\")\n\t}\n\tgpUniform4fvARB = (C.GPUNIFORM4FVARB)(getProcAddr(\"glUniform4fvARB\"))\n\tgpUniform4i = (C.GPUNIFORM4I)(getProcAddr(\"glUniform4i\"))\n\tif gpUniform4i == nil {\n\t\treturn errors.New(\"glUniform4i\")\n\t}\n\tgpUniform4i64ARB = (C.GPUNIFORM4I64ARB)(getProcAddr(\"glUniform4i64ARB\"))\n\tgpUniform4i64NV = (C.GPUNIFORM4I64NV)(getProcAddr(\"glUniform4i64NV\"))\n\tgpUniform4i64vARB = (C.GPUNIFORM4I64VARB)(getProcAddr(\"glUniform4i64vARB\"))\n\tgpUniform4i64vNV = (C.GPUNIFORM4I64VNV)(getProcAddr(\"glUniform4i64vNV\"))\n\tgpUniform4iARB = (C.GPUNIFORM4IARB)(getProcAddr(\"glUniform4iARB\"))\n\tgpUniform4iv = (C.GPUNIFORM4IV)(getProcAddr(\"glUniform4iv\"))\n\tif gpUniform4iv == nil {\n\t\treturn errors.New(\"glUniform4iv\")\n\t}\n\tgpUniform4ivARB = (C.GPUNIFORM4IVARB)(getProcAddr(\"glUniform4ivARB\"))\n\tgpUniform4ui = (C.GPUNIFORM4UI)(getProcAddr(\"glUniform4ui\"))\n\tif gpUniform4ui == nil {\n\t\treturn errors.New(\"glUniform4ui\")\n\t}\n\tgpUniform4ui64ARB = (C.GPUNIFORM4UI64ARB)(getProcAddr(\"glUniform4ui64ARB\"))\n\tgpUniform4ui64NV = (C.GPUNIFORM4UI64NV)(getProcAddr(\"glUniform4ui64NV\"))\n\tgpUniform4ui64vARB = (C.GPUNIFORM4UI64VARB)(getProcAddr(\"glUniform4ui64vARB\"))\n\tgpUniform4ui64vNV = (C.GPUNIFORM4UI64VNV)(getProcAddr(\"glUniform4ui64vNV\"))\n\tgpUniform4uiEXT = (C.GPUNIFORM4UIEXT)(getProcAddr(\"glUniform4uiEXT\"))\n\tgpUniform4uiv = (C.GPUNIFORM4UIV)(getProcAddr(\"glUniform4uiv\"))\n\tif gpUniform4uiv == nil {\n\t\treturn errors.New(\"glUniform4uiv\")\n\t}\n\tgpUniform4uivEXT = (C.GPUNIFORM4UIVEXT)(getProcAddr(\"glUniform4uivEXT\"))\n\tgpUniformBlockBinding = (C.GPUNIFORMBLOCKBINDING)(getProcAddr(\"glUniformBlockBinding\"))\n\tif gpUniformBlockBinding == nil {\n\t\treturn errors.New(\"glUniformBlockBinding\")\n\t}\n\tgpUniformBufferEXT = (C.GPUNIFORMBUFFEREXT)(getProcAddr(\"glUniformBufferEXT\"))\n\tgpUniformHandleui64ARB = (C.GPUNIFORMHANDLEUI64ARB)(getProcAddr(\"glUniformHandleui64ARB\"))\n\tgpUniformHandleui64NV = (C.GPUNIFORMHANDLEUI64NV)(getProcAddr(\"glUniformHandleui64NV\"))\n\tgpUniformHandleui64vARB = (C.GPUNIFORMHANDLEUI64VARB)(getProcAddr(\"glUniformHandleui64vARB\"))\n\tgpUniformHandleui64vNV = (C.GPUNIFORMHANDLEUI64VNV)(getProcAddr(\"glUniformHandleui64vNV\"))\n\tgpUniformMatrix2dv = (C.GPUNIFORMMATRIX2DV)(getProcAddr(\"glUniformMatrix2dv\"))\n\tif gpUniformMatrix2dv == nil {\n\t\treturn errors.New(\"glUniformMatrix2dv\")\n\t}\n\tgpUniformMatrix2fv = (C.GPUNIFORMMATRIX2FV)(getProcAddr(\"glUniformMatrix2fv\"))\n\tif gpUniformMatrix2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2fv\")\n\t}\n\tgpUniformMatrix2fvARB = (C.GPUNIFORMMATRIX2FVARB)(getProcAddr(\"glUniformMatrix2fvARB\"))\n\tgpUniformMatrix2x3dv = (C.GPUNIFORMMATRIX2X3DV)(getProcAddr(\"glUniformMatrix2x3dv\"))\n\tif gpUniformMatrix2x3dv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x3dv\")\n\t}\n\tgpUniformMatrix2x3fv = (C.GPUNIFORMMATRIX2X3FV)(getProcAddr(\"glUniformMatrix2x3fv\"))\n\tif gpUniformMatrix2x3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x3fv\")\n\t}\n\tgpUniformMatrix2x4dv = (C.GPUNIFORMMATRIX2X4DV)(getProcAddr(\"glUniformMatrix2x4dv\"))\n\tif gpUniformMatrix2x4dv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x4dv\")\n\t}\n\tgpUniformMatrix2x4fv = (C.GPUNIFORMMATRIX2X4FV)(getProcAddr(\"glUniformMatrix2x4fv\"))\n\tif gpUniformMatrix2x4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2x4fv\")\n\t}\n\tgpUniformMatrix3dv = (C.GPUNIFORMMATRIX3DV)(getProcAddr(\"glUniformMatrix3dv\"))\n\tif gpUniformMatrix3dv == nil {\n\t\treturn errors.New(\"glUniformMatrix3dv\")\n\t}\n\tgpUniformMatrix3fv = (C.GPUNIFORMMATRIX3FV)(getProcAddr(\"glUniformMatrix3fv\"))\n\tif gpUniformMatrix3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3fv\")\n\t}\n\tgpUniformMatrix3fvARB = (C.GPUNIFORMMATRIX3FVARB)(getProcAddr(\"glUniformMatrix3fvARB\"))\n\tgpUniformMatrix3x2dv = (C.GPUNIFORMMATRIX3X2DV)(getProcAddr(\"glUniformMatrix3x2dv\"))\n\tif gpUniformMatrix3x2dv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x2dv\")\n\t}\n\tgpUniformMatrix3x2fv = (C.GPUNIFORMMATRIX3X2FV)(getProcAddr(\"glUniformMatrix3x2fv\"))\n\tif gpUniformMatrix3x2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x2fv\")\n\t}\n\tgpUniformMatrix3x4dv = (C.GPUNIFORMMATRIX3X4DV)(getProcAddr(\"glUniformMatrix3x4dv\"))\n\tif gpUniformMatrix3x4dv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x4dv\")\n\t}\n\tgpUniformMatrix3x4fv = (C.GPUNIFORMMATRIX3X4FV)(getProcAddr(\"glUniformMatrix3x4fv\"))\n\tif gpUniformMatrix3x4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3x4fv\")\n\t}\n\tgpUniformMatrix4dv = (C.GPUNIFORMMATRIX4DV)(getProcAddr(\"glUniformMatrix4dv\"))\n\tif gpUniformMatrix4dv == nil {\n\t\treturn errors.New(\"glUniformMatrix4dv\")\n\t}\n\tgpUniformMatrix4fv = (C.GPUNIFORMMATRIX4FV)(getProcAddr(\"glUniformMatrix4fv\"))\n\tif gpUniformMatrix4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4fv\")\n\t}\n\tgpUniformMatrix4fvARB = (C.GPUNIFORMMATRIX4FVARB)(getProcAddr(\"glUniformMatrix4fvARB\"))\n\tgpUniformMatrix4x2dv = (C.GPUNIFORMMATRIX4X2DV)(getProcAddr(\"glUniformMatrix4x2dv\"))\n\tif gpUniformMatrix4x2dv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x2dv\")\n\t}\n\tgpUniformMatrix4x2fv = (C.GPUNIFORMMATRIX4X2FV)(getProcAddr(\"glUniformMatrix4x2fv\"))\n\tif gpUniformMatrix4x2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x2fv\")\n\t}\n\tgpUniformMatrix4x3dv = (C.GPUNIFORMMATRIX4X3DV)(getProcAddr(\"glUniformMatrix4x3dv\"))\n\tif gpUniformMatrix4x3dv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x3dv\")\n\t}\n\tgpUniformMatrix4x3fv = (C.GPUNIFORMMATRIX4X3FV)(getProcAddr(\"glUniformMatrix4x3fv\"))\n\tif gpUniformMatrix4x3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4x3fv\")\n\t}\n\tgpUniformSubroutinesuiv = (C.GPUNIFORMSUBROUTINESUIV)(getProcAddr(\"glUniformSubroutinesuiv\"))\n\tif gpUniformSubroutinesuiv == nil {\n\t\treturn errors.New(\"glUniformSubroutinesuiv\")\n\t}\n\tgpUniformui64NV = (C.GPUNIFORMUI64NV)(getProcAddr(\"glUniformui64NV\"))\n\tgpUniformui64vNV = (C.GPUNIFORMUI64VNV)(getProcAddr(\"glUniformui64vNV\"))\n\tgpUnlockArraysEXT = (C.GPUNLOCKARRAYSEXT)(getProcAddr(\"glUnlockArraysEXT\"))\n\tgpUnmapBuffer = (C.GPUNMAPBUFFER)(getProcAddr(\"glUnmapBuffer\"))\n\tif gpUnmapBuffer == nil {\n\t\treturn errors.New(\"glUnmapBuffer\")\n\t}\n\tgpUnmapBufferARB = (C.GPUNMAPBUFFERARB)(getProcAddr(\"glUnmapBufferARB\"))\n\tgpUnmapNamedBuffer = (C.GPUNMAPNAMEDBUFFER)(getProcAddr(\"glUnmapNamedBuffer\"))\n\tgpUnmapNamedBufferEXT = (C.GPUNMAPNAMEDBUFFEREXT)(getProcAddr(\"glUnmapNamedBufferEXT\"))\n\tgpUnmapObjectBufferATI = (C.GPUNMAPOBJECTBUFFERATI)(getProcAddr(\"glUnmapObjectBufferATI\"))\n\tgpUnmapTexture2DINTEL = (C.GPUNMAPTEXTURE2DINTEL)(getProcAddr(\"glUnmapTexture2DINTEL\"))\n\tgpUpdateObjectBufferATI = (C.GPUPDATEOBJECTBUFFERATI)(getProcAddr(\"glUpdateObjectBufferATI\"))\n\tgpUploadGpuMaskNVX = (C.GPUPLOADGPUMASKNVX)(getProcAddr(\"glUploadGpuMaskNVX\"))\n\tgpUseProgram = (C.GPUSEPROGRAM)(getProcAddr(\"glUseProgram\"))\n\tif gpUseProgram == nil {\n\t\treturn errors.New(\"glUseProgram\")\n\t}\n\tgpUseProgramObjectARB = (C.GPUSEPROGRAMOBJECTARB)(getProcAddr(\"glUseProgramObjectARB\"))\n\tgpUseProgramStages = (C.GPUSEPROGRAMSTAGES)(getProcAddr(\"glUseProgramStages\"))\n\tif gpUseProgramStages == nil {\n\t\treturn errors.New(\"glUseProgramStages\")\n\t}\n\tgpUseProgramStagesEXT = (C.GPUSEPROGRAMSTAGESEXT)(getProcAddr(\"glUseProgramStagesEXT\"))\n\tgpUseShaderProgramEXT = (C.GPUSESHADERPROGRAMEXT)(getProcAddr(\"glUseShaderProgramEXT\"))\n\tgpVDPAUFiniNV = (C.GPVDPAUFININV)(getProcAddr(\"glVDPAUFiniNV\"))\n\tgpVDPAUGetSurfaceivNV = (C.GPVDPAUGETSURFACEIVNV)(getProcAddr(\"glVDPAUGetSurfaceivNV\"))\n\tgpVDPAUInitNV = (C.GPVDPAUINITNV)(getProcAddr(\"glVDPAUInitNV\"))\n\tgpVDPAUIsSurfaceNV = (C.GPVDPAUISSURFACENV)(getProcAddr(\"glVDPAUIsSurfaceNV\"))\n\tgpVDPAUMapSurfacesNV = (C.GPVDPAUMAPSURFACESNV)(getProcAddr(\"glVDPAUMapSurfacesNV\"))\n\tgpVDPAURegisterOutputSurfaceNV = (C.GPVDPAUREGISTEROUTPUTSURFACENV)(getProcAddr(\"glVDPAURegisterOutputSurfaceNV\"))\n\tgpVDPAURegisterVideoSurfaceNV = (C.GPVDPAUREGISTERVIDEOSURFACENV)(getProcAddr(\"glVDPAURegisterVideoSurfaceNV\"))\n\tgpVDPAURegisterVideoSurfaceWithPictureStructureNV = (C.GPVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENV)(getProcAddr(\"glVDPAURegisterVideoSurfaceWithPictureStructureNV\"))\n\tgpVDPAUSurfaceAccessNV = (C.GPVDPAUSURFACEACCESSNV)(getProcAddr(\"glVDPAUSurfaceAccessNV\"))\n\tgpVDPAUUnmapSurfacesNV = (C.GPVDPAUUNMAPSURFACESNV)(getProcAddr(\"glVDPAUUnmapSurfacesNV\"))\n\tgpVDPAUUnregisterSurfaceNV = (C.GPVDPAUUNREGISTERSURFACENV)(getProcAddr(\"glVDPAUUnregisterSurfaceNV\"))\n\tgpValidateProgram = (C.GPVALIDATEPROGRAM)(getProcAddr(\"glValidateProgram\"))\n\tif gpValidateProgram == nil {\n\t\treturn errors.New(\"glValidateProgram\")\n\t}\n\tgpValidateProgramARB = (C.GPVALIDATEPROGRAMARB)(getProcAddr(\"glValidateProgramARB\"))\n\tgpValidateProgramPipeline = (C.GPVALIDATEPROGRAMPIPELINE)(getProcAddr(\"glValidateProgramPipeline\"))\n\tif gpValidateProgramPipeline == nil {\n\t\treturn errors.New(\"glValidateProgramPipeline\")\n\t}\n\tgpValidateProgramPipelineEXT = (C.GPVALIDATEPROGRAMPIPELINEEXT)(getProcAddr(\"glValidateProgramPipelineEXT\"))\n\tgpVariantArrayObjectATI = (C.GPVARIANTARRAYOBJECTATI)(getProcAddr(\"glVariantArrayObjectATI\"))\n\tgpVariantPointerEXT = (C.GPVARIANTPOINTEREXT)(getProcAddr(\"glVariantPointerEXT\"))\n\tgpVariantbvEXT = (C.GPVARIANTBVEXT)(getProcAddr(\"glVariantbvEXT\"))\n\tgpVariantdvEXT = (C.GPVARIANTDVEXT)(getProcAddr(\"glVariantdvEXT\"))\n\tgpVariantfvEXT = (C.GPVARIANTFVEXT)(getProcAddr(\"glVariantfvEXT\"))\n\tgpVariantivEXT = (C.GPVARIANTIVEXT)(getProcAddr(\"glVariantivEXT\"))\n\tgpVariantsvEXT = (C.GPVARIANTSVEXT)(getProcAddr(\"glVariantsvEXT\"))\n\tgpVariantubvEXT = (C.GPVARIANTUBVEXT)(getProcAddr(\"glVariantubvEXT\"))\n\tgpVariantuivEXT = (C.GPVARIANTUIVEXT)(getProcAddr(\"glVariantuivEXT\"))\n\tgpVariantusvEXT = (C.GPVARIANTUSVEXT)(getProcAddr(\"glVariantusvEXT\"))\n\tgpVertex2bOES = (C.GPVERTEX2BOES)(getProcAddr(\"glVertex2bOES\"))\n\tgpVertex2bvOES = (C.GPVERTEX2BVOES)(getProcAddr(\"glVertex2bvOES\"))\n\tgpVertex2d = (C.GPVERTEX2D)(getProcAddr(\"glVertex2d\"))\n\tif gpVertex2d == nil {\n\t\treturn errors.New(\"glVertex2d\")\n\t}\n\tgpVertex2dv = (C.GPVERTEX2DV)(getProcAddr(\"glVertex2dv\"))\n\tif gpVertex2dv == nil {\n\t\treturn errors.New(\"glVertex2dv\")\n\t}\n\tgpVertex2f = (C.GPVERTEX2F)(getProcAddr(\"glVertex2f\"))\n\tif gpVertex2f == nil {\n\t\treturn errors.New(\"glVertex2f\")\n\t}\n\tgpVertex2fv = (C.GPVERTEX2FV)(getProcAddr(\"glVertex2fv\"))\n\tif gpVertex2fv == nil {\n\t\treturn errors.New(\"glVertex2fv\")\n\t}\n\tgpVertex2hNV = (C.GPVERTEX2HNV)(getProcAddr(\"glVertex2hNV\"))\n\tgpVertex2hvNV = (C.GPVERTEX2HVNV)(getProcAddr(\"glVertex2hvNV\"))\n\tgpVertex2i = (C.GPVERTEX2I)(getProcAddr(\"glVertex2i\"))\n\tif gpVertex2i == nil {\n\t\treturn errors.New(\"glVertex2i\")\n\t}\n\tgpVertex2iv = (C.GPVERTEX2IV)(getProcAddr(\"glVertex2iv\"))\n\tif gpVertex2iv == nil {\n\t\treturn errors.New(\"glVertex2iv\")\n\t}\n\tgpVertex2s = (C.GPVERTEX2S)(getProcAddr(\"glVertex2s\"))\n\tif gpVertex2s == nil {\n\t\treturn errors.New(\"glVertex2s\")\n\t}\n\tgpVertex2sv = (C.GPVERTEX2SV)(getProcAddr(\"glVertex2sv\"))\n\tif gpVertex2sv == nil {\n\t\treturn errors.New(\"glVertex2sv\")\n\t}\n\tgpVertex2xOES = (C.GPVERTEX2XOES)(getProcAddr(\"glVertex2xOES\"))\n\tgpVertex2xvOES = (C.GPVERTEX2XVOES)(getProcAddr(\"glVertex2xvOES\"))\n\tgpVertex3bOES = (C.GPVERTEX3BOES)(getProcAddr(\"glVertex3bOES\"))\n\tgpVertex3bvOES = (C.GPVERTEX3BVOES)(getProcAddr(\"glVertex3bvOES\"))\n\tgpVertex3d = (C.GPVERTEX3D)(getProcAddr(\"glVertex3d\"))\n\tif gpVertex3d == nil {\n\t\treturn errors.New(\"glVertex3d\")\n\t}\n\tgpVertex3dv = (C.GPVERTEX3DV)(getProcAddr(\"glVertex3dv\"))\n\tif gpVertex3dv == nil {\n\t\treturn errors.New(\"glVertex3dv\")\n\t}\n\tgpVertex3f = (C.GPVERTEX3F)(getProcAddr(\"glVertex3f\"))\n\tif gpVertex3f == nil {\n\t\treturn errors.New(\"glVertex3f\")\n\t}\n\tgpVertex3fv = (C.GPVERTEX3FV)(getProcAddr(\"glVertex3fv\"))\n\tif gpVertex3fv == nil {\n\t\treturn errors.New(\"glVertex3fv\")\n\t}\n\tgpVertex3hNV = (C.GPVERTEX3HNV)(getProcAddr(\"glVertex3hNV\"))\n\tgpVertex3hvNV = (C.GPVERTEX3HVNV)(getProcAddr(\"glVertex3hvNV\"))\n\tgpVertex3i = (C.GPVERTEX3I)(getProcAddr(\"glVertex3i\"))\n\tif gpVertex3i == nil {\n\t\treturn errors.New(\"glVertex3i\")\n\t}\n\tgpVertex3iv = (C.GPVERTEX3IV)(getProcAddr(\"glVertex3iv\"))\n\tif gpVertex3iv == nil {\n\t\treturn errors.New(\"glVertex3iv\")\n\t}\n\tgpVertex3s = (C.GPVERTEX3S)(getProcAddr(\"glVertex3s\"))\n\tif gpVertex3s == nil {\n\t\treturn errors.New(\"glVertex3s\")\n\t}\n\tgpVertex3sv = (C.GPVERTEX3SV)(getProcAddr(\"glVertex3sv\"))\n\tif gpVertex3sv == nil {\n\t\treturn errors.New(\"glVertex3sv\")\n\t}\n\tgpVertex3xOES = (C.GPVERTEX3XOES)(getProcAddr(\"glVertex3xOES\"))\n\tgpVertex3xvOES = (C.GPVERTEX3XVOES)(getProcAddr(\"glVertex3xvOES\"))\n\tgpVertex4bOES = (C.GPVERTEX4BOES)(getProcAddr(\"glVertex4bOES\"))\n\tgpVertex4bvOES = (C.GPVERTEX4BVOES)(getProcAddr(\"glVertex4bvOES\"))\n\tgpVertex4d = (C.GPVERTEX4D)(getProcAddr(\"glVertex4d\"))\n\tif gpVertex4d == nil {\n\t\treturn errors.New(\"glVertex4d\")\n\t}\n\tgpVertex4dv = (C.GPVERTEX4DV)(getProcAddr(\"glVertex4dv\"))\n\tif gpVertex4dv == nil {\n\t\treturn errors.New(\"glVertex4dv\")\n\t}\n\tgpVertex4f = (C.GPVERTEX4F)(getProcAddr(\"glVertex4f\"))\n\tif gpVertex4f == nil {\n\t\treturn errors.New(\"glVertex4f\")\n\t}\n\tgpVertex4fv = (C.GPVERTEX4FV)(getProcAddr(\"glVertex4fv\"))\n\tif gpVertex4fv == nil {\n\t\treturn errors.New(\"glVertex4fv\")\n\t}\n\tgpVertex4hNV = (C.GPVERTEX4HNV)(getProcAddr(\"glVertex4hNV\"))\n\tgpVertex4hvNV = (C.GPVERTEX4HVNV)(getProcAddr(\"glVertex4hvNV\"))\n\tgpVertex4i = (C.GPVERTEX4I)(getProcAddr(\"glVertex4i\"))\n\tif gpVertex4i == nil {\n\t\treturn errors.New(\"glVertex4i\")\n\t}\n\tgpVertex4iv = (C.GPVERTEX4IV)(getProcAddr(\"glVertex4iv\"))\n\tif gpVertex4iv == nil {\n\t\treturn errors.New(\"glVertex4iv\")\n\t}\n\tgpVertex4s = (C.GPVERTEX4S)(getProcAddr(\"glVertex4s\"))\n\tif gpVertex4s == nil {\n\t\treturn errors.New(\"glVertex4s\")\n\t}\n\tgpVertex4sv = (C.GPVERTEX4SV)(getProcAddr(\"glVertex4sv\"))\n\tif gpVertex4sv == nil {\n\t\treturn errors.New(\"glVertex4sv\")\n\t}\n\tgpVertex4xOES = (C.GPVERTEX4XOES)(getProcAddr(\"glVertex4xOES\"))\n\tgpVertex4xvOES = (C.GPVERTEX4XVOES)(getProcAddr(\"glVertex4xvOES\"))\n\tgpVertexArrayAttribBinding = (C.GPVERTEXARRAYATTRIBBINDING)(getProcAddr(\"glVertexArrayAttribBinding\"))\n\tgpVertexArrayAttribFormat = (C.GPVERTEXARRAYATTRIBFORMAT)(getProcAddr(\"glVertexArrayAttribFormat\"))\n\tgpVertexArrayAttribIFormat = (C.GPVERTEXARRAYATTRIBIFORMAT)(getProcAddr(\"glVertexArrayAttribIFormat\"))\n\tgpVertexArrayAttribLFormat = (C.GPVERTEXARRAYATTRIBLFORMAT)(getProcAddr(\"glVertexArrayAttribLFormat\"))\n\tgpVertexArrayBindVertexBufferEXT = (C.GPVERTEXARRAYBINDVERTEXBUFFEREXT)(getProcAddr(\"glVertexArrayBindVertexBufferEXT\"))\n\tgpVertexArrayBindingDivisor = (C.GPVERTEXARRAYBINDINGDIVISOR)(getProcAddr(\"glVertexArrayBindingDivisor\"))\n\tgpVertexArrayColorOffsetEXT = (C.GPVERTEXARRAYCOLOROFFSETEXT)(getProcAddr(\"glVertexArrayColorOffsetEXT\"))\n\tgpVertexArrayEdgeFlagOffsetEXT = (C.GPVERTEXARRAYEDGEFLAGOFFSETEXT)(getProcAddr(\"glVertexArrayEdgeFlagOffsetEXT\"))\n\tgpVertexArrayElementBuffer = (C.GPVERTEXARRAYELEMENTBUFFER)(getProcAddr(\"glVertexArrayElementBuffer\"))\n\tgpVertexArrayFogCoordOffsetEXT = (C.GPVERTEXARRAYFOGCOORDOFFSETEXT)(getProcAddr(\"glVertexArrayFogCoordOffsetEXT\"))\n\tgpVertexArrayIndexOffsetEXT = (C.GPVERTEXARRAYINDEXOFFSETEXT)(getProcAddr(\"glVertexArrayIndexOffsetEXT\"))\n\tgpVertexArrayMultiTexCoordOffsetEXT = (C.GPVERTEXARRAYMULTITEXCOORDOFFSETEXT)(getProcAddr(\"glVertexArrayMultiTexCoordOffsetEXT\"))\n\tgpVertexArrayNormalOffsetEXT = (C.GPVERTEXARRAYNORMALOFFSETEXT)(getProcAddr(\"glVertexArrayNormalOffsetEXT\"))\n\tgpVertexArrayParameteriAPPLE = (C.GPVERTEXARRAYPARAMETERIAPPLE)(getProcAddr(\"glVertexArrayParameteriAPPLE\"))\n\tgpVertexArrayRangeAPPLE = (C.GPVERTEXARRAYRANGEAPPLE)(getProcAddr(\"glVertexArrayRangeAPPLE\"))\n\tgpVertexArrayRangeNV = (C.GPVERTEXARRAYRANGENV)(getProcAddr(\"glVertexArrayRangeNV\"))\n\tgpVertexArraySecondaryColorOffsetEXT = (C.GPVERTEXARRAYSECONDARYCOLOROFFSETEXT)(getProcAddr(\"glVertexArraySecondaryColorOffsetEXT\"))\n\tgpVertexArrayTexCoordOffsetEXT = (C.GPVERTEXARRAYTEXCOORDOFFSETEXT)(getProcAddr(\"glVertexArrayTexCoordOffsetEXT\"))\n\tgpVertexArrayVertexAttribBindingEXT = (C.GPVERTEXARRAYVERTEXATTRIBBINDINGEXT)(getProcAddr(\"glVertexArrayVertexAttribBindingEXT\"))\n\tgpVertexArrayVertexAttribDivisorEXT = (C.GPVERTEXARRAYVERTEXATTRIBDIVISOREXT)(getProcAddr(\"glVertexArrayVertexAttribDivisorEXT\"))\n\tgpVertexArrayVertexAttribFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBFORMATEXT)(getProcAddr(\"glVertexArrayVertexAttribFormatEXT\"))\n\tgpVertexArrayVertexAttribIFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBIFORMATEXT)(getProcAddr(\"glVertexArrayVertexAttribIFormatEXT\"))\n\tgpVertexArrayVertexAttribIOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBIOFFSETEXT)(getProcAddr(\"glVertexArrayVertexAttribIOffsetEXT\"))\n\tgpVertexArrayVertexAttribLFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBLFORMATEXT)(getProcAddr(\"glVertexArrayVertexAttribLFormatEXT\"))\n\tgpVertexArrayVertexAttribLOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBLOFFSETEXT)(getProcAddr(\"glVertexArrayVertexAttribLOffsetEXT\"))\n\tgpVertexArrayVertexAttribOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBOFFSETEXT)(getProcAddr(\"glVertexArrayVertexAttribOffsetEXT\"))\n\tgpVertexArrayVertexBindingDivisorEXT = (C.GPVERTEXARRAYVERTEXBINDINGDIVISOREXT)(getProcAddr(\"glVertexArrayVertexBindingDivisorEXT\"))\n\tgpVertexArrayVertexBuffer = (C.GPVERTEXARRAYVERTEXBUFFER)(getProcAddr(\"glVertexArrayVertexBuffer\"))\n\tgpVertexArrayVertexBuffers = (C.GPVERTEXARRAYVERTEXBUFFERS)(getProcAddr(\"glVertexArrayVertexBuffers\"))\n\tgpVertexArrayVertexOffsetEXT = (C.GPVERTEXARRAYVERTEXOFFSETEXT)(getProcAddr(\"glVertexArrayVertexOffsetEXT\"))\n\tgpVertexAttrib1d = (C.GPVERTEXATTRIB1D)(getProcAddr(\"glVertexAttrib1d\"))\n\tif gpVertexAttrib1d == nil {\n\t\treturn errors.New(\"glVertexAttrib1d\")\n\t}\n\tgpVertexAttrib1dARB = (C.GPVERTEXATTRIB1DARB)(getProcAddr(\"glVertexAttrib1dARB\"))\n\tgpVertexAttrib1dNV = (C.GPVERTEXATTRIB1DNV)(getProcAddr(\"glVertexAttrib1dNV\"))\n\tgpVertexAttrib1dv = (C.GPVERTEXATTRIB1DV)(getProcAddr(\"glVertexAttrib1dv\"))\n\tif gpVertexAttrib1dv == nil {\n\t\treturn errors.New(\"glVertexAttrib1dv\")\n\t}\n\tgpVertexAttrib1dvARB = (C.GPVERTEXATTRIB1DVARB)(getProcAddr(\"glVertexAttrib1dvARB\"))\n\tgpVertexAttrib1dvNV = (C.GPVERTEXATTRIB1DVNV)(getProcAddr(\"glVertexAttrib1dvNV\"))\n\tgpVertexAttrib1f = (C.GPVERTEXATTRIB1F)(getProcAddr(\"glVertexAttrib1f\"))\n\tif gpVertexAttrib1f == nil {\n\t\treturn errors.New(\"glVertexAttrib1f\")\n\t}\n\tgpVertexAttrib1fARB = (C.GPVERTEXATTRIB1FARB)(getProcAddr(\"glVertexAttrib1fARB\"))\n\tgpVertexAttrib1fNV = (C.GPVERTEXATTRIB1FNV)(getProcAddr(\"glVertexAttrib1fNV\"))\n\tgpVertexAttrib1fv = (C.GPVERTEXATTRIB1FV)(getProcAddr(\"glVertexAttrib1fv\"))\n\tif gpVertexAttrib1fv == nil {\n\t\treturn errors.New(\"glVertexAttrib1fv\")\n\t}\n\tgpVertexAttrib1fvARB = (C.GPVERTEXATTRIB1FVARB)(getProcAddr(\"glVertexAttrib1fvARB\"))\n\tgpVertexAttrib1fvNV = (C.GPVERTEXATTRIB1FVNV)(getProcAddr(\"glVertexAttrib1fvNV\"))\n\tgpVertexAttrib1hNV = (C.GPVERTEXATTRIB1HNV)(getProcAddr(\"glVertexAttrib1hNV\"))\n\tgpVertexAttrib1hvNV = (C.GPVERTEXATTRIB1HVNV)(getProcAddr(\"glVertexAttrib1hvNV\"))\n\tgpVertexAttrib1s = (C.GPVERTEXATTRIB1S)(getProcAddr(\"glVertexAttrib1s\"))\n\tif gpVertexAttrib1s == nil {\n\t\treturn errors.New(\"glVertexAttrib1s\")\n\t}\n\tgpVertexAttrib1sARB = (C.GPVERTEXATTRIB1SARB)(getProcAddr(\"glVertexAttrib1sARB\"))\n\tgpVertexAttrib1sNV = (C.GPVERTEXATTRIB1SNV)(getProcAddr(\"glVertexAttrib1sNV\"))\n\tgpVertexAttrib1sv = (C.GPVERTEXATTRIB1SV)(getProcAddr(\"glVertexAttrib1sv\"))\n\tif gpVertexAttrib1sv == nil {\n\t\treturn errors.New(\"glVertexAttrib1sv\")\n\t}\n\tgpVertexAttrib1svARB = (C.GPVERTEXATTRIB1SVARB)(getProcAddr(\"glVertexAttrib1svARB\"))\n\tgpVertexAttrib1svNV = (C.GPVERTEXATTRIB1SVNV)(getProcAddr(\"glVertexAttrib1svNV\"))\n\tgpVertexAttrib2d = (C.GPVERTEXATTRIB2D)(getProcAddr(\"glVertexAttrib2d\"))\n\tif gpVertexAttrib2d == nil {\n\t\treturn errors.New(\"glVertexAttrib2d\")\n\t}\n\tgpVertexAttrib2dARB = (C.GPVERTEXATTRIB2DARB)(getProcAddr(\"glVertexAttrib2dARB\"))\n\tgpVertexAttrib2dNV = (C.GPVERTEXATTRIB2DNV)(getProcAddr(\"glVertexAttrib2dNV\"))\n\tgpVertexAttrib2dv = (C.GPVERTEXATTRIB2DV)(getProcAddr(\"glVertexAttrib2dv\"))\n\tif gpVertexAttrib2dv == nil {\n\t\treturn errors.New(\"glVertexAttrib2dv\")\n\t}\n\tgpVertexAttrib2dvARB = (C.GPVERTEXATTRIB2DVARB)(getProcAddr(\"glVertexAttrib2dvARB\"))\n\tgpVertexAttrib2dvNV = (C.GPVERTEXATTRIB2DVNV)(getProcAddr(\"glVertexAttrib2dvNV\"))\n\tgpVertexAttrib2f = (C.GPVERTEXATTRIB2F)(getProcAddr(\"glVertexAttrib2f\"))\n\tif gpVertexAttrib2f == nil {\n\t\treturn errors.New(\"glVertexAttrib2f\")\n\t}\n\tgpVertexAttrib2fARB = (C.GPVERTEXATTRIB2FARB)(getProcAddr(\"glVertexAttrib2fARB\"))\n\tgpVertexAttrib2fNV = (C.GPVERTEXATTRIB2FNV)(getProcAddr(\"glVertexAttrib2fNV\"))\n\tgpVertexAttrib2fv = (C.GPVERTEXATTRIB2FV)(getProcAddr(\"glVertexAttrib2fv\"))\n\tif gpVertexAttrib2fv == nil {\n\t\treturn errors.New(\"glVertexAttrib2fv\")\n\t}\n\tgpVertexAttrib2fvARB = (C.GPVERTEXATTRIB2FVARB)(getProcAddr(\"glVertexAttrib2fvARB\"))\n\tgpVertexAttrib2fvNV = (C.GPVERTEXATTRIB2FVNV)(getProcAddr(\"glVertexAttrib2fvNV\"))\n\tgpVertexAttrib2hNV = (C.GPVERTEXATTRIB2HNV)(getProcAddr(\"glVertexAttrib2hNV\"))\n\tgpVertexAttrib2hvNV = (C.GPVERTEXATTRIB2HVNV)(getProcAddr(\"glVertexAttrib2hvNV\"))\n\tgpVertexAttrib2s = (C.GPVERTEXATTRIB2S)(getProcAddr(\"glVertexAttrib2s\"))\n\tif gpVertexAttrib2s == nil {\n\t\treturn errors.New(\"glVertexAttrib2s\")\n\t}\n\tgpVertexAttrib2sARB = (C.GPVERTEXATTRIB2SARB)(getProcAddr(\"glVertexAttrib2sARB\"))\n\tgpVertexAttrib2sNV = (C.GPVERTEXATTRIB2SNV)(getProcAddr(\"glVertexAttrib2sNV\"))\n\tgpVertexAttrib2sv = (C.GPVERTEXATTRIB2SV)(getProcAddr(\"glVertexAttrib2sv\"))\n\tif gpVertexAttrib2sv == nil {\n\t\treturn errors.New(\"glVertexAttrib2sv\")\n\t}\n\tgpVertexAttrib2svARB = (C.GPVERTEXATTRIB2SVARB)(getProcAddr(\"glVertexAttrib2svARB\"))\n\tgpVertexAttrib2svNV = (C.GPVERTEXATTRIB2SVNV)(getProcAddr(\"glVertexAttrib2svNV\"))\n\tgpVertexAttrib3d = (C.GPVERTEXATTRIB3D)(getProcAddr(\"glVertexAttrib3d\"))\n\tif gpVertexAttrib3d == nil {\n\t\treturn errors.New(\"glVertexAttrib3d\")\n\t}\n\tgpVertexAttrib3dARB = (C.GPVERTEXATTRIB3DARB)(getProcAddr(\"glVertexAttrib3dARB\"))\n\tgpVertexAttrib3dNV = (C.GPVERTEXATTRIB3DNV)(getProcAddr(\"glVertexAttrib3dNV\"))\n\tgpVertexAttrib3dv = (C.GPVERTEXATTRIB3DV)(getProcAddr(\"glVertexAttrib3dv\"))\n\tif gpVertexAttrib3dv == nil {\n\t\treturn errors.New(\"glVertexAttrib3dv\")\n\t}\n\tgpVertexAttrib3dvARB = (C.GPVERTEXATTRIB3DVARB)(getProcAddr(\"glVertexAttrib3dvARB\"))\n\tgpVertexAttrib3dvNV = (C.GPVERTEXATTRIB3DVNV)(getProcAddr(\"glVertexAttrib3dvNV\"))\n\tgpVertexAttrib3f = (C.GPVERTEXATTRIB3F)(getProcAddr(\"glVertexAttrib3f\"))\n\tif gpVertexAttrib3f == nil {\n\t\treturn errors.New(\"glVertexAttrib3f\")\n\t}\n\tgpVertexAttrib3fARB = (C.GPVERTEXATTRIB3FARB)(getProcAddr(\"glVertexAttrib3fARB\"))\n\tgpVertexAttrib3fNV = (C.GPVERTEXATTRIB3FNV)(getProcAddr(\"glVertexAttrib3fNV\"))\n\tgpVertexAttrib3fv = (C.GPVERTEXATTRIB3FV)(getProcAddr(\"glVertexAttrib3fv\"))\n\tif gpVertexAttrib3fv == nil {\n\t\treturn errors.New(\"glVertexAttrib3fv\")\n\t}\n\tgpVertexAttrib3fvARB = (C.GPVERTEXATTRIB3FVARB)(getProcAddr(\"glVertexAttrib3fvARB\"))\n\tgpVertexAttrib3fvNV = (C.GPVERTEXATTRIB3FVNV)(getProcAddr(\"glVertexAttrib3fvNV\"))\n\tgpVertexAttrib3hNV = (C.GPVERTEXATTRIB3HNV)(getProcAddr(\"glVertexAttrib3hNV\"))\n\tgpVertexAttrib3hvNV = (C.GPVERTEXATTRIB3HVNV)(getProcAddr(\"glVertexAttrib3hvNV\"))\n\tgpVertexAttrib3s = (C.GPVERTEXATTRIB3S)(getProcAddr(\"glVertexAttrib3s\"))\n\tif gpVertexAttrib3s == nil {\n\t\treturn errors.New(\"glVertexAttrib3s\")\n\t}\n\tgpVertexAttrib3sARB = (C.GPVERTEXATTRIB3SARB)(getProcAddr(\"glVertexAttrib3sARB\"))\n\tgpVertexAttrib3sNV = (C.GPVERTEXATTRIB3SNV)(getProcAddr(\"glVertexAttrib3sNV\"))\n\tgpVertexAttrib3sv = (C.GPVERTEXATTRIB3SV)(getProcAddr(\"glVertexAttrib3sv\"))\n\tif gpVertexAttrib3sv == nil {\n\t\treturn errors.New(\"glVertexAttrib3sv\")\n\t}\n\tgpVertexAttrib3svARB = (C.GPVERTEXATTRIB3SVARB)(getProcAddr(\"glVertexAttrib3svARB\"))\n\tgpVertexAttrib3svNV = (C.GPVERTEXATTRIB3SVNV)(getProcAddr(\"glVertexAttrib3svNV\"))\n\tgpVertexAttrib4Nbv = (C.GPVERTEXATTRIB4NBV)(getProcAddr(\"glVertexAttrib4Nbv\"))\n\tif gpVertexAttrib4Nbv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nbv\")\n\t}\n\tgpVertexAttrib4NbvARB = (C.GPVERTEXATTRIB4NBVARB)(getProcAddr(\"glVertexAttrib4NbvARB\"))\n\tgpVertexAttrib4Niv = (C.GPVERTEXATTRIB4NIV)(getProcAddr(\"glVertexAttrib4Niv\"))\n\tif gpVertexAttrib4Niv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Niv\")\n\t}\n\tgpVertexAttrib4NivARB = (C.GPVERTEXATTRIB4NIVARB)(getProcAddr(\"glVertexAttrib4NivARB\"))\n\tgpVertexAttrib4Nsv = (C.GPVERTEXATTRIB4NSV)(getProcAddr(\"glVertexAttrib4Nsv\"))\n\tif gpVertexAttrib4Nsv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nsv\")\n\t}\n\tgpVertexAttrib4NsvARB = (C.GPVERTEXATTRIB4NSVARB)(getProcAddr(\"glVertexAttrib4NsvARB\"))\n\tgpVertexAttrib4Nub = (C.GPVERTEXATTRIB4NUB)(getProcAddr(\"glVertexAttrib4Nub\"))\n\tif gpVertexAttrib4Nub == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nub\")\n\t}\n\tgpVertexAttrib4NubARB = (C.GPVERTEXATTRIB4NUBARB)(getProcAddr(\"glVertexAttrib4NubARB\"))\n\tgpVertexAttrib4Nubv = (C.GPVERTEXATTRIB4NUBV)(getProcAddr(\"glVertexAttrib4Nubv\"))\n\tif gpVertexAttrib4Nubv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nubv\")\n\t}\n\tgpVertexAttrib4NubvARB = (C.GPVERTEXATTRIB4NUBVARB)(getProcAddr(\"glVertexAttrib4NubvARB\"))\n\tgpVertexAttrib4Nuiv = (C.GPVERTEXATTRIB4NUIV)(getProcAddr(\"glVertexAttrib4Nuiv\"))\n\tif gpVertexAttrib4Nuiv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nuiv\")\n\t}\n\tgpVertexAttrib4NuivARB = (C.GPVERTEXATTRIB4NUIVARB)(getProcAddr(\"glVertexAttrib4NuivARB\"))\n\tgpVertexAttrib4Nusv = (C.GPVERTEXATTRIB4NUSV)(getProcAddr(\"glVertexAttrib4Nusv\"))\n\tif gpVertexAttrib4Nusv == nil {\n\t\treturn errors.New(\"glVertexAttrib4Nusv\")\n\t}\n\tgpVertexAttrib4NusvARB = (C.GPVERTEXATTRIB4NUSVARB)(getProcAddr(\"glVertexAttrib4NusvARB\"))\n\tgpVertexAttrib4bv = (C.GPVERTEXATTRIB4BV)(getProcAddr(\"glVertexAttrib4bv\"))\n\tif gpVertexAttrib4bv == nil {\n\t\treturn errors.New(\"glVertexAttrib4bv\")\n\t}\n\tgpVertexAttrib4bvARB = (C.GPVERTEXATTRIB4BVARB)(getProcAddr(\"glVertexAttrib4bvARB\"))\n\tgpVertexAttrib4d = (C.GPVERTEXATTRIB4D)(getProcAddr(\"glVertexAttrib4d\"))\n\tif gpVertexAttrib4d == nil {\n\t\treturn errors.New(\"glVertexAttrib4d\")\n\t}\n\tgpVertexAttrib4dARB = (C.GPVERTEXATTRIB4DARB)(getProcAddr(\"glVertexAttrib4dARB\"))\n\tgpVertexAttrib4dNV = (C.GPVERTEXATTRIB4DNV)(getProcAddr(\"glVertexAttrib4dNV\"))\n\tgpVertexAttrib4dv = (C.GPVERTEXATTRIB4DV)(getProcAddr(\"glVertexAttrib4dv\"))\n\tif gpVertexAttrib4dv == nil {\n\t\treturn errors.New(\"glVertexAttrib4dv\")\n\t}\n\tgpVertexAttrib4dvARB = (C.GPVERTEXATTRIB4DVARB)(getProcAddr(\"glVertexAttrib4dvARB\"))\n\tgpVertexAttrib4dvNV = (C.GPVERTEXATTRIB4DVNV)(getProcAddr(\"glVertexAttrib4dvNV\"))\n\tgpVertexAttrib4f = (C.GPVERTEXATTRIB4F)(getProcAddr(\"glVertexAttrib4f\"))\n\tif gpVertexAttrib4f == nil {\n\t\treturn errors.New(\"glVertexAttrib4f\")\n\t}\n\tgpVertexAttrib4fARB = (C.GPVERTEXATTRIB4FARB)(getProcAddr(\"glVertexAttrib4fARB\"))\n\tgpVertexAttrib4fNV = (C.GPVERTEXATTRIB4FNV)(getProcAddr(\"glVertexAttrib4fNV\"))\n\tgpVertexAttrib4fv = (C.GPVERTEXATTRIB4FV)(getProcAddr(\"glVertexAttrib4fv\"))\n\tif gpVertexAttrib4fv == nil {\n\t\treturn errors.New(\"glVertexAttrib4fv\")\n\t}\n\tgpVertexAttrib4fvARB = (C.GPVERTEXATTRIB4FVARB)(getProcAddr(\"glVertexAttrib4fvARB\"))\n\tgpVertexAttrib4fvNV = (C.GPVERTEXATTRIB4FVNV)(getProcAddr(\"glVertexAttrib4fvNV\"))\n\tgpVertexAttrib4hNV = (C.GPVERTEXATTRIB4HNV)(getProcAddr(\"glVertexAttrib4hNV\"))\n\tgpVertexAttrib4hvNV = (C.GPVERTEXATTRIB4HVNV)(getProcAddr(\"glVertexAttrib4hvNV\"))\n\tgpVertexAttrib4iv = (C.GPVERTEXATTRIB4IV)(getProcAddr(\"glVertexAttrib4iv\"))\n\tif gpVertexAttrib4iv == nil {\n\t\treturn errors.New(\"glVertexAttrib4iv\")\n\t}\n\tgpVertexAttrib4ivARB = (C.GPVERTEXATTRIB4IVARB)(getProcAddr(\"glVertexAttrib4ivARB\"))\n\tgpVertexAttrib4s = (C.GPVERTEXATTRIB4S)(getProcAddr(\"glVertexAttrib4s\"))\n\tif gpVertexAttrib4s == nil {\n\t\treturn errors.New(\"glVertexAttrib4s\")\n\t}\n\tgpVertexAttrib4sARB = (C.GPVERTEXATTRIB4SARB)(getProcAddr(\"glVertexAttrib4sARB\"))\n\tgpVertexAttrib4sNV = (C.GPVERTEXATTRIB4SNV)(getProcAddr(\"glVertexAttrib4sNV\"))\n\tgpVertexAttrib4sv = (C.GPVERTEXATTRIB4SV)(getProcAddr(\"glVertexAttrib4sv\"))\n\tif gpVertexAttrib4sv == nil {\n\t\treturn errors.New(\"glVertexAttrib4sv\")\n\t}\n\tgpVertexAttrib4svARB = (C.GPVERTEXATTRIB4SVARB)(getProcAddr(\"glVertexAttrib4svARB\"))\n\tgpVertexAttrib4svNV = (C.GPVERTEXATTRIB4SVNV)(getProcAddr(\"glVertexAttrib4svNV\"))\n\tgpVertexAttrib4ubNV = (C.GPVERTEXATTRIB4UBNV)(getProcAddr(\"glVertexAttrib4ubNV\"))\n\tgpVertexAttrib4ubv = (C.GPVERTEXATTRIB4UBV)(getProcAddr(\"glVertexAttrib4ubv\"))\n\tif gpVertexAttrib4ubv == nil {\n\t\treturn errors.New(\"glVertexAttrib4ubv\")\n\t}\n\tgpVertexAttrib4ubvARB = (C.GPVERTEXATTRIB4UBVARB)(getProcAddr(\"glVertexAttrib4ubvARB\"))\n\tgpVertexAttrib4ubvNV = (C.GPVERTEXATTRIB4UBVNV)(getProcAddr(\"glVertexAttrib4ubvNV\"))\n\tgpVertexAttrib4uiv = (C.GPVERTEXATTRIB4UIV)(getProcAddr(\"glVertexAttrib4uiv\"))\n\tif gpVertexAttrib4uiv == nil {\n\t\treturn errors.New(\"glVertexAttrib4uiv\")\n\t}\n\tgpVertexAttrib4uivARB = (C.GPVERTEXATTRIB4UIVARB)(getProcAddr(\"glVertexAttrib4uivARB\"))\n\tgpVertexAttrib4usv = (C.GPVERTEXATTRIB4USV)(getProcAddr(\"glVertexAttrib4usv\"))\n\tif gpVertexAttrib4usv == nil {\n\t\treturn errors.New(\"glVertexAttrib4usv\")\n\t}\n\tgpVertexAttrib4usvARB = (C.GPVERTEXATTRIB4USVARB)(getProcAddr(\"glVertexAttrib4usvARB\"))\n\tgpVertexAttribArrayObjectATI = (C.GPVERTEXATTRIBARRAYOBJECTATI)(getProcAddr(\"glVertexAttribArrayObjectATI\"))\n\tgpVertexAttribBinding = (C.GPVERTEXATTRIBBINDING)(getProcAddr(\"glVertexAttribBinding\"))\n\tif gpVertexAttribBinding == nil {\n\t\treturn errors.New(\"glVertexAttribBinding\")\n\t}\n\tgpVertexAttribDivisor = (C.GPVERTEXATTRIBDIVISOR)(getProcAddr(\"glVertexAttribDivisor\"))\n\tif gpVertexAttribDivisor == nil {\n\t\treturn errors.New(\"glVertexAttribDivisor\")\n\t}\n\tgpVertexAttribDivisorARB = (C.GPVERTEXATTRIBDIVISORARB)(getProcAddr(\"glVertexAttribDivisorARB\"))\n\tgpVertexAttribFormat = (C.GPVERTEXATTRIBFORMAT)(getProcAddr(\"glVertexAttribFormat\"))\n\tif gpVertexAttribFormat == nil {\n\t\treturn errors.New(\"glVertexAttribFormat\")\n\t}\n\tgpVertexAttribFormatNV = (C.GPVERTEXATTRIBFORMATNV)(getProcAddr(\"glVertexAttribFormatNV\"))\n\tgpVertexAttribI1i = (C.GPVERTEXATTRIBI1I)(getProcAddr(\"glVertexAttribI1i\"))\n\tif gpVertexAttribI1i == nil {\n\t\treturn errors.New(\"glVertexAttribI1i\")\n\t}\n\tgpVertexAttribI1iEXT = (C.GPVERTEXATTRIBI1IEXT)(getProcAddr(\"glVertexAttribI1iEXT\"))\n\tgpVertexAttribI1iv = (C.GPVERTEXATTRIBI1IV)(getProcAddr(\"glVertexAttribI1iv\"))\n\tif gpVertexAttribI1iv == nil {\n\t\treturn errors.New(\"glVertexAttribI1iv\")\n\t}\n\tgpVertexAttribI1ivEXT = (C.GPVERTEXATTRIBI1IVEXT)(getProcAddr(\"glVertexAttribI1ivEXT\"))\n\tgpVertexAttribI1ui = (C.GPVERTEXATTRIBI1UI)(getProcAddr(\"glVertexAttribI1ui\"))\n\tif gpVertexAttribI1ui == nil {\n\t\treturn errors.New(\"glVertexAttribI1ui\")\n\t}\n\tgpVertexAttribI1uiEXT = (C.GPVERTEXATTRIBI1UIEXT)(getProcAddr(\"glVertexAttribI1uiEXT\"))\n\tgpVertexAttribI1uiv = (C.GPVERTEXATTRIBI1UIV)(getProcAddr(\"glVertexAttribI1uiv\"))\n\tif gpVertexAttribI1uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI1uiv\")\n\t}\n\tgpVertexAttribI1uivEXT = (C.GPVERTEXATTRIBI1UIVEXT)(getProcAddr(\"glVertexAttribI1uivEXT\"))\n\tgpVertexAttribI2i = (C.GPVERTEXATTRIBI2I)(getProcAddr(\"glVertexAttribI2i\"))\n\tif gpVertexAttribI2i == nil {\n\t\treturn errors.New(\"glVertexAttribI2i\")\n\t}\n\tgpVertexAttribI2iEXT = (C.GPVERTEXATTRIBI2IEXT)(getProcAddr(\"glVertexAttribI2iEXT\"))\n\tgpVertexAttribI2iv = (C.GPVERTEXATTRIBI2IV)(getProcAddr(\"glVertexAttribI2iv\"))\n\tif gpVertexAttribI2iv == nil {\n\t\treturn errors.New(\"glVertexAttribI2iv\")\n\t}\n\tgpVertexAttribI2ivEXT = (C.GPVERTEXATTRIBI2IVEXT)(getProcAddr(\"glVertexAttribI2ivEXT\"))\n\tgpVertexAttribI2ui = (C.GPVERTEXATTRIBI2UI)(getProcAddr(\"glVertexAttribI2ui\"))\n\tif gpVertexAttribI2ui == nil {\n\t\treturn errors.New(\"glVertexAttribI2ui\")\n\t}\n\tgpVertexAttribI2uiEXT = (C.GPVERTEXATTRIBI2UIEXT)(getProcAddr(\"glVertexAttribI2uiEXT\"))\n\tgpVertexAttribI2uiv = (C.GPVERTEXATTRIBI2UIV)(getProcAddr(\"glVertexAttribI2uiv\"))\n\tif gpVertexAttribI2uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI2uiv\")\n\t}\n\tgpVertexAttribI2uivEXT = (C.GPVERTEXATTRIBI2UIVEXT)(getProcAddr(\"glVertexAttribI2uivEXT\"))\n\tgpVertexAttribI3i = (C.GPVERTEXATTRIBI3I)(getProcAddr(\"glVertexAttribI3i\"))\n\tif gpVertexAttribI3i == nil {\n\t\treturn errors.New(\"glVertexAttribI3i\")\n\t}\n\tgpVertexAttribI3iEXT = (C.GPVERTEXATTRIBI3IEXT)(getProcAddr(\"glVertexAttribI3iEXT\"))\n\tgpVertexAttribI3iv = (C.GPVERTEXATTRIBI3IV)(getProcAddr(\"glVertexAttribI3iv\"))\n\tif gpVertexAttribI3iv == nil {\n\t\treturn errors.New(\"glVertexAttribI3iv\")\n\t}\n\tgpVertexAttribI3ivEXT = (C.GPVERTEXATTRIBI3IVEXT)(getProcAddr(\"glVertexAttribI3ivEXT\"))\n\tgpVertexAttribI3ui = (C.GPVERTEXATTRIBI3UI)(getProcAddr(\"glVertexAttribI3ui\"))\n\tif gpVertexAttribI3ui == nil {\n\t\treturn errors.New(\"glVertexAttribI3ui\")\n\t}\n\tgpVertexAttribI3uiEXT = (C.GPVERTEXATTRIBI3UIEXT)(getProcAddr(\"glVertexAttribI3uiEXT\"))\n\tgpVertexAttribI3uiv = (C.GPVERTEXATTRIBI3UIV)(getProcAddr(\"glVertexAttribI3uiv\"))\n\tif gpVertexAttribI3uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI3uiv\")\n\t}\n\tgpVertexAttribI3uivEXT = (C.GPVERTEXATTRIBI3UIVEXT)(getProcAddr(\"glVertexAttribI3uivEXT\"))\n\tgpVertexAttribI4bv = (C.GPVERTEXATTRIBI4BV)(getProcAddr(\"glVertexAttribI4bv\"))\n\tif gpVertexAttribI4bv == nil {\n\t\treturn errors.New(\"glVertexAttribI4bv\")\n\t}\n\tgpVertexAttribI4bvEXT = (C.GPVERTEXATTRIBI4BVEXT)(getProcAddr(\"glVertexAttribI4bvEXT\"))\n\tgpVertexAttribI4i = (C.GPVERTEXATTRIBI4I)(getProcAddr(\"glVertexAttribI4i\"))\n\tif gpVertexAttribI4i == nil {\n\t\treturn errors.New(\"glVertexAttribI4i\")\n\t}\n\tgpVertexAttribI4iEXT = (C.GPVERTEXATTRIBI4IEXT)(getProcAddr(\"glVertexAttribI4iEXT\"))\n\tgpVertexAttribI4iv = (C.GPVERTEXATTRIBI4IV)(getProcAddr(\"glVertexAttribI4iv\"))\n\tif gpVertexAttribI4iv == nil {\n\t\treturn errors.New(\"glVertexAttribI4iv\")\n\t}\n\tgpVertexAttribI4ivEXT = (C.GPVERTEXATTRIBI4IVEXT)(getProcAddr(\"glVertexAttribI4ivEXT\"))\n\tgpVertexAttribI4sv = (C.GPVERTEXATTRIBI4SV)(getProcAddr(\"glVertexAttribI4sv\"))\n\tif gpVertexAttribI4sv == nil {\n\t\treturn errors.New(\"glVertexAttribI4sv\")\n\t}\n\tgpVertexAttribI4svEXT = (C.GPVERTEXATTRIBI4SVEXT)(getProcAddr(\"glVertexAttribI4svEXT\"))\n\tgpVertexAttribI4ubv = (C.GPVERTEXATTRIBI4UBV)(getProcAddr(\"glVertexAttribI4ubv\"))\n\tif gpVertexAttribI4ubv == nil {\n\t\treturn errors.New(\"glVertexAttribI4ubv\")\n\t}\n\tgpVertexAttribI4ubvEXT = (C.GPVERTEXATTRIBI4UBVEXT)(getProcAddr(\"glVertexAttribI4ubvEXT\"))\n\tgpVertexAttribI4ui = (C.GPVERTEXATTRIBI4UI)(getProcAddr(\"glVertexAttribI4ui\"))\n\tif gpVertexAttribI4ui == nil {\n\t\treturn errors.New(\"glVertexAttribI4ui\")\n\t}\n\tgpVertexAttribI4uiEXT = (C.GPVERTEXATTRIBI4UIEXT)(getProcAddr(\"glVertexAttribI4uiEXT\"))\n\tgpVertexAttribI4uiv = (C.GPVERTEXATTRIBI4UIV)(getProcAddr(\"glVertexAttribI4uiv\"))\n\tif gpVertexAttribI4uiv == nil {\n\t\treturn errors.New(\"glVertexAttribI4uiv\")\n\t}\n\tgpVertexAttribI4uivEXT = (C.GPVERTEXATTRIBI4UIVEXT)(getProcAddr(\"glVertexAttribI4uivEXT\"))\n\tgpVertexAttribI4usv = (C.GPVERTEXATTRIBI4USV)(getProcAddr(\"glVertexAttribI4usv\"))\n\tif gpVertexAttribI4usv == nil {\n\t\treturn errors.New(\"glVertexAttribI4usv\")\n\t}\n\tgpVertexAttribI4usvEXT = (C.GPVERTEXATTRIBI4USVEXT)(getProcAddr(\"glVertexAttribI4usvEXT\"))\n\tgpVertexAttribIFormat = (C.GPVERTEXATTRIBIFORMAT)(getProcAddr(\"glVertexAttribIFormat\"))\n\tif gpVertexAttribIFormat == nil {\n\t\treturn errors.New(\"glVertexAttribIFormat\")\n\t}\n\tgpVertexAttribIFormatNV = (C.GPVERTEXATTRIBIFORMATNV)(getProcAddr(\"glVertexAttribIFormatNV\"))\n\tgpVertexAttribIPointer = (C.GPVERTEXATTRIBIPOINTER)(getProcAddr(\"glVertexAttribIPointer\"))\n\tif gpVertexAttribIPointer == nil {\n\t\treturn errors.New(\"glVertexAttribIPointer\")\n\t}\n\tgpVertexAttribIPointerEXT = (C.GPVERTEXATTRIBIPOINTEREXT)(getProcAddr(\"glVertexAttribIPointerEXT\"))\n\tgpVertexAttribL1d = (C.GPVERTEXATTRIBL1D)(getProcAddr(\"glVertexAttribL1d\"))\n\tif gpVertexAttribL1d == nil {\n\t\treturn errors.New(\"glVertexAttribL1d\")\n\t}\n\tgpVertexAttribL1dEXT = (C.GPVERTEXATTRIBL1DEXT)(getProcAddr(\"glVertexAttribL1dEXT\"))\n\tgpVertexAttribL1dv = (C.GPVERTEXATTRIBL1DV)(getProcAddr(\"glVertexAttribL1dv\"))\n\tif gpVertexAttribL1dv == nil {\n\t\treturn errors.New(\"glVertexAttribL1dv\")\n\t}\n\tgpVertexAttribL1dvEXT = (C.GPVERTEXATTRIBL1DVEXT)(getProcAddr(\"glVertexAttribL1dvEXT\"))\n\tgpVertexAttribL1i64NV = (C.GPVERTEXATTRIBL1I64NV)(getProcAddr(\"glVertexAttribL1i64NV\"))\n\tgpVertexAttribL1i64vNV = (C.GPVERTEXATTRIBL1I64VNV)(getProcAddr(\"glVertexAttribL1i64vNV\"))\n\tgpVertexAttribL1ui64ARB = (C.GPVERTEXATTRIBL1UI64ARB)(getProcAddr(\"glVertexAttribL1ui64ARB\"))\n\tgpVertexAttribL1ui64NV = (C.GPVERTEXATTRIBL1UI64NV)(getProcAddr(\"glVertexAttribL1ui64NV\"))\n\tgpVertexAttribL1ui64vARB = (C.GPVERTEXATTRIBL1UI64VARB)(getProcAddr(\"glVertexAttribL1ui64vARB\"))\n\tgpVertexAttribL1ui64vNV = (C.GPVERTEXATTRIBL1UI64VNV)(getProcAddr(\"glVertexAttribL1ui64vNV\"))\n\tgpVertexAttribL2d = (C.GPVERTEXATTRIBL2D)(getProcAddr(\"glVertexAttribL2d\"))\n\tif gpVertexAttribL2d == nil {\n\t\treturn errors.New(\"glVertexAttribL2d\")\n\t}\n\tgpVertexAttribL2dEXT = (C.GPVERTEXATTRIBL2DEXT)(getProcAddr(\"glVertexAttribL2dEXT\"))\n\tgpVertexAttribL2dv = (C.GPVERTEXATTRIBL2DV)(getProcAddr(\"glVertexAttribL2dv\"))\n\tif gpVertexAttribL2dv == nil {\n\t\treturn errors.New(\"glVertexAttribL2dv\")\n\t}\n\tgpVertexAttribL2dvEXT = (C.GPVERTEXATTRIBL2DVEXT)(getProcAddr(\"glVertexAttribL2dvEXT\"))\n\tgpVertexAttribL2i64NV = (C.GPVERTEXATTRIBL2I64NV)(getProcAddr(\"glVertexAttribL2i64NV\"))\n\tgpVertexAttribL2i64vNV = (C.GPVERTEXATTRIBL2I64VNV)(getProcAddr(\"glVertexAttribL2i64vNV\"))\n\tgpVertexAttribL2ui64NV = (C.GPVERTEXATTRIBL2UI64NV)(getProcAddr(\"glVertexAttribL2ui64NV\"))\n\tgpVertexAttribL2ui64vNV = (C.GPVERTEXATTRIBL2UI64VNV)(getProcAddr(\"glVertexAttribL2ui64vNV\"))\n\tgpVertexAttribL3d = (C.GPVERTEXATTRIBL3D)(getProcAddr(\"glVertexAttribL3d\"))\n\tif gpVertexAttribL3d == nil {\n\t\treturn errors.New(\"glVertexAttribL3d\")\n\t}\n\tgpVertexAttribL3dEXT = (C.GPVERTEXATTRIBL3DEXT)(getProcAddr(\"glVertexAttribL3dEXT\"))\n\tgpVertexAttribL3dv = (C.GPVERTEXATTRIBL3DV)(getProcAddr(\"glVertexAttribL3dv\"))\n\tif gpVertexAttribL3dv == nil {\n\t\treturn errors.New(\"glVertexAttribL3dv\")\n\t}\n\tgpVertexAttribL3dvEXT = (C.GPVERTEXATTRIBL3DVEXT)(getProcAddr(\"glVertexAttribL3dvEXT\"))\n\tgpVertexAttribL3i64NV = (C.GPVERTEXATTRIBL3I64NV)(getProcAddr(\"glVertexAttribL3i64NV\"))\n\tgpVertexAttribL3i64vNV = (C.GPVERTEXATTRIBL3I64VNV)(getProcAddr(\"glVertexAttribL3i64vNV\"))\n\tgpVertexAttribL3ui64NV = (C.GPVERTEXATTRIBL3UI64NV)(getProcAddr(\"glVertexAttribL3ui64NV\"))\n\tgpVertexAttribL3ui64vNV = (C.GPVERTEXATTRIBL3UI64VNV)(getProcAddr(\"glVertexAttribL3ui64vNV\"))\n\tgpVertexAttribL4d = (C.GPVERTEXATTRIBL4D)(getProcAddr(\"glVertexAttribL4d\"))\n\tif gpVertexAttribL4d == nil {\n\t\treturn errors.New(\"glVertexAttribL4d\")\n\t}\n\tgpVertexAttribL4dEXT = (C.GPVERTEXATTRIBL4DEXT)(getProcAddr(\"glVertexAttribL4dEXT\"))\n\tgpVertexAttribL4dv = (C.GPVERTEXATTRIBL4DV)(getProcAddr(\"glVertexAttribL4dv\"))\n\tif gpVertexAttribL4dv == nil {\n\t\treturn errors.New(\"glVertexAttribL4dv\")\n\t}\n\tgpVertexAttribL4dvEXT = (C.GPVERTEXATTRIBL4DVEXT)(getProcAddr(\"glVertexAttribL4dvEXT\"))\n\tgpVertexAttribL4i64NV = (C.GPVERTEXATTRIBL4I64NV)(getProcAddr(\"glVertexAttribL4i64NV\"))\n\tgpVertexAttribL4i64vNV = (C.GPVERTEXATTRIBL4I64VNV)(getProcAddr(\"glVertexAttribL4i64vNV\"))\n\tgpVertexAttribL4ui64NV = (C.GPVERTEXATTRIBL4UI64NV)(getProcAddr(\"glVertexAttribL4ui64NV\"))\n\tgpVertexAttribL4ui64vNV = (C.GPVERTEXATTRIBL4UI64VNV)(getProcAddr(\"glVertexAttribL4ui64vNV\"))\n\tgpVertexAttribLFormat = (C.GPVERTEXATTRIBLFORMAT)(getProcAddr(\"glVertexAttribLFormat\"))\n\tif gpVertexAttribLFormat == nil {\n\t\treturn errors.New(\"glVertexAttribLFormat\")\n\t}\n\tgpVertexAttribLFormatNV = (C.GPVERTEXATTRIBLFORMATNV)(getProcAddr(\"glVertexAttribLFormatNV\"))\n\tgpVertexAttribLPointer = (C.GPVERTEXATTRIBLPOINTER)(getProcAddr(\"glVertexAttribLPointer\"))\n\tif gpVertexAttribLPointer == nil {\n\t\treturn errors.New(\"glVertexAttribLPointer\")\n\t}\n\tgpVertexAttribLPointerEXT = (C.GPVERTEXATTRIBLPOINTEREXT)(getProcAddr(\"glVertexAttribLPointerEXT\"))\n\tgpVertexAttribP1ui = (C.GPVERTEXATTRIBP1UI)(getProcAddr(\"glVertexAttribP1ui\"))\n\tif gpVertexAttribP1ui == nil {\n\t\treturn errors.New(\"glVertexAttribP1ui\")\n\t}\n\tgpVertexAttribP1uiv = (C.GPVERTEXATTRIBP1UIV)(getProcAddr(\"glVertexAttribP1uiv\"))\n\tif gpVertexAttribP1uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP1uiv\")\n\t}\n\tgpVertexAttribP2ui = (C.GPVERTEXATTRIBP2UI)(getProcAddr(\"glVertexAttribP2ui\"))\n\tif gpVertexAttribP2ui == nil {\n\t\treturn errors.New(\"glVertexAttribP2ui\")\n\t}\n\tgpVertexAttribP2uiv = (C.GPVERTEXATTRIBP2UIV)(getProcAddr(\"glVertexAttribP2uiv\"))\n\tif gpVertexAttribP2uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP2uiv\")\n\t}\n\tgpVertexAttribP3ui = (C.GPVERTEXATTRIBP3UI)(getProcAddr(\"glVertexAttribP3ui\"))\n\tif gpVertexAttribP3ui == nil {\n\t\treturn errors.New(\"glVertexAttribP3ui\")\n\t}\n\tgpVertexAttribP3uiv = (C.GPVERTEXATTRIBP3UIV)(getProcAddr(\"glVertexAttribP3uiv\"))\n\tif gpVertexAttribP3uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP3uiv\")\n\t}\n\tgpVertexAttribP4ui = (C.GPVERTEXATTRIBP4UI)(getProcAddr(\"glVertexAttribP4ui\"))\n\tif gpVertexAttribP4ui == nil {\n\t\treturn errors.New(\"glVertexAttribP4ui\")\n\t}\n\tgpVertexAttribP4uiv = (C.GPVERTEXATTRIBP4UIV)(getProcAddr(\"glVertexAttribP4uiv\"))\n\tif gpVertexAttribP4uiv == nil {\n\t\treturn errors.New(\"glVertexAttribP4uiv\")\n\t}\n\tgpVertexAttribParameteriAMD = (C.GPVERTEXATTRIBPARAMETERIAMD)(getProcAddr(\"glVertexAttribParameteriAMD\"))\n\tgpVertexAttribPointer = (C.GPVERTEXATTRIBPOINTER)(getProcAddr(\"glVertexAttribPointer\"))\n\tif gpVertexAttribPointer == nil {\n\t\treturn errors.New(\"glVertexAttribPointer\")\n\t}\n\tgpVertexAttribPointerARB = (C.GPVERTEXATTRIBPOINTERARB)(getProcAddr(\"glVertexAttribPointerARB\"))\n\tgpVertexAttribPointerNV = (C.GPVERTEXATTRIBPOINTERNV)(getProcAddr(\"glVertexAttribPointerNV\"))\n\tgpVertexAttribs1dvNV = (C.GPVERTEXATTRIBS1DVNV)(getProcAddr(\"glVertexAttribs1dvNV\"))\n\tgpVertexAttribs1fvNV = (C.GPVERTEXATTRIBS1FVNV)(getProcAddr(\"glVertexAttribs1fvNV\"))\n\tgpVertexAttribs1hvNV = (C.GPVERTEXATTRIBS1HVNV)(getProcAddr(\"glVertexAttribs1hvNV\"))\n\tgpVertexAttribs1svNV = (C.GPVERTEXATTRIBS1SVNV)(getProcAddr(\"glVertexAttribs1svNV\"))\n\tgpVertexAttribs2dvNV = (C.GPVERTEXATTRIBS2DVNV)(getProcAddr(\"glVertexAttribs2dvNV\"))\n\tgpVertexAttribs2fvNV = (C.GPVERTEXATTRIBS2FVNV)(getProcAddr(\"glVertexAttribs2fvNV\"))\n\tgpVertexAttribs2hvNV = (C.GPVERTEXATTRIBS2HVNV)(getProcAddr(\"glVertexAttribs2hvNV\"))\n\tgpVertexAttribs2svNV = (C.GPVERTEXATTRIBS2SVNV)(getProcAddr(\"glVertexAttribs2svNV\"))\n\tgpVertexAttribs3dvNV = (C.GPVERTEXATTRIBS3DVNV)(getProcAddr(\"glVertexAttribs3dvNV\"))\n\tgpVertexAttribs3fvNV = (C.GPVERTEXATTRIBS3FVNV)(getProcAddr(\"glVertexAttribs3fvNV\"))\n\tgpVertexAttribs3hvNV = (C.GPVERTEXATTRIBS3HVNV)(getProcAddr(\"glVertexAttribs3hvNV\"))\n\tgpVertexAttribs3svNV = (C.GPVERTEXATTRIBS3SVNV)(getProcAddr(\"glVertexAttribs3svNV\"))\n\tgpVertexAttribs4dvNV = (C.GPVERTEXATTRIBS4DVNV)(getProcAddr(\"glVertexAttribs4dvNV\"))\n\tgpVertexAttribs4fvNV = (C.GPVERTEXATTRIBS4FVNV)(getProcAddr(\"glVertexAttribs4fvNV\"))\n\tgpVertexAttribs4hvNV = (C.GPVERTEXATTRIBS4HVNV)(getProcAddr(\"glVertexAttribs4hvNV\"))\n\tgpVertexAttribs4svNV = (C.GPVERTEXATTRIBS4SVNV)(getProcAddr(\"glVertexAttribs4svNV\"))\n\tgpVertexAttribs4ubvNV = (C.GPVERTEXATTRIBS4UBVNV)(getProcAddr(\"glVertexAttribs4ubvNV\"))\n\tgpVertexBindingDivisor = (C.GPVERTEXBINDINGDIVISOR)(getProcAddr(\"glVertexBindingDivisor\"))\n\tif gpVertexBindingDivisor == nil {\n\t\treturn errors.New(\"glVertexBindingDivisor\")\n\t}\n\tgpVertexBlendARB = (C.GPVERTEXBLENDARB)(getProcAddr(\"glVertexBlendARB\"))\n\tgpVertexBlendEnvfATI = (C.GPVERTEXBLENDENVFATI)(getProcAddr(\"glVertexBlendEnvfATI\"))\n\tgpVertexBlendEnviATI = (C.GPVERTEXBLENDENVIATI)(getProcAddr(\"glVertexBlendEnviATI\"))\n\tgpVertexFormatNV = (C.GPVERTEXFORMATNV)(getProcAddr(\"glVertexFormatNV\"))\n\tgpVertexP2ui = (C.GPVERTEXP2UI)(getProcAddr(\"glVertexP2ui\"))\n\tif gpVertexP2ui == nil {\n\t\treturn errors.New(\"glVertexP2ui\")\n\t}\n\tgpVertexP2uiv = (C.GPVERTEXP2UIV)(getProcAddr(\"glVertexP2uiv\"))\n\tif gpVertexP2uiv == nil {\n\t\treturn errors.New(\"glVertexP2uiv\")\n\t}\n\tgpVertexP3ui = (C.GPVERTEXP3UI)(getProcAddr(\"glVertexP3ui\"))\n\tif gpVertexP3ui == nil {\n\t\treturn errors.New(\"glVertexP3ui\")\n\t}\n\tgpVertexP3uiv = (C.GPVERTEXP3UIV)(getProcAddr(\"glVertexP3uiv\"))\n\tif gpVertexP3uiv == nil {\n\t\treturn errors.New(\"glVertexP3uiv\")\n\t}\n\tgpVertexP4ui = (C.GPVERTEXP4UI)(getProcAddr(\"glVertexP4ui\"))\n\tif gpVertexP4ui == nil {\n\t\treturn errors.New(\"glVertexP4ui\")\n\t}\n\tgpVertexP4uiv = (C.GPVERTEXP4UIV)(getProcAddr(\"glVertexP4uiv\"))\n\tif gpVertexP4uiv == nil {\n\t\treturn errors.New(\"glVertexP4uiv\")\n\t}\n\tgpVertexPointer = (C.GPVERTEXPOINTER)(getProcAddr(\"glVertexPointer\"))\n\tif gpVertexPointer == nil {\n\t\treturn errors.New(\"glVertexPointer\")\n\t}\n\tgpVertexPointerEXT = (C.GPVERTEXPOINTEREXT)(getProcAddr(\"glVertexPointerEXT\"))\n\tgpVertexPointerListIBM = (C.GPVERTEXPOINTERLISTIBM)(getProcAddr(\"glVertexPointerListIBM\"))\n\tgpVertexPointervINTEL = (C.GPVERTEXPOINTERVINTEL)(getProcAddr(\"glVertexPointervINTEL\"))\n\tgpVertexStream1dATI = (C.GPVERTEXSTREAM1DATI)(getProcAddr(\"glVertexStream1dATI\"))\n\tgpVertexStream1dvATI = (C.GPVERTEXSTREAM1DVATI)(getProcAddr(\"glVertexStream1dvATI\"))\n\tgpVertexStream1fATI = (C.GPVERTEXSTREAM1FATI)(getProcAddr(\"glVertexStream1fATI\"))\n\tgpVertexStream1fvATI = (C.GPVERTEXSTREAM1FVATI)(getProcAddr(\"glVertexStream1fvATI\"))\n\tgpVertexStream1iATI = (C.GPVERTEXSTREAM1IATI)(getProcAddr(\"glVertexStream1iATI\"))\n\tgpVertexStream1ivATI = (C.GPVERTEXSTREAM1IVATI)(getProcAddr(\"glVertexStream1ivATI\"))\n\tgpVertexStream1sATI = (C.GPVERTEXSTREAM1SATI)(getProcAddr(\"glVertexStream1sATI\"))\n\tgpVertexStream1svATI = (C.GPVERTEXSTREAM1SVATI)(getProcAddr(\"glVertexStream1svATI\"))\n\tgpVertexStream2dATI = (C.GPVERTEXSTREAM2DATI)(getProcAddr(\"glVertexStream2dATI\"))\n\tgpVertexStream2dvATI = (C.GPVERTEXSTREAM2DVATI)(getProcAddr(\"glVertexStream2dvATI\"))\n\tgpVertexStream2fATI = (C.GPVERTEXSTREAM2FATI)(getProcAddr(\"glVertexStream2fATI\"))\n\tgpVertexStream2fvATI = (C.GPVERTEXSTREAM2FVATI)(getProcAddr(\"glVertexStream2fvATI\"))\n\tgpVertexStream2iATI = (C.GPVERTEXSTREAM2IATI)(getProcAddr(\"glVertexStream2iATI\"))\n\tgpVertexStream2ivATI = (C.GPVERTEXSTREAM2IVATI)(getProcAddr(\"glVertexStream2ivATI\"))\n\tgpVertexStream2sATI = (C.GPVERTEXSTREAM2SATI)(getProcAddr(\"glVertexStream2sATI\"))\n\tgpVertexStream2svATI = (C.GPVERTEXSTREAM2SVATI)(getProcAddr(\"glVertexStream2svATI\"))\n\tgpVertexStream3dATI = (C.GPVERTEXSTREAM3DATI)(getProcAddr(\"glVertexStream3dATI\"))\n\tgpVertexStream3dvATI = (C.GPVERTEXSTREAM3DVATI)(getProcAddr(\"glVertexStream3dvATI\"))\n\tgpVertexStream3fATI = (C.GPVERTEXSTREAM3FATI)(getProcAddr(\"glVertexStream3fATI\"))\n\tgpVertexStream3fvATI = (C.GPVERTEXSTREAM3FVATI)(getProcAddr(\"glVertexStream3fvATI\"))\n\tgpVertexStream3iATI = (C.GPVERTEXSTREAM3IATI)(getProcAddr(\"glVertexStream3iATI\"))\n\tgpVertexStream3ivATI = (C.GPVERTEXSTREAM3IVATI)(getProcAddr(\"glVertexStream3ivATI\"))\n\tgpVertexStream3sATI = (C.GPVERTEXSTREAM3SATI)(getProcAddr(\"glVertexStream3sATI\"))\n\tgpVertexStream3svATI = (C.GPVERTEXSTREAM3SVATI)(getProcAddr(\"glVertexStream3svATI\"))\n\tgpVertexStream4dATI = (C.GPVERTEXSTREAM4DATI)(getProcAddr(\"glVertexStream4dATI\"))\n\tgpVertexStream4dvATI = (C.GPVERTEXSTREAM4DVATI)(getProcAddr(\"glVertexStream4dvATI\"))\n\tgpVertexStream4fATI = (C.GPVERTEXSTREAM4FATI)(getProcAddr(\"glVertexStream4fATI\"))\n\tgpVertexStream4fvATI = (C.GPVERTEXSTREAM4FVATI)(getProcAddr(\"glVertexStream4fvATI\"))\n\tgpVertexStream4iATI = (C.GPVERTEXSTREAM4IATI)(getProcAddr(\"glVertexStream4iATI\"))\n\tgpVertexStream4ivATI = (C.GPVERTEXSTREAM4IVATI)(getProcAddr(\"glVertexStream4ivATI\"))\n\tgpVertexStream4sATI = (C.GPVERTEXSTREAM4SATI)(getProcAddr(\"glVertexStream4sATI\"))\n\tgpVertexStream4svATI = (C.GPVERTEXSTREAM4SVATI)(getProcAddr(\"glVertexStream4svATI\"))\n\tgpVertexWeightPointerEXT = (C.GPVERTEXWEIGHTPOINTEREXT)(getProcAddr(\"glVertexWeightPointerEXT\"))\n\tgpVertexWeightfEXT = (C.GPVERTEXWEIGHTFEXT)(getProcAddr(\"glVertexWeightfEXT\"))\n\tgpVertexWeightfvEXT = (C.GPVERTEXWEIGHTFVEXT)(getProcAddr(\"glVertexWeightfvEXT\"))\n\tgpVertexWeighthNV = (C.GPVERTEXWEIGHTHNV)(getProcAddr(\"glVertexWeighthNV\"))\n\tgpVertexWeighthvNV = (C.GPVERTEXWEIGHTHVNV)(getProcAddr(\"glVertexWeighthvNV\"))\n\tgpVideoCaptureNV = (C.GPVIDEOCAPTURENV)(getProcAddr(\"glVideoCaptureNV\"))\n\tgpVideoCaptureStreamParameterdvNV = (C.GPVIDEOCAPTURESTREAMPARAMETERDVNV)(getProcAddr(\"glVideoCaptureStreamParameterdvNV\"))\n\tgpVideoCaptureStreamParameterfvNV = (C.GPVIDEOCAPTURESTREAMPARAMETERFVNV)(getProcAddr(\"glVideoCaptureStreamParameterfvNV\"))\n\tgpVideoCaptureStreamParameterivNV = (C.GPVIDEOCAPTURESTREAMPARAMETERIVNV)(getProcAddr(\"glVideoCaptureStreamParameterivNV\"))\n\tgpViewport = (C.GPVIEWPORT)(getProcAddr(\"glViewport\"))\n\tif gpViewport == nil {\n\t\treturn errors.New(\"glViewport\")\n\t}\n\tgpViewportArrayv = (C.GPVIEWPORTARRAYV)(getProcAddr(\"glViewportArrayv\"))\n\tif gpViewportArrayv == nil {\n\t\treturn errors.New(\"glViewportArrayv\")\n\t}\n\tgpViewportIndexedf = (C.GPVIEWPORTINDEXEDF)(getProcAddr(\"glViewportIndexedf\"))\n\tif gpViewportIndexedf == nil {\n\t\treturn errors.New(\"glViewportIndexedf\")\n\t}\n\tgpViewportIndexedfv = (C.GPVIEWPORTINDEXEDFV)(getProcAddr(\"glViewportIndexedfv\"))\n\tif gpViewportIndexedfv == nil {\n\t\treturn errors.New(\"glViewportIndexedfv\")\n\t}\n\tgpViewportPositionWScaleNV = (C.GPVIEWPORTPOSITIONWSCALENV)(getProcAddr(\"glViewportPositionWScaleNV\"))\n\tgpViewportSwizzleNV = (C.GPVIEWPORTSWIZZLENV)(getProcAddr(\"glViewportSwizzleNV\"))\n\tgpWaitSemaphoreEXT = (C.GPWAITSEMAPHOREEXT)(getProcAddr(\"glWaitSemaphoreEXT\"))\n\tgpWaitSemaphoreui64NVX = (C.GPWAITSEMAPHOREUI64NVX)(getProcAddr(\"glWaitSemaphoreui64NVX\"))\n\tgpWaitSync = (C.GPWAITSYNC)(getProcAddr(\"glWaitSync\"))\n\tif gpWaitSync == nil {\n\t\treturn errors.New(\"glWaitSync\")\n\t}\n\tgpWaitVkSemaphoreNV = (C.GPWAITVKSEMAPHORENV)(getProcAddr(\"glWaitVkSemaphoreNV\"))\n\tgpWeightPathsNV = (C.GPWEIGHTPATHSNV)(getProcAddr(\"glWeightPathsNV\"))\n\tgpWeightPointerARB = (C.GPWEIGHTPOINTERARB)(getProcAddr(\"glWeightPointerARB\"))\n\tgpWeightbvARB = (C.GPWEIGHTBVARB)(getProcAddr(\"glWeightbvARB\"))\n\tgpWeightdvARB = (C.GPWEIGHTDVARB)(getProcAddr(\"glWeightdvARB\"))\n\tgpWeightfvARB = (C.GPWEIGHTFVARB)(getProcAddr(\"glWeightfvARB\"))\n\tgpWeightivARB = (C.GPWEIGHTIVARB)(getProcAddr(\"glWeightivARB\"))\n\tgpWeightsvARB = (C.GPWEIGHTSVARB)(getProcAddr(\"glWeightsvARB\"))\n\tgpWeightubvARB = (C.GPWEIGHTUBVARB)(getProcAddr(\"glWeightubvARB\"))\n\tgpWeightuivARB = (C.GPWEIGHTUIVARB)(getProcAddr(\"glWeightuivARB\"))\n\tgpWeightusvARB = (C.GPWEIGHTUSVARB)(getProcAddr(\"glWeightusvARB\"))\n\tgpWindowPos2d = (C.GPWINDOWPOS2D)(getProcAddr(\"glWindowPos2d\"))\n\tif gpWindowPos2d == nil {\n\t\treturn errors.New(\"glWindowPos2d\")\n\t}\n\tgpWindowPos2dARB = (C.GPWINDOWPOS2DARB)(getProcAddr(\"glWindowPos2dARB\"))\n\tgpWindowPos2dMESA = (C.GPWINDOWPOS2DMESA)(getProcAddr(\"glWindowPos2dMESA\"))\n\tgpWindowPos2dv = (C.GPWINDOWPOS2DV)(getProcAddr(\"glWindowPos2dv\"))\n\tif gpWindowPos2dv == nil {\n\t\treturn errors.New(\"glWindowPos2dv\")\n\t}\n\tgpWindowPos2dvARB = (C.GPWINDOWPOS2DVARB)(getProcAddr(\"glWindowPos2dvARB\"))\n\tgpWindowPos2dvMESA = (C.GPWINDOWPOS2DVMESA)(getProcAddr(\"glWindowPos2dvMESA\"))\n\tgpWindowPos2f = (C.GPWINDOWPOS2F)(getProcAddr(\"glWindowPos2f\"))\n\tif gpWindowPos2f == nil {\n\t\treturn errors.New(\"glWindowPos2f\")\n\t}\n\tgpWindowPos2fARB = (C.GPWINDOWPOS2FARB)(getProcAddr(\"glWindowPos2fARB\"))\n\tgpWindowPos2fMESA = (C.GPWINDOWPOS2FMESA)(getProcAddr(\"glWindowPos2fMESA\"))\n\tgpWindowPos2fv = (C.GPWINDOWPOS2FV)(getProcAddr(\"glWindowPos2fv\"))\n\tif gpWindowPos2fv == nil {\n\t\treturn errors.New(\"glWindowPos2fv\")\n\t}\n\tgpWindowPos2fvARB = (C.GPWINDOWPOS2FVARB)(getProcAddr(\"glWindowPos2fvARB\"))\n\tgpWindowPos2fvMESA = (C.GPWINDOWPOS2FVMESA)(getProcAddr(\"glWindowPos2fvMESA\"))\n\tgpWindowPos2i = (C.GPWINDOWPOS2I)(getProcAddr(\"glWindowPos2i\"))\n\tif gpWindowPos2i == nil {\n\t\treturn errors.New(\"glWindowPos2i\")\n\t}\n\tgpWindowPos2iARB = (C.GPWINDOWPOS2IARB)(getProcAddr(\"glWindowPos2iARB\"))\n\tgpWindowPos2iMESA = (C.GPWINDOWPOS2IMESA)(getProcAddr(\"glWindowPos2iMESA\"))\n\tgpWindowPos2iv = (C.GPWINDOWPOS2IV)(getProcAddr(\"glWindowPos2iv\"))\n\tif gpWindowPos2iv == nil {\n\t\treturn errors.New(\"glWindowPos2iv\")\n\t}\n\tgpWindowPos2ivARB = (C.GPWINDOWPOS2IVARB)(getProcAddr(\"glWindowPos2ivARB\"))\n\tgpWindowPos2ivMESA = (C.GPWINDOWPOS2IVMESA)(getProcAddr(\"glWindowPos2ivMESA\"))\n\tgpWindowPos2s = (C.GPWINDOWPOS2S)(getProcAddr(\"glWindowPos2s\"))\n\tif gpWindowPos2s == nil {\n\t\treturn errors.New(\"glWindowPos2s\")\n\t}\n\tgpWindowPos2sARB = (C.GPWINDOWPOS2SARB)(getProcAddr(\"glWindowPos2sARB\"))\n\tgpWindowPos2sMESA = (C.GPWINDOWPOS2SMESA)(getProcAddr(\"glWindowPos2sMESA\"))\n\tgpWindowPos2sv = (C.GPWINDOWPOS2SV)(getProcAddr(\"glWindowPos2sv\"))\n\tif gpWindowPos2sv == nil {\n\t\treturn errors.New(\"glWindowPos2sv\")\n\t}\n\tgpWindowPos2svARB = (C.GPWINDOWPOS2SVARB)(getProcAddr(\"glWindowPos2svARB\"))\n\tgpWindowPos2svMESA = (C.GPWINDOWPOS2SVMESA)(getProcAddr(\"glWindowPos2svMESA\"))\n\tgpWindowPos3d = (C.GPWINDOWPOS3D)(getProcAddr(\"glWindowPos3d\"))\n\tif gpWindowPos3d == nil {\n\t\treturn errors.New(\"glWindowPos3d\")\n\t}\n\tgpWindowPos3dARB = (C.GPWINDOWPOS3DARB)(getProcAddr(\"glWindowPos3dARB\"))\n\tgpWindowPos3dMESA = (C.GPWINDOWPOS3DMESA)(getProcAddr(\"glWindowPos3dMESA\"))\n\tgpWindowPos3dv = (C.GPWINDOWPOS3DV)(getProcAddr(\"glWindowPos3dv\"))\n\tif gpWindowPos3dv == nil {\n\t\treturn errors.New(\"glWindowPos3dv\")\n\t}\n\tgpWindowPos3dvARB = (C.GPWINDOWPOS3DVARB)(getProcAddr(\"glWindowPos3dvARB\"))\n\tgpWindowPos3dvMESA = (C.GPWINDOWPOS3DVMESA)(getProcAddr(\"glWindowPos3dvMESA\"))\n\tgpWindowPos3f = (C.GPWINDOWPOS3F)(getProcAddr(\"glWindowPos3f\"))\n\tif gpWindowPos3f == nil {\n\t\treturn errors.New(\"glWindowPos3f\")\n\t}\n\tgpWindowPos3fARB = (C.GPWINDOWPOS3FARB)(getProcAddr(\"glWindowPos3fARB\"))\n\tgpWindowPos3fMESA = (C.GPWINDOWPOS3FMESA)(getProcAddr(\"glWindowPos3fMESA\"))\n\tgpWindowPos3fv = (C.GPWINDOWPOS3FV)(getProcAddr(\"glWindowPos3fv\"))\n\tif gpWindowPos3fv == nil {\n\t\treturn errors.New(\"glWindowPos3fv\")\n\t}\n\tgpWindowPos3fvARB = (C.GPWINDOWPOS3FVARB)(getProcAddr(\"glWindowPos3fvARB\"))\n\tgpWindowPos3fvMESA = (C.GPWINDOWPOS3FVMESA)(getProcAddr(\"glWindowPos3fvMESA\"))\n\tgpWindowPos3i = (C.GPWINDOWPOS3I)(getProcAddr(\"glWindowPos3i\"))\n\tif gpWindowPos3i == nil {\n\t\treturn errors.New(\"glWindowPos3i\")\n\t}\n\tgpWindowPos3iARB = (C.GPWINDOWPOS3IARB)(getProcAddr(\"glWindowPos3iARB\"))\n\tgpWindowPos3iMESA = (C.GPWINDOWPOS3IMESA)(getProcAddr(\"glWindowPos3iMESA\"))\n\tgpWindowPos3iv = (C.GPWINDOWPOS3IV)(getProcAddr(\"glWindowPos3iv\"))\n\tif gpWindowPos3iv == nil {\n\t\treturn errors.New(\"glWindowPos3iv\")\n\t}\n\tgpWindowPos3ivARB = (C.GPWINDOWPOS3IVARB)(getProcAddr(\"glWindowPos3ivARB\"))\n\tgpWindowPos3ivMESA = (C.GPWINDOWPOS3IVMESA)(getProcAddr(\"glWindowPos3ivMESA\"))\n\tgpWindowPos3s = (C.GPWINDOWPOS3S)(getProcAddr(\"glWindowPos3s\"))\n\tif gpWindowPos3s == nil {\n\t\treturn errors.New(\"glWindowPos3s\")\n\t}\n\tgpWindowPos3sARB = (C.GPWINDOWPOS3SARB)(getProcAddr(\"glWindowPos3sARB\"))\n\tgpWindowPos3sMESA = (C.GPWINDOWPOS3SMESA)(getProcAddr(\"glWindowPos3sMESA\"))\n\tgpWindowPos3sv = (C.GPWINDOWPOS3SV)(getProcAddr(\"glWindowPos3sv\"))\n\tif gpWindowPos3sv == nil {\n\t\treturn errors.New(\"glWindowPos3sv\")\n\t}\n\tgpWindowPos3svARB = (C.GPWINDOWPOS3SVARB)(getProcAddr(\"glWindowPos3svARB\"))\n\tgpWindowPos3svMESA = (C.GPWINDOWPOS3SVMESA)(getProcAddr(\"glWindowPos3svMESA\"))\n\tgpWindowPos4dMESA = (C.GPWINDOWPOS4DMESA)(getProcAddr(\"glWindowPos4dMESA\"))\n\tgpWindowPos4dvMESA = (C.GPWINDOWPOS4DVMESA)(getProcAddr(\"glWindowPos4dvMESA\"))\n\tgpWindowPos4fMESA = (C.GPWINDOWPOS4FMESA)(getProcAddr(\"glWindowPos4fMESA\"))\n\tgpWindowPos4fvMESA = (C.GPWINDOWPOS4FVMESA)(getProcAddr(\"glWindowPos4fvMESA\"))\n\tgpWindowPos4iMESA = (C.GPWINDOWPOS4IMESA)(getProcAddr(\"glWindowPos4iMESA\"))\n\tgpWindowPos4ivMESA = (C.GPWINDOWPOS4IVMESA)(getProcAddr(\"glWindowPos4ivMESA\"))\n\tgpWindowPos4sMESA = (C.GPWINDOWPOS4SMESA)(getProcAddr(\"glWindowPos4sMESA\"))\n\tgpWindowPos4svMESA = (C.GPWINDOWPOS4SVMESA)(getProcAddr(\"glWindowPos4svMESA\"))\n\tgpWindowRectanglesEXT = (C.GPWINDOWRECTANGLESEXT)(getProcAddr(\"glWindowRectanglesEXT\"))\n\tgpWriteMaskEXT = (C.GPWRITEMASKEXT)(getProcAddr(\"glWriteMaskEXT\"))\n\treturn nil\n}", "func (s *BasePlSqlParserListener) EnterLibrary_debug(ctx *Library_debugContext) {}", "func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {\n\tgpChoosePixelFormat = (C.GPCHOOSEPIXELFORMAT)(getProcAddr(\"ChoosePixelFormat\"))\n\tif gpChoosePixelFormat == nil {\n\t\treturn errors.New(\"ChoosePixelFormat\")\n\t}\n\tgpDescribePixelFormat = (C.GPDESCRIBEPIXELFORMAT)(getProcAddr(\"DescribePixelFormat\"))\n\tif gpDescribePixelFormat == nil {\n\t\treturn errors.New(\"DescribePixelFormat\")\n\t}\n\tgpGetEnhMetaFilePixelFormat = (C.GPGETENHMETAFILEPIXELFORMAT)(getProcAddr(\"GetEnhMetaFilePixelFormat\"))\n\tif gpGetEnhMetaFilePixelFormat == nil {\n\t\treturn errors.New(\"GetEnhMetaFilePixelFormat\")\n\t}\n\tgpGetPixelFormat = (C.GPGETPIXELFORMAT)(getProcAddr(\"GetPixelFormat\"))\n\tif gpGetPixelFormat == nil {\n\t\treturn errors.New(\"GetPixelFormat\")\n\t}\n\tgpSetPixelFormat = (C.GPSETPIXELFORMAT)(getProcAddr(\"SetPixelFormat\"))\n\tif gpSetPixelFormat == nil {\n\t\treturn errors.New(\"SetPixelFormat\")\n\t}\n\tgpSwapBuffers = (C.GPSWAPBUFFERS)(getProcAddr(\"SwapBuffers\"))\n\tif gpSwapBuffers == nil {\n\t\treturn errors.New(\"SwapBuffers\")\n\t}\n\tgpAllocateMemoryNV = (C.GPALLOCATEMEMORYNV)(getProcAddr(\"wglAllocateMemoryNV\"))\n\tgpAssociateImageBufferEventsI3D = (C.GPASSOCIATEIMAGEBUFFEREVENTSI3D)(getProcAddr(\"wglAssociateImageBufferEventsI3D\"))\n\tgpBeginFrameTrackingI3D = (C.GPBEGINFRAMETRACKINGI3D)(getProcAddr(\"wglBeginFrameTrackingI3D\"))\n\tgpBindDisplayColorTableEXT = (C.GPBINDDISPLAYCOLORTABLEEXT)(getProcAddr(\"wglBindDisplayColorTableEXT\"))\n\tgpBindSwapBarrierNV = (C.GPBINDSWAPBARRIERNV)(getProcAddr(\"wglBindSwapBarrierNV\"))\n\tgpBindTexImageARB = (C.GPBINDTEXIMAGEARB)(getProcAddr(\"wglBindTexImageARB\"))\n\tgpBindVideoCaptureDeviceNV = (C.GPBINDVIDEOCAPTUREDEVICENV)(getProcAddr(\"wglBindVideoCaptureDeviceNV\"))\n\tgpBindVideoDeviceNV = (C.GPBINDVIDEODEVICENV)(getProcAddr(\"wglBindVideoDeviceNV\"))\n\tgpBindVideoImageNV = (C.GPBINDVIDEOIMAGENV)(getProcAddr(\"wglBindVideoImageNV\"))\n\tgpBlitContextFramebufferAMD = (C.GPBLITCONTEXTFRAMEBUFFERAMD)(getProcAddr(\"wglBlitContextFramebufferAMD\"))\n\tgpChoosePixelFormatARB = (C.GPCHOOSEPIXELFORMATARB)(getProcAddr(\"wglChoosePixelFormatARB\"))\n\tgpChoosePixelFormatEXT = (C.GPCHOOSEPIXELFORMATEXT)(getProcAddr(\"wglChoosePixelFormatEXT\"))\n\tgpCopyContext = (C.GPCOPYCONTEXT)(getProcAddr(\"wglCopyContext\"))\n\tif gpCopyContext == nil {\n\t\treturn errors.New(\"wglCopyContext\")\n\t}\n\tgpCopyImageSubDataNV = (C.GPCOPYIMAGESUBDATANV)(getProcAddr(\"wglCopyImageSubDataNV\"))\n\tgpCreateAffinityDCNV = (C.GPCREATEAFFINITYDCNV)(getProcAddr(\"wglCreateAffinityDCNV\"))\n\tgpCreateAssociatedContextAMD = (C.GPCREATEASSOCIATEDCONTEXTAMD)(getProcAddr(\"wglCreateAssociatedContextAMD\"))\n\tgpCreateAssociatedContextAttribsAMD = (C.GPCREATEASSOCIATEDCONTEXTATTRIBSAMD)(getProcAddr(\"wglCreateAssociatedContextAttribsAMD\"))\n\tgpCreateBufferRegionARB = (C.GPCREATEBUFFERREGIONARB)(getProcAddr(\"wglCreateBufferRegionARB\"))\n\tgpCreateContext = (C.GPCREATECONTEXT)(getProcAddr(\"wglCreateContext\"))\n\tif gpCreateContext == nil {\n\t\treturn errors.New(\"wglCreateContext\")\n\t}\n\tgpCreateContextAttribsARB = (C.GPCREATECONTEXTATTRIBSARB)(getProcAddr(\"wglCreateContextAttribsARB\"))\n\tgpCreateDisplayColorTableEXT = (C.GPCREATEDISPLAYCOLORTABLEEXT)(getProcAddr(\"wglCreateDisplayColorTableEXT\"))\n\tgpCreateImageBufferI3D = (C.GPCREATEIMAGEBUFFERI3D)(getProcAddr(\"wglCreateImageBufferI3D\"))\n\tgpCreateLayerContext = (C.GPCREATELAYERCONTEXT)(getProcAddr(\"wglCreateLayerContext\"))\n\tif gpCreateLayerContext == nil {\n\t\treturn errors.New(\"wglCreateLayerContext\")\n\t}\n\tgpCreatePbufferARB = (C.GPCREATEPBUFFERARB)(getProcAddr(\"wglCreatePbufferARB\"))\n\tgpCreatePbufferEXT = (C.GPCREATEPBUFFEREXT)(getProcAddr(\"wglCreatePbufferEXT\"))\n\tgpDXCloseDeviceNV = (C.GPDXCLOSEDEVICENV)(getProcAddr(\"wglDXCloseDeviceNV\"))\n\tgpDXLockObjectsNV = (C.GPDXLOCKOBJECTSNV)(getProcAddr(\"wglDXLockObjectsNV\"))\n\tgpDXObjectAccessNV = (C.GPDXOBJECTACCESSNV)(getProcAddr(\"wglDXObjectAccessNV\"))\n\tgpDXOpenDeviceNV = (C.GPDXOPENDEVICENV)(getProcAddr(\"wglDXOpenDeviceNV\"))\n\tgpDXRegisterObjectNV = (C.GPDXREGISTEROBJECTNV)(getProcAddr(\"wglDXRegisterObjectNV\"))\n\tgpDXSetResourceShareHandleNV = (C.GPDXSETRESOURCESHAREHANDLENV)(getProcAddr(\"wglDXSetResourceShareHandleNV\"))\n\tgpDXUnlockObjectsNV = (C.GPDXUNLOCKOBJECTSNV)(getProcAddr(\"wglDXUnlockObjectsNV\"))\n\tgpDXUnregisterObjectNV = (C.GPDXUNREGISTEROBJECTNV)(getProcAddr(\"wglDXUnregisterObjectNV\"))\n\tgpDelayBeforeSwapNV = (C.GPDELAYBEFORESWAPNV)(getProcAddr(\"wglDelayBeforeSwapNV\"))\n\tgpDeleteAssociatedContextAMD = (C.GPDELETEASSOCIATEDCONTEXTAMD)(getProcAddr(\"wglDeleteAssociatedContextAMD\"))\n\tgpDeleteBufferRegionARB = (C.GPDELETEBUFFERREGIONARB)(getProcAddr(\"wglDeleteBufferRegionARB\"))\n\tgpDeleteContext = (C.GPDELETECONTEXT)(getProcAddr(\"wglDeleteContext\"))\n\tif gpDeleteContext == nil {\n\t\treturn errors.New(\"wglDeleteContext\")\n\t}\n\tgpDeleteDCNV = (C.GPDELETEDCNV)(getProcAddr(\"wglDeleteDCNV\"))\n\tgpDescribeLayerPlane = (C.GPDESCRIBELAYERPLANE)(getProcAddr(\"wglDescribeLayerPlane\"))\n\tif gpDescribeLayerPlane == nil {\n\t\treturn errors.New(\"wglDescribeLayerPlane\")\n\t}\n\tgpDestroyDisplayColorTableEXT = (C.GPDESTROYDISPLAYCOLORTABLEEXT)(getProcAddr(\"wglDestroyDisplayColorTableEXT\"))\n\tgpDestroyImageBufferI3D = (C.GPDESTROYIMAGEBUFFERI3D)(getProcAddr(\"wglDestroyImageBufferI3D\"))\n\tgpDestroyPbufferARB = (C.GPDESTROYPBUFFERARB)(getProcAddr(\"wglDestroyPbufferARB\"))\n\tgpDestroyPbufferEXT = (C.GPDESTROYPBUFFEREXT)(getProcAddr(\"wglDestroyPbufferEXT\"))\n\tgpDisableFrameLockI3D = (C.GPDISABLEFRAMELOCKI3D)(getProcAddr(\"wglDisableFrameLockI3D\"))\n\tgpDisableGenlockI3D = (C.GPDISABLEGENLOCKI3D)(getProcAddr(\"wglDisableGenlockI3D\"))\n\tgpEnableFrameLockI3D = (C.GPENABLEFRAMELOCKI3D)(getProcAddr(\"wglEnableFrameLockI3D\"))\n\tgpEnableGenlockI3D = (C.GPENABLEGENLOCKI3D)(getProcAddr(\"wglEnableGenlockI3D\"))\n\tgpEndFrameTrackingI3D = (C.GPENDFRAMETRACKINGI3D)(getProcAddr(\"wglEndFrameTrackingI3D\"))\n\tgpEnumGpuDevicesNV = (C.GPENUMGPUDEVICESNV)(getProcAddr(\"wglEnumGpuDevicesNV\"))\n\tgpEnumGpusFromAffinityDCNV = (C.GPENUMGPUSFROMAFFINITYDCNV)(getProcAddr(\"wglEnumGpusFromAffinityDCNV\"))\n\tgpEnumGpusNV = (C.GPENUMGPUSNV)(getProcAddr(\"wglEnumGpusNV\"))\n\tgpEnumerateVideoCaptureDevicesNV = (C.GPENUMERATEVIDEOCAPTUREDEVICESNV)(getProcAddr(\"wglEnumerateVideoCaptureDevicesNV\"))\n\tgpEnumerateVideoDevicesNV = (C.GPENUMERATEVIDEODEVICESNV)(getProcAddr(\"wglEnumerateVideoDevicesNV\"))\n\tgpFreeMemoryNV = (C.GPFREEMEMORYNV)(getProcAddr(\"wglFreeMemoryNV\"))\n\tgpGenlockSampleRateI3D = (C.GPGENLOCKSAMPLERATEI3D)(getProcAddr(\"wglGenlockSampleRateI3D\"))\n\tgpGenlockSourceDelayI3D = (C.GPGENLOCKSOURCEDELAYI3D)(getProcAddr(\"wglGenlockSourceDelayI3D\"))\n\tgpGenlockSourceEdgeI3D = (C.GPGENLOCKSOURCEEDGEI3D)(getProcAddr(\"wglGenlockSourceEdgeI3D\"))\n\tgpGenlockSourceI3D = (C.GPGENLOCKSOURCEI3D)(getProcAddr(\"wglGenlockSourceI3D\"))\n\tgpGetContextGPUIDAMD = (C.GPGETCONTEXTGPUIDAMD)(getProcAddr(\"wglGetContextGPUIDAMD\"))\n\tgpGetCurrentAssociatedContextAMD = (C.GPGETCURRENTASSOCIATEDCONTEXTAMD)(getProcAddr(\"wglGetCurrentAssociatedContextAMD\"))\n\tgpGetCurrentContext = (C.GPGETCURRENTCONTEXT)(getProcAddr(\"wglGetCurrentContext\"))\n\tif gpGetCurrentContext == nil {\n\t\treturn errors.New(\"wglGetCurrentContext\")\n\t}\n\tgpGetCurrentDC = (C.GPGETCURRENTDC)(getProcAddr(\"wglGetCurrentDC\"))\n\tif gpGetCurrentDC == nil {\n\t\treturn errors.New(\"wglGetCurrentDC\")\n\t}\n\tgpGetCurrentReadDCARB = (C.GPGETCURRENTREADDCARB)(getProcAddr(\"wglGetCurrentReadDCARB\"))\n\tgpGetCurrentReadDCEXT = (C.GPGETCURRENTREADDCEXT)(getProcAddr(\"wglGetCurrentReadDCEXT\"))\n\tgpGetDigitalVideoParametersI3D = (C.GPGETDIGITALVIDEOPARAMETERSI3D)(getProcAddr(\"wglGetDigitalVideoParametersI3D\"))\n\tgpGetExtensionsStringARB = (C.GPGETEXTENSIONSSTRINGARB)(getProcAddr(\"wglGetExtensionsStringARB\"))\n\tgpGetExtensionsStringEXT = (C.GPGETEXTENSIONSSTRINGEXT)(getProcAddr(\"wglGetExtensionsStringEXT\"))\n\tgpGetFrameUsageI3D = (C.GPGETFRAMEUSAGEI3D)(getProcAddr(\"wglGetFrameUsageI3D\"))\n\tgpGetGPUIDsAMD = (C.GPGETGPUIDSAMD)(getProcAddr(\"wglGetGPUIDsAMD\"))\n\tgpGetGPUInfoAMD = (C.GPGETGPUINFOAMD)(getProcAddr(\"wglGetGPUInfoAMD\"))\n\tgpGetGammaTableI3D = (C.GPGETGAMMATABLEI3D)(getProcAddr(\"wglGetGammaTableI3D\"))\n\tgpGetGammaTableParametersI3D = (C.GPGETGAMMATABLEPARAMETERSI3D)(getProcAddr(\"wglGetGammaTableParametersI3D\"))\n\tgpGetGenlockSampleRateI3D = (C.GPGETGENLOCKSAMPLERATEI3D)(getProcAddr(\"wglGetGenlockSampleRateI3D\"))\n\tgpGetGenlockSourceDelayI3D = (C.GPGETGENLOCKSOURCEDELAYI3D)(getProcAddr(\"wglGetGenlockSourceDelayI3D\"))\n\tgpGetGenlockSourceEdgeI3D = (C.GPGETGENLOCKSOURCEEDGEI3D)(getProcAddr(\"wglGetGenlockSourceEdgeI3D\"))\n\tgpGetGenlockSourceI3D = (C.GPGETGENLOCKSOURCEI3D)(getProcAddr(\"wglGetGenlockSourceI3D\"))\n\tgpGetLayerPaletteEntries = (C.GPGETLAYERPALETTEENTRIES)(getProcAddr(\"wglGetLayerPaletteEntries\"))\n\tif gpGetLayerPaletteEntries == nil {\n\t\treturn errors.New(\"wglGetLayerPaletteEntries\")\n\t}\n\tgpGetMscRateOML = (C.GPGETMSCRATEOML)(getProcAddr(\"wglGetMscRateOML\"))\n\tgpGetPbufferDCARB = (C.GPGETPBUFFERDCARB)(getProcAddr(\"wglGetPbufferDCARB\"))\n\tgpGetPbufferDCEXT = (C.GPGETPBUFFERDCEXT)(getProcAddr(\"wglGetPbufferDCEXT\"))\n\tgpGetPixelFormatAttribfvARB = (C.GPGETPIXELFORMATATTRIBFVARB)(getProcAddr(\"wglGetPixelFormatAttribfvARB\"))\n\tgpGetPixelFormatAttribfvEXT = (C.GPGETPIXELFORMATATTRIBFVEXT)(getProcAddr(\"wglGetPixelFormatAttribfvEXT\"))\n\tgpGetPixelFormatAttribivARB = (C.GPGETPIXELFORMATATTRIBIVARB)(getProcAddr(\"wglGetPixelFormatAttribivARB\"))\n\tgpGetPixelFormatAttribivEXT = (C.GPGETPIXELFORMATATTRIBIVEXT)(getProcAddr(\"wglGetPixelFormatAttribivEXT\"))\n\tgpGetProcAddress = (C.GPGETPROCADDRESS)(getProcAddr(\"wglGetProcAddress\"))\n\tif gpGetProcAddress == nil {\n\t\treturn errors.New(\"wglGetProcAddress\")\n\t}\n\tgpGetSwapIntervalEXT = (C.GPGETSWAPINTERVALEXT)(getProcAddr(\"wglGetSwapIntervalEXT\"))\n\tgpGetSyncValuesOML = (C.GPGETSYNCVALUESOML)(getProcAddr(\"wglGetSyncValuesOML\"))\n\tgpGetVideoDeviceNV = (C.GPGETVIDEODEVICENV)(getProcAddr(\"wglGetVideoDeviceNV\"))\n\tgpGetVideoInfoNV = (C.GPGETVIDEOINFONV)(getProcAddr(\"wglGetVideoInfoNV\"))\n\tgpIsEnabledFrameLockI3D = (C.GPISENABLEDFRAMELOCKI3D)(getProcAddr(\"wglIsEnabledFrameLockI3D\"))\n\tgpIsEnabledGenlockI3D = (C.GPISENABLEDGENLOCKI3D)(getProcAddr(\"wglIsEnabledGenlockI3D\"))\n\tgpJoinSwapGroupNV = (C.GPJOINSWAPGROUPNV)(getProcAddr(\"wglJoinSwapGroupNV\"))\n\tgpLoadDisplayColorTableEXT = (C.GPLOADDISPLAYCOLORTABLEEXT)(getProcAddr(\"wglLoadDisplayColorTableEXT\"))\n\tgpLockVideoCaptureDeviceNV = (C.GPLOCKVIDEOCAPTUREDEVICENV)(getProcAddr(\"wglLockVideoCaptureDeviceNV\"))\n\tgpMakeAssociatedContextCurrentAMD = (C.GPMAKEASSOCIATEDCONTEXTCURRENTAMD)(getProcAddr(\"wglMakeAssociatedContextCurrentAMD\"))\n\tgpMakeContextCurrentARB = (C.GPMAKECONTEXTCURRENTARB)(getProcAddr(\"wglMakeContextCurrentARB\"))\n\tgpMakeContextCurrentEXT = (C.GPMAKECONTEXTCURRENTEXT)(getProcAddr(\"wglMakeContextCurrentEXT\"))\n\tgpMakeCurrent = (C.GPMAKECURRENT)(getProcAddr(\"wglMakeCurrent\"))\n\tif gpMakeCurrent == nil {\n\t\treturn errors.New(\"wglMakeCurrent\")\n\t}\n\tgpQueryCurrentContextNV = (C.GPQUERYCURRENTCONTEXTNV)(getProcAddr(\"wglQueryCurrentContextNV\"))\n\tgpQueryFrameCountNV = (C.GPQUERYFRAMECOUNTNV)(getProcAddr(\"wglQueryFrameCountNV\"))\n\tgpQueryFrameLockMasterI3D = (C.GPQUERYFRAMELOCKMASTERI3D)(getProcAddr(\"wglQueryFrameLockMasterI3D\"))\n\tgpQueryFrameTrackingI3D = (C.GPQUERYFRAMETRACKINGI3D)(getProcAddr(\"wglQueryFrameTrackingI3D\"))\n\tgpQueryGenlockMaxSourceDelayI3D = (C.GPQUERYGENLOCKMAXSOURCEDELAYI3D)(getProcAddr(\"wglQueryGenlockMaxSourceDelayI3D\"))\n\tgpQueryMaxSwapGroupsNV = (C.GPQUERYMAXSWAPGROUPSNV)(getProcAddr(\"wglQueryMaxSwapGroupsNV\"))\n\tgpQueryPbufferARB = (C.GPQUERYPBUFFERARB)(getProcAddr(\"wglQueryPbufferARB\"))\n\tgpQueryPbufferEXT = (C.GPQUERYPBUFFEREXT)(getProcAddr(\"wglQueryPbufferEXT\"))\n\tgpQuerySwapGroupNV = (C.GPQUERYSWAPGROUPNV)(getProcAddr(\"wglQuerySwapGroupNV\"))\n\tgpQueryVideoCaptureDeviceNV = (C.GPQUERYVIDEOCAPTUREDEVICENV)(getProcAddr(\"wglQueryVideoCaptureDeviceNV\"))\n\tgpRealizeLayerPalette = (C.GPREALIZELAYERPALETTE)(getProcAddr(\"wglRealizeLayerPalette\"))\n\tif gpRealizeLayerPalette == nil {\n\t\treturn errors.New(\"wglRealizeLayerPalette\")\n\t}\n\tgpReleaseImageBufferEventsI3D = (C.GPRELEASEIMAGEBUFFEREVENTSI3D)(getProcAddr(\"wglReleaseImageBufferEventsI3D\"))\n\tgpReleasePbufferDCARB = (C.GPRELEASEPBUFFERDCARB)(getProcAddr(\"wglReleasePbufferDCARB\"))\n\tgpReleasePbufferDCEXT = (C.GPRELEASEPBUFFERDCEXT)(getProcAddr(\"wglReleasePbufferDCEXT\"))\n\tgpReleaseTexImageARB = (C.GPRELEASETEXIMAGEARB)(getProcAddr(\"wglReleaseTexImageARB\"))\n\tgpReleaseVideoCaptureDeviceNV = (C.GPRELEASEVIDEOCAPTUREDEVICENV)(getProcAddr(\"wglReleaseVideoCaptureDeviceNV\"))\n\tgpReleaseVideoDeviceNV = (C.GPRELEASEVIDEODEVICENV)(getProcAddr(\"wglReleaseVideoDeviceNV\"))\n\tgpReleaseVideoImageNV = (C.GPRELEASEVIDEOIMAGENV)(getProcAddr(\"wglReleaseVideoImageNV\"))\n\tgpResetFrameCountNV = (C.GPRESETFRAMECOUNTNV)(getProcAddr(\"wglResetFrameCountNV\"))\n\tgpRestoreBufferRegionARB = (C.GPRESTOREBUFFERREGIONARB)(getProcAddr(\"wglRestoreBufferRegionARB\"))\n\tgpSaveBufferRegionARB = (C.GPSAVEBUFFERREGIONARB)(getProcAddr(\"wglSaveBufferRegionARB\"))\n\tgpSendPbufferToVideoNV = (C.GPSENDPBUFFERTOVIDEONV)(getProcAddr(\"wglSendPbufferToVideoNV\"))\n\tgpSetDigitalVideoParametersI3D = (C.GPSETDIGITALVIDEOPARAMETERSI3D)(getProcAddr(\"wglSetDigitalVideoParametersI3D\"))\n\tgpSetGammaTableI3D = (C.GPSETGAMMATABLEI3D)(getProcAddr(\"wglSetGammaTableI3D\"))\n\tgpSetGammaTableParametersI3D = (C.GPSETGAMMATABLEPARAMETERSI3D)(getProcAddr(\"wglSetGammaTableParametersI3D\"))\n\tgpSetLayerPaletteEntries = (C.GPSETLAYERPALETTEENTRIES)(getProcAddr(\"wglSetLayerPaletteEntries\"))\n\tif gpSetLayerPaletteEntries == nil {\n\t\treturn errors.New(\"wglSetLayerPaletteEntries\")\n\t}\n\tgpSetPbufferAttribARB = (C.GPSETPBUFFERATTRIBARB)(getProcAddr(\"wglSetPbufferAttribARB\"))\n\tgpSetStereoEmitterState3DL = (C.GPSETSTEREOEMITTERSTATE3DL)(getProcAddr(\"wglSetStereoEmitterState3DL\"))\n\tgpShareLists = (C.GPSHARELISTS)(getProcAddr(\"wglShareLists\"))\n\tif gpShareLists == nil {\n\t\treturn errors.New(\"wglShareLists\")\n\t}\n\tgpSwapBuffersMscOML = (C.GPSWAPBUFFERSMSCOML)(getProcAddr(\"wglSwapBuffersMscOML\"))\n\tgpSwapIntervalEXT = (C.GPSWAPINTERVALEXT)(getProcAddr(\"wglSwapIntervalEXT\"))\n\tgpSwapLayerBuffers = (C.GPSWAPLAYERBUFFERS)(getProcAddr(\"wglSwapLayerBuffers\"))\n\tif gpSwapLayerBuffers == nil {\n\t\treturn errors.New(\"wglSwapLayerBuffers\")\n\t}\n\tgpSwapLayerBuffersMscOML = (C.GPSWAPLAYERBUFFERSMSCOML)(getProcAddr(\"wglSwapLayerBuffersMscOML\"))\n\tgpUseFontBitmaps = (C.GPUSEFONTBITMAPS)(getProcAddr(\"wglUseFontBitmaps\"))\n\tif gpUseFontBitmaps == nil {\n\t\treturn errors.New(\"wglUseFontBitmaps\")\n\t}\n\tgpUseFontBitmapsA = (C.GPUSEFONTBITMAPSA)(getProcAddr(\"wglUseFontBitmapsA\"))\n\tif gpUseFontBitmapsA == nil {\n\t\treturn errors.New(\"wglUseFontBitmapsA\")\n\t}\n\tgpUseFontBitmapsW = (C.GPUSEFONTBITMAPSW)(getProcAddr(\"wglUseFontBitmapsW\"))\n\tif gpUseFontBitmapsW == nil {\n\t\treturn errors.New(\"wglUseFontBitmapsW\")\n\t}\n\tgpUseFontOutlines = (C.GPUSEFONTOUTLINES)(getProcAddr(\"wglUseFontOutlines\"))\n\tif gpUseFontOutlines == nil {\n\t\treturn errors.New(\"wglUseFontOutlines\")\n\t}\n\tgpUseFontOutlinesA = (C.GPUSEFONTOUTLINESA)(getProcAddr(\"wglUseFontOutlinesA\"))\n\tif gpUseFontOutlinesA == nil {\n\t\treturn errors.New(\"wglUseFontOutlinesA\")\n\t}\n\tgpUseFontOutlinesW = (C.GPUSEFONTOUTLINESW)(getProcAddr(\"wglUseFontOutlinesW\"))\n\tif gpUseFontOutlinesW == nil {\n\t\treturn errors.New(\"wglUseFontOutlinesW\")\n\t}\n\tgpWaitForMscOML = (C.GPWAITFORMSCOML)(getProcAddr(\"wglWaitForMscOML\"))\n\tgpWaitForSbcOML = (C.GPWAITFORSBCOML)(getProcAddr(\"wglWaitForSbcOML\"))\n\treturn nil\n}", "func DebugMessageInsert(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *int8) {\n C.glowDebugMessageInsert(gpDebugMessageInsert, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf)))\n}", "func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {\n\tgpActiveTexture = (C.GPACTIVETEXTURE)(getProcAddr(\"glActiveTexture\"))\n\tif gpActiveTexture == nil {\n\t\treturn errors.New(\"glActiveTexture\")\n\t}\n\tgpAttachShader = (C.GPATTACHSHADER)(getProcAddr(\"glAttachShader\"))\n\tif gpAttachShader == nil {\n\t\treturn errors.New(\"glAttachShader\")\n\t}\n\tgpBindAttribLocation = (C.GPBINDATTRIBLOCATION)(getProcAddr(\"glBindAttribLocation\"))\n\tif gpBindAttribLocation == nil {\n\t\treturn errors.New(\"glBindAttribLocation\")\n\t}\n\tgpBindBuffer = (C.GPBINDBUFFER)(getProcAddr(\"glBindBuffer\"))\n\tif gpBindBuffer == nil {\n\t\treturn errors.New(\"glBindBuffer\")\n\t}\n\tgpBindFramebuffer = (C.GPBINDFRAMEBUFFER)(getProcAddr(\"glBindFramebuffer\"))\n\tif gpBindFramebuffer == nil {\n\t\treturn errors.New(\"glBindFramebuffer\")\n\t}\n\tgpBindRenderbuffer = (C.GPBINDRENDERBUFFER)(getProcAddr(\"glBindRenderbuffer\"))\n\tif gpBindRenderbuffer == nil {\n\t\treturn errors.New(\"glBindRenderbuffer\")\n\t}\n\tgpBindTexture = (C.GPBINDTEXTURE)(getProcAddr(\"glBindTexture\"))\n\tif gpBindTexture == nil {\n\t\treturn errors.New(\"glBindTexture\")\n\t}\n\tgpBlendColor = (C.GPBLENDCOLOR)(getProcAddr(\"glBlendColor\"))\n\tif gpBlendColor == nil {\n\t\treturn errors.New(\"glBlendColor\")\n\t}\n\tgpBlendEquation = (C.GPBLENDEQUATION)(getProcAddr(\"glBlendEquation\"))\n\tif gpBlendEquation == nil {\n\t\treturn errors.New(\"glBlendEquation\")\n\t}\n\tgpBlendEquationSeparate = (C.GPBLENDEQUATIONSEPARATE)(getProcAddr(\"glBlendEquationSeparate\"))\n\tif gpBlendEquationSeparate == nil {\n\t\treturn errors.New(\"glBlendEquationSeparate\")\n\t}\n\tgpBlendFunc = (C.GPBLENDFUNC)(getProcAddr(\"glBlendFunc\"))\n\tif gpBlendFunc == nil {\n\t\treturn errors.New(\"glBlendFunc\")\n\t}\n\tgpBlendFuncSeparate = (C.GPBLENDFUNCSEPARATE)(getProcAddr(\"glBlendFuncSeparate\"))\n\tif gpBlendFuncSeparate == nil {\n\t\treturn errors.New(\"glBlendFuncSeparate\")\n\t}\n\tgpBufferData = (C.GPBUFFERDATA)(getProcAddr(\"glBufferData\"))\n\tif gpBufferData == nil {\n\t\treturn errors.New(\"glBufferData\")\n\t}\n\tgpBufferSubData = (C.GPBUFFERSUBDATA)(getProcAddr(\"glBufferSubData\"))\n\tif gpBufferSubData == nil {\n\t\treturn errors.New(\"glBufferSubData\")\n\t}\n\tgpCheckFramebufferStatus = (C.GPCHECKFRAMEBUFFERSTATUS)(getProcAddr(\"glCheckFramebufferStatus\"))\n\tif gpCheckFramebufferStatus == nil {\n\t\treturn errors.New(\"glCheckFramebufferStatus\")\n\t}\n\tgpClear = (C.GPCLEAR)(getProcAddr(\"glClear\"))\n\tif gpClear == nil {\n\t\treturn errors.New(\"glClear\")\n\t}\n\tgpClearColor = (C.GPCLEARCOLOR)(getProcAddr(\"glClearColor\"))\n\tif gpClearColor == nil {\n\t\treturn errors.New(\"glClearColor\")\n\t}\n\tgpClearStencil = (C.GPCLEARSTENCIL)(getProcAddr(\"glClearStencil\"))\n\tif gpClearStencil == nil {\n\t\treturn errors.New(\"glClearStencil\")\n\t}\n\tgpColorMask = (C.GPCOLORMASK)(getProcAddr(\"glColorMask\"))\n\tif gpColorMask == nil {\n\t\treturn errors.New(\"glColorMask\")\n\t}\n\tgpCompileShader = (C.GPCOMPILESHADER)(getProcAddr(\"glCompileShader\"))\n\tif gpCompileShader == nil {\n\t\treturn errors.New(\"glCompileShader\")\n\t}\n\tgpCompressedTexImage2D = (C.GPCOMPRESSEDTEXIMAGE2D)(getProcAddr(\"glCompressedTexImage2D\"))\n\tif gpCompressedTexImage2D == nil {\n\t\treturn errors.New(\"glCompressedTexImage2D\")\n\t}\n\tgpCompressedTexSubImage2D = (C.GPCOMPRESSEDTEXSUBIMAGE2D)(getProcAddr(\"glCompressedTexSubImage2D\"))\n\tif gpCompressedTexSubImage2D == nil {\n\t\treturn errors.New(\"glCompressedTexSubImage2D\")\n\t}\n\tgpCopyTexImage2D = (C.GPCOPYTEXIMAGE2D)(getProcAddr(\"glCopyTexImage2D\"))\n\tif gpCopyTexImage2D == nil {\n\t\treturn errors.New(\"glCopyTexImage2D\")\n\t}\n\tgpCopyTexSubImage2D = (C.GPCOPYTEXSUBIMAGE2D)(getProcAddr(\"glCopyTexSubImage2D\"))\n\tif gpCopyTexSubImage2D == nil {\n\t\treturn errors.New(\"glCopyTexSubImage2D\")\n\t}\n\tgpCreateProgram = (C.GPCREATEPROGRAM)(getProcAddr(\"glCreateProgram\"))\n\tif gpCreateProgram == nil {\n\t\treturn errors.New(\"glCreateProgram\")\n\t}\n\tgpCreateShader = (C.GPCREATESHADER)(getProcAddr(\"glCreateShader\"))\n\tif gpCreateShader == nil {\n\t\treturn errors.New(\"glCreateShader\")\n\t}\n\tgpCullFace = (C.GPCULLFACE)(getProcAddr(\"glCullFace\"))\n\tif gpCullFace == nil {\n\t\treturn errors.New(\"glCullFace\")\n\t}\n\tgpDeleteBuffers = (C.GPDELETEBUFFERS)(getProcAddr(\"glDeleteBuffers\"))\n\tif gpDeleteBuffers == nil {\n\t\treturn errors.New(\"glDeleteBuffers\")\n\t}\n\tgpDeleteFramebuffers = (C.GPDELETEFRAMEBUFFERS)(getProcAddr(\"glDeleteFramebuffers\"))\n\tif gpDeleteFramebuffers == nil {\n\t\treturn errors.New(\"glDeleteFramebuffers\")\n\t}\n\tgpDeleteProgram = (C.GPDELETEPROGRAM)(getProcAddr(\"glDeleteProgram\"))\n\tif gpDeleteProgram == nil {\n\t\treturn errors.New(\"glDeleteProgram\")\n\t}\n\tgpDeleteRenderbuffers = (C.GPDELETERENDERBUFFERS)(getProcAddr(\"glDeleteRenderbuffers\"))\n\tif gpDeleteRenderbuffers == nil {\n\t\treturn errors.New(\"glDeleteRenderbuffers\")\n\t}\n\tgpDeleteShader = (C.GPDELETESHADER)(getProcAddr(\"glDeleteShader\"))\n\tif gpDeleteShader == nil {\n\t\treturn errors.New(\"glDeleteShader\")\n\t}\n\tgpDeleteTextures = (C.GPDELETETEXTURES)(getProcAddr(\"glDeleteTextures\"))\n\tif gpDeleteTextures == nil {\n\t\treturn errors.New(\"glDeleteTextures\")\n\t}\n\tgpDepthFunc = (C.GPDEPTHFUNC)(getProcAddr(\"glDepthFunc\"))\n\tif gpDepthFunc == nil {\n\t\treturn errors.New(\"glDepthFunc\")\n\t}\n\tgpDepthMask = (C.GPDEPTHMASK)(getProcAddr(\"glDepthMask\"))\n\tif gpDepthMask == nil {\n\t\treturn errors.New(\"glDepthMask\")\n\t}\n\tgpDetachShader = (C.GPDETACHSHADER)(getProcAddr(\"glDetachShader\"))\n\tif gpDetachShader == nil {\n\t\treturn errors.New(\"glDetachShader\")\n\t}\n\tgpDisable = (C.GPDISABLE)(getProcAddr(\"glDisable\"))\n\tif gpDisable == nil {\n\t\treturn errors.New(\"glDisable\")\n\t}\n\tgpDisableVertexAttribArray = (C.GPDISABLEVERTEXATTRIBARRAY)(getProcAddr(\"glDisableVertexAttribArray\"))\n\tif gpDisableVertexAttribArray == nil {\n\t\treturn errors.New(\"glDisableVertexAttribArray\")\n\t}\n\tgpDrawArrays = (C.GPDRAWARRAYS)(getProcAddr(\"glDrawArrays\"))\n\tif gpDrawArrays == nil {\n\t\treturn errors.New(\"glDrawArrays\")\n\t}\n\tgpDrawElements = (C.GPDRAWELEMENTS)(getProcAddr(\"glDrawElements\"))\n\tif gpDrawElements == nil {\n\t\treturn errors.New(\"glDrawElements\")\n\t}\n\tgpEnable = (C.GPENABLE)(getProcAddr(\"glEnable\"))\n\tif gpEnable == nil {\n\t\treturn errors.New(\"glEnable\")\n\t}\n\tgpEnableVertexAttribArray = (C.GPENABLEVERTEXATTRIBARRAY)(getProcAddr(\"glEnableVertexAttribArray\"))\n\tif gpEnableVertexAttribArray == nil {\n\t\treturn errors.New(\"glEnableVertexAttribArray\")\n\t}\n\tgpFinish = (C.GPFINISH)(getProcAddr(\"glFinish\"))\n\tif gpFinish == nil {\n\t\treturn errors.New(\"glFinish\")\n\t}\n\tgpFlush = (C.GPFLUSH)(getProcAddr(\"glFlush\"))\n\tif gpFlush == nil {\n\t\treturn errors.New(\"glFlush\")\n\t}\n\tgpFramebufferRenderbuffer = (C.GPFRAMEBUFFERRENDERBUFFER)(getProcAddr(\"glFramebufferRenderbuffer\"))\n\tif gpFramebufferRenderbuffer == nil {\n\t\treturn errors.New(\"glFramebufferRenderbuffer\")\n\t}\n\tgpFramebufferTexture2D = (C.GPFRAMEBUFFERTEXTURE2D)(getProcAddr(\"glFramebufferTexture2D\"))\n\tif gpFramebufferTexture2D == nil {\n\t\treturn errors.New(\"glFramebufferTexture2D\")\n\t}\n\tgpFrontFace = (C.GPFRONTFACE)(getProcAddr(\"glFrontFace\"))\n\tif gpFrontFace == nil {\n\t\treturn errors.New(\"glFrontFace\")\n\t}\n\tgpGenBuffers = (C.GPGENBUFFERS)(getProcAddr(\"glGenBuffers\"))\n\tif gpGenBuffers == nil {\n\t\treturn errors.New(\"glGenBuffers\")\n\t}\n\tgpGenFramebuffers = (C.GPGENFRAMEBUFFERS)(getProcAddr(\"glGenFramebuffers\"))\n\tif gpGenFramebuffers == nil {\n\t\treturn errors.New(\"glGenFramebuffers\")\n\t}\n\tgpGenRenderbuffers = (C.GPGENRENDERBUFFERS)(getProcAddr(\"glGenRenderbuffers\"))\n\tif gpGenRenderbuffers == nil {\n\t\treturn errors.New(\"glGenRenderbuffers\")\n\t}\n\tgpGenTextures = (C.GPGENTEXTURES)(getProcAddr(\"glGenTextures\"))\n\tif gpGenTextures == nil {\n\t\treturn errors.New(\"glGenTextures\")\n\t}\n\tgpGenerateMipmap = (C.GPGENERATEMIPMAP)(getProcAddr(\"glGenerateMipmap\"))\n\tif gpGenerateMipmap == nil {\n\t\treturn errors.New(\"glGenerateMipmap\")\n\t}\n\tgpGetActiveAttrib = (C.GPGETACTIVEATTRIB)(getProcAddr(\"glGetActiveAttrib\"))\n\tif gpGetActiveAttrib == nil {\n\t\treturn errors.New(\"glGetActiveAttrib\")\n\t}\n\tgpGetActiveUniform = (C.GPGETACTIVEUNIFORM)(getProcAddr(\"glGetActiveUniform\"))\n\tif gpGetActiveUniform == nil {\n\t\treturn errors.New(\"glGetActiveUniform\")\n\t}\n\tgpGetAttachedShaders = (C.GPGETATTACHEDSHADERS)(getProcAddr(\"glGetAttachedShaders\"))\n\tif gpGetAttachedShaders == nil {\n\t\treturn errors.New(\"glGetAttachedShaders\")\n\t}\n\tgpGetAttribLocation = (C.GPGETATTRIBLOCATION)(getProcAddr(\"glGetAttribLocation\"))\n\tif gpGetAttribLocation == nil {\n\t\treturn errors.New(\"glGetAttribLocation\")\n\t}\n\tgpGetBooleanv = (C.GPGETBOOLEANV)(getProcAddr(\"glGetBooleanv\"))\n\tif gpGetBooleanv == nil {\n\t\treturn errors.New(\"glGetBooleanv\")\n\t}\n\tgpGetBufferParameteriv = (C.GPGETBUFFERPARAMETERIV)(getProcAddr(\"glGetBufferParameteriv\"))\n\tif gpGetBufferParameteriv == nil {\n\t\treturn errors.New(\"glGetBufferParameteriv\")\n\t}\n\tgpGetError = (C.GPGETERROR)(getProcAddr(\"glGetError\"))\n\tif gpGetError == nil {\n\t\treturn errors.New(\"glGetError\")\n\t}\n\tgpGetFloatv = (C.GPGETFLOATV)(getProcAddr(\"glGetFloatv\"))\n\tif gpGetFloatv == nil {\n\t\treturn errors.New(\"glGetFloatv\")\n\t}\n\tgpGetFramebufferAttachmentParameteriv = (C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr(\"glGetFramebufferAttachmentParameteriv\"))\n\tif gpGetFramebufferAttachmentParameteriv == nil {\n\t\treturn errors.New(\"glGetFramebufferAttachmentParameteriv\")\n\t}\n\tgpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr(\"glGetIntegerv\"))\n\tif gpGetIntegerv == nil {\n\t\treturn errors.New(\"glGetIntegerv\")\n\t}\n\tgpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr(\"glGetProgramInfoLog\"))\n\tif gpGetProgramInfoLog == nil {\n\t\treturn errors.New(\"glGetProgramInfoLog\")\n\t}\n\tgpGetProgramiv = (C.GPGETPROGRAMIV)(getProcAddr(\"glGetProgramiv\"))\n\tif gpGetProgramiv == nil {\n\t\treturn errors.New(\"glGetProgramiv\")\n\t}\n\tgpGetRenderbufferParameteriv = (C.GPGETRENDERBUFFERPARAMETERIV)(getProcAddr(\"glGetRenderbufferParameteriv\"))\n\tif gpGetRenderbufferParameteriv == nil {\n\t\treturn errors.New(\"glGetRenderbufferParameteriv\")\n\t}\n\tgpGetShaderInfoLog = (C.GPGETSHADERINFOLOG)(getProcAddr(\"glGetShaderInfoLog\"))\n\tif gpGetShaderInfoLog == nil {\n\t\treturn errors.New(\"glGetShaderInfoLog\")\n\t}\n\tgpGetShaderSource = (C.GPGETSHADERSOURCE)(getProcAddr(\"glGetShaderSource\"))\n\tif gpGetShaderSource == nil {\n\t\treturn errors.New(\"glGetShaderSource\")\n\t}\n\tgpGetShaderiv = (C.GPGETSHADERIV)(getProcAddr(\"glGetShaderiv\"))\n\tif gpGetShaderiv == nil {\n\t\treturn errors.New(\"glGetShaderiv\")\n\t}\n\tgpGetString = (C.GPGETSTRING)(getProcAddr(\"glGetString\"))\n\tif gpGetString == nil {\n\t\treturn errors.New(\"glGetString\")\n\t}\n\tgpGetTexParameterfv = (C.GPGETTEXPARAMETERFV)(getProcAddr(\"glGetTexParameterfv\"))\n\tif gpGetTexParameterfv == nil {\n\t\treturn errors.New(\"glGetTexParameterfv\")\n\t}\n\tgpGetTexParameteriv = (C.GPGETTEXPARAMETERIV)(getProcAddr(\"glGetTexParameteriv\"))\n\tif gpGetTexParameteriv == nil {\n\t\treturn errors.New(\"glGetTexParameteriv\")\n\t}\n\tgpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr(\"glGetUniformLocation\"))\n\tif gpGetUniformLocation == nil {\n\t\treturn errors.New(\"glGetUniformLocation\")\n\t}\n\tgpGetUniformfv = (C.GPGETUNIFORMFV)(getProcAddr(\"glGetUniformfv\"))\n\tif gpGetUniformfv == nil {\n\t\treturn errors.New(\"glGetUniformfv\")\n\t}\n\tgpGetUniformiv = (C.GPGETUNIFORMIV)(getProcAddr(\"glGetUniformiv\"))\n\tif gpGetUniformiv == nil {\n\t\treturn errors.New(\"glGetUniformiv\")\n\t}\n\tgpGetVertexAttribPointerv = (C.GPGETVERTEXATTRIBPOINTERV)(getProcAddr(\"glGetVertexAttribPointerv\"))\n\tif gpGetVertexAttribPointerv == nil {\n\t\treturn errors.New(\"glGetVertexAttribPointerv\")\n\t}\n\tgpGetVertexAttribfv = (C.GPGETVERTEXATTRIBFV)(getProcAddr(\"glGetVertexAttribfv\"))\n\tif gpGetVertexAttribfv == nil {\n\t\treturn errors.New(\"glGetVertexAttribfv\")\n\t}\n\tgpGetVertexAttribiv = (C.GPGETVERTEXATTRIBIV)(getProcAddr(\"glGetVertexAttribiv\"))\n\tif gpGetVertexAttribiv == nil {\n\t\treturn errors.New(\"glGetVertexAttribiv\")\n\t}\n\tgpHint = (C.GPHINT)(getProcAddr(\"glHint\"))\n\tif gpHint == nil {\n\t\treturn errors.New(\"glHint\")\n\t}\n\tgpIsBuffer = (C.GPISBUFFER)(getProcAddr(\"glIsBuffer\"))\n\tif gpIsBuffer == nil {\n\t\treturn errors.New(\"glIsBuffer\")\n\t}\n\tgpIsEnabled = (C.GPISENABLED)(getProcAddr(\"glIsEnabled\"))\n\tif gpIsEnabled == nil {\n\t\treturn errors.New(\"glIsEnabled\")\n\t}\n\tgpIsFramebuffer = (C.GPISFRAMEBUFFER)(getProcAddr(\"glIsFramebuffer\"))\n\tif gpIsFramebuffer == nil {\n\t\treturn errors.New(\"glIsFramebuffer\")\n\t}\n\tgpIsProgram = (C.GPISPROGRAM)(getProcAddr(\"glIsProgram\"))\n\tif gpIsProgram == nil {\n\t\treturn errors.New(\"glIsProgram\")\n\t}\n\tgpIsRenderbuffer = (C.GPISRENDERBUFFER)(getProcAddr(\"glIsRenderbuffer\"))\n\tif gpIsRenderbuffer == nil {\n\t\treturn errors.New(\"glIsRenderbuffer\")\n\t}\n\tgpIsShader = (C.GPISSHADER)(getProcAddr(\"glIsShader\"))\n\tif gpIsShader == nil {\n\t\treturn errors.New(\"glIsShader\")\n\t}\n\tgpIsTexture = (C.GPISTEXTURE)(getProcAddr(\"glIsTexture\"))\n\tif gpIsTexture == nil {\n\t\treturn errors.New(\"glIsTexture\")\n\t}\n\tgpLineWidth = (C.GPLINEWIDTH)(getProcAddr(\"glLineWidth\"))\n\tif gpLineWidth == nil {\n\t\treturn errors.New(\"glLineWidth\")\n\t}\n\tgpLinkProgram = (C.GPLINKPROGRAM)(getProcAddr(\"glLinkProgram\"))\n\tif gpLinkProgram == nil {\n\t\treturn errors.New(\"glLinkProgram\")\n\t}\n\tgpPixelStorei = (C.GPPIXELSTOREI)(getProcAddr(\"glPixelStorei\"))\n\tif gpPixelStorei == nil {\n\t\treturn errors.New(\"glPixelStorei\")\n\t}\n\tgpPolygonOffset = (C.GPPOLYGONOFFSET)(getProcAddr(\"glPolygonOffset\"))\n\tif gpPolygonOffset == nil {\n\t\treturn errors.New(\"glPolygonOffset\")\n\t}\n\tgpReadPixels = (C.GPREADPIXELS)(getProcAddr(\"glReadPixels\"))\n\tif gpReadPixels == nil {\n\t\treturn errors.New(\"glReadPixels\")\n\t}\n\tgpRenderbufferStorage = (C.GPRENDERBUFFERSTORAGE)(getProcAddr(\"glRenderbufferStorage\"))\n\tif gpRenderbufferStorage == nil {\n\t\treturn errors.New(\"glRenderbufferStorage\")\n\t}\n\tgpSampleCoverage = (C.GPSAMPLECOVERAGE)(getProcAddr(\"glSampleCoverage\"))\n\tif gpSampleCoverage == nil {\n\t\treturn errors.New(\"glSampleCoverage\")\n\t}\n\tgpScissor = (C.GPSCISSOR)(getProcAddr(\"glScissor\"))\n\tif gpScissor == nil {\n\t\treturn errors.New(\"glScissor\")\n\t}\n\tgpShaderSource = (C.GPSHADERSOURCE)(getProcAddr(\"glShaderSource\"))\n\tif gpShaderSource == nil {\n\t\treturn errors.New(\"glShaderSource\")\n\t}\n\tgpStencilFunc = (C.GPSTENCILFUNC)(getProcAddr(\"glStencilFunc\"))\n\tif gpStencilFunc == nil {\n\t\treturn errors.New(\"glStencilFunc\")\n\t}\n\tgpStencilFuncSeparate = (C.GPSTENCILFUNCSEPARATE)(getProcAddr(\"glStencilFuncSeparate\"))\n\tif gpStencilFuncSeparate == nil {\n\t\treturn errors.New(\"glStencilFuncSeparate\")\n\t}\n\tgpStencilMask = (C.GPSTENCILMASK)(getProcAddr(\"glStencilMask\"))\n\tif gpStencilMask == nil {\n\t\treturn errors.New(\"glStencilMask\")\n\t}\n\tgpStencilMaskSeparate = (C.GPSTENCILMASKSEPARATE)(getProcAddr(\"glStencilMaskSeparate\"))\n\tif gpStencilMaskSeparate == nil {\n\t\treturn errors.New(\"glStencilMaskSeparate\")\n\t}\n\tgpStencilOp = (C.GPSTENCILOP)(getProcAddr(\"glStencilOp\"))\n\tif gpStencilOp == nil {\n\t\treturn errors.New(\"glStencilOp\")\n\t}\n\tgpStencilOpSeparate = (C.GPSTENCILOPSEPARATE)(getProcAddr(\"glStencilOpSeparate\"))\n\tif gpStencilOpSeparate == nil {\n\t\treturn errors.New(\"glStencilOpSeparate\")\n\t}\n\tgpTexImage2D = (C.GPTEXIMAGE2D)(getProcAddr(\"glTexImage2D\"))\n\tif gpTexImage2D == nil {\n\t\treturn errors.New(\"glTexImage2D\")\n\t}\n\tgpTexParameterf = (C.GPTEXPARAMETERF)(getProcAddr(\"glTexParameterf\"))\n\tif gpTexParameterf == nil {\n\t\treturn errors.New(\"glTexParameterf\")\n\t}\n\tgpTexParameterfv = (C.GPTEXPARAMETERFV)(getProcAddr(\"glTexParameterfv\"))\n\tif gpTexParameterfv == nil {\n\t\treturn errors.New(\"glTexParameterfv\")\n\t}\n\tgpTexParameteri = (C.GPTEXPARAMETERI)(getProcAddr(\"glTexParameteri\"))\n\tif gpTexParameteri == nil {\n\t\treturn errors.New(\"glTexParameteri\")\n\t}\n\tgpTexParameteriv = (C.GPTEXPARAMETERIV)(getProcAddr(\"glTexParameteriv\"))\n\tif gpTexParameteriv == nil {\n\t\treturn errors.New(\"glTexParameteriv\")\n\t}\n\tgpTexSubImage2D = (C.GPTEXSUBIMAGE2D)(getProcAddr(\"glTexSubImage2D\"))\n\tif gpTexSubImage2D == nil {\n\t\treturn errors.New(\"glTexSubImage2D\")\n\t}\n\tgpUniform1f = (C.GPUNIFORM1F)(getProcAddr(\"glUniform1f\"))\n\tif gpUniform1f == nil {\n\t\treturn errors.New(\"glUniform1f\")\n\t}\n\tgpUniform1fv = (C.GPUNIFORM1FV)(getProcAddr(\"glUniform1fv\"))\n\tif gpUniform1fv == nil {\n\t\treturn errors.New(\"glUniform1fv\")\n\t}\n\tgpUniform1i = (C.GPUNIFORM1I)(getProcAddr(\"glUniform1i\"))\n\tif gpUniform1i == nil {\n\t\treturn errors.New(\"glUniform1i\")\n\t}\n\tgpUniform1iv = (C.GPUNIFORM1IV)(getProcAddr(\"glUniform1iv\"))\n\tif gpUniform1iv == nil {\n\t\treturn errors.New(\"glUniform1iv\")\n\t}\n\tgpUniform2f = (C.GPUNIFORM2F)(getProcAddr(\"glUniform2f\"))\n\tif gpUniform2f == nil {\n\t\treturn errors.New(\"glUniform2f\")\n\t}\n\tgpUniform2fv = (C.GPUNIFORM2FV)(getProcAddr(\"glUniform2fv\"))\n\tif gpUniform2fv == nil {\n\t\treturn errors.New(\"glUniform2fv\")\n\t}\n\tgpUniform2i = (C.GPUNIFORM2I)(getProcAddr(\"glUniform2i\"))\n\tif gpUniform2i == nil {\n\t\treturn errors.New(\"glUniform2i\")\n\t}\n\tgpUniform2iv = (C.GPUNIFORM2IV)(getProcAddr(\"glUniform2iv\"))\n\tif gpUniform2iv == nil {\n\t\treturn errors.New(\"glUniform2iv\")\n\t}\n\tgpUniform3f = (C.GPUNIFORM3F)(getProcAddr(\"glUniform3f\"))\n\tif gpUniform3f == nil {\n\t\treturn errors.New(\"glUniform3f\")\n\t}\n\tgpUniform3fv = (C.GPUNIFORM3FV)(getProcAddr(\"glUniform3fv\"))\n\tif gpUniform3fv == nil {\n\t\treturn errors.New(\"glUniform3fv\")\n\t}\n\tgpUniform3i = (C.GPUNIFORM3I)(getProcAddr(\"glUniform3i\"))\n\tif gpUniform3i == nil {\n\t\treturn errors.New(\"glUniform3i\")\n\t}\n\tgpUniform3iv = (C.GPUNIFORM3IV)(getProcAddr(\"glUniform3iv\"))\n\tif gpUniform3iv == nil {\n\t\treturn errors.New(\"glUniform3iv\")\n\t}\n\tgpUniform4f = (C.GPUNIFORM4F)(getProcAddr(\"glUniform4f\"))\n\tif gpUniform4f == nil {\n\t\treturn errors.New(\"glUniform4f\")\n\t}\n\tgpUniform4fv = (C.GPUNIFORM4FV)(getProcAddr(\"glUniform4fv\"))\n\tif gpUniform4fv == nil {\n\t\treturn errors.New(\"glUniform4fv\")\n\t}\n\tgpUniform4i = (C.GPUNIFORM4I)(getProcAddr(\"glUniform4i\"))\n\tif gpUniform4i == nil {\n\t\treturn errors.New(\"glUniform4i\")\n\t}\n\tgpUniform4iv = (C.GPUNIFORM4IV)(getProcAddr(\"glUniform4iv\"))\n\tif gpUniform4iv == nil {\n\t\treturn errors.New(\"glUniform4iv\")\n\t}\n\tgpUniformMatrix2fv = (C.GPUNIFORMMATRIX2FV)(getProcAddr(\"glUniformMatrix2fv\"))\n\tif gpUniformMatrix2fv == nil {\n\t\treturn errors.New(\"glUniformMatrix2fv\")\n\t}\n\tgpUniformMatrix3fv = (C.GPUNIFORMMATRIX3FV)(getProcAddr(\"glUniformMatrix3fv\"))\n\tif gpUniformMatrix3fv == nil {\n\t\treturn errors.New(\"glUniformMatrix3fv\")\n\t}\n\tgpUniformMatrix4fv = (C.GPUNIFORMMATRIX4FV)(getProcAddr(\"glUniformMatrix4fv\"))\n\tif gpUniformMatrix4fv == nil {\n\t\treturn errors.New(\"glUniformMatrix4fv\")\n\t}\n\tgpUseProgram = (C.GPUSEPROGRAM)(getProcAddr(\"glUseProgram\"))\n\tif gpUseProgram == nil {\n\t\treturn errors.New(\"glUseProgram\")\n\t}\n\tgpValidateProgram = (C.GPVALIDATEPROGRAM)(getProcAddr(\"glValidateProgram\"))\n\tif gpValidateProgram == nil {\n\t\treturn errors.New(\"glValidateProgram\")\n\t}\n\tgpVertexAttrib1f = (C.GPVERTEXATTRIB1F)(getProcAddr(\"glVertexAttrib1f\"))\n\tif gpVertexAttrib1f == nil {\n\t\treturn errors.New(\"glVertexAttrib1f\")\n\t}\n\tgpVertexAttrib1fv = (C.GPVERTEXATTRIB1FV)(getProcAddr(\"glVertexAttrib1fv\"))\n\tif gpVertexAttrib1fv == nil {\n\t\treturn errors.New(\"glVertexAttrib1fv\")\n\t}\n\tgpVertexAttrib2f = (C.GPVERTEXATTRIB2F)(getProcAddr(\"glVertexAttrib2f\"))\n\tif gpVertexAttrib2f == nil {\n\t\treturn errors.New(\"glVertexAttrib2f\")\n\t}\n\tgpVertexAttrib2fv = (C.GPVERTEXATTRIB2FV)(getProcAddr(\"glVertexAttrib2fv\"))\n\tif gpVertexAttrib2fv == nil {\n\t\treturn errors.New(\"glVertexAttrib2fv\")\n\t}\n\tgpVertexAttrib3f = (C.GPVERTEXATTRIB3F)(getProcAddr(\"glVertexAttrib3f\"))\n\tif gpVertexAttrib3f == nil {\n\t\treturn errors.New(\"glVertexAttrib3f\")\n\t}\n\tgpVertexAttrib3fv = (C.GPVERTEXATTRIB3FV)(getProcAddr(\"glVertexAttrib3fv\"))\n\tif gpVertexAttrib3fv == nil {\n\t\treturn errors.New(\"glVertexAttrib3fv\")\n\t}\n\tgpVertexAttrib4f = (C.GPVERTEXATTRIB4F)(getProcAddr(\"glVertexAttrib4f\"))\n\tif gpVertexAttrib4f == nil {\n\t\treturn errors.New(\"glVertexAttrib4f\")\n\t}\n\tgpVertexAttrib4fv = (C.GPVERTEXATTRIB4FV)(getProcAddr(\"glVertexAttrib4fv\"))\n\tif gpVertexAttrib4fv == nil {\n\t\treturn errors.New(\"glVertexAttrib4fv\")\n\t}\n\tgpVertexAttribPointer = (C.GPVERTEXATTRIBPOINTER)(getProcAddr(\"glVertexAttribPointer\"))\n\tif gpVertexAttribPointer == nil {\n\t\treturn errors.New(\"glVertexAttribPointer\")\n\t}\n\tgpViewport = (C.GPVIEWPORT)(getProcAddr(\"glViewport\"))\n\tif gpViewport == nil {\n\t\treturn errors.New(\"glViewport\")\n\t}\n\treturn nil\n}", "func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {\n\tgpChoosePixelFormat = uintptr(getProcAddr(\"ChoosePixelFormat\"))\n\tif gpChoosePixelFormat == 0 {\n\t\treturn errors.New(\"ChoosePixelFormat\")\n\t}\n\tgpDescribePixelFormat = uintptr(getProcAddr(\"DescribePixelFormat\"))\n\tif gpDescribePixelFormat == 0 {\n\t\treturn errors.New(\"DescribePixelFormat\")\n\t}\n\tgpGetEnhMetaFilePixelFormat = uintptr(getProcAddr(\"GetEnhMetaFilePixelFormat\"))\n\tif gpGetEnhMetaFilePixelFormat == 0 {\n\t\treturn errors.New(\"GetEnhMetaFilePixelFormat\")\n\t}\n\tgpGetPixelFormat = uintptr(getProcAddr(\"GetPixelFormat\"))\n\tif gpGetPixelFormat == 0 {\n\t\treturn errors.New(\"GetPixelFormat\")\n\t}\n\tgpSetPixelFormat = uintptr(getProcAddr(\"SetPixelFormat\"))\n\tif gpSetPixelFormat == 0 {\n\t\treturn errors.New(\"SetPixelFormat\")\n\t}\n\tgpSwapBuffers = uintptr(getProcAddr(\"SwapBuffers\"))\n\tif gpSwapBuffers == 0 {\n\t\treturn errors.New(\"SwapBuffers\")\n\t}\n\tgpAllocateMemoryNV = uintptr(getProcAddr(\"wglAllocateMemoryNV\"))\n\tgpAssociateImageBufferEventsI3D = uintptr(getProcAddr(\"wglAssociateImageBufferEventsI3D\"))\n\tgpBeginFrameTrackingI3D = uintptr(getProcAddr(\"wglBeginFrameTrackingI3D\"))\n\tgpBindDisplayColorTableEXT = uintptr(getProcAddr(\"wglBindDisplayColorTableEXT\"))\n\tgpBindSwapBarrierNV = uintptr(getProcAddr(\"wglBindSwapBarrierNV\"))\n\tgpBindTexImageARB = uintptr(getProcAddr(\"wglBindTexImageARB\"))\n\tgpBindVideoCaptureDeviceNV = uintptr(getProcAddr(\"wglBindVideoCaptureDeviceNV\"))\n\tgpBindVideoDeviceNV = uintptr(getProcAddr(\"wglBindVideoDeviceNV\"))\n\tgpBindVideoImageNV = uintptr(getProcAddr(\"wglBindVideoImageNV\"))\n\tgpBlitContextFramebufferAMD = uintptr(getProcAddr(\"wglBlitContextFramebufferAMD\"))\n\tgpChoosePixelFormatARB = uintptr(getProcAddr(\"wglChoosePixelFormatARB\"))\n\tgpChoosePixelFormatEXT = uintptr(getProcAddr(\"wglChoosePixelFormatEXT\"))\n\tgpCopyContext = uintptr(getProcAddr(\"wglCopyContext\"))\n\tif gpCopyContext == 0 {\n\t\treturn errors.New(\"wglCopyContext\")\n\t}\n\tgpCopyImageSubDataNV = uintptr(getProcAddr(\"wglCopyImageSubDataNV\"))\n\tgpCreateAffinityDCNV = uintptr(getProcAddr(\"wglCreateAffinityDCNV\"))\n\tgpCreateAssociatedContextAMD = uintptr(getProcAddr(\"wglCreateAssociatedContextAMD\"))\n\tgpCreateAssociatedContextAttribsAMD = uintptr(getProcAddr(\"wglCreateAssociatedContextAttribsAMD\"))\n\tgpCreateBufferRegionARB = uintptr(getProcAddr(\"wglCreateBufferRegionARB\"))\n\tgpCreateContext = uintptr(getProcAddr(\"wglCreateContext\"))\n\tif gpCreateContext == 0 {\n\t\treturn errors.New(\"wglCreateContext\")\n\t}\n\tgpCreateContextAttribsARB = uintptr(getProcAddr(\"wglCreateContextAttribsARB\"))\n\tgpCreateDisplayColorTableEXT = uintptr(getProcAddr(\"wglCreateDisplayColorTableEXT\"))\n\tgpCreateImageBufferI3D = uintptr(getProcAddr(\"wglCreateImageBufferI3D\"))\n\tgpCreateLayerContext = uintptr(getProcAddr(\"wglCreateLayerContext\"))\n\tif gpCreateLayerContext == 0 {\n\t\treturn errors.New(\"wglCreateLayerContext\")\n\t}\n\tgpCreatePbufferARB = uintptr(getProcAddr(\"wglCreatePbufferARB\"))\n\tgpCreatePbufferEXT = uintptr(getProcAddr(\"wglCreatePbufferEXT\"))\n\tgpDXCloseDeviceNV = uintptr(getProcAddr(\"wglDXCloseDeviceNV\"))\n\tgpDXLockObjectsNV = uintptr(getProcAddr(\"wglDXLockObjectsNV\"))\n\tgpDXObjectAccessNV = uintptr(getProcAddr(\"wglDXObjectAccessNV\"))\n\tgpDXOpenDeviceNV = uintptr(getProcAddr(\"wglDXOpenDeviceNV\"))\n\tgpDXRegisterObjectNV = uintptr(getProcAddr(\"wglDXRegisterObjectNV\"))\n\tgpDXSetResourceShareHandleNV = uintptr(getProcAddr(\"wglDXSetResourceShareHandleNV\"))\n\tgpDXUnlockObjectsNV = uintptr(getProcAddr(\"wglDXUnlockObjectsNV\"))\n\tgpDXUnregisterObjectNV = uintptr(getProcAddr(\"wglDXUnregisterObjectNV\"))\n\tgpDelayBeforeSwapNV = uintptr(getProcAddr(\"wglDelayBeforeSwapNV\"))\n\tgpDeleteAssociatedContextAMD = uintptr(getProcAddr(\"wglDeleteAssociatedContextAMD\"))\n\tgpDeleteBufferRegionARB = uintptr(getProcAddr(\"wglDeleteBufferRegionARB\"))\n\tgpDeleteContext = uintptr(getProcAddr(\"wglDeleteContext\"))\n\tif gpDeleteContext == 0 {\n\t\treturn errors.New(\"wglDeleteContext\")\n\t}\n\tgpDeleteDCNV = uintptr(getProcAddr(\"wglDeleteDCNV\"))\n\tgpDescribeLayerPlane = uintptr(getProcAddr(\"wglDescribeLayerPlane\"))\n\tif gpDescribeLayerPlane == 0 {\n\t\treturn errors.New(\"wglDescribeLayerPlane\")\n\t}\n\tgpDestroyDisplayColorTableEXT = uintptr(getProcAddr(\"wglDestroyDisplayColorTableEXT\"))\n\tgpDestroyImageBufferI3D = uintptr(getProcAddr(\"wglDestroyImageBufferI3D\"))\n\tgpDestroyPbufferARB = uintptr(getProcAddr(\"wglDestroyPbufferARB\"))\n\tgpDestroyPbufferEXT = uintptr(getProcAddr(\"wglDestroyPbufferEXT\"))\n\tgpDisableFrameLockI3D = uintptr(getProcAddr(\"wglDisableFrameLockI3D\"))\n\tgpDisableGenlockI3D = uintptr(getProcAddr(\"wglDisableGenlockI3D\"))\n\tgpEnableFrameLockI3D = uintptr(getProcAddr(\"wglEnableFrameLockI3D\"))\n\tgpEnableGenlockI3D = uintptr(getProcAddr(\"wglEnableGenlockI3D\"))\n\tgpEndFrameTrackingI3D = uintptr(getProcAddr(\"wglEndFrameTrackingI3D\"))\n\tgpEnumGpuDevicesNV = uintptr(getProcAddr(\"wglEnumGpuDevicesNV\"))\n\tgpEnumGpusFromAffinityDCNV = uintptr(getProcAddr(\"wglEnumGpusFromAffinityDCNV\"))\n\tgpEnumGpusNV = uintptr(getProcAddr(\"wglEnumGpusNV\"))\n\tgpEnumerateVideoCaptureDevicesNV = uintptr(getProcAddr(\"wglEnumerateVideoCaptureDevicesNV\"))\n\tgpEnumerateVideoDevicesNV = uintptr(getProcAddr(\"wglEnumerateVideoDevicesNV\"))\n\tgpFreeMemoryNV = uintptr(getProcAddr(\"wglFreeMemoryNV\"))\n\tgpGenlockSampleRateI3D = uintptr(getProcAddr(\"wglGenlockSampleRateI3D\"))\n\tgpGenlockSourceDelayI3D = uintptr(getProcAddr(\"wglGenlockSourceDelayI3D\"))\n\tgpGenlockSourceEdgeI3D = uintptr(getProcAddr(\"wglGenlockSourceEdgeI3D\"))\n\tgpGenlockSourceI3D = uintptr(getProcAddr(\"wglGenlockSourceI3D\"))\n\tgpGetContextGPUIDAMD = uintptr(getProcAddr(\"wglGetContextGPUIDAMD\"))\n\tgpGetCurrentAssociatedContextAMD = uintptr(getProcAddr(\"wglGetCurrentAssociatedContextAMD\"))\n\tgpGetCurrentContext = uintptr(getProcAddr(\"wglGetCurrentContext\"))\n\tif gpGetCurrentContext == 0 {\n\t\treturn errors.New(\"wglGetCurrentContext\")\n\t}\n\tgpGetCurrentDC = uintptr(getProcAddr(\"wglGetCurrentDC\"))\n\tif gpGetCurrentDC == 0 {\n\t\treturn errors.New(\"wglGetCurrentDC\")\n\t}\n\tgpGetCurrentReadDCARB = uintptr(getProcAddr(\"wglGetCurrentReadDCARB\"))\n\tgpGetCurrentReadDCEXT = uintptr(getProcAddr(\"wglGetCurrentReadDCEXT\"))\n\tgpGetDigitalVideoParametersI3D = uintptr(getProcAddr(\"wglGetDigitalVideoParametersI3D\"))\n\tgpGetExtensionsStringARB = uintptr(getProcAddr(\"wglGetExtensionsStringARB\"))\n\tgpGetExtensionsStringEXT = uintptr(getProcAddr(\"wglGetExtensionsStringEXT\"))\n\tgpGetFrameUsageI3D = uintptr(getProcAddr(\"wglGetFrameUsageI3D\"))\n\tgpGetGPUIDsAMD = uintptr(getProcAddr(\"wglGetGPUIDsAMD\"))\n\tgpGetGPUInfoAMD = uintptr(getProcAddr(\"wglGetGPUInfoAMD\"))\n\tgpGetGammaTableI3D = uintptr(getProcAddr(\"wglGetGammaTableI3D\"))\n\tgpGetGammaTableParametersI3D = uintptr(getProcAddr(\"wglGetGammaTableParametersI3D\"))\n\tgpGetGenlockSampleRateI3D = uintptr(getProcAddr(\"wglGetGenlockSampleRateI3D\"))\n\tgpGetGenlockSourceDelayI3D = uintptr(getProcAddr(\"wglGetGenlockSourceDelayI3D\"))\n\tgpGetGenlockSourceEdgeI3D = uintptr(getProcAddr(\"wglGetGenlockSourceEdgeI3D\"))\n\tgpGetGenlockSourceI3D = uintptr(getProcAddr(\"wglGetGenlockSourceI3D\"))\n\tgpGetLayerPaletteEntries = uintptr(getProcAddr(\"wglGetLayerPaletteEntries\"))\n\tif gpGetLayerPaletteEntries == 0 {\n\t\treturn errors.New(\"wglGetLayerPaletteEntries\")\n\t}\n\tgpGetMscRateOML = uintptr(getProcAddr(\"wglGetMscRateOML\"))\n\tgpGetPbufferDCARB = uintptr(getProcAddr(\"wglGetPbufferDCARB\"))\n\tgpGetPbufferDCEXT = uintptr(getProcAddr(\"wglGetPbufferDCEXT\"))\n\tgpGetPixelFormatAttribfvARB = uintptr(getProcAddr(\"wglGetPixelFormatAttribfvARB\"))\n\tgpGetPixelFormatAttribfvEXT = uintptr(getProcAddr(\"wglGetPixelFormatAttribfvEXT\"))\n\tgpGetPixelFormatAttribivARB = uintptr(getProcAddr(\"wglGetPixelFormatAttribivARB\"))\n\tgpGetPixelFormatAttribivEXT = uintptr(getProcAddr(\"wglGetPixelFormatAttribivEXT\"))\n\tgpGetProcAddress = uintptr(getProcAddr(\"wglGetProcAddress\"))\n\tif gpGetProcAddress == 0 {\n\t\treturn errors.New(\"wglGetProcAddress\")\n\t}\n\tgpGetSwapIntervalEXT = uintptr(getProcAddr(\"wglGetSwapIntervalEXT\"))\n\tgpGetSyncValuesOML = uintptr(getProcAddr(\"wglGetSyncValuesOML\"))\n\tgpGetVideoDeviceNV = uintptr(getProcAddr(\"wglGetVideoDeviceNV\"))\n\tgpGetVideoInfoNV = uintptr(getProcAddr(\"wglGetVideoInfoNV\"))\n\tgpIsEnabledFrameLockI3D = uintptr(getProcAddr(\"wglIsEnabledFrameLockI3D\"))\n\tgpIsEnabledGenlockI3D = uintptr(getProcAddr(\"wglIsEnabledGenlockI3D\"))\n\tgpJoinSwapGroupNV = uintptr(getProcAddr(\"wglJoinSwapGroupNV\"))\n\tgpLoadDisplayColorTableEXT = uintptr(getProcAddr(\"wglLoadDisplayColorTableEXT\"))\n\tgpLockVideoCaptureDeviceNV = uintptr(getProcAddr(\"wglLockVideoCaptureDeviceNV\"))\n\tgpMakeAssociatedContextCurrentAMD = uintptr(getProcAddr(\"wglMakeAssociatedContextCurrentAMD\"))\n\tgpMakeContextCurrentARB = uintptr(getProcAddr(\"wglMakeContextCurrentARB\"))\n\tgpMakeContextCurrentEXT = uintptr(getProcAddr(\"wglMakeContextCurrentEXT\"))\n\tgpMakeCurrent = uintptr(getProcAddr(\"wglMakeCurrent\"))\n\tif gpMakeCurrent == 0 {\n\t\treturn errors.New(\"wglMakeCurrent\")\n\t}\n\tgpQueryCurrentContextNV = uintptr(getProcAddr(\"wglQueryCurrentContextNV\"))\n\tgpQueryFrameCountNV = uintptr(getProcAddr(\"wglQueryFrameCountNV\"))\n\tgpQueryFrameLockMasterI3D = uintptr(getProcAddr(\"wglQueryFrameLockMasterI3D\"))\n\tgpQueryFrameTrackingI3D = uintptr(getProcAddr(\"wglQueryFrameTrackingI3D\"))\n\tgpQueryGenlockMaxSourceDelayI3D = uintptr(getProcAddr(\"wglQueryGenlockMaxSourceDelayI3D\"))\n\tgpQueryMaxSwapGroupsNV = uintptr(getProcAddr(\"wglQueryMaxSwapGroupsNV\"))\n\tgpQueryPbufferARB = uintptr(getProcAddr(\"wglQueryPbufferARB\"))\n\tgpQueryPbufferEXT = uintptr(getProcAddr(\"wglQueryPbufferEXT\"))\n\tgpQuerySwapGroupNV = uintptr(getProcAddr(\"wglQuerySwapGroupNV\"))\n\tgpQueryVideoCaptureDeviceNV = uintptr(getProcAddr(\"wglQueryVideoCaptureDeviceNV\"))\n\tgpRealizeLayerPalette = uintptr(getProcAddr(\"wglRealizeLayerPalette\"))\n\tif gpRealizeLayerPalette == 0 {\n\t\treturn errors.New(\"wglRealizeLayerPalette\")\n\t}\n\tgpReleaseImageBufferEventsI3D = uintptr(getProcAddr(\"wglReleaseImageBufferEventsI3D\"))\n\tgpReleasePbufferDCARB = uintptr(getProcAddr(\"wglReleasePbufferDCARB\"))\n\tgpReleasePbufferDCEXT = uintptr(getProcAddr(\"wglReleasePbufferDCEXT\"))\n\tgpReleaseTexImageARB = uintptr(getProcAddr(\"wglReleaseTexImageARB\"))\n\tgpReleaseVideoCaptureDeviceNV = uintptr(getProcAddr(\"wglReleaseVideoCaptureDeviceNV\"))\n\tgpReleaseVideoDeviceNV = uintptr(getProcAddr(\"wglReleaseVideoDeviceNV\"))\n\tgpReleaseVideoImageNV = uintptr(getProcAddr(\"wglReleaseVideoImageNV\"))\n\tgpResetFrameCountNV = uintptr(getProcAddr(\"wglResetFrameCountNV\"))\n\tgpRestoreBufferRegionARB = uintptr(getProcAddr(\"wglRestoreBufferRegionARB\"))\n\tgpSaveBufferRegionARB = uintptr(getProcAddr(\"wglSaveBufferRegionARB\"))\n\tgpSendPbufferToVideoNV = uintptr(getProcAddr(\"wglSendPbufferToVideoNV\"))\n\tgpSetDigitalVideoParametersI3D = uintptr(getProcAddr(\"wglSetDigitalVideoParametersI3D\"))\n\tgpSetGammaTableI3D = uintptr(getProcAddr(\"wglSetGammaTableI3D\"))\n\tgpSetGammaTableParametersI3D = uintptr(getProcAddr(\"wglSetGammaTableParametersI3D\"))\n\tgpSetLayerPaletteEntries = uintptr(getProcAddr(\"wglSetLayerPaletteEntries\"))\n\tif gpSetLayerPaletteEntries == 0 {\n\t\treturn errors.New(\"wglSetLayerPaletteEntries\")\n\t}\n\tgpSetPbufferAttribARB = uintptr(getProcAddr(\"wglSetPbufferAttribARB\"))\n\tgpSetStereoEmitterState3DL = uintptr(getProcAddr(\"wglSetStereoEmitterState3DL\"))\n\tgpShareLists = uintptr(getProcAddr(\"wglShareLists\"))\n\tif gpShareLists == 0 {\n\t\treturn errors.New(\"wglShareLists\")\n\t}\n\tgpSwapBuffersMscOML = uintptr(getProcAddr(\"wglSwapBuffersMscOML\"))\n\tgpSwapIntervalEXT = uintptr(getProcAddr(\"wglSwapIntervalEXT\"))\n\tgpSwapLayerBuffers = uintptr(getProcAddr(\"wglSwapLayerBuffers\"))\n\tif gpSwapLayerBuffers == 0 {\n\t\treturn errors.New(\"wglSwapLayerBuffers\")\n\t}\n\tgpSwapLayerBuffersMscOML = uintptr(getProcAddr(\"wglSwapLayerBuffersMscOML\"))\n\tgpUseFontBitmaps = uintptr(getProcAddr(\"wglUseFontBitmapsW\"))\n\tif gpUseFontBitmaps == 0 {\n\t\treturn errors.New(\"wglUseFontBitmaps\")\n\t}\n\tgpUseFontOutlines = uintptr(getProcAddr(\"wglUseFontOutlinesW\"))\n\tif gpUseFontOutlines == 0 {\n\t\treturn errors.New(\"wglUseFontOutlines\")\n\t}\n\tgpWaitForMscOML = uintptr(getProcAddr(\"wglWaitForMscOML\"))\n\tgpWaitForSbcOML = uintptr(getProcAddr(\"wglWaitForSbcOML\"))\n\treturn nil\n}", "func DebugMessageCallback(callback unsafe.Pointer, userParam unsafe.Pointer) {\n\tsyscall.Syscall(gpDebugMessageCallback, 2, syscall.NewCallback(callback), uintptr(userParam), 0)\n}", "func _debug(ptr uint32, size uint32)", "func DebugMessageCallbackKHR(callback unsafe.Pointer, userParam unsafe.Pointer) {\n\tsyscall.Syscall(gpDebugMessageCallbackKHR, 2, syscall.NewCallback(callback), uintptr(userParam), 0)\n}", "func PassThrough(token float32) {\n C.glowPassThrough(gpPassThrough, (C.GLfloat)(token))\n}", "func DebugMessageInsert(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) {\n\tC.glowDebugMessageInsert(gpDebugMessageInsert, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf)))\n}", "func DebugMessageInsert(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) {\n\tC.glowDebugMessageInsert(gpDebugMessageInsert, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf)))\n}", "func DebugMessageControl(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) {\n C.glowDebugMessageControl(gpDebugMessageControl, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled)))\n}", "func BindFragDataLocation(program uint32, color uint32, name *int8) {\n C.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name)))\n}", "func InjectDebugCall(gp *g, fn any, regArgs *abi.RegArgs, stackArgs any, tkill func(tid int) error, returnOnUnsafePoint bool) (any, error) {\n\tif gp.lockedm == 0 {\n\t\treturn nil, plainError(\"goroutine not locked to thread\")\n\t}\n\n\ttid := int(gp.lockedm.ptr().procid)\n\tif tid == 0 {\n\t\treturn nil, plainError(\"missing tid\")\n\t}\n\n\tf := efaceOf(&fn)\n\tif f._type == nil || f._type.kind&kindMask != kindFunc {\n\t\treturn nil, plainError(\"fn must be a function\")\n\t}\n\tfv := (*funcval)(f.data)\n\n\ta := efaceOf(&stackArgs)\n\tif a._type != nil && a._type.kind&kindMask != kindPtr {\n\t\treturn nil, plainError(\"args must be a pointer or nil\")\n\t}\n\targp := a.data\n\tvar argSize uintptr\n\tif argp != nil {\n\t\targSize = (*ptrtype)(unsafe.Pointer(a._type)).elem.size\n\t}\n\n\th := new(debugCallHandler)\n\th.gp = gp\n\t// gp may not be running right now, but we can still get the M\n\t// it will run on since it's locked.\n\th.mp = gp.lockedm.ptr()\n\th.fv, h.regArgs, h.argp, h.argSize = fv, regArgs, argp, argSize\n\th.handleF = h.handle // Avoid allocating closure during signal\n\n\tdefer func() { testSigtrap = nil }()\n\tfor i := 0; ; i++ {\n\t\ttestSigtrap = h.inject\n\t\tnoteclear(&h.done)\n\t\th.err = \"\"\n\n\t\tif err := tkill(tid); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Wait for completion.\n\t\tnotetsleepg(&h.done, -1)\n\t\tif h.err != \"\" {\n\t\t\tswitch h.err {\n\t\t\tcase \"call not at safe point\":\n\t\t\t\tif returnOnUnsafePoint {\n\t\t\t\t\t// This is for TestDebugCallUnsafePoint.\n\t\t\t\t\treturn nil, h.err\n\t\t\t\t}\n\t\t\t\tfallthrough\n\t\t\tcase \"retry _Grunnable\", \"executing on Go runtime stack\", \"call from within the Go runtime\":\n\t\t\t\t// These are transient states. Try to get out of them.\n\t\t\t\tif i < 100 {\n\t\t\t\t\tusleep(100)\n\t\t\t\t\tGosched()\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil, h.err\n\t\t}\n\t\treturn h.panic, nil\n\t}\n}", "func FramebufferParameteri(target uint32, pname uint32, param int32) {\n C.glowFramebufferParameteri(gpFramebufferParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))\n}", "func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *int8) {\n C.glowGetProgramInfoLog(gpGetProgramInfoLog, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))\n}", "func BindFragDataLocationIndexed(program uint32, colorNumber uint32, index uint32, name *int8) {\n C.glowBindFragDataLocationIndexed(gpBindFragDataLocationIndexed, (C.GLuint)(program), (C.GLuint)(colorNumber), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))\n}", "func _debugf(format string, args ...interface{}) {\n\tif v(1) {\n\t\targs = append([]interface{}{_caller(2)}, args...)\n\t\tfmt.Printf(\"%s: \"+format+\"\\n\", args...)\n\t}\n}", "func (native *OpenGL) GLGetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) {\n\tgl.GetProgramInfoLog(program, bufSize, length, infoLog)\n}", "func GetVertexAttribLdv(index uint32, pname uint32, params *float64) {\n C.glowGetVertexAttribLdv(gpGetVertexAttribLdv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params)))\n}", "func (p *Provider) Debug(debug bool) {}", "func (p *Provider) Debug(debug bool) {}", "func (p *Provider) Debug(debug bool) {}", "func (p *Provider) Debug(debug bool) {}", "func DepthFunc(xfunc uint32) {\n C.glowDepthFunc(gpDepthFunc, (C.GLenum)(xfunc))\n}", "func AlphaFunc(xfunc uint32, ref float32) {\n C.glowAlphaFunc(gpAlphaFunc, (C.GLenum)(xfunc), (C.GLfloat)(ref))\n}", "func (native *OpenGL) LogOpenGLWarn() {\n\tif err := gl.GetError(); err != oglconsts.NO_ERROR {\n\t\tsettings.LogWarn(\"[OpenGL Error] Error occured: %v\", err)\n\t}\n}", "func (s *BasevhdlListener) EnterActual_parameter_part(ctx *Actual_parameter_partContext) {}", "func IfMydebug(f func()) {\n\t// f()\n}", "func Debug(v ...interface{}) { std.lprint(DEBUG, v...) }", "func (p *fakeLogger) Debug(msg string, fields ...string) {\n\tif p.callback != nil {\n\t\tp.callback(msg)\n\t}\n}", "func Dev(traceID string, funcName string, format string, a ...interface{}) {\n\tl.DevOffset(traceID, 1, funcName, format, a...)\n}", "func debug(m string, v interface{}) {\n\tif DebugMode {\n\t\tlog.Printf(m+\":%+v\", v)\n\t}\n}", "func GetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *int8) {\n C.glowGetShaderInfoLog(gpGetShaderInfoLog, (C.GLuint)(shader), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))\n}", "func (s *BaseGraffleParserListener) EnterBuilt_func_print(ctx *Built_func_printContext) {}", "func (fp MockProvider) Debug(b bool) {\n\tfp.faux.Debug(b)\n}", "func Debug(v bool, m ...interface{}) {\n\tif v {\n\t\tpc := make([]uintptr, 15)\n\t\tn := runtime.Callers(2, pc)\n\t\tframes := runtime.CallersFrames(pc[:n])\n\t\tframe, _ := frames.Next()\n\t\tlog.Printf(\"DEBUG [%v] %v\", frame.Function, fmt.Sprintln(m...))\n\t}\n}", "func (l *stubLogger) Debugf(format string, args ...interface{}) {}", "func ActiveShaderProgram(pipeline uint32, program uint32) {\n C.glowActiveShaderProgram(gpActiveShaderProgram, (C.GLuint)(pipeline), (C.GLuint)(program))\n}", "func GetVertexAttribfv(index uint32, pname uint32, params *float32) {\n C.glowGetVertexAttribfv(gpGetVertexAttribfv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))\n}", "func (s *BaseConcertoListener) EnterFuncCallArg(ctx *FuncCallArgContext) {}", "func Bcm2835_set_debug(Debug byte) {\n\tcDebug, _ := (C.uint8_t)(Debug), cgoAllocsUnknown\n\tC.bcm2835_set_debug(cDebug)\n}", "func TexParameterf(target Enum, pname Enum, param Float) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tcpname, _ := (C.GLenum)(pname), cgoAllocsUnknown\n\tcparam, _ := (C.GLfloat)(param), cgoAllocsUnknown\n\tC.glTexParameterf(ctarget, cpname, cparam)\n}", "func (s *BasePlSqlParserListener) ExitLibrary_debug(ctx *Library_debugContext) {}", "func Debugf(format string, v ...interface{}) { std.lprintf(DEBUG, format, v...) }", "func HandleLdv(em *Emulator, a int, b int) {\n addr := em.GetWordReg(b)\n data := em.VideoMemoryLoad(addr)\n em.SetReg(a, data)\n em.LogInstruction(\"ldv %s, %s -- VMEM[0x%04X] = 0x%02X\", RegisterNames[a],\n WordRegisterNames[b >> 1], addr, data)\n \n em.timer += 7;\n}", "func TexParameteri(target Enum, pname Enum, param Int) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tcpname, _ := (C.GLenum)(pname), cgoAllocsUnknown\n\tcparam, _ := (C.GLint)(param), cgoAllocsUnknown\n\tC.glTexParameteri(ctarget, cpname, cparam)\n}", "func UseProgram(program uint32) {\n C.glowUseProgram(gpUseProgram, (C.GLuint)(program))\n}", "func (native *OpenGL) GLGetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *uint8) {\n\tgl.GetShaderInfoLog(shader, bufSize, length, infoLog)\n}", "func BindVertexArray(array uint32) {\n C.glowBindVertexArray(gpBindVertexArray, (C.GLuint)(array))\n}", "func DrawTransformFeedbackInstanced(mode uint32, id uint32, instancecount int32) {\n C.glowDrawTransformFeedbackInstanced(gpDrawTransformFeedbackInstanced, (C.GLenum)(mode), (C.GLuint)(id), (C.GLsizei)(instancecount))\n}", "func DrawTransformFeedback(mode uint32, id uint32) {\n C.glowDrawTransformFeedback(gpDrawTransformFeedback, (C.GLenum)(mode), (C.GLuint)(id))\n}", "func selectDebug() {\n\tDEBUG_GATE = false\n\tDEBUG_STATE = true\n}", "func (l Layout) DebugRender(win *pixelgl.Window) {\n\tfor key := range l.Panels {\n\t\tpanel := l.CreatePanel(key)\n\t\tpanel.Draw(win)\n\t}\n\n\t//temp camera matrix\n\t//cam := pixel.IM.Scaled(l.centerPos, 1.0).Moved(l.centerPos)\n\t//win.SetMatrix(cam)\n}", "func dg() {\n\tgl.Dump() // doesn't need context.\n\n\t// Also print the opengl version which does need a context.\n\tapp := device.New(\"Dump\", 400, 100, 600, 600)\n\tfmt.Printf(\"%s %s\", gl.GetString(gl.RENDERER), gl.GetString(gl.VERSION))\n\tfmt.Printf(\" GLSL %s\\n\", gl.GetString(gl.SHADING_LANGUAGE_VERSION))\n\tapp.Dispose()\n}", "func GetDebugMessageLog(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *int8) uint32 {\n ret := C.glowGetDebugMessageLog(gpGetDebugMessageLog, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog)))\n return (uint32)(ret)\n}", "func (native *OpenGL) GLBindFragDataLocation(program uint32, color uint32, name *uint8) {\n\tgl.BindFragDataLocation(program, color, name)\n}", "func (l *ExtendedLevelFilteredLoggerWrapper) DebugFn(format string, params ParamsFn) {\n\tif l.level >= LevelDebug {\n\t\tl.delegate.Debug(l.sprintf(format, params))\n\t}\n}", "func handleDebugSignal(_ context.Context) {\n}", "func (_m *Logger) Debug(msg string, additionalValues ...interface{}) {\n\tvar _ca []interface{}\n\t_ca = append(_ca, msg)\n\t_ca = append(_ca, additionalValues...)\n\t_m.Called(_ca...)\n}", "func Debugf(msg ...interface{}) {\n\trunAdapters(DebugLog, FormattedOut, msg...)\n}", "func DepthFunc(func_ GLenum) {\n\tC.glDepthFunc(C.GLenum(func_))\n}", "func GetVertexAttribdv(index uint32, pname uint32, params *float64) {\n C.glowGetVertexAttribdv(gpGetVertexAttribdv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params)))\n}", "func FramebufferParameteri(target uint32, pname uint32, param int32) {\n\tC.glowFramebufferParameteri(gpFramebufferParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))\n}", "func FramebufferParameteri(target uint32, pname uint32, param int32) {\n\tC.glowFramebufferParameteri(gpFramebufferParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))\n}", "func (l *MemoryLogger) Debug(msg string, keyvals ...interface{}) {\n\tl.println(\"DEBUG\", msg, keyvals)\n}", "func LogDebug(context string, module string, info string) {\n log.Debug().\n Str(\"Context\", context).\n Str(\"Module\", module).\n Msg(info)\n}", "func (a CompatLoggerAdapter) Debugf(format string, v ...interface{}) {\n\ta.Printf(\"DEBUG: \"+format, v...)\n}", "func runtime_procPin()", "func (*ModuleBase) OnFrameChange() {}", "func Debugf(format string, args ...interface{}) { logRaw(LevelDebug, 2, format, args...) }", "func CallList(list uint32) {\n C.glowCallList(gpCallList, (C.GLuint)(list))\n}", "func (l *XORMLogBridge) Debugf(format string, v ...interface{}) {\n\tlog.Debugf(format, v...)\n}", "func DrawBuffer(mode uint32) {\n C.glowDrawBuffer(gpDrawBuffer, (C.GLenum)(mode))\n}", "func (ml *MemoryLogger) LogDebug(m ...interface{}) {\n\tml.RingBuffer.Add(fmt.Sprintf(\"debug: %v\", fmt.Sprint(m...)))\n}", "func (_m *Logger) Debug(args ...interface{}) {\n\tvar _ca []interface{}\n\t_ca = append(_ca, args...)\n\t_m.Called(_ca...)\n}", "func (s *BaseSyslParserListener) EnterView_param(ctx *View_paramContext) {}", "func (c Context) Debug(msg string) {\n\tc.Log(40, msg, GetCallingFunction())\n}", "func DBG(f string, a ...interface{}) {\n\tLog.LLog(slog.LDBG, 1, pDBG, f, a...)\n}", "func myDebug(format string, a ...interface{}) {\n\tif FlagDebug {\n\t\tformat = fmt.Sprintf(\"[DEBUG] %s\\n\", format)\n\t\tfmt.Fprintf(os.Stderr, format, a...)\n\t}\n}", "func (l BlackHole) Debug(_ string, _ ...Field) {}", "func BindFragDataLocation(program uint32, color uint32, name *uint8) {\n\tC.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name)))\n}", "func BindFragDataLocation(program uint32, color uint32, name *uint8) {\n\tC.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name)))\n}", "func Debugf(format string, args ...interface{}) {\n\tl.Debug().Msgf(format, args...)\n}", "func (lgr *lager) Debugf(msg string, v ...interface{}) {\n\tlgr.logf(Debug, msg, v...)\n}", "func Debug(args ...interface{}) {\n\tif defaultLgr == nil {\n\t\treturn\n\t}\n\tdefaultLgr.Debugf(strings.TrimSpace(strings.Repeat(\"%+v \", len(args))), args...)\n}", "func Debugf(format string, params ...interface{}){\n log.Debugf(format, params)\n}", "func (l nullLogger) Debug(msg string, ctx ...interface{}) {}", "func (e *Engine) Debugf(format string, a ...interface{}) {\n\te.debug.Printf(format, a...)\n}", "func (nl *NullLogger) LogDebug(m ...interface{}) {\n}", "func Debug(fn func()) {\n\n\tSetDumpCode(\"1\")\n\tdefer SetDumpCode(\"0\")\n\tfn()\n}", "func (h *ISADebugger) Func(ctx akita.HookCtx) {\n\twf, ok := ctx.Item.(*Wavefront)\n\tif !ok {\n\t\treturn\n\t}\n\n\t// For debugging\n\t// if wf.FirstWiFlatID != 0 {\n\t// \treturn\n\t// }\n\n\th.logWholeWf(wf)\n\t// if h.prevWf == nil || h.prevWf.FirstWiFlatID != wf.FirstWiFlatID {\n\t// \th.logWholeWf(wf)\n\t// } else {\n\t// \th.logDiffWf(wf)\n\t// }\n\n\t// h.stubWf(wf)\n}" ]
[ "0.7167712", "0.6670752", "0.6367215", "0.6367215", "0.6003104", "0.5930139", "0.5875492", "0.5819321", "0.56413215", "0.55396223", "0.55020416", "0.5496406", "0.54678655", "0.5454606", "0.53230804", "0.51372975", "0.51099735", "0.50893986", "0.50893986", "0.5085339", "0.5068794", "0.5043129", "0.5029593", "0.5005768", "0.49410978", "0.48869798", "0.48801482", "0.48797652", "0.4879299", "0.4879299", "0.4879299", "0.4879299", "0.48719752", "0.48626763", "0.48529056", "0.48429805", "0.48364204", "0.4803616", "0.4800673", "0.47836533", "0.47831783", "0.47705582", "0.47685364", "0.47666517", "0.4756316", "0.47360697", "0.4724752", "0.4719106", "0.47104588", "0.47100085", "0.47073781", "0.47036326", "0.46931276", "0.46769217", "0.467113", "0.4669539", "0.46667325", "0.46576202", "0.46572834", "0.46504417", "0.46462452", "0.46434653", "0.46320903", "0.46257004", "0.46190503", "0.46042216", "0.4598307", "0.45894802", "0.45842323", "0.45809287", "0.4579737", "0.45694348", "0.45694348", "0.45630613", "0.45557672", "0.45526826", "0.45499754", "0.4549652", "0.4543212", "0.45422256", "0.45380095", "0.4531931", "0.45310894", "0.45301014", "0.45260078", "0.4520262", "0.4519387", "0.45145577", "0.4511473", "0.45089963", "0.45089963", "0.45030308", "0.45018098", "0.45001215", "0.44922474", "0.44828737", "0.44819096", "0.4481506", "0.44804817", "0.44796103" ]
0.73665047
0
return a compressed texture image
вернуть сжатое изображение текстуры
func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) { C.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall6(gpGetCompressedTextureImage, 4, uintptr(texture), uintptr(level), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n C.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)\n}", "func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetCompressedTextureSubImage, 10, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(bufSize), uintptr(pixels), 0, 0)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tC.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tC.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)\n}", "func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {\n\tsyscall.Syscall(gpGetCompressedTexImage, 3, uintptr(target), uintptr(level), uintptr(img))\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage2D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage2D, 8, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(imageSize), uintptr(data), 0)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage3D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(depth), uintptr(border), uintptr(imageSize), uintptr(data))\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n C.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border, imageSize int32, pixels []float32) {\n\tgl.CompressedTexImage2D(uint32(target), level, uint32(internalformat), width, height, border, imageSize, unsafe.Pointer(&pixels[0]))\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) {\n\tgl.CompressedTexImage2D(uint32(target), int32(level), uint32(internalformat), int32(width), int32(height), int32(border), int32(len(data)), gl.Ptr(data))\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall12(gpCompressedTexSubImage3D, 11, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(imageSize), uintptr(data), 0)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexImage1D, 7, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(border), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexSubImage2D, 9, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(imageSize), uintptr(data))\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func (self *Graphics) GenerateTexture3O(resolution int, scaleMode int, padding int) *Texture{\n return &Texture{self.Object.Call(\"generateTexture\", resolution, scaleMode, padding)}\n}", "func CompressedTexSubImage2D(target GLEnum, level, xoffset, yoffset, width, height int32, format GLEnum, imageSize int32, pixels []float32) {\n\tgl.CompressedTexSubImage2D(uint32(target), level, xoffset, yoffset, width, height, uint32(format), imageSize, unsafe.Pointer(&pixels[0]))\n}", "func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpGetTextureSubImage, 12, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(bufSize), uintptr(pixels))\n}", "func Make(width, height int, internalformat int32, format, pixelType uint32,\n\tdata unsafe.Pointer, min, mag, s, t int32) Texture {\n\n\ttexture := Texture{0, gl.TEXTURE_2D, 0}\n\n\t// generate and bind texture\n\tgl.GenTextures(1, &texture.handle)\n\ttexture.Bind(0)\n\n\t// set texture properties\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, min)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, mag)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, s)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, t)\n\n\t// specify a texture image\n\tgl.TexImage2D(gl.TEXTURE_2D, 0, internalformat, int32(width), int32(height),\n\t\t0, format, pixelType, data)\n\n\t// unbind texture\n\ttexture.Unbind()\n\n\treturn texture\n}", "func Read(src image.Image) (*Image, error) {\n\t// Use fallback conversion for unknown image formats.\n\trgba, ok := src.(*image.RGBA)\n\tif !ok {\n\t\treturn Read(fallback(src))\n\t}\n\t// Use fallback conversion for subimages.\n\twidth, height := rgba.Rect.Dx(), rgba.Rect.Dy()\n\tif rgba.Stride != 4*width {\n\t\treturn Read(fallback(src))\n\t}\n\t// Create a read-only texture based on the pixels of the src image.\n\tt := C.sfTexture_create(C.uint(width), C.uint(height))\n\tif t == nil {\n\t\treturn nil, fmt.Errorf(\"texture.Read: unable to create %dx%d texture\", width, height)\n\t}\n\ttex := &Image{\n\t\ttex: t,\n\t}\n\tpix := (*C.sfUint8)(unsafe.Pointer(&rgba.Pix[0]))\n\tC.sfTexture_updateFromPixels(tex.tex, pix, C.uint(width), C.uint(height), 0, 0)\n\t// Create a sprite for the texture.\n\tsprite := C.sfSprite_create()\n\tif sprite == nil {\n\t\treturn nil, errors.New(\"texture.Read: unable to create sprite\")\n\t}\n\ttex.sprite = sprite\n\tC.sfSprite_setTexture(tex.sprite, tex.tex, C.sfTrue)\n\treturn tex, nil\n}", "func (f *Font) GetTexture() *Texture { return f.texture }", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexImage2D(target Enum, level Int, internalformat Enum, width Sizei, height Sizei, border Int, imageSize Sizei, data unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcinternalformat, _ := (C.GLenum)(internalformat), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcborder, _ := (C.GLint)(border), cgoAllocsUnknown\n\tcimageSize, _ := (C.GLsizei)(imageSize), cgoAllocsUnknown\n\tcdata, _ := (unsafe.Pointer)(unsafe.Pointer(data)), cgoAllocsUnknown\n\tC.glCompressedTexImage2D(ctarget, clevel, cinternalformat, cwidth, cheight, cborder, cimageSize, cdata)\n}", "func New(width uint16, height uint16) *Texture {\n\tt := &Texture{\n\t\twidth: width,\n\t\theight: height,\n\t\tpixels: make([]rgb565.Rgb565Color, width*height),\n\t}\n\n\tfor i := range t.pixels {\n\t\tt.pixels[i] = rgb565.New(0x00, 0x00, 0x00)\n\t}\n\n\treturn t\n}", "func (self *Graphics) GenerateTexture2O(resolution int, scaleMode int) *Texture{\n return &Texture{self.Object.Call(\"generateTexture\", resolution, scaleMode)}\n}", "func GetTextureImage(texture uint32, level int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureImage(gpGetTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func GetTextureImage(texture uint32, level int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tC.glowGetTextureImage(gpGetTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)\n}", "func CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) {\n\tgl.CompressedTexSubImage2D(uint32(target), int32(level), int32(xoffset), int32(yoffset), int32(width), int32(height), uint32(format), int32(len(data)), gl.Ptr(data))\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tC.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tC.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)\n}", "func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {\n\tsyscall.Syscall9(gpCompressedTexSubImage1D, 7, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(imageSize), uintptr(data), 0, 0)\n}", "func (t Texture3D) GetData() []byte {\n\t// TODO do this in batches/stream to avoid memory limitations\n\tvar data = make([]byte, t.width*t.height*t.depth*t.texelSize)\n\tt.Bind()\n\tgl.PixelStorei(gl.PACK_ALIGNMENT, t.alignment)\n\tgl.GetTexImage(gl.TEXTURE_3D, 0, t.format, gl.UNSIGNED_BYTE, unsafe.Pointer(&data[0]))\n\tt.Unbind()\n\treturn data\n}", "func (bm Blendmap) Texture() *gl.Texture {\n\treturn bm.Map.id\n}", "func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {\n\tsyscall.Syscall9(gpCopyTextureSubImage3D, 9, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(x), uintptr(y), uintptr(width), uintptr(height))\n}", "func GetTextureImage(texture uint32, level int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {\n\tsyscall.Syscall6(gpGetTextureImage, 6, uintptr(texture), uintptr(level), uintptr(format), uintptr(xtype), uintptr(bufSize), uintptr(pixels))\n}", "func (w *Worley) GenerateTexture(tex *texture.Texture) {\n\tgl.BindImageTexture(0, tex.GetHandle(), 0, false, 0, gl.READ_WRITE, gl.RGBA32F)\n\tgl.BindImageTexture(1, w.noisetexture.GetHandle(), 0, false, 0, gl.READ_ONLY, gl.RGBA32F)\n\n\tw.computeshader.Use()\n\tw.computeshader.UpdateInt32(\"uWidth\", w.width)\n\tw.computeshader.UpdateInt32(\"uHeight\", w.height)\n\tw.computeshader.UpdateInt32(\"uResolution\", w.resolution)\n\tw.computeshader.UpdateInt32(\"uOctaves\", w.octaves)\n\tw.computeshader.UpdateFloat32(\"uRadius\", w.radius)\n\tw.computeshader.UpdateFloat32(\"uRadiusScale\", w.radiusscale)\n\tw.computeshader.UpdateFloat32(\"uBrightness\", w.brightness)\n\tw.computeshader.UpdateFloat32(\"uContrast\", w.contrast)\n\tw.computeshader.UpdateFloat32(\"uScale\", w.scale)\n\tw.computeshader.UpdateFloat32(\"uPersistance\", w.persistance)\n\tw.computeshader.Compute(uint32(w.width), uint32(w.height), 1)\n\tw.computeshader.Compute(1024, 1024, 1)\n\tw.computeshader.Release()\n\n\tgl.MemoryBarrier(gl.ALL_BARRIER_BITS)\n\n\tgl.BindImageTexture(0, 0, 0, false, 0, gl.WRITE_ONLY, gl.RGBA32F)\n\tgl.BindImageTexture(1, 0, 0, false, 0, gl.READ_ONLY, gl.RGBA32F)\n}", "func (t *Three) Texture() *Texture {\n\tp := t.ctx.Get(\"Texture\")\n\treturn TextureFromJSObject(p)\n}", "func CompressedTexSubImage2D(target Enum, level Int, xoffset Int, yoffset Int, width Sizei, height Sizei, format Enum, imageSize Sizei, data unsafe.Pointer) {\n\tctarget, _ := (C.GLenum)(target), cgoAllocsUnknown\n\tclevel, _ := (C.GLint)(level), cgoAllocsUnknown\n\tcxoffset, _ := (C.GLint)(xoffset), cgoAllocsUnknown\n\tcyoffset, _ := (C.GLint)(yoffset), cgoAllocsUnknown\n\tcwidth, _ := (C.GLsizei)(width), cgoAllocsUnknown\n\tcheight, _ := (C.GLsizei)(height), cgoAllocsUnknown\n\tcformat, _ := (C.GLenum)(format), cgoAllocsUnknown\n\tcimageSize, _ := (C.GLsizei)(imageSize), cgoAllocsUnknown\n\tcdata, _ := (unsafe.Pointer)(unsafe.Pointer(data)), cgoAllocsUnknown\n\tC.glCompressedTexSubImage2D(ctarget, clevel, cxoffset, cyoffset, cwidth, cheight, cformat, cimageSize, cdata)\n}", "func GetTexImage(target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowGetTexImage(gpGetTexImage, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func (self *GameObjectCreator) RenderTexture4O(width int, height int, key string, addToCache bool) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width, height, key, addToCache)}\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTextureSubImage3D, 11, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(zoffset), uintptr(width), uintptr(height), uintptr(depth), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func (self *Graphics) GenerateTexture1O(resolution int) *Texture{\n return &Texture{self.Object.Call(\"generateTexture\", resolution)}\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func (c *Canvas) Texture() *glhf.Texture {\n\treturn c.gf.Texture()\n}", "func compressBlock(block *image.RGBA) []byte {\n\n\tvar minR, maxR, minG, maxG byte = 255, 0, 255, 0\n\tfor y := 0; y < 4; y++ {\n\t\tfor x := 0; x < 4; x++ {\n\t\t\tc := block.RGBAAt(x, y)\n\n\t\t\tif c.R < minR {\n\t\t\t\tminR = c.R\n\t\t\t}\n\t\t\tif c.R > maxR {\n\t\t\t\tmaxR = c.R\n\t\t\t}\n\n\t\t\tif c.G < minG {\n\t\t\t\tminG = c.G\n\t\t\t}\n\t\t\tif c.G > maxG {\n\t\t\t\tmaxG = c.G\n\t\t\t}\n\t\t}\n\t}\n\n\tpalR := generatePalette(normalize(minR), normalize(maxR))\n\tpalG := generatePalette(normalize(minG), normalize(maxG))\n\tnearest := func(pal [8]float64, v byte) byte {\n\t\tni := 0\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tif math.Abs(pal[i]-normalize(v)) < math.Abs(pal[ni]-normalize(v)) {\n\t\t\t\tni = i\n\t\t\t}\n\t\t}\n\t\treturn byte(ni)\n\t}\n\n\t//Compare red and green values and select closest in palette\n\trIndexU, gIndexU := uint64(0), uint64(0)\n\tfor y := 0; y < 4; y++ {\n\t\tfor x := 0; x < 4; x++ {\n\t\t\tc := block.RGBAAt(x, y)\n\t\t\trIndexU = (rIndexU << 3) | uint64(nearest(palR, c.R))\n\t\t\tgIndexU = (gIndexU << 3) | uint64(nearest(palG, c.G))\n\t\t}\n\t}\n\n\trIxBytes, gIxBytes := make([]byte, 8), make([]byte, 8)\n\tbinary.BigEndian.PutUint64(rIxBytes, rIndexU)\n\tbinary.BigEndian.PutUint64(gIxBytes, gIndexU)\n\n\tblockBytes := make([]byte, 16)\n\tblockBytes[0] = denormalize(palR[0])\n\tblockBytes[1] = denormalize(palR[1])\n\tcopy(blockBytes[2:8], rIxBytes[2:8])\n\n\tblockBytes[8] = denormalize(palG[0])\n\tblockBytes[9] = denormalize(palG[1])\n\tcopy(blockBytes[10:], gIxBytes[2:8])\n\n\treturn blockBytes\n}", "func (self *TileSprite) TilingTexture() *PIXITexture{\n return &PIXITexture{self.Object.Get(\"tilingTexture\")}\n}", "func (self *TileSprite) Texture() *Texture{\n return &Texture{self.Object.Get(\"texture\")}\n}", "func GetTexImage(target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall6(gpGetTexImage, 5, uintptr(target), uintptr(level), uintptr(format), uintptr(xtype), uintptr(pixels), 0)\n}", "func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func pixelsToTexture(renderer *sdl.Renderer, pixels []byte, w, h int) *sdl.Texture {\n\t// AGBR is backwards from way we will be filling in out bytes\n\ttex, err := renderer.CreateTexture(sdl.PIXELFORMAT_ABGR8888, sdl.TEXTUREACCESS_STREAMING, int32(w), int32(h))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ttex.Update(nil, pixels, w*4) // Can't provide a rectangle, pitch = 4 bytes per pixel\n\treturn tex\n}", "func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexImage3D(gpTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func NewTexture(scene *Scene, element *Element) *Texture {\n\tt := &Texture{\n\t\tObject: *NewObject(scene, element),\n\t}\n\treturn t\n}", "func (md MetalDrawable) Texture() mtl.Texture {\n\treturn mtl.NewTexture(C.MetalDrawable_Texture(md.metalDrawable))\n}", "func TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) {\n\tp := unsafe.Pointer(nil)\n\tif len(data) > 0 {\n\t\tp = gl.Ptr(&data[0])\n\t}\n\tgl.TexImage2D(uint32(target), int32(level), int32(format), int32(width), int32(height), 0, uint32(format), uint32(ty), p)\n}", "func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall12(gpTexImage3D, 10, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(depth), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func (self *Graphics) GenerateTexture() *Texture{\n return &Texture{self.Object.Call(\"generateTexture\")}\n}", "func YinYang(width uint16, height uint16) *Texture {\n\tt := New(width, height)\n\tfor y := uint16(0); y < height/2; y++ {\n\t\tfor x := uint16(0); x < width; x++ {\n\t\t\tt.Set(x, y, rgb565.New(0xFF, 0xFF, 0xFF))\n\t\t}\n\t}\n\tfor y := uint16(height/2) + 1; y < height; y++ {\n\t\tfor x := uint16(0); x < width; x++ {\n\t\t\tt.Set(x, y, rgb565.New(0x00, 0x00, 0x00))\n\t\t}\n\t}\n\treturn t\n}", "func (self *GameObjectCreator) RenderTexture2O(width int, height int) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width, height)}\n}", "func (self *TileSprite) TintedTexture() *Canvas{\n return &Canvas{self.Object.Get(\"tintedTexture\")}\n}", "func (x *FzCompressedImage) Ref() *C.fz_compressed_image {\n\tif x == nil {\n\t\treturn nil\n\t}\n\treturn (*C.fz_compressed_image)(unsafe.Pointer(x))\n}", "func GetTexImage(target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowGetTexImage(gpGetTexImage, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func GetTexImage(target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tC.glowGetTexImage(gpGetTexImage, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels)\n}", "func TexImage2D(target GLEnum, level int32, internalformat GLEnum, width, height, border int32, format, xtype GLEnum, pixels []float32) {\n\tgl.TexImage2D(uint32(target), level, int32(internalformat), width, height, border, uint32(format), uint32(xtype), unsafe.Pointer(&pixels[0]))\n}", "func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTexImage2D, 9, uintptr(target), uintptr(level), uintptr(internalformat), uintptr(width), uintptr(height), uintptr(border), uintptr(format), uintptr(xtype), uintptr(pixels))\n}", "func (gstr *GlyphString) GetTexture() *Texture { return gstr.font.GetTexture() }", "func (self *GameObjectCreator) RenderTexture3O(width int, height int, key string) *RenderTexture{\n return &RenderTexture{self.Object.Call(\"renderTexture\", width, height, key)}\n}", "func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {\n\tsyscall.Syscall9(gpTextureSubImage1D, 7, uintptr(texture), uintptr(level), uintptr(xoffset), uintptr(width), uintptr(format), uintptr(xtype), uintptr(pixels), 0, 0)\n}", "func (fnt *Font) Texture() *Texture {\n\treturn fnt.texture\n}", "func GetTexParameteriv(dst []int32, target, pname Enum) {\n\tgl.GetTexParameteriv(uint32(target), uint32(pname), &dst[0])\n}" ]
[ "0.7429074", "0.69827163", "0.69083256", "0.69083256", "0.6807672", "0.66595125", "0.66595125", "0.6630492", "0.64481664", "0.64481664", "0.63997597", "0.61933315", "0.61933315", "0.6182891", "0.61170536", "0.6085721", "0.6085721", "0.6069289", "0.5932974", "0.5835475", "0.5835475", "0.5824646", "0.57773155", "0.5765082", "0.5757285", "0.5712679", "0.568835", "0.5643279", "0.5634396", "0.5634396", "0.5629634", "0.5623947", "0.5615976", "0.5615976", "0.55715525", "0.55143416", "0.55143416", "0.54823136", "0.5467294", "0.5467294", "0.5448307", "0.5436591", "0.5431756", "0.5428443", "0.5420738", "0.5406705", "0.538194", "0.538194", "0.53549176", "0.5338835", "0.53283536", "0.52523255", "0.52523255", "0.5248293", "0.5219693", "0.5219693", "0.5210404", "0.5210404", "0.52057016", "0.5204755", "0.5195729", "0.5182997", "0.51720864", "0.5171173", "0.51650214", "0.5150974", "0.5150939", "0.50813365", "0.5079786", "0.50686246", "0.5045119", "0.5045119", "0.50385165", "0.5034734", "0.5028743", "0.5025094", "0.5017673", "0.49454033", "0.49440882", "0.4931834", "0.49014774", "0.4900459", "0.48994422", "0.48974404", "0.48951933", "0.48929474", "0.48772106", "0.4865013", "0.48636416", "0.48514274", "0.48482236", "0.48482236", "0.48312712", "0.48286036", "0.48194554", "0.4812315", "0.48058435", "0.47964692", "0.47918478" ]
0.752569
1
AddDefaultIndexes registers the default list of indexes.
AddDefaultIndexes регистрирует список по умолчанию индексов.
func AddDefaultIndexes(ctx context.Context, mgr ctrl.Manager) error { if err := ByMachineNode(ctx, mgr); err != nil { return err } if err := ByMachineProviderID(ctx, mgr); err != nil { return err } if feature.Gates.Enabled(feature.ClusterTopology) { if err := ByClusterClassName(ctx, mgr); err != nil { return err } } if feature.Gates.Enabled(feature.MachinePool) { if err := ByMachinePoolNode(ctx, mgr); err != nil { return err } if err := ByMachinePoolProviderID(ctx, mgr); err != nil { return err } } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (f *AutoIndexingServiceGetIndexesFunc) SetDefaultHook(hook func(context.Context, shared.GetIndexesOptions) ([]types.Index, int, error)) {\n\tf.defaultHook = hook\n}", "func (f *ResolverGetIndexesByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]dbstore.Index, error)) {\n\tf.defaultHook = hook\n}", "func (f *AutoIndexingServiceGetIndexesByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]types.Index, error)) {\n\tf.defaultHook = hook\n}", "func ensureDefaultIndexIfNoneExist() error {\n\tidx, err := indexoperations.ListIndexes(paths)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to retrieve plugin indexes\")\n\t}\n\tif len(idx) > 0 {\n\t\tklog.V(3).Infof(\"Found %d indexes, skipping adding default index.\", len(idx))\n\t\treturn nil\n\t}\n\n\tklog.V(3).Infof(\"No index found, add default index.\")\n\tdefaultIndex := index.DefaultIndex()\n\tfmt.Fprintf(os.Stderr, \"Adding \\\"default\\\" plugin index from %s.\\n\", defaultIndex)\n\treturn errors.Wrap(indexoperations.AddIndex(paths, constants.DefaultIndexName, defaultIndex),\n\t\t\"failed to add default plugin index in absence of no indexes\")\n}", "func (f *DBStoreDeleteOldIndexesFunc) SetDefaultHook(hook func(context.Context, time.Duration, time.Time) (int, error)) {\n\tf.defaultHook = hook\n}", "func (f *AutoIndexingServiceGetIndexesFunc) SetDefaultReturn(r0 []types.Index, r1 int, r2 error) {\n\tf.SetDefaultHook(func(context.Context, shared.GetIndexesOptions) ([]types.Index, int, error) {\n\t\treturn r0, r1, r2\n\t})\n}", "func (f *ResolverGetIndexesByIDsFunc) SetDefaultReturn(r0 []dbstore.Index, r1 error) {\n\tf.SetDefaultHook(func(context.Context, ...int) ([]dbstore.Index, error) {\n\t\treturn r0, r1\n\t})\n}", "func (f *AutoIndexingServiceGetIndexesByIDsFunc) SetDefaultReturn(r0 []types.Index, r1 error) {\n\tf.SetDefaultHook(func(context.Context, ...int) ([]types.Index, error) {\n\t\treturn r0, r1\n\t})\n}", "func (f *DBStoreDeleteIndexesWithoutRepositoryFunc) SetDefaultHook(hook func(context.Context, time.Time) (map[int]int, error)) {\n\tf.defaultHook = hook\n}", "func (f *ResolverIndexConnectionResolverFunc) SetDefaultHook(hook func(dbstore.GetIndexesOptions) *resolvers.IndexesResolver) {\n\tf.defaultHook = hook\n}", "func (c *Couchbase) RegisterIndexes(indexes []*Index) {\n\tc.indexes = indexes\n}", "func (d *DefaulterBuilder) AddDefault(f *ResourceFunction) {\n\tif !d.resource.Equals(f.Resource(), astmodel.EqualityOverrides{}) {\n\t\tpanic(\"cannot add default function on non-matching object types\")\n\t}\n\td.defaults = append(d.defaults, f)\n}", "func DefaultMacros() []LBuiltinDef {\n\tops := make([]LBuiltinDef, len(langMacros)+len(userMacros))\n\tfor i := range langMacros {\n\t\tops[i] = langMacros[i]\n\t}\n\toffset := len(langMacros)\n\tfor i := range userMacros {\n\t\tops[offset+i] = langMacros[i]\n\t}\n\treturn ops\n}", "func DefaultIndexer(r *http.Request) interface{} {\n\treturn r.Method + \":\" + path.Clean(r.URL.Path)\n}", "func (f *ResolverGetIndexByIDFunc) SetDefaultHook(hook func(context.Context, int) (dbstore.Index, bool, error)) {\n\tf.defaultHook = hook\n}", "func (f *AutoIndexingServiceGetIndexByIDFunc) SetDefaultHook(hook func(context.Context, int) (types.Index, bool, error)) {\n\tf.defaultHook = hook\n}", "func (s *BasePlSqlParserListener) EnterModify_index_default_attrs(ctx *Modify_index_default_attrsContext) {\n}", "func (c *Client) Default(indexName string) (bool, error) {\n\tclient := c.client\n\n\tia, err := c.indexAliases()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tif _, ok := ia[indexName]; !ok {\n\t\terr := fmt.Errorf(\"Index %s does not exists\", indexName)\n\t\treturn false, err\n\t}\n\n\taliasService := client.Alias()\n\tfor k, vs := range ia {\n\t\tif utils.ContainsString(vs, DefaultAliasName) {\n\t\t\t_, err := aliasService.Remove(k, DefaultAliasName).Do()\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\t}\n\n\tack, err := aliasService.Add(indexName, DefaultAliasName).Do()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn ack.Acknowledged, nil\n}", "func (f *DBStoreDeleteOldIndexesFunc) SetDefaultReturn(r0 int, r1 error) {\n\tf.SetDefaultHook(func(context.Context, time.Duration, time.Time) (int, error) {\n\t\treturn r0, r1\n\t})\n}", "func (o SparseCloudSnapshotAccountsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (o *EventsScalarQuery) SetIndexes(v []string) {\n\to.Indexes = v\n}", "func (db *DB) AddIndex(indexes ...*Index) error {\n\tfunc() {\n\t\tdb.m.Lock()\n\t\tdefer db.m.Unlock()\n\t\tfor _, v := range indexes {\n\t\t\tdb.indexes[v.name] = v\n\t\t}\n\t}()\n\tdb.m.RLock()\n\tdefer db.m.RUnlock()\n\treturn db.Update(func(tx *Tx) error {\n\t\tfor _, v := range db.indexes {\n\t\t\tif _, err := tx.CreateBucketIfNotExists([]byte(v.name)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := tx.CreateBucketIfNotExists([]byte(v.name + bkkeyssuffix)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n}", "func (repo *mongoBaseRepo) CreateIndexes(indexes interface{}, args ...interface{}) ([]string, error) {\n\ttimeout := DefaultTimeout\n\topts := &options.CreateIndexesOptions{}\n\n\tfor i := 0; i < len(args); i++ {\n\t\tswitch val := args[i].(type) {\n\t\tcase time.Duration:\n\t\t\ttimeout = val\n\t\tcase *options.CreateIndexesOptions:\n\t\t\topts = val\n\t\t}\n\t}\n\n\t// Convert indexModels\n\tindexModels, ok := indexes.([]mongo.IndexModel)\n\tif !ok {\n\t\treturn []string{}, ErrIndexConvert\n\t}\n\n\t// create indexes\n\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\tdefer cancel()\n\n\treturn repo.collection.Indexes().CreateMany(ctx, indexModels, opts)\n}", "func (p *Parser) AddDefaultActions(data string) error {\n\tp.defaultActions = append(p.defaultActions, data)\n\treturn nil\n}", "func (o SparseStatsQueriesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (g *Graph) addIndexes(schema *load.Schema) {\n\ttyp, _ := g.typ(schema.Name)\n\tfor _, idx := range schema.Indexes {\n\t\tcheck(typ.AddIndex(idx), \"invalid index for schema %q\", schema.Name)\n\t}\n}", "func (conf *Config) CreateIndexes(client *pilosa.Client) error {\n\treturn conf.CompareIndexes(client, true, true)\n}", "func DefaultSpecialOps() []LBuiltinDef {\n\tops := make([]LBuiltinDef, len(langSpecialOps)+len(userSpecialOps))\n\tfor i := range langSpecialOps {\n\t\tops[i] = langSpecialOps[i]\n\t}\n\toffset := len(langSpecialOps)\n\tfor i := range userSpecialOps {\n\t\tops[offset+i] = langSpecialOps[i]\n\t}\n\treturn ops\n}", "func (f *ResolverIndexConfigurationFunc) SetDefaultHook(hook func(context.Context, int) ([]byte, error)) {\n\tf.defaultHook = hook\n}", "func (o SparseAccessibleNamespacesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func (o SparseMetricsQueriesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (tbl DbCompoundTable) CreateIndexes(ifNotExist bool) (err error) {\n\n\terr = tbl.CreateAlphaBetaIndex(ifNotExist)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (f *ResolverIndexConnectionResolverFunc) SetDefaultReturn(r0 *resolvers.IndexesResolver) {\n\tf.SetDefaultHook(func(dbstore.GetIndexesOptions) *resolvers.IndexesResolver {\n\t\treturn r0\n\t})\n}", "func (o SparseEnforcerReportsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func RegisterDefaults(scheme *runtime.Scheme) error {\n\tscheme.AddTypeDefaultingFunc(&v1.DaemonSet{}, func(obj interface{}) { SetObjectDefaults_DaemonSet(obj.(*v1.DaemonSet)) })\n\tscheme.AddTypeDefaultingFunc(&v1.DaemonSetList{}, func(obj interface{}) { SetObjectDefaults_DaemonSetList(obj.(*v1.DaemonSetList)) })\n\tscheme.AddTypeDefaultingFunc(&v1.Deployment{}, func(obj interface{}) { SetObjectDefaults_Deployment(obj.(*v1.Deployment)) })\n\tscheme.AddTypeDefaultingFunc(&v1.DeploymentList{}, func(obj interface{}) { SetObjectDefaults_DeploymentList(obj.(*v1.DeploymentList)) })\n\tscheme.AddTypeDefaultingFunc(&v1.ReplicaSet{}, func(obj interface{}) { SetObjectDefaults_ReplicaSet(obj.(*v1.ReplicaSet)) })\n\tscheme.AddTypeDefaultingFunc(&v1.ReplicaSetList{}, func(obj interface{}) { SetObjectDefaults_ReplicaSetList(obj.(*v1.ReplicaSetList)) })\n\tscheme.AddTypeDefaultingFunc(&v1.StatefulSet{}, func(obj interface{}) { SetObjectDefaults_StatefulSet(obj.(*v1.StatefulSet)) })\n\tscheme.AddTypeDefaultingFunc(&v1.StatefulSetList{}, func(obj interface{}) { SetObjectDefaults_StatefulSetList(obj.(*v1.StatefulSetList)) })\n\treturn nil\n}", "func addIndexes() {\n\tvar err error\n\n\tufIndex1 := mgo.Index{\n\t\tKey: []string{\"codigo\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\tmunicipioIndex1 := mgo.Index{\n\t\tKey: []string{\"codigo\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\t// Add indexes into MongoDB\n\tsession := Session.Copy()\n\tdefer session.Close()\n\tufCol := session.DB(commons.AppConfig.Database).C(\"ufs\")\n\tmunicipioCol := session.DB(commons.AppConfig.Database).C(\"municipios\")\n\n\t// cria indice codigo para UF\n\terr = ufCol.EnsureIndex(ufIndex1)\n\tif err != nil {\n\t\tlog.Fatalf(\"[addIndexes]: %s\\n\", err)\n\t}\n\tlog.Println(\"Indice para UF criado com sucesso\")\n\n\t// cria indice codigo para Municipio\n\terr = municipioCol.EnsureIndex(municipioIndex1)\n\tif err != nil {\n\t\tlog.Fatalf(\"[addIndexes]: %s\\n\", err)\n\t}\n\tlog.Println(\"Indice para Municipio criado com sucesso\")\n\n}", "func (o SparseOAUTHKeysList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func addIndexes() {\n\tvar err error\n\tuserIndex := mgo.Index{\n\t\tKey: []string{\"email\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\t// Add indexes into MongoDB\n\tsession := GetSession().Copy()\n\tdefer session.Close()\n\tuserCol := session.DB(AppConfig.Database).C(\"users\")\n\n\terr = userCol.EnsureIndex(userIndex)\n\tif err != nil {\n\t\tlog.Fatalf(\"[addIndexes]: %s\\n\", err)\n\t}\n}", "func (f *ResolverDeleteIndexByIDFunc) SetDefaultHook(hook func(context.Context, int) error) {\n\tf.defaultHook = hook\n}", "func NewDefaultSourcesWithDefaults(filePaths []string, prefix, delimiter string, defaults Source, additionalSources ...Source) (sources []Source) {\n\tsources = []Source{defaults}\n\n\tsources = append(sources, NewDefaultSources(filePaths, prefix, delimiter, additionalSources...)...)\n\n\treturn sources\n}", "func (h *Root) indexDefault(ctx context.Context, w http.ResponseWriter, r *http.Request, params map[string]string) error {\n\treturn h.Renderer.Render(ctx, w, r, tmplLayoutSite, \"site-index.gohtml\", web.MIMETextHTMLCharsetUTF8, http.StatusOK, nil)\n}", "func (o SparseAPIChecksList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func RegisterDefaultChecks(mux mux, checks ...Checker) {\n\tRegisterPingEndpoint(mux)\n\tInstallPathHandler(mux, \"/healthz\", checks...)\n}", "func DefaultGroups(clusterName, addonName string) []string {\n\treturn []string{\n\t\tfmt.Sprintf(\"system:open-cluster-management:cluster:%s:addon:%s\", clusterName, addonName),\n\t\tfmt.Sprintf(\"system:open-cluster-management:addon:%s\", addonName),\n\t\t\"system:authenticated\",\n\t}\n}", "func CreateAllIndexes() error {\n\terr := questionAnswerDAO.CreateIndexes()\n\n\treturn err\n}", "func (conf *Config) UpdateIndexes(client *pilosa.Client) error {\n\treturn conf.CompareIndexes(client, true, false)\n}", "func (f *UploadServiceGetUploadDocumentsForPathFunc) SetDefaultHook(hook func(context.Context, int, string) ([]string, int, error)) {\n\tf.defaultHook = hook\n}", "func addIndexes() {\n\tvar err error\n\tuserIndex := mgo.Index{\n\t\tKey: []string{\"email\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\n\tauthIndex := mgo.Index{\n\t\tKey: []string{\"sender_id\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\n\t// Add indexes into MongoDB\n\tsession := GetSession().Copy()\n\tdefer session.Close()\n\tuserCol := session.DB(AppConfig.MongoDBName).C(\"users\")\n\tauthCol := session.DB(AppConfig.MongoDBName).C(\"auth\")\n\n\terr = userCol.EnsureIndex(userIndex)\n\tif err != nil {\n\t\tlog.Fatalf(\"[addIndexes]: %s\\n\", err)\n\t}\n\n\terr = authCol.EnsureIndex(authIndex)\n\tif err != nil {\n\t\tlog.Fatalf(\"[addIndexes]: %s\\n\", err)\n\t}\n\n}", "func BackupIndexes(metadataFile *utils.FileWithByteCount) {\n\tgplog.Verbose(\"Writing CREATE INDEX statements to metadata file\")\n\tindexes := GetIndexes(connectionPool)\n\tobjectCounts[\"Indexes\"] = len(indexes)\n\tindexMetadata := GetCommentsForObjectType(connectionPool, TYPE_INDEX)\n\tPrintCreateIndexStatements(metadataFile, globalTOC, indexes, indexMetadata)\n}", "func InitializeIndexes(bucket base.Bucket, useXattrs bool, numReplicas uint, numHousekeepingReplicas uint) error {\n\n\tbase.Logf(\"Initializing indexes with numReplicas: %d\", numReplicas)\n\n\tgocbBucket, ok := bucket.(*base.CouchbaseBucketGoCB)\n\tif !ok {\n\t\tbase.Log(\"Using a non-Couchbase bucket - indexes will not be created.\")\n\t\treturn nil\n\t}\n\n\tfor _, sgIndex := range sgIndexes {\n\t\terr := sgIndex.createIfNeeded(gocbBucket, useXattrs, numReplicas)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to install index %s: %v\", sgIndex.simpleName, err)\n\t\t}\n\t}\n\n\treturn waitForIndexes(gocbBucket, useXattrs)\n}", "func (o SparsePCSearchResultsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func SetIndexes(collection *mongo.Collection, keys bsonx.Doc) {\n\tindex := mongo.IndexModel{}\n\tindex.Keys = keys\n\tunique := true\n\tindex.Options = &options.IndexOptions{\n\t\tUnique: &unique,\n\t}\n\topts := options.CreateIndexes().SetMaxTime(10 * time.Second)\n\t_, err := collection.Indexes().CreateOne(context.Background(), index, opts)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error while creating indexs: %v\", err)\n\t}\n}", "func (o SparseTagsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (o MetricsQueriesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (f *DBStoreDeleteIndexesWithoutRepositoryFunc) SetDefaultReturn(r0 map[int]int, r1 error) {\n\tf.SetDefaultHook(func(context.Context, time.Time) (map[int]int, error) {\n\t\treturn r0, r1\n\t})\n}", "func (o SparseSSHAuthoritiesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func (o StatsQueriesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (b *Builder) WithDefaultDomains(defaultDomains []*gardenerutils.Domain) *Builder {\n\tb.defaultDomainsFunc = func() ([]*gardenerutils.Domain, error) { return defaultDomains, nil }\n\treturn b\n}", "func AddDefaultUser() error {\n\t// Add the new user to the database\n\tdbQuery := `\n\t\tINSERT INTO users (auth0_id, user_name, email, password_hash, client_cert, display_name)\n\t\tVALUES ($1, $2, $3, $4, $5, $6)\n\t\tON CONFLICT (user_name)\n\t\t\tDO NOTHING`\n\t_, err := pdb.Exec(dbQuery, RandomString(16), \"default\", \"default@dbhub.io\", RandomString(16), \"\",\n\t\t\"Default system user\")\n\tif err != nil {\n\t\tlog.Printf(\"Error when adding the default user to the database: %v\\n\", err)\n\t\t// For now, don't bother logging a failure here. This *might* need changing later on\n\t\treturn err\n\t}\n\n\t// Log addition of the default user\n\tlog.Println(\"Default user added\")\n\treturn nil\n}", "func RegisterDefaults(scheme *runtime.Scheme) error {\n\tscheme.AddTypeDefaultingFunc(&HyperConverged{}, func(obj interface{}) { SetObjectDefaults_HyperConverged(obj.(*HyperConverged)) })\n\tscheme.AddTypeDefaultingFunc(&HyperConvergedList{}, func(obj interface{}) { SetObjectDefaults_HyperConvergedList(obj.(*HyperConvergedList)) })\n\treturn nil\n}", "func (o CloudSnapshotAccountsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (f *AutoIndexingServiceRepositoryIDsWithConfigurationFunc) SetDefaultHook(hook func(context.Context, int, int) ([]shared.RepositoryWithAvailableIndexers, int, error)) {\n\tf.defaultHook = hook\n}", "func (f *ResolverGetUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]dbstore.Upload, error)) {\n\tf.defaultHook = hook\n}", "func (f *AutoIndexingServiceGetIndexByIDFunc) SetDefaultReturn(r0 types.Index, r1 bool, r2 error) {\n\tf.SetDefaultHook(func(context.Context, int) (types.Index, bool, error) {\n\t\treturn r0, r1, r2\n\t})\n}", "func (f *ResolverGetIndexByIDFunc) SetDefaultReturn(r0 dbstore.Index, r1 bool, r2 error) {\n\tf.SetDefaultHook(func(context.Context, int) (dbstore.Index, bool, error) {\n\t\treturn r0, r1, r2\n\t})\n}", "func addUserIndexes(db *mgo.Session) error {\n\tsession := db.Copy()\n\tdefer session.Close()\n\tc := session.DB(\"\").C(userCollection)\n\ti := mgo.Index{\n\t\tKey: []string{\"phone\"},\n\t\tUnique: true,\n\t}\n\terr := c.EnsureIndex(i)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to add index: %v\", err)\n\t}\n\n\treturn nil\n}", "func (f *DBStoreGetUploadsFunc) SetDefaultHook(hook func(context.Context, dbstore.GetUploadsOptions) ([]dbstore.Upload, int, error)) {\n\tf.defaultHook = hook\n}", "func (f *DBStoreGetUploadsFunc) SetDefaultHook(hook func(context.Context, dbstore.GetUploadsOptions) ([]dbstore.Upload, int, error)) {\n\tf.defaultHook = hook\n}", "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}", "func (o SparseRenderTemplatesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func TestDefaultAuthorizer_DefaultACLs(t *testing.T) {\n\tctx, env := repotesting.NewEnvironment(t, repotesting.FormatNotImportant)\n\n\tfor _, e := range auth.DefaultACLs {\n\t\trequire.NoError(t, acl.AddACL(ctx, env.RepositoryWriter, e, false))\n\t}\n\n\tverifyLegacyAuthorizer(ctx, t, env.Repository, auth.DefaultAuthorizer())\n}", "func (r *Search) IndicesBoost(indicesboosts ...map[string]types.Float64) *Search {\n\tr.req.IndicesBoost = indicesboosts\n\n\treturn r\n}", "func (f *UploadServiceGetUploadsByIDsFunc) SetDefaultHook(hook func(context.Context, ...int) ([]types.Upload, error)) {\n\tf.defaultHook = hook\n}", "func (o EnforcerReportsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func RegisterDefaultMacro(name string, formals *LVal, fn LBuiltin) {\n\tuserMacros = append(userMacros, &langBuiltin{name, formals.Copy(), fn, \"\"})\n}", "func (o SparseDependencyMapsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func CreateIndexes(collections []models.Collection) {\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, collection := range collections {\n\t\tmodels := []mongo.IndexModel{}\n\n\t\tfor _, field := range collection.Fields {\n\t\t\tmodels = append(models, mongo.IndexModel{\n\t\t\t\tKeys: bson.M{field.FieldName: 1},\n\t\t\t\tOptions: options.Index().SetUnique(field.Unique),\n\t\t\t})\n\t\t}\n\n\t\tdatabase := ConnectDB().Database(utils.Config.DatabaseName).Collection(collection.CollectionName)\n\t\t_, err := database.Indexes().CreateMany(ctx, models)\n\t\tif err != nil {\n\t\t\tfmt.Println(err.Error())\n\t\t\treturn\n\t\t}\n\t}\n}", "func ConfigureIndexes(mClient *mongo.Client) {\n\tcollection := getMarkdownCollection(mClient)\n\n\tindex := []mongo.IndexModel{\n\t\t{\n\t\t\tKeys: bsonx.Doc{\n\t\t\t\t{Key: \"title\", Value: bsonx.String(\"text\")},\n\t\t\t\t{Key: \"body\", Value: bsonx.String(\"text\")},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tKeys: bsonx.Doc{{Key: \"createDate\", Value: bsonx.Int32(1)}},\n\t\t},\n\t}\n\tname, err := collection.Indexes().CreateMany(context.TODO(), index)\n\tif err != nil {\n\t\tfmt.Printf(\"Error Creating Text Index: %s\", err)\n\t\treturn\n\t}\n\tfmt.Printf(\"Index Created: %s\\n\", name)\n}", "func (r *ListLogsGetOptionalParameters) WithFilterIndexes(filterIndexes []string) *ListLogsGetOptionalParameters {\n\tr.FilterIndexes = &filterIndexes\n\treturn r\n}", "func AddIndex(db MongoDB, m metrics.Metrics, col string, indexes ...mgo.Index) error {\n\tdefer m.CollectMetrics(\"DB.AddIndex\")\n\n\tif len(indexes) == 0 {\n\t\treturn nil\n\t}\n\n\tdatabase, session, err := db.New(false)\n\tif err != nil {\n\t\tm.Emit(metrics.Errorf(\"Failed to create session for index\"), metrics.With(\"collection\", col), metrics.With(\"error\", err.Error()))\n\t\treturn err\n\t}\n\n\tdefer session.Close()\n\n\tcollection := database.C(col)\n\n\tfor _, index := range indexes {\n\t\tif err := collection.EnsureIndex(index); err != nil {\n\t\t\tm.Emit(metrics.Errorf(\"Failed to ensure session index\"), metrics.With(\"collection\", col), metrics.With(\"index\", index), metrics.With(\"error\", err.Error()))\n\t\t\treturn err\n\t\t}\n\n\t\tm.Emit(metrics.Info(\"Succeeded in ensuring collection index\"), metrics.With(\"collection\", col), metrics.With(\"index\", index))\n\t}\n\n\tm.Emit(metrics.Info(\"Finished adding index\"), metrics.With(\"collection\", col))\n\treturn nil\n}", "func (o *QueryLambdaSql) SetDefaultParameters(v []QueryParameter) {\n\to.DefaultParameters = v\n}", "func (m *DataRepositoryMongo) CreateIndex(collectionName string, indexes map[string]interface{}) <-chan error {\n\tresult := make(chan error)\n\tgo func() {\n\n\t\tvar (\n\t\t\terr error\n\t\t\tcollection *mongo.Collection\n\t\t\tctx context.Context\n\t\t)\n\n\t\tcollection, err = m.Client.GetCollection(collectionName)\n\t\tif err != nil {\n\t\t\tlog.Error(\"Get collection %s err (%s)! \\n\", collectionName, err.Error())\n\t\t\tresult <- err\n\t\t}\n\n\t\tctx, err = m.Client.GetContext()\n\t\tif err != nil {\n\t\t\tlog.Error(\"Get context err (%s)! \\n\", err.Error())\n\t\t\tresult <- err\n\t\t}\n\n\t\tvar indexList []mongo.IndexModel\n\n\t\tfor key, value := range indexes {\n\t\t\tindexOption := &options.IndexOptions{}\n\t\t\tindexOption = indexOption.SetBackground(true)\n\t\t\tindex := mongo.IndexModel{Keys: bson.M{key: value}, Options: indexOption}\n\t\t\tindexList = append(indexList, index)\n\t\t}\n\n\t\t_, err = collection.Indexes().CreateMany(ctx, indexList)\n\t\tresult <- err\n\t\tclose(result)\n\t}()\n\n\treturn result\n}", "func WithDefaultLimits(l Limits, conf queryrange.Config) Limits {\n\tres := limits{\n\t\tLimits: l,\n\t\toverrides: true,\n\t}\n\n\tif conf.SplitQueriesByInterval != 0 {\n\t\tres.splitDuration = conf.SplitQueriesByInterval\n\t}\n\n\treturn res\n}", "func (f *AutoIndexingServiceGetListTagsFunc) SetDefaultHook(hook func(context.Context, api.RepoName, ...string) ([]*gitdomain.Tag, error)) {\n\tf.defaultHook = hook\n}", "func (c *Codegen) RegisterDefaultGenerators() {\n\tc.RegisterGenerator(\"uf\", generateUfTemplate)\n\tc.RegisterGenerator(\"ibprop\", generateIbpropTemplate)\n\tc.RegisterGenerator(\"mailevent\", generateMaileventTemplate)\n\t//\"/getlist\", \"/iblockgetlist\", \"/sectiongetlist\", \"/addproperty\", \"/addpropertyval\n}", "func (c *Client) ListIndexes(ctx context.Context, params *ListIndexesInput, optFns ...func(*Options)) (*ListIndexesOutput, error) {\n\tif params == nil {\n\t\tparams = &ListIndexesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListIndexes\", params, optFns, c.addOperationListIndexesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListIndexesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "func (o AccessibleNamespacesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func DefaultConfig(scale cachescale.Func) IndexConfig {\n\treturn IndexConfig{\n\t\tCaches: IndexCacheConfig{\n\t\t\tForklessCausePairs: scale.I(20000),\n\t\t\tHighestBeforeSeqSize: scale.U(160 * 1024),\n\t\t\tLowestAfterSeqSize: scale.U(160 * 1024),\n\t\t},\n\t}\n}", "func addAllFieldIndexes(ctx context.Context, indexer client.FieldIndexer) error {\n\tif err := indexer.IndexField(ctx, &gardencorev1beta1.Project{}, gardencore.ProjectNamespace, func(obj client.Object) []string {\n\t\tproject, ok := obj.(*gardencorev1beta1.Project)\n\t\tif !ok {\n\t\t\treturn []string{\"\"}\n\t\t}\n\t\tif project.Spec.Namespace == nil {\n\t\t\treturn []string{\"\"}\n\t\t}\n\t\treturn []string{*project.Spec.Namespace}\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"failed to add indexer to Project Informer: %w\", err)\n\t}\n\n\tif err := indexer.IndexField(ctx, &gardencorev1beta1.Shoot{}, gardencore.ShootSeedName, func(obj client.Object) []string {\n\t\tshoot, ok := obj.(*gardencorev1beta1.Shoot)\n\t\tif !ok {\n\t\t\treturn []string{\"\"}\n\t\t}\n\t\tif shoot.Spec.SeedName == nil {\n\t\t\treturn []string{\"\"}\n\t\t}\n\t\treturn []string{*shoot.Spec.SeedName}\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"failed to add indexer to Shoot Informer: %w\", err)\n\t}\n\n\tif err := indexer.IndexField(ctx, &seedmanagementv1alpha1.ManagedSeed{}, seedmanagement.ManagedSeedShootName, func(obj client.Object) []string {\n\t\tms, ok := obj.(*seedmanagementv1alpha1.ManagedSeed)\n\t\tif !ok {\n\t\t\treturn []string{\"\"}\n\t\t}\n\t\tif ms.Spec.Shoot == nil {\n\t\t\treturn []string{\"\"}\n\t\t}\n\t\treturn []string{ms.Spec.Shoot.Name}\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"failed to add indexer to ManagedSeed Informer: %w\", err)\n\t}\n\n\treturn nil\n}", "func (o TagsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (s *BasePlSqlParserListener) ExitModify_index_default_attrs(ctx *Modify_index_default_attrsContext) {\n}", "func (o SparseSSHAuthorizationPoliciesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func (f *DBStoreSelectRepositoriesForRetentionScanFunc) SetDefaultHook(hook func(context.Context, time.Duration, int) ([]int, error)) {\n\tf.defaultHook = hook\n}", "func DefaultKnownHosts() (ssh.HostKeyCallback, error) {\n\n\tpath, err := DefaultKnownHostsPath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn KnownHosts(path)\n}", "func (f *DBStoreCommitsVisibleToUploadFunc) SetDefaultHook(hook func(context.Context, int, int, *string) ([]string, *string, error)) {\n\tf.defaultHook = hook\n}", "func (p *ThriftHiveMetastoreClient) GetIndexes(ctx context.Context, db_name string, tbl_name string, max_indexes int16) (r []*Index, err error) {\n var _args114 ThriftHiveMetastoreGetIndexesArgs\n _args114.DbName = db_name\n _args114.TblName = tbl_name\n _args114.MaxIndexes = max_indexes\n var _result115 ThriftHiveMetastoreGetIndexesResult\n if err = p.Client_().Call(ctx, \"get_indexes\", &_args114, &_result115); err != nil {\n return\n }\n switch {\n case _result115.O1!= nil:\n return r, _result115.O1\n case _result115.O2!= nil:\n return r, _result115.O2\n }\n\n return _result115.GetSuccess(), nil\n}", "func (s *UAA) SetDefaultScopes(scopes []string) {\n\ts.tokens.DefaultScopes = scopes\n}", "func DefaultDeclareKeys(\n\tdesc roachpb.RangeDescriptor, header roachpb.Header, req roachpb.Request, spans *spanset.SpanSet,\n) {\n\tif roachpb.IsReadOnly(req) {\n\t\tspans.Add(spanset.SpanReadOnly, req.Header())\n\t} else {\n\t\tspans.Add(spanset.SpanReadWrite, req.Header())\n\t}\n\tif header.Txn != nil {\n\t\theader.Txn.AssertInitialized(context.TODO())\n\t\tspans.Add(spanset.SpanReadOnly, roachpb.Span{\n\t\t\tKey: keys.AbortSpanKey(header.RangeID, header.Txn.ID),\n\t\t})\n\t}\n\tif header.ReturnRangeInfo {\n\t\tspans.Add(spanset.SpanReadOnly, roachpb.Span{Key: keys.RangeLeaseKey(header.RangeID)})\n\t\tspans.Add(spanset.SpanReadOnly, roachpb.Span{Key: keys.RangeDescriptorKey(desc.StartKey)})\n\t}\n}", "func RegisterDefaultSpecialOp(name string, formals *LVal, fn LBuiltin) {\n\tuserSpecialOps = append(userSpecialOps, &langBuiltin{name, formals.Copy(), fn, \"\"})\n}", "func (c *ConfigPolicyNode) AddDefaults(m map[string]ctypes.ConfigValue) (*map[string]ctypes.ConfigValue, *ProcessingErrors) {\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\tpErrors := NewProcessingErrors()\n\t// Loop through each rule and process\n\tfor key, rule := range c.rules {\n\t\t// items exists for rule\n\t\tif _, ok := m[key]; ok {\n\t\t\tpErrors.AddError(fmt.Errorf(\"The key \\\"%v\\\" already has a default policy for this plugin\", key))\n\t\t} else {\n\t\t\t// If it was required add error\n\t\t\tif !rule.Required() {\n\t\t\t\t// If default returns we should add it\n\t\t\t\tcv := rule.Default()\n\t\t\t\tif cv != nil {\n\t\t\t\t\tm[key] = cv\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif pErrors.HasErrors() {\n\t\treturn nil, pErrors\n\t}\n\treturn &m, pErrors\n}" ]
[ "0.67015946", "0.65820223", "0.6558238", "0.62669903", "0.6112775", "0.56924784", "0.56649387", "0.5607494", "0.55619687", "0.5535923", "0.5508265", "0.5426262", "0.5390371", "0.53833604", "0.5379549", "0.53476596", "0.533891", "0.5274567", "0.52689487", "0.5254998", "0.519513", "0.5167797", "0.51483756", "0.51411253", "0.5116421", "0.51047117", "0.5077923", "0.50776803", "0.50776225", "0.5077364", "0.5066575", "0.5060678", "0.50446475", "0.5024605", "0.5020541", "0.50186825", "0.50183153", "0.50150853", "0.50021285", "0.49795616", "0.4972726", "0.49723506", "0.49679494", "0.4963908", "0.49520707", "0.49518502", "0.4930741", "0.48947254", "0.4892197", "0.4879788", "0.4878008", "0.48757663", "0.48624432", "0.48518524", "0.4831769", "0.48300874", "0.4829013", "0.48282477", "0.48226854", "0.48164776", "0.48062164", "0.48048615", "0.48032185", "0.4766072", "0.4761526", "0.4751383", "0.4749951", "0.4749951", "0.47408313", "0.47385806", "0.47037867", "0.47021073", "0.46999717", "0.4695628", "0.46821028", "0.4677005", "0.4674405", "0.46741083", "0.46721354", "0.46680704", "0.46609458", "0.46524122", "0.4648964", "0.46381807", "0.463579", "0.4632054", "0.46250933", "0.45990437", "0.45985365", "0.45970187", "0.45946717", "0.45889774", "0.4584223", "0.45805103", "0.45761144", "0.45747605", "0.45425367", "0.45369083", "0.4533844", "0.45261586" ]
0.8728488
0
NewGetExpertsIDNotFound creates a GetExpertsIDNotFound with default headers values
NewGetExpertsIDNotFound создает GetExpertsIDNotFound с значениями заголовков по умолчанию
func NewGetExpertsIDNotFound() *GetExpertsIDNotFound { return &GetExpertsIDNotFound{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewNotFound(parameters ...wparams.ParamStorer) Error {\n\treturn newGenericError(nil, DefaultNotFound, wparams.NewParamStorer(parameters...))\n}", "func NewNotFound(s string, v ...interface{}) error {\n\treturn asNotFound(fmt.Errorf(s, v...))\n}", "func NewGetCustomIntegrationVersionByIDUsingGETNotFound() *GetCustomIntegrationVersionByIDUsingGETNotFound {\n\treturn &GetCustomIntegrationVersionByIDUsingGETNotFound{}\n}", "func NewGetExpertsIDOK() *GetExpertsIDOK {\n\treturn &GetExpertsIDOK{}\n}", "func NewNotFound() error {\n\treturn requestError{\n\t\tClientError: ClientError{\n\t\t\tErrors: []clientErrorSubError{{Message: \"status code 404\"}},\n\t\t},\n\t}\n}", "func NewNotFound(a Attributes) error {\n\tname, resource, err := extractResourceName(a)\n\tif err != nil {\n\t\treturn apierrors.NewInternalError(err)\n\t}\n\treturn apierrors.NewNotFound(resource, name)\n}", "func NewNotFound(err error, msg ...string) *Errs {\n\tif err == nil {\n\t\terr = ErrNotFound\n\t}\n\treturn &Errs{\n\t\tcodeHTTP: http.StatusNotFound,\n\t\terr: err,\n\t\tkind: trace(2),\n\t\tmessage: msg,\n\t}\n}", "func (ctx *GetByIDHostContext) NotFound() error {\n\tctx.ResponseData.WriteHeader(404)\n\treturn nil\n}", "func NewGetCustomNameByProjectIDNotFound() *GetCustomNameByProjectIDNotFound {\n\treturn &GetCustomNameByProjectIDNotFound{}\n}", "func NewGetDetailNotFound() *GetDetailNotFound {\n\treturn &GetDetailNotFound{}\n}", "func NewGetUserByIDNotFound() *GetUserByIDNotFound {\n\treturn &GetUserByIDNotFound{}\n}", "func NewGetEntriesNotFound() *GetEntriesNotFound {\n\treturn &GetEntriesNotFound{}\n}", "func NewGetByUIDNotFound() *GetByUIDNotFound {\n\treturn &GetByUIDNotFound{}\n}", "func NewNotFound(name, group, resource string) error {\n\treturn errors.NewNotFound(schema.GroupResource{Group: group, Resource: resource}, name)\n}", "func notFound(resp *ApiResponse, msg string) error {\n resp.StatusCode = http.StatusNotFound\n resp.Message = []byte(msg)\n resp.ErrorMessage = http.StatusText(http.StatusNotFound)\n\n return nil\n}", "func NewGetByIDUsingGETNotFound() *GetByIDUsingGETNotFound {\n\treturn &GetByIDUsingGETNotFound{}\n}", "func NewGetTemplatesLibraryIdentifierNotFound() *GetTemplatesLibraryIdentifierNotFound {\n\treturn &GetTemplatesLibraryIdentifierNotFound{}\n}", "func NewInsuranceGetNotFound() *InsuranceGetNotFound {\n\treturn &InsuranceGetNotFound{}\n}", "func (a *API) getNotFound(ctx context.Context, res *common.HttpResponseWriter) error {\n\tres.WriteHeader(http.StatusNotFound)\n\treturn nil\n}", "func NewDescribeDefault(code int) *DescribeDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &DescribeDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetNiaapiDcnmHweolsMoidNotFound() *GetNiaapiDcnmHweolsMoidNotFound {\n\treturn &GetNiaapiDcnmHweolsMoidNotFound{}\n}", "func NewGetCustomIntegrationVersionByIDUsingGETUnauthorized() *GetCustomIntegrationVersionByIDUsingGETUnauthorized {\n\treturn &GetCustomIntegrationVersionByIDUsingGETUnauthorized{}\n}", "func NewGetTeacherNotFound() *GetTeacherNotFound {\n\n\treturn &GetTeacherNotFound{}\n}", "func NewNotFound(msg string) error {\n\treturn &ELBError{\n\t\tmsg: msg,\n\t\tCode: http.StatusNotFound,\n\t}\n}", "func NewThreadGetOneNotFound() *ThreadGetOneNotFound {\n\n\treturn &ThreadGetOneNotFound{}\n}", "func NewSystemDetailFindByIDNotFound() *SystemDetailFindByIDNotFound {\n\treturn &SystemDetailFindByIDNotFound{}\n}", "func NewGetVulnerabilitiesAdditionNotFound() *GetVulnerabilitiesAdditionNotFound {\n\treturn &GetVulnerabilitiesAdditionNotFound{}\n}", "func WrapWithNotFound(cause error, parameters ...wparams.ParamStorer) Error {\n\treturn newGenericError(cause, DefaultNotFound, wparams.NewParamStorer(parameters...))\n}", "func NewGetCustomObjectsByIDByIDNotFound() *GetCustomObjectsByIDByIDNotFound {\n\treturn &GetCustomObjectsByIDByIDNotFound{}\n}", "func NewGetNotFound(body *GetNotFoundResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func NewGetNotFound(body *GetNotFoundResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func (Http) getNotFound(name string) *Http {\n\treturn &Http{\n\t\tCode: http.StatusNotFound,\n\t\tStatus: http.StatusText(http.StatusNotFound),\n\t\tMessage: fmt.Sprintf(\"%s not found\", toUpperFirstChar(name)),\n\t}\n}", "func NewGetPrimeEntitlementsNotFound() *GetPrimeEntitlementsNotFound {\n\treturn &GetPrimeEntitlementsNotFound{}\n}", "func NewPollersDataGetNotFound() *PollersDataGetNotFound {\n\treturn &PollersDataGetNotFound{}\n}", "func NewGetCatalogItemUsingGET4NotFound() *GetCatalogItemUsingGET4NotFound {\n\treturn &GetCatalogItemUsingGET4NotFound{}\n}", "func NewGetSectionNotFound() *GetSectionNotFound {\n\n\treturn &GetSectionNotFound{}\n}", "func NewGetDetailsNotFound() *GetDetailsNotFound {\n\treturn &GetDetailsNotFound{}\n}", "func NewGetVersionByIDUsingGETMixin3NotFound() *GetVersionByIDUsingGETMixin3NotFound {\n\treturn &GetVersionByIDUsingGETMixin3NotFound{}\n}", "func NewGetConstructorNotFound() *GetConstructorNotFound {\n\treturn &GetConstructorNotFound{}\n}", "func NewGetProjectsIDNotFound() *GetProjectsIDNotFound {\n\treturn &GetProjectsIDNotFound{}\n}", "func NewFindMaterialByIDDefault(code int) *FindMaterialByIDDefault {\n\treturn &FindMaterialByIDDefault{\n\t\t_statusCode: code,\n\t}\n}", "func noFound(msg string) error {\n\treturn status.Error(codes.NotFound, msg)\n}", "func NewGetKeysNotFound() *GetKeysNotFound {\n\treturn &GetKeysNotFound{}\n}", "func NewGetPollersIdentifierNotFound() *GetPollersIdentifierNotFound {\n\treturn &GetPollersIdentifierNotFound{}\n}", "func NewGetBicsIDNotFound() *GetBicsIDNotFound {\n\treturn &GetBicsIDNotFound{}\n}", "func NewGetTeamDetailDefault(code int) *GetTeamDetailDefault {\n\treturn &GetTeamDetailDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetDebugRequestNotFound() *GetDebugRequestNotFound {\n\treturn &GetDebugRequestNotFound{}\n}", "func notFound(w http.ResponseWriter, req *http.Request) {\n\t// w.Header().Set(\"Content-Type\", \"text/plain; charset=utf-8\")\n\tapiError := apirouter.ErrorFromRequest(req, fmt.Sprintf(\"404 occurred: %s\", req.RequestURI), \"Whoops - this request is not recognized\", http.StatusNotFound, http.StatusNotFound, \"\")\n\tapirouter.ReturnResponse(w, req, apiError.Code, apiError)\n}", "func NewGetDevicesUispssIDNotFound() *GetDevicesUispssIDNotFound {\n\treturn &GetDevicesUispssIDNotFound{}\n}", "func NewGetRacksIDNotFound() *GetRacksIDNotFound {\n\treturn &GetRacksIDNotFound{}\n}", "func NewNewDiscoveryDefault(code int) *NewDiscoveryDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &NewDiscoveryDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetInteractionsNotFound() *GetInteractionsNotFound {\n\n\treturn &GetInteractionsNotFound{}\n}", "func notFound(resource string) middleware.Responder {\n\tmessage := fmt.Sprintf(\"404 %s not found\", resource)\n\treturn operations.NewGetChartDefault(http.StatusNotFound).WithPayload(\n\t\t&models.Error{Code: helpers.Int64ToPtr(http.StatusNotFound), Message: &message},\n\t)\n}", "func NewGetNiaapiDcnmSweolsMoidNotFound() *GetNiaapiDcnmSweolsMoidNotFound {\n\treturn &GetNiaapiDcnmSweolsMoidNotFound{}\n}", "func NewGetUserNotFound() *GetUserNotFound {\n\n\treturn &GetUserNotFound{}\n}", "func NewGetUserNotFound() *GetUserNotFound {\n\n\treturn &GetUserNotFound{}\n}", "func NewGetRequestByIDUsingGETNotFound() *GetRequestByIDUsingGETNotFound {\n\treturn &GetRequestByIDUsingGETNotFound{}\n}", "func NewGetUserNotFound() *GetUserNotFound {\n\treturn &GetUserNotFound{}\n}", "func NewGetPracticesDefault(code int) *GetPracticesDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &GetPracticesDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NotFound(msg string) Error {\n\te := err{msg: msg, code: notFoundCode, group: generic, kind: notFound}\n\treturn &e\n}", "func NewGetHyperflexServerModelsMoidNotFound() *GetHyperflexServerModelsMoidNotFound {\n\treturn &GetHyperflexServerModelsMoidNotFound{}\n}", "func NewNoDataFound(errorMsg string) error {\n\treturn &NoDataFound {\n\t\tmsg: errorMsg,\n\t}\n}", "func NewGetNicsNotFound() *GetNicsNotFound {\n\treturn &GetNicsNotFound{}\n}", "func writeInsightNotFound(w http.ResponseWriter, str string) {\n\tw.Header().Set(\"Content-Type\", \"text/html; charset=utf-8\")\n\tw.WriteHeader(http.StatusNotFound)\n\tio.WriteString(w, str)\n}", "func NewEmployeesByIDGetUnauthorized() *EmployeesByIDGetUnauthorized {\n\treturn &EmployeesByIDGetUnauthorized{}\n}", "func NewGetSecurityGroupNotFound() *GetSecurityGroupNotFound {\n\treturn &GetSecurityGroupNotFound{}\n}", "func NewGetClusterByIDDefault(code int) *GetClusterByIDDefault {\n\treturn &GetClusterByIDDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetNiaapiApicSweolsMoidNotFound() *GetNiaapiApicSweolsMoidNotFound {\n\treturn &GetNiaapiApicSweolsMoidNotFound{}\n}", "func NewGetIdentityIDNotFound() *GetIdentityIDNotFound {\n\n\treturn &GetIdentityIDNotFound{}\n}", "func NewGetProductListsByIDNotFound() *GetProductListsByIDNotFound {\n\treturn &GetProductListsByIDNotFound{}\n}", "func NewGetTiersNotFound() *GetTiersNotFound {\n\treturn &GetTiersNotFound{}\n}", "func NewObjectsGetNotFound() *ObjectsGetNotFound {\n\treturn &ObjectsGetNotFound{}\n}", "func notfound(out http.ResponseWriter, format string, args ...interface{}) {\n\tsend(http.StatusNotFound, out, format, args...)\n}", "func (c ApiWrapper) NotFound(msg string, objs ...interface{}) revel.Result {\n\treturn c.renderErrorString(404, fmt.Sprintf(msg, objs))\n}", "func NotFound(w http.ResponseWriter, r *http.Request) {\n\tresponse := response.CreateResponse()\n\tresponse.SendDataWithStatusCode(w, \"not found\", http.StatusOK)\n}", "func NotFound(rt, id string) NotFoundErr {\n\treturn NotFoundErr{ResourceType: rt, ID: id}\n}", "func (ctx *GetOutputContext) NotFound() error {\n\tctx.ResponseData.WriteHeader(404)\n\treturn nil\n}", "func (resp *Response) NotFound(w http.ResponseWriter, queryParam string) {\n\tresp.Error = \"The user with id \" + queryParam + \" was not found\"\n\twrite(resp, w)\n}", "func NewGetNodeNotFound() *GetNodeNotFound {\n\treturn &GetNodeNotFound{}\n}", "func NewRequestID() string {\n\tbytes := make([]byte, 8)\n\t_, _ = rand.Read(bytes) // In case of failure, do not fail request, just use default bytes (zero)\n\treturn hex.EncodeToString(bytes)\n}", "func NewGetCustomObjectDefinitionsByIDAttributeGroupsByIDNotFound() *GetCustomObjectDefinitionsByIDAttributeGroupsByIDNotFound {\n\treturn &GetCustomObjectDefinitionsByIDAttributeGroupsByIDNotFound{}\n}", "func NewGetRecorderIDNotFound() *GetRecorderIDNotFound {\n\treturn &GetRecorderIDNotFound{}\n}", "func NewRequestID() (string, error) {\n\treturn strings.Replace(util.UniqueID(), \"-\", \"\", -1), nil\n}", "func NewRequestID() (string, error) {\n\treturn strings.Replace(util.UniqueID(), \"-\", \"\", -1), nil\n}", "func NewGetUserDetailsNotFound() *GetUserDetailsNotFound {\n\treturn &GetUserDetailsNotFound{}\n}", "func NewGetHostGroupsNotFound() *GetHostGroupsNotFound {\n\treturn &GetHostGroupsNotFound{}\n}", "func (client *RoleDefinitionsClient) getByIDCreateRequest(ctx context.Context, roleID string, options *RoleDefinitionsGetByIDOptions) (*policy.Request, error) {\n\turlPath := \"/{roleId}\"\n\turlPath = strings.ReplaceAll(urlPath, \"{roleId}\", roleID)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func ERROR_AUTH_SEED_NOT_FOUND(w http.ResponseWriter, pl string) {\n\tbuildForeignError(w, http.StatusForbidden, \"ERROR_AUTH_SEED_NOT_FOUND\", pl)\n}", "func NotFound(c *gin.Context) {\n\tresponse := types.APIErrResponse{Msg: \"Something went wrong\", Success: false, Err: \"Not found\"}\n\tc.JSON(http.StatusNotFound, response)\n}", "func NotFound(w ResponseWriter, r *Request) {\n\tw.SetHeader(CodeNotFound, \"not found\")\n}", "func NewGetByIDUsingGETUnauthorized() *GetByIDUsingGETUnauthorized {\n\treturn &GetByIDUsingGETUnauthorized{}\n}", "func NewGetProviderRegionByIDNotFound() *GetProviderRegionByIDNotFound {\n\treturn &GetProviderRegionByIDNotFound{}\n}", "func NewGetObmsLibraryIdentifierNotFound() *GetObmsLibraryIdentifierNotFound {\n\treturn &GetObmsLibraryIdentifierNotFound{}\n}", "func NewGetOneKeyspaceNotFound() *GetOneKeyspaceNotFound {\n\treturn &GetOneKeyspaceNotFound{}\n}", "func NewGetDatasourceByIDDefault(code int) *GetDatasourceByIDDefault {\n\treturn &GetDatasourceByIDDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetAdapterHostEthInterfacesMoidNotFound() *GetAdapterHostEthInterfacesMoidNotFound {\n\treturn &GetAdapterHostEthInterfacesMoidNotFound{}\n}", "func NewGetSysteminfoGetcertNotFound() *GetSysteminfoGetcertNotFound {\n\treturn &GetSysteminfoGetcertNotFound{}\n}", "func NewGetSysteminfoGetcertNotFound() *GetSysteminfoGetcertNotFound {\n\treturn &GetSysteminfoGetcertNotFound{}\n}", "func NewGetTemplatesLibraryIdentifierDefault(code int) *GetTemplatesLibraryIdentifierDefault {\n\treturn &GetTemplatesLibraryIdentifierDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewNotFoundError(message string)*RestErr{\n\treturn &RestErr{\n\t\tMessage: message,\n\t\tStatus: http.StatusNotFound,\n\t\tError: \"Not Found\",\n\t}\n}" ]
[ "0.5662817", "0.56517524", "0.5495926", "0.54688585", "0.5418953", "0.5308546", "0.52899915", "0.5279872", "0.5270878", "0.52628124", "0.5241968", "0.52075416", "0.52074784", "0.5170049", "0.5167049", "0.5156365", "0.51450014", "0.5113342", "0.5108819", "0.50972646", "0.5090796", "0.50621694", "0.50596046", "0.5055992", "0.5052292", "0.5051992", "0.5043833", "0.50382143", "0.50372493", "0.50265664", "0.50265664", "0.50264937", "0.5026223", "0.50181687", "0.4984327", "0.49740213", "0.49627683", "0.4959537", "0.49558163", "0.49444726", "0.49442253", "0.4927465", "0.49215788", "0.49164578", "0.49143982", "0.4914247", "0.49101183", "0.4908009", "0.48909083", "0.4883929", "0.4880394", "0.48794264", "0.48739895", "0.4863601", "0.48573878", "0.48573878", "0.4846852", "0.4840037", "0.48345885", "0.48273242", "0.4823988", "0.4820073", "0.48195362", "0.4818315", "0.48092002", "0.47906423", "0.4789343", "0.47873017", "0.47871637", "0.4764245", "0.47594625", "0.47550038", "0.47547463", "0.47491708", "0.47411358", "0.47343934", "0.4731971", "0.47271144", "0.4725512", "0.47211313", "0.47203782", "0.4713547", "0.47113603", "0.47113603", "0.4708216", "0.47003818", "0.46956095", "0.469455", "0.46929246", "0.46865517", "0.46810782", "0.4676366", "0.4674937", "0.46679178", "0.46651158", "0.46564484", "0.46522087", "0.46522087", "0.4651122", "0.46486494" ]
0.71422535
0
NewCreateCoreV1NamespacedPodBindingOK creates CreateCoreV1NamespacedPodBindingOK with default headers values
NewCreateCoreV1NamespacedPodBindingOK создает CreateCoreV1NamespacedPodBindingOK с значениями заголовков по умолчанию
func NewCreateCoreV1NamespacedPodBindingOK() *CreateCoreV1NamespacedPodBindingOK { return &CreateCoreV1NamespacedPodBindingOK{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateCoreV1NamespacedPodBindingUnauthorized() *CreateCoreV1NamespacedPodBindingUnauthorized {\n\n\treturn &CreateCoreV1NamespacedPodBindingUnauthorized{}\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateCoreV1NamespacedPodBindingCreated() *CreateCoreV1NamespacedPodBindingCreated {\n\n\treturn &CreateCoreV1NamespacedPodBindingCreated{}\n}", "func NewCreateCoreV1NamespacedPodOK() *CreateCoreV1NamespacedPodOK {\n\treturn &CreateCoreV1NamespacedPodOK{}\n}", "func (b *bindingTest) Podcreate(name *string) {\n\tb.PodcreateAndExpose(name, nil)\n}", "func NewCreateCoreV1NamespacedPodBindingAccepted() *CreateCoreV1NamespacedPodBindingAccepted {\n\n\treturn &CreateCoreV1NamespacedPodBindingAccepted{}\n}", "func newPod(ctx context.Context, cl client.Client, ns, name, image string, cmd []string) (*corev1.Pod, error) {\n\tc := corev1.Container{\n\t\tName: name,\n\t\tImage: image,\n\t\tCommand: cmd,\n\t}\n\tp := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: ns,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{c},\n\t\t\t// Kill the pod immediately so it exits quickly on deletion.\n\t\t\tTerminationGracePeriodSeconds: pointer.Int64Ptr(0),\n\t\t},\n\t}\n\tif err := cl.Create(ctx, p); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create pod %s/%s: %v\", p.Namespace, p.Name, err)\n\t}\n\treturn p, nil\n}", "func (b *bindingTest) PodcreateAndExpose(name *string, port *string) {\n\tcommand := []string{\"pod\", \"create\"}\n\tif name != nil {\n\t\tpodname := *name\n\t\tcommand = append(command, \"--name\", podname)\n\t}\n\tif port != nil {\n\t\tpodport := *port\n\t\tcommand = append(command, \"--publish\", podport)\n\t}\n\tb.runPodman(command).Wait(45)\n}", "func NewPod(namespace, name, nodeName string, opts *NewPodOptions) *corev1.Pod {\n\tpod := &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{},\n\t\t\tAnnotations: map[string]string{},\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tNodeName: nodeName,\n\t\t\tAffinity: &corev1.Affinity{},\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: name,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif opts != nil {\n\t\tpod.CreationTimestamp = opts.CreationTimestamp\n\n\t\tpod.Spec.Containers[0].Resources = opts.Resources\n\n\t\tif opts.Annotations != nil {\n\t\t\tfor key, value := range opts.Annotations {\n\t\t\t\tpod.Annotations[key] = value\n\t\t\t}\n\t\t}\n\t\tif opts.Labels != nil {\n\t\t\tfor key, value := range opts.Labels {\n\t\t\t\tpod.Labels[key] = value\n\t\t\t}\n\t\t}\n\t\tif opts.NodeSelector != nil {\n\t\t\tpod.Spec.NodeSelector = map[string]string{}\n\t\t\tfor key, value := range opts.NodeSelector {\n\t\t\t\tpod.Spec.NodeSelector[key] = value\n\t\t\t}\n\t\t}\n\t\tpod.Status.Phase = opts.Phase\n\t\tpod.Status.Reason = opts.Reason\n\t\tpod.Status.ContainerStatuses = opts.ContainerStatuses\n\t\tpod.Spec.Tolerations = append(pod.Spec.Tolerations, opts.Tolerations...)\n\t\tpod.Spec.Affinity = &opts.Affinity\n\t}\n\n\tif nodeName != \"\" {\n\t\tutilaffinity.ReplaceNodeNameNodeAffinity(pod.Spec.Affinity, nodeName)\n\t}\n\n\treturn pod\n}", "func createPod(clientset kubernetes.Interface, namespace string, image string, name string,\n\tlabels map[string]string, command []string, args []string) (*v1.Pod, error) {\n\tenv := []v1.EnvVar{\n\t\t{\n\t\t\tName: \"NAMESPACE\",\n\t\t\tValueFrom: &v1.EnvVarSource{\n\t\t\t\tFieldRef: &v1.ObjectFieldSelector{\n\t\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\t\tFieldPath: \"metadata.namespace\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tspec := v1.PodSpec{\n\t\tContainers: []v1.Container{\n\t\t\t{\n\t\t\t\tEnv: env,\n\t\t\t\tName: fmt.Sprintf(\"%v-pod-container\", name),\n\t\t\t\tImage: image,\n\t\t\t},\n\t\t},\n\t}\n\n\tif len(command) > 0 {\n\t\tspec.Containers[0].Command = command\n\t\tif len(args) > 0 {\n\t\t\tspec.Containers[0].Args = args\n\t\t}\n\t}\n\n\tpod := &v1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: labels,\n\t\t\tName: name,\n\t\t},\n\t\tSpec: spec,\n\t}\n\n\tif _, err := clientset.CoreV1().Pods(namespace).Create(pod); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn clientset.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})\n}", "func NewPod(name string, labels labels.Set, shootVersionConstraints ...string) Pod {\n\tconstraint := \"\"\n\tif len(shootVersionConstraints) > 0 {\n\t\tconstraint = shootVersionConstraints[0]\n\t}\n\treturn Pod{name, labels, constraint, nil}\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func newPod(name string) *corev1.Pod {\n\treturn &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{},\n\t\tObjectMeta: metav1.ObjectMeta{Name: name},\n\t\tSpec: corev1.PodSpec{},\n\t\tStatus: corev1.PodStatus{},\n\t}\n}", "func createNS(h *Handler, ns string, del bool) error {\n\tmanifest := fmt.Sprintf(`\napiVersion: v1\nkind: Namespace\nmetadata:\n name: %s\n`,\n\t\tns,\n\t)\n\n\tif err := h.applyManifest(del, noneNamespace, []byte(manifest)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func createNS(ctx context.Context, prefix string) string {\n\tnm := createNSName(prefix)\n\n\t// Create the namespace\n\tns := &corev1.Namespace{}\n\tns.Name = nm\n\tExpect(k8sClient.Create(ctx, ns)).Should(Succeed())\n\n\t// Wait for the Hierarchy singleton to be created\n\tsnm := types.NamespacedName{Namespace: nm, Name: tenancy.Singleton}\n\thier := &tenancy.Hierarchy{}\n\tEventually(func() error {\n\t\treturn k8sClient.Get(ctx, snm, hier)\n\t}).Should(Succeed())\n\n\treturn nm\n}", "func newPodForCR(cr *sdewanv1alpha1.Sdewan) *corev1.Pod {\n\tlabels := map[string]string{\n\t\t\"app\": cr.Name,\n\t}\n\tpriv := true\n\tvar netmaps []map[string]interface{}\n\tfor _, net := range cr.Spec.Networks {\n\t\tnetmaps = append(netmaps, map[string]interface{}{\n\t\t\t\"name\": net.Name,\n\t\t\t\"interface\": net.Interface,\n\t\t\t\"defaultGateway\": fmt.Sprintf(\"%t\", net.DefaultGateway),\n\t\t})\n\t}\n\tnetjson, _ := json.MarshalIndent(netmaps, \"\", \" \")\n\tvolumes := []corev1.Volume{\n\t\t{\n\t\t\tName: cr.Name,\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tConfigMap: &corev1.ConfigMapVolumeSource{\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{Name: cr.Name},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name,\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: labels,\n\t\t\tAnnotations: map[string]string{\n\t\t\t\t\"k8s.v1.cni.cncf.io/networks\": `[{ \"name\": \"ovn-networkobj\"}]`,\n\t\t\t\t\"k8s.plugin.opnfv.org/nfn-network\": `{ \"type\": \"ovn4nfv\", \"interface\": ` + string(netjson) + \"}\",\n\t\t\t},\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"sdewan\",\n\t\t\t\t\tImage: OpenwrtTag,\n\t\t\t\t\tCommand: []string{\"/bin/sh\", \"/tmp/sdewan/entrypoint.sh\"},\n\t\t\t\t\tImagePullPolicy: corev1.PullIfNotPresent,\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tPrivileged: &priv,\n\t\t\t\t\t},\n\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: cr.Name,\n\t\t\t\t\t\t\tReadOnly: true,\n\t\t\t\t\t\t\tMountPath: \"/tmp/sdewan\",\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\tNodeSelector: map[string]string{\"kubernetes.io/hostname\": cr.Spec.Node},\n\t\t\tVolumes: volumes,\n\t\t},\n\t}\n}", "func NewCreateCoreV1NamespacedPodUnauthorized() *CreateCoreV1NamespacedPodUnauthorized {\n\treturn &CreateCoreV1NamespacedPodUnauthorized{}\n}", "func (t DefaultBuildManager) CreatePod(pod *k8sapi.Pod) error {\n\t_, err := t.kubernetesClient.Pods(\"decap\").Create(pod)\n\treturn err\n}", "func genpod(namespace, name, image string) *corev1.Pod {\n\tvar userID int64 = 65534\n\n\treturn &corev1.Pod{\n\t\tMetadata: &metav1.ObjectMeta{\n\t\t\tName: k8s.String(name),\n\t\t\tNamespace: k8s.String(namespace),\n\t\t\tLabels: map[string]string{\"generator\": \"kboom\"},\n\t\t},\n\t\tSpec: &corev1.PodSpec{\n\t\t\tContainers: []*corev1.Container{\n\t\t\t\t&corev1.Container{\n\t\t\t\t\tName: k8s.String(\"main\"),\n\t\t\t\t\tImage: k8s.String(image),\n\t\t\t\t\tCommand: []string{\"/bin/sh\", \"-ec\", \"sleep 3600\"},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tRunAsUser: &userID,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func (f *Framework) CreateDummyPodObjectWithPrefix(prefix string, images ...string) *corev1.Pod {\n\tpod := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tGenerateName: prefix,\n\t\t\tNamespace: f.Namespace,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tNodeSelector: map[string]string{\n\t\t\t\thostnameNodeSelectorLabel: f.NodeName,\n\t\t\t},\n\t\t\tTolerations: []corev1.Toleration{\n\t\t\t\t{\n\t\t\t\t\tKey: f.TaintKey,\n\t\t\t\t\tValue: f.TaintValue,\n\t\t\t\t\tEffect: corev1.TaintEffect(f.TaintEffect),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tfor idx, img := range images {\n\t\tpod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{\n\t\t\tName: fmt.Sprintf(\"%s%d\", prefix, idx),\n\t\t\tImage: img,\n\t\t})\n\t}\n\treturn pod\n}", "func CreatePod(name string, options ...PodOption) *corev1.Pod {\n\tpod := &corev1.Pod{\n\t\tTypeMeta: genTypeMeta(gvk.Pod),\n\t\tObjectMeta: genObjectMeta(name, true),\n\t}\n\n\tfor _, option := range options {\n\t\toption(pod)\n\t}\n\n\treturn pod\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\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}", "func createNewPod(ctx context.Context, podName, clusterID string, shadow bool, clientset kubernetes.Interface) (*corev1.Pod, error) {\n\tresources := corev1.ResourceList{}\n\tresources[corev1.ResourceCPU] = *resource.NewQuantity(1, resource.DecimalSI)\n\tresources[corev1.ResourceMemory] = *resource.NewQuantity(50000, resource.DecimalSI)\n\tpod := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: podName,\n\t\t\tNamespace: \"default\",\n\t\t\tLabels: map[string]string{},\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t0: {\n\t\t\t\t\tName: \"test-container1\",\n\t\t\t\t\tResources: corev1.ResourceRequirements{\n\t\t\t\t\t\tLimits: resources,\n\t\t\t\t\t\tRequests: resources,\n\t\t\t\t\t},\n\t\t\t\t\tImage: \"nginx\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif clusterID != \"\" {\n\t\tpod.Labels[forge.LiqoOriginClusterIDKey] = clusterID\n\t}\n\tif shadow {\n\t\tpod.Labels[consts.LocalPodLabelKey] = consts.LocalPodLabelValue\n\t}\n\tpod, err := clientset.CoreV1().Pods(\"default\").Create(ctx, pod, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// set Status Ready\n\tpod.Status = corev1.PodStatus{\n\t\tPhase: corev1.PodRunning,\n\t}\n\tpod, err = clientset.CoreV1().Pods(\"default\").UpdateStatus(ctx, pod, metav1.UpdateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pod, nil\n}", "func makePodTemplate(bind *v1alpha1.Bind, namespace string, serviceAccountName string, podName string, spec *v1alpha1.EventSourceSpec, op BindOperation, trigger EventTrigger, route string, bindContext BindContext) (*corev1.PodTemplateSpec, error) {\n\tmarshalledBindContext, err := json.Marshal(bindContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencodedBindContext := base64.StdEncoding.EncodeToString(marshalledBindContext)\n\n\tmarshalledTrigger, err := json.Marshal(trigger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencodedTrigger := base64.StdEncoding.EncodeToString(marshalledTrigger)\n\n\tencodedParameters := \"\"\n\tif spec.Parameters != nil {\n\t\tmarshalledParameters, err := json.Marshal(spec.Parameters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tencodedParameters = base64.StdEncoding.EncodeToString(marshalledParameters)\n\t}\n\n\treturn &corev1.PodTemplateSpec{\n\t\tSpec: corev1.PodSpec{\n\t\t\tServiceAccountName: serviceAccountName,\n\t\t\tRestartPolicy: corev1.RestartPolicyNever,\n\t\t\tContainers: []corev1.Container{\n\t\t\t\tcorev1.Container{\n\t\t\t\t\tName: podName,\n\t\t\t\t\tImage: spec.Image,\n\t\t\t\t\tImagePullPolicy: \"Always\",\n\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindOperationKey,\n\t\t\t\t\t\t\tValue: string(op),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindTargetKey,\n\t\t\t\t\t\t\tValue: route,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindTriggerKey,\n\t\t\t\t\t\t\tValue: encodedTrigger,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindContextKey,\n\t\t\t\t\t\t\tValue: encodedBindContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: EventSourceParametersKey,\n\t\t\t\t\t\t\tValue: encodedParameters,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, nil\n}", "func CreateTestingNS(baseName string, c client.Client, labels map[string]string) (*corev1.Namespace, error) {\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tlabels[selectorKey] = string(RunID)\n\n\t// We don't use ObjectMeta.GenerateName feature, as in case of API call\n\t// failure we don't know whether the namespace was created and what is its\n\t// name.\n\tname := fmt.Sprintf(\"%v-%v\", baseName, RandomSuffix())\n\n\tnamespaceObj := &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: \"\",\n\t\t\tLabels: labels,\n\t\t},\n\t\tStatus: corev1.NamespaceStatus{},\n\t}\n\t// Be robust about making the namespace creation call.\n\tif err := wait.PollImmediate(poll, pollShortTimeout, func() (bool, error) {\n\t\tvar err error\n\t\terr = c.Create(context.Background(), namespaceObj)\n\t\tif err != nil {\n\t\t\tif apierrs.IsAlreadyExists(err) {\n\t\t\t\t// regenerate on conflict\n\t\t\t\tLogf(\"Namespace name %q was already taken, generate a new name and retry\", namespaceObj.Name)\n\t\t\t\tnamespaceObj.Name = fmt.Sprintf(\"%v-%v\", baseName, RandomSuffix())\n\t\t\t} else {\n\t\t\t\tLogf(\"Unexpected error while creating namespace: %v\", err)\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\t\treturn true, nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn namespaceObj, nil\n}", "func (h *httpHandler) CreateServiceBinding(w http.ResponseWriter, r *http.Request) {\n\tvar req scmodel.CreateServiceBindingRequest\n\terr := util.BodyToObject(r, &req)\n\tif err != nil {\n\t\tlog.Printf(\"Error unmarshaling: %#v\\n\", err)\n\t\tutil.WriteResponse(w, 400, err)\n\t\treturn\n\t}\n\n\tbinding := scmodel.ServiceBinding{\n\t\tName: req.Name,\n\t\tFrom: req.From,\n\t\tTo: req.To,\n\t\tParameters: req.Parameters,\n\t}\n\n\terr = h.k8sStorage.AddServiceBinding(&binding, nil)\n\tif err != nil {\n\t\tlog.Printf(\"Error creating a service binding %s: %v\\n\", req.Name, err)\n\t\tutil.WriteResponse(w, 400, err)\n\t\treturn\n\t}\n\tutil.WriteResponse(w, 200, binding)\n}", "func createWebhookConfigurationReadyNamespace(f *framework.Framework, namespace string) {\n\tctx := f.Context\n\t_, err := f.VclusterClient.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: namespace + \"-markers\",\n\t\t\tLabels: map[string]string{uniqueName + \"-markers\": \"true\"},\n\t\t},\n\t}, metav1.CreateOptions{})\n\tframework.ExpectNoError(err, \"creating namespace for webhook configuration ready markers\")\n}", "func (pc *BasicECSPodCreator) CreatePodFromExistingDefinition(ctx context.Context, def cocoa.ECSTaskDefinition, opts ...cocoa.ECSPodExecutionOptions) (cocoa.ECSPod, error) {\n\treturn nil, errors.New(\"TODO: implement\")\n}", "func bind(client kubernetes.Interface, p corev1.Pod, NodeName string, discoverTime time.Duration, schedTime time.Time) error{\r\n\r\n if p.Annotations != nil {\r\n p.Annotations[\"epsilon.discover.time\"]=discoverTime.String()\r\n p.Annotations[\"epsilon.scheduling.time\"]=time.Since(schedTime).String()\r\n }else{\r\n p.Annotations=map[string]string{\r\n \"epsilon.discover.time\": discoverTime.String(),\r\n \"epsilon.scheduling.time\": time.Since(schedTime).String(),\r\n }\r\n }\r\n\r\n log.Infof(\"Attempting to bind %v/%v to %v\", p.Namespace, p.Name, NodeName)\r\n\tbinding := &corev1.Binding{\r\n\t\tObjectMeta: metav1.ObjectMeta{\r\n Namespace: p.Namespace,\r\n Name: p.Name,\r\n UID: p.UID,\r\n Annotations: p.Annotations,\r\n },\r\n\t\tTarget: corev1.ObjectReference{Kind: \"Node\", Name: NodeName},\r\n\t}\r\n\r\n\terr := client.CoreV1().Pods(binding.Namespace).Bind(context.TODO(), binding, metav1.CreateOptions{})\r\n\tif err != nil {\r\n //key, _ := cache.MetaNamespaceKeyFunc(p)\r\n\r\n\r\n // Resend pod for reschedule\r\n\r\n\t\treturn errors.New(err.Error())\r\n\t}\r\n\treturn nil\r\n}", "func NewDeleteCoreV1NamespacedPodOK() *DeleteCoreV1NamespacedPodOK {\n\n\treturn &DeleteCoreV1NamespacedPodOK{}\n}", "func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Create(parent string, instanceId string, bindingId string, googlecloudservicebrokerv1alpha1__binding *GoogleCloudServicebrokerV1alpha1__Binding) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {\n\tc := &ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\tc.instanceId = instanceId\n\tc.bindingId = bindingId\n\tc.googlecloudservicebrokerv1alpha1__binding = googlecloudservicebrokerv1alpha1__binding\n\treturn c\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingAccepted {\n\to.Payload = payload\n\treturn o\n}", "func Create(input CreateInput) *corev1.Pod {\n\tExpect(input.Creator).NotTo(BeNil(), \"input.Creator is required for Pod.Create\")\n\tExpect(input.Config).NotTo(BeNil(), \"input.Config is required for Pod.Create\")\n\tExpect(input.Name).NotTo(BeEmpty(), \"input.Name is required for Pod.Create\")\n\tExpect(input.Namespace).NotTo(BeEmpty(), \"input.Namespace is required for Pod.Create\")\n\tExpect(input.SecretProviderClassName).NotTo(BeEmpty(), \"input.SecretProviderClassName is required for Pod.Create\")\n\n\tBy(fmt.Sprintf(\"Creating Pod \\\"%s\\\"\", input.Name))\n\n\treadOnly := true\n\tpod := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: input.Name,\n\t\t\tNamespace: input.Namespace,\n\t\t\tLabels: input.Labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tTerminationGracePeriodSeconds: to.Int64Ptr(int64(0)),\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"tester\",\n\t\t\t\t\tImage: \"registry.k8s.io/e2e-test-images/busybox:1.29-4\",\n\t\t\t\t\tImagePullPolicy: corev1.PullIfNotPresent,\n\t\t\t\t\tCommand: []string{\"/bin/sleep\", \"10000\"},\n\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"secrets-store-inline\",\n\t\t\t\t\t\t\tMountPath: \"/mnt/secrets-store\",\n\t\t\t\t\t\t\tReadOnly: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tVolumes: []corev1.Volume{\n\t\t\t\t{\n\t\t\t\t\tName: \"secrets-store-inline\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tCSI: &corev1.CSIVolumeSource{\n\t\t\t\t\t\t\tDriver: \"secrets-store.csi.k8s.io\",\n\t\t\t\t\t\t\tReadOnly: &readOnly,\n\t\t\t\t\t\t\tVolumeAttributes: map[string]string{\"secretProviderClass\": input.SecretProviderClassName},\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\tif input.NodePublishSecretRefName != \"\" {\n\t\tfor idx := range pod.Spec.Volumes {\n\t\t\tpod.Spec.Volumes[idx].CSI.NodePublishSecretRef = &corev1.LocalObjectReference{Name: input.NodePublishSecretRefName}\n\t\t}\n\t}\n\n\tif input.Config.IsWindowsTest {\n\t\tpod.Spec.NodeSelector = map[string]string{\"kubernetes.io/os\": \"windows\"}\n\t} else if input.Config.IsGPUTest {\n\t\tpod.Spec.NodeSelector = map[string]string{\n\t\t\t\"kubernetes.io/os\": \"linux\",\n\t\t\t\"accelerator\": \"nvidia\",\n\t\t}\n\t} else {\n\t\tpod.Spec.NodeSelector = map[string]string{\"kubernetes.io/os\": \"linux\"}\n\t}\n\n\tif input.ServiceAccountName != \"\" {\n\t\tpod.Spec.ServiceAccountName = input.ServiceAccountName\n\t}\n\n\tExpect(input.Creator.Create(context.TODO(), pod)).Should(Succeed())\n\treturn pod\n}", "func NewReadCoreV1NamespacedPodOK() *ReadCoreV1NamespacedPodOK {\n\treturn &ReadCoreV1NamespacedPodOK{}\n}", "func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*corev1.Namespace, error) {\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tnamespaceObj := &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t// use a short name because long names produce long hostnames but\n\t\t\t// maximum allowed length by mysql is 60.\n\t\t\t// https://dev.mysql.com/doc/refman/8.0/en/change-master-to.html\n\t\t\tGenerateName: fmt.Sprintf(\"e2e-%v-\", baseName),\n\t\t\tNamespace: \"\",\n\t\t\tLabels: labels,\n\t\t},\n\t\tStatus: corev1.NamespaceStatus{},\n\t}\n\t// Be robust about making the namespace creation call.\n\tvar got *corev1.Namespace\n\tif err := wait.PollImmediate(Poll, 30*time.Second, func() (bool, error) {\n\t\tvar err error\n\t\tgot, err = c.CoreV1().Namespaces().Create(namespaceObj)\n\t\tif err != nil {\n\t\t\tLogf(\"Unexpected error while creating namespace: %v\", err)\n\t\t\treturn false, nil\n\t\t}\n\t\treturn true, nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn got, nil\n}", "func (f *Framework) CreateNamespace(namespace string) error {\n\tkubeCore := f.KubeClient.CoreV1()\n\tns := &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: namespace,\n\t\t\tLabels: NamespaceLabel,\n\t\t},\n\t}\n\n\tctx := context.Background()\n\n\toptions := metav1.CreateOptions{}\n\tif _, err := kubeCore.Namespaces().Create(ctx, ns, options); err != nil {\n\t\treturn errors.Errorf(\"creating namespace %s failed: %s\", namespace, err.Error())\n\t}\n\tlogrus.Infof(\"Namespace %s is created\", namespace)\n\n\tsaName := \"agones-sdk\"\n\tif _, err := kubeCore.ServiceAccounts(namespace).Create(ctx, &corev1.ServiceAccount{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: saName,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\"app\": \"agones\"},\n\t\t},\n\t}, options); err != nil {\n\t\terr = errors.Errorf(\"creating ServiceAccount %s in namespace %s failed: %s\", saName, namespace, err.Error())\n\t\tderr := f.DeleteNamespace(namespace)\n\t\tif derr != nil {\n\t\t\treturn errors.Wrap(err, derr.Error())\n\t\t}\n\t\treturn err\n\t}\n\tlogrus.Infof(\"ServiceAccount %s/%s is created\", namespace, saName)\n\n\trb := &rbacv1.RoleBinding{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"agones-sdk-access\",\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\"app\": \"agones\"},\n\t\t},\n\t\tRoleRef: rbacv1.RoleRef{\n\t\t\tAPIGroup: \"rbac.authorization.k8s.io\",\n\t\t\tKind: \"ClusterRole\",\n\t\t\tName: \"agones-sdk\",\n\t\t},\n\t\tSubjects: []rbacv1.Subject{\n\t\t\t{\n\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\tName: saName,\n\t\t\t\tNamespace: namespace,\n\t\t\t},\n\t\t},\n\t}\n\tif _, err := f.KubeClient.RbacV1().RoleBindings(namespace).Create(ctx, rb, options); err != nil {\n\t\terr = errors.Errorf(\"creating RoleBinding for service account %q in namespace %q failed: %s\", saName, namespace, err.Error())\n\t\tderr := f.DeleteNamespace(namespace)\n\t\tif derr != nil {\n\t\t\treturn errors.Wrap(err, derr.Error())\n\t\t}\n\t\treturn err\n\t}\n\tlogrus.Infof(\"RoleBinding %s/%s is created\", namespace, rb.Name)\n\n\treturn nil\n}", "func CreatePod(cs clientset.Interface, ns string, manifest *v1.Pod) error {\n\tLogf(\"creating pod %s in namespace %s\", manifest.Name, ns)\n\t_, err := cs.CoreV1().Pods(ns).Create(context.TODO(), manifest, metav1.CreateOptions{})\n\treturn err\n}", "func NewConvergedinfraBasePod(classId string, objectType string) *ConvergedinfraBasePod {\n\tthis := ConvergedinfraBasePod{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar type_ string = \"FlexPod\"\n\tthis.Type = &type_\n\treturn &this\n}", "func NewCreateCoreV1NamespacedPodAccepted() *CreateCoreV1NamespacedPodAccepted {\n\treturn &CreateCoreV1NamespacedPodAccepted{}\n}", "func newNs(ctx context.Context, cl client.Client, name string) error {\n\tns := &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t},\n\t}\n\tif err := cl.Create(ctx, ns); err != nil {\n\t\tif !errors.IsAlreadyExists(err) {\n\t\t\treturn fmt.Errorf(\"failed to create namespace %s: %v\", ns.Name, err)\n\t\t}\n\t}\n\treturn nil\n}", "func CreateTestingNS(ctx context.Context, baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error) {\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tlabels[\"e2e-run\"] = string(RunID)\n\n\t// We don't use ObjectMeta.GenerateName feature, as in case of API call\n\t// failure we don't know whether the namespace was created and what is its\n\t// name.\n\tname := fmt.Sprintf(\"%v-%v\", baseName, RandomSuffix())\n\n\tnamespaceObj := &v1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: \"\",\n\t\t\tLabels: labels,\n\t\t},\n\t\tStatus: v1.NamespaceStatus{},\n\t}\n\t// Be robust about making the namespace creation call.\n\tvar got *v1.Namespace\n\tif err := wait.PollImmediateWithContext(ctx, Poll, 30*time.Second, func(ctx context.Context) (bool, error) {\n\t\tvar err error\n\t\tgot, err = c.CoreV1().Namespaces().Create(ctx, namespaceObj, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\tif apierrors.IsAlreadyExists(err) {\n\t\t\t\t// regenerate on conflict\n\t\t\t\tLogf(\"Namespace name %q was already taken, generate a new name and retry\", namespaceObj.Name)\n\t\t\t\tnamespaceObj.Name = fmt.Sprintf(\"%v-%v\", baseName, RandomSuffix())\n\t\t\t} else {\n\t\t\t\tLogf(\"Unexpected error while creating namespace: %v\", err)\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\t\treturn true, nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif TestContext.VerifyServiceAccount {\n\t\tif err := WaitForDefaultServiceAccountInNamespace(ctx, c, got.Name); err != nil {\n\t\t\t// Even if we fail to create serviceAccount in the namespace,\n\t\t\t// we have successfully create a namespace.\n\t\t\t// So, return the created namespace.\n\t\t\treturn got, err\n\t\t}\n\t}\n\treturn got, nil\n}", "func (f *Framework) CreatePodObjectWithMandatorySecretKey(testName string) *corev1.Pod {\n\treturn f.CreatePodObjectWithEnv(testName, []corev1.EnvVar{\n\t\t{\n\t\t\tName: \"SECRET_0_KEY_0\",\n\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{Name: \"secret-0\"},\n\t\t\t\t\tKey: \"key_0\",\n\t\t\t\t\tOptional: &bFalse,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n}", "func generatePod(c *client.Client, podName string, nsName string, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\n\tp := pod.Instance{\n\t\tName: podName,\n\t\tNamespace: nsName,\n\t\tImage: imageSource,\n\t\tLabelKey: \"app\",\n\t\tImagePullPolicy: \"ifnotpresent\",\n\t\tLabelValue: \"podTest\",\n\t}\n\n\ttimeNow := time.Now()\n\tfmt.Printf(\"creating pod %s in namespace %s\\n\", podName, nsName)\n\terr := pod.CreateWaitRunningState(c, &p)\n\t//if err != nil {\n\t//\tfmt.Printf(\"%s\\n\", err)\n\t//\tos.Exit(1)\n\t//}\n\n\tlastTime, err := pod.GetLastTimeConditionHappened(c,\n\t\t\"Ready\",\n\t\tpodName,\n\t\tnsName)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\thour := lastTime.Sub(timeNow).Hours()\n\thour, mf := math.Modf(hour)\n\ttotalHour = totalHour + hour\n\n\tminutes := mf * 60\n\tminutes, sf := math.Modf(minutes)\n\ttotalMinutes = totalMinutes + minutes\n\n\tseconds := sf * 60\n\ttotalSec = totalSec + seconds\n\n\tfmt.Printf(\"\\n- %s is created and responsive in namespace %s ✅\\n\", p.Name, p.Namespace)\n\tfmt.Printf(\"- image used: %s\\n\", imageSource)\n\n\tfmt.Println(\" took:\", hour, \"hours\",\n\t\tminutes, \"minutes\",\n\t\tseconds, \"seconds\")\n\tsumSec = append(sumSec, totalSec)\n\tsumMin = append(sumMin, totalMinutes)\n\tsumHour = append(sumHour, totalHour)\n\ttotalPodsRunning = totalPodsRunning + 1\n\tfmt.Printf(\"TOTAL NUMBER OF PODS RUNNING: %v\\n\", totalPodsRunning)\n\tfmt.Printf(\"TIME NOW: %v\\n\", time.Now().Format(\"2006-01-02 3:4:5 PM\"))\n\n\ttotalHour = 0\n\ttotalMinutes = 0\n\ttotalSec = 0\n}", "func newPodWithSessionName(t *testing.T, name string) *corev1.Pod {\n\tt.Helper()\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"session-name\": name,\n\t\t\t},\n\t\t},\n\t}\n}", "func (a *Client) CreateNetworkingV1beta1NamespacedIngress(params *CreateNetworkingV1beta1NamespacedIngressParams) (*CreateNetworkingV1beta1NamespacedIngressOK, *CreateNetworkingV1beta1NamespacedIngressCreated, *CreateNetworkingV1beta1NamespacedIngressAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateNetworkingV1beta1NamespacedIngressParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createNetworkingV1beta1NamespacedIngress\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/vnd.kubernetes.protobuf\", \"application/yaml\"},\n\t\tConsumesMediaTypes: []string{\"*/*\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateNetworkingV1beta1NamespacedIngressReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreateNetworkingV1beta1NamespacedIngressOK:\n\t\treturn value, nil, nil, nil\n\tcase *CreateNetworkingV1beta1NamespacedIngressCreated:\n\t\treturn nil, value, nil, nil\n\tcase *CreateNetworkingV1beta1NamespacedIngressAccepted:\n\t\treturn nil, nil, value, nil\n\t}\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 networking_v1beta1: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func createNamespaceSpec(nsName string) *v1.Namespace {\n\tvar namespace = &v1.Namespace{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Namespace\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tGenerateName: nsName,\n\t\t},\n\t}\n\treturn namespace\n}", "func toK8SPodSpec(podSpec *pbpod.PodSpec) *corev1.Pod {\n\t// Create pod template spec and apply configurations to spec.\n\tlabels := make(map[string]string)\n\tfor _, label := range podSpec.GetLabels() {\n\t\tlabels[label.GetKey()] = label.GetValue()\n\t}\n\n\ttermGracePeriod := int64(podSpec.GetKillGracePeriodSeconds())\n\n\tpodTemp := corev1.PodTemplateSpec{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: toK8SContainerSpecs(podSpec.GetContainers()),\n\t\t\tInitContainers: toK8SContainerSpecs(podSpec.GetInitContainers()),\n\t\t\tRestartPolicy: \"Never\",\n\t\t\tTerminationGracePeriodSeconds: &termGracePeriod,\n\t\t},\n\t}\n\n\t// Bind node and create pod.\n\treturn &corev1.Pod{\n\t\tObjectMeta: podTemp.ObjectMeta,\n\t\tSpec: podTemp.Spec,\n\t}\n}", "func (f *Framework) CreatePodObjectWithOptionalSecretKey(testName string) *corev1.Pod {\n\treturn f.CreatePodObjectWithEnv(testName, []corev1.EnvVar{\n\t\t{\n\t\t\tName: \"SECRET_0_KEY_0\",\n\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{Name: \"secret-0\"},\n\t\t\t\t\tKey: \"key_0\",\n\t\t\t\t\tOptional: &bTrue,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n}", "func (pc *BasicECSPodCreator) CreatePod(ctx context.Context, opts ...cocoa.ECSPodCreationOptions) (cocoa.ECSPod, error) {\n\tmergedPodCreationOpts := cocoa.MergeECSPodCreationOptions(opts...)\n\tvar mergedPodExecutionOpts cocoa.ECSPodExecutionOptions\n\tif mergedPodCreationOpts.ExecutionOpts != nil {\n\t\tmergedPodExecutionOpts = cocoa.MergeECSPodExecutionOptions(*mergedPodCreationOpts.ExecutionOpts)\n\t}\n\n\tif err := mergedPodCreationOpts.Validate(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"invalid pod creation options\")\n\t}\n\n\tif err := mergedPodExecutionOpts.Validate(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"invalid pod execution options\")\n\t}\n\n\tif err := pc.createSecrets(ctx, &mergedPodCreationOpts); err != nil {\n\t\treturn nil, errors.Wrap(err, \"creating new secrets\")\n\t}\n\ttaskDefinition := pc.exportPodCreationOptions(mergedPodCreationOpts)\n\n\tregisterOut, err := pc.client.RegisterTaskDefinition(ctx, taskDefinition)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"registering task definition\")\n\t}\n\n\tif registerOut.TaskDefinition == nil || registerOut.TaskDefinition.TaskDefinitionArn == nil {\n\t\treturn nil, errors.New(\"expected a task definition from ECS, but none was returned\")\n\t}\n\n\ttaskDef := cocoa.NewECSTaskDefinition().\n\t\tSetID(utility.FromStringPtr(registerOut.TaskDefinition.TaskDefinitionArn)).\n\t\tSetOwned(true)\n\n\trunTask := pc.exportTaskExecutionOptions(mergedPodExecutionOpts, *taskDef)\n\n\trunOut, err := pc.client.RunTask(ctx, runTask)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"running task for definition '%s' in cluster '%s'\", utility.FromStringPtr(runTask.TaskDefinition), utility.FromStringPtr(runTask.Cluster))\n\t}\n\n\tif len(runOut.Failures) > 0 {\n\t\tcatcher := grip.NewBasicCatcher()\n\t\tfor _, failure := range runOut.Failures {\n\t\t\tcatcher.Errorf(\"task '%s': %s: %s\\n\", utility.FromStringPtr(failure.Arn), utility.FromStringPtr(failure.Detail), utility.FromStringPtr(failure.Reason))\n\t\t}\n\t\treturn nil, errors.Wrap(catcher.Resolve(), \"running task\")\n\t}\n\n\tif len(runOut.Tasks) == 0 || runOut.Tasks[0].TaskArn == nil {\n\t\treturn nil, errors.New(\"expected a task to be running in ECS, but none was returned\")\n\t}\n\n\tresources := cocoa.NewECSPodResources().\n\t\tSetCluster(utility.FromStringPtr(mergedPodExecutionOpts.Cluster)).\n\t\tSetContainers(pc.translateContainerResources(runOut.Tasks[0].Containers, mergedPodCreationOpts.ContainerDefinitions)).\n\t\tSetTaskDefinition(*taskDef).\n\t\tSetTaskID(utility.FromStringPtr(runOut.Tasks[0].TaskArn))\n\n\tpodOpts := NewBasicECSPodOptions().\n\t\tSetClient(pc.client).\n\t\tSetVault(pc.vault).\n\t\tSetStatusInfo(translatePodStatusInfo(runOut.Tasks[0])).\n\t\tSetResources(*resources)\n\n\tp, err := NewBasicECSPod(podOpts)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"creating pod\")\n\t}\n\n\treturn p, nil\n}", "func generatePod(ip string) *corev1.Pod {\n\tpod := &corev1.Pod{}\n\tpod.Status.PodIP = ip\n\tpod.Status.Phase = corev1.PodRunning\n\tpod.Spec.Containers = []corev1.Container{\n\t\t{Ports: []corev1.ContainerPort{\n\t\t\t{Name: \"management\", ContainerPort: 8558},\n\t\t}},\n\t}\n\treturn pod\n}", "func (g genericPlugin) Create(yamlFilePath string, namespace string, client plugin.KubernetesConnector) (string, error) {\n\tif namespace == \"\" {\n\t\tnamespace = \"default\"\n\t}\n\n\t//Decode the yaml file to create a runtime.Object\n\tunstruct := &unstructured.Unstructured{}\n\t//Ignore the returned obj as we expect the data in unstruct\n\t_, err := utils.DecodeYAML(yamlFilePath, unstruct)\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Decode deployment object error\")\n\t}\n\n\tdynClient := client.GetDynamicClient()\n\tmapper := client.GetMapper()\n\n\tgvk := unstruct.GroupVersionKind()\n\tmapping, err := mapper.RESTMapping(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version)\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Mapping kind to resource error\")\n\t}\n\n\t//Add the tracking label to all resources created here\n\tlabels := unstruct.GetLabels()\n\t//Check if labels exist for this object\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tlabels[config.GetConfiguration().KubernetesLabelName] = client.GetInstanceID()\n\tunstruct.SetLabels(labels)\n\n\t// This checks if the resource we are creating has a podSpec in it\n\t// Eg: Deployment, StatefulSet, Job etc..\n\t// If a PodSpec is found, the label will be added to it too.\n\tplugin.TagPodsIfPresent(unstruct, client.GetInstanceID())\n\n\tgvr := mapping.Resource\n\tvar createdObj *unstructured.Unstructured\n\n\tswitch mapping.Scope.Name() {\n\tcase meta.RESTScopeNameNamespace:\n\t\tcreatedObj, err = dynClient.Resource(gvr).Namespace(namespace).Create(unstruct, metav1.CreateOptions{})\n\tcase meta.RESTScopeNameRoot:\n\t\tcreatedObj, err = dynClient.Resource(gvr).Create(unstruct, metav1.CreateOptions{})\n\tdefault:\n\t\treturn \"\", pkgerrors.New(\"Got an unknown RESTSCopeName for mapping: \" + gvk.String())\n\t}\n\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Create object error\")\n\t}\n\n\treturn createdObj.GetName(), nil\n}", "func TestCreateNamespace(t *testing.T) {\n\tconst (\n\t\tprojectId = \"test-project-id\"\n\t\tprojectName = \"test-project-name\"\n\t\tclusterId = \"test-cluster-id\"\n\t\tnamespaceName = \"test-namespace\"\n\t)\n\tvar (\n\t\tactualOpts *clusterClient.Namespace\n\t\tclientConfig = ClientConfig{}\n\t\tnamespace = projectModel.Namespace{\n\t\t\tName: namespaceName,\n\t\t}\n\t\ttestClients = stubs.CreateBackendStubs(t)\n\t)\n\n\tnamespaceOperationsStub := stubs.CreateNamespaceOperationsStub(t)\n\tnamespaceOperationsStub.DoCreate = func(opts *clusterClient.Namespace) (*clusterClient.Namespace, error) {\n\t\tactualOpts = opts\n\t\treturn nil, nil\n\t}\n\ttestClients.ClusterClient.Namespace = namespaceOperationsStub\n\n\tclient := rancherClient{\n\t\tclientConfig: clientConfig,\n\t\tprojectId: projectId,\n\t\tclusterClient: testClients.ClusterClient,\n\t\tlogger: logrus.WithField(\"test\", true),\n\t}\n\t//Act\n\terr := client.CreateNamespace(namespace)\n\n\t//Assert\n\tassert.Ok(t, err)\n\tassert.Equals(t, &clusterClient.Namespace{Name: \"test-namespace\", ProjectID: \"test-project-id\"}, actualOpts)\n}", "func InitWorkerPod(ctx context.Context, jsonBody io.ReadCloser) (*v1types.WorkerPod, error) {\n\tg := config.GetConfig()\n\twp := v1types.DefaultWorkerPod(g)\n\tid := ctx.Value(apitypes.LogCtxID).(uuid.UUID)\n\tidArr := strings.Split(id.String(), \"-\")\n\twp.Name = wp.Name + idArr[0]\n\tlogger.InfoFields(\"This default\", logger.Fields{\n\t\tapitypes.LogCtxID: ctx.Value(apitypes.LogCtxID),\n\t\t\"Container-prefix\": wp.Name,\n\t})\n\n\terr := json.NewDecoder(jsonBody).Decode(&wp)\n\twp.Prefix = wp.Prefix + \"-\" + idArr[0] + \"-\"\n\tif err != nil {\n\t\treturn wp, err\n\t}\n\tif wp.Cmd == nil {\n\t\treturn wp, errors.New(\"cmd is a mandatory parameter\")\n\t}\n\n\treturn wp, err\n}", "func (client Client) CreatePod(pod api.Pod) (api.Pod, error) {\n\tvar result api.Pod\n\tbody, err := json.Marshal(pod)\n\tif err == nil {\n\t\t_, err = client.rawRequest(\"POST\", \"pods\", bytes.NewBuffer(body), &result)\n\t}\n\treturn result, err\n}", "func (sar *ServiceAccountReflector) NewNamespaced(opts *options.NamespacedOpts) manager.NamespacedReflector {\n\tremoteSecrets := opts.RemoteFactory.Core().V1().Secrets()\n\n\t// Regardless of the type of the event, we always enqueue the key corresponding to the pod.\n\t_, err := remoteSecrets.Informer().AddEventHandler(opts.HandlerFactory(RemoteSASecretNamespacedKeyer(opts.LocalNamespace, forge.LiqoNodeName)))\n\tutilruntime.Must(err)\n\n\treturn &NamespacedServiceAccountReflector{\n\t\tNamespacedReflector: generic.NewNamespacedReflector(opts, ServiceAccountReflectorName),\n\n\t\tlocalPods: sar.localPods.Pods(opts.LocalNamespace),\n\t\tremoteSecrets: remoteSecrets.Lister().Secrets(opts.RemoteNamespace),\n\n\t\tlocalSAsClient: opts.LocalClient.CoreV1().ServiceAccounts(opts.LocalNamespace),\n\t\tremoteSecretsClient: opts.RemoteClient.CoreV1().Secrets(opts.RemoteNamespace),\n\t}\n}", "func NewCreateCoreV1NamespacedServiceAccountTokenOK() *CreateCoreV1NamespacedServiceAccountTokenOK {\n\n\treturn &CreateCoreV1NamespacedServiceAccountTokenOK{}\n}", "func newbusyBoxPod(cr *v1alpha1.MysqlBinding) *corev1.Pod {\n\tlabels := map[string]string{\n\t\t\"app\": \"busy-box\",\n\t}\n\treturn &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"busy-box\",\n\t\t\tNamespace: cr.Namespace,\n\t\t\tOwnerReferences: []metav1.OwnerReference{\n\t\t\t\t*metav1.NewControllerRef(cr, schema.GroupVersionKind{\n\t\t\t\t\tGroup: v1alpha1.SchemeGroupVersion.Group,\n\t\t\t\t\tVersion: v1alpha1.SchemeGroupVersion.Version,\n\t\t\t\t\tKind: \"MysqlBinding\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"busybox\",\n\t\t\t\t\tImage: \"busybox\",\n\t\t\t\t\tCommand: []string{\"sleep\", \"3600\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func newNs(name string) (*namespace, error) {\n\tns := &namespace{\n\t\tname: name,\n\t\tsetMap: make(map[string]string),\n\t\tpodMap: make(map[types.UID]*corev1.Pod),\n\t\tnpMap: make(map[string]*networkingv1.NetworkPolicy),\n\t\tipsMgr: ipsm.NewIpsetManager(),\n\t\tiptMgr: iptm.NewIptablesManager(),\n\t}\n\n\treturn ns, nil\n}", "func (m *ECSPodCreator) CreatePodFromExistingDefinition(ctx context.Context, def cocoa.ECSTaskDefinition, opts ...cocoa.ECSPodExecutionOptions) (cocoa.ECSPod, error) {\n\treturn nil, errors.New(\"TODO: implement\")\n}", "func newKnativeServiceCreated(namespace, name string) pkgreconciler.Event {\n\treturn pkgreconciler.NewEvent(corev1.EventTypeNormal, \"KnativeServiceCreated\", \"created service: \\\"%s/%s\\\"\", namespace, name)\n}", "func (o *NamespaceOptions) createNamespace() *corev1.Namespace {\n\tnamespace := &corev1.Namespace{\n\t\tTypeMeta: metav1.TypeMeta{APIVersion: corev1.SchemeGroupVersion.String(), Kind: \"Namespace\"},\n\t\tObjectMeta: metav1.ObjectMeta{Name: o.Name},\n\t}\n\treturn namespace\n}", "func NewPod(ns, name string) (*Pod, error) {\n\tkey := fmt.Sprintf(\"%s/%s\", ns, name)\n\titem, exists, err := podInformer.GetIndexer().GetByKey(key)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get pod: %s failed, error: %s\", name, err)\n\t} else if exists == false {\n\t\treturn nil, fmt.Errorf(\"pod: %s is not exists\", name)\n\t}\n\n\tpod, ok := item.(*core_v1.Pod)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"type assertion is wrong, shoud be pod\")\n\t}\n\n\treturn &Pod{Pod: pod}, nil\n}", "func (f *Framework) CreatePodObjectWithEnv(testName string, env []corev1.EnvVar) *corev1.Pod {\n\tpod := f.CreateDummyPodObjectWithPrefix(testName, \"env-test\", \"foo\")\n\tpod.Spec.Containers[0].Env = env\n\treturn pod\n}", "func (a *Client) CreateRbacAuthorizationV1alpha1NamespacedRoleBinding(params *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingParams) (*CreateRbacAuthorizationV1alpha1NamespacedRoleBindingOK, *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingCreated, *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateRbacAuthorizationV1alpha1NamespacedRoleBindingParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createRbacAuthorizationV1alpha1NamespacedRoleBinding\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/vnd.kubernetes.protobuf\", \"application/yaml\"},\n\t\tConsumesMediaTypes: []string{\"*/*\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateRbacAuthorizationV1alpha1NamespacedRoleBindingReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingOK:\n\t\treturn value, nil, nil, nil\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingCreated:\n\t\treturn nil, value, nil, nil\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingAccepted:\n\t\treturn nil, nil, value, nil\n\t}\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 rbac_authorization_v1alpha1: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func newPodForCR(cr *devopsv1.Server) *corev1.Pod {\n\tlabels := map[string]string{\n\t\t\"app\": cr.Name,\n\t}\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name + \"-pod\",\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"busybox\",\n\t\t\t\t\tImage: \"busybox\",\n\t\t\t\t\tCommand: []string{\"sleep\", \"3600\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func createPod(session *gexec.Session, webhookName string) {\n\tpodYamlAbsPath, err := filepath.Abs(filepath.Join(podYamlRelPath))\n\tExpect(err).NotTo(HaveOccurred())\n\n\tpod, err := kubeClient.CreatePod(podYamlAbsPath)\n\tEventually(session.Err, defaultTimeout).Should(gbytes.Say(\"handle: validating webhook request\"))\n\tExpect(err).NotTo(HaveOccurred())\n\tExpect(pod).NotTo(BeNil())\n\n\t// delete pod\n\terr = kubeClient.DeletePod(pod.GetName())\n\tExpect(err).NotTo(HaveOccurred())\n\n\t// delete validating webhook configuration\n\terr = kubeClient.DeleteValidatingWebhookConfiguration(webhookName)\n\tExpect(err).NotTo(HaveOccurred())\n\n\tif utils.IsWindowsPlatform() {\n\t\tsession.Kill()\n\t} else {\n\t\tsession.Terminate()\n\t}\n}", "func (s *Server) CreatePods(ctx context.Context, in *datahub_v1alpha1.CreatePodsRequest) (*status.Status, error) {\n\tscope.Debug(\"Request received from CreatePods grpc function: \" + utils.InterfaceToString(in))\n\tvar containerDAO cluster_status_dao.ContainerOperation = &cluster_status_dao_impl.Container{\n\t\tInfluxDBConfig: *s.Config.InfluxDB,\n\t}\n\n\tif err := containerDAO.AddPods(in.GetPods()); err != nil {\n\t\tscope.Error(err.Error())\n\t\treturn &status.Status{\n\t\t\tCode: int32(code.Code_INTERNAL),\n\t\t\tMessage: err.Error(),\n\t\t}, nil\n\t}\n\treturn &status.Status{\n\t\tCode: int32(code.Code_OK),\n\t}, nil\n}", "func CreateKubeNamespaceWithLabel(baseName string, labels map[string]string, c kubernetes.Interface) (string, error) {\n\treturn createNamespace(baseName, labels, c)\n}", "func NewService(log zerolog.Logger, config *rest.Config, builder APIBuilder) (*Service, error) {\n\tvar c client.Client\n\tctx := context.Background()\n\tif err := retry.Do(ctx, func(ctx context.Context) error {\n\t\tvar err error\n\t\tc, err = client.New(config, client.Options{})\n\t\treturn err\n\t}, retry.Timeout(constants.TimeoutK8sClient)); err != nil {\n\t\treturn nil, err\n\t}\n\tns, err := constants.GetNamespace()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tpodName, err := constants.GetPodName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tpipelineName, err := constants.GetPipelineName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tlinkName, err := constants.GetLinkName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tport, err := constants.GetAPIPort()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tdnsName, err := constants.GetDNSName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tvar p corev1.Pod\n\tpodKey := client.ObjectKey{\n\t\tName: podName,\n\t\tNamespace: ns,\n\t}\n\tif err := retry.Do(ctx, func(ctx context.Context) error {\n\t\treturn c.Get(ctx, podKey, &p)\n\t}, retry.Timeout(constants.TimeoutAPIServer)); err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to get own pod\")\n\t\treturn nil, maskAny(err)\n\t}\n\tavReg, err := avclient.NewAnnotatedValueRegistryClient()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to create annotated value registry client\")\n\t\treturn nil, maskAny(err)\n\t}\n\tagentReg, err := pipelinecl.CreateAgentRegistryClient()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to create agent registry client\")\n\t\treturn nil, maskAny(err)\n\t}\n\tstatsSink, err := trackingcl.CreateStatisticsSinkClient()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to create statistics sink client\")\n\t\treturn nil, maskAny(err)\n\t}\n\turi := newLinkURI(dnsName, port, &p)\n\tstatistics := &tracking.LinkStatistics{\n\t\tName: linkName,\n\t\tURI: uri,\n\t}\n\tdeps := APIDependencies{\n\t\tClient: c,\n\t\tPipelineName: pipelineName,\n\t\tLinkName: linkName,\n\t\tNamespace: ns,\n\t\tURI: uri,\n\t\tAnnotatedValueRegistry: avReg,\n\t\tAgentRegistry: agentReg,\n\t\tStatistics: statistics,\n\t}\n\tavPublisher, err := builder.NewAnnotatedValuePublisher(deps)\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tavSource, err := builder.NewAnnotatedValueSource(deps)\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\treturn &Service{\n\t\tlog: log,\n\t\tport: port,\n\t\tlinkName: linkName,\n\t\turi: uri,\n\t\tstatistics: statistics,\n\t\tavPublisher: avPublisher,\n\t\tavSource: avSource,\n\t\tavRegistry: avReg,\n\t\tagentRegistry: agentReg,\n\t\tstatisticsSink: statsSink,\n\t}, nil\n}", "func newCreateParam4Create(req *http.Request) (*CreateParam, error) {\n\tparam := &CreateParam{}\n\terr := xreq.BindJSON(req, param)\n\treturn param, err\n}", "func NewCreateCoreV1NamespacedServiceAccountTokenOK() *CreateCoreV1NamespacedServiceAccountTokenOK {\n\treturn &CreateCoreV1NamespacedServiceAccountTokenOK{}\n}", "func NewPatchCoreV1NamespacedServiceAccountOK() *PatchCoreV1NamespacedServiceAccountOK {\n\treturn &PatchCoreV1NamespacedServiceAccountOK{}\n}", "func NewCreateNetworkingV1beta1NamespacedIngressOK() *CreateNetworkingV1beta1NamespacedIngressOK {\n\n\treturn &CreateNetworkingV1beta1NamespacedIngressOK{}\n}", "func createTestingNS(t *testing.T, baseName string, c clientset.Interface) (*v1.Namespace, error) {\n\t// We don't use ObjectMeta.GenerateName feature, as in case of API call\n\t// failure we don't know whether the namespace was created and what is its\n\t// name.\n\tname := fmt.Sprintf(\"%v-%v\", baseName, strconv.Itoa(rand.Intn(10000)))\n\n\tnamespaceObj := &v1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: \"\",\n\t\t},\n\t\tStatus: v1.NamespaceStatus{},\n\t}\n\t// Be robust about making the namespace creation call.\n\tvar got *v1.Namespace\n\tif err := wait.PollImmediate(nsCreationPollInterval, 30*time.Second, func() (bool, error) {\n\t\tvar err error\n\t\tgot, err = c.CoreV1().Namespaces().Create(context.TODO(), namespaceObj, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\tif apierrors.IsAlreadyExists(err) {\n\t\t\t\t// regenerate on conflict\n\t\t\t\tt.Logf(\"Namespace name %q was already taken, generate a new name and retry\", namespaceObj.Name)\n\t\t\t\tnamespaceObj.Name = fmt.Sprintf(\"%v-%v\", baseName, strconv.Itoa(rand.Intn(10000)))\n\t\t\t} else {\n\t\t\t\tt.Logf(\"Unexpected error while creating namespace: %v\", err)\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\t\treturn true, nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn got, nil\n}", "func NewCreateCoreV1NamespacedPodCreated() *CreateCoreV1NamespacedPodCreated {\n\treturn &CreateCoreV1NamespacedPodCreated{}\n}", "func createIstioCARoleBinding(clientset kubernetes.Interface, namespace string) error {\n\trolebinding := rbac.RoleBinding{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"rbac.authorization.k8s.io/v1beta1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"istio-ca-role-binding\",\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSubjects: []rbac.Subject{\n\t\t\t{\n\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\tName: \"default\",\n\t\t\t\tNamespace: namespace,\n\t\t\t},\n\t\t},\n\t\tRoleRef: rbac.RoleRef{\n\t\t\tKind: \"Role\",\n\t\t\tName: \"istio-ca-role\",\n\t\t\tAPIGroup: \"rbac.authorization.k8s.io\",\n\t\t},\n\t}\n\t_, err := clientset.RbacV1beta1().RoleBindings(namespace).Create(&rolebinding)\n\treturn err\n}", "func NewPod(pod k8sApi.Pod, dc *DaemonConfig) (*Pod, error) {\n\tvar sidecarState *SidecarState\n\t// If we have an annotation saying we have a sidecar, lets load it\n\tif sidecarContainerName, ok := pod.ObjectMeta.Annotations[SidecarName]; ok {\n\t\t// we want to mark the initial state based on what the sidecar container state\n\t\t// is, this way if the daemon gets reloaded we don't require a re-negotiation\n\t\tsidecarReady := false\n\t\tfound := false\n\t\tfor _, containerStatus := range pod.Status.ContainerStatuses {\n\t\t\tif containerStatus.Name == sidecarContainerName {\n\t\t\t\tsidecarReady = containerStatus.Ready\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 nil, fmt.Errorf(\"Unable to find sidecar container %s\", sidecarContainerName)\n\t\t}\n\n\t\tsidecarState = &SidecarState{\n\t\t\tSidecarName: sidecarContainerName,\n\t\t\tReady: sidecarReady,\n\t\t}\n\t}\n\n\t// Calculate SyncInterval\n\tsyncInterval := dc.DefaultSyncInterval\n\tif interval, ok := pod.ObjectMeta.Annotations[SyncInterval]; ok {\n\t\tduration, err := time.ParseDuration(interval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsyncInterval = duration\n\t}\n\n\t// Calculate CheckTTL\n\tcheckTTL := dc.DefaultCheckTTL\n\tif interval, ok := pod.ObjectMeta.Annotations[ConsulServiceCheckTTL]; ok {\n\t\tduration, err := time.ParseDuration(interval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcheckTTL = duration\n\t}\n\n\t// Ensure that the checkTTL is at least SyncTTLBuffer greater than syncTTL\n\tif minCheckTTL := syncInterval + dc.SyncTTLBuffer; checkTTL < minCheckTTL {\n\t\tcheckTTL = minCheckTTL\n\t}\n\n\treturn &Pod{\n\t\tPod: pod,\n\t\tSidecarState: sidecarState,\n\t\tSyncStatuses: make(map[string]*SyncStatus),\n\n\t\tCheckTTL: checkTTL,\n\t\tSyncInterval: syncInterval,\n\t}, nil\n\n}", "func (client *WebAppsClient) createOrUpdateHostNameBindingSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, slot string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingSlotOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif hostName == \"\" {\n\t\treturn nil, errors.New(\"parameter hostName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{hostName}\", url.PathEscape(hostName))\n\tif slot == \"\" {\n\t\treturn nil, errors.New(\"parameter slot cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{slot}\", url.PathEscape(slot))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, hostNameBinding)\n}", "func newPodForCR(cr *cnatv1alpha1.At) *corev1.Pod {\n\tlabels := map[string]string{\n\t\t\"app\": cr.Name,\n\t}\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name + \"-pod\",\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"busybox\",\n\t\t\t\t\tImage: \"busybox\",\n\t\t\t\t\tCommand: strings.Split(cr.Spec.Command, \" \"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tRestartPolicy: corev1.RestartPolicyOnFailure,\n\t\t},\n\t}\n}", "func (r *KubeRunner) CreateNamespace(namespace string, inject bool) error {\n\tns := &v1.Namespace{\n\t\tObjectMeta: v12.ObjectMeta{\n\t\t\tName: namespace,\n\t\t\tLabels: map[string]string{},\n\t\t},\n\t}\n\n\tif inject {\n\t\t// ns.Labels[\"istio.io/rev\"] = \"1-8-1\"\n\t\tns.Labels[\"istio-injection\"] = \"enabled\"\n\t}\n\n\t_, err := r.client.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})\n\treturn err\n}", "func New(_ runtime.Object, h framework.Handle) (framework.Plugin, error) {\n\treturn &PodState{handle: h}, nil\n}", "func NewWatchCoreV1NamespacedEndpointsOK() *WatchCoreV1NamespacedEndpointsOK {\n\n\treturn &WatchCoreV1NamespacedEndpointsOK{}\n}", "func NewCreateExtensionsV1beta1NamespacedIngressOK() *CreateExtensionsV1beta1NamespacedIngressOK {\n\n\treturn &CreateExtensionsV1beta1NamespacedIngressOK{}\n}", "func NewConvergedinfraBasePodWithDefaults() *ConvergedinfraBasePod {\n\tthis := ConvergedinfraBasePod{}\n\tvar classId string = \"convergedinfra.Pod\"\n\tthis.ClassId = classId\n\tvar objectType string = \"convergedinfra.Pod\"\n\tthis.ObjectType = objectType\n\tvar type_ string = \"FlexPod\"\n\tthis.Type = &type_\n\treturn &this\n}", "func NewPod(operator container.Container, tasks []*container.BcsContainerTask,\n\thandler *container.PodEventHandler, extendedResourceDriver *extendedresource.Driver) container.Pod {\n\tif len(tasks) == 0 {\n\t\tlogs.Errorf(\"Create DockerPod error, Container tasks are 0\")\n\t\treturn nil\n\t}\n\ttaskMap := make(map[string]*container.BcsContainerTask)\n\tif len(tasks) > 1 {\n\t\tfor _, task := range tasks[1:] {\n\t\t\ttaskMap[task.Name] = task\n\t\t}\n\t}\n\trCxt, rCancel := context.WithCancel(context.Background())\n\tpod := &DockerPod{\n\t\thealthy: true,\n\t\tstatus: container.PodStatus_UNKNOWN,\n\t\tpodCxt: rCxt,\n\t\tpodCancel: rCancel,\n\t\tevents: handler,\n\t\tnetTask: tasks[0],\n\t\tconClient: operator,\n\t\tconTasks: taskMap,\n\t\trunningContainer: make(map[string]*container.BcsContainerInfo),\n\t\tresourceManager: devicepluginmanager.NewResourceManager(\n\t\t\tdevicepluginmanager.NewDevicePluginManager(),\n\t\t\textendedResourceDriver),\n\t}\n\treturn pod\n}", "func NewConnectCoreV1OptionsNamespacedPodProxyWithPathOK() *ConnectCoreV1OptionsNamespacedPodProxyWithPathOK {\n\treturn &ConnectCoreV1OptionsNamespacedPodProxyWithPathOK{}\n}", "func buildEchoPod(name, namespace string) *corev1.Pod {\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": name,\n\t\t\t},\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\t// Note that HTTP/1.0 will strip the HSTS response header\n\t\t\t\t\tArgs: []string{\n\t\t\t\t\t\t\"TCP4-LISTEN:8080,reuseaddr,fork\",\n\t\t\t\t\t\t`EXEC:'/bin/bash -c \\\"printf \\\\\\\"HTTP/1.0 200 OK\\r\\n\\r\\n\\\\\\\"; sed -e \\\\\\\"/^\\r/q\\\\\\\"\\\"'`,\n\t\t\t\t\t},\n\t\t\t\t\tCommand: []string{\"/bin/socat\"},\n\t\t\t\t\tImage: \"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\",\n\t\t\t\t\tName: \"echo\",\n\t\t\t\t\tPorts: []corev1.ContainerPort{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContainerPort: int32(8080),\n\t\t\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tAllowPrivilegeEscalation: pointer.Bool(false),\n\t\t\t\t\t\tCapabilities: &corev1.Capabilities{\n\t\t\t\t\t\t\tDrop: []corev1.Capability{\"ALL\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tRunAsNonRoot: pointer.Bool(true),\n\t\t\t\t\t\tSeccompProfile: &corev1.SeccompProfile{\n\t\t\t\t\t\t\tType: corev1.SeccompProfileTypeRuntimeDefault,\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}", "func AddPodEvent(\r\n client kubernetes.Interface,\r\n obj *corev1.Pod, message string,\r\n typeOfError string){\r\n\r\n // Update API server to inform admin that the pod cannot be deployed and require manual intervention\r\n timestamp := time.Now().UTC()\r\n client.CoreV1().Events(obj.Namespace).Create(context.TODO(), &corev1.Event{\r\n Count: 1,\r\n Message: message,\r\n Reason: \"Error\",\r\n LastTimestamp: metav1.NewTime(timestamp),\r\n FirstTimestamp: metav1.NewTime(timestamp),\r\n Type: typeOfError,\r\n Source: corev1.EventSource{\r\n Component: \"custom\",\r\n },\r\n InvolvedObject: corev1.ObjectReference{\r\n Kind: \"Pod\",\r\n Name: obj.Name,\r\n Namespace: obj.Namespace,\r\n UID: obj.UID,\r\n },\r\n ObjectMeta: metav1.ObjectMeta{\r\n GenerateName: obj.Name + \"-\",\r\n },\r\n },metav1.CreateOptions{})\r\n}", "func NewConnectCoreV1PatchNamespacedServiceProxyOK() *ConnectCoreV1PatchNamespacedServiceProxyOK {\n\treturn &ConnectCoreV1PatchNamespacedServiceProxyOK{}\n}", "func (h *HealthCheck) createBinding() error {\n\tif h.frameworkError != nil {\n\t\treturn h.frameworkError\n\t}\n\tglog.V(4).Info(\"Creating a ServiceBinding\")\n\tbinding := &v1beta1.ServiceBinding{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: h.bindingName,\n\t\t\tNamespace: h.namespace.Name,\n\t\t},\n\t\tSpec: v1beta1.ServiceBindingSpec{\n\t\t\tServiceInstanceRef: v1beta1.LocalObjectReference{\n\t\t\t\tName: h.instanceName,\n\t\t\t},\n\t\t\tSecretName: \"my-secret\",\n\t\t},\n\t}\n\toperationStartTime := time.Now()\n\tbinding, err := h.serviceCatalogClientSet.ServicecatalogV1beta1().ServiceBindings(h.namespace.Name).Create(binding)\n\tif err != nil {\n\t\treturn h.setError(\"Error creating binding: %v\", err.Error())\n\t}\n\tif binding == nil {\n\t\treturn h.setError(\"Binding should not be null\")\n\t}\n\n\tglog.V(4).Info(\"Waiting for ServiceBinding to be ready\")\n\t_, err = util.WaitForBindingCondition(h.serviceCatalogClientSet.ServicecatalogV1beta1(),\n\t\th.namespace.Name,\n\t\th.bindingName,\n\t\tv1beta1.ServiceBindingCondition{\n\t\t\tType: v1beta1.ServiceBindingConditionReady,\n\t\t\tStatus: v1beta1.ConditionTrue,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn h.setError(\"binding not ready: %v\", err.Error())\n\t}\n\tReportOperationCompleted(\"binding_ready\", operationStartTime)\n\n\tglog.V(4).Info(\"Validating that a secret was created after binding\")\n\t_, err = h.kubeClientSet.CoreV1().Secrets(h.namespace.Name).Get(\"my-secret\", metav1.GetOptions{})\n\tif err != nil {\n\t\treturn h.setError(\"Error getting secret: %v\", err.Error())\n\t}\n\tglog.V(4).Info(\"Successfully created instance & binding. Cleaning up.\")\n\treturn nil\n}", "func (f *fixture) buildPod(namespace k8s.Namespace, name string, podLabels labels.Set, rs *appsv1.ReplicaSet) *v1.Pod {\n\tf.t.Helper()\n\n\tif podLabels == nil {\n\t\tpodLabels = make(labels.Set)\n\t}\n\n\tp := &v1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tUID: types.UID(name + \"-uid\"),\n\t\t\tNamespace: namespace.String(),\n\t\t\tName: name,\n\t\t\tLabels: podLabels,\n\t\t},\n\t\tStatus: v1.PodStatus{\n\t\t\tPhase: v1.PodRunning,\n\t\t},\n\t}\n\n\tif rs != nil {\n\t\tif rs.Namespace != p.Namespace {\n\t\t\tf.t.Fatalf(\"Pod (namespace=%s) cannot differ from ReplicaSet (namespace=%s)\", p.Namespace, rs.Namespace)\n\t\t}\n\t\tp.OwnerReferences = []metav1.OwnerReference{k8s.RuntimeObjToOwnerRef(rs)}\n\t}\n\n\treturn p\n}", "func (client *WebAppsClient) createOrUpdateHostNameBindingCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif hostName == \"\" {\n\t\treturn nil, errors.New(\"parameter hostName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{hostName}\", url.PathEscape(hostName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, hostNameBinding)\n}", "func (b DefaultBinder) Bind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) *framework.Status {\n\tlogger := klog.FromContext(ctx)\n\tlogger.V(3).Info(\"Attempting to bind pod to node\", \"pod\", klog.KObj(p), \"node\", klog.KRef(\"\", nodeName))\n\tbinding := &v1.Binding{\n\t\tObjectMeta: metav1.ObjectMeta{Namespace: p.Namespace, Name: p.Name, UID: p.UID},\n\t\tTarget: v1.ObjectReference{Kind: \"Node\", Name: nodeName},\n\t}\n\terr := b.handle.ClientSet().CoreV1().Pods(binding.Namespace).Bind(ctx, binding, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn framework.AsStatus(err)\n\t}\n\treturn nil\n}", "func (cc *CloudComb) CreateNamespace(params string) (uint, error) {\n\tif params == \"\" {\n\t\treturn 0, errors.New(\"Params is missed\")\n\t}\n\tparams = PurifyParams(params)\n\n\tbody := bytes.NewBufferString(params)\n\n\t// do rest request\n\tresult, _, err := cc.doRESTRequest(\"POST\", \"/api/v1/namespaces\", \"\", nil, body)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// create cluster response messages\n\ttype createNamespaceRes struct {\n\t\tId uint `json:\"namespace_id\"`\n\t}\n\tvar res createNamespaceRes\n\n\t// parse json\n\tif err := json.NewDecoder(strings.NewReader(result)).Decode(&res); err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn res.Id, nil\n}", "func (o *AggregatedDomain) CreateNSGRoutingPolicyBinding(child *NSGRoutingPolicyBinding) *bambou.Error {\n\n\treturn bambou.CurrentSession().CreateChild(o, child)\n}", "func newHCDummy(logPrefix string, json JSONMap) *HCDummy {\n\thc := new(HCDummy)\n\thc.HCBase = &HCBase{}\n\thc.hcType = json[\"type\"].(string)\n\n\tif result, ok := json[\"result\"].(HCResult); ok {\n\t\thc.result = result\n\t}\n\n\thc.logPrefix = logPrefix + fmt.Sprintf(\"healthcheck: %s response: %s \", hc.hcType, hc.result)\n\n\tlogger.Info.Printf(hc.logPrefix + \"created\")\n\treturn hc\n}", "func NewK8sObj(t reflect.Type) metav1.Object {\n\t// Create a new object of the webhook resource type\n\t// convert to ptr and typeassert to Kubernetes Object.\n\tvar obj interface{}\n\tnewObj := reflect.New(t)\n\tobj = newObj.Interface()\n\treturn obj.(metav1.Object)\n}", "func (i *IAM) CreateAIB(useDefaultNS bool, aibName, aiName string) error {\n\n\t// Obtain the kubernetes cluster client connection\n\tc, _ := i.k.GetClient()\n\tnamespace := i.getNamespace(useDefaultNS)\n\n\tif !useDefaultNS {\n\t\t// Create the non-default namespace (will succeed if the ns already exists)\n\t\tapiNS := apiv1.Namespace{}\n\t\tapiNS.ObjectMeta.Name = namespace\n\t\tc.CoreV1().Namespaces().Create(context.TODO(), &apiNS, metav1.CreateOptions{})\n\t}\n\n\t// Create an runtime AIB object and assign attributes using input parameters\n\truntimeAib := i.createAIBObject(namespace, aibName, aiName)\n\n\t// set the api path for the aadpodidentity package which include the azureidentitybindings custom resource definition\n\tapiPath := \"apis/aadpodidentity.k8s.io/v1\"\n\n\t//\tCreate a rest api client Post request object\n\trequest := c.CoreV1().RESTClient().Post().AbsPath(apiPath).Namespace(namespace).Resource(\"azureidentitybindings\").Body(runtimeAib)\n\n\t//\tCall the api to execute the Post request and create the AIB in the cluster\n\tresponse := request.Do(context.TODO())\n\tlog.Printf(\"[DEBUG] RAW Result: %+v\", response)\n\n\t//\tHandle response error - ignore the error if the AIB already exists\n\tif (response.Error() != nil) && (!errors.IsAlreadyExists(response.Error())) {\n\t\tlog.Printf(\"[DEBUG] AIB creation Error: %+v\", response.Error())\n\t\treturn response.Error()\n\t}\n\n\tb, _ := response.Raw()\n\tbs := string(b)\n\tlog.Printf(\"[DEBUG] STRING result: %+v\", bs)\n\n\tj := kubernetes.K8SJSON{}\n\tjson.Unmarshal(b, &j)\n\n\tlog.Printf(\"[DEBUG] JSON result: %+v\", j)\n\n\treturn nil\n}", "func NewWatchCoreV1NamespacedPodTemplateListOK() *WatchCoreV1NamespacedPodTemplateListOK {\n\treturn &WatchCoreV1NamespacedPodTemplateListOK{}\n}" ]
[ "0.63520384", "0.6186931", "0.6132766", "0.58211017", "0.5794697", "0.56063914", "0.538274", "0.53195673", "0.525624", "0.5243301", "0.510414", "0.49943492", "0.4982679", "0.49806482", "0.4952446", "0.49439883", "0.49132204", "0.488667", "0.48738325", "0.48653427", "0.48653123", "0.48268953", "0.48247746", "0.48229477", "0.48189628", "0.48171908", "0.48060447", "0.47882566", "0.47475982", "0.47340348", "0.4727914", "0.471924", "0.47174174", "0.4672669", "0.46630225", "0.46623078", "0.46537665", "0.46450204", "0.46251765", "0.4596378", "0.45811406", "0.45779115", "0.45772642", "0.45758379", "0.45624524", "0.45556298", "0.4554856", "0.45430544", "0.45371288", "0.45352527", "0.45192248", "0.4495273", "0.44938704", "0.44858298", "0.4481467", "0.4464102", "0.44620115", "0.4459601", "0.44562814", "0.44530064", "0.4450408", "0.4438085", "0.44247866", "0.44203922", "0.4414388", "0.43862623", "0.43851846", "0.43806186", "0.43804392", "0.43760213", "0.43753088", "0.4366849", "0.43646595", "0.4356371", "0.43523148", "0.4351654", "0.43480608", "0.43322465", "0.43277216", "0.43208495", "0.43207106", "0.43156764", "0.43079248", "0.42994326", "0.42988214", "0.42921215", "0.42920607", "0.42764068", "0.42763987", "0.4268611", "0.42676315", "0.42651814", "0.42548543", "0.42512974", "0.42501467", "0.42440596", "0.42383838", "0.42357382", "0.42356023", "0.4218549" ]
0.7081246
0
WithPayload adds the payload to the create core v1 namespaced pod binding o k response
WithPayload добавляет payload в create core v1 namespaced pod binding o k response
func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressCreated) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *ReplaceExtensionsV1beta1NamespacedIngressCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressCreated) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *CreateExtensionsV1beta1NamespacedIngressCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressOK) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *CreateExtensionsV1beta1NamespacedIngressOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenOK) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenCreated) WithPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) *CreateCoreV1NamespacedServiceAccountTokenCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenOK) WithPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) *CreateCoreV1NamespacedServiceAccountTokenOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) WithPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) *CreateNetworkingV1beta1NamespacedIngressCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedPodOK) WithPayload(payload *models.IoK8sAPICoreV1Pod) *DeleteCoreV1NamespacedPodOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedPodOK) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated) WithPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressOK) WithPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) *CreateNetworkingV1beta1NamespacedIngressOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *WatchCoreV1NamespacedEndpointsOK) WithPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) *WatchCoreV1NamespacedEndpointsOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated) WithPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated {\n\to.Payload = payload\n\treturn o\n}", "func (g genericPlugin) Create(yamlFilePath string, namespace string, client plugin.KubernetesConnector) (string, error) {\n\tif namespace == \"\" {\n\t\tnamespace = \"default\"\n\t}\n\n\t//Decode the yaml file to create a runtime.Object\n\tunstruct := &unstructured.Unstructured{}\n\t//Ignore the returned obj as we expect the data in unstruct\n\t_, err := utils.DecodeYAML(yamlFilePath, unstruct)\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Decode deployment object error\")\n\t}\n\n\tdynClient := client.GetDynamicClient()\n\tmapper := client.GetMapper()\n\n\tgvk := unstruct.GroupVersionKind()\n\tmapping, err := mapper.RESTMapping(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version)\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Mapping kind to resource error\")\n\t}\n\n\t//Add the tracking label to all resources created here\n\tlabels := unstruct.GetLabels()\n\t//Check if labels exist for this object\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tlabels[config.GetConfiguration().KubernetesLabelName] = client.GetInstanceID()\n\tunstruct.SetLabels(labels)\n\n\t// This checks if the resource we are creating has a podSpec in it\n\t// Eg: Deployment, StatefulSet, Job etc..\n\t// If a PodSpec is found, the label will be added to it too.\n\tplugin.TagPodsIfPresent(unstruct, client.GetInstanceID())\n\n\tgvr := mapping.Resource\n\tvar createdObj *unstructured.Unstructured\n\n\tswitch mapping.Scope.Name() {\n\tcase meta.RESTScopeNameNamespace:\n\t\tcreatedObj, err = dynClient.Resource(gvr).Namespace(namespace).Create(unstruct, metav1.CreateOptions{})\n\tcase meta.RESTScopeNameRoot:\n\t\tcreatedObj, err = dynClient.Resource(gvr).Create(unstruct, metav1.CreateOptions{})\n\tdefault:\n\t\treturn \"\", pkgerrors.New(\"Got an unknown RESTSCopeName for mapping: \" + gvk.String())\n\t}\n\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Create object error\")\n\t}\n\n\treturn createdObj.GetName(), nil\n}", "func (o *CreateOK) WithPayload(payload *models.Event) *CreateOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *NamespaceOptions) Run() error {\n\tnamespace := o.createNamespace()\n\tif err := util.CreateOrUpdateAnnotation(o.CreateAnnotation, namespace, scheme.DefaultJSONEncoder()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.DryRunStrategy != cmdutil.DryRunClient {\n\t\tcreateOptions := metav1.CreateOptions{}\n\t\tif o.FieldManager != \"\" {\n\t\t\tcreateOptions.FieldManager = o.FieldManager\n\t\t}\n\t\tcreateOptions.FieldValidation = o.ValidationDirective\n\t\tif o.DryRunStrategy == cmdutil.DryRunServer {\n\t\t\tcreateOptions.DryRun = []string{metav1.DryRunAll}\n\t\t}\n\t\tvar err error\n\t\tnamespace, err = o.Client.Namespaces().Create(context.TODO(), namespace, createOptions)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn o.PrintObj(namespace)\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressOK) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *ReplaceExtensionsV1beta1NamespacedIngressOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreatePackageCreated) WithPayload(payload *models.Package) *CreatePackageCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func createPod(clientset kubernetes.Interface, namespace string, image string, name string,\n\tlabels map[string]string, command []string, args []string) (*v1.Pod, error) {\n\tenv := []v1.EnvVar{\n\t\t{\n\t\t\tName: \"NAMESPACE\",\n\t\t\tValueFrom: &v1.EnvVarSource{\n\t\t\t\tFieldRef: &v1.ObjectFieldSelector{\n\t\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\t\tFieldPath: \"metadata.namespace\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tspec := v1.PodSpec{\n\t\tContainers: []v1.Container{\n\t\t\t{\n\t\t\t\tEnv: env,\n\t\t\t\tName: fmt.Sprintf(\"%v-pod-container\", name),\n\t\t\t\tImage: image,\n\t\t\t},\n\t\t},\n\t}\n\n\tif len(command) > 0 {\n\t\tspec.Containers[0].Command = command\n\t\tif len(args) > 0 {\n\t\t\tspec.Containers[0].Args = args\n\t\t}\n\t}\n\n\tpod := &v1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: labels,\n\t\t\tName: name,\n\t\t},\n\t\tSpec: spec,\n\t}\n\n\tif _, err := clientset.CoreV1().Pods(namespace).Create(pod); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn clientset.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})\n}", "func (o *CreateHPCResourceCreated) SetPayload(payload *models.CreatedResponse) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *ReplaceCertificatesV1CertificateSigningRequestCreated) WithPayload(payload *models.IoK8sAPICertificatesV1CertificateSigningRequest) *ReplaceCertificatesV1CertificateSigningRequestCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated) SetPayload(payload *models.Version) {\n\to.Payload = payload\n}", "func (o *WatchCoreV1NamespacedEndpointsOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func NewCreateCoreV1NamespacedPodBindingOK() *CreateCoreV1NamespacedPodBindingOK {\n\n\treturn &CreateCoreV1NamespacedPodBindingOK{}\n}", "func (o *DeleteCoreV1NamespacedConfigMapOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func buildEchoPod(name, namespace string) *corev1.Pod {\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": name,\n\t\t\t},\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\t// Note that HTTP/1.0 will strip the HSTS response header\n\t\t\t\t\tArgs: []string{\n\t\t\t\t\t\t\"TCP4-LISTEN:8080,reuseaddr,fork\",\n\t\t\t\t\t\t`EXEC:'/bin/bash -c \\\"printf \\\\\\\"HTTP/1.0 200 OK\\r\\n\\r\\n\\\\\\\"; sed -e \\\\\\\"/^\\r/q\\\\\\\"\\\"'`,\n\t\t\t\t\t},\n\t\t\t\t\tCommand: []string{\"/bin/socat\"},\n\t\t\t\t\tImage: \"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\",\n\t\t\t\t\tName: \"echo\",\n\t\t\t\t\tPorts: []corev1.ContainerPort{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContainerPort: int32(8080),\n\t\t\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tAllowPrivilegeEscalation: pointer.Bool(false),\n\t\t\t\t\t\tCapabilities: &corev1.Capabilities{\n\t\t\t\t\t\t\tDrop: []corev1.Capability{\"ALL\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tRunAsNonRoot: pointer.Bool(true),\n\t\t\t\t\t\tSeccompProfile: &corev1.SeccompProfile{\n\t\t\t\t\t\t\tType: corev1.SeccompProfileTypeRuntimeDefault,\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}", "func (o *WatchApiregistrationV1APIServiceOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func createNS(h *Handler, ns string, del bool) error {\n\tmanifest := fmt.Sprintf(`\napiVersion: v1\nkind: Namespace\nmetadata:\n name: %s\n`,\n\t\tns,\n\t)\n\n\tif err := h.applyManifest(del, noneNamespace, []byte(manifest)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (o *ReplicateCreated) WithPayload(payload *models.SteeringRequestID) *ReplicateCreated {\n\to.Payload = payload\n\treturn o\n}", "func (f *Framework) CreateNamespace(namespace string) error {\n\tkubeCore := f.KubeClient.CoreV1()\n\tns := &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: namespace,\n\t\t\tLabels: NamespaceLabel,\n\t\t},\n\t}\n\n\tctx := context.Background()\n\n\toptions := metav1.CreateOptions{}\n\tif _, err := kubeCore.Namespaces().Create(ctx, ns, options); err != nil {\n\t\treturn errors.Errorf(\"creating namespace %s failed: %s\", namespace, err.Error())\n\t}\n\tlogrus.Infof(\"Namespace %s is created\", namespace)\n\n\tsaName := \"agones-sdk\"\n\tif _, err := kubeCore.ServiceAccounts(namespace).Create(ctx, &corev1.ServiceAccount{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: saName,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\"app\": \"agones\"},\n\t\t},\n\t}, options); err != nil {\n\t\terr = errors.Errorf(\"creating ServiceAccount %s in namespace %s failed: %s\", saName, namespace, err.Error())\n\t\tderr := f.DeleteNamespace(namespace)\n\t\tif derr != nil {\n\t\t\treturn errors.Wrap(err, derr.Error())\n\t\t}\n\t\treturn err\n\t}\n\tlogrus.Infof(\"ServiceAccount %s/%s is created\", namespace, saName)\n\n\trb := &rbacv1.RoleBinding{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"agones-sdk-access\",\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\"app\": \"agones\"},\n\t\t},\n\t\tRoleRef: rbacv1.RoleRef{\n\t\t\tAPIGroup: \"rbac.authorization.k8s.io\",\n\t\t\tKind: \"ClusterRole\",\n\t\t\tName: \"agones-sdk\",\n\t\t},\n\t\tSubjects: []rbacv1.Subject{\n\t\t\t{\n\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\tName: saName,\n\t\t\t\tNamespace: namespace,\n\t\t\t},\n\t\t},\n\t}\n\tif _, err := f.KubeClient.RbacV1().RoleBindings(namespace).Create(ctx, rb, options); err != nil {\n\t\terr = errors.Errorf(\"creating RoleBinding for service account %q in namespace %q failed: %s\", saName, namespace, err.Error())\n\t\tderr := f.DeleteNamespace(namespace)\n\t\tif derr != nil {\n\t\t\treturn errors.Wrap(err, derr.Error())\n\t\t}\n\t\treturn err\n\t}\n\tlogrus.Infof(\"RoleBinding %s/%s is created\", namespace, rb.Name)\n\n\treturn nil\n}", "func newPod(ctx context.Context, cl client.Client, ns, name, image string, cmd []string) (*corev1.Pod, error) {\n\tc := corev1.Container{\n\t\tName: name,\n\t\tImage: image,\n\t\tCommand: cmd,\n\t}\n\tp := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: ns,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{c},\n\t\t\t// Kill the pod immediately so it exits quickly on deletion.\n\t\t\tTerminationGracePeriodSeconds: pointer.Int64Ptr(0),\n\t\t},\n\t}\n\tif err := cl.Create(ctx, p); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create pod %s/%s: %v\", p.Namespace, p.Name, err)\n\t}\n\treturn p, nil\n}", "func (b *bindingTest) Podcreate(name *string) {\n\tb.PodcreateAndExpose(name, nil)\n}", "func AddPodEvent(\r\n client kubernetes.Interface,\r\n obj *corev1.Pod, message string,\r\n typeOfError string){\r\n\r\n // Update API server to inform admin that the pod cannot be deployed and require manual intervention\r\n timestamp := time.Now().UTC()\r\n client.CoreV1().Events(obj.Namespace).Create(context.TODO(), &corev1.Event{\r\n Count: 1,\r\n Message: message,\r\n Reason: \"Error\",\r\n LastTimestamp: metav1.NewTime(timestamp),\r\n FirstTimestamp: metav1.NewTime(timestamp),\r\n Type: typeOfError,\r\n Source: corev1.EventSource{\r\n Component: \"custom\",\r\n },\r\n InvolvedObject: corev1.ObjectReference{\r\n Kind: \"Pod\",\r\n Name: obj.Name,\r\n Namespace: obj.Namespace,\r\n UID: obj.UID,\r\n },\r\n ObjectMeta: metav1.ObjectMeta{\r\n GenerateName: obj.Name + \"-\",\r\n },\r\n },metav1.CreateOptions{})\r\n}", "func (o *WatchApiregistrationV1APIServiceOK) WithPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) *WatchApiregistrationV1APIServiceOK {\n\to.Payload = payload\n\treturn o\n}", "func (rm *resourceManager) newDeleteRequestPayload(\n\tr *resource,\n) (*svcsdk.DeleteVpnConnectionInput, error) {\n\tres := &svcsdk.DeleteVpnConnectionInput{}\n\n\tif r.ko.Spec.DryRun != nil {\n\t\tres.SetDryRun(*r.ko.Spec.DryRun)\n\t}\n\tif r.ko.Status.VPNConnectionID != nil {\n\t\tres.SetVpnConnectionId(*r.ko.Status.VPNConnectionID)\n\t}\n\n\treturn res, nil\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated) SetPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceOK) WithPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) *CreateDiscoveryV1beta1NamespacedEndpointSliceOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) WithPayload(payload *models.IoK8sAPICoreV1Pod) *DeleteCoreV1NamespacedPodAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (b *bindingTest) PodcreateAndExpose(name *string, port *string) {\n\tcommand := []string{\"pod\", \"create\"}\n\tif name != nil {\n\t\tpodname := *name\n\t\tcommand = append(command, \"--name\", podname)\n\t}\n\tif port != nil {\n\t\tpodport := *port\n\t\tcommand = append(command, \"--publish\", podport)\n\t}\n\tb.runPodman(command).Wait(45)\n}", "func (o *ReplacePolicyV1beta1NamespacedPodDisruptionBudgetCreated) WithPayload(payload *models.IoK8sAPIPolicyV1beta1PodDisruptionBudget) *ReplacePolicyV1beta1NamespacedPodDisruptionBudgetCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteApiextensionsV1CollectionCustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *AddReleasesCreated) WithPayload(payload *models.APIResponse) *AddReleasesCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateBatchV1NamespacedJobCreated) WithPayload(payload *models.IoK8sAPIBatchV1Job) *CreateBatchV1NamespacedJobCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ServiceAddCreated) WithPayload(payload *models.Service) *ServiceAddCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1alpha1Role) {\n\to.Payload = payload\n}", "func (o *CreateBatchV1NamespacedJobOK) WithPayload(payload *models.IoK8sAPIBatchV1Job) *CreateBatchV1NamespacedJobOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK) WithPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *GraphqlPostOK) WithPayload(payload *models.GraphQLResponse) *GraphqlPostOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleCreated) WithPayload(payload *models.IoK8sAPIRbacV1Role) *CreateRbacAuthorizationV1NamespacedRoleCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *PostInteractionCreated) WithPayload(payload *models.ConsoleInteraction) *PostInteractionCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1Role) {\n\to.Payload = payload\n}", "func (o *V1CreateHelloOK) SetPayload(payload *models.CreateHelloResponse) {\n\to.Payload = payload\n}", "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateModelPackageInput, error) {\n\tres := &svcsdk.CreateModelPackageInput{}\n\n\tif r.ko.Spec.CertifyForMarketplace != nil {\n\t\tres.SetCertifyForMarketplace(*r.ko.Spec.CertifyForMarketplace)\n\t}\n\tif r.ko.Spec.ClientToken != nil {\n\t\tres.SetClientToken(*r.ko.Spec.ClientToken)\n\t}\n\tif r.ko.Spec.InferenceSpecification != nil {\n\t\tf2 := &svcsdk.InferenceSpecification{}\n\t\tif r.ko.Spec.InferenceSpecification.Containers != nil {\n\t\t\tf2f0 := []*svcsdk.ModelPackageContainerDefinition{}\n\t\t\tfor _, f2f0iter := range r.ko.Spec.InferenceSpecification.Containers {\n\t\t\t\tf2f0elem := &svcsdk.ModelPackageContainerDefinition{}\n\t\t\t\tif f2f0iter.ContainerHostname != nil {\n\t\t\t\t\tf2f0elem.SetContainerHostname(*f2f0iter.ContainerHostname)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.Image != nil {\n\t\t\t\t\tf2f0elem.SetImage(*f2f0iter.Image)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.ImageDigest != nil {\n\t\t\t\t\tf2f0elem.SetImageDigest(*f2f0iter.ImageDigest)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.ModelDataURL != nil {\n\t\t\t\t\tf2f0elem.SetModelDataUrl(*f2f0iter.ModelDataURL)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.ProductID != nil {\n\t\t\t\t\tf2f0elem.SetProductId(*f2f0iter.ProductID)\n\t\t\t\t}\n\t\t\t\tf2f0 = append(f2f0, f2f0elem)\n\t\t\t}\n\t\t\tf2.SetContainers(f2f0)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedContentTypes != nil {\n\t\t\tf2f1 := []*string{}\n\t\t\tfor _, f2f1iter := range r.ko.Spec.InferenceSpecification.SupportedContentTypes {\n\t\t\t\tvar f2f1elem string\n\t\t\t\tf2f1elem = *f2f1iter\n\t\t\t\tf2f1 = append(f2f1, &f2f1elem)\n\t\t\t}\n\t\t\tf2.SetSupportedContentTypes(f2f1)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedRealtimeInferenceInstanceTypes != nil {\n\t\t\tf2f2 := []*string{}\n\t\t\tfor _, f2f2iter := range r.ko.Spec.InferenceSpecification.SupportedRealtimeInferenceInstanceTypes {\n\t\t\t\tvar f2f2elem string\n\t\t\t\tf2f2elem = *f2f2iter\n\t\t\t\tf2f2 = append(f2f2, &f2f2elem)\n\t\t\t}\n\t\t\tf2.SetSupportedRealtimeInferenceInstanceTypes(f2f2)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedResponseMIMETypes != nil {\n\t\t\tf2f3 := []*string{}\n\t\t\tfor _, f2f3iter := range r.ko.Spec.InferenceSpecification.SupportedResponseMIMETypes {\n\t\t\t\tvar f2f3elem string\n\t\t\t\tf2f3elem = *f2f3iter\n\t\t\t\tf2f3 = append(f2f3, &f2f3elem)\n\t\t\t}\n\t\t\tf2.SetSupportedResponseMIMETypes(f2f3)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedTransformInstanceTypes != nil {\n\t\t\tf2f4 := []*string{}\n\t\t\tfor _, f2f4iter := range r.ko.Spec.InferenceSpecification.SupportedTransformInstanceTypes {\n\t\t\t\tvar f2f4elem string\n\t\t\t\tf2f4elem = *f2f4iter\n\t\t\t\tf2f4 = append(f2f4, &f2f4elem)\n\t\t\t}\n\t\t\tf2.SetSupportedTransformInstanceTypes(f2f4)\n\t\t}\n\t\tres.SetInferenceSpecification(f2)\n\t}\n\tif r.ko.Spec.MetadataProperties != nil {\n\t\tf3 := &svcsdk.MetadataProperties{}\n\t\tif r.ko.Spec.MetadataProperties.CommitID != nil {\n\t\t\tf3.SetCommitId(*r.ko.Spec.MetadataProperties.CommitID)\n\t\t}\n\t\tif r.ko.Spec.MetadataProperties.GeneratedBy != nil {\n\t\t\tf3.SetGeneratedBy(*r.ko.Spec.MetadataProperties.GeneratedBy)\n\t\t}\n\t\tif r.ko.Spec.MetadataProperties.ProjectID != nil {\n\t\t\tf3.SetProjectId(*r.ko.Spec.MetadataProperties.ProjectID)\n\t\t}\n\t\tif r.ko.Spec.MetadataProperties.Repository != nil {\n\t\t\tf3.SetRepository(*r.ko.Spec.MetadataProperties.Repository)\n\t\t}\n\t\tres.SetMetadataProperties(f3)\n\t}\n\tif r.ko.Spec.ModelApprovalStatus != nil {\n\t\tres.SetModelApprovalStatus(*r.ko.Spec.ModelApprovalStatus)\n\t}\n\tif r.ko.Spec.ModelMetrics != nil {\n\t\tf5 := &svcsdk.ModelMetrics{}\n\t\tif r.ko.Spec.ModelMetrics.Bias != nil {\n\t\t\tf5f0 := &svcsdk.Bias{}\n\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report != nil {\n\t\t\t\tf5f0f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report.ContentDigest != nil {\n\t\t\t\t\tf5f0f0.SetContentDigest(*r.ko.Spec.ModelMetrics.Bias.Report.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report.ContentType != nil {\n\t\t\t\t\tf5f0f0.SetContentType(*r.ko.Spec.ModelMetrics.Bias.Report.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report.S3URI != nil {\n\t\t\t\t\tf5f0f0.SetS3Uri(*r.ko.Spec.ModelMetrics.Bias.Report.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f0.SetReport(f5f0f0)\n\t\t\t}\n\t\t\tf5.SetBias(f5f0)\n\t\t}\n\t\tif r.ko.Spec.ModelMetrics.Explainability != nil {\n\t\t\tf5f1 := &svcsdk.Explainability{}\n\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report != nil {\n\t\t\t\tf5f1f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report.ContentDigest != nil {\n\t\t\t\t\tf5f1f0.SetContentDigest(*r.ko.Spec.ModelMetrics.Explainability.Report.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report.ContentType != nil {\n\t\t\t\t\tf5f1f0.SetContentType(*r.ko.Spec.ModelMetrics.Explainability.Report.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report.S3URI != nil {\n\t\t\t\t\tf5f1f0.SetS3Uri(*r.ko.Spec.ModelMetrics.Explainability.Report.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f1.SetReport(f5f1f0)\n\t\t\t}\n\t\t\tf5.SetExplainability(f5f1)\n\t\t}\n\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality != nil {\n\t\t\tf5f2 := &svcsdk.ModelDataQuality{}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints != nil {\n\t\t\t\tf5f2f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentDigest != nil {\n\t\t\t\t\tf5f2f0.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentType != nil {\n\t\t\t\t\tf5f2f0.SetContentType(*r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.S3URI != nil {\n\t\t\t\t\tf5f2f0.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f2.SetConstraints(f5f2f0)\n\t\t\t}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics != nil {\n\t\t\t\tf5f2f1 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentDigest != nil {\n\t\t\t\t\tf5f2f1.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentType != nil {\n\t\t\t\t\tf5f2f1.SetContentType(*r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.S3URI != nil {\n\t\t\t\t\tf5f2f1.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f2.SetStatistics(f5f2f1)\n\t\t\t}\n\t\t\tf5.SetModelDataQuality(f5f2)\n\t\t}\n\t\tif r.ko.Spec.ModelMetrics.ModelQuality != nil {\n\t\t\tf5f3 := &svcsdk.ModelQuality{}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints != nil {\n\t\t\t\tf5f3f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentDigest != nil {\n\t\t\t\t\tf5f3f0.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentType != nil {\n\t\t\t\t\tf5f3f0.SetContentType(*r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints.S3URI != nil {\n\t\t\t\t\tf5f3f0.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelQuality.Constraints.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f3.SetConstraints(f5f3f0)\n\t\t\t}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics != nil {\n\t\t\t\tf5f3f1 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentDigest != nil {\n\t\t\t\t\tf5f3f1.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentType != nil {\n\t\t\t\t\tf5f3f1.SetContentType(*r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics.S3URI != nil {\n\t\t\t\t\tf5f3f1.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelQuality.Statistics.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f3.SetStatistics(f5f3f1)\n\t\t\t}\n\t\t\tf5.SetModelQuality(f5f3)\n\t\t}\n\t\tres.SetModelMetrics(f5)\n\t}\n\tif r.ko.Spec.ModelPackageDescription != nil {\n\t\tres.SetModelPackageDescription(*r.ko.Spec.ModelPackageDescription)\n\t}\n\tif r.ko.Spec.ModelPackageGroupName != nil {\n\t\tres.SetModelPackageGroupName(*r.ko.Spec.ModelPackageGroupName)\n\t}\n\tif r.ko.Spec.ModelPackageName != nil {\n\t\tres.SetModelPackageName(*r.ko.Spec.ModelPackageName)\n\t}\n\tif r.ko.Spec.SourceAlgorithmSpecification != nil {\n\t\tf9 := &svcsdk.SourceAlgorithmSpecification{}\n\t\tif r.ko.Spec.SourceAlgorithmSpecification.SourceAlgorithms != nil {\n\t\t\tf9f0 := []*svcsdk.SourceAlgorithm{}\n\t\t\tfor _, f9f0iter := range r.ko.Spec.SourceAlgorithmSpecification.SourceAlgorithms {\n\t\t\t\tf9f0elem := &svcsdk.SourceAlgorithm{}\n\t\t\t\tif f9f0iter.AlgorithmName != nil {\n\t\t\t\t\tf9f0elem.SetAlgorithmName(*f9f0iter.AlgorithmName)\n\t\t\t\t}\n\t\t\t\tif f9f0iter.ModelDataURL != nil {\n\t\t\t\t\tf9f0elem.SetModelDataUrl(*f9f0iter.ModelDataURL)\n\t\t\t\t}\n\t\t\t\tf9f0 = append(f9f0, f9f0elem)\n\t\t\t}\n\t\t\tf9.SetSourceAlgorithms(f9f0)\n\t\t}\n\t\tres.SetSourceAlgorithmSpecification(f9)\n\t}\n\tif r.ko.Spec.Tags != nil {\n\t\tf10 := []*svcsdk.Tag{}\n\t\tfor _, f10iter := range r.ko.Spec.Tags {\n\t\t\tf10elem := &svcsdk.Tag{}\n\t\t\tif f10iter.Key != nil {\n\t\t\t\tf10elem.SetKey(*f10iter.Key)\n\t\t\t}\n\t\t\tif f10iter.Value != nil {\n\t\t\t\tf10elem.SetValue(*f10iter.Value)\n\t\t\t}\n\t\t\tf10 = append(f10, f10elem)\n\t\t}\n\t\tres.SetTags(f10)\n\t}\n\tif r.ko.Spec.ValidationSpecification != nil {\n\t\tf11 := &svcsdk.ModelPackageValidationSpecification{}\n\t\tif r.ko.Spec.ValidationSpecification.ValidationProfiles != nil {\n\t\t\tf11f0 := []*svcsdk.ModelPackageValidationProfile{}\n\t\t\tfor _, f11f0iter := range r.ko.Spec.ValidationSpecification.ValidationProfiles {\n\t\t\t\tf11f0elem := &svcsdk.ModelPackageValidationProfile{}\n\t\t\t\tif f11f0iter.ProfileName != nil {\n\t\t\t\t\tf11f0elem.SetProfileName(*f11f0iter.ProfileName)\n\t\t\t\t}\n\t\t\t\tif f11f0iter.TransformJobDefinition != nil {\n\t\t\t\t\tf11f0elemf1 := &svcsdk.TransformJobDefinition{}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.BatchStrategy != nil {\n\t\t\t\t\t\tf11f0elemf1.SetBatchStrategy(*f11f0iter.TransformJobDefinition.BatchStrategy)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.Environment != nil {\n\t\t\t\t\t\tf11f0elemf1f1 := map[string]*string{}\n\t\t\t\t\t\tfor f11f0elemf1f1key, f11f0elemf1f1valiter := range f11f0iter.TransformJobDefinition.Environment {\n\t\t\t\t\t\t\tvar f11f0elemf1f1val string\n\t\t\t\t\t\t\tf11f0elemf1f1val = *f11f0elemf1f1valiter\n\t\t\t\t\t\t\tf11f0elemf1f1[f11f0elemf1f1key] = &f11f0elemf1f1val\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetEnvironment(f11f0elemf1f1)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.MaxConcurrentTransforms != nil {\n\t\t\t\t\t\tf11f0elemf1.SetMaxConcurrentTransforms(*f11f0iter.TransformJobDefinition.MaxConcurrentTransforms)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.MaxPayloadInMB != nil {\n\t\t\t\t\t\tf11f0elemf1.SetMaxPayloadInMB(*f11f0iter.TransformJobDefinition.MaxPayloadInMB)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput != nil {\n\t\t\t\t\t\tf11f0elemf1f4 := &svcsdk.TransformInput{}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.CompressionType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4.SetCompressionType(*f11f0iter.TransformJobDefinition.TransformInput.CompressionType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.ContentType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4.SetContentType(*f11f0iter.TransformJobDefinition.TransformInput.ContentType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4f2 := &svcsdk.TransformDataSource{}\n\t\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource != nil {\n\t\t\t\t\t\t\t\tf11f0elemf1f4f2f0 := &svcsdk.TransformS3DataSource{}\n\t\t\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3DataType != nil {\n\t\t\t\t\t\t\t\t\tf11f0elemf1f4f2f0.SetS3DataType(*f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3DataType)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3URI != nil {\n\t\t\t\t\t\t\t\t\tf11f0elemf1f4f2f0.SetS3Uri(*f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3URI)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tf11f0elemf1f4f2.SetS3DataSource(f11f0elemf1f4f2f0)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tf11f0elemf1f4.SetDataSource(f11f0elemf1f4f2)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.SplitType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4.SetSplitType(*f11f0iter.TransformJobDefinition.TransformInput.SplitType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetTransformInput(f11f0elemf1f4)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput != nil {\n\t\t\t\t\t\tf11f0elemf1f5 := &svcsdk.TransformOutput{}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.Accept != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetAccept(*f11f0iter.TransformJobDefinition.TransformOutput.Accept)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.AssembleWith != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetAssembleWith(*f11f0iter.TransformJobDefinition.TransformOutput.AssembleWith)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.KMSKeyID != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetKmsKeyId(*f11f0iter.TransformJobDefinition.TransformOutput.KMSKeyID)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.S3OutputPath != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetS3OutputPath(*f11f0iter.TransformJobDefinition.TransformOutput.S3OutputPath)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetTransformOutput(f11f0elemf1f5)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources != nil {\n\t\t\t\t\t\tf11f0elemf1f6 := &svcsdk.TransformResources{}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources.InstanceCount != nil {\n\t\t\t\t\t\t\tf11f0elemf1f6.SetInstanceCount(*f11f0iter.TransformJobDefinition.TransformResources.InstanceCount)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources.InstanceType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f6.SetInstanceType(*f11f0iter.TransformJobDefinition.TransformResources.InstanceType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources.VolumeKMSKeyID != nil {\n\t\t\t\t\t\t\tf11f0elemf1f6.SetVolumeKmsKeyId(*f11f0iter.TransformJobDefinition.TransformResources.VolumeKMSKeyID)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetTransformResources(f11f0elemf1f6)\n\t\t\t\t\t}\n\t\t\t\t\tf11f0elem.SetTransformJobDefinition(f11f0elemf1)\n\t\t\t\t}\n\t\t\t\tf11f0 = append(f11f0, f11f0elem)\n\t\t\t}\n\t\t\tf11.SetValidationProfiles(f11f0)\n\t\t}\n\t\tif r.ko.Spec.ValidationSpecification.ValidationRole != nil {\n\t\t\tf11.SetValidationRole(*r.ko.Spec.ValidationSpecification.ValidationRole)\n\t\t}\n\t\tres.SetValidationSpecification(f11)\n\t}\n\n\treturn res, nil\n}", "func (o *RegisterPluginCreated) WithPayload(payload *models.Plugin) *RegisterPluginCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedConfigMapAccepted) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *CreateDevPodOptions) Run() error {\n\tclient, curNs, err := o.KubeClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\tns, _, err := kube.GetDevNamespace(client, curNs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcm, err := client.CoreV1().ConfigMaps(ns).Get(kube.ConfigMapJenkinsPodTemplates, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to find ConfigMap %s in namespace %s: %s\", kube.ConfigMapJenkinsPodTemplates, ns, err)\n\t}\n\tpodTemplates := cm.Data\n\tlabels := util.SortedMapKeys(podTemplates)\n\n\tlabel := o.Label\n\tyml := \"\"\n\tif label != \"\" {\n\t\tyml = podTemplates[label]\n\t\tif yml == \"\" {\n\t\t\treturn util.InvalidOption(optionLabel, label, labels)\n\t\t}\n\t}\n\tif label == \"\" {\n\t\tlabel, err = util.PickName(labels, \"Pick which kind of dev pod you wish to create: \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tyml = podTemplates[label]\n\t\tif yml == \"\" {\n\t\t\treturn fmt.Errorf(\"Could not find YAML for pod template label %s\", label)\n\t\t}\n\t}\n\to.Printf(\"Creating a dev pod of label: %s\\n\", label)\n\n\tpod := &corev1.Pod{}\n\terr = yaml.Unmarshal([]byte(yml), &pod)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to parse Pod Template YAML: %s\\n%s\", err, yml)\n\t}\n\n\tu, err := user.Current()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuserName := u.Username\n\tname := kube.ToValidName(userName + \"-\" + label)\n\tif o.Suffix != \"\" {\n\t\tname += \"-\" + o.Suffix\n\t}\n\tnames, err := kube.GetPodNames(client, ns, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tname = uniquePodName(names, name)\n\n\tpod.Name = name\n\tpod.Labels[kube.LabelPodTemplate] = label\n\tpod.Labels[kube.LabelDevPodName] = name\n\tpod.Labels[kube.LabelDevPodUsername] = userName\n\n\t_, err = client.CoreV1().Pods(ns).Create(pod)\n\tif err != nil {\n\t\tif o.Verbose {\n\t\t\treturn fmt.Errorf(\"Failed to create pod %s\\nYAML: %s\", err, yml)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"Failed to create pod %s\", err)\n\t\t}\n\t}\n\n\to.Printf(\"Created pod %s - waiting for it to be ready...\\n\", util.ColorInfo(name))\n\terr = kube.WaitForPodNameToBeReady(client, ns, name, time.Hour)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\to.Printf(\"Pod %s is now ready!\\n\", util.ColorInfo(name))\n\to.Printf(\"You can open other shells into this DevPod via %s\\n\", util.ColorInfo(\"jx rsh -d\"))\n\n\toptions := &RshOptions{\n\t\tCommonOptions: o.CommonOptions,\n\t\tNamespace: ns,\n\t\tExecutable: \"bash\",\n\t\tPod: name,\n\t}\n\toptions.Args = []string{}\n\treturn options.Run()\n}", "func NewPod(namespace, name, nodeName string, opts *NewPodOptions) *corev1.Pod {\n\tpod := &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{},\n\t\t\tAnnotations: map[string]string{},\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tNodeName: nodeName,\n\t\t\tAffinity: &corev1.Affinity{},\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: name,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif opts != nil {\n\t\tpod.CreationTimestamp = opts.CreationTimestamp\n\n\t\tpod.Spec.Containers[0].Resources = opts.Resources\n\n\t\tif opts.Annotations != nil {\n\t\t\tfor key, value := range opts.Annotations {\n\t\t\t\tpod.Annotations[key] = value\n\t\t\t}\n\t\t}\n\t\tif opts.Labels != nil {\n\t\t\tfor key, value := range opts.Labels {\n\t\t\t\tpod.Labels[key] = value\n\t\t\t}\n\t\t}\n\t\tif opts.NodeSelector != nil {\n\t\t\tpod.Spec.NodeSelector = map[string]string{}\n\t\t\tfor key, value := range opts.NodeSelector {\n\t\t\t\tpod.Spec.NodeSelector[key] = value\n\t\t\t}\n\t\t}\n\t\tpod.Status.Phase = opts.Phase\n\t\tpod.Status.Reason = opts.Reason\n\t\tpod.Status.ContainerStatuses = opts.ContainerStatuses\n\t\tpod.Spec.Tolerations = append(pod.Spec.Tolerations, opts.Tolerations...)\n\t\tpod.Spec.Affinity = &opts.Affinity\n\t}\n\n\tif nodeName != \"\" {\n\t\tutilaffinity.ReplaceNodeNameNodeAffinity(pod.Spec.Affinity, nodeName)\n\t}\n\n\treturn pod\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated) WithPayload(payload *models.IoK8sAPIRbacV1alpha1Role) *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated) WithPayload(payload *models.Version) *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) WithPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) *CreateCoreV1NamespacedServiceAccountTokenAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (client IdentityClient) createTagNamespace(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodPost, \"/tagNamespaces\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response CreateTagNamespaceResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func (o *ReplaceCertificatesV1CertificateSigningRequestCreated) SetPayload(payload *models.IoK8sAPICertificatesV1CertificateSigningRequest) {\n\to.Payload = payload\n}", "func RunPod(ctx context.Context, pod corev1.Pod,\n\tts oauth2.TokenSource, watcherImage, project, zone, machineType string) error {\n\n\tsvc, err := compute.NewService(ctx, option.WithTokenSource(ts))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tb, err := yaml.Marshal(pod)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpodstr := string(b)\n\tlog.Println(\"POD MANIFEST:\\n\", podstr) // TODO remove\n\n\tregion := zone[:strings.LastIndex(zone, \"-\")]\n\n\twatcherPod := fmt.Sprintf(watcherPodFmt, watcherImage)\n\n\tname := \"instance-\" + uuid.New().String()[:4]\n\tlog.Printf(\"creating %q...\", name)\n\top, err := svc.Instances.Insert(project, zone, &compute.Instance{\n\t\tName: name,\n\t\tZone: zone,\n\t\tMachineType: fmt.Sprintf(\"projects/%s/zones/%s/machineTypes/%s\", project, zone, machineType),\n\t\tDisks: []*compute.AttachedDisk{{\n\t\t\tInitializeParams: &compute.AttachedDiskInitializeParams{\n\t\t\t\tSourceImage: \"projects/cos-cloud/global/images/family/cos-stable\",\n\t\t\t},\n\t\t\tBoot: true,\n\t\t}},\n\t\tNetworkInterfaces: []*compute.NetworkInterface{{\n\t\t\tSubnetwork: fmt.Sprintf(\"projects/%s/regions/%s/subnetworks/default\", project, region),\n\t\t\tAccessConfigs: []*compute.AccessConfig{{\n\t\t\t\tName: \"External NAT\",\n\t\t\t\tType: \"ONE_TO_ONE_NAT\",\n\t\t\t\tNetworkTier: \"PREMIUM\",\n\t\t\t}},\n\t\t}},\n\t\tServiceAccounts: []*compute.ServiceAccount{{\n\t\t\tEmail: \"178371766757-compute@developer.gserviceaccount.com\",\n\t\t\tScopes: []string{\n\t\t\t\t// Permiission to pull private images (watcher)\n\t\t\t\t\"https://www.googleapis.com/auth/devstorage.read_only\",\n\n\t\t\t\t// Permission to write logs and metrics (google-fluentd)\n\t\t\t\t\"https://www.googleapis.com/auth/logging.write\",\n\t\t\t\t\"https://www.googleapis.com/auth/monitoring.write\",\n\t\t\t},\n\t\t}},\n\t\tMetadata: &compute.Metadata{\n\t\t\tItems: []*compute.MetadataItems{{\n\t\t\t\tKey: \"user-data\",\n\t\t\t\tValue: &cloudConfig,\n\t\t\t}, {\n\t\t\t\tKey: \"watcher\",\n\t\t\t\tValue: &watcherPod,\n\t\t\t}, {\n\t\t\t\tKey: \"pod\",\n\t\t\t\tValue: &podstr,\n\t\t\t}, {\n\t\t\t\tKey: \"ca-cert\",\n\t\t\t\tValue: &caCert,\n\t\t\t}, {\n\t\t\t\tKey: \"ca-cert-key\",\n\t\t\t\tValue: &caCertKey,\n\t\t\t}, {\n\t\t\t\tKey: \"cos-metrics-enabled\",\n\t\t\t\tValue: &trueString,\n\t\t\t}},\n\t\t},\n\t\tTags: &compute.Tags{Items: []string{\"https-server\"}},\n\t\tShieldedInstanceConfig: &compute.ShieldedInstanceConfig{\n\t\t\tEnableSecureBoot: true,\n\t\t},\n\t}).Do()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstart := time.Now()\n\tfor ; ; time.Sleep(time.Second) {\n\t\top, err = svc.ZoneOperations.Get(project, zone, op.Name).Do()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Printf(\"operation is %q...\", op.Status)\n\t\tif op.Status == \"DONE\" {\n\t\t\tbreak\n\t\t}\n\t}\n\tlog.Println(\"startup took\", time.Since(start))\n\treturn nil\n}", "func (o *CreateBackendSwitchingRuleCreated) WithPayload(payload *models.BackendSwitchingRule) *CreateBackendSwitchingRuleCreated {\n\to.Payload = payload\n\treturn o\n}", "func (req *postResource) Run(ctx context.Context, s *MockKubeAPIServer) error {\n\tgr := schema.GroupResource{Group: req.Group, Resource: req.Resource}\n\n\tresource := s.storage.FindResource(gr)\n\tif resource == nil {\n\t\treturn req.writeErrorResponse(http.StatusNotFound)\n\t}\n\n\tbodyBytes, err := io.ReadAll(req.r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tklog.V(4).Infof(\"post request %#v\", string(bodyBytes))\n\n\tobj := &unstructured.Unstructured{}\n\tif err := obj.UnmarshalJSON(bodyBytes); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse payload: %w\", err)\n\t}\n\n\tid := types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.GetName()}\n\n\tif id.Namespace != req.Namespace {\n\t\treturn fmt.Errorf(\"namespace in payload did not match namespace in URL\")\n\t}\n\tif id.Name == \"\" {\n\t\treturn fmt.Errorf(\"name must be provided in payload\")\n\t}\n\n\tif err := s.storage.CreateObject(ctx, resource, id, obj); err != nil {\n\t\treturn err\n\t}\n\treturn req.writeResponse(obj)\n}", "func (o *ServiceAddCreated) SetPayload(payload *models.Service) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleOK) WithPayload(payload *models.IoK8sAPIRbacV1alpha1Role) *CreateRbacAuthorizationV1alpha1NamespacedRoleOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *GetProjectProjectNameServiceServiceNameResourceOK) SetPayload(payload *models.Resources) {\n\to.Payload = payload\n}", "func (o *RegisterInfraEnvCreated) WithPayload(payload *models.InfraEnv) *RegisterInfraEnvCreated {\n\to.Payload = payload\n\treturn o\n}", "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateVpnConnectionInput, error) {\n\tres := &svcsdk.CreateVpnConnectionInput{}\n\n\tif r.ko.Spec.CustomerGatewayID != nil {\n\t\tres.SetCustomerGatewayId(*r.ko.Spec.CustomerGatewayID)\n\t}\n\tif r.ko.Spec.DryRun != nil {\n\t\tres.SetDryRun(*r.ko.Spec.DryRun)\n\t}\n\tif r.ko.Spec.Options != nil {\n\t\tf2 := &svcsdk.VpnConnectionOptionsSpecification{}\n\t\tif r.ko.Spec.Options.EnableAcceleration != nil {\n\t\t\tf2.SetEnableAcceleration(*r.ko.Spec.Options.EnableAcceleration)\n\t\t}\n\t\tif r.ko.Spec.Options.LocalIPv4NetworkCIDR != nil {\n\t\t\tf2.SetLocalIpv4NetworkCidr(*r.ko.Spec.Options.LocalIPv4NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.LocalIPv6NetworkCIDR != nil {\n\t\t\tf2.SetLocalIpv6NetworkCidr(*r.ko.Spec.Options.LocalIPv6NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.RemoteIPv4NetworkCIDR != nil {\n\t\t\tf2.SetRemoteIpv4NetworkCidr(*r.ko.Spec.Options.RemoteIPv4NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.RemoteIPv6NetworkCIDR != nil {\n\t\t\tf2.SetRemoteIpv6NetworkCidr(*r.ko.Spec.Options.RemoteIPv6NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.StaticRoutesOnly != nil {\n\t\t\tf2.SetStaticRoutesOnly(*r.ko.Spec.Options.StaticRoutesOnly)\n\t\t}\n\t\tif r.ko.Spec.Options.TunnelInsideIPVersion != nil {\n\t\t\tf2.SetTunnelInsideIpVersion(*r.ko.Spec.Options.TunnelInsideIPVersion)\n\t\t}\n\t\tif r.ko.Spec.Options.TunnelOptions != nil {\n\t\t\tf2f7 := []*svcsdk.VpnTunnelOptionsSpecification{}\n\t\t\tfor _, f2f7iter := range r.ko.Spec.Options.TunnelOptions {\n\t\t\t\tf2f7elem := &svcsdk.VpnTunnelOptionsSpecification{}\n\t\t\t\tif f2f7iter.DPDTimeoutAction != nil {\n\t\t\t\t\tf2f7elem.SetDPDTimeoutAction(*f2f7iter.DPDTimeoutAction)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.DPDTimeoutSeconds != nil {\n\t\t\t\t\tf2f7elem.SetDPDTimeoutSeconds(*f2f7iter.DPDTimeoutSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.IKEVersions != nil {\n\t\t\t\t\tf2f7elemf2 := []*svcsdk.IKEVersionsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf2iter := range f2f7iter.IKEVersions {\n\t\t\t\t\t\tf2f7elemf2elem := &svcsdk.IKEVersionsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf2iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf2elem.SetValue(*f2f7elemf2iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf2 = append(f2f7elemf2, f2f7elemf2elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetIKEVersions(f2f7elemf2)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1DHGroupNumbers != nil {\n\t\t\t\t\tf2f7elemf3 := []*svcsdk.Phase1DHGroupNumbersRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf3iter := range f2f7iter.Phase1DHGroupNumbers {\n\t\t\t\t\t\tf2f7elemf3elem := &svcsdk.Phase1DHGroupNumbersRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf3iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf3elem.SetValue(*f2f7elemf3iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf3 = append(f2f7elemf3, f2f7elemf3elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase1DHGroupNumbers(f2f7elemf3)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1EncryptionAlgorithms != nil {\n\t\t\t\t\tf2f7elemf4 := []*svcsdk.Phase1EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf4iter := range f2f7iter.Phase1EncryptionAlgorithms {\n\t\t\t\t\t\tf2f7elemf4elem := &svcsdk.Phase1EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf4iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf4elem.SetValue(*f2f7elemf4iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf4 = append(f2f7elemf4, f2f7elemf4elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase1EncryptionAlgorithms(f2f7elemf4)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1IntegrityAlgorithms != nil {\n\t\t\t\t\tf2f7elemf5 := []*svcsdk.Phase1IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf5iter := range f2f7iter.Phase1IntegrityAlgorithms {\n\t\t\t\t\t\tf2f7elemf5elem := &svcsdk.Phase1IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf5iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf5elem.SetValue(*f2f7elemf5iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf5 = append(f2f7elemf5, f2f7elemf5elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase1IntegrityAlgorithms(f2f7elemf5)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1LifetimeSeconds != nil {\n\t\t\t\t\tf2f7elem.SetPhase1LifetimeSeconds(*f2f7iter.Phase1LifetimeSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2DHGroupNumbers != nil {\n\t\t\t\t\tf2f7elemf7 := []*svcsdk.Phase2DHGroupNumbersRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf7iter := range f2f7iter.Phase2DHGroupNumbers {\n\t\t\t\t\t\tf2f7elemf7elem := &svcsdk.Phase2DHGroupNumbersRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf7iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf7elem.SetValue(*f2f7elemf7iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf7 = append(f2f7elemf7, f2f7elemf7elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase2DHGroupNumbers(f2f7elemf7)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2EncryptionAlgorithms != nil {\n\t\t\t\t\tf2f7elemf8 := []*svcsdk.Phase2EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf8iter := range f2f7iter.Phase2EncryptionAlgorithms {\n\t\t\t\t\t\tf2f7elemf8elem := &svcsdk.Phase2EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf8iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf8elem.SetValue(*f2f7elemf8iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf8 = append(f2f7elemf8, f2f7elemf8elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase2EncryptionAlgorithms(f2f7elemf8)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2IntegrityAlgorithms != nil {\n\t\t\t\t\tf2f7elemf9 := []*svcsdk.Phase2IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf9iter := range f2f7iter.Phase2IntegrityAlgorithms {\n\t\t\t\t\t\tf2f7elemf9elem := &svcsdk.Phase2IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf9iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf9elem.SetValue(*f2f7elemf9iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf9 = append(f2f7elemf9, f2f7elemf9elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase2IntegrityAlgorithms(f2f7elemf9)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2LifetimeSeconds != nil {\n\t\t\t\t\tf2f7elem.SetPhase2LifetimeSeconds(*f2f7iter.Phase2LifetimeSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.PreSharedKey != nil {\n\t\t\t\t\tf2f7elem.SetPreSharedKey(*f2f7iter.PreSharedKey)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.RekeyFuzzPercentage != nil {\n\t\t\t\t\tf2f7elem.SetRekeyFuzzPercentage(*f2f7iter.RekeyFuzzPercentage)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.RekeyMarginTimeSeconds != nil {\n\t\t\t\t\tf2f7elem.SetRekeyMarginTimeSeconds(*f2f7iter.RekeyMarginTimeSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.ReplayWindowSize != nil {\n\t\t\t\t\tf2f7elem.SetReplayWindowSize(*f2f7iter.ReplayWindowSize)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.StartupAction != nil {\n\t\t\t\t\tf2f7elem.SetStartupAction(*f2f7iter.StartupAction)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.TunnelInsideCIDR != nil {\n\t\t\t\t\tf2f7elem.SetTunnelInsideCidr(*f2f7iter.TunnelInsideCIDR)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.TunnelInsideIPv6CIDR != nil {\n\t\t\t\t\tf2f7elem.SetTunnelInsideIpv6Cidr(*f2f7iter.TunnelInsideIPv6CIDR)\n\t\t\t\t}\n\t\t\t\tf2f7 = append(f2f7, f2f7elem)\n\t\t\t}\n\t\t\tf2.SetTunnelOptions(f2f7)\n\t\t}\n\t\tres.SetOptions(f2)\n\t}\n\tif r.ko.Spec.TagSpecifications != nil {\n\t\tf3 := []*svcsdk.TagSpecification{}\n\t\tfor _, f3iter := range r.ko.Spec.TagSpecifications {\n\t\t\tf3elem := &svcsdk.TagSpecification{}\n\t\t\tif f3iter.ResourceType != nil {\n\t\t\t\tf3elem.SetResourceType(*f3iter.ResourceType)\n\t\t\t}\n\t\t\tif f3iter.Tags != nil {\n\t\t\t\tf3elemf1 := []*svcsdk.Tag{}\n\t\t\t\tfor _, f3elemf1iter := range f3iter.Tags {\n\t\t\t\t\tf3elemf1elem := &svcsdk.Tag{}\n\t\t\t\t\tif f3elemf1iter.Key != nil {\n\t\t\t\t\t\tf3elemf1elem.SetKey(*f3elemf1iter.Key)\n\t\t\t\t\t}\n\t\t\t\t\tif f3elemf1iter.Value != nil {\n\t\t\t\t\t\tf3elemf1elem.SetValue(*f3elemf1iter.Value)\n\t\t\t\t\t}\n\t\t\t\t\tf3elemf1 = append(f3elemf1, f3elemf1elem)\n\t\t\t\t}\n\t\t\t\tf3elem.SetTags(f3elemf1)\n\t\t\t}\n\t\t\tf3 = append(f3, f3elem)\n\t\t}\n\t\tres.SetTagSpecifications(f3)\n\t}\n\tif r.ko.Spec.TransitGatewayID != nil {\n\t\tres.SetTransitGatewayId(*r.ko.Spec.TransitGatewayID)\n\t}\n\tif r.ko.Spec.Type != nil {\n\t\tres.SetType(*r.ko.Spec.Type)\n\t}\n\tif r.ko.Spec.VPNGatewayID != nil {\n\t\tres.SetVpnGatewayId(*r.ko.Spec.VPNGatewayID)\n\t}\n\n\treturn res, nil\n}", "func Create(input CreateInput) *corev1.Pod {\n\tExpect(input.Creator).NotTo(BeNil(), \"input.Creator is required for Pod.Create\")\n\tExpect(input.Config).NotTo(BeNil(), \"input.Config is required for Pod.Create\")\n\tExpect(input.Name).NotTo(BeEmpty(), \"input.Name is required for Pod.Create\")\n\tExpect(input.Namespace).NotTo(BeEmpty(), \"input.Namespace is required for Pod.Create\")\n\tExpect(input.SecretProviderClassName).NotTo(BeEmpty(), \"input.SecretProviderClassName is required for Pod.Create\")\n\n\tBy(fmt.Sprintf(\"Creating Pod \\\"%s\\\"\", input.Name))\n\n\treadOnly := true\n\tpod := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: input.Name,\n\t\t\tNamespace: input.Namespace,\n\t\t\tLabels: input.Labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tTerminationGracePeriodSeconds: to.Int64Ptr(int64(0)),\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"tester\",\n\t\t\t\t\tImage: \"registry.k8s.io/e2e-test-images/busybox:1.29-4\",\n\t\t\t\t\tImagePullPolicy: corev1.PullIfNotPresent,\n\t\t\t\t\tCommand: []string{\"/bin/sleep\", \"10000\"},\n\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"secrets-store-inline\",\n\t\t\t\t\t\t\tMountPath: \"/mnt/secrets-store\",\n\t\t\t\t\t\t\tReadOnly: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tVolumes: []corev1.Volume{\n\t\t\t\t{\n\t\t\t\t\tName: \"secrets-store-inline\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tCSI: &corev1.CSIVolumeSource{\n\t\t\t\t\t\t\tDriver: \"secrets-store.csi.k8s.io\",\n\t\t\t\t\t\t\tReadOnly: &readOnly,\n\t\t\t\t\t\t\tVolumeAttributes: map[string]string{\"secretProviderClass\": input.SecretProviderClassName},\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\tif input.NodePublishSecretRefName != \"\" {\n\t\tfor idx := range pod.Spec.Volumes {\n\t\t\tpod.Spec.Volumes[idx].CSI.NodePublishSecretRef = &corev1.LocalObjectReference{Name: input.NodePublishSecretRefName}\n\t\t}\n\t}\n\n\tif input.Config.IsWindowsTest {\n\t\tpod.Spec.NodeSelector = map[string]string{\"kubernetes.io/os\": \"windows\"}\n\t} else if input.Config.IsGPUTest {\n\t\tpod.Spec.NodeSelector = map[string]string{\n\t\t\t\"kubernetes.io/os\": \"linux\",\n\t\t\t\"accelerator\": \"nvidia\",\n\t\t}\n\t} else {\n\t\tpod.Spec.NodeSelector = map[string]string{\"kubernetes.io/os\": \"linux\"}\n\t}\n\n\tif input.ServiceAccountName != \"\" {\n\t\tpod.Spec.ServiceAccountName = input.ServiceAccountName\n\t}\n\n\tExpect(input.Creator.Create(context.TODO(), pod)).Should(Succeed())\n\treturn pod\n}", "func (o *CreateZoneCreated) SetPayload(payload *models.CreateZoneResponse) {\n\to.Payload = payload\n}", "func (o *CreateClusterCreated) SetPayload(payload *models.Kluster) {\n\to.Payload = payload\n}", "func (o *ClientPermissionCreateOK) SetPayload(payload *ClientPermissionCreateOKBody) {\n\to.Payload = payload\n}", "func genpod(namespace, name, image string) *corev1.Pod {\n\tvar userID int64 = 65534\n\n\treturn &corev1.Pod{\n\t\tMetadata: &metav1.ObjectMeta{\n\t\t\tName: k8s.String(name),\n\t\t\tNamespace: k8s.String(namespace),\n\t\t\tLabels: map[string]string{\"generator\": \"kboom\"},\n\t\t},\n\t\tSpec: &corev1.PodSpec{\n\t\t\tContainers: []*corev1.Container{\n\t\t\t\t&corev1.Container{\n\t\t\t\t\tName: k8s.String(\"main\"),\n\t\t\t\t\tImage: k8s.String(image),\n\t\t\t\t\tCommand: []string{\"/bin/sh\", \"-ec\", \"sleep 3600\"},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tRunAsUser: &userID,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleOK) WithPayload(payload *models.IoK8sAPIRbacV1Role) *CreateRbacAuthorizationV1NamespacedRoleOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateDeploymentOptions) Run() error {\n\tdeploy := o.createDeployment()\n\n\tif err := util.CreateOrUpdateAnnotation(o.CreateAnnotation, deploy, scheme.DefaultJSONEncoder()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.DryRunStrategy != cmdutil.DryRunClient {\n\t\tcreateOptions := metav1.CreateOptions{}\n\t\tif o.FieldManager != \"\" {\n\t\t\tcreateOptions.FieldManager = o.FieldManager\n\t\t}\n\t\tcreateOptions.FieldValidation = o.ValidationDirective\n\t\tif o.DryRunStrategy == cmdutil.DryRunServer {\n\t\t\tcreateOptions.DryRun = []string{metav1.DryRunAll}\n\t\t}\n\t\tvar err error\n\t\tdeploy, err = o.Client.Deployments(o.Namespace).Create(context.TODO(), deploy, createOptions)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create deployment: %v\", err)\n\t\t}\n\t}\n\n\treturn o.PrintObj(deploy)\n}", "func (o *CreateAuthenticationV1beta1TokenReviewCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1beta1TokenReview) {\n\to.Payload = payload\n}", "func (o *CreateCoordinationV1NamespacedLeaseCreated) SetPayload(payload *models.IoK8sAPICoordinationV1Lease) {\n\to.Payload = payload\n}", "func (o *PostOrderCreated) SetPayload(payload *models.OrderCreateResponse) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionOK) WithPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) *ReplaceApiextensionsV1beta1CustomResourceDefinitionOK {\n\to.Payload = payload\n\treturn o\n}", "func createDeployment(cluster *client.VanClient, annotations map[string]string) (*v1.Deployment, error) {\n\tname := \"nginx\"\n\treplicas := int32(1)\n\tdep := &v1.Deployment{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: cluster.Namespace,\n\t\t\tAnnotations: annotations,\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": name,\n\t\t\t},\n\t\t},\n\t\tSpec: v1.DeploymentSpec{\n\t\t\tReplicas: &replicas,\n\t\t\tSelector: &metav1.LabelSelector{\n\t\t\t\tMatchLabels: map[string]string{\n\t\t\t\t\t\"app\": name,\n\t\t\t\t},\n\t\t\t},\n\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\t\"app\": name,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\tContainers: []corev1.Container{\n\t\t\t\t\t\t{Name: \"nginx\", Image: \"quay.io/skupper/nginx-unprivileged:stable-alpine\", Ports: []corev1.ContainerPort{{Name: \"web\", ContainerPort: 8080}}, ImagePullPolicy: corev1.PullIfNotPresent},\n\t\t\t\t\t},\n\t\t\t\t\tRestartPolicy: corev1.RestartPolicyAlways,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// Deploying resource\n\tdep, err := cluster.KubeClient.AppsV1().Deployments(cluster.Namespace).Create(context.TODO(), dep, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wait for deployment to be ready\n\tdep, err = kube.WaitDeploymentReadyReplicas(dep.Name, cluster.Namespace, 1, cluster.KubeClient, timeout, interval)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn dep, nil\n}", "func generatePod(c *client.Client, podName string, nsName string, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\n\tp := pod.Instance{\n\t\tName: podName,\n\t\tNamespace: nsName,\n\t\tImage: imageSource,\n\t\tLabelKey: \"app\",\n\t\tImagePullPolicy: \"ifnotpresent\",\n\t\tLabelValue: \"podTest\",\n\t}\n\n\ttimeNow := time.Now()\n\tfmt.Printf(\"creating pod %s in namespace %s\\n\", podName, nsName)\n\terr := pod.CreateWaitRunningState(c, &p)\n\t//if err != nil {\n\t//\tfmt.Printf(\"%s\\n\", err)\n\t//\tos.Exit(1)\n\t//}\n\n\tlastTime, err := pod.GetLastTimeConditionHappened(c,\n\t\t\"Ready\",\n\t\tpodName,\n\t\tnsName)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\thour := lastTime.Sub(timeNow).Hours()\n\thour, mf := math.Modf(hour)\n\ttotalHour = totalHour + hour\n\n\tminutes := mf * 60\n\tminutes, sf := math.Modf(minutes)\n\ttotalMinutes = totalMinutes + minutes\n\n\tseconds := sf * 60\n\ttotalSec = totalSec + seconds\n\n\tfmt.Printf(\"\\n- %s is created and responsive in namespace %s ✅\\n\", p.Name, p.Namespace)\n\tfmt.Printf(\"- image used: %s\\n\", imageSource)\n\n\tfmt.Println(\" took:\", hour, \"hours\",\n\t\tminutes, \"minutes\",\n\t\tseconds, \"seconds\")\n\tsumSec = append(sumSec, totalSec)\n\tsumMin = append(sumMin, totalMinutes)\n\tsumHour = append(sumHour, totalHour)\n\ttotalPodsRunning = totalPodsRunning + 1\n\tfmt.Printf(\"TOTAL NUMBER OF PODS RUNNING: %v\\n\", totalPodsRunning)\n\tfmt.Printf(\"TIME NOW: %v\\n\", time.Now().Format(\"2006-01-02 3:4:5 PM\"))\n\n\ttotalHour = 0\n\ttotalMinutes = 0\n\ttotalSec = 0\n}", "func (o *AddNamespaceToGroupUnauthorized) WithPayload(payload *models.Error) *AddNamespaceToGroupUnauthorized {\n\to.Payload = payload\n\treturn o\n}", "func createDeployment(k *kabanerov1alpha1.Kabanero, clientset *kubernetes.Clientset, c client.Client, name string, image string, env []corev1.EnvVar, envFrom []corev1.EnvFromSource, livenessProbe *corev1.Probe, reqLogger logr.Logger) error {\n\tcl := clientset.AppsV1().Deployments(k.ObjectMeta.Namespace)\n\n\t// Check if the Deployment resource already exists.\n\tdInstance := &appsv1.Deployment{}\n\terr := c.Get(context.Background(), types.NamespacedName{\n\t\tName: name,\n\t\tNamespace: k.ObjectMeta.Namespace}, dInstance)\n\n\tdeploymentExists := true\n\tif err != nil {\n\t\tif apierrors.IsNotFound(err) == false {\n\t\t\treturn err\n\t\t}\n\n\t\t// The deployment does not already exist. Create one.\n\t\tdeploymentExists = false\n\n\t\t// Gather Kabanero operator ownerReference information.\n\t\townerRef, err := getOwnerReference(k, c, reqLogger)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Initialize the deployment\n\t\tvar repCount int32 = 1\n\t\tdInstance = &appsv1.Deployment{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: name,\n\t\t\t\tOwnerReferences: []metav1.OwnerReference{\n\t\t\t\t\t{\n\t\t\t\t\t\tAPIVersion: ownerRef.APIVersion,\n\t\t\t\t\t\tKind: ownerRef.Kind,\n\t\t\t\t\t\tName: ownerRef.Name,\n\t\t\t\t\t\tUID: ownerRef.UID,\n\t\t\t\t\t\tController: ownerRef.Controller,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tSpec: appsv1.DeploymentSpec{\n\t\t\t\tReplicas: &repCount,\n\t\t\t\tSelector: &metav1.LabelSelector{\n\t\t\t\t\tMatchLabels: map[string]string{\n\t\t\t\t\t\t\"app\": name,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\t\t\"app\": name,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\t\tServiceAccountName: name,\n\t\t\t\t\t\tContainers: []corev1.Container{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName: name,\n\t\t\t\t\t\t\t\tImagePullPolicy: \"Always\",\n\t\t\t\t\t\t\t\tPorts: []corev1.ContainerPort{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tContainerPort: 9443,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\t// Here we update the things that can change. In the future we could\n\t// consider re-applying all the fields in case someone hand-edited the\n\t// deployment object in an incompatible way.\n\tdInstance.Spec.Template.Spec.Containers[0].Env = env\n\tdInstance.Spec.Template.Spec.Containers[0].EnvFrom = envFrom\n\tdInstance.Spec.Template.Spec.Containers[0].Image = image\n\tdInstance.Spec.Template.Spec.Containers[0].LivenessProbe = livenessProbe\n\n\tif deploymentExists == false {\n\t\treqLogger.Info(fmt.Sprintf(\"createDeployment: Deployment for create: %v\", dInstance))\n\n\t\t_, err = cl.Create(dInstance)\n\t} else {\n\t\treqLogger.Info(fmt.Sprintf(\"createDeployment: Deployment for update: %v\", dInstance))\n\n\t\t_, err = cl.Update(dInstance)\n\t}\n\n\treturn err\n}" ]
[ "0.71600986", "0.60759914", "0.59215206", "0.58727187", "0.5759193", "0.56535906", "0.55602", "0.54629165", "0.54402953", "0.53990656", "0.5341951", "0.53034186", "0.5286376", "0.5239901", "0.51543856", "0.51484925", "0.5105422", "0.50624555", "0.50260985", "0.50252205", "0.50149053", "0.5009855", "0.49704212", "0.49647942", "0.49233246", "0.49169382", "0.490192", "0.4881735", "0.48800182", "0.486494", "0.48465598", "0.48367375", "0.48297155", "0.48216897", "0.48207855", "0.4819244", "0.48185122", "0.48045516", "0.48010796", "0.47995344", "0.4795657", "0.47796205", "0.47656396", "0.47607982", "0.4756538", "0.47451356", "0.47384334", "0.47372675", "0.473271", "0.47169587", "0.47003382", "0.4687489", "0.46715942", "0.46667963", "0.4666501", "0.4657562", "0.4652917", "0.465096", "0.46507797", "0.46490958", "0.4636716", "0.46234506", "0.46233588", "0.46222615", "0.4611167", "0.46105695", "0.46101922", "0.46084756", "0.459806", "0.45947826", "0.45923543", "0.45874286", "0.45819795", "0.4566096", "0.45648515", "0.4561402", "0.4559168", "0.45589095", "0.45523685", "0.45514837", "0.45495352", "0.45495012", "0.4549463", "0.4536664", "0.4532651", "0.45260254", "0.45210466", "0.45198375", "0.4509025", "0.45067316", "0.45029098", "0.4501962", "0.44959295", "0.44945222", "0.44861645", "0.4480339", "0.44782475", "0.4477948", "0.4474403", "0.44708923" ]
0.7258825
0
SetPayload sets the payload to the create core v1 namespaced pod binding o k response
SetPayload устанавливает полезную нагрузку для создания core v1 namespaced pod binding o k response
func (o *CreateCoreV1NamespacedPodBindingOK) SetPayload(payload *models.IoK8sAPICoreV1Binding) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateCoreV1NamespacedPodBindingCreated) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedPodOK) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenOK) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *WatchCoreV1NamespacedEndpointsOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *CreateHPCResourceCreated) SetPayload(payload *models.CreatedResponse) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedConfigMapOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *WatchApiregistrationV1APIServiceOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated) SetPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) {\n\to.Payload = payload\n}", "func (o *PostOrderCreated) SetPayload(payload *models.OrderCreateResponse) {\n\to.Payload = payload\n}", "func (o *CreateZoneCreated) SetPayload(payload *models.CreateZoneResponse) {\n\to.Payload = payload\n}", "func (o *CreateCoordinationV1NamespacedLeaseCreated) SetPayload(payload *models.IoK8sAPICoordinationV1Lease) {\n\to.Payload = payload\n}", "func (o *PutSlideLikeCreated) SetPayload(payload models.Success) {\n\to.Payload = payload\n}", "func (o *ReplaceAppsV1NamespacedReplicaSetScaleCreated) SetPayload(payload *models.IoK8sAPIAutoscalingV1Scale) {\n\to.Payload = payload\n}", "func (o *CreateClusterCreated) SetPayload(payload *models.Kluster) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1alpha1Role) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1Role) {\n\to.Payload = payload\n}", "func (o *GetProjectProjectNameServiceServiceNameResourceOK) SetPayload(payload *models.Resources) {\n\to.Payload = payload\n}", "func (o *CreateOK) SetPayload(payload *models.Event) {\n\to.Payload = payload\n}", "func (o *ServiceAddCreated) SetPayload(payload *models.Service) {\n\to.Payload = payload\n}", "func (o *PutSlideSuperlikeCreated) SetPayload(payload models.Success) {\n\to.Payload = payload\n}", "func (o *ReplaceNodeV1alpha1RuntimeClassCreated) SetPayload(payload *models.IoK8sAPINodeV1alpha1RuntimeClass) {\n\to.Payload = payload\n}", "func (o *V1CreateHelloOK) SetPayload(payload *models.CreateHelloResponse) {\n\to.Payload = payload\n}", "func (o *SetResourceCreated) SetPayload(payload *models.Resource) {\n\to.Payload = payload\n}", "func (o *PostReposOwnerRepoKeysCreated) SetPayload(payload *models.UserKeysKeyID) {\n\to.Payload = payload\n}", "func (o *ReplaceCertificatesV1CertificateSigningRequestCreated) SetPayload(payload *models.IoK8sAPICertificatesV1CertificateSigningRequest) {\n\to.Payload = payload\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated) SetPayload(payload *models.Version) {\n\to.Payload = payload\n}", "func (o *SemverGenerateCreated) SetPayload(payload *models.SemverTagSet) {\n\to.Payload = payload\n}", "func (o *CreateCoordinationV1NamespacedLeaseOK) SetPayload(payload *models.IoK8sAPICoordinationV1Lease) {\n\to.Payload = payload\n}", "func (o *AddKeypairCreated) SetPayload(payload models.ULID) {\n\to.Payload = payload\n}", "func (o *WatchPolicyV1beta1PodSecurityPolicyOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *CreateSpoeCreated) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *AddReleasesCreated) SetPayload(payload *models.APIResponse) {\n\to.Payload = payload\n}", "func (o *PostInteractionCreated) SetPayload(payload *models.ConsoleInteraction) {\n\to.Payload = payload\n}", "func (o *RegisterInfraEnvCreated) SetPayload(payload *models.InfraEnv) {\n\to.Payload = payload\n}", "func (o *CreateAuthenticationV1beta1TokenReviewCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1beta1TokenReview) {\n\to.Payload = payload\n}", "func (o *DeleteApiextensionsV1CollectionCustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *CreateDocumentCreated) SetPayload(payload *internalmessages.Document) {\n\to.Payload = payload\n}", "func (o *PutWorkpaceByIDOK) SetPayload(payload *models.Workspace) {\n\to.Payload = payload\n}", "func (o *DeleteRuntimeContainerInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressOK) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreatePackageCreated) SetPayload(payload *models.Package) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedConfigMapAccepted) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *ReplaceRbacAuthorizationV1beta1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1beta1Role) {\n\to.Payload = payload\n}", "func (o *GetNamespacedNotebooksUnauthorized) SetPayload(payload *models.Error) {\r\n\to.Payload = payload\r\n}", "func (o *GetServicesHaproxyRuntimeAclsIDOK) SetPayload(payload *models.ACLFile) {\n\to.Payload = payload\n}", "func (o *GetCoreAPIVersionsOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1APIVersions) {\n\to.Payload = payload\n}", "func (o *AddNamespaceToGroupOK) SetPayload(payload *models.GroupNamespace) {\n\to.Payload = payload\n}", "func (o *PutWorkpaceByIDInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *ReplicateCreated) SetPayload(payload *models.SteeringRequestID) {\n\to.Payload = payload\n}", "func (o *PutProjectProjectNameStageStageNameResourceResourceURIDefault) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleOK) SetPayload(payload *models.IoK8sAPIRbacV1alpha1Role) {\n\to.Payload = payload\n}", "func (o *ClientPermissionCreateInternalServerError) SetPayload(payload *ClientPermissionCreateInternalServerErrorBody) {\n\to.Payload = payload\n}", "func (o *PatchCoreV1PersistentVolumeOK) SetPayload(payload *models.IoK8sAPICoreV1PersistentVolume) {\n\to.Payload = payload\n}", "func (o *DeleteRuntimeContainerNotFound) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *CreateBatchV1NamespacedJobCreated) SetPayload(payload *models.IoK8sAPIBatchV1Job) {\n\to.Payload = payload\n}", "func (o *PatchFoldersIDOK) SetPayload(payload *models.CreateFolderResp) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleOK) SetPayload(payload *models.IoK8sAPIRbacV1Role) {\n\to.Payload = payload\n}", "func (o *ReplacePolicyV1beta1NamespacedPodDisruptionBudgetCreated) SetPayload(payload *models.IoK8sAPIPolicyV1beta1PodDisruptionBudget) {\n\to.Payload = payload\n}", "func (o *DeletePostbyIDInternalServerError) SetPayload(payload *models.Response) {\n\to.Payload = payload\n}", "func (o *DeletePostbyIDOK) SetPayload(payload *models.Response) {\n\to.Payload = payload\n}", "func (nf *NetworkPayload) SetPayload(newpayload []byte) {\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceDefault) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *CreateFoldersCreated) SetPayload(payload *models.CreateFolderResp) {\n\to.Payload = payload\n}", "func (o *DeletePostbyIDUnauthorized) SetPayload(payload *models.Response) {\n\to.Payload = payload\n}", "func (o *CreatePeerCreated) SetPayload(payload *models.PeerSection) {\n\to.Payload = payload\n}", "func (o *CreateStorageSSLCertificateCreated) SetPayload(payload *models.SslCertificate) {\n\to.Payload = payload\n}", "func (o *V1CreateHelloInternalServerError) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *WatchNetworkingV1NetworkPolicyListForAllNamespacesOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *ReplaceAppsV1NamespacedReplicaSetScaleOK) SetPayload(payload *models.IoK8sAPIAutoscalingV1Scale) {\n\to.Payload = payload\n}", "func (o *CreateBackendSwitchingRuleCreated) SetPayload(payload *models.BackendSwitchingRule) {\n\to.Payload = payload\n}", "func (o *PutReposOwnerRepoContentsPathOK) SetPayload(payload *models.CreateFile) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1ClusterRoleBindingCreated) SetPayload(payload *models.IoK8sAPIRbacV1ClusterRoleBinding) {\n\to.Payload = payload\n}", "func (o *AddNamespaceToGroupUnauthorized) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *CreateZoneInternalServerError) SetPayload(payload *models.ErrorResponse) {\n\to.Payload = payload\n}", "func (o *GetProjectProjectNameServiceServiceNameResourceDefault) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *GetServicesHaproxyRuntimeAclsIDDefault) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *AddPayloadRuntimeACLCreated) SetPayload(payload models.ACLFilesEntries) {\n\to.Payload = payload\n}", "func (o *CreateACLCreated) SetPayload(payload *models.ACL) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceOK) SetPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) {\n\to.Payload = payload\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressOK) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *GraphqlPostOK) SetPayload(payload *models.GraphQLResponse) {\n\to.Payload = payload\n}", "func (o *WeaviateThingTemplatesCreateAccepted) SetPayload(payload *models.ThingTemplateGetResponse) {\n\to.Payload = payload\n}", "func (o *AddNamespaceToGroupNotFound) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *CreateACLAccepted) SetPayload(payload *models.ACL) {\n\to.Payload = payload\n}", "func (o *PostWordOK) SetPayload(payload *models.ReturnCode) {\n\to.Payload = payload\n}", "func (o *GetBackupRuntimeEnvironmentsInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *PutMeetupOK) SetPayload(payload *models.CreateObject) {\n\to.Payload = payload\n}", "func (o *CreateSubCategoryCreated) SetPayload(payload *models.SubCategory) {\n\to.Payload = payload\n}" ]
[ "0.7574514", "0.6823581", "0.67944187", "0.6659133", "0.6657111", "0.6604768", "0.65083516", "0.64258933", "0.64172417", "0.6376208", "0.6357927", "0.6333871", "0.6318253", "0.63011295", "0.62972033", "0.6286647", "0.6250242", "0.6237566", "0.6207524", "0.6198076", "0.6186949", "0.6179916", "0.6171837", "0.6161549", "0.614897", "0.6145911", "0.6143428", "0.61288416", "0.61161286", "0.6114978", "0.6114911", "0.61049485", "0.6092716", "0.6091232", "0.60873586", "0.60842544", "0.60756665", "0.6065652", "0.60638285", "0.6062378", "0.6056153", "0.6053765", "0.605268", "0.6051359", "0.60437953", "0.6043541", "0.6042615", "0.60387456", "0.6022411", "0.60195154", "0.60166717", "0.6016153", "0.6006321", "0.60018736", "0.599852", "0.59859085", "0.59826213", "0.59811664", "0.5980149", "0.5978296", "0.59647936", "0.5960407", "0.5957854", "0.59558684", "0.59505016", "0.5949358", "0.5946809", "0.5944511", "0.59382933", "0.59353256", "0.5931443", "0.5924064", "0.59211713", "0.59159136", "0.59154195", "0.5913599", "0.5910949", "0.5897108", "0.58950675", "0.5890876", "0.58900744", "0.58782256", "0.58748543", "0.58648074", "0.58636737", "0.5860589", "0.58594877", "0.58590955", "0.58531636", "0.5852697", "0.58498245", "0.5848792", "0.5846161", "0.58426905", "0.58425975", "0.58349305", "0.58310837", "0.5830607", "0.5821809", "0.5811082" ]
0.7531282
1
WithPayload adds the payload to the create core v1 namespaced pod binding created response
WithPayload добавляет payload в ответ на создание create core v1 namespaced pod binding
func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressCreated) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *ReplaceExtensionsV1beta1NamespacedIngressCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressCreated) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *CreateExtensionsV1beta1NamespacedIngressCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenCreated) WithPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) *CreateCoreV1NamespacedServiceAccountTokenCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenOK) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) WithPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) *CreateNetworkingV1beta1NamespacedIngressCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressOK) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *CreateExtensionsV1beta1NamespacedIngressOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated) WithPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated) WithPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *CreateHPCResourceCreated) SetPayload(payload *models.CreatedResponse) {\n\to.Payload = payload\n}", "func (o *AddReleasesCreated) WithPayload(payload *models.APIResponse) *AddReleasesCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenOK) WithPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) *CreateCoreV1NamespacedServiceAccountTokenOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func (o *CreatePackageCreated) WithPayload(payload *models.Package) *CreatePackageCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedPodOK) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (g genericPlugin) Create(yamlFilePath string, namespace string, client plugin.KubernetesConnector) (string, error) {\n\tif namespace == \"\" {\n\t\tnamespace = \"default\"\n\t}\n\n\t//Decode the yaml file to create a runtime.Object\n\tunstruct := &unstructured.Unstructured{}\n\t//Ignore the returned obj as we expect the data in unstruct\n\t_, err := utils.DecodeYAML(yamlFilePath, unstruct)\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Decode deployment object error\")\n\t}\n\n\tdynClient := client.GetDynamicClient()\n\tmapper := client.GetMapper()\n\n\tgvk := unstruct.GroupVersionKind()\n\tmapping, err := mapper.RESTMapping(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version)\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Mapping kind to resource error\")\n\t}\n\n\t//Add the tracking label to all resources created here\n\tlabels := unstruct.GetLabels()\n\t//Check if labels exist for this object\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tlabels[config.GetConfiguration().KubernetesLabelName] = client.GetInstanceID()\n\tunstruct.SetLabels(labels)\n\n\t// This checks if the resource we are creating has a podSpec in it\n\t// Eg: Deployment, StatefulSet, Job etc..\n\t// If a PodSpec is found, the label will be added to it too.\n\tplugin.TagPodsIfPresent(unstruct, client.GetInstanceID())\n\n\tgvr := mapping.Resource\n\tvar createdObj *unstructured.Unstructured\n\n\tswitch mapping.Scope.Name() {\n\tcase meta.RESTScopeNameNamespace:\n\t\tcreatedObj, err = dynClient.Resource(gvr).Namespace(namespace).Create(unstruct, metav1.CreateOptions{})\n\tcase meta.RESTScopeNameRoot:\n\t\tcreatedObj, err = dynClient.Resource(gvr).Create(unstruct, metav1.CreateOptions{})\n\tdefault:\n\t\treturn \"\", pkgerrors.New(\"Got an unknown RESTSCopeName for mapping: \" + gvk.String())\n\t}\n\n\tif err != nil {\n\t\treturn \"\", pkgerrors.Wrap(err, \"Create object error\")\n\t}\n\n\treturn createdObj.GetName(), nil\n}", "func (o *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated) SetPayload(payload *models.Version) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated) SetPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedPodOK) WithPayload(payload *models.IoK8sAPICoreV1Pod) *DeleteCoreV1NamespacedPodOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplicateCreated) WithPayload(payload *models.SteeringRequestID) *ReplicateCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1alpha1Role) {\n\to.Payload = payload\n}", "func (o *CreateOK) WithPayload(payload *models.Event) *CreateOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressOK) WithPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) *CreateNetworkingV1beta1NamespacedIngressOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleCreated) WithPayload(payload *models.IoK8sAPIRbacV1Role) *CreateRbacAuthorizationV1NamespacedRoleCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated) WithPayload(payload *models.IoK8sAPIRbacV1alpha1Role) *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1Role) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\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}", "func (o *PostInteractionCreated) WithPayload(payload *models.ConsoleInteraction) *PostInteractionCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ServiceAddCreated) WithPayload(payload *models.Service) *ServiceAddCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateZoneCreated) SetPayload(payload *models.CreateZoneResponse) {\n\to.Payload = payload\n}", "func (o *ReplaceCertificatesV1CertificateSigningRequestCreated) WithPayload(payload *models.IoK8sAPICertificatesV1CertificateSigningRequest) *ReplaceCertificatesV1CertificateSigningRequestCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *WatchApiregistrationV1APIServiceOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *WatchCoreV1NamespacedEndpointsOK) WithPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) *WatchCoreV1NamespacedEndpointsOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *V1CreateHelloOK) SetPayload(payload *models.CreateHelloResponse) {\n\to.Payload = payload\n}", "func (o *WatchCoreV1NamespacedEndpointsOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *RegisterPluginCreated) WithPayload(payload *models.Plugin) *RegisterPluginCreated {\n\to.Payload = payload\n\treturn o\n}", "func createNS(h *Handler, ns string, del bool) error {\n\tmanifest := fmt.Sprintf(`\napiVersion: v1\nkind: Namespace\nmetadata:\n name: %s\n`,\n\t\tns,\n\t)\n\n\tif err := h.applyManifest(del, noneNamespace, []byte(manifest)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (b *bindingTest) PodcreateAndExpose(name *string, port *string) {\n\tcommand := []string{\"pod\", \"create\"}\n\tif name != nil {\n\t\tpodname := *name\n\t\tcommand = append(command, \"--name\", podname)\n\t}\n\tif port != nil {\n\t\tpodport := *port\n\t\tcommand = append(command, \"--publish\", podport)\n\t}\n\tb.runPodman(command).Wait(45)\n}", "func AddPodEvent(\r\n client kubernetes.Interface,\r\n obj *corev1.Pod, message string,\r\n typeOfError string){\r\n\r\n // Update API server to inform admin that the pod cannot be deployed and require manual intervention\r\n timestamp := time.Now().UTC()\r\n client.CoreV1().Events(obj.Namespace).Create(context.TODO(), &corev1.Event{\r\n Count: 1,\r\n Message: message,\r\n Reason: \"Error\",\r\n LastTimestamp: metav1.NewTime(timestamp),\r\n FirstTimestamp: metav1.NewTime(timestamp),\r\n Type: typeOfError,\r\n Source: corev1.EventSource{\r\n Component: \"custom\",\r\n },\r\n InvolvedObject: corev1.ObjectReference{\r\n Kind: \"Pod\",\r\n Name: obj.Name,\r\n Namespace: obj.Namespace,\r\n UID: obj.UID,\r\n },\r\n ObjectMeta: metav1.ObjectMeta{\r\n GenerateName: obj.Name + \"-\",\r\n },\r\n },metav1.CreateOptions{})\r\n}", "func (f *Framework) CreateNamespace(namespace string) error {\n\tkubeCore := f.KubeClient.CoreV1()\n\tns := &corev1.Namespace{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: namespace,\n\t\t\tLabels: NamespaceLabel,\n\t\t},\n\t}\n\n\tctx := context.Background()\n\n\toptions := metav1.CreateOptions{}\n\tif _, err := kubeCore.Namespaces().Create(ctx, ns, options); err != nil {\n\t\treturn errors.Errorf(\"creating namespace %s failed: %s\", namespace, err.Error())\n\t}\n\tlogrus.Infof(\"Namespace %s is created\", namespace)\n\n\tsaName := \"agones-sdk\"\n\tif _, err := kubeCore.ServiceAccounts(namespace).Create(ctx, &corev1.ServiceAccount{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: saName,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\"app\": \"agones\"},\n\t\t},\n\t}, options); err != nil {\n\t\terr = errors.Errorf(\"creating ServiceAccount %s in namespace %s failed: %s\", saName, namespace, err.Error())\n\t\tderr := f.DeleteNamespace(namespace)\n\t\tif derr != nil {\n\t\t\treturn errors.Wrap(err, derr.Error())\n\t\t}\n\t\treturn err\n\t}\n\tlogrus.Infof(\"ServiceAccount %s/%s is created\", namespace, saName)\n\n\trb := &rbacv1.RoleBinding{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"agones-sdk-access\",\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\"app\": \"agones\"},\n\t\t},\n\t\tRoleRef: rbacv1.RoleRef{\n\t\t\tAPIGroup: \"rbac.authorization.k8s.io\",\n\t\t\tKind: \"ClusterRole\",\n\t\t\tName: \"agones-sdk\",\n\t\t},\n\t\tSubjects: []rbacv1.Subject{\n\t\t\t{\n\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\tName: saName,\n\t\t\t\tNamespace: namespace,\n\t\t\t},\n\t\t},\n\t}\n\tif _, err := f.KubeClient.RbacV1().RoleBindings(namespace).Create(ctx, rb, options); err != nil {\n\t\terr = errors.Errorf(\"creating RoleBinding for service account %q in namespace %q failed: %s\", saName, namespace, err.Error())\n\t\tderr := f.DeleteNamespace(namespace)\n\t\tif derr != nil {\n\t\t\treturn errors.Wrap(err, derr.Error())\n\t\t}\n\t\treturn err\n\t}\n\tlogrus.Infof(\"RoleBinding %s/%s is created\", namespace, rb.Name)\n\n\treturn nil\n}", "func (o *PostOrderCreated) SetPayload(payload *models.OrderCreateResponse) {\n\to.Payload = payload\n}", "func (o *NamespaceOptions) Run() error {\n\tnamespace := o.createNamespace()\n\tif err := util.CreateOrUpdateAnnotation(o.CreateAnnotation, namespace, scheme.DefaultJSONEncoder()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.DryRunStrategy != cmdutil.DryRunClient {\n\t\tcreateOptions := metav1.CreateOptions{}\n\t\tif o.FieldManager != \"\" {\n\t\t\tcreateOptions.FieldManager = o.FieldManager\n\t\t}\n\t\tcreateOptions.FieldValidation = o.ValidationDirective\n\t\tif o.DryRunStrategy == cmdutil.DryRunServer {\n\t\t\tcreateOptions.DryRun = []string{metav1.DryRunAll}\n\t\t}\n\t\tvar err error\n\t\tnamespace, err = o.Client.Namespaces().Create(context.TODO(), namespace, createOptions)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn o.PrintObj(namespace)\n}", "func buildEchoPod(name, namespace string) *corev1.Pod {\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": name,\n\t\t\t},\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\t// Note that HTTP/1.0 will strip the HSTS response header\n\t\t\t\t\tArgs: []string{\n\t\t\t\t\t\t\"TCP4-LISTEN:8080,reuseaddr,fork\",\n\t\t\t\t\t\t`EXEC:'/bin/bash -c \\\"printf \\\\\\\"HTTP/1.0 200 OK\\r\\n\\r\\n\\\\\\\"; sed -e \\\\\\\"/^\\r/q\\\\\\\"\\\"'`,\n\t\t\t\t\t},\n\t\t\t\t\tCommand: []string{\"/bin/socat\"},\n\t\t\t\t\tImage: \"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\",\n\t\t\t\t\tName: \"echo\",\n\t\t\t\t\tPorts: []corev1.ContainerPort{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContainerPort: int32(8080),\n\t\t\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tAllowPrivilegeEscalation: pointer.Bool(false),\n\t\t\t\t\t\tCapabilities: &corev1.Capabilities{\n\t\t\t\t\t\t\tDrop: []corev1.Capability{\"ALL\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tRunAsNonRoot: pointer.Bool(true),\n\t\t\t\t\t\tSeccompProfile: &corev1.SeccompProfile{\n\t\t\t\t\t\t\tType: corev1.SeccompProfileTypeRuntimeDefault,\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}", "func (o *DeleteCoreV1NamespacedConfigMapOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceOK) WithPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) *CreateDiscoveryV1beta1NamespacedEndpointSliceOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK) WithPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateCoreV1NamespacedPodBindingOK() *CreateCoreV1NamespacedPodBindingOK {\n\n\treturn &CreateCoreV1NamespacedPodBindingOK{}\n}", "func createPod(clientset kubernetes.Interface, namespace string, image string, name string,\n\tlabels map[string]string, command []string, args []string) (*v1.Pod, error) {\n\tenv := []v1.EnvVar{\n\t\t{\n\t\t\tName: \"NAMESPACE\",\n\t\t\tValueFrom: &v1.EnvVarSource{\n\t\t\t\tFieldRef: &v1.ObjectFieldSelector{\n\t\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\t\tFieldPath: \"metadata.namespace\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tspec := v1.PodSpec{\n\t\tContainers: []v1.Container{\n\t\t\t{\n\t\t\t\tEnv: env,\n\t\t\t\tName: fmt.Sprintf(\"%v-pod-container\", name),\n\t\t\t\tImage: image,\n\t\t\t},\n\t\t},\n\t}\n\n\tif len(command) > 0 {\n\t\tspec.Containers[0].Command = command\n\t\tif len(args) > 0 {\n\t\t\tspec.Containers[0].Args = args\n\t\t}\n\t}\n\n\tpod := &v1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: labels,\n\t\t\tName: name,\n\t\t},\n\t\tSpec: spec,\n\t}\n\n\tif _, err := clientset.CoreV1().Pods(namespace).Create(pod); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn clientset.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})\n}", "func (o *CreateBatchV1NamespacedJobCreated) WithPayload(payload *models.IoK8sAPIBatchV1Job) *CreateBatchV1NamespacedJobCreated {\n\to.Payload = payload\n\treturn o\n}", "func (b *bindingTest) Podcreate(name *string) {\n\tb.PodcreateAndExpose(name, nil)\n}", "func (o *ServiceAddCreated) SetPayload(payload *models.Service) {\n\to.Payload = payload\n}", "func (o *CreateBackendSwitchingRuleCreated) WithPayload(payload *models.BackendSwitchingRule) *CreateBackendSwitchingRuleCreated {\n\to.Payload = payload\n\treturn o\n}", "func newPod(ctx context.Context, cl client.Client, ns, name, image string, cmd []string) (*corev1.Pod, error) {\n\tc := corev1.Container{\n\t\tName: name,\n\t\tImage: image,\n\t\tCommand: cmd,\n\t}\n\tp := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: ns,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{c},\n\t\t\t// Kill the pod immediately so it exits quickly on deletion.\n\t\t\tTerminationGracePeriodSeconds: pointer.Int64Ptr(0),\n\t\t},\n\t}\n\tif err := cl.Create(ctx, p); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create pod %s/%s: %v\", p.Namespace, p.Name, err)\n\t}\n\treturn p, nil\n}", "func (o *CreateCoordinationV1NamespacedLeaseCreated) SetPayload(payload *models.IoK8sAPICoordinationV1Lease) {\n\to.Payload = payload\n}", "func (o *DeleteApiextensionsV1CollectionCustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressOK) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *ReplaceExtensionsV1beta1NamespacedIngressOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *AddReleasesCreated) SetPayload(payload *models.APIResponse) {\n\to.Payload = payload\n}", "func (o *ReplaceRbacAuthorizationV1beta1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1beta1Role) {\n\to.Payload = payload\n}", "func (o *ReplacePolicyV1beta1NamespacedPodDisruptionBudgetCreated) WithPayload(payload *models.IoK8sAPIPolicyV1beta1PodDisruptionBudget) *ReplacePolicyV1beta1NamespacedPodDisruptionBudgetCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleOK) WithPayload(payload *models.IoK8sAPIRbacV1alpha1Role) *CreateRbacAuthorizationV1alpha1NamespacedRoleOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *AddPayloadRuntimeACLCreated) WithPayload(payload models.ACLFilesEntries) *AddPayloadRuntimeACLCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceCertificatesV1CertificateSigningRequestCreated) SetPayload(payload *models.IoK8sAPICertificatesV1CertificateSigningRequest) {\n\to.Payload = payload\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated) WithPayload(payload *models.Version) *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateHPCResourceCreated) WithPayload(payload *models.CreatedResponse) *CreateHPCResourceCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ReplaceRbacAuthorizationV1beta1NamespacedRoleCreated) WithPayload(payload *models.IoK8sAPIRbacV1beta1Role) *ReplaceRbacAuthorizationV1beta1NamespacedRoleCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreatePackageCreated) SetPayload(payload *models.Package) {\n\to.Payload = payload\n}", "func (o *GetProjectProjectNameServiceServiceNameResourceOK) SetPayload(payload *models.Resources) {\n\to.Payload = payload\n}", "func (o *GraphqlPostOK) WithPayload(payload *models.GraphQLResponse) *GraphqlPostOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *WatchApiregistrationV1APIServiceOK) WithPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) *WatchApiregistrationV1APIServiceOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleOK) WithPayload(payload *models.IoK8sAPIRbacV1Role) *CreateRbacAuthorizationV1NamespacedRoleOK {\n\to.Payload = payload\n\treturn o\n}", "func NewPayload(urldict map[string][]string) *WCSPayload {\n\tp := &WCSPayload{\n\t\twcs: make(map[string]string),\n\t}\n\tp.AddURLDict(urldict)\n\treturn p\n}", "func (o *DeleteCoreV1NamespacedConfigMapAccepted) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *RegisterInfraEnvCreated) WithPayload(payload *models.InfraEnv) *RegisterInfraEnvCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateAuthenticationV1beta1TokenReviewCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1beta1TokenReview) {\n\to.Payload = payload\n}", "func createDeployment(cluster *client.VanClient, annotations map[string]string) (*v1.Deployment, error) {\n\tname := \"nginx\"\n\treplicas := int32(1)\n\tdep := &v1.Deployment{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: cluster.Namespace,\n\t\t\tAnnotations: annotations,\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": name,\n\t\t\t},\n\t\t},\n\t\tSpec: v1.DeploymentSpec{\n\t\t\tReplicas: &replicas,\n\t\t\tSelector: &metav1.LabelSelector{\n\t\t\t\tMatchLabels: map[string]string{\n\t\t\t\t\t\"app\": name,\n\t\t\t\t},\n\t\t\t},\n\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\t\"app\": name,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\tContainers: []corev1.Container{\n\t\t\t\t\t\t{Name: \"nginx\", Image: \"quay.io/skupper/nginx-unprivileged:stable-alpine\", Ports: []corev1.ContainerPort{{Name: \"web\", ContainerPort: 8080}}, ImagePullPolicy: corev1.PullIfNotPresent},\n\t\t\t\t\t},\n\t\t\t\t\tRestartPolicy: corev1.RestartPolicyAlways,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// Deploying resource\n\tdep, err := cluster.KubeClient.AppsV1().Deployments(cluster.Namespace).Create(context.TODO(), dep, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wait for deployment to be ready\n\tdep, err = kube.WaitDeploymentReadyReplicas(dep.Name, cluster.Namespace, 1, cluster.KubeClient, timeout, interval)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn dep, nil\n}", "func (rm *resourceManager) newDeleteRequestPayload(\n\tr *resource,\n) (*svcsdk.DeleteVpnConnectionInput, error) {\n\tres := &svcsdk.DeleteVpnConnectionInput{}\n\n\tif r.ko.Spec.DryRun != nil {\n\t\tres.SetDryRun(*r.ko.Spec.DryRun)\n\t}\n\tif r.ko.Status.VPNConnectionID != nil {\n\t\tres.SetVpnConnectionId(*r.ko.Status.VPNConnectionID)\n\t}\n\n\treturn res, nil\n}", "func (req *postResource) Run(ctx context.Context, s *MockKubeAPIServer) error {\n\tgr := schema.GroupResource{Group: req.Group, Resource: req.Resource}\n\n\tresource := s.storage.FindResource(gr)\n\tif resource == nil {\n\t\treturn req.writeErrorResponse(http.StatusNotFound)\n\t}\n\n\tbodyBytes, err := io.ReadAll(req.r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tklog.V(4).Infof(\"post request %#v\", string(bodyBytes))\n\n\tobj := &unstructured.Unstructured{}\n\tif err := obj.UnmarshalJSON(bodyBytes); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse payload: %w\", err)\n\t}\n\n\tid := types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.GetName()}\n\n\tif id.Namespace != req.Namespace {\n\t\treturn fmt.Errorf(\"namespace in payload did not match namespace in URL\")\n\t}\n\tif id.Name == \"\" {\n\t\treturn fmt.Errorf(\"name must be provided in payload\")\n\t}\n\n\tif err := s.storage.CreateObject(ctx, resource, id, obj); err != nil {\n\t\treturn err\n\t}\n\treturn req.writeResponse(obj)\n}", "func (o *ReplaceAppsV1NamespacedReplicaSetScaleCreated) SetPayload(payload *models.IoK8sAPIAutoscalingV1Scale) {\n\to.Payload = payload\n}", "func (o *ReplaceNodeV1alpha1RuntimeClassCreated) SetPayload(payload *models.IoK8sAPINodeV1alpha1RuntimeClass) {\n\to.Payload = payload\n}", "func (r CreateRequest) Payload() *model.Payload {\n\tbuf, _ := json.Marshal(r)\n\treturn model.NewPostPayload(buf)\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) WithPayload(payload *models.IoK8sAPICoreV1Pod) *DeleteCoreV1NamespacedPodAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateModelPackageInput, error) {\n\tres := &svcsdk.CreateModelPackageInput{}\n\n\tif r.ko.Spec.CertifyForMarketplace != nil {\n\t\tres.SetCertifyForMarketplace(*r.ko.Spec.CertifyForMarketplace)\n\t}\n\tif r.ko.Spec.ClientToken != nil {\n\t\tres.SetClientToken(*r.ko.Spec.ClientToken)\n\t}\n\tif r.ko.Spec.InferenceSpecification != nil {\n\t\tf2 := &svcsdk.InferenceSpecification{}\n\t\tif r.ko.Spec.InferenceSpecification.Containers != nil {\n\t\t\tf2f0 := []*svcsdk.ModelPackageContainerDefinition{}\n\t\t\tfor _, f2f0iter := range r.ko.Spec.InferenceSpecification.Containers {\n\t\t\t\tf2f0elem := &svcsdk.ModelPackageContainerDefinition{}\n\t\t\t\tif f2f0iter.ContainerHostname != nil {\n\t\t\t\t\tf2f0elem.SetContainerHostname(*f2f0iter.ContainerHostname)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.Image != nil {\n\t\t\t\t\tf2f0elem.SetImage(*f2f0iter.Image)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.ImageDigest != nil {\n\t\t\t\t\tf2f0elem.SetImageDigest(*f2f0iter.ImageDigest)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.ModelDataURL != nil {\n\t\t\t\t\tf2f0elem.SetModelDataUrl(*f2f0iter.ModelDataURL)\n\t\t\t\t}\n\t\t\t\tif f2f0iter.ProductID != nil {\n\t\t\t\t\tf2f0elem.SetProductId(*f2f0iter.ProductID)\n\t\t\t\t}\n\t\t\t\tf2f0 = append(f2f0, f2f0elem)\n\t\t\t}\n\t\t\tf2.SetContainers(f2f0)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedContentTypes != nil {\n\t\t\tf2f1 := []*string{}\n\t\t\tfor _, f2f1iter := range r.ko.Spec.InferenceSpecification.SupportedContentTypes {\n\t\t\t\tvar f2f1elem string\n\t\t\t\tf2f1elem = *f2f1iter\n\t\t\t\tf2f1 = append(f2f1, &f2f1elem)\n\t\t\t}\n\t\t\tf2.SetSupportedContentTypes(f2f1)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedRealtimeInferenceInstanceTypes != nil {\n\t\t\tf2f2 := []*string{}\n\t\t\tfor _, f2f2iter := range r.ko.Spec.InferenceSpecification.SupportedRealtimeInferenceInstanceTypes {\n\t\t\t\tvar f2f2elem string\n\t\t\t\tf2f2elem = *f2f2iter\n\t\t\t\tf2f2 = append(f2f2, &f2f2elem)\n\t\t\t}\n\t\t\tf2.SetSupportedRealtimeInferenceInstanceTypes(f2f2)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedResponseMIMETypes != nil {\n\t\t\tf2f3 := []*string{}\n\t\t\tfor _, f2f3iter := range r.ko.Spec.InferenceSpecification.SupportedResponseMIMETypes {\n\t\t\t\tvar f2f3elem string\n\t\t\t\tf2f3elem = *f2f3iter\n\t\t\t\tf2f3 = append(f2f3, &f2f3elem)\n\t\t\t}\n\t\t\tf2.SetSupportedResponseMIMETypes(f2f3)\n\t\t}\n\t\tif r.ko.Spec.InferenceSpecification.SupportedTransformInstanceTypes != nil {\n\t\t\tf2f4 := []*string{}\n\t\t\tfor _, f2f4iter := range r.ko.Spec.InferenceSpecification.SupportedTransformInstanceTypes {\n\t\t\t\tvar f2f4elem string\n\t\t\t\tf2f4elem = *f2f4iter\n\t\t\t\tf2f4 = append(f2f4, &f2f4elem)\n\t\t\t}\n\t\t\tf2.SetSupportedTransformInstanceTypes(f2f4)\n\t\t}\n\t\tres.SetInferenceSpecification(f2)\n\t}\n\tif r.ko.Spec.MetadataProperties != nil {\n\t\tf3 := &svcsdk.MetadataProperties{}\n\t\tif r.ko.Spec.MetadataProperties.CommitID != nil {\n\t\t\tf3.SetCommitId(*r.ko.Spec.MetadataProperties.CommitID)\n\t\t}\n\t\tif r.ko.Spec.MetadataProperties.GeneratedBy != nil {\n\t\t\tf3.SetGeneratedBy(*r.ko.Spec.MetadataProperties.GeneratedBy)\n\t\t}\n\t\tif r.ko.Spec.MetadataProperties.ProjectID != nil {\n\t\t\tf3.SetProjectId(*r.ko.Spec.MetadataProperties.ProjectID)\n\t\t}\n\t\tif r.ko.Spec.MetadataProperties.Repository != nil {\n\t\t\tf3.SetRepository(*r.ko.Spec.MetadataProperties.Repository)\n\t\t}\n\t\tres.SetMetadataProperties(f3)\n\t}\n\tif r.ko.Spec.ModelApprovalStatus != nil {\n\t\tres.SetModelApprovalStatus(*r.ko.Spec.ModelApprovalStatus)\n\t}\n\tif r.ko.Spec.ModelMetrics != nil {\n\t\tf5 := &svcsdk.ModelMetrics{}\n\t\tif r.ko.Spec.ModelMetrics.Bias != nil {\n\t\t\tf5f0 := &svcsdk.Bias{}\n\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report != nil {\n\t\t\t\tf5f0f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report.ContentDigest != nil {\n\t\t\t\t\tf5f0f0.SetContentDigest(*r.ko.Spec.ModelMetrics.Bias.Report.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report.ContentType != nil {\n\t\t\t\t\tf5f0f0.SetContentType(*r.ko.Spec.ModelMetrics.Bias.Report.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Bias.Report.S3URI != nil {\n\t\t\t\t\tf5f0f0.SetS3Uri(*r.ko.Spec.ModelMetrics.Bias.Report.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f0.SetReport(f5f0f0)\n\t\t\t}\n\t\t\tf5.SetBias(f5f0)\n\t\t}\n\t\tif r.ko.Spec.ModelMetrics.Explainability != nil {\n\t\t\tf5f1 := &svcsdk.Explainability{}\n\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report != nil {\n\t\t\t\tf5f1f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report.ContentDigest != nil {\n\t\t\t\t\tf5f1f0.SetContentDigest(*r.ko.Spec.ModelMetrics.Explainability.Report.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report.ContentType != nil {\n\t\t\t\t\tf5f1f0.SetContentType(*r.ko.Spec.ModelMetrics.Explainability.Report.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.Explainability.Report.S3URI != nil {\n\t\t\t\t\tf5f1f0.SetS3Uri(*r.ko.Spec.ModelMetrics.Explainability.Report.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f1.SetReport(f5f1f0)\n\t\t\t}\n\t\t\tf5.SetExplainability(f5f1)\n\t\t}\n\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality != nil {\n\t\t\tf5f2 := &svcsdk.ModelDataQuality{}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints != nil {\n\t\t\t\tf5f2f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentDigest != nil {\n\t\t\t\t\tf5f2f0.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentType != nil {\n\t\t\t\t\tf5f2f0.SetContentType(*r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.S3URI != nil {\n\t\t\t\t\tf5f2f0.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelDataQuality.Constraints.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f2.SetConstraints(f5f2f0)\n\t\t\t}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics != nil {\n\t\t\t\tf5f2f1 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentDigest != nil {\n\t\t\t\t\tf5f2f1.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentType != nil {\n\t\t\t\t\tf5f2f1.SetContentType(*r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.S3URI != nil {\n\t\t\t\t\tf5f2f1.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelDataQuality.Statistics.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f2.SetStatistics(f5f2f1)\n\t\t\t}\n\t\t\tf5.SetModelDataQuality(f5f2)\n\t\t}\n\t\tif r.ko.Spec.ModelMetrics.ModelQuality != nil {\n\t\t\tf5f3 := &svcsdk.ModelQuality{}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints != nil {\n\t\t\t\tf5f3f0 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentDigest != nil {\n\t\t\t\t\tf5f3f0.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentType != nil {\n\t\t\t\t\tf5f3f0.SetContentType(*r.ko.Spec.ModelMetrics.ModelQuality.Constraints.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Constraints.S3URI != nil {\n\t\t\t\t\tf5f3f0.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelQuality.Constraints.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f3.SetConstraints(f5f3f0)\n\t\t\t}\n\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics != nil {\n\t\t\t\tf5f3f1 := &svcsdk.MetricsSource{}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentDigest != nil {\n\t\t\t\t\tf5f3f1.SetContentDigest(*r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentDigest)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentType != nil {\n\t\t\t\t\tf5f3f1.SetContentType(*r.ko.Spec.ModelMetrics.ModelQuality.Statistics.ContentType)\n\t\t\t\t}\n\t\t\t\tif r.ko.Spec.ModelMetrics.ModelQuality.Statistics.S3URI != nil {\n\t\t\t\t\tf5f3f1.SetS3Uri(*r.ko.Spec.ModelMetrics.ModelQuality.Statistics.S3URI)\n\t\t\t\t}\n\t\t\t\tf5f3.SetStatistics(f5f3f1)\n\t\t\t}\n\t\t\tf5.SetModelQuality(f5f3)\n\t\t}\n\t\tres.SetModelMetrics(f5)\n\t}\n\tif r.ko.Spec.ModelPackageDescription != nil {\n\t\tres.SetModelPackageDescription(*r.ko.Spec.ModelPackageDescription)\n\t}\n\tif r.ko.Spec.ModelPackageGroupName != nil {\n\t\tres.SetModelPackageGroupName(*r.ko.Spec.ModelPackageGroupName)\n\t}\n\tif r.ko.Spec.ModelPackageName != nil {\n\t\tres.SetModelPackageName(*r.ko.Spec.ModelPackageName)\n\t}\n\tif r.ko.Spec.SourceAlgorithmSpecification != nil {\n\t\tf9 := &svcsdk.SourceAlgorithmSpecification{}\n\t\tif r.ko.Spec.SourceAlgorithmSpecification.SourceAlgorithms != nil {\n\t\t\tf9f0 := []*svcsdk.SourceAlgorithm{}\n\t\t\tfor _, f9f0iter := range r.ko.Spec.SourceAlgorithmSpecification.SourceAlgorithms {\n\t\t\t\tf9f0elem := &svcsdk.SourceAlgorithm{}\n\t\t\t\tif f9f0iter.AlgorithmName != nil {\n\t\t\t\t\tf9f0elem.SetAlgorithmName(*f9f0iter.AlgorithmName)\n\t\t\t\t}\n\t\t\t\tif f9f0iter.ModelDataURL != nil {\n\t\t\t\t\tf9f0elem.SetModelDataUrl(*f9f0iter.ModelDataURL)\n\t\t\t\t}\n\t\t\t\tf9f0 = append(f9f0, f9f0elem)\n\t\t\t}\n\t\t\tf9.SetSourceAlgorithms(f9f0)\n\t\t}\n\t\tres.SetSourceAlgorithmSpecification(f9)\n\t}\n\tif r.ko.Spec.Tags != nil {\n\t\tf10 := []*svcsdk.Tag{}\n\t\tfor _, f10iter := range r.ko.Spec.Tags {\n\t\t\tf10elem := &svcsdk.Tag{}\n\t\t\tif f10iter.Key != nil {\n\t\t\t\tf10elem.SetKey(*f10iter.Key)\n\t\t\t}\n\t\t\tif f10iter.Value != nil {\n\t\t\t\tf10elem.SetValue(*f10iter.Value)\n\t\t\t}\n\t\t\tf10 = append(f10, f10elem)\n\t\t}\n\t\tres.SetTags(f10)\n\t}\n\tif r.ko.Spec.ValidationSpecification != nil {\n\t\tf11 := &svcsdk.ModelPackageValidationSpecification{}\n\t\tif r.ko.Spec.ValidationSpecification.ValidationProfiles != nil {\n\t\t\tf11f0 := []*svcsdk.ModelPackageValidationProfile{}\n\t\t\tfor _, f11f0iter := range r.ko.Spec.ValidationSpecification.ValidationProfiles {\n\t\t\t\tf11f0elem := &svcsdk.ModelPackageValidationProfile{}\n\t\t\t\tif f11f0iter.ProfileName != nil {\n\t\t\t\t\tf11f0elem.SetProfileName(*f11f0iter.ProfileName)\n\t\t\t\t}\n\t\t\t\tif f11f0iter.TransformJobDefinition != nil {\n\t\t\t\t\tf11f0elemf1 := &svcsdk.TransformJobDefinition{}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.BatchStrategy != nil {\n\t\t\t\t\t\tf11f0elemf1.SetBatchStrategy(*f11f0iter.TransformJobDefinition.BatchStrategy)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.Environment != nil {\n\t\t\t\t\t\tf11f0elemf1f1 := map[string]*string{}\n\t\t\t\t\t\tfor f11f0elemf1f1key, f11f0elemf1f1valiter := range f11f0iter.TransformJobDefinition.Environment {\n\t\t\t\t\t\t\tvar f11f0elemf1f1val string\n\t\t\t\t\t\t\tf11f0elemf1f1val = *f11f0elemf1f1valiter\n\t\t\t\t\t\t\tf11f0elemf1f1[f11f0elemf1f1key] = &f11f0elemf1f1val\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetEnvironment(f11f0elemf1f1)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.MaxConcurrentTransforms != nil {\n\t\t\t\t\t\tf11f0elemf1.SetMaxConcurrentTransforms(*f11f0iter.TransformJobDefinition.MaxConcurrentTransforms)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.MaxPayloadInMB != nil {\n\t\t\t\t\t\tf11f0elemf1.SetMaxPayloadInMB(*f11f0iter.TransformJobDefinition.MaxPayloadInMB)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput != nil {\n\t\t\t\t\t\tf11f0elemf1f4 := &svcsdk.TransformInput{}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.CompressionType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4.SetCompressionType(*f11f0iter.TransformJobDefinition.TransformInput.CompressionType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.ContentType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4.SetContentType(*f11f0iter.TransformJobDefinition.TransformInput.ContentType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4f2 := &svcsdk.TransformDataSource{}\n\t\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource != nil {\n\t\t\t\t\t\t\t\tf11f0elemf1f4f2f0 := &svcsdk.TransformS3DataSource{}\n\t\t\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3DataType != nil {\n\t\t\t\t\t\t\t\t\tf11f0elemf1f4f2f0.SetS3DataType(*f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3DataType)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3URI != nil {\n\t\t\t\t\t\t\t\t\tf11f0elemf1f4f2f0.SetS3Uri(*f11f0iter.TransformJobDefinition.TransformInput.DataSource.S3DataSource.S3URI)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tf11f0elemf1f4f2.SetS3DataSource(f11f0elemf1f4f2f0)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tf11f0elemf1f4.SetDataSource(f11f0elemf1f4f2)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformInput.SplitType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f4.SetSplitType(*f11f0iter.TransformJobDefinition.TransformInput.SplitType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetTransformInput(f11f0elemf1f4)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput != nil {\n\t\t\t\t\t\tf11f0elemf1f5 := &svcsdk.TransformOutput{}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.Accept != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetAccept(*f11f0iter.TransformJobDefinition.TransformOutput.Accept)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.AssembleWith != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetAssembleWith(*f11f0iter.TransformJobDefinition.TransformOutput.AssembleWith)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.KMSKeyID != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetKmsKeyId(*f11f0iter.TransformJobDefinition.TransformOutput.KMSKeyID)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformOutput.S3OutputPath != nil {\n\t\t\t\t\t\t\tf11f0elemf1f5.SetS3OutputPath(*f11f0iter.TransformJobDefinition.TransformOutput.S3OutputPath)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetTransformOutput(f11f0elemf1f5)\n\t\t\t\t\t}\n\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources != nil {\n\t\t\t\t\t\tf11f0elemf1f6 := &svcsdk.TransformResources{}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources.InstanceCount != nil {\n\t\t\t\t\t\t\tf11f0elemf1f6.SetInstanceCount(*f11f0iter.TransformJobDefinition.TransformResources.InstanceCount)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources.InstanceType != nil {\n\t\t\t\t\t\t\tf11f0elemf1f6.SetInstanceType(*f11f0iter.TransformJobDefinition.TransformResources.InstanceType)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif f11f0iter.TransformJobDefinition.TransformResources.VolumeKMSKeyID != nil {\n\t\t\t\t\t\t\tf11f0elemf1f6.SetVolumeKmsKeyId(*f11f0iter.TransformJobDefinition.TransformResources.VolumeKMSKeyID)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf11f0elemf1.SetTransformResources(f11f0elemf1f6)\n\t\t\t\t\t}\n\t\t\t\t\tf11f0elem.SetTransformJobDefinition(f11f0elemf1)\n\t\t\t\t}\n\t\t\t\tf11f0 = append(f11f0, f11f0elem)\n\t\t\t}\n\t\t\tf11.SetValidationProfiles(f11f0)\n\t\t}\n\t\tif r.ko.Spec.ValidationSpecification.ValidationRole != nil {\n\t\t\tf11.SetValidationRole(*r.ko.Spec.ValidationSpecification.ValidationRole)\n\t\t}\n\t\tres.SetValidationSpecification(f11)\n\t}\n\n\treturn res, nil\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func (o *ClientPermissionCreateOK) SetPayload(payload *ClientPermissionCreateOKBody) {\n\to.Payload = payload\n}", "func PostPayload(c echo.Context) error {\n\tvar request jsonmodels.PostPayloadRequest\n\tif err := c.Bind(&request); err != nil {\n\t\tPlugin().LogInfo(err.Error())\n\t\treturn c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err))\n\t}\n\n\tparsedPayload, _, err := payload.FromBytes(request.Payload)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err))\n\t}\n\n\tmsg, err := messagelayer.Tangle().IssuePayload(parsedPayload)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err))\n\t}\n\n\treturn c.JSON(http.StatusOK, jsonmodels.NewPostPayloadResponse(msg))\n}", "func (o *CreateClusterCreated) SetPayload(payload *models.Kluster) {\n\to.Payload = payload\n}", "func (o *PutSlideSuperlikeCreated) WithPayload(payload models.Success) *PutSlideSuperlikeCreated {\n\to.Payload = payload\n\treturn o\n}" ]
[ "0.7040494", "0.6154935", "0.5884471", "0.5809372", "0.5791104", "0.56312996", "0.55489933", "0.5369722", "0.5353531", "0.53532404", "0.52937114", "0.5228546", "0.521564", "0.5198322", "0.51803315", "0.5170201", "0.50951815", "0.5085272", "0.50764763", "0.506338", "0.50485516", "0.5032496", "0.5012691", "0.49885792", "0.4971226", "0.49565437", "0.49417284", "0.49129707", "0.4899636", "0.48965377", "0.48858315", "0.4874792", "0.48715007", "0.4851019", "0.48411113", "0.48386732", "0.48205197", "0.48174745", "0.48122826", "0.4812141", "0.47810933", "0.47597367", "0.4759096", "0.47586793", "0.47462666", "0.47432426", "0.47365412", "0.47352585", "0.4734955", "0.47180194", "0.47159117", "0.47130084", "0.47067577", "0.4701947", "0.470067", "0.46943372", "0.46856314", "0.46853787", "0.4684039", "0.4682443", "0.4677339", "0.46747255", "0.46696958", "0.46624425", "0.46611327", "0.46610132", "0.46600428", "0.46596435", "0.46432972", "0.46335799", "0.46172452", "0.46162513", "0.4599288", "0.45858884", "0.45814222", "0.45730177", "0.45722842", "0.4565411", "0.45628273", "0.45527986", "0.45438316", "0.4537833", "0.45364702", "0.45345193", "0.4526451", "0.45182315", "0.45089954", "0.45089388", "0.45071217", "0.4502721", "0.4500656", "0.44931206", "0.44804582", "0.44781592", "0.44779634", "0.44761255", "0.44671044", "0.4459623", "0.4459587", "0.44590425" ]
0.72066486
0
SetPayload sets the payload to the create core v1 namespaced pod binding created response
SetPayload устанавливает полезную нагрузку для ответа на создание core v1 namespaced pod binding
func (o *CreateCoreV1NamespacedPodBindingCreated) SetPayload(payload *models.IoK8sAPICoreV1Binding) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateCoreV1NamespacedPodBindingOK) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) SetPayload(payload *models.IoK8sAPICoreV1Binding) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenOK) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateHPCResourceCreated) SetPayload(payload *models.CreatedResponse) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedPodOK) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionCreated) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *ReplaceExtensionsV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceCreated) SetPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) {\n\to.Payload = payload\n}", "func (o *AddReleasesCreated) SetPayload(payload *models.APIResponse) {\n\to.Payload = payload\n}", "func (o *CreateZoneCreated) SetPayload(payload *models.CreateZoneResponse) {\n\to.Payload = payload\n}", "func (o *PatchApiextensionsV1beta1CustomResourceDefinitionStatusOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *PostOrderCreated) SetPayload(payload *models.OrderCreateResponse) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1alpha1Role) {\n\to.Payload = payload\n}", "func (o *CreateCoordinationV1NamespacedLeaseCreated) SetPayload(payload *models.IoK8sAPICoordinationV1Lease) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1Role) {\n\to.Payload = payload\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) SetPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *WatchCoreV1NamespacedEndpointsOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *PutSlideLikeCreated) SetPayload(payload models.Success) {\n\to.Payload = payload\n}", "func (o *WatchApiregistrationV1APIServiceOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *ReplaceNodeV1alpha1RuntimeClassCreated) SetPayload(payload *models.IoK8sAPINodeV1alpha1RuntimeClass) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) SetPayload(payload *models.IoK8sAPICoreV1Pod) {\n\to.Payload = payload\n}", "func (o *ReplaceAppsV1NamespacedReplicaSetScaleCreated) SetPayload(payload *models.IoK8sAPIAutoscalingV1Scale) {\n\to.Payload = payload\n}", "func (o *V1CreateHelloOK) SetPayload(payload *models.CreateHelloResponse) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedConfigMapOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *PutSlideSuperlikeCreated) SetPayload(payload models.Success) {\n\to.Payload = payload\n}", "func (o *PutProjectProjectNameStageStageNameServiceServiceNameResourceCreated) SetPayload(payload *models.Version) {\n\to.Payload = payload\n}", "func (o *ServiceAddCreated) SetPayload(payload *models.Service) {\n\to.Payload = payload\n}", "func (o *SetResourceCreated) SetPayload(payload *models.Resource) {\n\to.Payload = payload\n}", "func (o *SemverGenerateCreated) SetPayload(payload *models.SemverTagSet) {\n\to.Payload = payload\n}", "func (o *PostInteractionCreated) SetPayload(payload *models.ConsoleInteraction) {\n\to.Payload = payload\n}", "func (o *CreateOK) SetPayload(payload *models.Event) {\n\to.Payload = payload\n}", "func (o *GetProjectProjectNameServiceServiceNameResourceOK) SetPayload(payload *models.Resources) {\n\to.Payload = payload\n}", "func (o *CreateCoordinationV1NamespacedLeaseOK) SetPayload(payload *models.IoK8sAPICoordinationV1Lease) {\n\to.Payload = payload\n}", "func (o *GetServicesHaproxyRuntimeAclsIDOK) SetPayload(payload *models.ACLFile) {\n\to.Payload = payload\n}", "func (o *ReplaceRbacAuthorizationV1beta1NamespacedRoleCreated) SetPayload(payload *models.IoK8sAPIRbacV1beta1Role) {\n\to.Payload = payload\n}", "func (o *CreatePackageCreated) SetPayload(payload *models.Package) {\n\to.Payload = payload\n}", "func (o *ReplaceCertificatesV1CertificateSigningRequestCreated) SetPayload(payload *models.IoK8sAPICertificatesV1CertificateSigningRequest) {\n\to.Payload = payload\n}", "func (o *CreateClusterCreated) SetPayload(payload *models.Kluster) {\n\to.Payload = payload\n}", "func (o *ReplaceApiextensionsV1beta1CustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceDefinition) {\n\to.Payload = payload\n}", "func (o *CreateFoldersCreated) SetPayload(payload *models.CreateFolderResp) {\n\to.Payload = payload\n}", "func (o *DeletePostbyIDInternalServerError) SetPayload(payload *models.Response) {\n\to.Payload = payload\n}", "func (o *DeleteApiextensionsV1CollectionCustomResourceDefinitionOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *RegisterInfraEnvCreated) SetPayload(payload *models.InfraEnv) {\n\to.Payload = payload\n}", "func (o *CreateSpoeCreated) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *PostReposOwnerRepoKeysCreated) SetPayload(payload *models.UserKeysKeyID) {\n\to.Payload = payload\n}", "func (o *AddKeypairCreated) SetPayload(payload models.ULID) {\n\to.Payload = payload\n}", "func (o *CreateDocumentCreated) SetPayload(payload *internalmessages.Document) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleOK) SetPayload(payload *models.IoK8sAPIRbacV1alpha1Role) {\n\to.Payload = payload\n}", "func (o *WeaviateThingTemplatesCreateAccepted) SetPayload(payload *models.ThingTemplateGetResponse) {\n\to.Payload = payload\n}", "func (o *ReplicateCreated) SetPayload(payload *models.SteeringRequestID) {\n\to.Payload = payload\n}", "func (o *CreateAuthenticationV1beta1TokenReviewCreated) SetPayload(payload *models.IoK8sAPIAuthenticationV1beta1TokenReview) {\n\to.Payload = payload\n}", "func (nf *NetworkPayload) SetPayload(newpayload []byte) {\n}", "func (o *PatchFoldersIDOK) SetPayload(payload *models.CreateFolderResp) {\n\to.Payload = payload\n}", "func (o *GetCoreAPIVersionsOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1APIVersions) {\n\to.Payload = payload\n}", "func (o *DeletePostbyIDUnauthorized) SetPayload(payload *models.Response) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleOK) SetPayload(payload *models.IoK8sAPIRbacV1Role) {\n\to.Payload = payload\n}", "func (o *CreateStorageSSLCertificateCreated) SetPayload(payload *models.SslCertificate) {\n\to.Payload = payload\n}", "func (o *GraphqlPostOK) SetPayload(payload *models.GraphQLResponse) {\n\to.Payload = payload\n}", "func (o *CreatePeerCreated) SetPayload(payload *models.PeerSection) {\n\to.Payload = payload\n}", "func (o *CreateRbacAuthorizationV1ClusterRoleBindingCreated) SetPayload(payload *models.IoK8sAPIRbacV1ClusterRoleBinding) {\n\to.Payload = payload\n}", "func (o *ClientPermissionCreateInternalServerError) SetPayload(payload *ClientPermissionCreateInternalServerErrorBody) {\n\to.Payload = payload\n}", "func (o *DeletePostbyIDOK) SetPayload(payload *models.Response) {\n\to.Payload = payload\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) SetPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) {\n\to.Payload = payload\n}", "func (o *CreateZoneInternalServerError) SetPayload(payload *models.ErrorResponse) {\n\to.Payload = payload\n}", "func (o *GetNamespacedNotebooksUnauthorized) SetPayload(payload *models.Error) {\r\n\to.Payload = payload\r\n}", "func (o *AddPayloadRuntimeACLCreated) SetPayload(payload models.ACLFilesEntries) {\n\to.Payload = payload\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressOK) SetPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) {\n\to.Payload = payload\n}", "func (o *DeleteRuntimeContainerInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *V1CreateHelloInternalServerError) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *CreateACLCreated) SetPayload(payload *models.ACL) {\n\to.Payload = payload\n}", "func (o *CreateBackendSwitchingRuleCreated) SetPayload(payload *models.BackendSwitchingRule) {\n\to.Payload = payload\n}", "func (o *DeleteCoreV1NamespacedConfigMapAccepted) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {\n\to.Payload = payload\n}", "func (o *PutWorkpaceByIDInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *WatchPolicyV1beta1PodSecurityPolicyOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *ReplacePolicyV1beta1NamespacedPodDisruptionBudgetCreated) SetPayload(payload *models.IoK8sAPIPolicyV1beta1PodDisruptionBudget) {\n\to.Payload = payload\n}", "func (o *PutWorkpaceByIDOK) SetPayload(payload *models.Workspace) {\n\to.Payload = payload\n}", "func (o *CreateBatchV1NamespacedJobCreated) SetPayload(payload *models.IoK8sAPIBatchV1Job) {\n\to.Payload = payload\n}", "func (o *GetServicesHaproxyRuntimeAclsIDDefault) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *GetServicesHaproxyRuntimeAclsIDNotFound) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceOK) SetPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) {\n\to.Payload = payload\n}", "func (o *RegisterPluginCreated) SetPayload(payload *models.Plugin) {\n\to.Payload = payload\n}", "func (o *CreatePackageNotFound) SetPayload(payload *models.Error) {\n\to.Payload = payload\n}", "func (o *DeleteRuntimeContainerNotFound) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *PostRegisterDetailsInternalServerError) SetPayload(payload *models.GeneralResponse) {\n\to.Payload = payload\n}", "func (o *CreateACLAccepted) SetPayload(payload *models.ACL) {\n\to.Payload = payload\n}", "func (o *AddNamespaceToGroupOK) SetPayload(payload *models.GroupNamespace) {\n\to.Payload = payload\n}", "func (o *UpdateCatalogInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *CreateHPCResourceUnauthorized) SetPayload(payload *models.ErrorResponse) {\n\to.Payload = payload\n}", "func (o *GetNamespacedNotebooksOK) SetPayload(payload *models.GetNotebooksResponse) {\r\n\to.Payload = payload\r\n}", "func (o *PostWordOK) SetPayload(payload *models.ReturnCode) {\n\to.Payload = payload\n}", "func (o *GetBackupRuntimeEnvironmentsInternalServerError) SetPayload(payload string) {\n\to.Payload = payload\n}", "func (o *PutReposOwnerRepoContentsPathOK) SetPayload(payload *models.CreateFile) {\n\to.Payload = payload\n}", "func (o *WatchNetworkingV1NetworkPolicyListForAllNamespacesOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1WatchEvent) {\n\to.Payload = payload\n}", "func (o *PostWordInternalServerError) SetPayload(payload *models.ReturnCode) {\n\to.Payload = payload\n}", "func (o *PostRegisterDetailsOK) SetPayload(payload *models.GeneralResponse) {\n\to.Payload = payload\n}", "func (o *PatchCoreV1PersistentVolumeOK) SetPayload(payload *models.IoK8sAPICoreV1PersistentVolume) {\n\to.Payload = payload\n}" ]
[ "0.73745334", "0.67489946", "0.67317206", "0.65107083", "0.6496046", "0.64906657", "0.64088506", "0.63850045", "0.6355121", "0.63480544", "0.6346671", "0.630173", "0.6298144", "0.6295662", "0.6277614", "0.62639123", "0.62403667", "0.6215138", "0.6203269", "0.6188285", "0.6186027", "0.6170193", "0.61382806", "0.6128105", "0.6124512", "0.61237156", "0.6117134", "0.611581", "0.61153054", "0.61028665", "0.6100786", "0.61007667", "0.6079065", "0.6075474", "0.60526145", "0.6051653", "0.60364133", "0.6034842", "0.60286534", "0.60156626", "0.60076666", "0.5992169", "0.5983124", "0.59744596", "0.5962195", "0.595809", "0.5957363", "0.5954611", "0.59485424", "0.5942331", "0.5942007", "0.5939255", "0.5936762", "0.5931337", "0.59259367", "0.59213185", "0.5918223", "0.5917474", "0.59172857", "0.5909778", "0.5908741", "0.59084874", "0.590077", "0.59004384", "0.58990335", "0.58987874", "0.589505", "0.589152", "0.5887357", "0.5887344", "0.5879399", "0.58772254", "0.5872675", "0.58622944", "0.58615386", "0.58486086", "0.5846454", "0.5846408", "0.5844362", "0.58420026", "0.5841433", "0.58385044", "0.5836462", "0.5833801", "0.58239955", "0.5823666", "0.5807072", "0.58066046", "0.5805252", "0.580039", "0.57966495", "0.57921785", "0.5790944", "0.57903755", "0.5781625", "0.5775928", "0.5774897", "0.57748353", "0.5772973", "0.5770837" ]
0.7524761
0
NewCreateCoreV1NamespacedPodBindingAccepted creates CreateCoreV1NamespacedPodBindingAccepted with default headers values
NewCreateCoreV1NamespacedPodBindingAccepted создает CreateCoreV1NamespacedPodBindingAccepted с значениями заголовков по умолчанию
func NewCreateCoreV1NamespacedPodBindingAccepted() *CreateCoreV1NamespacedPodBindingAccepted { return &CreateCoreV1NamespacedPodBindingAccepted{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateCoreV1NamespacedPodBindingAccepted) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateCoreV1NamespacedPodAccepted() *CreateCoreV1NamespacedPodAccepted {\n\treturn &CreateCoreV1NamespacedPodAccepted{}\n}", "func NewCreateCoreV1NamespacedPodBindingOK() *CreateCoreV1NamespacedPodBindingOK {\n\n\treturn &CreateCoreV1NamespacedPodBindingOK{}\n}", "func NewCreateNetworkingV1beta1NamespacedIngressAccepted() *CreateNetworkingV1beta1NamespacedIngressAccepted {\n\n\treturn &CreateNetworkingV1beta1NamespacedIngressAccepted{}\n}", "func (o *CreateCoreV1NamespacedPodBindingAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func NewCreateExtensionsV1beta1NamespacedIngressAccepted() *CreateExtensionsV1beta1NamespacedIngressAccepted {\n\n\treturn &CreateExtensionsV1beta1NamespacedIngressAccepted{}\n}", "func NewDeleteCoreV1NamespacedPodAccepted() *DeleteCoreV1NamespacedPodAccepted {\n\n\treturn &DeleteCoreV1NamespacedPodAccepted{}\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateDiscoveryV1beta1NamespacedEndpointSliceAccepted() *CreateDiscoveryV1beta1NamespacedEndpointSliceAccepted {\n\n\treturn &CreateDiscoveryV1beta1NamespacedEndpointSliceAccepted{}\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateCoreV1NamespacedServiceAccountTokenAccepted() *CreateCoreV1NamespacedServiceAccountTokenAccepted {\n\n\treturn &CreateCoreV1NamespacedServiceAccountTokenAccepted{}\n}", "func NewCreateRbacAuthorizationV1NamespacedRoleAccepted() *CreateRbacAuthorizationV1NamespacedRoleAccepted {\n\n\treturn &CreateRbacAuthorizationV1NamespacedRoleAccepted{}\n}", "func NewCreateCoreV1NamespacedServiceAccountTokenAccepted() *CreateCoreV1NamespacedServiceAccountTokenAccepted {\n\treturn &CreateCoreV1NamespacedServiceAccountTokenAccepted{}\n}", "func NewCreateAutoscalingV2beta2NamespacedHorizontalPodAutoscalerAccepted() *CreateAutoscalingV2beta2NamespacedHorizontalPodAutoscalerAccepted {\n\treturn &CreateAutoscalingV2beta2NamespacedHorizontalPodAutoscalerAccepted{}\n}", "func NewCreateRbacAuthorizationV1alpha1NamespacedRoleAccepted() *CreateRbacAuthorizationV1alpha1NamespacedRoleAccepted {\n\n\treturn &CreateRbacAuthorizationV1alpha1NamespacedRoleAccepted{}\n}", "func NewDeleteCoreV1NamespacedEventAccepted() *DeleteCoreV1NamespacedEventAccepted {\n\treturn &DeleteCoreV1NamespacedEventAccepted{}\n}", "func NewDeleteCoreV1NamespacedServiceAccepted() *DeleteCoreV1NamespacedServiceAccepted {\n\treturn &DeleteCoreV1NamespacedServiceAccepted{}\n}", "func NewCreateCoreV1NamespacedPodBindingCreated() *CreateCoreV1NamespacedPodBindingCreated {\n\n\treturn &CreateCoreV1NamespacedPodBindingCreated{}\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func (o *DeleteCoreV1NamespacedPodAccepted) WithPayload(payload *models.IoK8sAPICoreV1Pod) *DeleteCoreV1NamespacedPodAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateBatchV1NamespacedJobAccepted() *CreateBatchV1NamespacedJobAccepted {\n\n\treturn &CreateBatchV1NamespacedJobAccepted{}\n}", "func NewCreateBackendSwitchingRuleAccepted() *CreateBackendSwitchingRuleAccepted {\n\n\treturn &CreateBackendSwitchingRuleAccepted{}\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func NewCreateCoreV1NamespacedPodBindingUnauthorized() *CreateCoreV1NamespacedPodBindingUnauthorized {\n\n\treturn &CreateCoreV1NamespacedPodBindingUnauthorized{}\n}", "func NewCreateBlueprintRequestUsingPOST1Accepted() *CreateBlueprintRequestUsingPOST1Accepted {\n\treturn &CreateBlueprintRequestUsingPOST1Accepted{}\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) WithPayload(payload *models.IoK8sAPIAuthenticationV1TokenRequest) *CreateCoreV1NamespacedServiceAccountTokenAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateRbacAuthorizationV1ClusterRoleBindingAccepted() *CreateRbacAuthorizationV1ClusterRoleBindingAccepted {\n\n\treturn &CreateRbacAuthorizationV1ClusterRoleBindingAccepted{}\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressAccepted) WithPayload(payload *models.IoK8sAPINetworkingV1beta1Ingress) *CreateNetworkingV1beta1NamespacedIngressAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateApiregistrationV1beta1APIServiceAccepted() *CreateApiregistrationV1beta1APIServiceAccepted {\n\treturn &CreateApiregistrationV1beta1APIServiceAccepted{}\n}", "func (a *Client) CreateRbacAuthorizationV1alpha1NamespacedRoleBinding(params *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingParams) (*CreateRbacAuthorizationV1alpha1NamespacedRoleBindingOK, *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingCreated, *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateRbacAuthorizationV1alpha1NamespacedRoleBindingParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createRbacAuthorizationV1alpha1NamespacedRoleBinding\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/vnd.kubernetes.protobuf\", \"application/yaml\"},\n\t\tConsumesMediaTypes: []string{\"*/*\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateRbacAuthorizationV1alpha1NamespacedRoleBindingReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingOK:\n\t\treturn value, nil, nil, nil\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingCreated:\n\t\treturn nil, value, nil, nil\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingAccepted:\n\t\treturn nil, nil, value, nil\n\t}\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 rbac_authorization_v1alpha1: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func (o *CreateExtensionsV1beta1NamespacedIngressAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (o *CreateExtensionsV1beta1NamespacedIngressAccepted) WithPayload(payload *models.IoK8sAPIExtensionsV1beta1Ingress) *CreateExtensionsV1beta1NamespacedIngressAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func NewDeleteCertificatesV1beta1CertificateSigningRequestAccepted() *DeleteCertificatesV1beta1CertificateSigningRequestAccepted {\n\treturn &DeleteCertificatesV1beta1CertificateSigningRequestAccepted{}\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\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}", "func NewCreateAppsV1NamespacedControllerRevisionAccepted() *CreateAppsV1NamespacedControllerRevisionAccepted {\n\treturn &CreateAppsV1NamespacedControllerRevisionAccepted{}\n}", "func (o *CreateDiscoveryV1beta1NamespacedEndpointSliceAccepted) WithPayload(payload *models.IoK8sAPIDiscoveryV1beta1EndpointSlice) *CreateDiscoveryV1beta1NamespacedEndpointSliceAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedServiceAccountTokenAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionSlotOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif privateEndpointConnectionName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateEndpointConnectionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateEndpointConnectionName}\", url.PathEscape(privateEndpointConnectionName))\n\tif slot == \"\" {\n\t\treturn nil, errors.New(\"parameter slot cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{slot}\", url.PathEscape(slot))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, privateEndpointWrapper)\n}", "func (o *CreateRbacAuthorizationV1ClusterRoleBindingAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func NewCreateCoordinationV1NamespacedLeaseAccepted() *CreateCoordinationV1NamespacedLeaseAccepted {\n\n\treturn &CreateCoordinationV1NamespacedLeaseAccepted{}\n}", "func NewDeleteCoreV1NamespacedConfigMapAccepted() *DeleteCoreV1NamespacedConfigMapAccepted {\n\n\treturn &DeleteCoreV1NamespacedConfigMapAccepted{}\n}", "func NewCreateRbacAuthorizationV1beta1ClusterRoleBindingAccepted() *CreateRbacAuthorizationV1beta1ClusterRoleBindingAccepted {\n\treturn &CreateRbacAuthorizationV1beta1ClusterRoleBindingAccepted{}\n}", "func (o *DeleteCoreV1NamespacedPodAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (o *CreateAuthenticationV1beta1TokenReviewAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (o *WeaviateThingTemplatesCreateAccepted) WithPayload(payload *models.ThingTemplateGetResponse) *WeaviateThingTemplatesCreateAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Create(parent string, instanceId string, bindingId string, googlecloudservicebrokerv1alpha1__binding *GoogleCloudServicebrokerV1alpha1__Binding) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {\n\tc := &ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\tc.instanceId = instanceId\n\tc.bindingId = bindingId\n\tc.googlecloudservicebrokerv1alpha1__binding = googlecloudservicebrokerv1alpha1__binding\n\treturn c\n}", "func (o *CreateCoordinationV1NamespacedLeaseAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func NewCreateCoreV1PersistentVolumeAccepted() *CreateCoreV1PersistentVolumeAccepted {\n\treturn &CreateCoreV1PersistentVolumeAccepted{}\n}", "func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {\n\tc.urlParams_.Set(\"acceptsIncomplete\", fmt.Sprint(acceptsIncomplete))\n\treturn c\n}", "func NewEndpointCreated() filters.Spec {\n\tvar ec endpointCreated\n\treturn ec\n}", "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateVpcPeeringConnectionInput, error) {\n\tres := &svcsdk.CreateVpcPeeringConnectionInput{}\n\n\tif r.ko.Spec.DryRun != nil {\n\t\tres.SetDryRun(*r.ko.Spec.DryRun)\n\t}\n\tif r.ko.Spec.PeerOwnerID != nil {\n\t\tres.SetPeerOwnerId(*r.ko.Spec.PeerOwnerID)\n\t}\n\tif r.ko.Spec.PeerRegion != nil {\n\t\tres.SetPeerRegion(*r.ko.Spec.PeerRegion)\n\t}\n\tif r.ko.Spec.PeerVPCID != nil {\n\t\tres.SetPeerVpcId(*r.ko.Spec.PeerVPCID)\n\t}\n\tif r.ko.Spec.TagSpecifications != nil {\n\t\tf4 := []*svcsdk.TagSpecification{}\n\t\tfor _, f4iter := range r.ko.Spec.TagSpecifications {\n\t\t\tf4elem := &svcsdk.TagSpecification{}\n\t\t\tif f4iter.ResourceType != nil {\n\t\t\t\tf4elem.SetResourceType(*f4iter.ResourceType)\n\t\t\t}\n\t\t\tif f4iter.Tags != nil {\n\t\t\t\tf4elemf1 := []*svcsdk.Tag{}\n\t\t\t\tfor _, f4elemf1iter := range f4iter.Tags {\n\t\t\t\t\tf4elemf1elem := &svcsdk.Tag{}\n\t\t\t\t\tif f4elemf1iter.Key != nil {\n\t\t\t\t\t\tf4elemf1elem.SetKey(*f4elemf1iter.Key)\n\t\t\t\t\t}\n\t\t\t\t\tif f4elemf1iter.Value != nil {\n\t\t\t\t\t\tf4elemf1elem.SetValue(*f4elemf1iter.Value)\n\t\t\t\t\t}\n\t\t\t\t\tf4elemf1 = append(f4elemf1, f4elemf1elem)\n\t\t\t\t}\n\t\t\t\tf4elem.SetTags(f4elemf1)\n\t\t\t}\n\t\t\tf4 = append(f4, f4elem)\n\t\t}\n\t\tres.SetTagSpecifications(f4)\n\t}\n\tif r.ko.Spec.VPCID != nil {\n\t\tres.SetVpcId(*r.ko.Spec.VPCID)\n\t}\n\n\treturn res, nil\n}", "func NewSnapshotCreateAccepted() *SnapshotCreateAccepted {\n\treturn &SnapshotCreateAccepted{}\n}", "func (client *WebAppsClient) createOrUpdateHostNameBindingSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, slot string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingSlotOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif hostName == \"\" {\n\t\treturn nil, errors.New(\"parameter hostName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{hostName}\", url.PathEscape(hostName))\n\tif slot == \"\" {\n\t\treturn nil, errors.New(\"parameter slot cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{slot}\", url.PathEscape(slot))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, hostNameBinding)\n}", "func (o *CreatePeerAccepted) WithPayload(payload *models.PeerSection) *CreatePeerAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateServerSwitchingRuleAccepted() *CreateServerSwitchingRuleAccepted {\n\treturn &CreateServerSwitchingRuleAccepted{}\n}", "func NewAddItemAccepted() *AddItemAccepted {\n\n\treturn &AddItemAccepted{}\n}", "func NewCreatePeerAccepted() *CreatePeerAccepted {\n\n\treturn &CreatePeerAccepted{}\n}", "func NewPcloudCloudconnectionsDeleteAccepted() *PcloudCloudconnectionsDeleteAccepted {\n\treturn &PcloudCloudconnectionsDeleteAccepted{}\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleAccepted) WithPayload(payload *models.IoK8sAPIRbacV1alpha1Role) *CreateRbacAuthorizationV1alpha1NamespacedRoleAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateTCPCheckAccepted() *CreateTCPCheckAccepted {\n\n\treturn &CreateTCPCheckAccepted{}\n}", "func NewWeaviateActionsPatchAccepted() *WeaviateActionsPatchAccepted {\n\n\treturn &WeaviateActionsPatchAccepted{}\n}", "func NewWeaviateThingTemplatesCreateAccepted() *WeaviateThingTemplatesCreateAccepted {\n\treturn &WeaviateThingTemplatesCreateAccepted{}\n}", "func NewReplaceTCPResponseRuleAccepted() *ReplaceTCPResponseRuleAccepted {\n\treturn &ReplaceTCPResponseRuleAccepted{}\n}", "func (a *Client) CreateNetworkingV1beta1NamespacedIngress(params *CreateNetworkingV1beta1NamespacedIngressParams) (*CreateNetworkingV1beta1NamespacedIngressOK, *CreateNetworkingV1beta1NamespacedIngressCreated, *CreateNetworkingV1beta1NamespacedIngressAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateNetworkingV1beta1NamespacedIngressParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createNetworkingV1beta1NamespacedIngress\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/vnd.kubernetes.protobuf\", \"application/yaml\"},\n\t\tConsumesMediaTypes: []string{\"*/*\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateNetworkingV1beta1NamespacedIngressReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreateNetworkingV1beta1NamespacedIngressOK:\n\t\treturn value, nil, nil, nil\n\tcase *CreateNetworkingV1beta1NamespacedIngressCreated:\n\t\treturn nil, value, nil, nil\n\tcase *CreateNetworkingV1beta1NamespacedIngressAccepted:\n\t\treturn nil, nil, value, nil\n\t}\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 networking_v1beta1: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleAccepted) WithPayload(payload *models.IoK8sAPIRbacV1Role) *CreateRbacAuthorizationV1NamespacedRoleAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateBatchV1NamespacedJobAccepted) WithPayload(payload *models.IoK8sAPIBatchV1Job) *CreateBatchV1NamespacedJobAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1alpha1NamespacedRoleAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (o *CreateBatchV1NamespacedJobAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (h *httpHandler) CreateServiceBinding(w http.ResponseWriter, r *http.Request) {\n\tvar req scmodel.CreateServiceBindingRequest\n\terr := util.BodyToObject(r, &req)\n\tif err != nil {\n\t\tlog.Printf(\"Error unmarshaling: %#v\\n\", err)\n\t\tutil.WriteResponse(w, 400, err)\n\t\treturn\n\t}\n\n\tbinding := scmodel.ServiceBinding{\n\t\tName: req.Name,\n\t\tFrom: req.From,\n\t\tTo: req.To,\n\t\tParameters: req.Parameters,\n\t}\n\n\terr = h.k8sStorage.AddServiceBinding(&binding, nil)\n\tif err != nil {\n\t\tlog.Printf(\"Error creating a service binding %s: %v\\n\", req.Name, err)\n\t\tutil.WriteResponse(w, 400, err)\n\t\treturn\n\t}\n\tutil.WriteResponse(w, 200, binding)\n}", "func NewDeleteFlowcontrolApiserverV1alpha1PriorityLevelConfigurationAccepted() *DeleteFlowcontrolApiserverV1alpha1PriorityLevelConfigurationAccepted {\n\treturn &DeleteFlowcontrolApiserverV1alpha1PriorityLevelConfigurationAccepted{}\n}", "func createIstioCARoleBinding(clientset kubernetes.Interface, namespace string) error {\n\trolebinding := rbac.RoleBinding{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"rbac.authorization.k8s.io/v1beta1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"istio-ca-role-binding\",\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSubjects: []rbac.Subject{\n\t\t\t{\n\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\tName: \"default\",\n\t\t\t\tNamespace: namespace,\n\t\t\t},\n\t\t},\n\t\tRoleRef: rbac.RoleRef{\n\t\t\tKind: \"Role\",\n\t\t\tName: \"istio-ca-role\",\n\t\t\tAPIGroup: \"rbac.authorization.k8s.io\",\n\t\t},\n\t}\n\t_, err := clientset.RbacV1beta1().RoleBindings(namespace).Create(&rolebinding)\n\treturn err\n}", "func CreateBeginVnDialogueResponse() (response *BeginVnDialogueResponse) {\n\tresponse = &BeginVnDialogueResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func (o *WeaviateThingTemplatesCreateAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (o *CreateCoordinationV1NamespacedLeaseAccepted) WithPayload(payload *models.IoK8sAPICoordinationV1Lease) *CreateCoordinationV1NamespacedLeaseAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateRbacAuthorizationV1NamespacedRoleAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func NewDeleteCoreV1PersistentVolumeAccepted() *DeleteCoreV1PersistentVolumeAccepted {\n\treturn &DeleteCoreV1PersistentVolumeAccepted{}\n}", "func (a *Client) CreateBind(params *CreateBindParams, authInfo runtime.ClientAuthInfoWriter) (*CreateBindCreated, *CreateBindAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateBindParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createBind\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/services/haproxy/configuration/binds\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateBindReader{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, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreateBindCreated:\n\t\treturn value, nil, nil\n\tcase *CreateBindAccepted:\n\t\treturn nil, value, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*CreateBindDefault)\n\treturn nil, nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "func Accepted(data Serializer, logging ...interface{}) Response {\n\tif data == nil {\n\t\tdata = String(\"202 Accepted\")\n\t}\n\treturn Response{Status: http.StatusAccepted, Data: data, Logging: logging}\n}", "func NewDeleteNodeV1alpha1RuntimeClassAccepted() *DeleteNodeV1alpha1RuntimeClassAccepted {\n\treturn &DeleteNodeV1alpha1RuntimeClassAccepted{}\n}", "func TestNatBindingCreateDelete(t *testing.T) {\n\t// create netagent\n\tag, _, _ := state.createNetAgent(t)\n\tAssert(t, ag != nil, \"Failed to create agent %#v\", ag)\n\tdefer ag.Stop()\n\t// namespace\n\tnb := netproto.NatBinding{\n\t\tTypeMeta: api.TypeMeta{Kind: \"NatBinding\"},\n\t\tObjectMeta: api.ObjectMeta{\n\t\t\tTenant: \"default\",\n\t\t\tNamespace: \"default\",\n\t\t\tName: \"testNatBinding\",\n\t\t},\n\t\tSpec: netproto.NatBindingSpec{\n\t\t\tNatPoolName: \"preCreatedNatPool\",\n\t\t\tIPAddress: \"10.1.1.1\",\n\t\t},\n\t}\n\n\t// create backing nat pool\n\tnp := netproto.NatPool{\n\t\tTypeMeta: api.TypeMeta{Kind: \"NatPool\"},\n\t\tObjectMeta: api.ObjectMeta{\n\t\t\tTenant: \"default\",\n\t\t\tNamespace: \"default\",\n\t\t\tName: \"preCreatedNatPool\",\n\t\t},\n\t\tSpec: netproto.NatPoolSpec{\n\t\t\tIPRange: \"10.0.0.1-10.1.1.100\",\n\t\t},\n\t}\n\n\t// create nat pool\n\terr := ag.CreateNatPool(&np)\n\tAssertOk(t, err, \"Error creating nat pool\")\n\n\t// create nat binding\n\terr = ag.CreateNatBinding(&nb)\n\tAssertOk(t, err, \"Error creating nat binding\")\n\tnatPool, err := ag.FindNatBinding(nb.ObjectMeta)\n\tAssertOk(t, err, \"Nat Pool was not found in DB\")\n\tAssert(t, natPool.Name == \"testNatBinding\", \"NatBinding names did not match\", natPool)\n\n\t// verify duplicate tenant creations succeed\n\terr = ag.CreateNatBinding(&nb)\n\tAssertOk(t, err, \"Error creating duplicate nat pool\")\n\n\t// verify list api works.\n\tnbList := ag.ListNatBinding()\n\tAssert(t, len(nbList) == 1, \"Incorrect number of nat pools\")\n\n\t// delete the natpool and verify its gone from db\n\terr = ag.DeleteNatBinding(nb.Tenant, nb.Namespace, nb.Name)\n\tAssertOk(t, err, \"Error deleting nat pool\")\n\t_, err = ag.FindNatBinding(nb.ObjectMeta)\n\tAssert(t, err != nil, \"Nat Pool was still found in database after deleting\", ag)\n\n\t// verify you can not delete non-existing tenant\n\terr = ag.DeleteNatBinding(nb.Tenant, nb.Namespace, nb.Name)\n\tAssert(t, err != nil, \"deleting non-existing nat pool succeeded\", ag)\n}", "func NewCreateCoreV1NamespacedPodOK() *CreateCoreV1NamespacedPodOK {\n\treturn &CreateCoreV1NamespacedPodOK{}\n}", "func (o *DeleteCoreV1NamespacedConfigMapAccepted) WithPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) *DeleteCoreV1NamespacedConfigMapAccepted {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateNetworkingV1beta1NamespacedIngressCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func (o *PostManagementKubernetesIoV1NodesAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(202)\n}", "func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif privateEndpointConnectionName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateEndpointConnectionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateEndpointConnectionName}\", url.PathEscape(privateEndpointConnectionName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, privateEndpointWrapper)\n}", "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateVpnConnectionInput, error) {\n\tres := &svcsdk.CreateVpnConnectionInput{}\n\n\tif r.ko.Spec.CustomerGatewayID != nil {\n\t\tres.SetCustomerGatewayId(*r.ko.Spec.CustomerGatewayID)\n\t}\n\tif r.ko.Spec.DryRun != nil {\n\t\tres.SetDryRun(*r.ko.Spec.DryRun)\n\t}\n\tif r.ko.Spec.Options != nil {\n\t\tf2 := &svcsdk.VpnConnectionOptionsSpecification{}\n\t\tif r.ko.Spec.Options.EnableAcceleration != nil {\n\t\t\tf2.SetEnableAcceleration(*r.ko.Spec.Options.EnableAcceleration)\n\t\t}\n\t\tif r.ko.Spec.Options.LocalIPv4NetworkCIDR != nil {\n\t\t\tf2.SetLocalIpv4NetworkCidr(*r.ko.Spec.Options.LocalIPv4NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.LocalIPv6NetworkCIDR != nil {\n\t\t\tf2.SetLocalIpv6NetworkCidr(*r.ko.Spec.Options.LocalIPv6NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.RemoteIPv4NetworkCIDR != nil {\n\t\t\tf2.SetRemoteIpv4NetworkCidr(*r.ko.Spec.Options.RemoteIPv4NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.RemoteIPv6NetworkCIDR != nil {\n\t\t\tf2.SetRemoteIpv6NetworkCidr(*r.ko.Spec.Options.RemoteIPv6NetworkCIDR)\n\t\t}\n\t\tif r.ko.Spec.Options.StaticRoutesOnly != nil {\n\t\t\tf2.SetStaticRoutesOnly(*r.ko.Spec.Options.StaticRoutesOnly)\n\t\t}\n\t\tif r.ko.Spec.Options.TunnelInsideIPVersion != nil {\n\t\t\tf2.SetTunnelInsideIpVersion(*r.ko.Spec.Options.TunnelInsideIPVersion)\n\t\t}\n\t\tif r.ko.Spec.Options.TunnelOptions != nil {\n\t\t\tf2f7 := []*svcsdk.VpnTunnelOptionsSpecification{}\n\t\t\tfor _, f2f7iter := range r.ko.Spec.Options.TunnelOptions {\n\t\t\t\tf2f7elem := &svcsdk.VpnTunnelOptionsSpecification{}\n\t\t\t\tif f2f7iter.DPDTimeoutAction != nil {\n\t\t\t\t\tf2f7elem.SetDPDTimeoutAction(*f2f7iter.DPDTimeoutAction)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.DPDTimeoutSeconds != nil {\n\t\t\t\t\tf2f7elem.SetDPDTimeoutSeconds(*f2f7iter.DPDTimeoutSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.IKEVersions != nil {\n\t\t\t\t\tf2f7elemf2 := []*svcsdk.IKEVersionsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf2iter := range f2f7iter.IKEVersions {\n\t\t\t\t\t\tf2f7elemf2elem := &svcsdk.IKEVersionsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf2iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf2elem.SetValue(*f2f7elemf2iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf2 = append(f2f7elemf2, f2f7elemf2elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetIKEVersions(f2f7elemf2)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1DHGroupNumbers != nil {\n\t\t\t\t\tf2f7elemf3 := []*svcsdk.Phase1DHGroupNumbersRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf3iter := range f2f7iter.Phase1DHGroupNumbers {\n\t\t\t\t\t\tf2f7elemf3elem := &svcsdk.Phase1DHGroupNumbersRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf3iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf3elem.SetValue(*f2f7elemf3iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf3 = append(f2f7elemf3, f2f7elemf3elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase1DHGroupNumbers(f2f7elemf3)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1EncryptionAlgorithms != nil {\n\t\t\t\t\tf2f7elemf4 := []*svcsdk.Phase1EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf4iter := range f2f7iter.Phase1EncryptionAlgorithms {\n\t\t\t\t\t\tf2f7elemf4elem := &svcsdk.Phase1EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf4iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf4elem.SetValue(*f2f7elemf4iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf4 = append(f2f7elemf4, f2f7elemf4elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase1EncryptionAlgorithms(f2f7elemf4)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1IntegrityAlgorithms != nil {\n\t\t\t\t\tf2f7elemf5 := []*svcsdk.Phase1IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf5iter := range f2f7iter.Phase1IntegrityAlgorithms {\n\t\t\t\t\t\tf2f7elemf5elem := &svcsdk.Phase1IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf5iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf5elem.SetValue(*f2f7elemf5iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf5 = append(f2f7elemf5, f2f7elemf5elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase1IntegrityAlgorithms(f2f7elemf5)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase1LifetimeSeconds != nil {\n\t\t\t\t\tf2f7elem.SetPhase1LifetimeSeconds(*f2f7iter.Phase1LifetimeSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2DHGroupNumbers != nil {\n\t\t\t\t\tf2f7elemf7 := []*svcsdk.Phase2DHGroupNumbersRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf7iter := range f2f7iter.Phase2DHGroupNumbers {\n\t\t\t\t\t\tf2f7elemf7elem := &svcsdk.Phase2DHGroupNumbersRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf7iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf7elem.SetValue(*f2f7elemf7iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf7 = append(f2f7elemf7, f2f7elemf7elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase2DHGroupNumbers(f2f7elemf7)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2EncryptionAlgorithms != nil {\n\t\t\t\t\tf2f7elemf8 := []*svcsdk.Phase2EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf8iter := range f2f7iter.Phase2EncryptionAlgorithms {\n\t\t\t\t\t\tf2f7elemf8elem := &svcsdk.Phase2EncryptionAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf8iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf8elem.SetValue(*f2f7elemf8iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf8 = append(f2f7elemf8, f2f7elemf8elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase2EncryptionAlgorithms(f2f7elemf8)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2IntegrityAlgorithms != nil {\n\t\t\t\t\tf2f7elemf9 := []*svcsdk.Phase2IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\tfor _, f2f7elemf9iter := range f2f7iter.Phase2IntegrityAlgorithms {\n\t\t\t\t\t\tf2f7elemf9elem := &svcsdk.Phase2IntegrityAlgorithmsRequestListValue{}\n\t\t\t\t\t\tif f2f7elemf9iter.Value != nil {\n\t\t\t\t\t\t\tf2f7elemf9elem.SetValue(*f2f7elemf9iter.Value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf2f7elemf9 = append(f2f7elemf9, f2f7elemf9elem)\n\t\t\t\t\t}\n\t\t\t\t\tf2f7elem.SetPhase2IntegrityAlgorithms(f2f7elemf9)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.Phase2LifetimeSeconds != nil {\n\t\t\t\t\tf2f7elem.SetPhase2LifetimeSeconds(*f2f7iter.Phase2LifetimeSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.PreSharedKey != nil {\n\t\t\t\t\tf2f7elem.SetPreSharedKey(*f2f7iter.PreSharedKey)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.RekeyFuzzPercentage != nil {\n\t\t\t\t\tf2f7elem.SetRekeyFuzzPercentage(*f2f7iter.RekeyFuzzPercentage)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.RekeyMarginTimeSeconds != nil {\n\t\t\t\t\tf2f7elem.SetRekeyMarginTimeSeconds(*f2f7iter.RekeyMarginTimeSeconds)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.ReplayWindowSize != nil {\n\t\t\t\t\tf2f7elem.SetReplayWindowSize(*f2f7iter.ReplayWindowSize)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.StartupAction != nil {\n\t\t\t\t\tf2f7elem.SetStartupAction(*f2f7iter.StartupAction)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.TunnelInsideCIDR != nil {\n\t\t\t\t\tf2f7elem.SetTunnelInsideCidr(*f2f7iter.TunnelInsideCIDR)\n\t\t\t\t}\n\t\t\t\tif f2f7iter.TunnelInsideIPv6CIDR != nil {\n\t\t\t\t\tf2f7elem.SetTunnelInsideIpv6Cidr(*f2f7iter.TunnelInsideIPv6CIDR)\n\t\t\t\t}\n\t\t\t\tf2f7 = append(f2f7, f2f7elem)\n\t\t\t}\n\t\t\tf2.SetTunnelOptions(f2f7)\n\t\t}\n\t\tres.SetOptions(f2)\n\t}\n\tif r.ko.Spec.TagSpecifications != nil {\n\t\tf3 := []*svcsdk.TagSpecification{}\n\t\tfor _, f3iter := range r.ko.Spec.TagSpecifications {\n\t\t\tf3elem := &svcsdk.TagSpecification{}\n\t\t\tif f3iter.ResourceType != nil {\n\t\t\t\tf3elem.SetResourceType(*f3iter.ResourceType)\n\t\t\t}\n\t\t\tif f3iter.Tags != nil {\n\t\t\t\tf3elemf1 := []*svcsdk.Tag{}\n\t\t\t\tfor _, f3elemf1iter := range f3iter.Tags {\n\t\t\t\t\tf3elemf1elem := &svcsdk.Tag{}\n\t\t\t\t\tif f3elemf1iter.Key != nil {\n\t\t\t\t\t\tf3elemf1elem.SetKey(*f3elemf1iter.Key)\n\t\t\t\t\t}\n\t\t\t\t\tif f3elemf1iter.Value != nil {\n\t\t\t\t\t\tf3elemf1elem.SetValue(*f3elemf1iter.Value)\n\t\t\t\t\t}\n\t\t\t\t\tf3elemf1 = append(f3elemf1, f3elemf1elem)\n\t\t\t\t}\n\t\t\t\tf3elem.SetTags(f3elemf1)\n\t\t\t}\n\t\t\tf3 = append(f3, f3elem)\n\t\t}\n\t\tres.SetTagSpecifications(f3)\n\t}\n\tif r.ko.Spec.TransitGatewayID != nil {\n\t\tres.SetTransitGatewayId(*r.ko.Spec.TransitGatewayID)\n\t}\n\tif r.ko.Spec.Type != nil {\n\t\tres.SetType(*r.ko.Spec.Type)\n\t}\n\tif r.ko.Spec.VPNGatewayID != nil {\n\t\tres.SetVpnGatewayId(*r.ko.Spec.VPNGatewayID)\n\t}\n\n\treturn res, nil\n}", "func NewAcceptedProposal(data []byte) (*AcceptedProposal, error) {\n\tvar ap AcceptedProposal\n\tdec := gob.NewDecoder(bytes.NewBuffer(data))\n\tif err := dec.Decode(&ap); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ap, nil\n}", "func (o CreateChannelBody) MarshalJSON() ([]byte, error) {\n\t_parts := make([][]byte, 0, 2)\n\n\tvar dataCreateChannelParamsBodyAO0 struct {\n\t\tConfigMeta *CreateChannelParamsBodyCreateChannelParamsBodyAO0ConfigMeta `json:\"config_meta,omitempty\"`\n\n\t\tExternalID string `json:\"external_id,omitempty\"`\n\n\t\tIsListableFromUI bool `json:\"is_listable_from_ui,omitempty\"`\n\n\t\tIsVisible bool `json:\"is_visible,omitempty\"`\n\n\t\tName *string `json:\"name\"`\n\n\t\tStatus string `json:\"status,omitempty\"`\n\t}\n\n\tdataCreateChannelParamsBodyAO0.ConfigMeta = o.ConfigMeta\n\n\tdataCreateChannelParamsBodyAO0.ExternalID = o.ExternalID\n\n\tdataCreateChannelParamsBodyAO0.IsListableFromUI = o.IsListableFromUI\n\n\tdataCreateChannelParamsBodyAO0.IsVisible = o.IsVisible\n\n\tdataCreateChannelParamsBodyAO0.Name = o.Name\n\n\tdataCreateChannelParamsBodyAO0.Status = o.Status\n\n\tjsonDataCreateChannelParamsBodyAO0, errCreateChannelParamsBodyAO0 := swag.WriteJSON(dataCreateChannelParamsBodyAO0)\n\tif errCreateChannelParamsBodyAO0 != nil {\n\t\treturn nil, errCreateChannelParamsBodyAO0\n\t}\n\t_parts = append(_parts, jsonDataCreateChannelParamsBodyAO0)\n\tvar dataCreateChannelParamsBodyAO1 struct {\n\t\tPlatform *string `json:\"platform\"`\n\n\t\tType *string `json:\"type\"`\n\t}\n\n\tdataCreateChannelParamsBodyAO1.Platform = o.Platform\n\n\tdataCreateChannelParamsBodyAO1.Type = o.Type\n\n\tjsonDataCreateChannelParamsBodyAO1, errCreateChannelParamsBodyAO1 := swag.WriteJSON(dataCreateChannelParamsBodyAO1)\n\tif errCreateChannelParamsBodyAO1 != nil {\n\t\treturn nil, errCreateChannelParamsBodyAO1\n\t}\n\t_parts = append(_parts, jsonDataCreateChannelParamsBodyAO1)\n\treturn swag.ConcatJSON(_parts...), nil\n}", "func (rm *resourceManager) newDeleteRequestPayload(\n\tr *resource,\n) (*svcsdk.DeleteVpcPeeringConnectionInput, error) {\n\tres := &svcsdk.DeleteVpcPeeringConnectionInput{}\n\n\tif r.ko.Spec.DryRun != nil {\n\t\tres.SetDryRun(*r.ko.Spec.DryRun)\n\t}\n\tif r.ko.Status.VPCPeeringConnectionID != nil {\n\t\tres.SetVpcPeeringConnectionId(*r.ko.Status.VPCPeeringConnectionID)\n\t}\n\n\treturn res, nil\n}", "func (client *WebAppsClient) createOrUpdateHostNameBindingCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}\"\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 name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif hostName == \"\" {\n\t\treturn nil, errors.New(\"parameter hostName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{hostName}\", url.PathEscape(hostName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-02-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, hostNameBinding)\n}", "func (o *CreateRbacAuthorizationV1ClusterRoleBindingCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func (o *CreateRbacAuthorizationV1ClusterRoleBindingAccepted) WithPayload(payload *models.IoK8sAPIRbacV1ClusterRoleBinding) *CreateRbacAuthorizationV1ClusterRoleBindingAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateTaskAccepted() *CreateTaskAccepted {\n\n\treturn &CreateTaskAccepted{}\n}", "func NewDeleteStorageV1VolumeAttachmentAccepted() *DeleteStorageV1VolumeAttachmentAccepted {\n\treturn &DeleteStorageV1VolumeAttachmentAccepted{}\n}", "func (b *bindingTest) PodcreateAndExpose(name *string, port *string) {\n\tcommand := []string{\"pod\", \"create\"}\n\tif name != nil {\n\t\tpodname := *name\n\t\tcommand = append(command, \"--name\", podname)\n\t}\n\tif port != nil {\n\t\tpodport := *port\n\t\tcommand = append(command, \"--publish\", podport)\n\t}\n\tb.runPodman(command).Wait(45)\n}", "func (a *Client) CreatePolicyV1beta1NamespacedPodDisruptionBudget(params *CreatePolicyV1beta1NamespacedPodDisruptionBudgetParams) (*CreatePolicyV1beta1NamespacedPodDisruptionBudgetOK, *CreatePolicyV1beta1NamespacedPodDisruptionBudgetCreated, *CreatePolicyV1beta1NamespacedPodDisruptionBudgetAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreatePolicyV1beta1NamespacedPodDisruptionBudgetParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createPolicyV1beta1NamespacedPodDisruptionBudget\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/vnd.kubernetes.protobuf\", \"application/yaml\"},\n\t\tConsumesMediaTypes: []string{\"*/*\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreatePolicyV1beta1NamespacedPodDisruptionBudgetReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreatePolicyV1beta1NamespacedPodDisruptionBudgetOK:\n\t\treturn value, nil, nil, nil\n\tcase *CreatePolicyV1beta1NamespacedPodDisruptionBudgetCreated:\n\t\treturn nil, value, nil, nil\n\tcase *CreatePolicyV1beta1NamespacedPodDisruptionBudgetAccepted:\n\t\treturn nil, nil, value, nil\n\t}\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 policy_v1beta1: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func NewStopAppAccepted() *StopAppAccepted {\n\treturn &StopAppAccepted{}\n}", "func (o *CreateAuthorizationV1beta1NamespacedLocalSubjectAccessReviewAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(202)\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}", "func (rm *resourceManager) sdkCreate(\n\tctx context.Context,\n\tr *resource,\n) (*resource, error) {\n\tinput, err := rm.newCreateRequestPayload(ctx, r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, respErr := rm.sdkapi.CreateVpcPeeringConnectionWithContext(ctx, input)\n\trm.metrics.RecordAPICall(\"CREATE\", \"CreateVpcPeeringConnection\", respErr)\n\tif respErr != nil {\n\t\treturn nil, respErr\n\t}\n\t// Merge in the information we read from the API call above to the copy of\n\t// the original Kubernetes object we passed to the function\n\tko := r.ko.DeepCopy()\n\n\tif resp.VpcPeeringConnection.AccepterVpcInfo != nil {\n\t\tf0 := &svcapitypes.VPCPeeringConnectionVPCInfo{}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.CidrBlock != nil {\n\t\t\tf0.CIDRBlock = resp.VpcPeeringConnection.AccepterVpcInfo.CidrBlock\n\t\t}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.CidrBlockSet != nil {\n\t\t\tf0f1 := []*svcapitypes.CIDRBlock{}\n\t\t\tfor _, f0f1iter := range resp.VpcPeeringConnection.AccepterVpcInfo.CidrBlockSet {\n\t\t\t\tf0f1elem := &svcapitypes.CIDRBlock{}\n\t\t\t\tif f0f1iter.CidrBlock != nil {\n\t\t\t\t\tf0f1elem.CIDRBlock = f0f1iter.CidrBlock\n\t\t\t\t}\n\t\t\t\tf0f1 = append(f0f1, f0f1elem)\n\t\t\t}\n\t\t\tf0.CIDRBlockSet = f0f1\n\t\t}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.Ipv6CidrBlockSet != nil {\n\t\t\tf0f2 := []*svcapitypes.IPv6CIDRBlock{}\n\t\t\tfor _, f0f2iter := range resp.VpcPeeringConnection.AccepterVpcInfo.Ipv6CidrBlockSet {\n\t\t\t\tf0f2elem := &svcapitypes.IPv6CIDRBlock{}\n\t\t\t\tif f0f2iter.Ipv6CidrBlock != nil {\n\t\t\t\t\tf0f2elem.IPv6CIDRBlock = f0f2iter.Ipv6CidrBlock\n\t\t\t\t}\n\t\t\t\tf0f2 = append(f0f2, f0f2elem)\n\t\t\t}\n\t\t\tf0.IPv6CIDRBlockSet = f0f2\n\t\t}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.OwnerId != nil {\n\t\t\tf0.OwnerID = resp.VpcPeeringConnection.AccepterVpcInfo.OwnerId\n\t\t}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions != nil {\n\t\t\tf0f4 := &svcapitypes.VPCPeeringConnectionOptionsDescription{}\n\t\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions.AllowDnsResolutionFromRemoteVpc != nil {\n\t\t\t\tf0f4.AllowDNSResolutionFromRemoteVPC = resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions.AllowDnsResolutionFromRemoteVpc\n\t\t\t}\n\t\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions.AllowEgressFromLocalClassicLinkToRemoteVpc != nil {\n\t\t\t\tf0f4.AllowEgressFromLocalClassicLinkToRemoteVPC = resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions.AllowEgressFromLocalClassicLinkToRemoteVpc\n\t\t\t}\n\t\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions.AllowEgressFromLocalVpcToRemoteClassicLink != nil {\n\t\t\t\tf0f4.AllowEgressFromLocalVPCToRemoteClassicLink = resp.VpcPeeringConnection.AccepterVpcInfo.PeeringOptions.AllowEgressFromLocalVpcToRemoteClassicLink\n\t\t\t}\n\t\t\tf0.PeeringOptions = f0f4\n\t\t}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.Region != nil {\n\t\t\tf0.Region = resp.VpcPeeringConnection.AccepterVpcInfo.Region\n\t\t}\n\t\tif resp.VpcPeeringConnection.AccepterVpcInfo.VpcId != nil {\n\t\t\tf0.VPCID = resp.VpcPeeringConnection.AccepterVpcInfo.VpcId\n\t\t}\n\t\tko.Status.AccepterVPCInfo = f0\n\t}\n\tif resp.VpcPeeringConnection.ExpirationTime != nil {\n\t\tko.Status.ExpirationTime = &metav1.Time{*resp.VpcPeeringConnection.ExpirationTime}\n\t}\n\tif resp.VpcPeeringConnection.RequesterVpcInfo != nil {\n\t\tf2 := &svcapitypes.VPCPeeringConnectionVPCInfo{}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.CidrBlock != nil {\n\t\t\tf2.CIDRBlock = resp.VpcPeeringConnection.RequesterVpcInfo.CidrBlock\n\t\t}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.CidrBlockSet != nil {\n\t\t\tf2f1 := []*svcapitypes.CIDRBlock{}\n\t\t\tfor _, f2f1iter := range resp.VpcPeeringConnection.RequesterVpcInfo.CidrBlockSet {\n\t\t\t\tf2f1elem := &svcapitypes.CIDRBlock{}\n\t\t\t\tif f2f1iter.CidrBlock != nil {\n\t\t\t\t\tf2f1elem.CIDRBlock = f2f1iter.CidrBlock\n\t\t\t\t}\n\t\t\t\tf2f1 = append(f2f1, f2f1elem)\n\t\t\t}\n\t\t\tf2.CIDRBlockSet = f2f1\n\t\t}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.Ipv6CidrBlockSet != nil {\n\t\t\tf2f2 := []*svcapitypes.IPv6CIDRBlock{}\n\t\t\tfor _, f2f2iter := range resp.VpcPeeringConnection.RequesterVpcInfo.Ipv6CidrBlockSet {\n\t\t\t\tf2f2elem := &svcapitypes.IPv6CIDRBlock{}\n\t\t\t\tif f2f2iter.Ipv6CidrBlock != nil {\n\t\t\t\t\tf2f2elem.IPv6CIDRBlock = f2f2iter.Ipv6CidrBlock\n\t\t\t\t}\n\t\t\t\tf2f2 = append(f2f2, f2f2elem)\n\t\t\t}\n\t\t\tf2.IPv6CIDRBlockSet = f2f2\n\t\t}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.OwnerId != nil {\n\t\t\tf2.OwnerID = resp.VpcPeeringConnection.RequesterVpcInfo.OwnerId\n\t\t}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions != nil {\n\t\t\tf2f4 := &svcapitypes.VPCPeeringConnectionOptionsDescription{}\n\t\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions.AllowDnsResolutionFromRemoteVpc != nil {\n\t\t\t\tf2f4.AllowDNSResolutionFromRemoteVPC = resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions.AllowDnsResolutionFromRemoteVpc\n\t\t\t}\n\t\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions.AllowEgressFromLocalClassicLinkToRemoteVpc != nil {\n\t\t\t\tf2f4.AllowEgressFromLocalClassicLinkToRemoteVPC = resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions.AllowEgressFromLocalClassicLinkToRemoteVpc\n\t\t\t}\n\t\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions.AllowEgressFromLocalVpcToRemoteClassicLink != nil {\n\t\t\t\tf2f4.AllowEgressFromLocalVPCToRemoteClassicLink = resp.VpcPeeringConnection.RequesterVpcInfo.PeeringOptions.AllowEgressFromLocalVpcToRemoteClassicLink\n\t\t\t}\n\t\t\tf2.PeeringOptions = f2f4\n\t\t}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.Region != nil {\n\t\t\tf2.Region = resp.VpcPeeringConnection.RequesterVpcInfo.Region\n\t\t}\n\t\tif resp.VpcPeeringConnection.RequesterVpcInfo.VpcId != nil {\n\t\t\tf2.VPCID = resp.VpcPeeringConnection.RequesterVpcInfo.VpcId\n\t\t}\n\t\tko.Status.RequesterVPCInfo = f2\n\t}\n\tif resp.VpcPeeringConnection.Status != nil {\n\t\tf3 := &svcapitypes.VPCPeeringConnectionStateReason{}\n\t\tif resp.VpcPeeringConnection.Status.Code != nil {\n\t\t\tf3.Code = resp.VpcPeeringConnection.Status.Code\n\t\t}\n\t\tif resp.VpcPeeringConnection.Status.Message != nil {\n\t\t\tf3.Message = resp.VpcPeeringConnection.Status.Message\n\t\t}\n\t\tko.Status.Status = f3\n\t}\n\tif resp.VpcPeeringConnection.Tags != nil {\n\t\tf4 := []*svcapitypes.Tag{}\n\t\tfor _, f4iter := range resp.VpcPeeringConnection.Tags {\n\t\t\tf4elem := &svcapitypes.Tag{}\n\t\t\tif f4iter.Key != nil {\n\t\t\t\tf4elem.Key = f4iter.Key\n\t\t\t}\n\t\t\tif f4iter.Value != nil {\n\t\t\t\tf4elem.Value = f4iter.Value\n\t\t\t}\n\t\t\tf4 = append(f4, f4elem)\n\t\t}\n\t\tko.Status.Tags = f4\n\t}\n\tif resp.VpcPeeringConnection.VpcPeeringConnectionId != nil {\n\t\tko.Status.VPCPeeringConnectionID = resp.VpcPeeringConnection.VpcPeeringConnectionId\n\t}\n\n\trm.setStatusDefaults(ko)\n\n\treturn &resource{ko}, nil\n}" ]
[ "0.69764715", "0.6383097", "0.5926168", "0.5786029", "0.56956553", "0.5679013", "0.55781716", "0.5445475", "0.5294871", "0.5286224", "0.5186162", "0.51444805", "0.51283205", "0.5108229", "0.5104331", "0.51002", "0.5077701", "0.50480133", "0.50150347", "0.49778944", "0.49369657", "0.4922598", "0.4908675", "0.48944053", "0.48567396", "0.48535064", "0.4825806", "0.47873124", "0.47732687", "0.47455096", "0.47357258", "0.47300798", "0.47117925", "0.46931142", "0.4683384", "0.46815816", "0.46549982", "0.46305358", "0.4600283", "0.45930788", "0.45610896", "0.45565745", "0.45499372", "0.45175546", "0.45055294", "0.44933167", "0.44797793", "0.44570717", "0.44521984", "0.44481242", "0.4436301", "0.44323426", "0.4431183", "0.44303444", "0.4423178", "0.44230536", "0.44178376", "0.44094938", "0.43807828", "0.43769795", "0.43633503", "0.436196", "0.43507725", "0.435067", "0.43208605", "0.43146867", "0.4308225", "0.42841905", "0.42715636", "0.4243381", "0.42420945", "0.42407098", "0.42382902", "0.42341942", "0.42331472", "0.42325893", "0.4225271", "0.42164466", "0.42147774", "0.42141756", "0.42077374", "0.4184477", "0.41799003", "0.41653487", "0.41641068", "0.4161125", "0.4155589", "0.41430646", "0.41394216", "0.41127726", "0.41113046", "0.41077313", "0.41033322", "0.4088555", "0.40865758", "0.40752688", "0.4059027", "0.40590096", "0.40571767", "0.40545422" ]
0.7632759
0
NewCreateCoreV1NamespacedPodBindingUnauthorized creates CreateCoreV1NamespacedPodBindingUnauthorized with default headers values
NewCreateCoreV1NamespacedPodBindingUnauthorized создает CreateCoreV1NamespacedPodBindingUnauthorized с значениями заголовков по умолчанию
func NewCreateCoreV1NamespacedPodBindingUnauthorized() *CreateCoreV1NamespacedPodBindingUnauthorized { return &CreateCoreV1NamespacedPodBindingUnauthorized{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCreateCoreV1NamespacedPodUnauthorized() *CreateCoreV1NamespacedPodUnauthorized {\n\treturn &CreateCoreV1NamespacedPodUnauthorized{}\n}", "func NewCreateNetworkingV1beta1NamespacedIngressUnauthorized() *CreateNetworkingV1beta1NamespacedIngressUnauthorized {\n\n\treturn &CreateNetworkingV1beta1NamespacedIngressUnauthorized{}\n}", "func NewReadCoreV1NamespacedPodUnauthorized() *ReadCoreV1NamespacedPodUnauthorized {\n\treturn &ReadCoreV1NamespacedPodUnauthorized{}\n}", "func NewCreateCoreV1NamespacedPodBindingOK() *CreateCoreV1NamespacedPodBindingOK {\n\n\treturn &CreateCoreV1NamespacedPodBindingOK{}\n}", "func NewDeleteCoreV1NamespacedPodUnauthorized() *DeleteCoreV1NamespacedPodUnauthorized {\n\n\treturn &DeleteCoreV1NamespacedPodUnauthorized{}\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *CreateCoreV1NamespacedPodBindingUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(401)\n}", "func NewCreateCoreV1NamespacedServiceAccountTokenUnauthorized() *CreateCoreV1NamespacedServiceAccountTokenUnauthorized {\n\n\treturn &CreateCoreV1NamespacedServiceAccountTokenUnauthorized{}\n}", "func NewCreateCoreV1NamespacedServiceAccountTokenUnauthorized() *CreateCoreV1NamespacedServiceAccountTokenUnauthorized {\n\treturn &CreateCoreV1NamespacedServiceAccountTokenUnauthorized{}\n}", "func NewWatchCoreV1NamespacedPodTemplateListUnauthorized() *WatchCoreV1NamespacedPodTemplateListUnauthorized {\n\treturn &WatchCoreV1NamespacedPodTemplateListUnauthorized{}\n}", "func NewAuthPrivilegeRequestWithoutParam() *AuthPrivilegeRequest {\n\n return &AuthPrivilegeRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/management:authPrivilege\",\n Method: \"POST\",\n Header: nil,\n Version: \"v1\",\n },\n }\n}", "func (o *CreateCoreV1NamespacedPodBindingOK) WithPayload(payload *models.IoK8sAPICoreV1Binding) *CreateCoreV1NamespacedPodBindingOK {\n\to.Payload = payload\n\treturn o\n}", "func NewPatchCoreV1NamespacedServiceAccountUnauthorized() *PatchCoreV1NamespacedServiceAccountUnauthorized {\n\treturn &PatchCoreV1NamespacedServiceAccountUnauthorized{}\n}", "func NewWatchCoreV1NamespacedEndpointsUnauthorized() *WatchCoreV1NamespacedEndpointsUnauthorized {\n\n\treturn &WatchCoreV1NamespacedEndpointsUnauthorized{}\n}", "func NewCreateExtensionsV1beta1NamespacedIngressUnauthorized() *CreateExtensionsV1beta1NamespacedIngressUnauthorized {\n\n\treturn &CreateExtensionsV1beta1NamespacedIngressUnauthorized{}\n}", "func NewConnectCoreV1PatchNamespacedServiceProxyUnauthorized() *ConnectCoreV1PatchNamespacedServiceProxyUnauthorized {\n\treturn &ConnectCoreV1PatchNamespacedServiceProxyUnauthorized{}\n}", "func NewCreateDiscoveryV1beta1NamespacedEndpointSliceUnauthorized() *CreateDiscoveryV1beta1NamespacedEndpointSliceUnauthorized {\n\n\treturn &CreateDiscoveryV1beta1NamespacedEndpointSliceUnauthorized{}\n}", "func NewDeleteCoreV1NamespacedServiceUnauthorized() *DeleteCoreV1NamespacedServiceUnauthorized {\n\treturn &DeleteCoreV1NamespacedServiceUnauthorized{}\n}", "func NewCreateInputPortUnauthorized() *CreateInputPortUnauthorized {\n\treturn &CreateInputPortUnauthorized{}\n}", "func NewUnauthorized(cause error) Unauthorized { return Unauthorized(cause.Error()) }", "func NewUnauthorized(err error, msg ...string) *Errs {\n\tif err == nil {\n\t\terr = ErrUnauthorized\n\t}\n\treturn &Errs{\n\t\tcodeHTTP: http.StatusUnauthorized,\n\t\terr: err,\n\t\tkind: trace(2),\n\t\tmessage: msg,\n\t}\n}", "func NewUnauthorized() *AppError {\n\treturn NewUnauthorizedR(StatusText(Unauthenticated))\n}", "func (a *Client) CreateRbacAuthorizationV1alpha1NamespacedRoleBinding(params *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingParams) (*CreateRbacAuthorizationV1alpha1NamespacedRoleBindingOK, *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingCreated, *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateRbacAuthorizationV1alpha1NamespacedRoleBindingParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createRbacAuthorizationV1alpha1NamespacedRoleBinding\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/vnd.kubernetes.protobuf\", \"application/yaml\"},\n\t\tConsumesMediaTypes: []string{\"*/*\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateRbacAuthorizationV1alpha1NamespacedRoleBindingReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingOK:\n\t\treturn value, nil, nil, nil\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingCreated:\n\t\treturn nil, value, nil, nil\n\tcase *CreateRbacAuthorizationV1alpha1NamespacedRoleBindingAccepted:\n\t\treturn nil, nil, value, nil\n\t}\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 rbac_authorization_v1alpha1: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func NewCreateBatchV1NamespacedJobUnauthorized() *CreateBatchV1NamespacedJobUnauthorized {\n\n\treturn &CreateBatchV1NamespacedJobUnauthorized{}\n}", "func NewCreateBlueprintRequestUsingPOST1Unauthorized() *CreateBlueprintRequestUsingPOST1Unauthorized {\n\treturn &CreateBlueprintRequestUsingPOST1Unauthorized{}\n}", "func NewConnectCoreV1OptionsNamespacedPodProxyWithPathUnauthorized() *ConnectCoreV1OptionsNamespacedPodProxyWithPathUnauthorized {\n\treturn &ConnectCoreV1OptionsNamespacedPodProxyWithPathUnauthorized{}\n}", "func NewReadCoreV1NamespacedEndpointsUnauthorized() *ReadCoreV1NamespacedEndpointsUnauthorized {\n\treturn &ReadCoreV1NamespacedEndpointsUnauthorized{}\n}", "func (b *bindingTest) Podcreate(name *string) {\n\tb.PodcreateAndExpose(name, nil)\n}", "func NewUnauthorized(err error, msg string) error {\n\treturn &unauthorized{wrap(err, msg, \"\")}\n}", "func NewCreateServiceUnauthorized() *CreateServiceUnauthorized {\n\treturn &CreateServiceUnauthorized{}\n}", "func NewCreateHPCResourceUnauthorized() *CreateHPCResourceUnauthorized {\n\n\treturn &CreateHPCResourceUnauthorized{}\n}", "func NewCreateCoreV1NamespacedPodBindingCreated() *CreateCoreV1NamespacedPodBindingCreated {\n\n\treturn &CreateCoreV1NamespacedPodBindingCreated{}\n}", "func NewWeaviateThingsPatchUnauthorized() *WeaviateThingsPatchUnauthorized {\n\treturn &WeaviateThingsPatchUnauthorized{}\n}", "func NewConnectCoreV1PutNamespacedPodProxyUnauthorized() *ConnectCoreV1PutNamespacedPodProxyUnauthorized {\n\treturn &ConnectCoreV1PutNamespacedPodProxyUnauthorized{}\n}", "func NewAddUnauthorized(body Unauthorized) addersvc.Unauthorized {\n\tv := addersvc.Unauthorized(body)\n\treturn v\n}", "func NewUnauthorized(res calcsvc.Unauthorized) Unauthorized {\n\tbody := Unauthorized(res)\n\treturn body\n}", "func NewConnectCoreV1GetNamespacedServiceProxyWithPathUnauthorized() *ConnectCoreV1GetNamespacedServiceProxyWithPathUnauthorized {\n\treturn &ConnectCoreV1GetNamespacedServiceProxyWithPathUnauthorized{}\n}", "func newPod(ctx context.Context, cl client.Client, ns, name, image string, cmd []string) (*corev1.Pod, error) {\n\tc := corev1.Container{\n\t\tName: name,\n\t\tImage: image,\n\t\tCommand: cmd,\n\t}\n\tp := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: ns,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{c},\n\t\t\t// Kill the pod immediately so it exits quickly on deletion.\n\t\t\tTerminationGracePeriodSeconds: pointer.Int64Ptr(0),\n\t\t},\n\t}\n\tif err := cl.Create(ctx, p); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create pod %s/%s: %v\", p.Namespace, p.Name, err)\n\t}\n\treturn p, nil\n}", "func NewCreateApiregistrationV1beta1APIServiceUnauthorized() *CreateApiregistrationV1beta1APIServiceUnauthorized {\n\treturn &CreateApiregistrationV1beta1APIServiceUnauthorized{}\n}", "func (f *Framework) CreatePodObjectWithMandatorySecretKey(testName string) *corev1.Pod {\n\treturn f.CreatePodObjectWithEnv(testName, []corev1.EnvVar{\n\t\t{\n\t\t\tName: \"SECRET_0_KEY_0\",\n\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{Name: \"secret-0\"},\n\t\t\t\t\tKey: \"key_0\",\n\t\t\t\t\tOptional: &bFalse,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n}", "func NewPod(name string, labels labels.Set, shootVersionConstraints ...string) Pod {\n\tconstraint := \"\"\n\tif len(shootVersionConstraints) > 0 {\n\t\tconstraint = shootVersionConstraints[0]\n\t}\n\treturn Pod{name, labels, constraint, nil}\n}", "func NewCreateAutoscalingV2beta2NamespacedHorizontalPodAutoscalerUnauthorized() *CreateAutoscalingV2beta2NamespacedHorizontalPodAutoscalerUnauthorized {\n\treturn &CreateAutoscalingV2beta2NamespacedHorizontalPodAutoscalerUnauthorized{}\n}", "func NewDeleteCoreV1NamespacedConfigMapUnauthorized() *DeleteCoreV1NamespacedConfigMapUnauthorized {\n\n\treturn &DeleteCoreV1NamespacedConfigMapUnauthorized{}\n}", "func NewDeleteCoreV1NamespacedEventUnauthorized() *DeleteCoreV1NamespacedEventUnauthorized {\n\treturn &DeleteCoreV1NamespacedEventUnauthorized{}\n}", "func NewWatchApiregistrationV1APIServiceUnauthorized() *WatchApiregistrationV1APIServiceUnauthorized {\n\n\treturn &WatchApiregistrationV1APIServiceUnauthorized{}\n}", "func (client *LROSADsClient) post202NoLocationCreateRequest(ctx context.Context, options *LROSADsClientBeginPost202NoLocationOptions) (*policy.Request, error) {\n\turlPath := \"/lro/error/post/202/nolocation\"\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\tif options != nil && options.Product != nil {\n\t\tif err := runtime.MarshalAsJSON(req, *options.Product); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn req, nil\n\t}\n\treturn req, nil\n}", "func NewUnauthorizedR(reason string) *AppError {\n\treturn NewError(Unauthenticated, \"\", reason)\n}", "func (c *Config) createUnassignedPodLW() *cache.ListWatch {\n\tselector := fields.ParseSelectorOrDie(\"spec.nodeName==\" + \"\" + \",status.phase!=\" + string(api.PodSucceeded) + \",status.phase!=\" + string(api.PodFailed))\n\n\treturn cache.NewListWatchFromClient(c.Client, \"pods\", api.NamespaceAll, selector)\n}", "func NewThingsDeleteUnauthorized() *ThingsDeleteUnauthorized {\n\n\treturn &ThingsDeleteUnauthorized{}\n}", "func NewPatchEventsV1NamespacedEventUnauthorized() *PatchEventsV1NamespacedEventUnauthorized {\n\treturn &PatchEventsV1NamespacedEventUnauthorized{}\n}", "func (client *LROSADsClient) post202RetryInvalidHeaderCreateRequest(ctx context.Context, options *LROSADsClientBeginPost202RetryInvalidHeaderOptions) (*policy.Request, error) {\n\turlPath := \"/lro/error/post/202/retry/invalidheader\"\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\tif options != nil && options.Product != nil {\n\t\tif err := runtime.MarshalAsJSON(req, *options.Product); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn req, nil\n\t}\n\treturn req, nil\n}", "func NewDeleteLibraryAPIVersionUnauthorized() *DeleteLibraryAPIVersionUnauthorized {\n\treturn &DeleteLibraryAPIVersionUnauthorized{}\n}", "func NewServiceAddUnauthorized() *ServiceAddUnauthorized {\n\n\treturn &ServiceAddUnauthorized{}\n}", "func NewBindHostUnauthorized() *BindHostUnauthorized {\n\treturn &BindHostUnauthorized{}\n}", "func NewReplaceExtensionsV1beta1NamespacedIngressUnauthorized() *ReplaceExtensionsV1beta1NamespacedIngressUnauthorized {\n\n\treturn &ReplaceExtensionsV1beta1NamespacedIngressUnauthorized{}\n}", "func NewWeaviateSchemaThingsPropertiesAddUnauthorized() *WeaviateSchemaThingsPropertiesAddUnauthorized {\n\treturn &WeaviateSchemaThingsPropertiesAddUnauthorized{}\n}", "func Create(input CreateInput) *corev1.Pod {\n\tExpect(input.Creator).NotTo(BeNil(), \"input.Creator is required for Pod.Create\")\n\tExpect(input.Config).NotTo(BeNil(), \"input.Config is required for Pod.Create\")\n\tExpect(input.Name).NotTo(BeEmpty(), \"input.Name is required for Pod.Create\")\n\tExpect(input.Namespace).NotTo(BeEmpty(), \"input.Namespace is required for Pod.Create\")\n\tExpect(input.SecretProviderClassName).NotTo(BeEmpty(), \"input.SecretProviderClassName is required for Pod.Create\")\n\n\tBy(fmt.Sprintf(\"Creating Pod \\\"%s\\\"\", input.Name))\n\n\treadOnly := true\n\tpod := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: input.Name,\n\t\t\tNamespace: input.Namespace,\n\t\t\tLabels: input.Labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tTerminationGracePeriodSeconds: to.Int64Ptr(int64(0)),\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"tester\",\n\t\t\t\t\tImage: \"registry.k8s.io/e2e-test-images/busybox:1.29-4\",\n\t\t\t\t\tImagePullPolicy: corev1.PullIfNotPresent,\n\t\t\t\t\tCommand: []string{\"/bin/sleep\", \"10000\"},\n\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"secrets-store-inline\",\n\t\t\t\t\t\t\tMountPath: \"/mnt/secrets-store\",\n\t\t\t\t\t\t\tReadOnly: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tVolumes: []corev1.Volume{\n\t\t\t\t{\n\t\t\t\t\tName: \"secrets-store-inline\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tCSI: &corev1.CSIVolumeSource{\n\t\t\t\t\t\t\tDriver: \"secrets-store.csi.k8s.io\",\n\t\t\t\t\t\t\tReadOnly: &readOnly,\n\t\t\t\t\t\t\tVolumeAttributes: map[string]string{\"secretProviderClass\": input.SecretProviderClassName},\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\tif input.NodePublishSecretRefName != \"\" {\n\t\tfor idx := range pod.Spec.Volumes {\n\t\t\tpod.Spec.Volumes[idx].CSI.NodePublishSecretRef = &corev1.LocalObjectReference{Name: input.NodePublishSecretRefName}\n\t\t}\n\t}\n\n\tif input.Config.IsWindowsTest {\n\t\tpod.Spec.NodeSelector = map[string]string{\"kubernetes.io/os\": \"windows\"}\n\t} else if input.Config.IsGPUTest {\n\t\tpod.Spec.NodeSelector = map[string]string{\n\t\t\t\"kubernetes.io/os\": \"linux\",\n\t\t\t\"accelerator\": \"nvidia\",\n\t\t}\n\t} else {\n\t\tpod.Spec.NodeSelector = map[string]string{\"kubernetes.io/os\": \"linux\"}\n\t}\n\n\tif input.ServiceAccountName != \"\" {\n\t\tpod.Spec.ServiceAccountName = input.ServiceAccountName\n\t}\n\n\tExpect(input.Creator.Create(context.TODO(), pod)).Should(Succeed())\n\treturn pod\n}", "func (b *bindingTest) PodcreateAndExpose(name *string, port *string) {\n\tcommand := []string{\"pod\", \"create\"}\n\tif name != nil {\n\t\tpodname := *name\n\t\tcommand = append(command, \"--name\", podname)\n\t}\n\tif port != nil {\n\t\tpodport := *port\n\t\tcommand = append(command, \"--publish\", podport)\n\t}\n\tb.runPodman(command).Wait(45)\n}", "func NewObjectsPatchUnauthorized() *ObjectsPatchUnauthorized {\n\n\treturn &ObjectsPatchUnauthorized{}\n}", "func NewDeleteLibraryUnauthorized() *DeleteLibraryUnauthorized {\n\treturn &DeleteLibraryUnauthorized{}\n}", "func makePodTemplate(bind *v1alpha1.Bind, namespace string, serviceAccountName string, podName string, spec *v1alpha1.EventSourceSpec, op BindOperation, trigger EventTrigger, route string, bindContext BindContext) (*corev1.PodTemplateSpec, error) {\n\tmarshalledBindContext, err := json.Marshal(bindContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencodedBindContext := base64.StdEncoding.EncodeToString(marshalledBindContext)\n\n\tmarshalledTrigger, err := json.Marshal(trigger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencodedTrigger := base64.StdEncoding.EncodeToString(marshalledTrigger)\n\n\tencodedParameters := \"\"\n\tif spec.Parameters != nil {\n\t\tmarshalledParameters, err := json.Marshal(spec.Parameters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tencodedParameters = base64.StdEncoding.EncodeToString(marshalledParameters)\n\t}\n\n\treturn &corev1.PodTemplateSpec{\n\t\tSpec: corev1.PodSpec{\n\t\t\tServiceAccountName: serviceAccountName,\n\t\t\tRestartPolicy: corev1.RestartPolicyNever,\n\t\t\tContainers: []corev1.Container{\n\t\t\t\tcorev1.Container{\n\t\t\t\t\tName: podName,\n\t\t\t\t\tImage: spec.Image,\n\t\t\t\t\tImagePullPolicy: \"Always\",\n\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindOperationKey,\n\t\t\t\t\t\t\tValue: string(op),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindTargetKey,\n\t\t\t\t\t\t\tValue: route,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindTriggerKey,\n\t\t\t\t\t\t\tValue: encodedTrigger,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: BindContextKey,\n\t\t\t\t\t\t\tValue: encodedBindContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: EventSourceParametersKey,\n\t\t\t\t\t\t\tValue: encodedParameters,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, nil\n}", "func NewDeleteScopeUnauthorized() *DeleteScopeUnauthorized {\n\treturn &DeleteScopeUnauthorized{}\n}", "func NewWatchSettingsV1alpha1NamespacedPodPresetUnauthorized() *WatchSettingsV1alpha1NamespacedPodPresetUnauthorized {\n\treturn &WatchSettingsV1alpha1NamespacedPodPresetUnauthorized{}\n}", "func (o *CreateCoreV1NamespacedPodBindingCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\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}", "func NewReadAppsV1NamespacedDeploymentUnauthorized() *ReadAppsV1NamespacedDeploymentUnauthorized {\n\treturn &ReadAppsV1NamespacedDeploymentUnauthorized{}\n}", "func genpod(namespace, name, image string) *corev1.Pod {\n\tvar userID int64 = 65534\n\n\treturn &corev1.Pod{\n\t\tMetadata: &metav1.ObjectMeta{\n\t\t\tName: k8s.String(name),\n\t\t\tNamespace: k8s.String(namespace),\n\t\t\tLabels: map[string]string{\"generator\": \"kboom\"},\n\t\t},\n\t\tSpec: &corev1.PodSpec{\n\t\t\tContainers: []*corev1.Container{\n\t\t\t\t&corev1.Container{\n\t\t\t\t\tName: k8s.String(\"main\"),\n\t\t\t\t\tImage: k8s.String(image),\n\t\t\t\t\tCommand: []string{\"/bin/sh\", \"-ec\", \"sleep 3600\"},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tRunAsUser: &userID,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func NewCreatePackageUnauthorized() *CreatePackageUnauthorized {\n\treturn &CreatePackageUnauthorized{}\n}", "func NewListCoreV1NamespacedConfigMapUnauthorized() *ListCoreV1NamespacedConfigMapUnauthorized {\n\treturn &ListCoreV1NamespacedConfigMapUnauthorized{}\n}", "func NewCreateAppsV1NamespacedControllerRevisionUnauthorized() *CreateAppsV1NamespacedControllerRevisionUnauthorized {\n\treturn &CreateAppsV1NamespacedControllerRevisionUnauthorized{}\n}", "func NewJudgeUnauthorized() *JudgeUnauthorized {\n\treturn &JudgeUnauthorized{}\n}", "func NewDeleteAPIUnauthorized() *DeleteAPIUnauthorized {\n\treturn &DeleteAPIUnauthorized{}\n}", "func NewCreateCoreV1NamespacedPodOK() *CreateCoreV1NamespacedPodOK {\n\treturn &CreateCoreV1NamespacedPodOK{}\n}", "func (t DefaultBuildManager) CreatePod(pod *k8sapi.Pod) error {\n\t_, err := t.kubernetesClient.Pods(\"decap\").Create(pod)\n\treturn err\n}", "func NewCreateCoreV1NamespacedPodBindingAccepted() *CreateCoreV1NamespacedPodBindingAccepted {\n\n\treturn &CreateCoreV1NamespacedPodBindingAccepted{}\n}", "func newPod(name string) *corev1.Pod {\n\treturn &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{},\n\t\tObjectMeta: metav1.ObjectMeta{Name: name},\n\t\tSpec: corev1.PodSpec{},\n\t\tStatus: corev1.PodStatus{},\n\t}\n}", "func (f *Framework) CreatePodObjectWithOptionalSecretKey(testName string) *corev1.Pod {\n\treturn f.CreatePodObjectWithEnv(testName, []corev1.EnvVar{\n\t\t{\n\t\t\tName: \"SECRET_0_KEY_0\",\n\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{Name: \"secret-0\"},\n\t\t\t\t\tKey: \"key_0\",\n\t\t\t\t\tOptional: &bTrue,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n}", "func (pc *BasicECSPodCreator) CreatePodFromExistingDefinition(ctx context.Context, def cocoa.ECSTaskDefinition, opts ...cocoa.ECSPodExecutionOptions) (cocoa.ECSPod, error) {\n\treturn nil, errors.New(\"TODO: implement\")\n}", "func createIstioCARoleBinding(clientset kubernetes.Interface, namespace string) error {\n\trolebinding := rbac.RoleBinding{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"rbac.authorization.k8s.io/v1beta1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"istio-ca-role-binding\",\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSubjects: []rbac.Subject{\n\t\t\t{\n\t\t\t\tKind: \"ServiceAccount\",\n\t\t\t\tName: \"default\",\n\t\t\t\tNamespace: namespace,\n\t\t\t},\n\t\t},\n\t\tRoleRef: rbac.RoleRef{\n\t\t\tKind: \"Role\",\n\t\t\tName: \"istio-ca-role\",\n\t\t\tAPIGroup: \"rbac.authorization.k8s.io\",\n\t\t},\n\t}\n\t_, err := clientset.RbacV1beta1().RoleBindings(namespace).Create(&rolebinding)\n\treturn err\n}", "func NewCreateCompanyUnauthorized(body *CreateCompanyUnauthorizedResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func (o *DeleteCoreV1NamespacedPodUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(401)\n}", "func NewPodHandler(r *mux.Router, mw middleware.Middleware, state *state.State) {\n\n\tctx := logger.NewContext(context.Background(), nil)\n\tlog := logger.WithContext(ctx)\n\n\tlog.Infof(\"%s:> init pod routes\", logPrefix)\n\n\thandler := &Handler{\n\t\tstate: state,\n\t}\n\n\tr.Handle(\"/pod/{pod}\", h.Handle(mw.Authenticate(handler.PodGetH))).Methods(http.MethodGet)\n\tr.Handle(\"/pod/{pod}/{container}/logs\", h.Handle(mw.Authenticate(handler.PodLogsH))).Methods(http.MethodGet)\n}", "func NewAuthorizationHeader(clientID, secret string) string {\n\treturn \"Basic \" + base64.StdEncoding.EncodeToString([]byte(clientID+\":\"+secret))\n}", "func createAuthorization(roleRef, userRef string) string {\n\treturn fmt.Sprintf(`{\n \"type\": \"Authorization\",\n \"user\": \"%s\",\n \"role\": \"%s\",\n \"target\": \"%s\"\n}`, userRef, roleRef, userRef)\n}", "func createPod(session *gexec.Session, webhookName string) {\n\tpodYamlAbsPath, err := filepath.Abs(filepath.Join(podYamlRelPath))\n\tExpect(err).NotTo(HaveOccurred())\n\n\tpod, err := kubeClient.CreatePod(podYamlAbsPath)\n\tEventually(session.Err, defaultTimeout).Should(gbytes.Say(\"handle: validating webhook request\"))\n\tExpect(err).NotTo(HaveOccurred())\n\tExpect(pod).NotTo(BeNil())\n\n\t// delete pod\n\terr = kubeClient.DeletePod(pod.GetName())\n\tExpect(err).NotTo(HaveOccurred())\n\n\t// delete validating webhook configuration\n\terr = kubeClient.DeleteValidatingWebhookConfiguration(webhookName)\n\tExpect(err).NotTo(HaveOccurred())\n\n\tif utils.IsWindowsPlatform() {\n\t\tsession.Kill()\n\t} else {\n\t\tsession.Terminate()\n\t}\n}", "func NewAddAPIUnauthorized() *AddAPIUnauthorized {\n\treturn &AddAPIUnauthorized{}\n}", "func NewGetVariableRegistryUpdateRequestUnauthorized() *GetVariableRegistryUpdateRequestUnauthorized {\n\treturn &GetVariableRegistryUpdateRequestUnauthorized{}\n}", "func NewDeleteCapabilityUnauthorized() *DeleteCapabilityUnauthorized {\n\treturn &DeleteCapabilityUnauthorized{}\n}", "func NewCreateDataCenterUsingPOSTUnauthorized() *CreateDataCenterUsingPOSTUnauthorized {\n\treturn &CreateDataCenterUsingPOSTUnauthorized{}\n}", "func createPod(clientset kubernetes.Interface, namespace string, image string, name string,\n\tlabels map[string]string, command []string, args []string) (*v1.Pod, error) {\n\tenv := []v1.EnvVar{\n\t\t{\n\t\t\tName: \"NAMESPACE\",\n\t\t\tValueFrom: &v1.EnvVarSource{\n\t\t\t\tFieldRef: &v1.ObjectFieldSelector{\n\t\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\t\tFieldPath: \"metadata.namespace\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tspec := v1.PodSpec{\n\t\tContainers: []v1.Container{\n\t\t\t{\n\t\t\t\tEnv: env,\n\t\t\t\tName: fmt.Sprintf(\"%v-pod-container\", name),\n\t\t\t\tImage: image,\n\t\t\t},\n\t\t},\n\t}\n\n\tif len(command) > 0 {\n\t\tspec.Containers[0].Command = command\n\t\tif len(args) > 0 {\n\t\t\tspec.Containers[0].Args = args\n\t\t}\n\t}\n\n\tpod := &v1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tLabels: labels,\n\t\t\tName: name,\n\t\t},\n\t\tSpec: spec,\n\t}\n\n\tif _, err := clientset.CoreV1().Pods(namespace).Create(pod); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn clientset.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})\n}", "func SetupSecret(certDir, namespace string) error {\n\t// generate the certificate to use when registering and serving the webhook\n\tsvc := fmt.Sprintf(\"%s.%s.svc\", serviceName, namespace)\n\tnow := time.Now()\n\tcrt := x509.Certificate{\n\t\tSubject: pkix.Name{CommonName: svc},\n\t\tNotBefore: now,\n\t\tNotAfter: now.Add(365 * 24 * time.Hour),\n\t\tSerialNumber: big.NewInt(now.Unix()),\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tIsCA: true,\n\t\tBasicConstraintsValid: true,\n\t\tDNSNames: []string{svc},\n\t}\n\t// generate the private key to use when registering and serving the webhook\n\tkey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// pem-encode the private key\n\tkeyBytes := pem.EncodeToMemory(&pem.Block{\n\t\tType: keyutil.RSAPrivateKeyBlockType,\n\t\tBytes: x509.MarshalPKCS1PrivateKey(key),\n\t})\n\t// self-sign the generated certificate using the private key\n\tsig, err := x509.CreateCertificate(rand.Reader, &crt, &crt, key.Public(), key)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// pem-encode the signed certificate\n\tsigBytes := pem.EncodeToMemory(&pem.Block{\n\t\tType: cert.CertificateBlockType,\n\t\tBytes: sig,\n\t})\n\n\tcertFileName := filepath.Join(certDir, v1.TLSCertKey)\n\tkeyFileName := filepath.Join(certDir, v1.TLSPrivateKeyKey)\n\n\tos.MkdirAll(filepath.Dir(certFileName), os.FileMode(0777))\n\terr = ioutil.WriteFile(certFileName, sigBytes, os.FileMode(0777))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tos.MkdirAll(filepath.Dir(keyFileName), os.FileMode(0777))\n\terr = ioutil.WriteFile(keyFileName, keyBytes, os.FileMode(0777))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func resourceVolterraK8SPodSecurityPolicyCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_k8s_pod_security_policy.CreateSpecType{}\n\tcreateReq := &ves_io_schema_k8s_pod_security_policy.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\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\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.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\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//config_method_choice\n\n\tconfigMethodChoiceTypeFound := false\n\n\tif v, ok := d.GetOk(\"psp_spec\"); ok && !configMethodChoiceTypeFound {\n\n\t\tconfigMethodChoiceTypeFound = true\n\t\tconfigMethodChoiceInt := &ves_io_schema_k8s_pod_security_policy.CreateSpecType_PspSpec{}\n\t\tconfigMethodChoiceInt.PspSpec = &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType{}\n\t\tcreateSpec.ConfigMethodChoice = configMethodChoiceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"allow_privilege_escalation\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowPrivilegeEscalation = v.(bool)\n\n\t\t\t}\n\n\t\t\tallowedCapabilitiesChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"allowed_capabilities\"]; ok && !isIntfNil(v) && !allowedCapabilitiesChoiceTypeFound {\n\n\t\t\t\tallowedCapabilitiesChoiceTypeFound = true\n\t\t\t\tallowedCapabilitiesChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_AllowedCapabilities{}\n\t\t\t\tallowedCapabilitiesChoiceInt.AllowedCapabilities = &ves_io_schema_k8s_pod_security_policy.CapabilityListType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedCapabilitiesChoice = allowedCapabilitiesChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"capabilities\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tallowedCapabilitiesChoiceInt.AllowedCapabilities.Capabilities = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"no_allowed_capabilities\"]; ok && !isIntfNil(v) && !allowedCapabilitiesChoiceTypeFound {\n\n\t\t\t\tallowedCapabilitiesChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tallowedCapabilitiesChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoAllowedCapabilities{}\n\t\t\t\t\tallowedCapabilitiesChoiceInt.NoAllowedCapabilities = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedCapabilitiesChoice = allowedCapabilitiesChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"allowed_csi_drivers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedCsiDrivers = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"allowed_flex_volumes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedFlexVolumes = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"allowed_host_paths\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tallowedHostPaths := make([]*ves_io_schema_k8s_pod_security_policy.HostPathType, len(sl))\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedHostPaths = allowedHostPaths\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tallowedHostPaths[i] = &ves_io_schema_k8s_pod_security_policy.HostPathType{}\n\t\t\t\t\tallowedHostPathsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := allowedHostPathsMapStrToI[\"path_prefix\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tallowedHostPaths[i].PathPrefix = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := allowedHostPathsMapStrToI[\"read_only\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tallowedHostPaths[i].ReadOnly = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"allowed_proc_mounts\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedProcMounts = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"allowed_unsafe_sysctls\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.AllowedUnsafeSysctls = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"default_allow_privilege_escalation\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.DefaultAllowPrivilegeEscalation = v.(bool)\n\n\t\t\t}\n\n\t\t\tdefaultCapabilitiesChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"default_capabilities\"]; ok && !isIntfNil(v) && !defaultCapabilitiesChoiceTypeFound {\n\n\t\t\t\tdefaultCapabilitiesChoiceTypeFound = true\n\t\t\t\tdefaultCapabilitiesChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_DefaultCapabilities{}\n\t\t\t\tdefaultCapabilitiesChoiceInt.DefaultCapabilities = &ves_io_schema_k8s_pod_security_policy.CapabilityListType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.DefaultCapabilitiesChoice = defaultCapabilitiesChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"capabilities\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefaultCapabilitiesChoiceInt.DefaultCapabilities.Capabilities = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"no_default_capabilities\"]; ok && !isIntfNil(v) && !defaultCapabilitiesChoiceTypeFound {\n\n\t\t\t\tdefaultCapabilitiesChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tdefaultCapabilitiesChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoDefaultCapabilities{}\n\t\t\t\t\tdefaultCapabilitiesChoiceInt.NoDefaultCapabilities = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.DefaultCapabilitiesChoice = defaultCapabilitiesChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdropCapabilitiesChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"drop_capabilities\"]; ok && !isIntfNil(v) && !dropCapabilitiesChoiceTypeFound {\n\n\t\t\t\tdropCapabilitiesChoiceTypeFound = true\n\t\t\t\tdropCapabilitiesChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_DropCapabilities{}\n\t\t\t\tdropCapabilitiesChoiceInt.DropCapabilities = &ves_io_schema_k8s_pod_security_policy.CapabilityListType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.DropCapabilitiesChoice = dropCapabilitiesChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"capabilities\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdropCapabilitiesChoiceInt.DropCapabilities.Capabilities = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"no_drop_capabilities\"]; ok && !isIntfNil(v) && !dropCapabilitiesChoiceTypeFound {\n\n\t\t\t\tdropCapabilitiesChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tdropCapabilitiesChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoDropCapabilities{}\n\t\t\t\t\tdropCapabilitiesChoiceInt.NoDropCapabilities = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.DropCapabilitiesChoice = dropCapabilitiesChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"forbidden_sysctls\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.ForbiddenSysctls = ls\n\n\t\t\t}\n\n\t\t\tfsGroupChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"fs_group_strategy_options\"]; ok && !isIntfNil(v) && !fsGroupChoiceTypeFound {\n\n\t\t\t\tfsGroupChoiceTypeFound = true\n\t\t\t\tfsGroupChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_FsGroupStrategyOptions{}\n\t\t\t\tfsGroupChoiceInt.FsGroupStrategyOptions = &ves_io_schema_k8s_pod_security_policy.IDStrategyOptionsType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.FsGroupChoice = fsGroupChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"id_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tidRanges := make([]*ves_io_schema_k8s_pod_security_policy.IDRangeType, len(sl))\n\t\t\t\t\t\tfsGroupChoiceInt.FsGroupStrategyOptions.IdRanges = idRanges\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tidRanges[i] = &ves_io_schema_k8s_pod_security_policy.IDRangeType{}\n\t\t\t\t\t\t\tidRangesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"max_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MaxId = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"min_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MinId = uint32(w.(int))\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 := cs[\"rule\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tfsGroupChoiceInt.FsGroupStrategyOptions.Rule = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"no_fs_groups\"]; ok && !isIntfNil(v) && !fsGroupChoiceTypeFound {\n\n\t\t\t\tfsGroupChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tfsGroupChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoFsGroups{}\n\t\t\t\t\tfsGroupChoiceInt.NoFsGroups = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.FsGroupChoice = fsGroupChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgroupChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"no_run_as_group\"]; ok && !isIntfNil(v) && !groupChoiceTypeFound {\n\n\t\t\t\tgroupChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tgroupChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoRunAsGroup{}\n\t\t\t\t\tgroupChoiceInt.NoRunAsGroup = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.GroupChoice = groupChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"run_as_group\"]; ok && !isIntfNil(v) && !groupChoiceTypeFound {\n\n\t\t\t\tgroupChoiceTypeFound = true\n\t\t\t\tgroupChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_RunAsGroup{}\n\t\t\t\tgroupChoiceInt.RunAsGroup = &ves_io_schema_k8s_pod_security_policy.IDStrategyOptionsType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.GroupChoice = groupChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"id_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tidRanges := make([]*ves_io_schema_k8s_pod_security_policy.IDRangeType, len(sl))\n\t\t\t\t\t\tgroupChoiceInt.RunAsGroup.IdRanges = idRanges\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tidRanges[i] = &ves_io_schema_k8s_pod_security_policy.IDRangeType{}\n\t\t\t\t\t\t\tidRangesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"max_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MaxId = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"min_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MinId = uint32(w.(int))\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 := cs[\"rule\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tgroupChoiceInt.RunAsGroup.Rule = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"host_ipc\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.HostIpc = v.(bool)\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"host_network\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.HostNetwork = v.(bool)\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"host_pid\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.HostPid = v.(bool)\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"host_port_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.HostPortRanges = v.(string)\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"privileged\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.Privileged = v.(bool)\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"read_only_root_filesystem\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tconfigMethodChoiceInt.PspSpec.ReadOnlyRootFilesystem = v.(bool)\n\n\t\t\t}\n\n\t\t\truntimeClassChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"no_runtime_class\"]; ok && !isIntfNil(v) && !runtimeClassChoiceTypeFound {\n\n\t\t\t\truntimeClassChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\truntimeClassChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoRuntimeClass{}\n\t\t\t\t\truntimeClassChoiceInt.NoRuntimeClass = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.RuntimeClassChoice = runtimeClassChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"runtime_class\"]; ok && !isIntfNil(v) && !runtimeClassChoiceTypeFound {\n\n\t\t\t\truntimeClassChoiceTypeFound = true\n\t\t\t\truntimeClassChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_RuntimeClass{}\n\t\t\t\truntimeClassChoiceInt.RuntimeClass = &ves_io_schema_k8s_pod_security_policy.RuntimeClassStrategyOptions{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.RuntimeClassChoice = runtimeClassChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"allowed_runtime_class_names\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\truntimeClassChoiceInt.RuntimeClass.AllowedRuntimeClassNames = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"default_runtime_class_name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\truntimeClassChoiceInt.RuntimeClass.DefaultRuntimeClassName = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tseLinuxChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"no_se_linux_options\"]; ok && !isIntfNil(v) && !seLinuxChoiceTypeFound {\n\n\t\t\t\tseLinuxChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tseLinuxChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoSeLinuxOptions{}\n\t\t\t\t\tseLinuxChoiceInt.NoSeLinuxOptions = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.SeLinuxChoice = seLinuxChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"se_linux_options\"]; ok && !isIntfNil(v) && !seLinuxChoiceTypeFound {\n\n\t\t\t\tseLinuxChoiceTypeFound = true\n\t\t\t\tseLinuxChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_SeLinuxOptions{}\n\t\t\t\tseLinuxChoiceInt.SeLinuxOptions = &ves_io_schema_k8s_pod_security_policy.SELinuxStrategyOptions{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.SeLinuxChoice = seLinuxChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"level\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tseLinuxChoiceInt.SeLinuxOptions.Level = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"role\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tseLinuxChoiceInt.SeLinuxOptions.Role = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"rule\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tseLinuxChoiceInt.SeLinuxOptions.Rule = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tseLinuxChoiceInt.SeLinuxOptions.Type = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"user\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tseLinuxChoiceInt.SeLinuxOptions.User = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tsupplementalGroupChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"no_supplemental_groups\"]; ok && !isIntfNil(v) && !supplementalGroupChoiceTypeFound {\n\n\t\t\t\tsupplementalGroupChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tsupplementalGroupChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoSupplementalGroups{}\n\t\t\t\t\tsupplementalGroupChoiceInt.NoSupplementalGroups = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.SupplementalGroupChoice = supplementalGroupChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"supplemental_groups\"]; ok && !isIntfNil(v) && !supplementalGroupChoiceTypeFound {\n\n\t\t\t\tsupplementalGroupChoiceTypeFound = true\n\t\t\t\tsupplementalGroupChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_SupplementalGroups{}\n\t\t\t\tsupplementalGroupChoiceInt.SupplementalGroups = &ves_io_schema_k8s_pod_security_policy.IDStrategyOptionsType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.SupplementalGroupChoice = supplementalGroupChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"id_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tidRanges := make([]*ves_io_schema_k8s_pod_security_policy.IDRangeType, len(sl))\n\t\t\t\t\t\tsupplementalGroupChoiceInt.SupplementalGroups.IdRanges = idRanges\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tidRanges[i] = &ves_io_schema_k8s_pod_security_policy.IDRangeType{}\n\t\t\t\t\t\t\tidRangesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"max_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MaxId = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"min_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MinId = uint32(w.(int))\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 := cs[\"rule\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsupplementalGroupChoiceInt.SupplementalGroups.Rule = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tuserChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"no_run_as_user\"]; ok && !isIntfNil(v) && !userChoiceTypeFound {\n\n\t\t\t\tuserChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tuserChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_NoRunAsUser{}\n\t\t\t\t\tuserChoiceInt.NoRunAsUser = &ves_io_schema.Empty{}\n\t\t\t\t\tconfigMethodChoiceInt.PspSpec.UserChoice = userChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"run_as_user\"]; ok && !isIntfNil(v) && !userChoiceTypeFound {\n\n\t\t\t\tuserChoiceTypeFound = true\n\t\t\t\tuserChoiceInt := &ves_io_schema_k8s_pod_security_policy.PodSecurityPolicySpecType_RunAsUser{}\n\t\t\t\tuserChoiceInt.RunAsUser = &ves_io_schema_k8s_pod_security_policy.IDStrategyOptionsType{}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.UserChoice = userChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"id_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tidRanges := make([]*ves_io_schema_k8s_pod_security_policy.IDRangeType, len(sl))\n\t\t\t\t\t\tuserChoiceInt.RunAsUser.IdRanges = idRanges\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tidRanges[i] = &ves_io_schema_k8s_pod_security_policy.IDRangeType{}\n\t\t\t\t\t\t\tidRangesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"max_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MaxId = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := idRangesMapStrToI[\"min_id\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tidRanges[i].MinId = uint32(w.(int))\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 := cs[\"rule\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tuserChoiceInt.RunAsUser.Rule = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"volumes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tconfigMethodChoiceInt.PspSpec.Volumes = ls\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"yaml\"); ok && !configMethodChoiceTypeFound {\n\n\t\tconfigMethodChoiceTypeFound = true\n\t\tconfigMethodChoiceInt := &ves_io_schema_k8s_pod_security_policy.CreateSpecType_Yaml{}\n\n\t\tcreateSpec.ConfigMethodChoice = configMethodChoiceInt\n\n\t\tconfigMethodChoiceInt.Yaml = v.(string)\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra K8SPodSecurityPolicy object with struct: %+v\", createReq)\n\n\tcreateK8SPodSecurityPolicyResp, err := client.CreateObject(context.Background(), ves_io_schema_k8s_pod_security_policy.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating K8SPodSecurityPolicy: %s\", err)\n\t}\n\td.SetId(createK8SPodSecurityPolicyResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraK8SPodSecurityPolicyRead(d, meta)\n}", "func NewUpdateBugfieldTemplateGroupUnauthorized() *UpdateBugfieldTemplateGroupUnauthorized {\n\treturn &UpdateBugfieldTemplateGroupUnauthorized{}\n}", "func NewDeleteVirtualCircuitUnauthorized() *DeleteVirtualCircuitUnauthorized {\n\treturn &DeleteVirtualCircuitUnauthorized{}\n}", "func NewPod(namespace, name, nodeName string, opts *NewPodOptions) *corev1.Pod {\n\tpod := &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{},\n\t\t\tAnnotations: map[string]string{},\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tNodeName: nodeName,\n\t\t\tAffinity: &corev1.Affinity{},\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: name,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif opts != nil {\n\t\tpod.CreationTimestamp = opts.CreationTimestamp\n\n\t\tpod.Spec.Containers[0].Resources = opts.Resources\n\n\t\tif opts.Annotations != nil {\n\t\t\tfor key, value := range opts.Annotations {\n\t\t\t\tpod.Annotations[key] = value\n\t\t\t}\n\t\t}\n\t\tif opts.Labels != nil {\n\t\t\tfor key, value := range opts.Labels {\n\t\t\t\tpod.Labels[key] = value\n\t\t\t}\n\t\t}\n\t\tif opts.NodeSelector != nil {\n\t\t\tpod.Spec.NodeSelector = map[string]string{}\n\t\t\tfor key, value := range opts.NodeSelector {\n\t\t\t\tpod.Spec.NodeSelector[key] = value\n\t\t\t}\n\t\t}\n\t\tpod.Status.Phase = opts.Phase\n\t\tpod.Status.Reason = opts.Reason\n\t\tpod.Status.ContainerStatuses = opts.ContainerStatuses\n\t\tpod.Spec.Tolerations = append(pod.Spec.Tolerations, opts.Tolerations...)\n\t\tpod.Spec.Affinity = &opts.Affinity\n\t}\n\n\tif nodeName != \"\" {\n\t\tutilaffinity.ReplaceNodeNameNodeAffinity(pod.Spec.Affinity, nodeName)\n\t}\n\n\treturn pod\n}", "func NewCreateUnauthorized() *CreateUnauthorized {\n\treturn &CreateUnauthorized{}\n}", "func newPodForPolicy(name, ns string, node *corev1.Node) *corev1.Pod {\n\tlabels := map[string]string{\n\t\t\"appName\": name,\n\t\t\"appNamespace\": ns,\n\t}\n\ttrueVal := true\n\thostVolTypeDir := corev1.HostPathDirectory\n\treturn &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: GetInstallerPodName(name, ns, node),\n\t\t\tNamespace: config.GetOperatorNamespace(),\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"policy-installer\",\n\t\t\t\t\t// TODO(jaosorior): Add udica image or equivalent to a\n\t\t\t\t\t// more formal registry\n\t\t\t\t\tImage: \"quay.io/jaosorior/udica\",\n\t\t\t\t\tCommand: []string{\"/bin/sh\"},\n\t\t\t\t\tArgs: []string{\"-c\", \"semodule -vi /tmp/policy/*.cil /usr/share/udica/templates/*cil;\"},\n\t\t\t\t\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tPrivileged: &trueVal,\n\t\t\t\t\t},\n\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"fsselinux\",\n\t\t\t\t\t\t\tMountPath: \"/sys/fs/selinux\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"etcselinux\",\n\t\t\t\t\t\t\tMountPath: \"/etc/selinux\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"varlibselinux\",\n\t\t\t\t\t\t\tMountPath: \"/var/lib/selinux\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"policyvolume\",\n\t\t\t\t\t\t\tMountPath: \"/tmp/policy\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// This container needs to keep running so we can run the uninstall script.\n\t\t\t\t{\n\t\t\t\t\tName: \"policy-uninstaller\",\n\t\t\t\t\t// NOTE(jaosorior): Add udica image or equivalent to a\n\t\t\t\t\t// more formal registry\n\t\t\t\t\tImage: \"quay.io/jaosorior/udica\",\n\t\t\t\t\tCommand: []string{\"/bin/sh\"},\n\t\t\t\t\tArgs: []string{\"-c\", \"trap 'exit 0' SIGINT SIGTERM; while true; do sleep infinity; done;\"},\n\t\t\t\t\tLifecycle: &corev1.Lifecycle{\n\t\t\t\t\t\tPreStop: &corev1.Handler{\n\t\t\t\t\t\t\tExec: &corev1.ExecAction{\n\t\t\t\t\t\t\t\tCommand: []string{\"/bin/sh\", \"-c\", fmt.Sprintf(\"semodule -vr '%s'\", GetPolicyName(name, ns))},\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\tSecurityContext: &corev1.SecurityContext{\n\t\t\t\t\t\tPrivileged: &trueVal,\n\t\t\t\t\t},\n\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"fsselinux\",\n\t\t\t\t\t\t\tMountPath: \"/sys/fs/selinux\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"etcselinux\",\n\t\t\t\t\t\t\tMountPath: \"/etc/selinux\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"varlibselinux\",\n\t\t\t\t\t\t\tMountPath: \"/var/lib/selinux\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"policyvolume\",\n\t\t\t\t\t\t\tMountPath: \"/tmp/policy\",\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\t// NOTE(jaosorior): use another service account\n\t\t\tServiceAccountName: \"security-profiles-operator\",\n\t\t\tRestartPolicy: corev1.RestartPolicyNever,\n\t\t\tNodeName: node.Name,\n\t\t\tVolumes: []corev1.Volume{\n\t\t\t\t{\n\t\t\t\t\tName: \"fsselinux\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tHostPath: &corev1.HostPathVolumeSource{\n\t\t\t\t\t\t\tPath: \"/sys/fs/selinux\",\n\t\t\t\t\t\t\tType: &hostVolTypeDir,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"etcselinux\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tHostPath: &corev1.HostPathVolumeSource{\n\t\t\t\t\t\t\tPath: \"/etc/selinux\",\n\t\t\t\t\t\t\tType: &hostVolTypeDir,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"varlibselinux\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tHostPath: &corev1.HostPathVolumeSource{\n\t\t\t\t\t\t\tPath: \"/var/lib/selinux\",\n\t\t\t\t\t\t\tType: &hostVolTypeDir,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"policyvolume\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tConfigMap: &corev1.ConfigMapVolumeSource{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: GetPolicyConfigMapName(name, ns),\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\tTolerations: []corev1.Toleration{\n\t\t\t\t{\n\t\t\t\t\tKey: \"node-role.kubernetes.io/master\",\n\t\t\t\t\tOperator: \"Exists\",\n\t\t\t\t\tEffect: \"NoSchedule\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func NewUpdateNamespaceUnauthorized() *UpdateNamespaceUnauthorized {\n\treturn &UpdateNamespaceUnauthorized{}\n}", "func NewDeviceLayoutUnauthorized(body DeviceLayoutUnauthorizedResponseBody) information.Unauthorized {\n\tv := information.Unauthorized(body)\n\treturn v\n}", "func generatePod(ip string) *corev1.Pod {\n\tpod := &corev1.Pod{}\n\tpod.Status.PodIP = ip\n\tpod.Status.Phase = corev1.PodRunning\n\tpod.Spec.Containers = []corev1.Container{\n\t\t{Ports: []corev1.ContainerPort{\n\t\t\t{Name: \"management\", ContainerPort: 8558},\n\t\t}},\n\t}\n\treturn pod\n}", "func NewWeaviateKeyCreateUnauthorized() *WeaviateKeyCreateUnauthorized {\n\treturn &WeaviateKeyCreateUnauthorized{}\n}" ]
[ "0.6324373", "0.56614023", "0.55299544", "0.5471965", "0.54620415", "0.5333958", "0.53161937", "0.52693075", "0.52219146", "0.52057135", "0.52049303", "0.5203383", "0.5196548", "0.5158162", "0.5138266", "0.50582945", "0.505557", "0.50355905", "0.5028456", "0.4977101", "0.49672177", "0.49507177", "0.4948179", "0.49428692", "0.49313334", "0.4929314", "0.49197417", "0.49020457", "0.48909694", "0.485626", "0.4844132", "0.483674", "0.483566", "0.48243022", "0.48012567", "0.47865427", "0.47607696", "0.4749603", "0.46926102", "0.46703768", "0.46626666", "0.4640921", "0.46313167", "0.46278483", "0.46163574", "0.46103448", "0.46020806", "0.45971313", "0.45951268", "0.45831126", "0.45586222", "0.4556472", "0.4550771", "0.45450723", "0.45326614", "0.45132282", "0.45103052", "0.450942", "0.44972196", "0.44961447", "0.44954425", "0.4488652", "0.44749832", "0.44746083", "0.44562614", "0.44480753", "0.4445514", "0.44446126", "0.44359997", "0.43927094", "0.43921304", "0.43798065", "0.43791926", "0.4376917", "0.4375105", "0.43730187", "0.43674248", "0.43582273", "0.43581083", "0.43564492", "0.43530038", "0.43512732", "0.4345603", "0.4344036", "0.43431237", "0.43377525", "0.4337435", "0.43188477", "0.4316856", "0.43167642", "0.43122777", "0.4303573", "0.43028468", "0.43025175", "0.42941222", "0.42876688", "0.42875862", "0.42773297", "0.42653608", "0.42575353" ]
0.7638226
0
Deprecated: Use PopularityListRequest.ProtoReflect.Descriptor instead.
Устарело: используйте PopularityListRequest.ProtoReflect.Descriptor вместо этого.
func (*PopularityListRequest) Descriptor() ([]byte, []int) { return file_popularity_proto_rawDescGZIP(), []int{1} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*ListMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{0}\n}", "func (*PopularityListResponse) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{3}\n}", "func (*PopularityRequest) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{2}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{0}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{3}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_api_jsonapi_request_proto_rawDescGZIP(), []int{5}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_versions_v1_versions_proto_rawDescGZIP(), []int{0}\n}", "func (*ProductsListRequest) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_proto_productslist_products_list_proto_rawDescGZIP(), []int{0}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_bucketsd_pb_bucketsd_proto_rawDescGZIP(), []int{2}\n}", "func (*UserListRequest) Descriptor() ([]byte, []int) {\n\treturn file_presence_proto_rawDescGZIP(), []int{1}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_weather_proto_rawDescGZIP(), []int{10}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{2}\n}", "func (*UserListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_hezzel_proto_rawDescGZIP(), []int{5}\n}", "func (*PeopleListRequest) Descriptor() ([]byte, []int) {\n\treturn file_sil_proto_rawDescGZIP(), []int{2}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{3}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_contact_proto_rawDescGZIP(), []int{14}\n}", "func (*ListVersionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{9}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_task_v1_task_proto_rawDescGZIP(), []int{5}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_accord_proto_rawDescGZIP(), []int{7}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_store_store_proto_rawDescGZIP(), []int{12}\n}", "func (*WatchlistRequest) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{2}\n}", "func (*MemberStatisticsInfoListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{101}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_v1_proto_rawDescGZIP(), []int{1}\n}", "func (*ListMetadataRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cipd_api_cipd_v1_repo_proto_rawDescGZIP(), []int{23}\n}", "func (*ListCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{164}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_fabl_v1_item_service_proto_rawDescGZIP(), []int{6}\n}", "func (*MemberListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{2}\n}", "func (*GetWatchlistRequest) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{1}\n}", "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{1}\n}", "func (*SimpleListRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_api_jsonapi_request_proto_rawDescGZIP(), []int{6}\n}", "func (*ListAnnotationSearchMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{124}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_mods_v1_mods_proto_rawDescGZIP(), []int{0}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_wallet_proto_rawDescGZIP(), []int{7}\n}", "func (*ListPeopleRequest) Descriptor() ([]byte, []int) {\n\treturn file_people_proto_rawDescGZIP(), []int{3}\n}", "func (*ListAnnotationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{2}\n}", "func (*GetFavoritePostListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_menger_menger_proto_rawDescGZIP(), []int{3}\n}", "func (*ListModelVersionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{88}\n}", "func (*ListTrendingMetricsViewsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{172}\n}", "func (*MemberLevelListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{47}\n}", "func (*ReleaseListRequest) Descriptor() ([]byte, []int) {\n\treturn file_release_proto_rawDescGZIP(), []int{16}\n}", "func (*ListFriendsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{57}\n}", "func (*ListNotificationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{63}\n}", "func (*ListInstancesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{15}\n}", "func (*GetListRequest) Descriptor() ([]byte, []int) {\n\treturn file_parser_company_proto_rawDescGZIP(), []int{14}\n}", "func (*MemberTagListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{110}\n}", "func (*ReleaseNameListRequest) Descriptor() ([]byte, []int) {\n\treturn file_release_proto_rawDescGZIP(), []int{21}\n}", "func (*ListModelEvaluationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_automl_v1_service_proto_rawDescGZIP(), []int{19}\n}", "func (*ListMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_threads_proto_rawDescGZIP(), []int{14}\n}", "func (*ListRefsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cipd_api_cipd_v1_repo_proto_rawDescGZIP(), []int{15}\n}", "func (*ListModelTypesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{96}\n}", "func (*GroupListRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_raft_proto_rawDescGZIP(), []int{36}\n}", "func (*ListLimitsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_limits_proto_v1alpha2_limit_service_proto_rawDescGZIP(), []int{3}\n}", "func (*ListCommentsRequest) Descriptor() ([]byte, []int) {\n\treturn file_view_grpc_blog_api_proto_rawDescGZIP(), []int{29}\n}", "func (*GrowthChangeHistoryListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{20}\n}", "func (*GetMengerListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_menger_menger_proto_rawDescGZIP(), []int{13}\n}", "func (*ListNodeSelectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_spire_server_datastore_datastore_proto_rawDescGZIP(), []int{23}\n}", "func (*ListGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{58}\n}", "func (*ListChartReq) Descriptor() ([]byte, []int) {\n\treturn file_helm_api_proto_rawDescGZIP(), []int{27}\n}", "func (*GetUserListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{0}\n}", "func (*PluginListRequest) Descriptor() ([]byte, []int) {\n\treturn file_plugin_proto_rawDescGZIP(), []int{7}\n}", "func (*ListInstancesRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cipd_api_cipd_v1_repo_proto_rawDescGZIP(), []int{9}\n}", "func (*ListMatchesRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{62}\n}", "func (*ListLeaderboardRecordsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{61}\n}", "func (*PostTrendingMetricsViewRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{171}\n}", "func (*ListOccurrencesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_containeranalysis_v1beta1_grafeas_grafeas_proto_rawDescGZIP(), []int{4}\n}", "func (*ListTeamsRequest) Descriptor() ([]byte, []int) {\n\treturn file_mods_v1_mods_proto_rawDescGZIP(), []int{18}\n}", "func (*ListHeadersRequest) Descriptor() ([]byte, []int) {\n\treturn file_data_proto_rawDescGZIP(), []int{10}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*ListTagsRequest) Descriptor() ([]byte, []int) {\n\treturn file_modeldb_versioning_VersioningService_proto_rawDescGZIP(), []int{28}\n}", "func (*GetVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{9}\n}", "func (*ListPodsRequest) Descriptor() ([]byte, []int) {\n\treturn file_viz_proto_rawDescGZIP(), []int{7}\n}", "func (*ListKnowledgeGraphsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{42}\n}", "func (*BlogSetLovelistRequest) Descriptor() ([]byte, []int) {\n\treturn file_contents_v1_blog_proto_rawDescGZIP(), []int{5}\n}", "func (*EventListRequest) Descriptor() ([]byte, []int) {\n\treturn file_event_service_proto_rawDescGZIP(), []int{7}\n}", "func (*ListUserFriendReq) Descriptor() ([]byte, []int) {\n\treturn file_v1_friend_friend_proto_rawDescGZIP(), []int{6}\n}", "func (*PopularityResponse) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{4}\n}", "func (*ListModelReferencesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{105}\n}", "func (*GetModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{94}\n}", "func (*GetFavoritePostListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_menger_menger_proto_rawDescGZIP(), []int{4}\n}", "func (*ListProjectsRequest) Descriptor() ([]byte, []int) {\n\treturn file_web_proto_rawDescGZIP(), []int{0}\n}", "func (*ListPartitionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataplex_v1_metadata_proto_rawDescGZIP(), []int{6}\n}", "func (*CMsgSocialFeedRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{304}\n}", "func (*ListEntitiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataplex_v1_metadata_proto_rawDescGZIP(), []int{3}\n}", "func (*ListStorageRequest) Descriptor() ([]byte, []int) {\n\treturn file_console_proto_rawDescGZIP(), []int{11}\n}", "func (*ListPidsRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_runtime_v1_shim_v1_shim_proto_rawDescGZIP(), []int{11}\n}", "func (*IntegrationChangeHistoryListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{29}\n}", "func (*ListUserGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{69}\n}", "func (*ListArticleRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_api_article_proto_rawDescGZIP(), []int{2}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{4}\n}", "func (*ListUsersRequest) Descriptor() ([]byte, []int) {\n\treturn file_example_proto_rawDescGZIP(), []int{2}\n}", "func (*ListPostsRequest) Descriptor() ([]byte, []int) {\n\treturn file_view_grpc_blog_api_proto_rawDescGZIP(), []int{19}\n}", "func (*PostModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{93}\n}", "func (*BlogGetListRequest) Descriptor() ([]byte, []int) {\n\treturn file_contents_v1_blog_proto_rawDescGZIP(), []int{1}\n}", "func (*ListPathRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_bucketsd_pb_bucketsd_proto_rawDescGZIP(), []int{10}\n}", "func (*ListGuildMembersRequest) Descriptor() ([]byte, []int) {\n\treturn file_discord_v1_cache_proto_rawDescGZIP(), []int{6}\n}", "func (*ListServicesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{4}\n}", "func (*ListModelsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_automl_v1_service_proto_rawDescGZIP(), []int{11}\n}", "func (*UpdateLimitRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_limits_proto_v1alpha2_limit_service_proto_rawDescGZIP(), []int{9}\n}", "func (*ListReleaseReq) Descriptor() ([]byte, []int) {\n\treturn file_helm_api_proto_rawDescGZIP(), []int{13}\n}", "func (*GetClientListRequest) Descriptor() ([]byte, []int) {\n\treturn file_messaging_proto_rawDescGZIP(), []int{4}\n}" ]
[ "0.7237613", "0.71879435", "0.7142334", "0.7067568", "0.7032066", "0.6967289", "0.69310343", "0.6881598", "0.68485683", "0.6842119", "0.68362856", "0.68357027", "0.68323797", "0.6810191", "0.6805528", "0.67902154", "0.6782207", "0.6767958", "0.6764224", "0.6764095", "0.6760439", "0.67584175", "0.6747775", "0.6745131", "0.67377865", "0.6712017", "0.6691349", "0.6690732", "0.6682383", "0.6677797", "0.66740537", "0.6671653", "0.6662672", "0.6656886", "0.6653812", "0.66481495", "0.6633423", "0.66309273", "0.6581214", "0.6571341", "0.65658057", "0.65603864", "0.6557103", "0.6537202", "0.65318114", "0.65284246", "0.6510212", "0.64974844", "0.6492767", "0.6490407", "0.64898276", "0.6485865", "0.64632946", "0.6461816", "0.6454066", "0.64511186", "0.644145", "0.64394116", "0.6437916", "0.64226514", "0.6412678", "0.64016414", "0.6393242", "0.63887477", "0.6383003", "0.63802207", "0.63735217", "0.63727576", "0.637258", "0.63651586", "0.63622266", "0.6358603", "0.63508546", "0.6350804", "0.6349351", "0.63448626", "0.6341395", "0.63403976", "0.6323716", "0.6319799", "0.63183635", "0.63102", "0.63044393", "0.62973475", "0.6293096", "0.62926656", "0.6289275", "0.62853223", "0.6283573", "0.628069", "0.6280008", "0.62781507", "0.62750024", "0.6271905", "0.6269493", "0.62611115", "0.62597376", "0.62593347", "0.6252359", "0.62520885" ]
0.7821995
0
Deprecated: Use PopularityRequest.ProtoReflect.Descriptor instead.
Устарело: используйте PopularityRequest.ProtoReflect.Descriptor вместо этого.
func (*PopularityRequest) Descriptor() ([]byte, []int) { return file_popularity_proto_rawDescGZIP(), []int{2} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*PopularityListRequest) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{1}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*GetVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{9}\n}", "func (*GetModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{94}\n}", "func (*RefreshRequest) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{16}\n}", "func (*PostModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{93}\n}", "func (*CMsgClientToGCPlayerStatsRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{143}\n}", "func (*MetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_ssn_dataservice_v1_dataservice_proto_rawDescGZIP(), []int{11}\n}", "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{5}\n}", "func (*ListMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{0}\n}", "func (*PostTrendingMetricsViewRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{171}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_newfindmaxpb_newfindmaxpb_proto_rawDescGZIP(), []int{0}\n}", "func (*DescribeRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_engine_proto_rawDescGZIP(), []int{4}\n}", "func (*NewVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_versiontracker_proto_rawDescGZIP(), []int{1}\n}", "func (*PatchAnnotationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{4}\n}", "func (*FloatRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_calc_proto_rawDescGZIP(), []int{2}\n}", "func (*ModifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_engine_proto_rawDescGZIP(), []int{10}\n}", "func (*GetPeerInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{6}\n}", "func (*AddPeerRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{8}\n}", "func (*QueryMicroRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_micro_pb_request_proto_rawDescGZIP(), []int{2}\n}", "func (*CMsgSocialFeedRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{304}\n}", "func (*GetServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{6}\n}", "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{10}\n}", "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_api_jsonapi_request_proto_rawDescGZIP(), []int{7}\n}", "func (*GetVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{11}\n}", "func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryParamsRequest\n}", "func (*CalculatorRequest) Descriptor() ([]byte, []int) {\n\treturn file_basicpb_unary_api_proto_rawDescGZIP(), []int{4}\n}", "func (*LoadStatsRequest) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_load_stats_v3_lrs_proto_rawDescGZIP(), []int{0}\n}", "func (*TelemetryRequest) Descriptor() ([]byte, []int) {\n\treturn file_automate_gateway_api_telemetry_telemetry_proto_rawDescGZIP(), []int{0}\n}", "func (*CodeLensRequest) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{163}\n}", "func (*ValidateRequest) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_clusrun_proto_rawDescGZIP(), []int{17}\n}", "func (*GenerateMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_ai_generativelanguage_v1beta2_discuss_service_proto_rawDescGZIP(), []int{0}\n}", "func (*DeleteCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{162}\n}", "func (*DetectionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_chromeos_uidetection_v1_ui_detection_proto_rawDescGZIP(), []int{1}\n}", "func (*DescribeMicroRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_micro_pb_request_proto_rawDescGZIP(), []int{3}\n}", "func (*AddRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_calculator_proto_calc_proto_rawDescGZIP(), []int{0}\n}", "func (*RecentMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_threads_proto_rawDescGZIP(), []int{16}\n}", "func (*BatchRequest_Request) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_buildbucket_proto_builds_service_proto_rawDescGZIP(), []int{3, 0}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_pkg_smgrpc_smgrpc_proto_rawDescGZIP(), []int{0}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_api_protobuf_spec_example_example_proto_rawDescGZIP(), []int{1}\n}", "func (*ContractQueryRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{22}\n}", "func (*QueryPermissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_permission_pb_request_proto_rawDescGZIP(), []int{0}\n}", "func (*RefreshTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_bulbasur_v1_bulbasur_proto_rawDescGZIP(), []int{5}\n}", "func (*CMsgGCPlayerInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{117}\n}", "func (*GetCollectorRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{163}\n}", "func (*ObserveGovernanceRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_trading_proto_rawDescGZIP(), []int{39}\n}", "func (*CollectRequest) Descriptor() ([]byte, []int) {\n\treturn file_orc8r_cloud_go_services_analytics_protos_collector_proto_rawDescGZIP(), []int{0}\n}", "func (*DeleteMicroRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_micro_pb_request_proto_rawDescGZIP(), []int{4}\n}", "func (*MeasureDistanceRequest) Descriptor() ([]byte, []int) {\n\treturn file_coolenv_proto_rawDescGZIP(), []int{3}\n}", "func (*RefreshTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_token_proto_rawDescGZIP(), []int{10}\n}", "func (*BatchUpdateReferencesRequest_Request) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_icas_icas_proto_rawDescGZIP(), []int{1, 0}\n}", "func (*AddProducerRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{2}\n}", "func (*UpdateTelemetryReportedRequest) Descriptor() ([]byte, []int) {\n\treturn file_external_applications_applications_proto_rawDescGZIP(), []int{29}\n}", "func (*UpdatePermissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_role_pb_request_proto_rawDescGZIP(), []int{9}\n}", "func (*PostCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{160}\n}", "func (*MetricsServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{18}\n}", "func (*PostAnnotationSearchMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{122}\n}", "func (*LoadBalancerStatsRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_test_proto_rawDescGZIP(), []int{9}\n}", "func (*WatchRequestTypeProto) Descriptor() ([]byte, []int) {\n\treturn file_raft_proto_rawDescGZIP(), []int{25}\n}", "func (*UpdateVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{13}\n}", "func (*FriendRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_user_proto_rawDescGZIP(), []int{5}\n}", "func (*MathRequest) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{0}\n}", "func (*WebhookRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_v2beta1_webhook_proto_rawDescGZIP(), []int{0}\n}", "func (*RefreshProjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_web_proto_rawDescGZIP(), []int{2}\n}", "func (*VersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_provider_v1alpha1_service_proto_rawDescGZIP(), []int{0}\n}", "func (*GetRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_comments_proto_rawDescGZIP(), []int{3}\n}", "func (*DeleteVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{14}\n}", "func (*PrimeDecompRequest) Descriptor() ([]byte, []int) {\n\treturn file_calculatorpb_calculator_proto_rawDescGZIP(), []int{4}\n}", "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_exercicio_proto_rawDescGZIP(), []int{7}\n}", "func (*CMsgDOTAMatchmakingStatsRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{49}\n}", "func (*DetailRequest) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{4}\n}", "func (*ValueRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{10}\n}", "func (*MyScopesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{109}\n}", "func (*GPULabelRequest) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{10}\n}", "func (*RefreshRequest) Descriptor() ([]byte, []int) {\n\treturn file_toit_api_auth_proto_rawDescGZIP(), []int{1}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_helloworld_helloworld_proto_rawDescGZIP(), []int{2}\n}", "func (*LanguageDetectorRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_language_proto_rawDescGZIP(), []int{1}\n}", "func (*LogMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{59}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_activity_proto_rawDescGZIP(), []int{10}\n}", "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_versions_v1_versions_proto_rawDescGZIP(), []int{5}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_internal_services_profile_proto_profile_proto_rawDescGZIP(), []int{0}\n}", "func (*FeedbackRequest) Descriptor() ([]byte, []int) {\n\treturn file_ssn_dataservice_v1_dataservice_proto_rawDescGZIP(), []int{10}\n}", "func (*GetEvaluationRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_agency_web_proto_rawDescGZIP(), []int{18}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_msgs_msgs_proto_rawDescGZIP(), []int{14}\n}", "func (*TrainInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{2}\n}", "func (*TypeDefinitionRequest) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{133}\n}", "func (*RateLaptopRequest) Descriptor() ([]byte, []int) {\n\treturn file_helloworld_helloworld_proto_rawDescGZIP(), []int{4}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_proto_fandncloud_service_user_user_proto_rawDescGZIP(), []int{10}\n}", "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_recordwants_proto_rawDescGZIP(), []int{6}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_api_jsonapi_request_proto_rawDescGZIP(), []int{5}\n}", "func (*GetFlowsRequest_Experimental) Descriptor() ([]byte, []int) {\n\treturn file_observer_observer_proto_rawDescGZIP(), []int{2, 0}\n}", "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_example_proto_rawDescGZIP(), []int{1}\n}", "func (*CapabilityRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_gnmi_gnmi_proto_rawDescGZIP(), []int{20}\n}", "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{4}\n}", "func (*DecodeRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_videoservice_proto_rawDescGZIP(), []int{0}\n}", "func (*FetchMatchesRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_backend_proto_rawDescGZIP(), []int{1}\n}", "func (*DiffRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP(), []int{2}\n}", "func (*PatchAnnotationsStatusRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{5}\n}", "func (*RequestPresentationRequest) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{0}\n}", "func (*CreateVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{12}\n}" ]
[ "0.7082874", "0.70466405", "0.70027757", "0.6991793", "0.6961903", "0.6930849", "0.69178694", "0.6898601", "0.688897", "0.68645346", "0.6864145", "0.6836272", "0.6826459", "0.68234265", "0.68149114", "0.68109876", "0.6810779", "0.6788016", "0.67873865", "0.67856604", "0.67804575", "0.67667466", "0.67529744", "0.67432374", "0.67426395", "0.6742184", "0.6741854", "0.67394567", "0.67358977", "0.67327774", "0.673109", "0.6729629", "0.67292774", "0.67223835", "0.67177606", "0.67149496", "0.6714185", "0.67109394", "0.6705194", "0.6704307", "0.67024267", "0.6701672", "0.67012805", "0.67008805", "0.6699773", "0.6695416", "0.66943365", "0.66942877", "0.66939175", "0.6691471", "0.6686966", "0.66867644", "0.668587", "0.66793346", "0.66788536", "0.66752845", "0.6672699", "0.6670689", "0.6666011", "0.66627645", "0.66624516", "0.6661763", "0.6655782", "0.66493106", "0.6649007", "0.6647473", "0.6647363", "0.6646154", "0.66443276", "0.664418", "0.66433364", "0.66385853", "0.66380167", "0.6635063", "0.66347677", "0.6634379", "0.66313154", "0.6631025", "0.6630842", "0.66297007", "0.6628693", "0.6627606", "0.6627403", "0.6626806", "0.66227967", "0.6622406", "0.6620516", "0.6618433", "0.66151476", "0.66138947", "0.66062474", "0.6604816", "0.66043675", "0.66010225", "0.65997934", "0.6599015", "0.6598006", "0.6596836", "0.6595053", "0.6594888" ]
0.7320204
0
Deprecated: Use PopularityListResponse.ProtoReflect.Descriptor instead.
Устарело: используйте PopularityListResponse.ProtoReflect.Descriptor вместо этого.
func (*PopularityListResponse) Descriptor() ([]byte, []int) { return file_popularity_proto_rawDescGZIP(), []int{3} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{1}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{4}\n}", "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{1}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_versions_v1_versions_proto_rawDescGZIP(), []int{1}\n}", "func (*PopularityListRequest) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{1}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_weather_proto_rawDescGZIP(), []int{17}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_contact_proto_rawDescGZIP(), []int{15}\n}", "func (*PopularityResponse) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{4}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{3}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{4}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_bucketsd_pb_bucketsd_proto_rawDescGZIP(), []int{3}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_task_v1_task_proto_rawDescGZIP(), []int{6}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_v1_proto_rawDescGZIP(), []int{7}\n}", "func (*ListMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{0}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_mods_v1_mods_proto_rawDescGZIP(), []int{1}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{0}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_wallet_proto_rawDescGZIP(), []int{8}\n}", "func (*GetMetricsInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{44}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_store_store_proto_rawDescGZIP(), []int{13}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_fabl_v1_item_service_proto_rawDescGZIP(), []int{7}\n}", "func (*GetMengerListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_menger_menger_proto_rawDescGZIP(), []int{14}\n}", "func (*ProductsListResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_proto_productslist_products_list_proto_rawDescGZIP(), []int{1}\n}", "func (*GetListResponse) Descriptor() ([]byte, []int) {\n\treturn file_parser_company_proto_rawDescGZIP(), []int{15}\n}", "func (*GetFavoritePostListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_menger_menger_proto_rawDescGZIP(), []int{4}\n}", "func (*ListMyTeams_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{4, 0}\n}", "func (*ReleaseListResponseData) Descriptor() ([]byte, []int) {\n\treturn file_release_proto_rawDescGZIP(), []int{20}\n}", "func (*ProdListResponse) Descriptor() ([]byte, []int) {\n\treturn file_ProdModel_proto_rawDescGZIP(), []int{2}\n}", "func (*WatchlistResponse) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{9}\n}", "func (*PopularityRequest) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{2}\n}", "func (*MemberStatisticsInfoListResp) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{103}\n}", "func (*MultiTrendingMetricsViewResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{173}\n}", "func (*ListVersionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{10}\n}", "func (*ReleaseListResponse) Descriptor() ([]byte, []int) {\n\treturn file_release_proto_rawDescGZIP(), []int{17}\n}", "func (*ListTrendingMetricsViewsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{172}\n}", "func (*MetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_index_proto_rawDescGZIP(), []int{25}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_versions_v1_versions_proto_rawDescGZIP(), []int{0}\n}", "func (*GetVersionResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{31}\n}", "func (*ListTeamsResponse) Descriptor() ([]byte, []int) {\n\treturn file_xsuportal_services_audience_team_list_proto_rawDescGZIP(), []int{0}\n}", "func (*GetVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{9}\n}", "func (*MemberTagListResp) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{112}\n}", "func (*GetStatsResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{45}\n}", "func (*ReleaseNameListResponse) Descriptor() ([]byte, []int) {\n\treturn file_release_proto_rawDescGZIP(), []int{22}\n}", "func (*ListCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{164}\n}", "func (*RefreshResponse) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{17}\n}", "func (*ListInstancesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{16}\n}", "func (*MemberListResp) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{4}\n}", "func (*ListVideosV1Response) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_video_api_ocp_video_api_proto_rawDescGZIP(), []int{1}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{3}\n}", "func (*ItemsListResponse) Descriptor() ([]byte, []int) {\n\treturn file_services_grpcPb_grpc_proto_rawDescGZIP(), []int{15}\n}", "func (*Deprecation) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_response_nodes_proto_rawDescGZIP(), []int{8}\n}", "func (*ListMetadataResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cipd_api_cipd_v1_repo_proto_rawDescGZIP(), []int{24}\n}", "func (*ListPodsResponse) Descriptor() ([]byte, []int) {\n\treturn file_viz_proto_rawDescGZIP(), []int{8}\n}", "func (*MultiAnnotationSearchMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{125}\n}", "func (*MemberStatisticsInfoListReq) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{101}\n}", "func (*ListModelEvaluationsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_automl_v1_service_proto_rawDescGZIP(), []int{20}\n}", "func (*ListPeopleResponse) Descriptor() ([]byte, []int) {\n\treturn file_people_proto_rawDescGZIP(), []int{4}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_weather_proto_rawDescGZIP(), []int{10}\n}", "func (*ListNodeSelectorsResponse) Descriptor() ([]byte, []int) {\n\treturn file_spire_server_datastore_datastore_proto_rawDescGZIP(), []int{24}\n}", "func (*GetClientListResponse) Descriptor() ([]byte, []int) {\n\treturn file_messaging_proto_rawDescGZIP(), []int{5}\n}", "func (*WatchLimitsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_limits_proto_v1alpha2_limit_service_proto_rawDescGZIP(), []int{8}\n}", "func (APIVersion) EnumDescriptor() ([]byte, []int) {\n\treturn file_dapr_proto_internals_v1_apiversion_proto_rawDescGZIP(), []int{0}\n}", "func (*UserListResponse) Descriptor() ([]byte, []int) {\n\treturn file_presence_proto_rawDescGZIP(), []int{4}\n}", "func (*MemberLevelListResp) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{49}\n}", "func (*ListMatchesRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{62}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_api_jsonapi_request_proto_rawDescGZIP(), []int{5}\n}", "func (*CountMessageTokensResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_ai_generativelanguage_v1beta2_discuss_service_proto_rawDescGZIP(), []int{6}\n}", "func (*ListTagsRequest_Response) Descriptor() ([]byte, []int) {\n\treturn file_modeldb_versioning_VersioningService_proto_rawDescGZIP(), []int{28, 0}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*ListAnnotationSearchMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{124}\n}", "func (*ReadTensorboardUsageResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_aiplatform_v1_tensorboard_service_proto_rawDescGZIP(), []int{7}\n}", "func (*ListVersionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{9}\n}", "func (*RefreshTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_bulbasur_v1_bulbasur_proto_rawDescGZIP(), []int{6}\n}", "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{2}\n}", "func (*WatchLimitResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_limits_proto_v1alpha2_limit_service_proto_rawDescGZIP(), []int{6}\n}", "func (*ListNodePlanningsResponse) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_plannings_services_proto_rawDescGZIP(), []int{15}\n}", "func (*GetWatchlistRequest) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{1}\n}", "func (CMsgSocialFeedResponse_Result) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{305, 0}\n}", "func (*WatchlistRequest) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{2}\n}", "func (StandardPTransforms_DeprecatedPrimitives) EnumDescriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_beam_runner_api_proto_rawDescGZIP(), []int{4, 1}\n}", "func (*ListChartReq) Descriptor() ([]byte, []int) {\n\treturn file_helm_api_proto_rawDescGZIP(), []int{27}\n}", "func (*UserListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_hezzel_proto_rawDescGZIP(), []int{6}\n}", "func (*ListVideosV1Request) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_video_api_ocp_video_api_proto_rawDescGZIP(), []int{0}\n}", "func (*ListLimitsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_limits_proto_v1alpha2_limit_service_proto_rawDescGZIP(), []int{4}\n}", "func (*UpdateTelemetryReportedResponse) Descriptor() ([]byte, []int) {\n\treturn file_external_applications_applications_proto_rawDescGZIP(), []int{30}\n}", "func (*ListAnnotationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{2}\n}", "func (*GetTeamByName_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{2, 0}\n}", "func (*GetModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{94}\n}", "func (*InstancesListResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_sql_v1beta4_cloud_sql_resources_proto_rawDescGZIP(), []int{30}\n}", "func (*TodoListResponse) Descriptor() ([]byte, []int) {\n\treturn file_todoapp_proto_rawDescGZIP(), []int{2}\n}", "func (*RevokeTokensResponse) Descriptor() ([]byte, []int) {\n\treturn file_token_proto_rawDescGZIP(), []int{18}\n}", "func (*ListModelVersionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{88}\n}", "func (*ListTeamsResponse) Descriptor() ([]byte, []int) {\n\treturn file_mods_v1_mods_proto_rawDescGZIP(), []int{19}\n}", "func (*ListTeamsRequest) Descriptor() ([]byte, []int) {\n\treturn file_mods_v1_mods_proto_rawDescGZIP(), []int{18}\n}", "func (*GetPeerInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{28}\n}", "func (*ListMetadataRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cipd_api_cipd_v1_repo_proto_rawDescGZIP(), []int{23}\n}", "func (*ListInstancesResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cipd_api_cipd_v1_repo_proto_rawDescGZIP(), []int{10}\n}", "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{11}\n}", "func (*RefreshTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_token_proto_rawDescGZIP(), []int{11}\n}", "func (*NewsPhotoGetListResponse) Descriptor() ([]byte, []int) {\n\treturn file_contents_v1_news_photo_proto_rawDescGZIP(), []int{6}\n}", "func (*AddPeerResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{30}\n}" ]
[ "0.71613175", "0.70811313", "0.6964309", "0.6961536", "0.69323695", "0.6889161", "0.68409914", "0.68287885", "0.6815276", "0.68109584", "0.6788512", "0.6770173", "0.6754738", "0.674238", "0.67397827", "0.668816", "0.66817975", "0.6667783", "0.6642515", "0.6640957", "0.66291136", "0.66256726", "0.66194177", "0.661524", "0.6598692", "0.65760934", "0.657444", "0.6567168", "0.6554971", "0.6554265", "0.65500605", "0.6521088", "0.65186834", "0.6501161", "0.6489723", "0.6488992", "0.6473626", "0.6455825", "0.6444628", "0.64403284", "0.6439207", "0.6422261", "0.64197415", "0.64152735", "0.6411958", "0.64099216", "0.6407155", "0.6400566", "0.6388246", "0.6386321", "0.6379627", "0.63722444", "0.6359167", "0.63423604", "0.63418585", "0.63386714", "0.633863", "0.63342696", "0.63280225", "0.63202524", "0.6314325", "0.6313453", "0.6311993", "0.6310694", "0.63084865", "0.63045704", "0.63036555", "0.6301967", "0.63017184", "0.6298397", "0.6295213", "0.62944615", "0.62941456", "0.62930655", "0.62905365", "0.6287907", "0.6287301", "0.6286799", "0.6281002", "0.62797964", "0.6278871", "0.6278617", "0.62779117", "0.62770355", "0.6274442", "0.62740135", "0.6272449", "0.6272271", "0.627032", "0.6269923", "0.6267055", "0.6263127", "0.6261026", "0.6259597", "0.62590194", "0.6254516", "0.6253809", "0.62536055", "0.6242261", "0.62406504" ]
0.7601463
0
Deprecated: Use PopularityResponse.ProtoReflect.Descriptor instead.
Устарело: используйте PopularityResponse.ProtoReflect.Descriptor вместо этого.
func (*PopularityResponse) Descriptor() ([]byte, []int) { return file_popularity_proto_rawDescGZIP(), []int{4} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*PopularityListResponse) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{3}\n}", "func (*GetMetricsInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{44}\n}", "func (*MetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_index_proto_rawDescGZIP(), []int{25}\n}", "func (*MultiTrendingMetricsViewResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{173}\n}", "func (*GetStatsResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{45}\n}", "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{1}\n}", "func (*GetVersionResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{31}\n}", "func (*GetVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{9}\n}", "func (*AddPeerResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{30}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{1}\n}", "func (*GetPeerInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{28}\n}", "func (*PopularityRequest) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{2}\n}", "func (*RefreshResponse) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{17}\n}", "func (*Response) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_newfindmaxpb_newfindmaxpb_proto_rawDescGZIP(), []int{1}\n}", "func (*Deprecation) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_response_nodes_proto_rawDescGZIP(), []int{8}\n}", "func (*PerformanceResponse) Descriptor() ([]byte, []int) {\n\treturn file_commissionService_proto_rawDescGZIP(), []int{5}\n}", "func (*ListMyTeams_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{4, 0}\n}", "func (*DescribeResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_engine_proto_rawDescGZIP(), []int{5}\n}", "func (*MultiAnnotationSearchMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{125}\n}", "func (*LoadStatsResponse) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_load_stats_v3_lrs_proto_rawDescGZIP(), []int{1}\n}", "func (*DeleteTeam_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{6, 0}\n}", "func (*NewVersionResponse) Descriptor() ([]byte, []int) {\n\treturn file_versiontracker_proto_rawDescGZIP(), []int{2}\n}", "func (*PostModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{93}\n}", "func (*GetTeamById_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{1, 0}\n}", "func (*GetTeamByName_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{2, 0}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{4}\n}", "func (*GenerateMessageResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_ai_generativelanguage_v1beta2_discuss_service_proto_rawDescGZIP(), []int{1}\n}", "func (*GetModelVersionMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{94}\n}", "func (*UpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{7}\n}", "func (*AddProducerResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{23}\n}", "func (*UpdateTelemetryReportedResponse) Descriptor() ([]byte, []int) {\n\treturn file_external_applications_applications_proto_rawDescGZIP(), []int{30}\n}", "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{11}\n}", "func (*CollectResponse) Descriptor() ([]byte, []int) {\n\treturn file_orc8r_cloud_go_services_analytics_protos_collector_proto_rawDescGZIP(), []int{1}\n}", "func (*PopularityListRequest) Descriptor() ([]byte, []int) {\n\treturn file_popularity_proto_rawDescGZIP(), []int{1}\n}", "func (*CMsgSocialFeedResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{305}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*ShowResponse) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{9}\n}", "func (*ObserveGovernanceResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_trading_proto_rawDescGZIP(), []int{40}\n}", "func (*MultiCollectorResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{165}\n}", "func (*FetchMatchesResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_backend_proto_rawDescGZIP(), []int{2}\n}", "func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateParamsResponse\n}", "func (*ProtoResponse) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{2}\n}", "func (*ReadTensorboardUsageResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_aiplatform_v1_tensorboard_service_proto_rawDescGZIP(), []int{7}\n}", "func (*DetailResponse) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{7}\n}", "func (*ContractQueryResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{50}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_versions_v1_versions_proto_rawDescGZIP(), []int{1}\n}", "func (*LivenessCheckResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_index_proto_rawDescGZIP(), []int{0}\n}", "func (*MultiStatValueResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{168}\n}", "func (*ApiVersionResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_check_api_ocp_check_api_proto_rawDescGZIP(), []int{14}\n}", "func (*MultiModelVersionResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{91}\n}", "func (*GetTagRequest_Response) Descriptor() ([]byte, []int) {\n\treturn file_modeldb_versioning_VersioningService_proto_rawDescGZIP(), []int{29, 0}\n}", "func (*SetTeam_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{5, 0}\n}", "func (*GetTeamByShortName_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{3, 0}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_weather_proto_rawDescGZIP(), []int{17}\n}", "func (*GetFavoriteTranslationResponse) Descriptor() ([]byte, []int) {\n\treturn file_translation_proto_rawDescGZIP(), []int{4}\n}", "func (*ListMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{0}\n}", "func (*MultiKnowledgeGraphResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{46}\n}", "func (*ApplyResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP(), []int{1}\n}", "func (*LoadBalancerStatsResponse) Descriptor() ([]byte, []int) {\n\treturn file_grpc_test_proto_rawDescGZIP(), []int{10}\n}", "func (*DecodeReply) Descriptor() ([]byte, []int) {\n\treturn file_proto_videoservice_proto_rawDescGZIP(), []int{1}\n}", "func (*DecodeRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_videoservice_proto_rawDescGZIP(), []int{0}\n}", "func (*TelemetryResponse) Descriptor() ([]byte, []int) {\n\treturn file_automate_gateway_api_telemetry_telemetry_proto_rawDescGZIP(), []int{1}\n}", "func (*Response) Descriptor() ([]byte, []int) {\n\treturn file_api_protobuf_spec_example_example_proto_rawDescGZIP(), []int{2}\n}", "func (*RefreshTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_bulbasur_v1_bulbasur_proto_rawDescGZIP(), []int{6}\n}", "func (*FloatResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_calc_proto_rawDescGZIP(), []int{3}\n}", "func (*TypeDefinitionResponse) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{26}\n}", "func (*RecentMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_threads_proto_rawDescGZIP(), []int{17}\n}", "func (*ModifyResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_engine_proto_rawDescGZIP(), []int{11}\n}", "func (*LanguageDetectorResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_language_proto_rawDescGZIP(), []int{2}\n}", "func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryParamsResponse\n}", "func (*RecognitionResponse) Descriptor() ([]byte, []int) {\n\treturn file_cubic_proto_rawDescGZIP(), []int{6}\n}", "func (*KindTagResponse) Descriptor() ([]byte, []int) {\n\treturn file_kindTagService_proto_rawDescGZIP(), []int{2}\n}", "func (*RefreshProjectResponse) Descriptor() ([]byte, []int) {\n\treturn file_web_proto_rawDescGZIP(), []int{3}\n}", "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_contact_proto_rawDescGZIP(), []int{15}\n}", "func (*SingleModelVersionResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{90}\n}", "func (*MemberStatisticsInfoUpdateResp) Descriptor() ([]byte, []int) {\n\treturn file_ums_proto_rawDescGZIP(), []int{105}\n}", "func (*PostTrendingMetricsViewRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{171}\n}", "func (*AddResponse) Descriptor() ([]byte, []int) {\n\treturn file_grpc_calculator_proto_calc_proto_rawDescGZIP(), []int{1}\n}", "func (*WatchlistResponse) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_movies_movies_proto_rawDescGZIP(), []int{9}\n}", "func (*CountMessageTokensResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_ai_generativelanguage_v1beta2_discuss_service_proto_rawDescGZIP(), []int{6}\n}", "func (*MeasureDistanceResponse) Descriptor() ([]byte, []int) {\n\treturn file_coolenv_proto_rawDescGZIP(), []int{4}\n}", "func (x *fastReflection_MsgFundCommunityPoolResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgFundCommunityPoolResponse\n}", "func (*SingleCollectorResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{166}\n}", "func (*ValueResponse) Descriptor() ([]byte, []int) {\n\treturn file_kvapi_proto_rawDescGZIP(), []int{2}\n}", "func (*HoverResponse) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{18}\n}", "func (*MultiScopeDepsResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{110}\n}", "func (*DropTeamResponse) Descriptor() ([]byte, []int) {\n\treturn file_mods_v1_mods_proto_rawDescGZIP(), []int{23}\n}", "func (*RefreshTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_token_proto_rawDescGZIP(), []int{11}\n}", "func (*CodeLensResponse) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{32}\n}", "func (*DefinitionResponse) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{25}\n}", "func (*ValueResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{11}\n}", "func (*CalculatorResponse) Descriptor() ([]byte, []int) {\n\treturn file_basicpb_unary_api_proto_rawDescGZIP(), []int{5}\n}", "func (*WatchResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_index_proto_rawDescGZIP(), []int{24}\n}", "func (*RefreshRequest) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{16}\n}", "func (*NodeGroupDecreaseTargetSizeResponse) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{25}\n}", "func (*DelResponse) Descriptor() ([]byte, []int) {\n\treturn file_patrol_proto_rawDescGZIP(), []int{9}\n}", "func (*TrainInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{3}\n}", "func (*ComputeDoubleResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_kubernetes_csi_csi_proxy_integrationtests_apigroups_api_dummy_v1_api_proto_rawDescGZIP(), []int{1}\n}", "func (*GPULabelResponse) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{11}\n}", "func (*GetPeerInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{6}\n}" ]
[ "0.7134704", "0.7111636", "0.70104676", "0.6936063", "0.6926665", "0.6925415", "0.6913843", "0.6790236", "0.6789545", "0.67850775", "0.67768216", "0.6768377", "0.6763497", "0.6756869", "0.6733272", "0.6728977", "0.67196757", "0.6716262", "0.670581", "0.6693681", "0.6683952", "0.66823447", "0.66617024", "0.6657871", "0.6657557", "0.66527486", "0.66512257", "0.6646412", "0.6637994", "0.6636317", "0.6627701", "0.66259426", "0.66184783", "0.6609159", "0.6604121", "0.6603331", "0.66017133", "0.6594797", "0.65896386", "0.6588831", "0.6588566", "0.6588352", "0.6586228", "0.6583063", "0.6571566", "0.65705353", "0.6570141", "0.6560741", "0.6559015", "0.6558706", "0.65580523", "0.6551889", "0.65488195", "0.65481186", "0.65476376", "0.6546176", "0.654602", "0.6545893", "0.6541905", "0.6538575", "0.6536902", "0.65367657", "0.6532059", "0.6529404", "0.65288615", "0.65257573", "0.6525463", "0.65248615", "0.6523256", "0.65192455", "0.6518884", "0.65177464", "0.6514789", "0.6511103", "0.6511055", "0.6505763", "0.6505436", "0.6501654", "0.65009", "0.64996284", "0.6496709", "0.6495806", "0.6495215", "0.6492343", "0.64914525", "0.64907545", "0.64829314", "0.6479258", "0.64764947", "0.64761996", "0.64740926", "0.64726734", "0.6471916", "0.64703685", "0.6469053", "0.64677936", "0.64660925", "0.6464493", "0.64585394", "0.645214" ]
0.7181659
0
NewSignInItemRequestBuilderInternal instantiates a new SignInItemRequestBuilder and sets the default values.
NewSignInItemRequestBuilderInternal создает новый SignInItemRequestBuilder и устанавливает значения по умолчанию.
func NewSignInItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SignInItemRequestBuilder) { m := &SignInItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/auditLogs/signIns/{signIn%2Did}{?%24select,%24expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewSignInItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SignInItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewSignInItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemPhotoRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPhotoRequestBuilder) {\n m := &ItemPhotoRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/photo{?%24select}\", pathParameters),\n }\n return m\n}", "func NewItemSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) {\n m := &ItemSettingsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/settings{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemOutlookRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookRequestBuilder) {\n m := &ItemOutlookRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/outlook{?%24select}\", pathParameters),\n }\n return m\n}", "func NewStoreItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StoreItemRequestBuilder) {\n m := &StoreItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/sites/{site%2Did}/termStores/{store%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemOnlineMeetingsItemRegistrationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOnlineMeetingsItemRegistrationRequestBuilder) {\n m := &ItemOnlineMeetingsItemRegistrationRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/onlineMeetings/{onlineMeeting%2Did}/registration{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewSiteItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SiteItemRequestBuilder) {\n m := &SiteItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/sites/{site%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams\n m.requestAdapter = requestAdapter\n return m\n}", "func NewSiteItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SiteItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewSiteItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewQnasQnaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*QnasQnaItemRequestBuilder) {\n m := &QnasQnaItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/search/qnas/{qna%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewStoreItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StoreItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewStoreItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemPhotoRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPhotoRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemPhotoRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOutlookRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOutlookRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewEducationClassItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EducationClassItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEducationClassItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewTeamItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamItemRequestBuilder) {\n m := &TeamItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/me/joinedTeams/{team%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewSubjectRightsRequestItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubjectRightsRequestItemRequestBuilder) {\n m := &SubjectRightsRequestItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/privacy/subjectRightsRequests/{subjectRightsRequest%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewEducationClassItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EducationClassItemRequestBuilder) {\n m := &EducationClassItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/education/schools/{educationSchool%2Did}/classes/{educationClass%2Did}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSettingsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOnlineMeetingsItemRegistrationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOnlineMeetingsItemRegistrationRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOnlineMeetingsItemRegistrationRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewManagedAppRegistrationItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedAppRegistrationItemRequestBuilder) {\n m := &ManagedAppRegistrationItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/deviceAppManagement/managedAppRegistrations/{managedAppRegistration%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewEventItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventItemRequestBuilder) {\n m := &EventItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/users/{user%2Did}/events/{event%2Did}/instances/{event%2Did1}{?%24select}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemWindowsInformationProtectionDeviceRegistrationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder) {\n m := &ItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/windowsInformationProtectionDeviceRegistrations{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewTeamItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewTeamItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewPrivilegedSignupStatusItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PrivilegedSignupStatusItemRequestBuilder) {\n m := &PrivilegedSignupStatusItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/privilegedSignupStatus/{privilegedSignupStatus%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewOnlineMeetingsItemRegistrationRegistrantsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationRegistrantsRequestBuilder) {\n m := &OnlineMeetingsItemRegistrationRegistrantsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/communications/onlineMeetings/{onlineMeeting%2Did}/registration/registrants{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewChatItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ChatItemRequestBuilder) {\n m := &ChatItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/users/{user%2Did}/chats/{chat%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewGroupItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GroupItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewGroupItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewGroupItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GroupItemRequestBuilder) {\n m := &GroupItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/print/shares/{printerShare%2Did}/allowedGroups/{group%2Did}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewKeySetsItemUploadCertificateRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeySetsItemUploadCertificateRequestBuilder) {\n m := &KeySetsItemUploadCertificateRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/trustFramework/keySets/{trustFrameworkKeySet%2Did}/uploadCertificate\", pathParameters),\n }\n return m\n}", "func NewIdentityGovernanceRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IdentityGovernanceRequestBuilder) {\n m := &IdentityGovernanceRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/identityGovernance{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemWindowsInformationProtectionDeviceRegistrationsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewMyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MyRequestBuilder) {\n m := &MyRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/privilegedRoleAssignmentRequests/my(){?%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}\", pathParameters),\n }\n return m\n}", "func NewItemMailFoldersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMailFoldersRequestBuilder) {\n m := &ItemMailFoldersRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/mailFolders{?includeHiddenFolders*,%24top,%24skip,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewTeamsAppItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsAppItemRequestBuilder) {\n m := &TeamsAppItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/appCatalogs/teamsApps/{teamsApp%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewManagedAppRegistrationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedAppRegistrationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewManagedAppRegistrationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewChatItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ChatItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewChatItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemQuotaRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemQuotaRequestBuilder) {\n m := &ItemQuotaRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/connections/{externalConnection%2Did}/quota{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewTeamsAppItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsAppItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewTeamsAppItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemProfilePositionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProfilePositionsRequestBuilder) {\n m := &ItemProfilePositionsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/profile/positions{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemDriveItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDriveItemRequestBuilder) {\n m := &ItemDriveItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/shares/{sharedDriveItem%2Did}/driveItem{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewDeviceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DeviceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewDeviceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOutlookTasksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookTasksRequestBuilder) {\n m := &ItemOutlookTasksRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/outlook/tasks{?%24top,%24skip,%24filter,%24count,%24orderby,%24select}\", pathParameters),\n }\n return m\n}", "func NewManagedDeviceItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedDeviceItemRequestBuilder) {\n m := &ManagedDeviceItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/deviceManagement/managedDevices/{managedDevice%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewOnlineMeetingsItemRegistrationRegistrantsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationRegistrantsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewOnlineMeetingsItemRegistrationRegistrantsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewThreatAssessmentRequestsThreatAssessmentRequestItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreatAssessmentRequestsThreatAssessmentRequestItemRequestBuilder) {\n m := &ThreatAssessmentRequestsThreatAssessmentRequestItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/informationProtection/threatAssessmentRequests/{threatAssessmentRequest%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewDirectoryObjectItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DirectoryObjectItemRequestBuilder) {\n m := &DirectoryObjectItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/groups/{group%2Did}/members/{directoryObject%2Did}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewDeviceItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DeviceItemRequestBuilder) {\n m := &DeviceItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/devices/{device%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams\n m.requestAdapter = requestAdapter\n return m\n}", "func NewIntentsDeviceManagementIntentItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IntentsDeviceManagementIntentItemRequestBuilder) {\n m := &IntentsDeviceManagementIntentItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/deviceManagement/intents/{deviceManagementIntent%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewCompaniesItemCompanyInformationCompanyInformationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesItemCompanyInformationCompanyInformationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewCompaniesItemCompanyInformationCompanyInformationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewUserFlowLanguagePageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UserFlowLanguagePageItemRequestBuilder) {\n m := &UserFlowLanguagePageItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/identity/b2xUserFlows/{b2xIdentityUserFlow%2Did}/languages/{userFlowLanguageConfiguration%2Did}/defaultPages/{userFlowLanguagePage%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemRegisteredUsersDirectoryObjectItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRegisteredUsersDirectoryObjectItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemRegisteredUsersDirectoryObjectItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewClassesItemGroupRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClassesItemGroupRequestBuilder) {\n m := &ClassesItemGroupRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/education/classes/{educationClass%2Did}/group{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewKeySetsItemUploadCertificateRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeySetsItemUploadCertificateRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewKeySetsItemUploadCertificateRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewDeviceConfigurationItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DeviceConfigurationItemRequestBuilder) {\n m := &DeviceConfigurationItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/deviceManagement/deviceConfigurations/{deviceConfiguration%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewPrivilegedSignupStatusItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PrivilegedSignupStatusItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewPrivilegedSignupStatusItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewMyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MyRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewMyRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSpecialDriveItemItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSpecialDriveItemItemRequestBuilder) {\n m := &ItemSpecialDriveItemItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/drives/{drive%2Did}/special/{driveItem%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewEventItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEventItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSpecialDriveItemItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSpecialDriveItemItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSpecialDriveItemItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewConnectedOrganizationItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ConnectedOrganizationItemRequestBuilder) {\n m := &ConnectedOrganizationItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/identityGovernance/entitlementManagement/connectedOrganizations/{connectedOrganization%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewAddKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AddKeyRequestBuilder) {\n m := &AddKeyRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/applications/{application%2Did}/microsoft.graph.addKey\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemQuotaRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemQuotaRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemQuotaRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSitesSiteItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSitesSiteItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSitesSiteItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewTeamworkRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamworkRequestBuilder) {\n m := &TeamworkRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/me/teamwork{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewOnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilder) {\n m := &OnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/app/onlineMeetings/{onlineMeeting%2Did}/registration/customQuestions/{meetingRegistrationQuestion%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemMailFoldersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMailFoldersRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemMailFoldersRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewQnasQnaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*QnasQnaItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewQnasQnaItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewVirtualEndpointUserSettingsCloudPcUserSettingItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*VirtualEndpointUserSettingsCloudPcUserSettingItemRequestBuilder) {\n m := &VirtualEndpointUserSettingsCloudPcUserSettingItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/deviceManagement/virtualEndpoint/userSettings/{cloudPcUserSetting%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewRiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilder) {\n m := &RiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/identityProtection/riskyUsers/{riskyUser%2Did}/history/{riskyUserHistoryItem%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemRegisteredUsersDirectoryObjectItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRegisteredUsersDirectoryObjectItemRequestBuilder) {\n m := &ItemRegisteredUsersDirectoryObjectItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/devices/{device%2Did}/registeredUsers/{directoryObject%2Did}\", pathParameters),\n }\n return m\n}", "func NewItemDriveItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDriveItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemDriveItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewApiConnectorsIdentityApiConnectorItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiConnectorsIdentityApiConnectorItemRequestBuilder) {\n m := &ApiConnectorsIdentityApiConnectorItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/identity/apiConnectors/{identityApiConnector%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams\n m.requestAdapter = requestAdapter\n return m\n}", "func NewTeamTemplateDefinitionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamTemplateDefinitionItemRequestBuilder) {\n m := &TeamTemplateDefinitionItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemCalendarRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCalendarRequestBuilder) {\n m := &ItemCalendarRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/groups/{group%2Did}/calendar{?%24select}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams\n m.requestAdapter = requestAdapter\n return m\n}", "func NewOnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewOnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewCompaniesCompanyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesCompanyItemRequestBuilder) {\n m := &CompaniesCompanyItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/financials/companies/{company%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewManagedDeviceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedDeviceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewManagedDeviceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewAttackSimulationSimulationsItemLandingPageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AttackSimulationSimulationsItemLandingPageRequestBuilder) {\n m := &AttackSimulationSimulationsItemLandingPageRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/security/attackSimulation/simulations/{simulation%2Did}/landingPage{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewIntentsDeviceManagementIntentItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IntentsDeviceManagementIntentItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewIntentsDeviceManagementIntentItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOutlookTasksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookTasksRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOutlookTasksRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSitesSiteItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSitesSiteItemRequestBuilder) {\n m := &ItemSitesSiteItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/groups/{group%2Did}/sites/{site%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemProfilePositionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProfilePositionsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemProfilePositionsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemManagedDevicesItemSecurityBaselineStatesSecurityBaselineStateItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemManagedDevicesItemSecurityBaselineStatesSecurityBaselineStateItemRequestBuilder) {\n m := &ItemManagedDevicesItemSecurityBaselineStatesSecurityBaselineStateItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/managedDevices/{managedDevice%2Did}/securityBaselineStates/{securityBaselineState%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilder) {\n m := &ItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/domains/{domain%2Did}/sharedEmailDomainInvitations/{sharedEmailDomainInvitation%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewEducationAssignmentItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EducationAssignmentItemRequestBuilder) {\n m := &EducationAssignmentItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/education/users/{educationUser%2Did}/assignments/{educationAssignment%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemPendingAccessReviewInstancesAccessReviewInstanceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPendingAccessReviewInstancesAccessReviewInstanceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemPendingAccessReviewInstancesAccessReviewInstanceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewCustomAuthenticationExtensionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CustomAuthenticationExtensionsRequestBuilder) {\n m := &CustomAuthenticationExtensionsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/identity/customAuthenticationExtensions{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewEntitlementManagementResourceRequestsItemResourceScopesItemResourceRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EntitlementManagementResourceRequestsItemResourceScopesItemResourceRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEntitlementManagementResourceRequestsItemResourceScopesItemResourceRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemInsightsTrendingTrendingItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInsightsTrendingTrendingItemRequestBuilder) {\n m := &ItemInsightsTrendingTrendingItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/insights/trending/{trending%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewCompaniesItemCompanyInformationCompanyInformationItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesItemCompanyInformationCompanyInformationItemRequestBuilder) {\n m := &CompaniesItemCompanyInformationCompanyInformationItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/financials/companies/{company%2Did}/companyInformation/{companyInformation%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewCompaniesCompanyItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesCompanyItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewCompaniesCompanyItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewClassesItemGroupRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClassesItemGroupRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewClassesItemGroupRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemTokenLifetimePoliciesTokenLifetimePolicyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenLifetimePoliciesTokenLifetimePolicyItemRequestBuilder) {\n m := &ItemTokenLifetimePoliciesTokenLifetimePolicyItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/applications/{application%2Did}/tokenLifetimePolicies/{tokenLifetimePolicy%2Did}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams\n m.requestAdapter = requestAdapter\n return m\n}", "func NewFeatureRolloutPolicyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FeatureRolloutPolicyItemRequestBuilder) {\n m := &FeatureRolloutPolicyItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/policies/featureRolloutPolicies/{featureRolloutPolicy%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemInformationProtectionSensitivityPolicySettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInformationProtectionSensitivityPolicySettingsRequestBuilder) {\n m := &ItemInformationProtectionSensitivityPolicySettingsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/informationProtection/sensitivityPolicySettings{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemItemsItemWorkbookWorksheetsItemChartsItemDataLabelsFormatRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemsItemWorkbookWorksheetsItemChartsItemDataLabelsFormatRequestBuilder) {\n m := &ItemItemsItemWorkbookWorksheetsItemChartsItemDataLabelsFormatRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/drives/{drive%2Did}/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewRiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewRiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewSchoolsItemUsersEducationUserItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SchoolsItemUsersEducationUserItemRequestBuilder) {\n m := &SchoolsItemUsersEducationUserItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/education/schools/{educationSchool%2Did}/users/{educationUser%2Did}\", pathParameters),\n }\n return m\n}", "func NewAssignmentDefaultsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AssignmentDefaultsRequestBuilder) {\n m := &AssignmentDefaultsRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/education/classes/{educationClass%2Did}/assignmentDefaults{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewDeviceLocalCredentialInfoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DeviceLocalCredentialInfoItemRequestBuilder) {\n m := &DeviceLocalCredentialInfoItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/deviceLocalCredentials/{deviceLocalCredentialInfo%2Did}{?%24select}\", pathParameters),\n }\n return m\n}" ]
[ "0.7817571", "0.6820168", "0.67984176", "0.6735601", "0.6698511", "0.6693382", "0.66908264", "0.6585633", "0.6532462", "0.6530671", "0.6504501", "0.64920276", "0.6485399", "0.6475157", "0.6458795", "0.6455845", "0.64397204", "0.6429171", "0.6412303", "0.63747364", "0.63693976", "0.6351515", "0.63487536", "0.6347527", "0.634297", "0.6329862", "0.6326253", "0.63166016", "0.6309028", "0.6305169", "0.62675554", "0.626409", "0.62630284", "0.62582195", "0.62473595", "0.6246728", "0.6232411", "0.6214407", "0.6201182", "0.6182644", "0.6166687", "0.616381", "0.6161265", "0.61594063", "0.61588264", "0.614264", "0.6136424", "0.6128863", "0.6125691", "0.6121567", "0.6115159", "0.61071944", "0.61047655", "0.60932994", "0.608864", "0.6087614", "0.6086927", "0.6076002", "0.60704046", "0.60625577", "0.6059158", "0.6058282", "0.6057276", "0.60480624", "0.6039209", "0.6033265", "0.6032172", "0.6020013", "0.60191053", "0.60111046", "0.6008203", "0.6006649", "0.600657", "0.60044104", "0.6001881", "0.59943634", "0.59776783", "0.5968798", "0.59632945", "0.59623456", "0.59527135", "0.59468335", "0.5939629", "0.5938086", "0.5936335", "0.5936204", "0.5933419", "0.5931588", "0.5919329", "0.5913865", "0.59113127", "0.5908489", "0.59022224", "0.589579", "0.5891993", "0.58778405", "0.587513", "0.58749396", "0.58707166", "0.5859311" ]
0.82037175
0
NewSignInItemRequestBuilder instantiates a new SignInItemRequestBuilder and sets the default values.
NewSignInItemRequestBuilder создает новый SignInItemRequestBuilder и устанавливает значения по умолчанию.
func NewSignInItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SignInItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl return NewSignInItemRequestBuilderInternal(urlParams, requestAdapter) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewSignInItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SignInItemRequestBuilder) {\n m := &SignInItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/auditLogs/signIns/{signIn%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemOnlineMeetingsItemRegistrationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOnlineMeetingsItemRegistrationRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOnlineMeetingsItemRegistrationRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewSiteItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SiteItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewSiteItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewStoreItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StoreItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewStoreItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemPhotoRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPhotoRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemPhotoRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSettingsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOutlookRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOutlookRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewOnlineMeetingsItemRegistrationRegistrantsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationRegistrantsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewOnlineMeetingsItemRegistrationRegistrantsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewEducationClassItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EducationClassItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEducationClassItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewChatItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ChatItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewChatItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewTeamItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewTeamItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemWindowsInformationProtectionDeviceRegistrationsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewTeamsAppItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsAppItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewTeamsAppItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemRegisteredUsersDirectoryObjectItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRegisteredUsersDirectoryObjectItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemRegisteredUsersDirectoryObjectItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewCompaniesItemCompanyInformationCompanyInformationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesItemCompanyInformationCompanyInformationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewCompaniesItemCompanyInformationCompanyInformationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewManagedAppRegistrationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedAppRegistrationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewManagedAppRegistrationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewGroupItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GroupItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewGroupItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSharedEmailDomainInvitationsSharedEmailDomainInvitationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSitesSiteItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSitesSiteItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSitesSiteItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewQnasQnaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*QnasQnaItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewQnasQnaItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOnlineMeetingsItemRegistrationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOnlineMeetingsItemRegistrationRequestBuilder) {\n m := &ItemOnlineMeetingsItemRegistrationRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/onlineMeetings/{onlineMeeting%2Did}/registration{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewKeySetsItemUploadCertificateRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeySetsItemUploadCertificateRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewKeySetsItemUploadCertificateRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewPrintersItemSharesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PrintersItemSharesRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewPrintersItemSharesRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewDeviceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DeviceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewDeviceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewCompaniesCompanyItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesCompanyItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewCompaniesCompanyItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemQuotaRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemQuotaRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemQuotaRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewEventItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEventItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewOnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewOnlineMeetingsItemRegistrationCustomQuestionsMeetingRegistrationQuestionItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOutlookTasksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookTasksRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOutlookTasksRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSpecialDriveItemItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSpecialDriveItemItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSpecialDriveItemItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewDepOnboardingSettingsItemEnrollmentProfilesItemSetDefaultProfileRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DepOnboardingSettingsItemEnrollmentProfilesItemSetDefaultProfileRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewDepOnboardingSettingsItemEnrollmentProfilesItemSetDefaultProfileRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemMailFoldersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMailFoldersRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemMailFoldersRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewEntitlementManagementResourceRequestsItemResourceScopesItemResourceRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EntitlementManagementResourceRequestsItemResourceScopesItemResourceRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEntitlementManagementResourceRequestsItemResourceScopesItemResourceRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewIntentsDeviceManagementIntentItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IntentsDeviceManagementIntentItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewIntentsDeviceManagementIntentItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewApiConnectorsIdentityApiConnectorItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiConnectorsIdentityApiConnectorItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewApiConnectorsIdentityApiConnectorItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewQnasQnaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*QnasQnaItemRequestBuilder) {\n m := &QnasQnaItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/search/qnas/{qna%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewItemProfilePositionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProfilePositionsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemProfilePositionsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemPhotoRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPhotoRequestBuilder) {\n m := &ItemPhotoRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/photo{?%24select}\", pathParameters),\n }\n return m\n}", "func NewSiteItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SiteItemRequestBuilder) {\n m := &SiteItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/sites/{site%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams\n m.requestAdapter = requestAdapter\n return m\n}", "func NewItemSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) {\n m := &ItemSettingsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/settings{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewMyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MyRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewMyRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewStoreItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StoreItemRequestBuilder) {\n m := &StoreItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/sites/{site%2Did}/termStores/{store%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemItemsItemWorkbookTablesWorkbookTableItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemsItemWorkbookTablesWorkbookTableItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemItemsItemWorkbookTablesWorkbookTableItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewPrivilegedSignupStatusItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PrivilegedSignupStatusItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewPrivilegedSignupStatusItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOutlookRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutlookRequestBuilder) {\n m := &ItemOutlookRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/outlook{?%24select}\", pathParameters),\n }\n return m\n}", "func NewItemPendingAccessReviewInstancesAccessReviewInstanceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPendingAccessReviewInstancesAccessReviewInstanceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemPendingAccessReviewInstancesAccessReviewInstanceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemTransitiveMembersDirectoryObjectItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTransitiveMembersDirectoryObjectItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemTransitiveMembersDirectoryObjectItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemDriveItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDriveItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemDriveItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemItemsItemWorkbookWorksheetsItemChartsItemDataLabelsFormatRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemsItemWorkbookWorksheetsItemChartsItemDataLabelsFormatRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemItemsItemWorkbookWorksheetsItemChartsItemDataLabelsFormatRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewSchoolsItemUsersEducationUserItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SchoolsItemUsersEducationUserItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewSchoolsItemUsersEducationUserItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewRiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewRiskyUsersItemHistoryRiskyUserHistoryItemItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewOnlineMeetingsItemRegistrationRegistrantsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OnlineMeetingsItemRegistrationRegistrantsRequestBuilder) {\n m := &OnlineMeetingsItemRegistrationRegistrantsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/communications/onlineMeetings/{onlineMeeting%2Did}/registration/registrants{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewSubjectRightsRequestItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubjectRightsRequestItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewSubjectRightsRequestItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewDirectoryObjectItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DirectoryObjectItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewDirectoryObjectItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewAttackSimulationSimulationsItemLandingPageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AttackSimulationSimulationsItemLandingPageRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewAttackSimulationSimulationsItemLandingPageRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewPrintersItemJobsPrintJobItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PrintersItemJobsPrintJobItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewPrintersItemJobsPrintJobItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemCalendarRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCalendarRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemCalendarRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewSignIn(ctx *middleware.Context, handler SignInHandler) *SignIn {\n\treturn &SignIn{Context: ctx, Handler: handler}\n}", "func NewManagedDeviceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedDeviceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewManagedDeviceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewConnectedOrganizationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ConnectedOrganizationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewConnectedOrganizationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func (m *ItemItemsDriveItemItemRequestBuilder) Checkin()(*ItemItemsItemCheckinRequestBuilder) {\n return NewItemItemsItemCheckinRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)\n}", "func NewClassesItemGroupRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClassesItemGroupRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewClassesItemGroupRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemJoinedTeamsItemPrimaryChannelMembersConversationMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemJoinedTeamsItemPrimaryChannelMembersConversationMemberItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemJoinedTeamsItemPrimaryChannelMembersConversationMemberItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemItemsDriveItemItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemsDriveItemItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemItemsDriveItemItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemManagedDevicesItemSecurityBaselineStatesSecurityBaselineStateItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemManagedDevicesItemSecurityBaselineStatesSecurityBaselineStateItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemManagedDevicesItemSecurityBaselineStatesSecurityBaselineStateItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemTodoListsItemTasksTodoTaskItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTodoListsItemTasksTodoTaskItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemTodoListsItemTasksTodoTaskItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func (m *SignInItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *SignInItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET\n requestInfo.Headers[\"Accept\"] = \"application/json\"\n if requestConfiguration != nil {\n if requestConfiguration.QueryParameters != nil {\n requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))\n }\n requestInfo.AddRequestHeaders(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "func NewAddKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AddKeyRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewAddKeyRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewThreatAssessmentRequestsThreatAssessmentRequestItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreatAssessmentRequestsThreatAssessmentRequestItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewThreatAssessmentRequestsThreatAssessmentRequestItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewEducationAssignmentItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EducationAssignmentItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEducationAssignmentItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewTeamItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamItemRequestBuilder) {\n m := &TeamItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/me/joinedTeams/{team%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewSubjectRightsRequestItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubjectRightsRequestItemRequestBuilder) {\n m := &SubjectRightsRequestItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/privacy/subjectRightsRequests/{subjectRightsRequest%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemTodoListsItemTasksItemAttachmentsCreateUploadSessionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTodoListsItemTasksItemAttachmentsCreateUploadSessionRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemTodoListsItemTasksItemAttachmentsCreateUploadSessionRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewVirtualEndpointUserSettingsCloudPcUserSettingItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*VirtualEndpointUserSettingsCloudPcUserSettingItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewVirtualEndpointUserSettingsCloudPcUserSettingItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewPayloadResponseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PayloadResponseItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewPayloadResponseItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemListsItemItemsItemActivitiesItemDriveItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemListsItemItemsItemActivitiesItemDriveItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemListsItemItemsItemActivitiesItemDriveItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewAppConsentAppConsentRequestsItemUserConsentRequestsItemApprovalStagesApprovalStageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppConsentAppConsentRequestsItemUserConsentRequestsItemApprovalStagesApprovalStageItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewAppConsentAppConsentRequestsItemUserConsentRequestsItemApprovalStagesApprovalStageItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemDevicesItemMemberOfDirectoryObjectItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDevicesItemMemberOfDirectoryObjectItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemDevicesItemMemberOfDirectoryObjectItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewDeviceConfigurationItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DeviceConfigurationItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewDeviceConfigurationItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemInformationProtectionSensitivityPolicySettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInformationProtectionSensitivityPolicySettingsRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemInformationProtectionSensitivityPolicySettingsRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemWindowsInformationProtectionDeviceRegistrationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder) {\n m := &ItemWindowsInformationProtectionDeviceRegistrationsRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/users/{user%2Did}/windowsInformationProtectionDeviceRegistrations{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "func NewUserFlowLanguagePageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UserFlowLanguagePageItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewUserFlowLanguagePageItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewChatItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ChatItemRequestBuilder) {\n m := &ChatItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/users/{user%2Did}/chats/{chat%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemPrimaryChannelSharedWithTeamsSharedWithChannelTeamInfoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrimaryChannelSharedWithTeamsSharedWithChannelTeamInfoItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemPrimaryChannelSharedWithTeamsSharedWithChannelTeamInfoItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemOnenoteNotebooksItemSectionsItemPagesOnenotePageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOnenoteNotebooksItemSectionsItemPagesOnenotePageItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemOnenoteNotebooksItemSectionsItemPagesOnenotePageItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewManagedAppRegistrationItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManagedAppRegistrationItemRequestBuilder) {\n m := &ManagedAppRegistrationItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/deviceAppManagement/managedAppRegistrations/{managedAppRegistration%2Did}{?%24select,%24expand}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewMeAssignmentsItemSubmissionsItemResourcesEducationSubmissionResourceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MeAssignmentsItemSubmissionsItemResourcesEducationSubmissionResourceItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewMeAssignmentsItemSubmissionsItemResourcesEducationSubmissionResourceItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewRequestBuilder(baseURL string, token string, app *cli.App) *RequestBuilder {\n\tvar builder RequestBuilder\n\tbuilder.baseURL = baseURL\n\tbuilder.token = token\n\tbuilder.userAgent = fmt.Sprintf(\"%s/%s\", app.Name, app.Version)\n\treturn &builder\n}", "func NewTeamTemplateDefinitionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamTemplateDefinitionItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewTeamTemplateDefinitionItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewIdentityGovernanceRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IdentityGovernanceRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewIdentityGovernanceRequestBuilderInternal(urlParams, requestAdapter)\n}", "func (b *PurchaseInvoiceLineRequestBuilder) Item() *ItemRequestBuilder {\n\tbb := &ItemRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}\n\tbb.baseURL += \"/item\"\n\treturn bb\n}", "func NewItemInsightsTrendingTrendingItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInsightsTrendingTrendingItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemInsightsTrendingTrendingItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewIntentsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IntentsCountRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewIntentsCountRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewNotificationMessageTemplatesNotificationMessageTemplateItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NotificationMessageTemplatesNotificationMessageTemplateItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewNotificationMessageTemplatesNotificationMessageTemplateItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewTeamworkRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamworkRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewTeamworkRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewEducationClassItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EducationClassItemRequestBuilder) {\n m := &EducationClassItemRequestBuilder{\n }\n m.urlTemplate = \"{+baseurl}/education/schools/{educationSchool%2Did}/classes/{educationClass%2Did}\";\n urlTplParams := make(map[string]string)\n for idx, item := range pathParameters {\n urlTplParams[idx] = item\n }\n m.pathParameters = urlTplParams;\n m.requestAdapter = requestAdapter;\n return m\n}", "func NewItemTransitiveMembersItemGraphServicePrincipalRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTransitiveMembersItemGraphServicePrincipalRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemTransitiveMembersItemGraphServicePrincipalRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewCompaniesItemItemCategoriesItemCategoryItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesItemItemCategoriesItemCategoryItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewCompaniesItemItemCategoriesItemCategoryItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemSitesItemAnalyticsItemActivityStatsItemActivityStatItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSitesItemAnalyticsItemActivityStatsItemActivityStatItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemSitesItemAnalyticsItemActivityStatsItemActivityStatItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func NewItemTokenLifetimePoliciesTokenLifetimePolicyItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenLifetimePoliciesTokenLifetimePolicyItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewItemTokenLifetimePoliciesTokenLifetimePolicyItemRequestBuilderInternal(urlParams, requestAdapter)\n}" ]
[ "0.71854013", "0.6183314", "0.61416644", "0.6106175", "0.60573894", "0.6029274", "0.60251683", "0.59547544", "0.58809215", "0.5861404", "0.58487034", "0.58435464", "0.5836316", "0.57725453", "0.57585907", "0.57419944", "0.5733746", "0.57195973", "0.57034683", "0.5679502", "0.56650156", "0.5663183", "0.56584597", "0.56578", "0.5631053", "0.5614785", "0.56083125", "0.5596206", "0.5593193", "0.558679", "0.55587167", "0.5548372", "0.5528531", "0.55271375", "0.5526847", "0.5522988", "0.5507151", "0.5487128", "0.54810524", "0.54779243", "0.5477466", "0.54634184", "0.54627305", "0.54616356", "0.5457492", "0.5420168", "0.5415661", "0.54128623", "0.5408745", "0.5407204", "0.5397908", "0.53780997", "0.535325", "0.5343795", "0.5338404", "0.53288716", "0.5326664", "0.5320787", "0.5312548", "0.53100616", "0.53027374", "0.53002715", "0.52988034", "0.5287912", "0.5244751", "0.52443755", "0.5235349", "0.52343", "0.52265435", "0.5218579", "0.5216464", "0.5214007", "0.521371", "0.52073973", "0.52059454", "0.52048945", "0.51977664", "0.5190874", "0.5182738", "0.51808363", "0.51773286", "0.5173355", "0.5168597", "0.51600987", "0.5141667", "0.5125762", "0.51159513", "0.5106618", "0.5106539", "0.5103521", "0.51015973", "0.5095655", "0.509344", "0.5084818", "0.5084589", "0.5075034", "0.5072429", "0.5067342", "0.5066531", "0.5062873" ]
0.767015
0
getInstallationType returns the installation type as either CORE or FULL.
getInstallationType возвращает тип установки в виде CORE или FULL.
func getInstallationType(installationType string) (string, error) { switch installationType { case installationTypeServer: return windowsServerFull, nil case installationTypeServerCore: return windowsServerCore, nil default: return "", errors.Errorf("unsupported installation type: %s", installationType) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *DeeplinkRule) GetInstallType() string {\n\tif o == nil || o.InstallType == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.InstallType\n}", "func (o *AddOn) GetInstallMode() (value AddOnInstallMode, ok bool) {\n\tok = o != nil && o.bitmap_&512 != 0\n\tif ok {\n\t\tvalue = o.installMode\n\t}\n\treturn\n}", "func (s *StatusEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}", "func (t *TeamEvent) GetInstallation() *Installation {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Installation\n}", "func (g *GollumEvent) GetInstallation() *Installation {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Installation\n}", "func (t *TeamAddEvent) GetInstallation() *Installation {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Installation\n}", "func (d *DeploymentStatusEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}", "func (o *ApplianceSetupInfoAllOf) GetBuildType() string {\n\tif o == nil || o.BuildType == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.BuildType\n}", "func (c *CheckSuiteEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}", "func (o *DeeplinkRule) GetInstallTypeOk() (*string, bool) {\n\tif o == nil || o.InstallType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.InstallType, true\n}", "func (i *InstallationEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}", "func (w *WatchEvent) GetInstallation() *Installation {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Installation\n}", "func (l *LabelEvent) GetInstallation() *Installation {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Installation\n}", "func (c *CreateEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}", "func (o *OrganizationEvent) GetInstallation() *Installation {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Installation\n}", "func (c *CheckRunEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}", "func (m *MembershipEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}", "func (o *OrgBlockEvent) GetInstallation() *Installation {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Installation\n}", "func (f *ForkEvent) GetInstallation() *Installation {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Installation\n}", "func (d *DeploymentEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}", "func (m *MilestoneEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}", "func (m *WindowsInformationProtectionDeviceRegistration) GetDeviceType()(*string) {\n val, err := m.GetBackingStore().Get(\"deviceType\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (p *ProjectColumnEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (r *RepositoryEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}", "func (d *DeleteEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}", "func (m *MemberEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}", "func (p *ProjectCardEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (p *PingEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (p *ProjectEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (i *IssuesEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}", "func (p *PushEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (r *ReleaseEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}", "func (p *PullRequestEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (p *PublicEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (o *AddOn) InstallMode() AddOnInstallMode {\n\tif o != nil && o.bitmap_&512 != 0 {\n\t\treturn o.installMode\n\t}\n\treturn AddOnInstallMode(\"\")\n}", "func (i *InstallationRepositoriesEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}", "func (p *PullRequestReviewEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (o *OsInstallAllOf) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (o *HclFirmware) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (x BrowserApplicationEntity) GetAgentInstallType() BrowserAgentInstallType {\n\treturn x.AgentInstallType\n}", "func (c *CommitCommentEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}", "func GetBuiltinProcessorType(programHash hashing.HashValue) (string, bool) {\n\tif _, err := core.GetProcessor(programHash); err == nil {\n\t\treturn core.VMType, true\n\t}\n\tif _, ok := native.GetProcessor(programHash); ok {\n\t\treturn native.VMType, true\n\t}\n\treturn \"\", false\n}", "func (p *PageBuildEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (m *Win32LobAppRegistryRule) GetOperationType()(*Win32LobAppRegistryRuleOperationType) {\n return m.operationType\n}", "func (m *MarketplacePurchaseEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}", "func (o *LogsShowOptions) Installation() string {\n\treturn o.installationOptions.Name\n}", "func (o UsageLimitOutput) FeatureType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *UsageLimit) pulumi.StringOutput { return v.FeatureType }).(pulumi.StringOutput)\n}", "func getRegistryType(fullType string) *registry.Type {\n\ttList := strings.Split(fullType, \":\")\n\tif len(tList) != 2 {\n\t\treturn nil\n\t}\n\n\treturn &registry.Type{\n\t\tName: tList[0],\n\t\tVersion: tList[1],\n\t}\n}", "func (o *DeeplinkRule) SetInstallType(v string) {\n\to.InstallType = &v\n}", "func (m *User) GetCreationType()(*string) {\n return m.creationType\n}", "func getDeviceType(r apis.RaidGroup) string {\n\tif r.IsReadCache {\n\t\treturn DeviceTypeReadCache\n\t} else if r.IsSpare {\n\t\treturn DeviceTypeSpare\n\t} else if r.IsWriteCache {\n\t\treturn DeviceTypeWriteCache\n\t}\n\treturn DeviceTypeEmpty\n}", "func (i *Installation) GetTargetType() string {\n\tif i == nil || i.TargetType == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.TargetType\n}", "func (i *IssueCommentEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}", "func (s Shop) GetShopTypeString() (result string) {\n\treturn shopTypesEnum[s.Type]\n}", "func (o *ApplianceClusterInstallPhase) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (f *feature) GetType() FeatureTypes {\n\treturn f.Type\n}", "func (m *AgreementAcceptance) GetDeviceOSType()(*string) {\n return m.deviceOSType\n}", "func (o *DhcpLease6DataData) GetServer6Type() string {\n\tif o == nil || o.Server6Type == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Server6Type\n}", "func (p *PullRequestReviewCommentEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}", "func (sqlStore *SQLStore) GetClusterInstallation(id string) (*model.ClusterInstallation, error) {\n\tvar clusterInstallation model.ClusterInstallation\n\terr := sqlStore.getBuilder(sqlStore.db, &clusterInstallation,\n\t\tclusterInstallationSelect.Where(\"ID = ?\", id),\n\t)\n\tif err == sql.ErrNoRows {\n\t\treturn nil, nil\n\t} else if err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to get cluster installation by id\")\n\t}\n\n\treturn &clusterInstallation, nil\n}", "func GetServiceStartType(name string) (string, error) {\n\tfmt.Printf(\"Executing GetServiceStartType for: %s\\n\", name)\n\tvar starttype string\n\n\tvar keypath = fmt.Sprintf(\"SYSTEM\\\\CurrentControlSet\\\\services\\\\%s\", name)\n\n\tk, err := registry.OpenKey(registry.LOCAL_MACHINE, keypath, registry.QUERY_VALUE)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer k.Close()\n\n\t//var s string\n\ts, err := GetKeyIntValues(k, \"Start\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"%v\", s)\n\n\tswitch s {\n\tdefault:\n\t\tstarttype = \"unknown\"\n\tcase 2:\n\t\tstarttype = \"automatic\"\n\tcase 3:\n\t\tstarttype = \"manual\"\n\tcase 4:\n\t\tstarttype = \"disabled\"\n\t}\n\n\treturn starttype, nil\n}", "func (f *Frontend) GetAuthType() uint32 {\n\treturn f.authType\n}", "func (op *ThreeDEnrollmentAssembly) GetOperationType() structures.OperationType {\n\treturn op.opHTTPData.GetOperationType()\n}", "func (o *DeeplinkRule) HasInstallType() bool {\n\tif o != nil && o.InstallType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (fOpenCfg *FileOpenConfig) GetFileOpenType() FileOpenType {\n\n if fOpenCfg.fileOpenModes == nil {\n fOpenCfg.fileOpenModes = make([]FileOpenMode, 0)\n }\n\n return fOpenCfg.fileOpenType\n}", "func (sfs *SuiteFS) OSType() avfs.OSType {\n\treturn sfs.osType\n}", "func (m *WindowsInformationProtectionAppLearningSummary) GetApplicationType()(*ApplicationType) {\n return m.applicationType\n}", "func (hfsc *HfscClass) Type() string {\n\treturn \"hfsc\"\n}", "func (b *baseSysInit) Type() string {\n\treturn b.sysInitType\n}", "func (pier *Pier) Type() string {\n\tif pier.config.Mode.Type != repo.UnionMode {\n\t\treturn pier.plugin.Type()\n\t}\n\treturn repo.UnionMode\n}", "func (d Definition) GetExecutableType() *ExecutableType {\n\tt := ExecutableTypeDefinition\n\treturn &t\n}", "func (rc *RequiredCapability) GetType() string {\n\treturn \"deliveryservice.RequiredCapability\"\n}", "func (o *ApplianceSetupInfoAllOf) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (o GuestOsFeatureResponseOutput) Type() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GuestOsFeatureResponse) string { return v.Type }).(pulumi.StringOutput)\n}", "func (o *FirmwareSwitchUpgrade) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (o *Ga4ghChemotherapy) GetType() string {\n\tif o == nil || o.Type == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Type\n}", "func (o *ShowSystem) GetType() string {\n\tif o == nil || IsNil(o.Type) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Type\n}", "func (o *Ga4ghFeature) GetFeatureType() Ga4ghOntologyTerm {\n\tif o == nil || o.FeatureType == nil {\n\t\tvar ret Ga4ghOntologyTerm\n\t\treturn ret\n\t}\n\treturn *o.FeatureType\n}", "func (e *Huobi) GetType() string {\n\treturn e.option.Type\n}", "func (o *WorkflowCliCommandAllOf) GetType() string {\n\tif o == nil || o.Type == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Type\n}", "func (o *HyperflexServerFirmwareVersionEntryAllOf) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func GetJobType(ctx context.Context, clientConfig *rest.Config) (*JobType, error) {\n\tconfigClient, err := configclient.NewForConfig(clientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tinfrastructure, err := configClient.Infrastructures().Get(ctx, \"cluster\", metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclusterVersion, err := configClient.ClusterVersions().Get(ctx, \"version\", metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnetwork, err := configClient.Networks().Get(ctx, \"cluster\", metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tarchitecture, err := getArchitecture(clientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trelease := VersionFromHistory(clusterVersion.Status.History[0])\n\n\tfromRelease := \"\"\n\tif len(clusterVersion.Status.History) > 1 {\n\t\tfromRelease = VersionFromHistory(clusterVersion.Status.History[1])\n\t}\n\n\tplatform := \"\"\n\tswitch infrastructure.Status.PlatformStatus.Type {\n\tcase configv1.AWSPlatformType:\n\t\tplatform = \"aws\"\n\tcase configv1.GCPPlatformType:\n\t\tplatform = \"gcp\"\n\tcase configv1.AzurePlatformType:\n\t\tplatform = \"azure\"\n\tcase configv1.VSpherePlatformType:\n\t\tplatform = \"vsphere\"\n\tcase configv1.BareMetalPlatformType:\n\t\tplatform = \"metal\"\n\tcase configv1.OvirtPlatformType:\n\t\tplatform = \"ovirt\"\n\tcase configv1.OpenStackPlatformType:\n\t\tplatform = \"openstack\"\n\tcase configv1.LibvirtPlatformType:\n\t\tplatform = \"libvirt\"\n\t}\n\n\tnetworkType := \"\"\n\tswitch network.Status.NetworkType {\n\tcase \"OpenShiftSDN\":\n\t\tnetworkType = \"sdn\"\n\tcase \"OVNKubernetes\":\n\t\tnetworkType = \"ovn\"\n\t}\n\n\ttopology := \"\"\n\tswitch infrastructure.Status.ControlPlaneTopology {\n\tcase configv1.HighlyAvailableTopologyMode:\n\t\ttopology = \"ha\"\n\tcase configv1.SingleReplicaTopologyMode:\n\t\ttopology = \"single\"\n\t}\n\n\treturn &JobType{\n\t\tRelease: release,\n\t\tFromRelease: fromRelease,\n\t\tPlatform: platform,\n\t\tArchitecture: architecture,\n\t\tNetwork: networkType,\n\t\tTopology: topology,\n\t}, nil\n}", "func (m *TeamsAsyncOperation) GetOperationType()(*TeamsAsyncOperationType) {\n return m.operationType\n}", "func (delivery_instructions DeliveryInstructions) DeliveryType() (byte, error) {\n\tif len(delivery_instructions) >= 1 {\n\t\t/*\n\t\t Check if the 6-5 bits of the Delivery Instructions\n\t\t are set using binary AND operator to determine\n\t\t the delivery type\n\n\t\t xx0?xxxx\n\t\t &00110000 bit shift\n\t\t ---------\n\t\t 000?0000 >> 4 => n\t(DT_* consts)\n\t\t*/\n\t\treturn ((delivery_instructions[0] & 0x30) >> 4), nil\n\t}\n\treturn 0, errors.New(\"DeliveryInstructions contains no data\")\n}", "func (myOperatingSystemType *OperatingSystemType) Type() (param string) {\n\treturn myOperatingSystemType.Typevar\n}", "func (sys *Sys) GetOsType() int {\n\tlog.Debugln(\"GetOsType ENTER\")\n\n\tosType := OsUnknown\n\tif sys.fs.DoesFileExist(\"/etc/redhat-release\") {\n\t\tosType = OsRhel\n\t} else if sys.fs.DoesFileExist(\"/etc/SuSE-release\") {\n\t\tosType = OsSuse\n\t} else if sys.fs.DoesFileExist(\"/etc/lsb-release\") {\n\t\tosType = OsUbuntu\n\t\t//\t} else if sys.fs.DoesFileExist(\"/etc/release\") {\n\t\t//\t\treturn OsCoreOs\n\t} else {\n\t\tout, err := sys.run.CommandOutput(\"uname -s\")\n\t\tif err == nil && strings.EqualFold(out, \"Darwin\") {\n\t\t\tosType = OsMac\n\t\t} else {\n\t\t\tlog.Warnln(\"Unable to determine OS type\")\n\t\t}\n\t}\n\n\tlog.Debugln(\"GetOsType =\", osType)\n\tlog.Debugln(\"GetOsType LEAVE\")\n\treturn osType\n}", "func (o *CatalogEntry) GetType() string {\n\tif o == nil || o.Type == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Type\n}", "func (o *Application) GetType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Type\n}", "func (o LookupServiceIntegrationResultOutput) IntegrationType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupServiceIntegrationResult) string { return v.IntegrationType }).(pulumi.StringOutput)\n}", "func (op *ChargeDMSAssembly) GetOperationType() structures.OperationType {\n\treturn op.opHTTPData.GetOperationType()\n}", "func GetType(args []string) (Type, string) {\n\tif len(args) == 1 {\n\t\treturn Hotseat, \"\"\n\t}\n\n\tswitch args[1] {\n\tcase \"hotseat\", \"\":\n\t\treturn Hotseat, \"\"\n\tcase \"server\":\n\t\treturn Server, \"\"\n\tcase \"client\":\n\t\tif len(args) < 3 {\n\t\t\treturn Unknown, \"\"\n\t\t}\n\n\t\treturn Client, args[2]\n\tdefault:\n\t\treturn Unknown, \"\"\n\t}\n}", "func (o *WorkflowServiceItemInputDefinitionType) GetOperationType() string {\n\tif o == nil || o.OperationType == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.OperationType\n}", "func getOperationType(op iop.OperationInput) (operationType, error) {\n\thasAccount := op.Account != nil\n\thasTransaction := op.Transaction != nil\n\tif hasAccount == hasTransaction {\n\t\treturn operationTypeUnknown, errors.New(`Must have exactly 1 of \"account\" or \"transaction\" fields set`)\n\t}\n\tif hasAccount {\n\t\treturn operationTypeCreateAccount, nil\n\t}\n\treturn operationTypePerformTransaction, nil\n}", "func (o *CapabilityChassisUpgradeSupportMeta) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (o *Wireless) GetType() string {\n\tif o == nil || o.Type == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Type\n}", "func (m *DirectoryAudit) GetOperationType()(*string) {\n return m.operationType\n}", "func (o LookupOccurrenceResultOutput) Installation() InstallationResponseOutput {\n\treturn o.ApplyT(func(v LookupOccurrenceResult) InstallationResponse { return v.Installation }).(InstallationResponseOutput)\n}", "func (o LaunchOutput) Type() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Launch) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)\n}", "func WindowsType() {\n\tk, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion`, registry.QUERY_VALUE)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer k.Close()\n\n\ts, _, err := k.GetStringValue(\"EditionID\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif strings.Contains(s, \"Server\") {\n\t\tWindowsServerChecks()\n\t} else {\n\t\tWindowsWorkstationChecks()\n\t}\n}", "func (c *HelmChecker) Type() string {\n\treturn \"helm\"\n}" ]
[ "0.6033674", "0.5655952", "0.56538004", "0.5569289", "0.55534506", "0.548555", "0.5389482", "0.5383159", "0.5381609", "0.5369444", "0.5359032", "0.535424", "0.5350281", "0.5324424", "0.53146684", "0.53101766", "0.5280007", "0.527056", "0.52111757", "0.5170026", "0.51604617", "0.51366985", "0.51145387", "0.5097783", "0.5093557", "0.5078023", "0.5060769", "0.50563693", "0.50511837", "0.505094", "0.50452363", "0.4992309", "0.49842468", "0.49731275", "0.49673718", "0.4965296", "0.49550244", "0.49494997", "0.49314782", "0.49302647", "0.4928891", "0.4915626", "0.49063194", "0.48870093", "0.48864883", "0.4837161", "0.481991", "0.48099655", "0.48093915", "0.48021933", "0.47952786", "0.4782228", "0.47732055", "0.47651702", "0.47411346", "0.47361043", "0.47347075", "0.47337317", "0.4726894", "0.47178358", "0.47170824", "0.47110963", "0.47067788", "0.46919557", "0.46878532", "0.46721837", "0.46677005", "0.4666119", "0.46556342", "0.4650546", "0.46498632", "0.46222374", "0.46216455", "0.4619405", "0.46141934", "0.46060076", "0.4605461", "0.46022245", "0.45997956", "0.4594698", "0.4586719", "0.45812336", "0.45794708", "0.4579423", "0.45742208", "0.45722634", "0.45704803", "0.45678023", "0.456203", "0.45602354", "0.45563012", "0.45496014", "0.4541367", "0.45337725", "0.45252147", "0.4509512", "0.45066223", "0.45063955", "0.45061666", "0.45055518" ]
0.7311128
0
GetOSFamily returns the operating system family string. On Windows, it would be of the format "WINDOWS_SERVER__" In case of any exception this method just returns "windows" as operating system family.
GetOSFamily возвращает строку, представляющую семейство операционной системы. На Windows она будет иметь формат "WINDOWS_SERVER__". В случае возникновения любой ошибки этот метод просто возвращает "windows" как семейство операционной системы.
func GetOSFamily() string { // Find the build number of the os on which agent is running. versionInfo := windowsGetVersionFunc() buildNumber := int(versionInfo.BuildNumber) osRelease, ok := osReleaseFromBuildNumber[buildNumber] if !ok { seelog.Errorf("windows release with build number [%d] is unsupported", buildNumber) return unsupportedWindowsOSFamily } // Find the installation type from the Windows registry. key, err := winRegistry.OpenKey(ecsWinRegistryRootKey, ecsWinRegistryRootPath, registry.QUERY_VALUE) if err != nil { seelog.Errorf("unable to open Windows registry key to determine Windows installation type: %v", err) return unsupportedWindowsOSFamily } defer key.Close() installationType, _, err := key.GetStringValue("InstallationType") if err != nil { seelog.Errorf("unable to read registry key, InstallationType: %v", err) return unsupportedWindowsOSFamily } iType, err := getInstallationType(installationType) if err != nil { seelog.Errorf("invalid Installation type found: %v", err) return unsupportedWindowsOSFamily } // Construct the OSFamily attribute from the OS release and installation type. osFamily := fmt.Sprintf(osFamilyFormat, osRelease, iType) seelog.Debugf("operating system family is: %s", osFamily) return osFamily }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetOperatingSystemFamily() string {\n\tkey, err := winRegistry.OpenKey(ecsWinRegistryRootKey, ecsWinRegistryRootPath, registry.QUERY_VALUE)\n\tif err != nil {\n\t\tseelog.Errorf(\"Unable to open Windows registry key to determine Windows version: %v\", err)\n\t\treturn unsupportedWindowsOS\n\t}\n\tdefer key.Close()\n\n\tproductName, _, err := key.GetStringValue(\"ProductName\")\n\tif err != nil {\n\t\tseelog.Errorf(\"Unable to read registry key, ProductName: %v\", err)\n\t\treturn unsupportedWindowsOS\n\t}\n\tinstallationType, _, err := key.GetStringValue(\"InstallationType\")\n\tif err != nil {\n\t\tseelog.Errorf(\"Unable to read registry key, InstallationType: %v\", err)\n\t\treturn unsupportedWindowsOS\n\t}\n\tiType, err := getInstallationType(installationType)\n\tif err != nil {\n\t\tseelog.Errorf(\"Invalid Installation type found: %v\", err)\n\t\treturn unsupportedWindowsOS\n\t}\n\n\treleaseId := \"\"\n\tif strings.HasPrefix(productName, windowsServerDataCenter) {\n\t\treleaseIdFromRegistry, _, err := key.GetStringValue(\"ReleaseId\")\n\t\tif err != nil {\n\t\t\tseelog.Errorf(\"Unable to read registry key, ReleaseId: %v\", err)\n\t\t\treturn unsupportedWindowsOS\n\t\t}\n\n\t\treleaseId, err = getReleaseIdForLTSCReleases(releaseIdFromRegistry)\n\t\tif err != nil {\n\t\t\tseelog.Errorf(\"Failed to construct releaseId for Windows LTSC, Error: %v\", err)\n\t\t\treturn unsupportedWindowsOS\n\t\t}\n\t} else {\n\t\treleaseId, err = getReleaseIdForSACReleases(productName)\n\t\tif err != nil {\n\t\t\tseelog.Errorf(\"Failed to construct releaseId for Windows SAC, Error: %v\", err)\n\t\t\treturn unsupportedWindowsOS\n\t\t}\n\t}\n\treturn fmt.Sprintf(osTypeFormat, releaseId, iType)\n}", "func (o *Wireless) GetFamily() string {\n\tif o == nil || o.Family == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Family\n}", "func GetOsFamilyEnumStringValues() []string {\n\treturn []string{\n\t\t\"ORACLE_LINUX_9\",\n\t\t\"ORACLE_LINUX_8\",\n\t\t\"ORACLE_LINUX_7\",\n\t}\n}", "func OSFamily_Values() []string {\n\treturn []string{\n\t\tOSFamilyWindowsServer2019Full,\n\t\tOSFamilyWindowsServer2019Core,\n\t\tOSFamilyWindowsServer2016Full,\n\t\tOSFamilyWindowsServer2004Core,\n\t\tOSFamilyWindowsServer2022Core,\n\t\tOSFamilyWindowsServer2022Full,\n\t\tOSFamilyWindowsServer20h2Core,\n\t\tOSFamilyLinux,\n\t}\n}", "func GetOS() string {\n\tm := map[string]string{\n\t\t\"android\": \"Android\",\n\t\t\"freebsd\": \"FreeBSD\",\n\t\t\"linux\": \"Linux\",\n\t\t// iOS is not supported by Go\n\t\t\"darwin\": \"Mac OS\",\n\t\t\"openbsd\": \"OpenBSD\",\n\t\t\"windows\": \"Windows\",\n\t}\n\treturn m[runtime.GOOS]\n}", "func GetFamily(address string) (string, error) {\n\tparsed := net.ParseIP(address)\n\tif parsed.To4() != nil {\n\t\treturn upcloud.IPAddressFamilyIPv4, nil\n\t}\n\tif parsed.To16() != nil {\n\t\treturn upcloud.IPAddressFamilyIPv6, nil\n\t}\n\tip, _, err := net.ParseCIDR(address)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"%s is an invalid ip address\", address)\n\t}\n\tif ip.To4() != nil {\n\t\treturn upcloud.IPAddressFamilyIPv4, nil\n\t}\n\tif ip.To16() != nil {\n\t\treturn upcloud.IPAddressFamilyIPv6, nil\n\t}\n\treturn \"\", fmt.Errorf(\"%s is an invalid ip address\", address)\n}", "func (m *RIBMessage) Family() string {\n\treturn m.AFI + \" \" + m.SAFI\n}", "func (o SkuPtrOutput) Family() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Sku) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Family\n\t}).(pulumi.StringPtrOutput)\n}", "func OS() string {\n\t// If you're wondering why we have this function that just returns\n\t// runtime.GOOS written differently: in the old days, Go reported\n\t// GOOS=darwin for both iOS and macOS, so we needed this function to\n\t// differentiate them. Then a later Go release added GOOS=ios as a separate\n\t// platform, but by then the \"iOS\" and \"macOS\" values we'd picked, with that\n\t// exact capitalization, were already baked into databases.\n\tif IsAppleTV() {\n\t\treturn \"tvOS\"\n\t}\n\tif runtime.GOOS == \"ios\" {\n\t\treturn \"iOS\"\n\t}\n\tif runtime.GOOS == \"darwin\" {\n\t\treturn \"macOS\"\n\t}\n\treturn runtime.GOOS\n}", "func normalizeOS(name string) string {\n\tsp := strings.SplitN(name, \" \", 3)\n\tif len(sp) != 3 || sp[1] != \"NT\" {\n\t\treturn name\n\t}\n\n\tswitch sp[2] {\n\tcase \"5.0\":\n\t\treturn \"Windows 2000\"\n\tcase \"5.01\":\n\t\treturn \"Windows 2000, Service Pack 1 (SP1)\"\n\tcase \"5.1\":\n\t\treturn \"Windows XP\"\n\tcase \"5.2\":\n\t\treturn \"Windows XP x64 Edition\"\n\tcase \"6.0\":\n\t\treturn \"Windows Vista\"\n\tcase \"6.1\":\n\t\treturn \"Windows 7\"\n\tcase \"6.2\":\n\t\treturn \"Windows 8\"\n\tcase \"6.3\":\n\t\treturn \"Windows 8.1\"\n\tcase \"10.0\":\n\t\treturn \"Windows 10\"\n\t}\n\treturn name\n}", "func (s *RuntimePlatform) SetOperatingSystemFamily(v string) *RuntimePlatform {\n\ts.OperatingSystemFamily = &v\n\treturn s\n}", "func GetMappingOsFamilyEnum(val string) (OsFamilyEnum, bool) {\n\tenum, ok := mappingOsFamilyEnumLowerCase[strings.ToLower(val)]\n\treturn enum, ok\n}", "func (o SkuResponsePtrOutput) Family() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *SkuResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Family\n\t}).(pulumi.StringPtrOutput)\n}", "func (o SkuOutput) Family() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Sku) *string { return v.Family }).(pulumi.StringPtrOutput)\n}", "func GetFamily(c syscall.Conn) (uint16, error) {\n\tvar err2 error\n\tvar family uint16\n\n\tsc, err := c.SyscallConn()\n\tif err != nil {\n\t\treturn family, err\n\t}\n\n\terr = sc.Control(func(fd uintptr) {\n\t\tvar sa syscall.Sockaddr\n\n\t\tsa, err2 = syscall.Getsockname(int(fd))\n\t\tif err2 != nil {\n\t\t\treturn\n\t\t}\n\n\t\tswitch sa.(type) {\n\t\tcase *syscall.SockaddrInet4:\n\t\t\tfamily = FamilyIPv4\n\t\tcase *syscall.SockaddrInet6:\n\t\t\tfamily = FamilyIPv6\n\t\tdefault:\n\t\t\terr2 = errors.New(\"unknown address family\")\n\t\t}\n\t})\n\n\tif err2 != nil {\n\t\treturn family, err2\n\t}\n\treturn family, err\n}", "func GetOperatingSystem() (string, error) {\n\tif prettyName, err := getValueFromOsRelease(\"PRETTY_NAME\"); err != nil {\n\t\treturn \"\", err\n\t} else if prettyName != \"\" {\n\t\treturn prettyName, nil\n\t}\n\n\t// If not set, defaults to PRETTY_NAME=\"Linux\"\n\t// c.f. http://www.freedesktop.org/software/systemd/man/os-release.html\n\treturn \"Linux\", nil\n}", "func (a *ArtifactSpec) Family() ArtifactSpec_Name {\n\treturn a.Name.Family()\n}", "func (a ArtifactSpec_Name) Family() ArtifactSpec_Name {\n\tif a.ArtifactType() == ArtifactSpec_STONE_INGREDIENT {\n\t\treturn a.CorrespondingStone()\n\t}\n\treturn a\n}", "func (addr *Sockaddr) Family() int {\n\tif ifconfig.IsIPv4(addr.IP) {\n\t\treturn syscall.AF_INET\n\t}\n\treturn syscall.AF_INET6\n}", "func (_this *FontFace) Family() string {\n\tvar ret string\n\tvalue := _this.Value_JS.Get(\"family\")\n\tret = (value).String()\n\treturn ret\n}", "func (o LookupImageResultOutput) Family() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupImageResult) string { return v.Family }).(pulumi.StringOutput)\n}", "func (o SkuResponseOutput) Family() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v SkuResponse) *string { return v.Family }).(pulumi.StringPtrOutput)\n}", "func (s *SubsetFontObj) GetFamily() string {\n\treturn s.Family\n}", "func GetOS() []string {\n\tres := []string{runtime.GOOS}\n\tif runtime.GOOS == \"windows\" {\n\t\t// Adding win since some repositories release with that as the indicator of a windows binary\n\t\tres = append(res, \"win\")\n\t}\n\treturn res\n}", "func OS() string {\n\tif runtime.GOOS == \"ios\" {\n\t\treturn \"iOS\"\n\t}\n\tif runtime.GOOS == \"darwin\" {\n\t\treturn \"macOS\"\n\t}\n\treturn runtime.GOOS\n}", "func (o TaskDefinitionOutput) Family() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *TaskDefinition) pulumi.StringOutput { return v.Family }).(pulumi.StringOutput)\n}", "func (o *Tier) GetFamily() string {\n\tif o == nil || o.Family == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Family\n}", "func (sys *Sys) GetOsStrByType(iType int) string {\n\tlog.Debugln(\"GetOsStrByType ENTER\")\n\n\tosStr := \"Unknown\"\n\tswitch iType {\n\tcase OsRhel:\n\t\tosStr = \"RHEL\"\n\tcase OsSuse:\n\t\tosStr = \"SUSE\"\n\tcase OsUbuntu:\n\t\tosStr = \"Ubuntu\"\n\tcase OsCoreOs:\n\t\tosStr = \"CoreOS\"\n\tcase OsMac:\n\t\tosStr = \"OSX\"\n\t}\n\n\tlog.Debugln(\"GetOsStrByType =\", osStr)\n\tlog.Debugln(\"GetOsStrByType LEAVE\")\n\treturn osStr\n}", "func (s *font) GetFamily() string {\n\treturn s.family\n}", "func Family(from string) (string, error) {\n\treturn makeRequest(\"family\", from)\n}", "func (sshConfig *SSHConfig) GetOS() string {\n\tif sshConfig.RemoteOS == \"\" {\n\t\ttemp, err := sshConfig.Run(\"uname\") // Works only on macOS / Linux systems\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\ttemp = strings.Replace(temp, \"\\n\", \"\", -1)\n\t\tsshConfig.RemoteOS = strings.ToLower(temp)\n\t}\n\treturn sshConfig.RemoteOS\n}", "func HostOsTypeEnumFromValue(value string) HostOsTypeEnum {\r\n switch value {\r\n case \"kLinux\":\r\n return HostOsType_KLINUX\r\n case \"kWindows\":\r\n return HostOsType_KWINDOWS\r\n case \"kAix\":\r\n return HostOsType_KAIX\r\n case \"kSolaris\":\r\n return HostOsType_KSOLARIS\r\n default:\r\n return HostOsType_KLINUX\r\n }\r\n}", "func (a Address) Family() byte {\n\treturn byte(0xff & (a >> 56))\n}", "func OS() string {\n\tif os == \"\" {\n\t\treturn \"n/a\"\n\t}\n\treturn os\n}", "func (s *Task) SetPlatformFamily(v string) *Task {\n\ts.PlatformFamily = &v\n\treturn s\n}", "func (s *TaskSet) SetPlatformFamily(v string) *TaskSet {\n\ts.PlatformFamily = &v\n\treturn s\n}", "func GetOperatingSystem() (string, error) {\n\tcmd := exec.Command(\"uname\", \"-s\")\n\tosName, err := cmd.Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(osName), nil\n}", "func (r *systemImpl) Os(p graphql.ResolveParams) (string, error) {\n\tsys := p.Source.(types.System)\n\treturn sys.OS, nil\n}", "func IPFamilyName(isIPv6 bool) string {\n\tif isIPv6 {\n\t\treturn \"IPv6\"\n\t} else {\n\t\treturn \"IPv4\"\n\t}\n}", "func platformType() (string, error) {\n\taksNet, _ := hcsshim.GetHNSNetworkByName(\"azure\")\n\tif aksNet != nil {\n\t\treturn \"aks\", nil\n\t}\n\n\teksNet, _ := hcsshim.GetHNSNetworkByName(\"vpcbr*\")\n\tif eksNet != nil {\n\t\treturn \"eks\", nil\n\t}\n\n\t// EC2\n\tec2Resp, err := http.Get(\"http://169.254.169.254/latest/meta-data/local-hostname\")\n\tif err != nil && hasTimedOut(err) {\n\t\treturn \"\", err\n\t}\n\tif ec2Resp != nil {\n\t\tdefer ec2Resp.Body.Close()\n\t\tif ec2Resp.StatusCode == http.StatusOK {\n\t\t\treturn \"ec2\", nil\n\t\t}\n\t}\n\n\t// GCE\n\tclient := &http.Client{}\n\treq, err := http.NewRequest(\"GET\", \"http://metadata.google.internal/computeMetadata/v1/instance/hostname\", nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treq.Header.Add(\"Metadata-Flavor\", \"Google\")\n\tgceResp, err := client.Do(req)\n\tif err != nil && hasTimedOut(err) {\n\t\treturn \"\", err\n\t}\n\tif gceResp != nil {\n\t\tdefer gceResp.Body.Close()\n\t\tif gceResp.StatusCode == http.StatusOK {\n\t\t\treturn \"gce\", nil\n\t\t}\n\t}\n\n\treturn \"bare-metal\", nil\n}", "func getUserOS() (string, string) {\n\tvar osBuild string\n\tvar fileExt string\n\n\tswitch os := runtime.GOOS; os {\n\tcase \"darwin\":\n\t\tosBuild = \"darwin\"\n\t\tfileExt = \"\"\n\tcase \"linux\":\n\t\tosBuild = \"linux\"\n\t\tfileExt = \"\"\n\tcase \"windows\":\n\t\tosBuild = \"windows\"\n\t\tfileExt = \".exe\"\n\tdefault:\n\t\tosBuild = \"unsupported\"\n\t\tfileExt = \"\"\n\t}\n\n\treturn osBuild, fileExt\n}", "func GetOSName() (string, error) {\n\tetcOsReleaseFile, err := os.Open(etcOsRelease)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn \"\", fmt.Errorf(\"failed to open %s: %v\", etcOsRelease, err)\n\t\t}\n\t}\n\tdefer etcOsReleaseFile.Close()\n\n\tvar prettyName string\n\n\tscanner := bufio.NewScanner(etcOsReleaseFile)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tif !strings.HasPrefix(line, \"PRETTY_NAME=\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tdata := strings.SplitN(line, \"=\", 2)\n\t\tprettyName = data[1]\n\t\treturn prettyName, nil\n\t}\n\n\treturn \"Linux\", nil\n\n}", "func (p *ZunProvider) OperatingSystem() string {\n\tif p.operatingSystem != \"\" {\n\t\treturn p.operatingSystem\n\t}\n\treturn providers.OperatingSystemLinux\n}", "func (s *Deployment) SetPlatformFamily(v string) *Deployment {\n\ts.PlatformFamily = &v\n\treturn s\n}", "func (s *Service) SetPlatformFamily(v string) *Service {\n\ts.PlatformFamily = &v\n\treturn s\n}", "func (sys *Sys) GetOsType() int {\n\tlog.Debugln(\"GetOsType ENTER\")\n\n\tosType := OsUnknown\n\tif sys.fs.DoesFileExist(\"/etc/redhat-release\") {\n\t\tosType = OsRhel\n\t} else if sys.fs.DoesFileExist(\"/etc/SuSE-release\") {\n\t\tosType = OsSuse\n\t} else if sys.fs.DoesFileExist(\"/etc/lsb-release\") {\n\t\tosType = OsUbuntu\n\t\t//\t} else if sys.fs.DoesFileExist(\"/etc/release\") {\n\t\t//\t\treturn OsCoreOs\n\t} else {\n\t\tout, err := sys.run.CommandOutput(\"uname -s\")\n\t\tif err == nil && strings.EqualFold(out, \"Darwin\") {\n\t\t\tosType = OsMac\n\t\t} else {\n\t\t\tlog.Warnln(\"Unable to determine OS type\")\n\t\t}\n\t}\n\n\tlog.Debugln(\"GetOsType =\", osType)\n\tlog.Debugln(\"GetOsType LEAVE\")\n\treturn osType\n}", "func (o AdminUserOutput) FamilyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AdminUser) *string { return v.FamilyName }).(pulumi.StringPtrOutput)\n}", "func (o AdminUserResponseOutput) FamilyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AdminUserResponse) string { return v.FamilyName }).(pulumi.StringOutput)\n}", "func GetPlatform() string {\n\treturn platforms[runtime.GOOS]\n}", "func (o *Wireless) GetFamilyOk() (string, bool) {\n\tif o == nil || o.Family == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Family, true\n}", "func (o *SignalPersonName) GetFamilyName() string {\n\tif o == nil || o.FamilyName.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.FamilyName.Get()\n}", "func (o *DepositSwitchTargetUser) GetFamilyName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.FamilyName\n}", "func (c *Conn) getFamily(name string) (Family, error) {\n\tb, err := netlink.MarshalAttributes([]netlink.Attribute{{\n\t\tType: unix.CTRL_ATTR_FAMILY_NAME,\n\t\tData: nlenc.Bytes(name),\n\t}})\n\tif err != nil {\n\t\treturn Family{}, err\n\t}\n\n\treq := Message{\n\t\tHeader: Header{\n\t\t\tCommand: unix.CTRL_CMD_GETFAMILY,\n\t\t\t// TODO(mdlayher): grab nlctrl version?\n\t\t\tVersion: 1,\n\t\t},\n\t\tData: b,\n\t}\n\n\tmsgs, err := c.Execute(req, unix.GENL_ID_CTRL, netlink.Request)\n\tif err != nil {\n\t\treturn Family{}, err\n\t}\n\n\t// TODO(mdlayher): consider interpreting generic netlink header values\n\n\tfamilies, err := buildFamilies(msgs)\n\tif err != nil {\n\t\treturn Family{}, err\n\t}\n\tif len(families) != 1 {\n\t\t// If this were to ever happen, netlink must be in a state where\n\t\t// its answers cannot be trusted\n\t\tpanic(fmt.Sprintf(\"netlink returned multiple families for name: %q\", name))\n\t}\n\n\treturn families[0], nil\n}", "func prepareFamilyMessage() (msg netlinkMessage) {\n\tbuf := bytes.NewBuffer([]byte{})\n\taddAttribute(buf, unix.CTRL_ATTR_FAMILY_NAME, unix.TASKSTATS_GENL_NAME, len(unix.TASKSTATS_GENL_NAME)+1)\n\treturn prepareMessage(unix.GENL_ID_CTRL, unix.CTRL_CMD_GETFAMILY, buf.Bytes())\n}", "func (o EnvironmentVmImagePtrOutput) ImageFamily() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EnvironmentVmImage) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.ImageFamily\n\t}).(pulumi.StringPtrOutput)\n}", "func getOSName() {\n\tfmt.Print(\"This machine runs on: \")\n\tswitch os := runtime.GOOS; os {\n\tcase \"darwin\":\n\t\tfmt.Println(\"MacOS.\")\n\tcase \"linux\":\n\t\tfmt.Println(\"Linux\")\n\tdefault:\n\t\tfmt.Printf(\"%s.\\n\" , os)\n\t}\n}", "func (g *Generator) OS() string {\n\treturn g.image.OS\n}", "func (o EnvironmentVmImageOutput) ImageFamily() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v EnvironmentVmImage) *string { return v.ImageFamily }).(pulumi.StringPtrOutput)\n}", "func (ts *Typefaces) Family() []string {\n\tresult := []string{}\n\tfor _, v := range ts.Fonts {\n\t\tif v.Family == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tif !isUniqueString(result, v.Family) {\n\t\t\tcontinue\n\t\t}\n\n\t\tresult = append(result, v.Family)\n\t}\n\treturn result\n}", "func OSName() (string, error) {\n\t/*\n\t\tSample output of 'wmic os get caption'\n\n\t\tCaption\n\t\tMicrosoft Windows 10 Home\n\t*/\n\tresult, err := readAndParseFromCommandLine(osNameCmd)\n\tif err != nil {\n\t\treturn \"-1\", err\n\t}\n\tosName := \"\"\n\tif len(result) > 1 {\n\t\tosName = result[1]\n\t}\n\treturn osName, err\n}", "func getFSType(path string) string {\n\tvolumeNameSize, nFileSystemNameSize := uint32(260), uint32(260)\n\tvar lpVolumeSerialNumber uint32\n\tvar lpFileSystemFlags, lpMaximumComponentLength uint32\n\tvar lpFileSystemNameBuffer, volumeName [260]uint16\n\tvar ps = syscall.StringToUTF16Ptr(filepath.VolumeName(path))\n\n\t// Extract values safely\n\t// BOOL WINAPI GetVolumeInformation(\n\t// _In_opt_ LPCTSTR lpRootPathName,\n\t// _Out_opt_ LPTSTR lpVolumeNameBuffer,\n\t// _In_ DWORD nVolumeNameSize,\n\t// _Out_opt_ LPDWORD lpVolumeSerialNumber,\n\t// _Out_opt_ LPDWORD lpMaximumComponentLength,\n\t// _Out_opt_ LPDWORD lpFileSystemFlags,\n\t// _Out_opt_ LPTSTR lpFileSystemNameBuffer,\n\t// _In_ DWORD nFileSystemNameSize\n\t// );\n\n\t_, _, _ = GetVolumeInformation.Call(uintptr(unsafe.Pointer(ps)),\n\t\tuintptr(unsafe.Pointer(&volumeName)),\n\t\tuintptr(volumeNameSize),\n\t\tuintptr(unsafe.Pointer(&lpVolumeSerialNumber)),\n\t\tuintptr(unsafe.Pointer(&lpMaximumComponentLength)),\n\t\tuintptr(unsafe.Pointer(&lpFileSystemFlags)),\n\t\tuintptr(unsafe.Pointer(&lpFileSystemNameBuffer)),\n\t\tuintptr(nFileSystemNameSize))\n\n\treturn syscall.UTF16ToString(lpFileSystemNameBuffer[:])\n}", "func Platform() (string, error) {\n\tplatform, _, osVersion, err := host.PlatformInformation()\n\n\treturn platform + \" \" + osVersion, err\n}", "func (p *UserAgent) OS() string {\n\treturn p.os\n}", "func (o InstanceVmImageOutput) ImageFamily() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v InstanceVmImage) *string { return v.ImageFamily }).(pulumi.StringPtrOutput)\n}", "func osName(osSplit []string) (name, version string) {\n\tif len(osSplit) == 1 {\n\t\tname = osSplit[0]\n\t\tversion = \"\"\n\t} else {\n\t\t// Assume version is stored in the last part of the array.\n\t\tnameSplit := osSplit[:len(osSplit)-1]\n\t\tversion = osSplit[len(osSplit)-1]\n\n\t\t// Nicer looking Mac OS X\n\t\tif len(nameSplit) >= 2 && nameSplit[0] == \"Intel\" && nameSplit[1] == \"Mac\" {\n\t\t\tnameSplit = nameSplit[1:]\n\t\t}\n\t\tname = strings.Join(nameSplit, \" \")\n\n\t\tif strings.Contains(version, \"x86\") || strings.Contains(version, \"i686\") {\n\t\t\t// x86_64 and i868 are not Linux versions but architectures\n\t\t\tversion = \"\"\n\t\t} else if version == \"X\" && name == \"Mac OS\" {\n\t\t\t// X is not a version for Mac OS.\n\t\t\tname = name + \" \" + version\n\t\t\tversion = \"\"\n\t\t}\n\t}\n\treturn name, version\n}", "func PossibleOSFamilyValues() []OSFamily {\n\treturn []OSFamily{\n\t\tOSFamilyLinux,\n\t\tOSFamilyWindows,\n\t\tOSFamilyAndroid,\n\t\tOSFamilyIOS,\n\t\tOSFamilyUnknown,\n\t}\n}", "func (o AdminUserPtrOutput) FamilyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AdminUser) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.FamilyName\n\t}).(pulumi.StringPtrOutput)\n}", "func OSName(goOS string) (name string) {\n\tif name = OSNames[goOS]; len(name) == 0 {\n\t\tname = strings.ToTitle(goOS)\n\t}\n\treturn\n}", "func (obj *Global) OSName(ctx context.Context) (string, error) {\n\tresult := &struct {\n\t\tReturn string `json:\"qReturn\"`\n\t}{}\n\terr := obj.RPC(ctx, \"OSName\", result)\n\treturn result.Return, err\n}", "func (o *Wireless) SetFamily(v string) {\n\to.Family = &v\n}", "func (ctx Context) GetUserPlatform() string {\n\tif ctx.UserHasRole(ctx.Config.Roles.Xbox) {\n\t\treturn \"xb1\"\n\t}\n\tif ctx.UserHasRole(ctx.Config.Roles.Pc) {\n\t\treturn \"pc\"\n\t}\n\tif ctx.UserHasRole(ctx.Config.Roles.Ps4) {\n\t\treturn \"psn\"\n\t}\n\n\treturn \"ns\"\n\n}", "func (o InstanceVmImagePtrOutput) ImageFamily() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *InstanceVmImage) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.ImageFamily\n\t}).(pulumi.StringPtrOutput)\n}", "func (r *PrivateVirtualInterface) AddressFamily() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"addressFamily\"])\n}", "func (s *TaskDefinition) SetFamily(v string) *TaskDefinition {\n\ts.Family = &v\n\treturn s\n}", "func (m *PrintConnector) GetOperatingSystem()(*string) {\n val, err := m.GetBackingStore().Get(\"operatingSystem\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (o *V0037Node) GetOperatingSystem() string {\n\tif o == nil || o.OperatingSystem == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.OperatingSystem\n}", "func (target Target) OsVariation() string {\n\treturn target.Os.String()\n}", "func GetHostSys() string {\n\thostSys := os.Getenv(\"HOST_SYS\")\n\tif hostSys == \"\" {\n\t\thostSys = \"/sys\"\n\t}\n\treturn hostSys\n}", "func (s *RegisterTaskDefinitionInput) SetFamily(v string) *RegisterTaskDefinitionInput {\n\ts.Family = &v\n\treturn s\n}", "func GetOSInfo() string {\n\treturn \"windows\"\n}", "func (a *DefaultAddr) Family() int { return a.af }", "func (t ConnTuple) Family() ConnFamily {\n\tif t.Metadata&uint32(IPv6) != 0 {\n\t\treturn IPv6\n\t}\n\treturn IPv4\n}", "func (dw *DrawingWand) GetFontFamily() string {\n\tcsfamily := C.MagickDrawGetFontFamily(dw.dw)\n\tdefer C.MagickRelinquishMemory(unsafe.Pointer(csfamily))\n\treturn C.GoString(csfamily)\n}", "func getFileSystemType(path string) (fsType string, hr error) {\n\tdrive := filepath.VolumeName(path)\n\tif len(drive) != 2 {\n\t\treturn \"\", errors.New(\"getFileSystemType path must start with a drive letter\")\n\t}\n\n\tvar (\n\t\tmodkernel32 = windows.NewLazySystemDLL(\"kernel32.dll\")\n\t\tprocGetVolumeInformation = modkernel32.NewProc(\"GetVolumeInformationW\")\n\t\tbuf = make([]uint16, 255)\n\t\tsize = windows.MAX_PATH + 1\n\t)\n\tdrive += `\\`\n\tn := uintptr(unsafe.Pointer(nil))\n\tr0, _, _ := syscall.Syscall9(procGetVolumeInformation.Addr(), 8, uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(drive))), n, n, n, n, n, uintptr(unsafe.Pointer(&buf[0])), uintptr(size), 0)\n\tif int32(r0) < 0 {\n\t\thr = syscall.Errno(win32FromHresult(r0))\n\t}\n\tfsType = windows.UTF16ToString(buf)\n\treturn\n}", "func getOSName() string {\n\tosNameOnce.Do(func() { osName = osinfo.OSName() })\n\treturn osName\n}", "func getIPFamily(address []byte) (uint16, error) {\n\tif len(address) == 4 {\n\t\treturn syscall.AF_INET, nil\n\t}\n\n\tif isZeros(address) {\n\t\treturn 0, errors.New(\"could not parse IP family from address data\")\n\t}\n\n\t// assume IPv4 if first 4 bytes are non-zero but rest of the data is trailing zeros\n\tif !isZeros(address[:4]) && isZeros(address[4:]) {\n\t\treturn syscall.AF_INET, nil\n\t}\n\n\treturn syscall.AF_INET6, nil\n}", "func (s *ListTasksInput) SetFamily(v string) *ListTasksInput {\n\ts.Family = &v\n\treturn s\n}", "func osName() string {\n\treturn runtime.GOOS\n}", "func osVersion() string {\n\tv, err := syscall.GetVersion()\n\tif err != nil {\n\t\treturn \"0.0\"\n\t}\n\tmajor := uint8(v)\n\tminor := uint8(v >> 8)\n\treturn fmt.Sprintf(\"%d.%d\", major, minor)\n}", "func systemBasedTCPorSCTP() string {\n\tif runtime.GOOS == \"darwin\" {\n\t\tfmt.Println(\n\t\t\t\"Running servers with TCP. MacOS detected, SCTP not supported in this system. \" +\n\t\t\t\t\"Use this mode only for debugging!!!\")\n\t\treturn \"tcp\"\n\t}\n\tfmt.Println(\"Running servers with SCTP\")\n\treturn \"sctp\"\n}", "func ExampleConn_getFamily() {\n\tc, err := genetlink.Dial(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to dial generic netlink: %v\", err)\n\t}\n\tdefer c.Close()\n\n\t// Ask generic netlink about the generic netlink controller (nlctrl)'s\n\t// family information\n\tconst name = \"nlctrl\"\n\tfamily, err := c.Family.Get(name)\n\tif err != nil {\n\t\t// If family doesn't exist, error can be checked using os.IsNotExist\n\t\tif os.IsNotExist(err) {\n\t\t\tlog.Printf(\"%q family not available\", name)\n\t\t\treturn\n\t\t}\n\n\t\tlog.Fatalf(\"failed to query for family: %v\", err)\n\t}\n\n\tlog.Printf(\"%s: %+v\", name, family)\n}", "func (o FleetOutput) OperatingSystem() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Fleet) pulumi.StringOutput { return v.OperatingSystem }).(pulumi.StringOutput)\n}", "func osName() string {\r\n\treturn runtime.GOOS\r\n}", "func (device *Device) getOS() {\n\t// Android\n\tif strings.Contains(device.UserAgent, \"Android\") {\n\t\tdevice.OperatingSystem = \"Android\"\n\t} else if strings.Contains(device.UserAgent, \"Windows\") {\n\t\tdevice.OperatingSystem = \"Windows\"\n\t} else if strings.Contains(device.UserAgent, \"iPhone\") {\n\t\tdevice.OperatingSystem = \"iOS\"\n\t} else if strings.Contains(device.UserAgent, \"like Mac OS X\") {\n\t\tdevice.OperatingSystem = \"iOS\"\n\t} else if strings.Contains(device.UserAgent, \"Macintosh\") {\n\t\tdevice.OperatingSystem = \"macOS\"\n\t}\n\n\tswitch device.OperatingSystem {\n\tcase \"Android\":\n\t\tdevice.parseAndroidUA()\n\tcase \"Windows\":\n\t\tdevice.parseWindowsUA()\n\tcase \"iOS\":\n\t\tdevice.parseIOSUA()\n\tcase \"macOS\":\n\t\tdevice.parseMacOSUA()\n\t}\n}", "func (m *UserExperienceAnalyticsAnomalyDevice) GetOsName()(*string) {\n val, err := m.GetBackingStore().Get(\"osName\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func getPlatform(comment []string) string {\n\tif len(comment) > 0 {\n\t\tif comment[0] != \"compatible\" {\n\t\t\tif strings.HasPrefix(comment[0], \"Windows\") {\n\t\t\t\treturn \"Windows\"\n\t\t\t} else if strings.HasPrefix(comment[0], \"Symbian\") {\n\t\t\t\treturn \"Symbian\"\n\t\t\t} else if strings.HasPrefix(comment[0], \"webOS\") {\n\t\t\t\treturn \"webOS\"\n\t\t\t} else if comment[0] == \"BB10\" {\n\t\t\t\treturn \"BlackBerry\"\n\t\t\t}\n\t\t\treturn comment[0]\n\t\t}\n\t}\n\treturn \"\"\n}", "func (o *DepositSwitchTargetUser) GetFamilyNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.FamilyName, true\n}", "func osVersion() string {\r\n\tv, err := syscall.GetVersion()\r\n\tif err != nil {\r\n\t\treturn \"0.0\"\r\n\t}\r\n\tmajor := uint8(v)\r\n\tminor := uint8(v >> 8)\r\n\treturn fmt.Sprintf(\"%d.%d\", major, minor)\r\n}", "func (p Profile) FamilyName() *attribute.StringAttribute {\n\treturn p.GetStringAttribute(AttrConstFamilyName)\n}", "func getOSInfo(c context.Context, b *buildbotBuild, m *buildbotMaster) (\n\tfamily, version string) {\n\t// Fetch the master info from datastore if not provided.\n\tif m.Name == \"\" {\n\t\tlogging.Infof(c, \"Fetching info for master %s\", b.Master)\n\t\tentry := buildbotMasterEntry{Name: b.Master}\n\t\terr := ds.Get(c, &entry)\n\t\tif err != nil {\n\t\t\tlogging.WithError(err).Errorf(\n\t\t\t\tc, \"Encountered error while fetching entry for %s\", b.Master)\n\t\t\treturn\n\t\t}\n\t\terr = decodeMasterEntry(c, &entry, m)\n\t\tif err != nil {\n\t\t\tlogging.WithError(err).Warningf(\n\t\t\t\tc, \"Failed to decode master information for OS info on master %s\", b.Master)\n\t\t\treturn\n\t\t}\n\t\tif entry.Internal && !b.Internal {\n\t\t\tlogging.Errorf(c, \"Build references an internal master, but build is not internal.\")\n\t\t\treturn\n\t\t}\n\t}\n\n\ts, ok := m.Slaves[b.Slave]\n\tif !ok {\n\t\tlogging.Warningf(c, \"Could not find slave %s in master %s\", b.Slave, b.Master)\n\t\treturn\n\t}\n\thostInfo := map[string]string{}\n\tfor _, v := range strings.Split(s.Host, \"\\n\") {\n\t\tif info := strings.SplitN(v, \":\", 2); len(info) == 2 {\n\t\t\thostInfo[info[0]] = strings.TrimSpace(info[1])\n\t\t}\n\t}\n\t// Extract OS and OS Family\n\tif v, ok := hostInfo[\"os family\"]; ok {\n\t\tfamily = v\n\t}\n\tif v, ok := hostInfo[\"os version\"]; ok {\n\t\tversion = v\n\t}\n\treturn\n}" ]
[ "0.7497416", "0.6440313", "0.6265161", "0.62639576", "0.62581", "0.61973", "0.6124115", "0.60934013", "0.60089207", "0.5989644", "0.5955059", "0.586677", "0.58603936", "0.5839756", "0.5819483", "0.58168316", "0.58055353", "0.5803999", "0.577336", "0.57567614", "0.5718889", "0.5716328", "0.56361306", "0.56328434", "0.5629913", "0.5627624", "0.56199133", "0.5604243", "0.55550915", "0.5553393", "0.5551975", "0.5533107", "0.5515219", "0.549933", "0.5474235", "0.5425059", "0.5416896", "0.5362831", "0.5362121", "0.53518724", "0.5345872", "0.53404766", "0.5285838", "0.52486706", "0.5244626", "0.5240998", "0.52369004", "0.52096206", "0.5208068", "0.5201875", "0.5201382", "0.51941204", "0.5187253", "0.5179696", "0.5151631", "0.5149696", "0.5138322", "0.51256204", "0.5115423", "0.51138955", "0.5108566", "0.51022995", "0.50995934", "0.5097753", "0.5071665", "0.50525403", "0.50480443", "0.503036", "0.5029212", "0.5022625", "0.50161195", "0.50046337", "0.49960083", "0.49620834", "0.4952017", "0.49080935", "0.4896098", "0.48959103", "0.48952395", "0.48845428", "0.4880208", "0.4858771", "0.48562068", "0.48520273", "0.4847012", "0.48469543", "0.4833993", "0.4826451", "0.4801677", "0.47954232", "0.47894454", "0.4787878", "0.47739804", "0.4763708", "0.47624877", "0.47464368", "0.4732894", "0.47289965", "0.47268483", "0.4722924" ]
0.83538216
0
parseAux examines the data of a SAM record's OPT fields, returning a slice of sam.Aux that are backed by the original data.
parseAux анализирует данные полей OPT записи SAM, возвращая срез sam.Aux, использующий оригинальные данные.
func parseAux(aux []byte, aa []sam.Aux) { naa := 0 for i := 0; i+2 < len(aux); { t := aux[i+2] switch j := jumps[t]; { case j > 0: j += 3 aa[naa] = sam.Aux(aux[i : i+j : i+j]) naa++ i += j case j < 0: switch t { case 'Z', 'H': var ( j int v byte ) for j, v = range aux[i:] { if v == 0 { // C string termination break // Truncate terminal zero. } } aa[naa] = sam.Aux(aux[i : i+j : i+j]) naa++ i += j + 1 case 'B': length := binary.LittleEndian.Uint32(aux[i+4 : i+8]) j = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4 aa[naa] = sam.Aux(aux[i : i+j : i+j]) naa++ i += j } default: panic(fmt.Sprintf("bam: unrecognised optional field type: %q", t)) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func parseAux(aux []byte) ([]sam.Aux, error) {\n\tif len(aux) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Heuristically pre-allocate enough slots for the byte data.\n\t// Value chosen by experimentation and will not fit all inputs,\n\t// with the cost being over-allocation.\n\taa := make([]sam.Aux, 0, len(aux)/4)\n\n\tfor i := 0; i+2 < len(aux); {\n\t\tt := aux[i+2]\n\t\tswitch j := jumps[t]; {\n\t\tcase j > 0:\n\t\t\tj += 3\n\t\t\taa = append(aa, sam.Aux(aux[i:i+j:i+j]))\n\t\t\ti += j\n\t\tcase j < 0:\n\t\t\tswitch t {\n\t\t\tcase 'Z', 'H':\n\t\t\t\tj := bytes.IndexByte(aux[i:], 0)\n\t\t\t\tif j == -1 {\n\t\t\t\t\treturn nil, errors.New(\"bam: invalid zero terminated data: no zero\")\n\t\t\t\t}\n\t\t\t\taa = append(aa, sam.Aux(aux[i:i+j:i+j]))\n\t\t\t\ti += j + 1\n\t\t\tcase 'B':\n\t\t\t\tlength := binary.LittleEndian.Uint32(aux[i+4 : i+8])\n\t\t\t\tj = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4\n\t\t\t\tif j < 0 || i+j < 0 || i+j > len(aux) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"bam: invalid array length for aux data: %d\", length)\n\t\t\t\t}\n\t\t\t\taa = append(aa, sam.Aux(aux[i:i+j:i+j]))\n\t\t\t\ti += j\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"bam: unrecognised optional field type: %q\", t)\n\t\t}\n\t}\n\treturn aa, nil\n}", "func buildAux(aa []sam.Aux, buf *[]byte) {\n\tfor _, a := range aa {\n\t\t// TODO: validate each 'a'\n\t\t*buf = append(*buf, []byte(a)...)\n\t\tswitch a.Type() {\n\t\tcase 'Z', 'H':\n\t\t\t*buf = append(*buf, 0)\n\t\t}\n\t}\n}", "func buildAux(aa []sam.Aux) (aux []byte) {\n\tfor _, a := range aa {\n\t\t// TODO: validate each 'a'\n\t\taux = append(aux, []byte(a)...)\n\t\tswitch a.Type() {\n\t\tcase 'Z', 'H':\n\t\t\taux = append(aux, 0)\n\t\t}\n\t}\n\treturn\n}", "func (r MLDv2ReportMulticastAddressRecord) AuxDataLen() int {\n\treturn int(r[mldv2ReportMulticastAddressRecordAuxDataLenOffset]) * mldv2ReportMulticastAddressRecordAuxDataLenUnits\n}", "func Unmarshal(b []byte, header *sam.Header) (*sam.Record, error) {\n\tif len(b) < bamFixedBytes {\n\t\treturn nil, errRecordTooShort\n\t}\n\t// Need to use int(int32(uint32)) to ensure 2's complement extension of -1.\n\trec := sam.GetFromFreePool()\n\trefID := int(int32(binary.LittleEndian.Uint32(b)))\n\trec.Pos = int(int32(binary.LittleEndian.Uint32(b[4:])))\n\tnLen := int(b[8])\n\trec.MapQ = b[9]\n\tnCigar := int(binary.LittleEndian.Uint16(b[12:]))\n\trec.Flags = sam.Flags(binary.LittleEndian.Uint16(b[14:]))\n\tlSeq := int(binary.LittleEndian.Uint32(b[16:]))\n\tnextRefID := int(int32(binary.LittleEndian.Uint32(b[20:])))\n\trec.MatePos = int(int32(binary.LittleEndian.Uint32(b[24:])))\n\trec.TempLen = int(int32(binary.LittleEndian.Uint32(b[28:])))\n\n\t// Read variable length data.\n\tsrcVariableBytes := len(b) - bamFixedBytes\n\n\tnDoubletBytes := (lSeq + 1) >> 1\n\tsrcAuxOffset := bamFixedBytes + nLen + (nCigar * 4) + nDoubletBytes + lSeq\n\tif len(b) < srcAuxOffset {\n\t\treturn nil, fmt.Errorf(\"Corrupt BAM aux record: len(b)=%d, auxoffset=%d\", len(b), srcAuxOffset)\n\t}\n\tnAuxFields, err := countAuxFields(b[srcAuxOffset:])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tshadowCigarOffset := alignOffset(srcVariableBytes) // store the cigar int32s here\n\tshadowAuxOffset := alignOffset(shadowCigarOffset + (nCigar * 4)) // store the AuxFields here\n\tshadowSize := shadowAuxOffset + (nAuxFields * sizeofSliceHeader)\n\n\t// shadowBuf is used as an 'arena' from which all objects/slices\n\t// required to store the result of parsing the bam alignment record.\n\t// This reduces the load on GC and consequently allows for better\n\t// scalability with the number of cores used by clients of this package.\n\tsam.ResizeScratch(&rec.Scratch, shadowSize)\n\tshadowBuf := rec.Scratch\n\tcopy(shadowBuf, b[bamFixedBytes:])\n\n\tbufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&shadowBuf))\n\n\t// Note that rec.Name now points to the shadow buffer\n\thdr := (*reflect.StringHeader)(unsafe.Pointer(&rec.Name))\n\thdr.Data = uintptr(unsafe.Pointer(bufHdr.Data))\n\thdr.Len = nLen - 1 // drop trailing '\\0'\n\tshadowOffset := nLen\n\n\tvar sliceHdr *reflect.SliceHeader\n\tif nCigar > 0 {\n\t\tfor i := 0; i < nCigar; i++ {\n\t\t\t*(*uint32)(unsafe.Pointer(&shadowBuf[shadowCigarOffset+(i*4)])) = binary.LittleEndian.Uint32(shadowBuf[shadowOffset+(i*4):])\n\t\t}\n\t\trec.Cigar = UnsafeBytesToCigar(shadowBuf[shadowCigarOffset : shadowCigarOffset+nCigar*4])\n\t\tshadowOffset += nCigar * 4\n\t} else {\n\t\trec.Cigar = nil\n\t}\n\n\trec.Seq.Length = lSeq\n\trec.Seq.Seq = UnsafeBytesToDoublets(shadowBuf[shadowOffset : shadowOffset+nDoubletBytes])\n\tshadowOffset += nDoubletBytes\n\n\trec.Qual = shadowBuf[shadowOffset : shadowOffset+lSeq]\n\tshadowOffset += lSeq\n\tif nAuxFields > 0 {\n\t\t// Clear the array before updating rec.AuxFields. GC will be\n\t\t// confused otherwise.\n\t\tfor i := shadowAuxOffset; i < shadowAuxOffset+nAuxFields*sizeofSliceHeader; i++ {\n\t\t\tshadowBuf[i] = 0\n\t\t}\n\t\tsliceHdr = (*reflect.SliceHeader)(unsafe.Pointer(&rec.AuxFields))\n\t\tsliceHdr.Data = uintptr(unsafe.Pointer(bufHdr.Data + uintptr(shadowAuxOffset)))\n\t\tsliceHdr.Len = nAuxFields\n\t\tsliceHdr.Cap = sliceHdr.Len\n\t\tparseAux(shadowBuf[shadowOffset:srcVariableBytes], rec.AuxFields)\n\t}\n\n\trefs := len(header.Refs())\n\tif refID != -1 {\n\t\tif refID < -1 || refID >= refs {\n\t\t\treturn nil, fmt.Errorf(\"bam: reference id %v out of range\", refID)\n\t\t}\n\t\trec.Ref = header.Refs()[refID]\n\t}\n\tif nextRefID != -1 {\n\t\tif refID == nextRefID {\n\t\t\trec.MateRef = rec.Ref\n\t\t\treturn rec, nil\n\t\t}\n\t\tif nextRefID < -1 || nextRefID >= refs {\n\t\t\treturn nil, fmt.Errorf(\"bam: mate reference id %v out of range\", nextRefID)\n\t\t}\n\t\trec.MateRef = header.Refs()[nextRefID]\n\t}\n\treturn rec, nil\n}", "func (xd *ExtraData) Parse(raw []byte) {\n\t*xd = ExtraData{}\n\n\tindex := uint(0)\n\tlength := uint(len(raw))\n\tfor (index + 4) <= length {\n\t\tvar rec ExtraDataRecord\n\t\trec.ID[0] = raw[index+0]\n\t\trec.ID[1] = raw[index+1]\n\t\trecLen := uint(binary.LittleEndian.Uint16(raw[index+2 : index+4]))\n\t\tindex += 4\n\t\trec.Bytes = raw[index : index+recLen]\n\t\tindex += recLen\n\t\txd.Records = append(xd.Records, rec)\n\t}\n}", "func mustAux(a sam.Aux, err error) sam.Aux {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn a\n}", "func makeAuxSignerData(clientCtx client.Context, f Factory, msgs ...sdk.Msg) (tx.AuxSignerData, error) {\n\tb := NewAuxTxBuilder()\n\tfromAddress, name, _, err := client.GetFromFields(clientCtx, clientCtx.Keyring, clientCtx.From)\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\tb.SetAddress(fromAddress.String())\n\tif clientCtx.Offline {\n\t\tb.SetAccountNumber(f.accountNumber)\n\t\tb.SetSequence(f.sequence)\n\t} else {\n\t\taccNum, seq, err := clientCtx.AccountRetriever.GetAccountNumberSequence(clientCtx, fromAddress)\n\t\tif err != nil {\n\t\t\treturn tx.AuxSignerData{}, err\n\t\t}\n\t\tb.SetAccountNumber(accNum)\n\t\tb.SetSequence(seq)\n\t}\n\n\terr = b.SetMsgs(msgs...)\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\tif f.tip != nil {\n\t\tif _, err := clientCtx.AddressCodec.StringToBytes(f.tip.Tipper); err != nil {\n\t\t\treturn tx.AuxSignerData{}, sdkerrors.ErrInvalidAddress.Wrap(\"tipper must be a valid address\")\n\t\t}\n\t\tb.SetTip(f.tip)\n\t}\n\n\terr = b.SetSignMode(f.SignMode())\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\tkey, err := clientCtx.Keyring.Key(name)\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\tpub, err := key.GetPubKey()\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\terr = b.SetPubKey(pub)\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\tb.SetChainID(clientCtx.ChainID)\n\tsignBz, err := b.GetSignBytes()\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\n\tsig, _, err := clientCtx.Keyring.Sign(name, signBz, f.signMode)\n\tif err != nil {\n\t\treturn tx.AuxSignerData{}, err\n\t}\n\tb.SetSignature(sig)\n\n\treturn b.GetAuxSignerData()\n}", "func (r *Record) Tag(tag []byte) (v Aux, ok bool) {\n\tif len(tag) < 2 {\n\t\tpanic(\"sam: tag too short\")\n\t}\n\tfor _, aux := range r.AuxFields {\n\t\tif aux.matches(tag) {\n\t\t\treturn aux, true\n\t\t}\n\t}\n\treturn nil, false\n}", "func countAuxFields(aux []byte) (int, error) {\n\tnaux := 0\n\tfor i := 0; i+2 < len(aux); {\n\t\tt := aux[i+2]\n\t\tswitch j := jumps[t]; {\n\t\tcase j > 0:\n\t\t\tj += 3\n\t\t\ti += j\n\t\t\tnaux++\n\t\tcase j < 0:\n\t\t\tswitch t {\n\t\t\tcase 'Z', 'H':\n\t\t\t\tvar (\n\t\t\t\t\tj int\n\t\t\t\t\tv byte\n\t\t\t\t)\n\t\t\t\tfor j, v = range aux[i:] {\n\t\t\t\t\tif v == 0 { // C string termination\n\t\t\t\t\t\tbreak // Truncate terminal zero.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti += j + 1\n\t\t\t\tnaux++\n\t\t\tcase 'B':\n\t\t\t\tif len(aux) < i+8 {\n\t\t\t\t\treturn -1, errCorruptAuxField\n\t\t\t\t}\n\t\t\t\tlength := binary.LittleEndian.Uint32(aux[i+4 : i+8])\n\t\t\t\tj = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4\n\t\t\t\ti += j\n\t\t\t\tnaux++\n\t\t\t}\n\t\tdefault:\n\t\t\treturn -1, errCorruptAuxField\n\t\t}\n\t}\n\treturn naux, nil\n}", "func AddAux(a *obj.Addr, v *ssa.Value)", "func (l *Loader) Aux2(i Sym, j int) Aux2 {\n\tif l.IsExternal(i) {\n\t\treturn Aux2{}\n\t}\n\tr, li := l.toLocal(i)\n\tif j >= r.NAux(li) {\n\t\treturn Aux2{}\n\t}\n\treturn Aux2{r.Aux(li, j), r, l}\n}", "func parseRuleAux(rule string, commented bool) (*Rule, error) {\n\tl, err := lex(rule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer l.close()\n\tdataPosition = pktData\n\tr := &Rule{}\n\tvar unsupportedOptions = make([]string, 0, 3)\n\tfor item := l.nextItem(); item.typ != itemEOR && item.typ != itemEOF && err == nil; item = l.nextItem() {\n\t\tswitch item.typ {\n\t\tcase itemComment:\n\t\t\tif r.Action != \"\" || commented {\n\t\t\t\t// Ignore comment ending rule.\n\t\t\t\treturn r, nil\n\t\t\t}\n\t\t\terr = r.comment(item, l)\n\t\t\t// Error here means that the comment was not a commented rule.\n\t\t\t// So we're not parsing a rule and we need to break out.\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// This line was a commented rule.\n\t\t\treturn r, nil\n\t\tcase itemAction:\n\t\t\terr = r.action(item, l)\n\t\tcase itemProtocol:\n\t\t\terr = r.protocol(item, l)\n\t\tcase itemSourceAddress, itemDestinationAddress, itemSourcePort, itemDestinationPort:\n\t\t\terr = r.network(item, l)\n\t\tcase itemDirection:\n\t\t\terr = r.direction(item, l)\n\t\tcase itemOptionKey:\n\t\t\terr = r.option(item, l)\n\t\t\t// We will continue to parse a rule with unsupported options.\n\t\t\tif uerr, ok := err.(*UnsupportedOptionError); ok {\n\t\t\t\tunsupportedOptions = append(unsupportedOptions, uerr.Options...)\n\t\t\t\t// This is ugly but allows the parsing to continue.\n\t\t\t\terr = nil\n\t\t\t}\n\t\tcase itemError:\n\t\t\terr = errors.New(item.value)\n\t\t}\n\t\t// Unrecoverable parse error.\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// If we encountered one or more unsupported keys, return an UnsupportedOptionError.\n\tif len(unsupportedOptions) > 0 {\n\t\treturn nil, &UnsupportedOptionError{\n\t\t\tRule: r,\n\t\t\tOptions: unsupportedOptions,\n\t\t}\n\t}\n\n\treturn r, nil\n}", "func (l *Loader) GetFuncDwarfAuxSyms(fnSymIdx Sym) (auxDwarfInfo, auxDwarfLoc, auxDwarfRanges, auxDwarfLines Sym) {\n\tif l.SymType(fnSymIdx) != sym.STEXT {\n\t\tlog.Fatalf(\"error: non-function sym %d/%s t=%s passed to GetFuncDwarfAuxSyms\", fnSymIdx, l.SymName(fnSymIdx), l.SymType(fnSymIdx).String())\n\t}\n\tif l.IsExternal(fnSymIdx) {\n\t\t// Current expectation is that any external function will\n\t\t// not have auxsyms.\n\t\treturn\n\t}\n\tr, li := l.toLocal(fnSymIdx)\n\tauxs := r.Auxs(li)\n\tfor i := range auxs {\n\t\ta := &auxs[i]\n\t\tswitch a.Type() {\n\t\tcase goobj2.AuxDwarfInfo:\n\t\t\tauxDwarfInfo = l.resolve(r, a.Sym())\n\t\t\tif l.SymType(auxDwarfInfo) != sym.SDWARFINFO {\n\t\t\t\tpanic(\"aux dwarf info sym with wrong type\")\n\t\t\t}\n\t\tcase goobj2.AuxDwarfLoc:\n\t\t\tauxDwarfLoc = l.resolve(r, a.Sym())\n\t\t\tif l.SymType(auxDwarfLoc) != sym.SDWARFLOC {\n\t\t\t\tpanic(\"aux dwarf loc sym with wrong type\")\n\t\t\t}\n\t\tcase goobj2.AuxDwarfRanges:\n\t\t\tauxDwarfRanges = l.resolve(r, a.Sym())\n\t\t\tif l.SymType(auxDwarfRanges) != sym.SDWARFRANGE {\n\t\t\t\tpanic(\"aux dwarf ranges sym with wrong type\")\n\t\t\t}\n\t\tcase goobj2.AuxDwarfLines:\n\t\t\tauxDwarfLines = l.resolve(r, a.Sym())\n\t\t\tif l.SymType(auxDwarfLines) != sym.SDWARFLINES {\n\t\t\t\tpanic(\"aux dwarf lines sym with wrong type\")\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "func UnmarshalInformationSubTLV(b []byte) (*InformationSubTLV, error) {\n\t// Skip Resrved byte\n\tp := 1\n\ttlv := &InformationSubTLV{}\n\ttlv.SID = net.IP(b[p : p+16]).To16().String()\n\tp += 16\n\ttlv.Flags = b[p]\n\tp++\n\ttlv.EndpointBehavior = binary.BigEndian.Uint16(b[p : p+2])\n\tp += 2\n\tif p < len(b) {\n\t\tstlv, err := UnmarshalSRv6L3ServiceSubSubTLV(b[p:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttlv.SubSubTLVs = stlv\n\t}\n\treturn tlv, nil\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) SetAuxiliary(auxiliary *bool) {\n\to.Auxiliary = auxiliary\n}", "func (k *KACollector) parseData() ([]Data, error) {\n\tdata := make([]Data, 0)\n\n\tf, err := os.Open(\"/tmp/keepalived.data\")\n\tif err != nil {\n\t\treturn data, err\n\t}\n\n\tdefer f.Close()\n\n\tsep := \"VRRP Instance\"\n\tprop := \"=\"\n\n\tdt := Data{}\n\tscanner := bufio.NewScanner(bufio.NewReader(f))\n\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tif strings.HasPrefix(line, \" \"+sep) && strings.Contains(line, prop) {\n\t\t\tsp := strings.Split(strings.TrimSpace(line), prop)\n\t\t\tdt.Iname = strings.TrimSpace(sp[1])\n\t\t} else if strings.HasPrefix(line, \" \") && strings.Contains(line, prop) && dt.Iname != \"\" {\n\t\t\tsp := strings.Split(strings.TrimSpace(line), prop)\n\t\t\tkey := strings.TrimSpace(sp[0])\n\t\t\tval := strings.TrimSpace(sp[1])\n\t\t\tswitch key {\n\t\t\tcase \"Interface\":\n\t\t\t\tdt.IfpIfname = val\n\t\t\tcase \"Last transition\":\n\t\t\t\tlt, err := strconv.ParseFloat(strings.Split(val, \" \")[0], 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn data, err\n\t\t\t\t}\n\n\t\t\t\tdt.LastTransition = lt\n\t\t\tcase \"Virtual Router ID\":\n\t\t\t\tid, err := strconv.Atoi(val)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn data, err\n\t\t\t\t}\n\n\t\t\t\tdt.Vrid = id\n\t\t\tcase \"State\":\n\t\t\t\tif state, ok := string2state[val]; ok {\n\t\t\t\t\tdt.State = state\n\t\t\t\t}\n\t\t\tcase \"Wantstate\":\n\t\t\t\tif state, ok := string2state[val]; ok {\n\t\t\t\t\tdt.Wantstate = state\n\t\t\t\t}\n\t\t\t}\n\t\t} else if strings.HasPrefix(line, \" VRRP Version\") {\n\t\t\t// noop\n\t\t} else {\n\t\t\tif dt.Iname != \"\" {\n\t\t\t\tdata = append(data, dt)\n\t\t\t\tdt = Data{}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn data, nil\n}", "func (o HiveMetastoreConfigResponseOutput) AuxiliaryVersions() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v HiveMetastoreConfigResponse) map[string]string { return v.AuxiliaryVersions }).(pulumi.StringMapOutput)\n}", "func (f *recordingSource) Parse() error {\n\trecordDecls := make(map[int]string)\n\trecordingDecls := make(map[string]string)\n\n\tdata, err := f.source.ReadAll()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tscanner := bufio.NewScanner(bytes.NewReader(data))\n\tscanner.Buffer(nil, MaxRecordingSize)\n\tfor scanner.Scan() {\n\t\ttext := scanner.Text()\n\t\tif len(text) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif text[0] != '\"' {\n\t\t\t// Split the line on the first equal sign:\n\t\t\t// 1=DriverOpen 3:nil\n\t\t\tindex := strings.Index(text, \"=\")\n\t\t\tif index == -1 {\n\t\t\t\treturn fmt.Errorf(\"expected equals: %s\", text)\n\t\t\t}\n\n\t\t\trecordNum, err := strconv.Atoi(text[:index])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"expected record number: %s\", text)\n\t\t\t}\n\n\t\t\trecordDecls[recordNum-1] = text[index+1:]\n\t\t} else {\n\t\t\t// Split the line on the last equal sign:\n\t\t\t// \"some:name\":1,2,3,4\n\t\t\tindex := strings.LastIndex(text, \"=\")\n\t\t\tif index == -1 {\n\t\t\t\treturn fmt.Errorf(\"expected equals: %s\", text)\n\t\t\t}\n\t\t\trecordingName, err := strconv.Unquote(text[:index])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\trecordingDecl := text[index+1:]\n\t\t\trecordingDecls[recordingName] = recordingDecl\n\t\t}\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\tif err == bufio.ErrTooLong {\n\t\t\terr = errors.New(\"recording exceeds copyist.MaxRecordingSize and cannot be read\")\n\t\t}\n\t\treturn err\n\t}\n\n\tf.recordDecls = recordDecls\n\tf.recordingDecls = recordingDecls\n\treturn nil\n}", "func extractFields(raw []byte) any {\n\tvar resp map[string]any\n\n\terr := json.Unmarshal(raw, &resp)\n\tif err != nil {\n\t\tvar arrResp []map[string]any\n\n\t\terr := json.Unmarshal(raw, &arrResp)\n\t\tif err != nil {\n\t\t\treturn string(raw)\n\t\t}\n\n\t\treturn arrResp\n\t}\n\n\treturn resp\n}", "func (g *Getter) decodeA(buf []byte, res string) (int, error) {\n\t/* Parse as an IP address */\n\tip := net.ParseIP(res)\n\tif nil == ip {\n\t\treturn 0, fmt.Errorf(\"invalid IP address %q\", res)\n\t}\n\t/* Parse with the appropriate length */\n\tvar plen, start int\n\tswitch g.Type {\n\tcase TypeA:\n\t\tip = ip.To4()\n\t\tplen = 4\n\t\tstart = 1\n\tcase TypeAAAA:\n\t\tip = ip.To16()\n\t\tplen = 16\n\t\tstart = 8\n\t}\n\t/* If we didn't get an address of the right size, someone goofed */\n\tif nil == ip {\n\t\treturn 0, fmt.Errorf(\"unable to parse IP address %s\", res)\n\t}\n\t/* Make sure we have enough buffer */\n\tif plen > len(buf) {\n\t\treturn 0, fmt.Errorf(\n\t\t\t\"buffer too small for record of type %s\",\n\t\t\tg.Type,\n\t\t)\n\t}\n\t/* Extract the payload */\n\treturn copy(buf, ip[start:]), nil\n}", "func extract(buf []byte, name string) []byte {\n\textractRE := regexp.MustCompile(`\\s+` + name + `.+?{`)\n\tbuf = buf[extractRE.FindIndex(buf)[0]:]\n\treturn buf[:endRE.FindIndex(buf)[1]]\n}", "func (f genHelperDecoder) DecReadArrayStart() int { return f.d.arrayStart(f.d.d.ReadArrayStart()) }", "func (fw *Writer) PutAuxField(addr biopb.Coord, aa []sam.Aux) {\n\twb := fw.buf\n\twb.updateAddrBounds(addr)\n\twb.defaultBuf.PutUvarint64(uint64(len(aa)))\n\tfor _, a := range aa {\n\t\twb.blobBuf.PutBytes(a[:3])\n\t}\n\tfor _, a := range aa {\n\t\tswitch a[2] {\n\t\tcase 'A', 'c', 'C': // ascii, int8, uint8\n\t\t\tif len(a) != 4 {\n\t\t\t\tlog.Panic(a)\n\t\t\t}\n\t\t\twb.blobBuf.PutUint8(a[3])\n\t\tcase 's', 'S': // int16, uint16\n\t\t\tif len(a) != 5 {\n\t\t\t\tlog.Panic(a)\n\t\t\t}\n\t\t\twb.blobBuf.PutBytes(a[3:5])\n\t\tcase 'i', 'I', 'f': // int32, uint32, float32\n\t\t\tif len(a) != 7 {\n\t\t\t\tlog.Panic(a)\n\t\t\t}\n\t\t\twb.blobBuf.PutBytes(a[3:7])\n\t\tcase 'Z', 'H': // text, hexstr\n\t\t\twb.putLengthPrefixedBytes(a[3:])\n\t\tdefault:\n\t\t\tlog.Panic(a)\n\t\t}\n\t}\n}", "func (obj *ASN1Obj) extractFieldAndAdvanceOffset(bytes []byte, initialOffset int) (nextFieldOffset int, dataStartOffset int, dataLen int, err error) {\n\tnextFieldOffset = -1\n\tdataStartOffset = -1\n\tdataLen = -1\n\n\ttagAndLen, offset, err := parseTagAndLength(bytes, initialOffset)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif tagAndLen.tag != obj.Tag {\n\t\tif obj.Optional {\n\t\t\tnextFieldOffset = initialOffset\n\t\t\treturn\n\t\t} else {\n\t\t\tif obj.Name == \"Extensions\" && obj.Tag == 3 && tagAndLen.tag == 16 {\n\t\t\t\terr = MissingExtensionError{}\n\t\t\t} else {\n\t\t\t\terr = errors.New(fmt.Sprintf(\"%s tag error: expected %d got %d\", obj.Name, obj.Tag, tagAndLen.tag))\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n\tif obj.GetInnerTags {\n\t\tnextFieldOffset = offset\n\t\tdataStartOffset = offset\n\t\tdataLen = tagAndLen.length\n\t} else {\n\t\tnextFieldOffset = offset + tagAndLen.length\n\t\tdataStartOffset = offset\n\t\tdataLen = tagAndLen.length\n\t}\n\treturn\n}", "func SeparateAliasFromRest(data []byte) ([]byte, []byte) {\n\treader := bytes.NewReader(data)\n\tscanner := bufio.NewScanner(reader)\n\tscanner.Split(bufio.ScanLines)\n\n\tvar aliasBuffer bytes.Buffer\n\tvar buffer bytes.Buffer\n\n\tinside := false\n\taliasFieldName := regexp.MustCompile(`\\Aalias\\s*:.*\\z`)\n\tgenericTopLevelRe := regexp.MustCompile(`\\A[^\\s:]+[^:]*:.*\\z`)\n\tcommentRe := regexp.MustCompile(`\\A\\s*#.*`)\n\tfor scanner.Scan() {\n\t\ttext := scanner.Text()\n\t\tif matched := commentRe.MatchString(text); matched {\n\t\t\tcontinue\n\t\t}\n\n\t\tif matched := aliasFieldName.MatchString(text); matched && !inside {\n\t\t\tinside = true\n\t\t} else if matched := genericTopLevelRe.MatchString(text); matched && inside {\n\t\t\tinside = false\n\t\t}\n\n\t\tif inside {\n\t\t\taliasBuffer.WriteString(text + \"\\n\")\n\t\t} else {\n\t\t\tbuffer.WriteString(text + \"\\n\")\n\t\t}\n\t}\n\n\treturn aliasBuffer.Bytes(), buffer.Bytes()\n}", "func (_Lmc *LmcFilterer) ParseExtended(log types.Log) (*LmcExtended, error) {\n\tevent := new(LmcExtended)\n\tif err := _Lmc.contract.UnpackLog(event, \"Extended\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func parseSectionV2(data []byte) ([]byte, []packetV2, error) {\n\tprevFieldType := fieldType(-1)\n\tvar packets []packetV2\n\tfor {\n\t\tif len(data) == 0 {\n\t\t\treturn nil, nil, fmt.Errorf(\"section extends past end of buffer\")\n\t\t}\n\t\trest, p, err := parsePacketV2(data)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif p.fieldType == fieldEOS {\n\t\t\treturn rest, packets, nil\n\t\t}\n\t\tif p.fieldType <= prevFieldType {\n\t\t\treturn nil, nil, fmt.Errorf(\"fields out of order\")\n\t\t}\n\t\tpackets = append(packets, p)\n\t\tprevFieldType = p.fieldType\n\t\tdata = rest\n\t}\n}", "func (o HiveMetastoreConfigOutput) AuxiliaryVersions() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v HiveMetastoreConfig) map[string]string { return v.AuxiliaryVersions }).(pulumi.StringMapOutput)\n}", "func (es extSlice) ReadExt(v interface{}, buf []byte) {\n\t// ReadExt actually receives a pointer to the list\n\tval := reflect.ValueOf(v)\n\tif val.Kind() != reflect.Ptr {\n\t\tpanic(fmt.Sprintf(\"Non-pointer passed to extSlice.ReadExt: %v\",\n\t\t\tval.Kind()))\n\t}\n\n\tval = val.Elem()\n\tif val.Kind() != reflect.Slice {\n\t\tpanic(fmt.Sprintf(\"Non-slice passed to extSlice.ReadExt %v\",\n\t\t\tval.Kind()))\n\t}\n\n\tvar ifaceArray []interface{}\n\terr := es.codec.Decode(buf, &ifaceArray)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Couldn't decode data into %v\", v))\n\t}\n\n\tif len(ifaceArray) > 0 {\n\t\tval.Set(reflect.MakeSlice(val.Type(), len(ifaceArray),\n\t\t\tlen(ifaceArray)))\n\t}\n\n\tfor i, v := range ifaceArray {\n\t\tif es.typer != nil {\n\t\t\tval.Index(i).Set(es.typer(v))\n\t\t} else {\n\t\t\tval.Index(i).Set(reflect.ValueOf(v))\n\t\t}\n\t}\n}", "func getNextRecordSlice(rdr *bufio.Reader) ([]string, int64, string) {\n\tposn := maxPosn\n\tdata := emptyRecord\n\tvarid := \"\"\n\ttext, err := rdr.ReadString('\\n')\n\tif err == nil {\n\t\ttext = strings.TrimRight(text, \"\\n\")\n\t\tdata = strings.Split(text, \"\\t\")\n\t\tposn = int64(variant.GetPosn(data))\n\t\tvarid = variant.GetVarid(data)\n\t}\n\treturn data, posn, varid\n}", "func newAuxvec(t *kernel.Task, msrc *fs.MountSource) *fs.Inode {\n\ta := &auxvec{t: t}\n\ta.InitEntry(t, fs.RootOwner, fs.FilePermsFromMode(0400))\n\treturn newFile(a, msrc, fs.SpecialFile, t)\n}", "func (o HiveMetastoreConfigPtrOutput) AuxiliaryVersions() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *HiveMetastoreConfig) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AuxiliaryVersions\n\t}).(pulumi.StringMapOutput)\n}", "func (e *Extractor) Extract(input io.Reader) (types.Subtitles, error) {\n\tsubs := make(types.Subtitles, 0)\n\tscanner := bufio.NewScanner(input)\n\tstate := 0\n\tlineno := 0\n\tvar sub types.Subtitle\n\tfor scanner.Scan() {\n\t\tlineno++\n\t\tline := scanner.Text()\n\t\tline = strings.TrimSpace(line)\n\t\tswitch state {\n\t\tcase 0:\n\t\t\t// expect an infinite number of blank lines or a number\n\t\t\tif len(line) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tline = strings.Replace(line, uefeff, \"\", 1)\n\t\t\tline = strings.Replace(line, efbbbf, \"\", -1)\n\t\t\tnum, err := strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\treturn subs, fmt.Errorf(\"error reading %q on line number %d\", line, lineno)\n\t\t\t}\n\t\t\tsub.Number = num\n\t\t\tstate = 1\n\t\tcase 1:\n\t\t\t// read duration\n\t\t\tfrom, to, err := readDuration(line)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"line: \", string(line))\n\t\t\t\treturn subs, fmt.Errorf(\"error reading duration on line: %v\", lineno)\n\t\t\t}\n\t\t\tsub.From = from\n\t\t\tsub.To = to\n\t\t\tstate = 2\n\t\tcase 2:\n\t\t\t// read subtitles or a blank line\n\t\t\t// a blank line resets the whole machine\n\t\t\tif len(line) == 0 {\n\t\t\t\tstate = 0\n\t\t\t\tswitch {\n\t\t\t\tcase len(sub.Contents) > 0:\n\t\t\t\t\tsubs = append(subs, sub)\n\t\t\t\tcase len(sub.Contents) == 0:\n\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t\tsub = types.Subtitle{}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\titem := clean(readSubtitle(line))\n\t\t\tif len(item) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsub.Contents = append(sub.Contents, item)\n\t\t}\n\t}\n\treturn subs, nil\n}", "func SetAuxAddress(addr string) func(*Server) error {\n\treturn func(s *Server) error {\n\t\ts.auxAddr = addr\n\t\treturn nil\n\t}\n}", "func (ctx Context) WithAux(isAux bool) Context {\n\tctx.IsAux = isAux\n\treturn ctx\n}", "func parseKernxSubtable0(data []byte, headerLength int, extended bool, tupleCount int) (Kern0, error) {\n\tbinSearchHeaderLength := 8\n\tif extended {\n\t\tbinSearchHeaderLength = 16\n\t}\n\tif len(data) < headerLength+binSearchHeaderLength {\n\t\treturn nil, errors.New(\"invalid kern/x subtable format 0 (EOF)\")\n\t}\n\tvar nPairs int\n\tif extended {\n\t\tnPairs = int(binary.BigEndian.Uint32(data[headerLength:]))\n\t} else {\n\t\tnPairs = int(binary.BigEndian.Uint16(data[headerLength:]))\n\t}\n\tout, err := parseKerningPairs(data[headerLength+binSearchHeaderLength:], nPairs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif tupleCount != 0 { // interpret values as offset\n\t\tfor _, pair := range out {\n\t\t\tif len(data) < int(uint16(pair.Value))+2 {\n\t\t\t\treturn nil, errors.New(\"invalid kern/x subtable format 0 (EOF)\")\n\t\t\t}\n\t\t\tpair.Value = int16(binary.BigEndian.Uint16(data[pair.Value:]))\n\t\t}\n\t}\n\treturn out, err\n}", "func (packet *Packet18) Extract(data []byte, offset int) error {\n\tif offset+packet.Size() > len(data) {\n\t\treturn errors.New(\"packet exceeds data length\")\n\t}\n\tbits := data[offset]\n\tpacket.Clean = bits&0b00000001 != 0b00000000\n\tpacket.Spot = bits&0b00000010 != 0b00000000\n\tpacket.Dock = bits&0b00000100 != 0b00000000\n\tpacket.Minute = bits&0b00001000 != 0b00000000\n\tpacket.Hour = bits&0b00010000 != 0b00000000\n\tpacket.Day = bits&0b00100000 != 0b00000000\n\tpacket.Schedule = bits&0b01000000 != 0b00000000\n\tpacket.Clock = bits&0b10000000 != 0b00000000\n\treturn nil\n}", "func (d *DriverFile) GetAuxXML() string {\n\treturn d.auxXML\n}", "func (d *Decoder) parseLine(line []byte) ([]pair, error) {\n\tvar add pair\n\tvar beg, offset int64\n\tvar esc bool\n\n\tstate := make(scanState, 0, 3)\n\tbuf := bytes.NewReader(line)\n\n\tfor r, sz, err := buf.ReadRune(); err == nil; r, sz, err = buf.ReadRune() {\n\t\tif r == 0xFFFD && sz == 1 {\n\t\t\treturn nil, errBadUnicode(line, offset)\n\t\t}\n\t\tswitch state.top() {\n\t\tcase scanNone:\n\t\t\tif unicode.IsSpace(r) {\n\t\t\t\t// skip\n\t\t\t} else if unicode.IsLetter(r) || unicode.IsNumber(r) {\n\t\t\t\tstate.push(scanAttr)\n\t\t\t\tbeg = offset\n\t\t\t} else {\n\t\t\t\treturn nil, errBadAttr(line, offset)\n\t\t\t}\n\t\tcase scanAttr:\n\t\t\tif unicode.IsSpace(r) {\n\t\t\t\tadd.attr = line[beg:offset]\n\t\t\t\td.pairbuf = append(d.pairbuf, add)\n\t\t\t\tif _, ok := d.attrs[string(add.attr)]; ok {\n\t\t\t\t\td.havemulti = true\n\t\t\t\t\td.multi[string(add.attr)] = struct{}{}\n\t\t\t\t} else {\n\t\t\t\t\td.attrs[string(add.attr)] = struct{}{}\n\t\t\t\t}\n\t\t\t\tadd.attr, add.val, esc = nil, nil, false\n\t\t\t\tstate.pop()\n\t\t\t} else if r == '=' {\n\t\t\t\tadd.attr = line[beg:offset]\n\t\t\t\tif _, ok := d.attrs[string(add.attr)]; ok {\n\t\t\t\t\td.havemulti = true\n\t\t\t\t\td.multi[string(add.attr)] = struct{}{}\n\t\t\t\t} else {\n\t\t\t\t\td.attrs[string(add.attr)] = struct{}{}\n\t\t\t\t}\n\t\t\t\tstate.pop()\n\t\t\t\tstate.push(scanValueStart)\n\t\t\t} else if !(r == '-' || unicode.IsLetter(r) || unicode.IsNumber(r)) {\n\t\t\t\treturn nil, errBadAttr(line, offset)\n\t\t\t}\n\t\tcase scanValueStart:\n\t\t\tbeg = offset\n\t\t\tstate.pop()\n\t\t\tstate.push(scanValue)\n\n\t\t\tif r == '\\'' {\n\t\t\t\tstate.push(scanQuoteStart)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfallthrough\n\t\tcase scanValue:\n\t\t\tif unicode.IsSpace(r) {\n\t\t\t\tstate.pop()\n\t\t\t\tadd.val = line[beg:offset]\n\t\t\t\tif esc {\n\t\t\t\t\tadd.val = bytes.Replace(add.val, []byte(\"''\"), []byte(\"'\"), -1)\n\t\t\t\t}\n\t\t\t\td.pairbuf = append(d.pairbuf, add)\n\t\t\t\tadd.attr, add.val = nil, nil\n\t\t\t}\n\t\tcase scanQuoteClose:\n\t\t\tstate.pop()\n\t\t\tif r == '\\'' {\n\t\t\t\tesc = true\n\t\t\t\tstate.push(scanQuoteValue)\n\t\t\t} else if unicode.IsSpace(r) {\n\t\t\t\tstate.pop()\n\t\t\t\tadd.val = line[beg : offset-1]\n\t\t\t\tif esc {\n\t\t\t\t\tadd.val = bytes.Replace(add.val, []byte(\"''\"), []byte(\"'\"), -1)\n\t\t\t\t}\n\t\t\t\td.pairbuf = append(d.pairbuf, add)\n\t\t\t\tadd.attr, add.val, esc = nil, nil, false\n\t\t\t} else {\n\t\t\t\treturn nil, errMissingSpace(line, offset)\n\t\t\t}\n\t\tcase scanQuoteStart:\n\t\t\tstate.pop()\n\t\t\tif r != '\\'' {\n\t\t\t\tbeg++\n\t\t\t\tstate.pop()\n\t\t\t\tstate.push(scanQuoteValue)\n\t\t\t} else {\n\t\t\t\tesc = true\n\t\t\t}\n\t\tcase scanQuoteValue:\n\t\t\tif r == '\\'' {\n\t\t\t\tstate.pop()\n\t\t\t\tstate.push(scanQuoteClose)\n\t\t\t} else if r == '\\n' {\n\t\t\t\treturn nil, errUnterminated(line, offset)\n\t\t\t}\n\t\t}\n\t\toffset += int64(sz)\n\t}\n\tswitch state.top() {\n\tcase scanQuoteValue, scanQuoteStart:\n\t\treturn nil, errUnterminated(line, offset)\n\tcase scanAttr:\n\t\tadd.attr = line[beg:offset]\n\t\tif _, ok := d.attrs[string(add.attr)]; ok {\n\t\t\td.havemulti = true\n\t\t\td.multi[string(add.attr)] = struct{}{}\n\t\t} else {\n\t\t\td.attrs[string(add.attr)] = struct{}{}\n\t\t}\n\t\td.pairbuf = append(d.pairbuf, add)\n\tcase scanValueStart:\n\t\tbeg = offset\n\t\tfallthrough\n\tcase scanQuoteClose:\n\t\toffset--\n\t\tfallthrough\n\tcase scanValue:\n\t\tadd.val = line[beg:offset]\n\t\tif esc {\n\t\t\tadd.val = bytes.Replace(add.val, []byte(\"''\"), []byte(\"'\"), -1)\n\t\t}\n\t\td.pairbuf = append(d.pairbuf, add)\n\t}\n\treturn d.pairbuf, nil\n}", "func parsePsRecord(record []string) Pacct {\n\tvar sample Pacct\n\n\tif sample.Command = strings.TrimSpace(record[0]); sample.Command == \"COMMAND\" {\n\t\treturn sample // It's just a header line\n\t}\n\n\tsample.CpuTime = toFloat32(record[1]) // seconds\n\tsample.Stime = 0\n\tsample.Utime = 0\n\tsample.Elapsed = toFloat32(record[2]) // seconds\n\tsample.Uid = toInt(record[3])\n\tsample.Gid = toInt(record[4])\n\tsample.Avmem = toFloat32(record[5]) // vsize: address space in kb\n\t\t\t\t\t\t\t\t\t\t// similar to \"avmem\" in psacct\n\tsample.Pid = toInt(record[6])\n\tsample.Ppid = toInt(record[7])\n\tsample.StartTime = hourToTime(record[8])\n\n\tDprintf(\"sample = %#v\\n\", sample)\n\tDprintf(\"sample2 = %v\\n\", sample)\n\treturn sample\n}", "func parseParts(field string, nameparts []string) (index int, elem1 string, elem2 string, err error) {\n defaultErr := fmt.Errorf(\"Invalid order[] element %v\", field)\n numRegex, err := regexp.Compile(\"^[0-9]+]$\")\n if err != nil {\n return\n }\n elemRegex, err := regexp.Compile(\"^[a-z]+]$\")\n if err != nil {\n return\n }\n if len(nameparts) != 3 && len(nameparts) != 4 {\n err = defaultErr\n return\n }\n // Make sure it is a number followed by the closing ]\n if !numRegex.MatchString(nameparts[1]) {\n err = defaultErr\n return\n }\n // And parse it as a number to make sure\n numstr := strings.TrimSuffix(nameparts[1], \"]\")\n index, err = strconv.Atoi(numstr)\n if err != nil {\n return\n }\n // Check that the next index is a name token followed by a ]\n if !elemRegex.MatchString(nameparts[2]) {\n err = defaultErr\n return\n }\n // Strip off the trailing ]\n elem1 = strings.TrimSuffix(nameparts[2], \"]\")\n // If we had a third element, check to make sure it is also close by a ]\n if len(nameparts) == 4 {\n if !elemRegex.MatchString(nameparts[3]) {\n err = defaultErr\n return\n }\n // And trim off the ]\n elem2 = strings.TrimSuffix(nameparts[3], \"]\")\n }\n // Let's sanity check and make sure they aren't returning an index that is way out of range.\n // We shall assume that no more than 200 columns are being returned\n if index > 200 || index < 0 {\n err = defaultErr\n }\n return\n}", "func TestTagDups(t *testing.T) {\n\tnoTags := defaultOpts\n\tnoTags.TagDups = false\n\n\tcases := []TestCase{\n\t\t{\n\t\t\t[]TestRecord{\n\t\t\t\t{R: basicA1, DupFlag: false, UnexpectedTags: []sam.Tag{sam.NewTag(\"DI\"), sam.NewTag(\"DS\"), sam.NewTag(\"DT\"), sam.NewTag(\"DU\")}},\n\t\t\t\t{R: basicB1, DupFlag: true, UnexpectedTags: []sam.Tag{sam.NewTag(\"DI\"), sam.NewTag(\"DS\"), sam.NewTag(\"DT\"), sam.NewTag(\"DU\")}},\n\t\t\t\t{R: basicA2, DupFlag: false, UnexpectedTags: []sam.Tag{sam.NewTag(\"DI\"), sam.NewTag(\"DS\"), sam.NewTag(\"DT\"), sam.NewTag(\"DU\")}},\n\t\t\t\t{R: basicB2, DupFlag: true, UnexpectedTags: []sam.Tag{sam.NewTag(\"DI\"), sam.NewTag(\"DS\"), sam.NewTag(\"DT\"), sam.NewTag(\"DU\")}},\n\t\t\t},\n\t\t\tnoTags,\n\t\t},\n\t\t{\n\t\t\t[]TestRecord{\n\t\t\t\t{R: basicA1, DupFlag: false, ExpectedAuxs: []sam.Aux{NewAux(\"DI\", \"0\"), NewAux(\"DS\", 2)}},\n\t\t\t\t{R: basicB1, DupFlag: true, ExpectedAuxs: []sam.Aux{NewAux(\"DI\", \"0\"), NewAux(\"DS\", 2), NewAux(\"DT\", \"SQ\")}},\n\t\t\t\t{R: basicA2, DupFlag: false, ExpectedAuxs: []sam.Aux{NewAux(\"DI\", \"0\"), NewAux(\"DS\", 2)}},\n\t\t\t\t{R: basicB2, DupFlag: true, ExpectedAuxs: []sam.Aux{NewAux(\"DI\", \"0\"), NewAux(\"DS\", 2), NewAux(\"DT\", \"SQ\")}},\n\t\t\t},\n\t\t\tdefaultOpts,\n\t\t},\n\t}\n\tRunTestCases(t, header, cases)\n}", "func ExtractRecords() (records []record) {\n // Open the input file and create a scanner to parse it\n file, _ := os.Open(\"Input.txt\")\n\tscanner := bufio.NewScanner(file)\n\n // Var to store the various fields which represents a record\n var fields string\n\t\n\tfor scanner.Scan() {\n // If a blank row isn't scan, add the row to the record representation\n\t\tif scanner.Text() != \"\" {\n\t\t\tfields += scanner.Text() + \" \"\n\t\t} else {\n // If a blank row is scan, convert the record representation to an actual record and add it to the records slice\n\t\t\trecords = append(records, ConvertRecord(fields))\n\n // Then reset the representation\n\t\t\tfields = \"\"\n\t\t}\n\t}\n // Add the last record, which is lost due to the end of file\n\trecords = append(records, ConvertRecord(fields))\n\tfile.Close()\n\n return\n}", "func parseZone(r io.Reader) (string, recordCollection, error) {\n\treturn parseZoneWithOrigin(r, \"\")\n}", "func NewAuxDAC() AuxDAC {\n\treturn [4]byte{0x00, 0x00, 0x00, 0x7f}\n}", "func (f *recordingSource) parseRecord(recordNum int) *record {\n\tr, ok := f.recordDecls[recordNum]\n\tif !ok {\n\t\tpanicf(\"record with number %d must exist\", recordNum)\n\t}\n\n\t// Record fields are separated by tabs, with the first field being the name\n\t// of the driver method.\n\tfields := splitString(r, \"\\t\")\n\trecType, ok := strToRecType[fields[0]]\n\tif !ok {\n\t\tpanicf(\"record type %v is not recognized\", fields[0])\n\t}\n\n\t// Remaining fields are record arguments in \"<dataType>:<formattedValue>\"\n\t// format.\n\trec := &record{Typ: recType}\n\tfor i := 1; i < len(fields); i++ {\n\t\tval, err := parseValueWithType(fields[i])\n\t\tif err != nil {\n\t\t\tpanicf(\"error parsing %s: %v\", fields[i], err)\n\t\t}\n\t\trec.Args = append(rec.Args, val)\n\t}\n\treturn rec\n}", "func (r *Record) UnmarshalSAM(h *Header, b []byte) error {\n\tf := bytes.Split(b, []byte{'\\t'})\n\tif len(f) < 11 {\n\t\treturn errors.New(\"sam: missing SAM fields\")\n\t}\n\t*r = Record{Name: string(f[0])}\n\t// TODO(kortschak): Consider parsing string format flags.\n\tflags, err := strconv.ParseUint(string(f[1]), 0, 16)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse flags: %v\", err)\n\t}\n\tr.Flags = Flags(flags)\n\tr.Ref, err = referenceForName(h, string(f[2]))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to assign reference: %v\", err)\n\t}\n\tr.Pos, err = strconv.Atoi(string(f[3]))\n\tr.Pos--\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse position: %v\", err)\n\t}\n\tmapQ, err := strconv.ParseUint(string(f[4]), 10, 8)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse map quality: %v\", err)\n\t}\n\tr.MapQ = byte(mapQ)\n\tr.Cigar, err = ParseCigar(f[5])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse cigar string: %v\", err)\n\t}\n\tif bytes.Equal(f[2], f[6]) || bytes.Equal(f[6], []byte{'='}) {\n\t\tr.MateRef = r.Ref\n\t} else {\n\t\tr.MateRef, err = referenceForName(h, string(f[6]))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"sam: failed to assign mate reference: %v\", err)\n\t\t}\n\t}\n\tr.MatePos, err = strconv.Atoi(string(f[7]))\n\tr.MatePos--\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse mate position: %v\", err)\n\t}\n\tr.TempLen, err = strconv.Atoi(string(f[8]))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse template length: %v\", err)\n\t}\n\tif !bytes.Equal(f[9], []byte{'*'}) {\n\t\tr.Seq = NewSeq(f[9])\n\t\tif len(r.Cigar) != 0 && !r.Cigar.IsValid(r.Seq.Length) {\n\t\t\treturn errors.New(\"sam: sequence/CIGAR length mismatch\")\n\t\t}\n\t}\n\tif !bytes.Equal(f[10], []byte{'*'}) {\n\t\tr.Qual = append(r.Qual, f[10]...)\n\t\tfor i := range r.Qual {\n\t\t\tr.Qual[i] -= 33\n\t\t}\n\t} else if r.Seq.Length != 0 {\n\t\tr.Qual = make([]byte, r.Seq.Length)\n\t\tfor i := range r.Qual {\n\t\t\tr.Qual[i] = 0xff\n\t\t}\n\t}\n\tif len(r.Qual) != 0 && len(r.Qual) != r.Seq.Length {\n\t\treturn errors.New(\"sam: sequence/quality length mismatch\")\n\t}\n\tif len(f) > 11 {\n\t\tr.AuxFields = make([]Aux, len(f)-11)\n\t\tfor i, aux := range f[11:] {\n\t\t\ta, err := ParseAux(aux)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tr.AuxFields[i] = a\n\t\t}\n\t}\n\treturn nil\n}", "func parseInternal(in io.Reader, bytesToRead int64, frameChan chan *frame.Frame, opts ...ParseOption) (Dataset, error) {\n\tp, err := NewParser(in, bytesToRead, frameChan, opts...)\n\tif err != nil {\n\t\treturn Dataset{}, err\n\t}\n\n\tfor !p.reader.rawReader.IsLimitExhausted() {\n\t\t_, err := p.Next()\n\t\tif err != nil {\n\t\t\tif errors.Is(err, io.EOF) {\n\t\t\t\t// exiting on EOF\n\t\t\t\terr = nil\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// exit on error\n\t\t\treturn p.dataset, err\n\t\t}\n\t}\n\n\t// Close the frameChannel if needed\n\tif p.frameChannel != nil {\n\t\tclose(p.frameChannel)\n\t}\n\treturn p.dataset, nil\n}", "func dataSplitUnaggregated(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif len(data) == 0 && atEOF {\n\t\t// stop\n\t\treturn 0, nil, nil\n\t}\n\n\tnameLen, readBytes, err := ReadUvarint(data)\n\ttokenLen := int(readBytes) + int(nameLen)\n\tif err != nil || len(data) < tokenLen {\n\t\treturn splitErrorHandler(&data, atEOF, tokenLen, err)\n\t}\n\n\ttimeLen, readBytes, err := ReadUvarint(data[tokenLen:])\n\ttokenLen += int(readBytes) + int(timeLen)*4\n\tif err != nil || len(data) < tokenLen {\n\t\treturn splitErrorHandler(&data, atEOF, tokenLen, err)\n\t}\n\n\tvalueLen, readBytes, err := ReadUvarint(data[tokenLen:])\n\ttokenLen += int(readBytes) + int(valueLen)*8\n\tif err != nil || len(data) < tokenLen {\n\t\treturn splitErrorHandler(&data, atEOF, tokenLen, err)\n\t}\n\n\ttimestampLen, readBytes, err := ReadUvarint(data[tokenLen:])\n\ttokenLen += int(readBytes) + int(timestampLen)*4\n\tif err != nil || len(data) < tokenLen {\n\t\treturn splitErrorHandler(&data, atEOF, tokenLen, err)\n\t}\n\n\tif timeLen != valueLen || timeLen != timestampLen {\n\t\treturn 0, nil, clickhouse.NewErrWithDescr(errClickHouseResponse.Error()+\": Different amount of Values, Times and Timestamps\", string(data))\n\t}\n\n\treturn tokenLen, data[:tokenLen], nil\n}", "func (fifi *FIAdditionalFIToFI) Parse(record string) error {\n\tif utf8.RuneCountInString(record) != 216 {\n\t\treturn NewTagWrongLengthErr(216, len(record))\n\t}\n\tfifi.tag = record[:6]\n\tfifi.AdditionalFIToFI.LineOne = fifi.parseStringField(record[6:41])\n\tfifi.AdditionalFIToFI.LineTwo = fifi.parseStringField(record[41:76])\n\tfifi.AdditionalFIToFI.LineThree = fifi.parseStringField(record[76:111])\n\tfifi.AdditionalFIToFI.LineFour = fifi.parseStringField(record[111:146])\n\tfifi.AdditionalFIToFI.LineFive = fifi.parseStringField(record[146:181])\n\tfifi.AdditionalFIToFI.LineSix = fifi.parseStringField(record[181:216])\n\treturn nil\n}", "func (rr *ResourceRecord) unpack(packet []byte, startIdx uint) (x uint, err error) {\n\tx = startIdx\n\n\terr = rr.unpackDomainName(&rr.Name, packet, x)\n\tif err != nil {\n\t\treturn x, err\n\t}\n\tif rr.off > 0 {\n\t\tx = rr.off + 1\n\t} else {\n\t\tif len(rr.Name) == 0 {\n\t\t\tx++\n\t\t} else {\n\t\t\tx += uint(len(rr.Name) + 2)\n\t\t}\n\t}\n\n\trr.Type = libbytes.ReadUint16(packet, x)\n\tx += 2\n\trr.Class = libbytes.ReadUint16(packet, x)\n\tx += 2\n\trr.offTTL = x\n\trr.TTL = libbytes.ReadUint32(packet, x)\n\tx += 4\n\trr.rdlen = libbytes.ReadUint16(packet, x)\n\tx += 2\n\n\trr.rdata = append(rr.rdata, packet[x:x+uint(rr.rdlen)]...)\n\n\terr = rr.unpackRData(packet, x)\n\n\tx += uint(rr.rdlen)\n\n\treturn x, err\n}", "func parseData(data string) identity {\n\tslice := strings.Fields(data)\n\n\tvar i identity\n\tfor _, field := range slice {\n\t\tswitch field[:2] {\n\t\tcase \"ec\":\n\t\t\ti.ECL = field[4:]\n\t\t\tbreak\n\t\tcase \"pi\":\n\t\t\ti.PID = field[4:]\n\t\t\tbreak\n\t\tcase \"ey\":\n\t\t\ti.EYR = field[4:]\n\t\t\tbreak\n\t\tcase \"hc\":\n\t\t\ti.HCL = field[4:]\n\t\t\tbreak\n\t\tcase \"by\":\n\t\t\ti.BYR = field[4:]\n\t\t\tbreak\n\t\tcase \"iy\":\n\t\t\ti.IYR = field[4:]\n\t\t\tbreak\n\t\tcase \"ci\":\n\t\t\ti.CID = field[4:]\n\t\t\tbreak\n\t\tcase \"hg\":\n\t\t\ti.HGT = field[4:]\n\t\t\tbreak\n\t\t}\n\t}\n\treturn i\n}", "func (d *dataHandler) parsePASVresponse(line string) error {\n\t// PASV response format : \"227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).\\r\\n\"\n\tvar err error\n\n\tstartIndex := strings.Index(line, \"(\")\n\tendIndex := strings.LastIndex(line, \")\")\n\n\tif startIndex == -1 || endIndex == -1 {\n\t\treturn errors.New(\"invalid data address\")\n\t}\n\n\td.originConn.remoteIP, d.originConn.remotePort, err = parseLineToAddr(line[startIndex+1 : endIndex])\n\n\t// if received ip is not public IP, ignore it\n\tif !isPublicIP(net.ParseIP(d.originConn.remoteIP)) {\n\t\td.originConn.remoteIP = d.originConn.originalRemoteIP\n\t}\n\n\treturn err\n}", "func parseSelectItem(tokens []*token, initialCursor uint, delimiters []token) (*[]*selectItem, uint, bool) {\n\tcursor := initialCursor\n\n\ts := []*selectItem{}\n\nouter:\n\tfor {\n\t\tif cursor >= uint(len(tokens)) {\n\t\t\treturn nil, initialCursor, false\n\t\t}\n\n\t\tcurrent := tokens[cursor]\n\t\tfor _, delimiter := range delimiters {\n\t\t\tif delimiter.equals(current) {\n\t\t\t\tbreak outer\n\t\t\t}\n\t\t}\n\n\t\tif len(s) > 0 {\n\t\t\tif !expectToken(tokens, cursor, tokenFromSymbol(commaSymbol)) {\n\t\t\t\thelpMessage(tokens, cursor, \"Expected ,\")\n\t\t\t\treturn nil, initialCursor, false\n\t\t\t}\n\n\t\t\tcursor++\n\t\t}\n\n\t\tvar si selectItem\n\t\tif expectToken(tokens, cursor, tokenFromSymbol(asteriskSymbol)) {\n\t\t\tsi = selectItem{asterisk: true}\n\t\t\tcursor++\n\t\t\ts = append(s, &si)\n\t\t\tcontinue\n\t\t}\n\n\t\texp, newCursor, ok := parseExpression(tokens, cursor, tokenFromSymbol(commaSymbol))\n\t\tif !ok {\n\t\t\thelpMessage(tokens, cursor, \"Expected expression\")\n\t\t\treturn nil, initialCursor, false\n\t\t}\n\n\t\tcursor = newCursor\n\t\tsi.exp = exp\n\n\t\tif expectToken(tokens, cursor, tokenFromKeyword(asKeyword)) {\n\t\t\tcursor++\n\n\t\t\tid, newCursor, ok := parseToken(tokens, cursor, identifierKind)\n\t\t\tif !ok {\n\t\t\t\thelpMessage(tokens, cursor, \"Expected identifier after AS\")\n\t\t\t\treturn nil, initialCursor, false\n\t\t\t}\n\n\t\t\tcursor = newCursor\n\t\t\tsi.as = id\n\t\t}\n\t\ts = append(s, &si)\n\t}\n\treturn &s, cursor, true\n}", "func (p *parser) parseLine(line string) {\n\tfor _, option := range p.options {\n\t\tif strings.HasPrefix(line, option.prefix) {\n\t\t\t// 1st condiition expect to parse a single line where the prefix is match\n\t\t\tif option.count == 0 {\n\t\t\t\tp.ips = append(p.ips, strings.Fields(line)[option.index])\n\t\t\t}\n\n\t\t\t// look for the IPs in lines after prefix are matched\n\t\t\tfor i := 0; i < option.count; i++ {\n\t\t\t\tif !p.scanner.Scan() {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tline := p.scanner.Text()\n\t\t\t\tp.ips = append(p.ips, strings.Fields(line)[option.index])\n\t\t\t}\n\t\t}\n\t}\n}", "func (p *Parser) unscan() { p.buf.n = 1 }", "func (p *Parser) unscan() { p.buf.n = 1 }", "func (p *Parser) unscan() { p.buf.n = 1 }", "func parseScanOptions(data []byte) (*tree.ScanOptions, error) {\n\toptions := &ScanOptions{}\n\terr := proto.Unmarshal(data, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar perms tree.Mode\n\tif options.Perms != nil {\n\t\tperms = tree.Mode(*options.Perms)\n\t}\n\treturn &tree.ScanOptions{\n\t\toptions.Exclude,\n\t\toptions.Include,\n\t\toptions.Follow,\n\t\tperms,\n\t\toptions.GetReplica(),\n\t}, nil\n}", "func decodeTLV(data []byte) (map[string]string, error) {\r\n\tresult := map[string]string{}\r\n\r\n\tif len(data) == 0 {\r\n\t\treturn result, errors.New(\"Data length is 0.\")\r\n\t}\r\n\r\n\t// Ugly, but simplifies flow with the \"value, err :=\" pattern.\r\n\tcursor := 0\r\n\tvar fieldType string\r\n\tvar fieldNumber string\r\n\tvar fieldLength int\r\n\tvar fieldValue string\r\n\tvar err error\r\n\r\n\tfor cursor < len(data) {\r\n\r\n\t\tif fieldType, err = getFieldType(data, cursor); err != nil {\r\n\t\t\treturn result, err\r\n\t\t}\r\n\t\tcursor += 1\r\n\r\n\t\tif fieldNumber, err = getFieldNumber(data, cursor); err != nil {\r\n\t\t\treturn result, err\r\n\t\t}\r\n\t\tcursor += 2\r\n\r\n\t\tif fieldLength, err = getPositiveNumber(data, cursor); err != nil {\r\n\t\t\treturn result, err\r\n\t\t}\r\n\t\tcursor += 2\r\n\r\n\t\tif fieldValue, err = getFieldValue(data, fieldType, fieldLength, cursor); err != nil {\r\n\t\t\treturn result, err\r\n\t\t}\r\n\t\tcursor += fieldLength\r\n\r\n\t\tresult[fieldNumber] = fieldValue\r\n\t}\r\n\r\n\treturn result, nil\r\n}", "func (j *JA3) parseSegment(segment []byte) error {\n\n\t// Check if we can decode the next fields\n\tif len(segment) < recordLayerHeaderLen {\n\t\treturn &ParseError{LengthErr, 1}\n\t}\n\n\t// Check if we have \"Content Type: Handshake (22)\"\n\tcontType := uint8(segment[0])\n\tif contType != contentType {\n\t\treturn &ParseError{errType: ContentTypeErr}\n\t}\n\n\t// Check if TLS record layer version is supported\n\ttlsRecordVersion := uint16(segment[1])<<8 | uint16(segment[2])\n\tif tlsRecordVersion&tlsVersionBitmask != 0x0300 && tlsRecordVersion != tls13 {\n\t\treturn &ParseError{VersionErr, 1}\n\t}\n\n\ths := segment[recordLayerHeaderLen:]\n\n\t// Check if actual length of handshake matches (this is a great exclusion criterion for false positives,\n\t// as these fields have to match the actual length of the rest of the segment)\n\tsegmentLen := uint16(segment[3])<<8 | uint16(segment[4])\n\tif len(hs) != int(segmentLen) {\n\t\treturn &ParseError{LengthErr, 2}\n\t}\n\n\terr := j.parseHandshake(hs)\n\n\treturn err\n}", "func (m *Message) extract(b []byte) {\n\tslices := bytes.Split(b, []byte{'|'})\n\ti := bytes.Index(b, []byte{'|'})\n\tm.Type = \"default\"\n\tif i != -1 {\n\t\t// well I know how I'd do it in python\n\t\t// this seems a little awkward\n\t\tm.dirtyfields = make(map[int]bool)\n\t\tif res, err := get(0, slices); err == nil {\n\t\t\tm.setField(0, string(res))\n\t\t}\n\t}\n\tif res, err := get(1, slices); err == nil {\n\t\tif string(res) != \"\" {\n\t\t\tm.setField(1, string(res))\n\t\t}\n\t}\n\tif res, err := get(2, slices); err == nil {\n\t\tm.setField(2, string(res))\n\t}\n\tif res, err := get(3, slices); err == nil {\n\t\tif t, err2 := strconv.Atoi(string(res)); err2 == nil {\n\t\t\tTimeout, _ := time.ParseDuration(fmt.Sprintf(\"%ds\", t))\n\t\t\tm.setField(3, Timeout)\n\t\t} else {\n\t\t\tif d, err3 := time.ParseDuration(string(res)); err3 == nil {\n\t\t\t\tm.setField(3, d)\n\t\t\t}\n\t\t}\n\t}\n}", "func (s *DbRecorder) parseTag(fieldName, tag string) []string {\n\tparts := strings.Split(tag, \",\")\n\tif len(parts) == 0 {\n\t\treturn []string{fieldName}\n\t}\n\treturn parts\n}", "func (_ERC20Detailed *ERC20DetailedFilterer) ParseTransfer(log types.Log) (*ERC20DetailedTransfer, error) {\n\tevent := new(ERC20DetailedTransfer)\n\tif err := _ERC20Detailed.contract.UnpackLog(event, \"Transfer\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func (i *Interpreter) Interpret(rec DataRecord) []InterpretedField {\n\treturn i.InterpretInto(rec, nil)\n}", "func (parser *Parser) unscan() {\n\tparser.buf.n = 1\n}", "func DecodeRecord(buf []byte, header *Header, conf Config) (*Record, error) {\n\tif len(buf) < 1 {\n\t\treturn nil, fmt.Errorf(\"expecting 1 byte but have %d\", len(buf))\n\t}\n\n\trec := &Record{\n\t\tFields: make(map[string]Field, len(header.Fields)-len(conf.FilteredFields())),\n\t}\n\n\tswitch buf[0] {\n\tcase 0x20:\n\t\trec.deleted = false\n\tcase 0x2A:\n\t\trec.deleted = true\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"missing deletion flag\")\n\t}\n\n\tpos := 1\n\tfor i, desc := range header.Fields {\n\t\tif len(buf) < (pos + int(desc.len)) {\n\t\t\treturn nil, fmt.Errorf(fieldDecodeErr, desc.name, i,\n\t\t\t\tfmt.Errorf(\"expecting %d bytes but have %d\", desc.len, len(buf)-pos))\n\t\t}\n\t\tstart, end := pos, pos+int(desc.len)\n\t\tpos += int(desc.len)\n\n\t\t// filter out unwanted fields\n\t\tif !wantField(desc.name, conf.FilteredFields()) {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar f Field\n\t\tvar err error\n\n\t\tswitch desc.Type {\n\t\tcase CharacterType:\n\t\t\tf, err = field.DecodeCharacter(buf[start:end], desc.name, conf.CharacterDecoder())\n\t\tcase DateType:\n\t\t\tf, err = field.DecodeDate(buf[start:end], desc.name)\n\t\tcase FloatingPointType:\n\t\t\tf, err = field.DecodeFloatingPoint(buf[start:end], desc.name)\n\t\tcase NumericType:\n\t\t\tf, err = field.DecodeNumeric(buf[start:end], desc.name)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(fieldDecodeErr, desc.name, i,\n\t\t\t\tfmt.Errorf(\"unsupported field type '%c'\", desc.Type))\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(fieldDecodeErr, desc.name, i, err)\n\t\t}\n\t\trec.Fields[f.Name()] = f\n\t}\n\n\treturn rec, nil\n}", "func parseSubData(cfh *ibmmq.MQCFH, buf []byte) string {\n\tvar elem *ibmmq.PCFParameter\n\n\ttraceEntry(\"parseSubData\")\n\n\tst := GetObjectStatus(GetConnectionKey(), OT_SUB)\n\tsubName := \"\"\n\tsubId := \"\"\n\tkey := \"\"\n\ttopicString := \"\"\n\n\tlastTime := \"\"\n\tlastDate := \"\"\n\n\tparmAvail := true\n\tbytesRead := 0\n\toffset := 0\n\tdatalen := len(buf)\n\tif cfh == nil || cfh.ParameterCount == 0 {\n\t\ttraceExit(\"parseSubData\", 1)\n\t\treturn \"\"\n\t}\n\n\t// Parse it once to extract the fields that are needed for the map key\n\tfor parmAvail && cfh.CompCode != ibmmq.MQCC_FAILED {\n\t\telem, bytesRead = ibmmq.ReadPCFParameter(buf[offset:])\n\t\toffset += bytesRead\n\t\t// Have we now reached the end of the message\n\t\tif offset >= datalen {\n\t\t\tparmAvail = false\n\t\t}\n\n\t\tswitch elem.Parameter {\n\t\tcase ibmmq.MQBACF_SUB_ID:\n\t\t\tsubId = trimToNull(elem.String[0])\n\t\tcase ibmmq.MQCA_TOPIC_STRING:\n\t\t\ttopicString = trimToNull(elem.String[0])\n\t\t}\n\t}\n\n\t// Create a unique key for this instance\n\tkey = subId\n\n\tst.Attributes[ATTR_SUB_ID].Values[key] = newStatusValueString(subId)\n\n\t// And then re-parse the message so we can store the metrics now knowing the map key\n\tparmAvail = true\n\toffset = 0\n\tfor parmAvail && cfh.CompCode != ibmmq.MQCC_FAILED {\n\t\telem, bytesRead = ibmmq.ReadPCFParameter(buf[offset:])\n\t\toffset += bytesRead\n\t\t// Have we now reached the end of the message\n\t\tif offset >= datalen {\n\t\t\tparmAvail = false\n\t\t}\n\n\t\tif !statusGetIntAttributes(GetObjectStatus(GetConnectionKey(), OT_SUB), elem, key) {\n\t\t\tswitch elem.Parameter {\n\t\t\tcase ibmmq.MQCACF_LAST_MSG_TIME:\n\t\t\t\tlastTime = strings.TrimSpace(elem.String[0])\n\t\t\tcase ibmmq.MQCACF_LAST_MSG_DATE:\n\t\t\t\tlastDate = strings.TrimSpace(elem.String[0])\n\t\t\tcase ibmmq.MQCA_TOPIC_STRING:\n\t\t\t\ttopicString = trimToNull(elem.String[0])\n\t\t\tcase ibmmq.MQCACF_SUB_NAME:\n\t\t\t\tsubName = trimToNull(elem.String[0])\n\t\t\t}\n\t\t}\n\t}\n\n\tnow := time.Now()\n\tst.Attributes[ATTR_SUB_SINCE_PUB_MSG].Values[key] = newStatusValueInt64(statusTimeDiff(now, lastDate, lastTime))\n\tst.Attributes[ATTR_SUB_TOPIC_STRING].Values[key] = newStatusValueString(topicString)\n\tst.Attributes[ATTR_SUB_NAME].Values[key] = newStatusValueString(subName)\n\n\ttraceExitF(\"parseSubData\", 0, \"Key : %s\", key)\n\n\treturn key\n}", "func (s TLSSpec) GetParsedAltNames() (dnsNames, ipAddresses, emailAddresses []string, err error) {\n\tfor _, name := range s.GetAltNames() {\n\t\tif net.ParseIP(name) != nil {\n\t\t\tipAddresses = append(ipAddresses, name)\n\t\t} else if validation.IsValidDNSName(name) {\n\t\t\tdnsNames = append(dnsNames, name)\n\t\t} else if validation.IsValidEmailAddress(name) {\n\t\t\temailAddresses = append(emailAddresses, name)\n\t\t} else {\n\t\t\treturn nil, nil, nil, errors.WithStack(errors.Newf(\"'%s' is not a valid alternate name\", name))\n\t\t}\n\t}\n\treturn dnsNames, ipAddresses, emailAddresses, nil\n}", "func (epr *ExternalParser) Analysis(keyPair interface{},\n\tdata *bytes.Buffer) (string, uint64, []byte, error) {\n\n\tif data.Len() < constAgreeHeader {\n\t\treturn \"\", 0, nil, nil\n\t}\n\n\thead := getAgreementHeader(data)\n\n\tdl := getAgreementDataLength(head)\n\tnl := getAgreementNameLength(head)\n\n\tif (dl + nl) > uint32(data.Len()) {\n\t\tdata.UnreadByte()\n\t\tdata.UnreadByte()\n\t\tdata.UnreadByte()\n\t\treturn \"\", 0, nil, nil\n\t}\n\n\tif int((dl + nl)) > AgreeSingleLimit {\n\t\tdata.Reset()\n\t\treturn \"\", 0, nil, ErrProtoIllegal\n\t}\n\n\tpname := string(data.Next(int(nl)))\n\tpdata := data.Next(int(dl))\n\n\treturn pname, 0, pdata, nil\n}", "func ParseTlv(buffer []byte) ([]DataItem, int) {\n\ttotLen := len(buffer)\n\tlenAcc := 0\n\tvar rv []DataItem\n\tfor {\n\t\tun, len0, err := ParseOne(buffer)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\trv = append(rv, un)\n\t\tbuffer = buffer[len0:]\n\t\tlenAcc += len0\n\t}\n\treturn rv, totLen - lenAcc\n}", "func gatherInfo(prefix string, spec interface{}, env map[string]string, isInsideStructSlice, forUsage bool) ([]varInfo, error) {\n\ts := reflect.ValueOf(spec)\n\n\tif s.Kind() != reflect.Ptr {\n\t\treturn nil, ErrInvalidSpecification\n\t}\n\ts = s.Elem()\n\tif s.Kind() != reflect.Struct {\n\t\treturn nil, ErrInvalidSpecification\n\t}\n\ttypeOfSpec := s.Type()\n\n\t// over allocate an info array, we will extend if needed later\n\tinfos := make([]varInfo, 0, s.NumField())\n\tfor i := 0; i < s.NumField(); i++ {\n\t\tf := s.Field(i)\n\t\tftype := typeOfSpec.Field(i)\n\t\tif !f.CanSet() || isTrue(ftype.Tag.Get(\"ignored\")) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor f.Kind() == reflect.Ptr {\n\t\t\tif f.IsNil() {\n\t\t\t\tif f.Type().Elem().Kind() != reflect.Struct {\n\t\t\t\t\t// nil pointer to a non-struct: leave it alone\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\t// nil pointer to struct: create a zero instance\n\t\t\t\tf.Set(reflect.New(f.Type().Elem()))\n\t\t\t}\n\t\t\tf = f.Elem()\n\t\t}\n\n\t\t// Capture information about the config variable\n\t\tinfo := varInfo{\n\t\t\tName: ftype.Name,\n\t\t\tField: f,\n\t\t\tTags: ftype.Tag,\n\t\t\tAlt: strings.ToUpper(ftype.Tag.Get(\"envconfig\")),\n\t\t}\n\n\t\t// Default to the field name as the env var name (will be upcased)\n\t\tinfo.Key = info.Name\n\n\t\t// Best effort to un-pick camel casing as separate words\n\t\tif isTrue(ftype.Tag.Get(\"split_words\")) {\n\t\t\twords := gatherRegexp.FindAllStringSubmatch(ftype.Name, -1)\n\t\t\tif len(words) > 0 {\n\t\t\t\tvar name []string\n\t\t\t\tfor _, words := range words {\n\t\t\t\t\tif m := acronymRegexp.FindStringSubmatch(words[0]); len(m) == 3 {\n\t\t\t\t\t\tname = append(name, m[1], m[2])\n\t\t\t\t\t} else {\n\t\t\t\t\t\tname = append(name, words[0])\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tinfo.Key = strings.Join(name, \"_\")\n\t\t\t}\n\t\t}\n\t\tif info.Alt != \"\" {\n\t\t\tinfo.Key = info.Alt\n\t\t\tif isInsideStructSlice {\n\t\t\t\t// we don't want this to be read, since we're inside of a struct slice,\n\t\t\t\t// each slice element will have same Alt and thus they would overwrite themselves\n\t\t\t\tinfo.Alt = \"\"\n\t\t\t}\n\t\t}\n\t\tif prefix != \"\" {\n\t\t\tinfo.Key = fmt.Sprintf(\"%s_%s\", prefix, info.Key)\n\t\t}\n\t\tinfo.Key = strings.ToUpper(info.Key)\n\n\t\tif decoderFrom(f) != nil || setterFrom(f) != nil || textUnmarshaler(f) != nil || binaryUnmarshaler(f) != nil {\n\t\t\t// there's a decoder defined, no further processing needed\n\t\t\tinfos = append(infos, info)\n\t\t} else if f.Kind() == reflect.Struct {\n\t\t\t// it's a struct without a specific decoder set\n\t\t\tinnerPrefix := prefix\n\t\t\tif !ftype.Anonymous {\n\t\t\t\tinnerPrefix = info.Key\n\t\t\t}\n\n\t\t\tembeddedPtr := f.Addr().Interface()\n\t\t\tembeddedInfos, err := gatherInfo(innerPrefix, embeddedPtr, env, isInsideStructSlice, forUsage)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tinfos = append(infos, embeddedInfos...)\n\t\t} else if arePointers := isSliceOfStructPtrs(f); arePointers || isSliceOfStructs(f) {\n\t\t\t// it's a slice of structs\n\t\t\tvar (\n\t\t\t\tl int\n\t\t\t\tprefixFormat prefixFormatter\n\t\t\t)\n\t\t\tif forUsage {\n\t\t\t\t// it's just for usage so we don't know how many of them can be out there\n\t\t\t\t// so we'll print one info with a generic [N] index\n\t\t\t\tl = 1\n\t\t\t\tprefixFormat = usagePrefix{info.Key, \"[N]\"}\n\t\t\t} else {\n\t\t\t\tvar err error\n\t\t\t\t// let's find out how many are defined by the env vars, and gather info of each one of them\n\t\t\t\tif l, err = sliceLen(info.Key, env); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tprefixFormat = processPrefix(info.Key)\n\t\t\t\t// if no keys, check the alternative keys, unless we're inside of a slice\n\t\t\t\tif l == 0 && info.Alt != \"\" && !isInsideStructSlice {\n\t\t\t\t\tif l, err = sliceLen(info.Alt, env); err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tprefixFormat = processPrefix(info.Alt)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tf.Set(reflect.MakeSlice(f.Type(), l, l))\n\t\t\tfor i := 0; i < l; i++ {\n\t\t\t\tvar structPtrValue reflect.Value\n\n\t\t\t\tif arePointers {\n\t\t\t\t\tf.Index(i).Set(reflect.New(f.Type().Elem().Elem()))\n\t\t\t\t\tstructPtrValue = f.Index(i)\n\t\t\t\t} else {\n\t\t\t\t\tstructPtrValue = f.Index(i).Addr()\n\t\t\t\t}\n\n\t\t\t\tembeddedInfos, err := gatherInfo(prefixFormat.format(i), structPtrValue.Interface(), env, true, forUsage)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tinfos = append(infos, embeddedInfos...)\n\t\t\t}\n\t\t} else {\n\t\t\tinfos = append(infos, info)\n\t\t}\n\t}\n\treturn infos, nil\n}", "func scanFields(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif atEOF {\n\t\treturn 0, nil, io.EOF\n\t}\n\n\tif len(data) < 4 {\n\t\treturn 0, nil, nil\n\t}\n\n\ttotalSize := int(binary.BigEndian.Uint32(data[:4])) + 4\n\n\tif totalSize > len(data) {\n\t\treturn 0, nil, nil\n\t}\n\n\t// msgBytes := make([]byte, totalSize-4, totalSize-4)\n\t// copy(msgBytes, data[4:totalSize])\n\t// not copy here, copied by callee more reasonable\n\treturn totalSize, data[4:totalSize], nil\n}", "func (a rawDef) rawParseObjAttr() def {\n objDef := def{}\n for _,attr := range a {\n oAttr := attrVal{}\n oAttrVal := strings.Split(attr[2], \",\")\n for _,val := range oAttrVal {\n oAttr.Add(strings.TrimSpace(val))\n }\n oAttr.Remove(\"\") // remove empty attr val silently\n objDef[attr[1]] = &oAttr // add attr to the def\n }\n return objDef\n}", "func (d *DriverFile) NeedAuxXML() bool {\n\treturn (d.Type == constant.TypeObject && len(d.Elements) > 0) || (d.Type == constant.TypeView && d.Code != \"*\") || (d.Type == constant.TypeProcess && d.CopyPermissions != constant.Undefined) || (d.Type == constant.TypeMenu && len(d.Sections) > 0)\n}", "func parsePESOptionalHeader(i []byte, offset *int) (h *PESOptionalHeader, dataStart int) {\n\t// Init\n\th = &PESOptionalHeader{}\n\n\t// Marker bits\n\th.MarkerBits = uint8(i[*offset]) >> 6\n\n\t// Scrambling control\n\th.ScramblingControl = uint8(i[*offset]) >> 4 & 0x3\n\n\t// Priority\n\th.Priority = uint8(i[*offset])&0x8 > 0\n\n\t// Data alignment indicator\n\th.DataAlignmentIndicator = uint8(i[*offset])&0x4 > 0\n\n\t// Copyrighted\n\th.IsCopyrighted = uint(i[*offset])&0x2 > 0\n\n\t// Original or copy\n\th.IsOriginal = uint8(i[*offset])&0x1 > 0\n\t*offset += 1\n\n\t// PTS DST indicator\n\th.PTSDTSIndicator = uint8(i[*offset]) >> 6 & 0x3\n\n\t// Flags\n\th.HasESCR = uint8(i[*offset])&0x20 > 0\n\th.HasESRate = uint8(i[*offset])&0x10 > 0\n\th.HasDSMTrickMode = uint8(i[*offset])&0x8 > 0\n\th.HasAdditionalCopyInfo = uint8(i[*offset])&0x4 > 0\n\th.HasCRC = uint8(i[*offset])&0x2 > 0\n\th.HasExtension = uint8(i[*offset])&0x1 > 0\n\t*offset += 1\n\n\t// Header length\n\th.HeaderLength = uint8(i[*offset])\n\t*offset += 1\n\n\t// Data start\n\tdataStart = *offset + int(h.HeaderLength)\n\n\t// PTS/DTS\n\tif h.PTSDTSIndicator == PTSDTSIndicatorOnlyPTS {\n\t\th.PTS = parsePTSOrDTS(i[*offset:])\n\t\t*offset += 5\n\t} else if h.PTSDTSIndicator == PTSDTSIndicatorBothPresent {\n\t\th.PTS = parsePTSOrDTS(i[*offset:])\n\t\t*offset += 5\n\t\th.DTS = parsePTSOrDTS(i[*offset:])\n\t\t*offset += 5\n\t}\n\n\t// ESCR\n\tif h.HasESCR {\n\t\th.ESCR = parseESCR(i[*offset:])\n\t\t*offset += 6\n\t}\n\n\t// ES rate\n\tif h.HasESRate {\n\t\th.ESRate = uint32(i[*offset])&0x7f<<15 | uint32(i[*offset+1])<<7 | uint32(i[*offset+2])>>1\n\t\t*offset += 3\n\t}\n\n\t// Trick mode\n\tif h.HasDSMTrickMode {\n\t\th.DSMTrickMode = parseDSMTrickMode(i[*offset])\n\t\t*offset += 1\n\t}\n\n\t// Additional copy info\n\tif h.HasAdditionalCopyInfo {\n\t\th.AdditionalCopyInfo = i[*offset] & 0x7f\n\t\t*offset += 1\n\t}\n\n\t// CRC\n\tif h.HasCRC {\n\t\th.CRC = uint16(i[*offset])>>8 | uint16(i[*offset+1])\n\t\t*offset += 2\n\t}\n\n\t// Extension\n\tif h.HasExtension {\n\t\t// Flags\n\t\th.HasPrivateData = i[*offset]&0x80 > 0\n\t\th.HasPackHeaderField = i[*offset]&0x40 > 0\n\t\th.HasProgramPacketSequenceCounter = i[*offset]&0x20 > 0\n\t\th.HasPSTDBuffer = i[*offset]&0x10 > 0\n\t\th.HasExtension2 = i[*offset]&0x1 > 0\n\t\t*offset += 1\n\n\t\t// Private data\n\t\tif h.HasPrivateData {\n\t\t\th.PrivateData = i[*offset : *offset+16]\n\t\t\t*offset += 16\n\t\t}\n\n\t\t// Pack field length\n\t\tif h.HasPackHeaderField {\n\t\t\th.PackField = uint8(i[*offset])\n\t\t\t*offset += 1\n\t\t}\n\n\t\t// Program packet sequence counter\n\t\tif h.HasProgramPacketSequenceCounter {\n\t\t\th.PacketSequenceCounter = uint8(i[*offset]) & 0x7f\n\t\t\th.MPEG1OrMPEG2ID = uint8(i[*offset+1]) >> 6 & 0x1\n\t\t\th.OriginalStuffingLength = uint8(i[*offset+1]) & 0x3f\n\t\t\t*offset += 2\n\t\t}\n\n\t\t// P-STD buffer\n\t\tif h.HasPSTDBuffer {\n\t\t\th.PSTDBufferScale = i[*offset] >> 5 & 0x1\n\t\t\th.PSTDBufferSize = uint16(i[*offset])&0x1f<<8 | uint16(i[*offset+1])\n\t\t\t*offset += 2\n\t\t}\n\n\t\t// Extension 2\n\t\tif h.HasExtension2 {\n\t\t\t// Length\n\t\t\th.Extension2Length = uint8(i[*offset]) & 0x7f\n\t\t\t*offset += 2\n\n\t\t\t// Data\n\t\t\th.Extension2Data = i[*offset : *offset+int(h.Extension2Length)]\n\t\t\t*offset += int(h.Extension2Length)\n\t\t}\n\t}\n\treturn\n}", "func (br *Reader) Read() (*sam.Record, error) {\n\tif br.c != nil && vOffset(br.r.LastChunk().End) >= vOffset(br.c.End) {\n\t\treturn nil, io.EOF\n\t}\n\n\tb, err := newBuffer(br)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar rec sam.Record\n\trefID := b.readInt32()\n\trec.Pos = int(b.readInt32())\n\tnLen := b.readUint8()\n\trec.MapQ = b.readUint8()\n\tb.discard(2)\n\tnCigar := b.readUint16()\n\trec.Flags = sam.Flags(b.readUint16())\n\tlSeq := int(b.readInt32())\n\tnextRefID := b.readInt32()\n\trec.MatePos = int(b.readInt32())\n\trec.TempLen = int(b.readInt32())\n\n\t// Read variable length data.\n\tif nLen < 1 {\n\t\treturn nil, fmt.Errorf(\"bam: invalid read name length: %d\", nLen)\n\t}\n\trec.Name = string(b.unsafeBytes(int(nLen) - 1))\n\tb.discard(1)\n\n\t// bytes are safe since readCigarOps does not retain the returned buffer.\n\trec.Cigar = readCigarOps(b.unsafeBytes(int(nCigar) * 4))\n\n\tvar seq, auxTags []byte\n\tif br.omit >= AllVariableLengthData {\n\t\tgoto done\n\t}\n\n\tif lSeq < 0 {\n\t\treturn nil, fmt.Errorf(\"bam: invalid sequence length: %d\", lSeq)\n\t}\n\tseq = b.bytes((lSeq >> 1) + (lSeq & 0x1))\n\trec.Seq = sam.Seq{Length: lSeq, Seq: *(*doublets)(unsafe.Pointer(&seq))}\n\trec.Qual = b.bytes(lSeq)\n\n\tif br.omit >= AuxTags {\n\t\tgoto done\n\t}\n\tauxTags = b.bytes(b.len())\n\trec.AuxFields, err = parseAux(auxTags)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ndone:\n\trefs := int32(len(br.h.Refs()))\n\tif refID != -1 {\n\t\tif refID < -1 || refID >= refs {\n\t\t\treturn nil, errors.New(\"bam: reference id out of range\")\n\t\t}\n\t\trec.Ref = br.h.Refs()[refID]\n\t}\n\tif nextRefID != -1 {\n\t\tif refID == nextRefID {\n\t\t\trec.MateRef = rec.Ref\n\t\t\treturn &rec, nil\n\t\t}\n\t\tif nextRefID < -1 || nextRefID >= refs {\n\t\t\treturn nil, errors.New(\"bam: mate reference id out of range\")\n\t\t}\n\t\trec.MateRef = br.h.Refs()[nextRefID]\n\t}\n\n\treturn &rec, nil\n}", "func (p *candidateParser) parse() error {\n\tif len(p.buf) < minBufLen {\n\t\treturn fmt.Errorf(\"buffer too small (%d < %d)\", len(p.buf), minBufLen)\n\t}\n\t// special cases for raw value support:\n\tif p.buf[0] == 'a' {\n\t\tp.buf = bytes.TrimPrefix(p.buf, []byte(\"a=\"))\n\t}\n\tif p.buf[0] == 'c' {\n\t\tp.buf = bytes.TrimPrefix(p.buf, []byte(\"candidate:\"))\n\t}\n\t// pos is current position\n\t// l is value length\n\t// last is last character offset\n\t// of mandatory elements\n\tvar pos, l, last int\n\tfns := [...]parseFn{\n\t\tp.parseFoundation, // 0\n\t\tp.parseComponentID, // 1\n\t\tp.parseTransport, // 2\n\t\tp.parsePriority, // 3\n\t\tp.parseConnectionAddress, // 4\n\t\tp.parsePort, // 5\n\t}\n\tfor i, b := range p.buf {\n\t\tif pos > mandatoryElements-1 {\n\t\t\t// saving offset\n\t\t\tlast = i\n\t\t\tbreak\n\t\t}\n\t\tif b != sp {\n\t\t\t// non-space character\n\t\t\tl++\n\t\t\tcontinue\n\t\t}\n\t\t// space character reached\n\t\tif err := fns[pos](p.buf[i-l : i]); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse char %d, pos %d: %v\",\n\t\t\t\ti, pos, err,\n\t\t\t)\n\t\t}\n\t\tpos++ // next element\n\t\tl = 0 // reset length of element\n\t}\n\tif last == 0 {\n\t\t// no non-mandatory elements\n\t\treturn nil\n\t}\n\t// offsets:\n\tvar (\n\t\tstart int // key start\n\t\tend int // key end\n\t\tvStart int // value start\n\t)\n\t// subslicing to simplify offset calculation\n\tbuf := p.buf[last-1:]\n\t// saving every k:v pair ignoring spaces\n\tfor i, b := range buf {\n\t\tif b != sp && i != len(buf)-1 {\n\t\t\t// b is non-space or end of buffer\n\t\t\tif start == 0 {\n\t\t\t\t// key not started\n\t\t\t\tstart = i\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif vStart == 0 && end != 0 {\n\t\t\t\t// value not started and key ended\n\t\t\t\tvStart = i\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// b is space or end of buf reached\n\t\tif start == 0 {\n\t\t\t// key not started, skipping\n\t\t\tcontinue\n\t\t}\n\t\tif end == 0 {\n\t\t\t// key ended, saving offset\n\t\t\tend = i\n\t\t\tcontinue\n\t\t}\n\t\tif vStart == 0 {\n\t\t\t// value not started, skipping\n\t\t\tcontinue\n\t\t}\n\t\tif i == len(buf)-1 && buf[len(buf)-1] != sp {\n\t\t\t// fix for end of buf\n\t\t\ti = len(buf)\n\t\t}\n\t\t// value ended, saving attribute\n\t\ta := Attribute{\n\t\t\tKey: buf[start:end],\n\t\t\tValue: buf[vStart:i],\n\t\t}\n\t\tif err := p.parseAttribute(a); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse attribute at char %d: %v\",\n\t\t\t\ti+last, err,\n\t\t\t)\n\t\t}\n\t\t// reset offset\n\t\tvStart = 0\n\t\tend = 0\n\t\tstart = 0\n\t}\n\treturn nil\n}", "func (l *Loader) NAux(i Sym) int {\n\tif l.IsExternal(i) {\n\t\treturn 0\n\t}\n\tr, li := l.toLocal(i)\n\treturn r.NAux(li)\n}", "func Unmarshal(data []byte, out interface{}) (err error) {\n\tlex := &lexer{scan: scanner.Scanner{Mode: scanner.GoTokens}}\n\tlex.scan.Init(bytes.NewReader(data))\n\tlex.next() // get the first token\n\tdefer func() {\n\t\t// NOTE: this is not an example of ideal error handling.\n\t\tif x := recover(); x != nil {\n\t\t\terr = fmt.Errorf(\"error at %s: %v\", lex.scan.Position, x)\n\t\t}\n\t}()\n\tread(lex, reflect.ValueOf(out).Elem())\n\treturn nil\n}", "func (_LockProxy *LockProxyFilterer) ParseDebugUint256(log types.Log) (*LockProxyDebugUint256, error) {\n\tevent := new(LockProxyDebugUint256)\n\tif err := _LockProxy.contract.UnpackLog(event, \"DebugUint256\", log); err != nil {\n\t\treturn nil, err\n\t}\n\treturn event, nil\n}", "func (e *endpoint) extract(sel *goquery.Selection) result {\n\tr := result{}\n\tfor field, ext := range e.Result {\n\t\tif v := ext.execute(sel); v != \"\" {\n\t\t\tr[field] = v\n\t\t\t// log.Printf(\"%s: %s\", field, v)\n\t\t}\n\t}\n\treturn r\n}", "func WalkOrig(v cue.Value, before func(cue.Value) bool, after func(cue.Value), options ...cue.Option) {\n\n\t// call before and possibly stop recursion\n\tif before != nil && !before(v) {\n\t\treturn\n\t}\n\n\t// possibly recurse\n\tswitch v.IncompleteKind() {\n\tcase cue.StructKind:\n\t\tif options == nil {\n\t\t\toptions = defaultWalkOptions\n\t\t}\n\t\ts, _ := v.Fields(options...)\n\n\t\tfor s.Next() {\n\t\t\tWalk(s.Value(), before, after, options...)\n\t\t}\n\n\tcase cue.ListKind:\n\t\tl, _ := v.List()\n\t\tfor l.Next() {\n\t\t\tWalk(l.Value(), before, after, options...)\n\t\t}\n\n\t\t// no default (basic lit types)\n\n\t}\n\n\tif after != nil {\n\t\tafter(v)\n\t}\n\n}", "func (sc *Scanner) parseRecord() (record map[string]string, err error) {\n\trecord = make(map[string]string)\n\tfor {\n\t\tf, delim, err := sc.parseFieldName()\n\t\tif err != nil {\n\t\t\tif len(record) == 0 {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif delim == '\\n' {\n\t\t\tcontinue\n\t\t}\n\t\tif delim == '%' {\n\t\t\tbreak\n\t\t}\n\t\tv, end := sc.parseFieldValue()\n\t\tif len(f) > 0 && len(v) > 0 {\n\t\t\tif _, dup := record[f]; dup {\n\t\t\t\treturn nil, errors.Errorf(\"line: %d: duplicated field %q\", sc.line, f)\n\t\t\t}\n\t\t\trecord[f] = v\n\t\t\tif !sc.fok[f] {\n\t\t\t\tsc.fok[f] = true\n\t\t\t\tsc.fields = append(sc.fields, f)\n\t\t\t}\n\t\t}\n\t\tif end {\n\t\t\tbreak\n\t\t}\n\t}\n\tif len(record) == 0 {\n\t\treturn nil, nil\n\t}\n\treturn record, nil\n}", "func (u *UseSRTP) Unmarshal(data []byte) error {\n\tif len(data) <= useSRTPHeaderSize {\n\t\treturn errBufferTooSmall\n\t} else if TypeValue(binary.BigEndian.Uint16(data)) != u.TypeValue() {\n\t\treturn errInvalidExtensionType\n\t}\n\n\tprofileCount := int(binary.BigEndian.Uint16(data[4:]) / 2)\n\tif supportedGroupsHeaderSize+(profileCount*2) > len(data) {\n\t\treturn errLengthMismatch\n\t}\n\n\tfor i := 0; i < profileCount; i++ {\n\t\tsupportedProfile := SRTPProtectionProfile(binary.BigEndian.Uint16(data[(useSRTPHeaderSize + (i * 2)):]))\n\t\tif _, ok := srtpProtectionProfiles()[supportedProfile]; ok {\n\t\t\tu.ProtectionProfiles = append(u.ProtectionProfiles, supportedProfile)\n\t\t}\n\t}\n\treturn nil\n}", "func ParseRec(s []byte, normalize bool, shouldLog bool, nowF func() time.Time, lg *zap.Logger) (*RecBytes, error) {\n\tpathStart, pathEnd, valStart, valEnd, timeStart, timeEnd, err := recFields(s)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to break record into fields\")\n\t}\n\n\tvar path []byte\n\tif normalize {\n\t\tpath, err = normalizePath(s[pathStart:pathEnd])\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to normalize path\")\n\t\t}\n\t} else {\n\t\tpath = append(path, s[pathStart:pathEnd]...)\n\t}\n\n\tres := RecBytes{\n\t\tPath: path,\n\t\tReceived: nowF(),\n\t}\n\tres.Val = append(res.Val, s[valStart:valEnd]...)\n\tres.Time = append(res.Time, s[timeStart:timeEnd]...)\n\n\treturn &res, nil\n}", "func ParseMain(data string) []string {\n\tsub := reg.FindAllStringSubmatch(data, -1)\n\tres := make([]string, len(sub))\n\tfor k, v := range sub {\n\t\tres[k] = v[1]\n\t}\n\tsort.Strings(res)\n\treturn res\n}", "func (_ERC20Pausable *ERC20PausableFilterer) ParseTransfer(log types.Log) (*ERC20PausableTransfer, error) {\n\tevent := new(ERC20PausableTransfer)\n\tif err := _ERC20Pausable.contract.UnpackLog(event, \"Transfer\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func ScanRecord(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif atEOF && len(data) == 0 {\n\t\treturn 0, nil, nil\n\t}\n\t// Find record start.\n\tswitch i := bytes.IndexByte(data, rs); {\n\tcase i < 0:\n\t\tif atEOF {\n\t\t\t// Partial record.\n\t\t\treturn len(data), data, nil\n\t\t}\n\t\t// Request more data.\n\t\treturn 0, nil, nil\n\tcase i > 0:\n\t\t// Partial record.\n\t\treturn i, data[0 : i-1], nil\n\t}\n\t// else i == 0\n\n\t// Drop consecutive leading rs's\n\tfor len(data) > 1 && data[1] == rs {\n\t\tdata = data[1:]\n\t}\n\n\t// Find end or next record.\n\ti := bytes.IndexByte(data[1:], rs)\n\tif i < 0 {\n\t\tif atEOF {\n\t\t\treturn len(data), data, nil\n\t\t}\n\t\t// Request more data.\n\t\treturn 0, nil, nil\n\t}\n\treturn 1 + i, data[:1+i], nil\n}", "func UnmarshalSIDStructureSubSubTLV(b []byte) (*SIDStructureSubSubTLV, error) {\n\t// Skip Resrved byte\n\tp := 0\n\ttlv := &SIDStructureSubSubTLV{}\n\ttlv.LocalBlockLength = b[p]\n\tp++\n\ttlv.LocalNodeLength = b[p]\n\tp++\n\ttlv.FunctionLength = b[p]\n\tp++\n\ttlv.ArgumentLength = b[p]\n\tp++\n\ttlv.TranspositionLength = b[p]\n\tp++\n\ttlv.TranspositionOffset = b[p]\n\n\treturn tlv, nil\n}", "func (_ERC20Capped *ERC20CappedFilterer) ParseTransfer(log types.Log) (*ERC20CappedTransfer, error) {\n\tevent := new(ERC20CappedTransfer)\n\tif err := _ERC20Capped.contract.UnpackLog(event, \"Transfer\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func (r *CAA) Decode(i []byte, start, length int) error {\n\tif length < 2 {\n\t\treturn errors.New(\"data is not long enough to contain CAA record\")\n\t}\n\tr.Flags = i[start]\n\ttlen := i[start+1]\n\tif length < int(tlen)+2 {\n\t\treturn errors.New(\"tag lenght exceeds data lenght\")\n\t}\n\tr.Tag = string(i[start+2 : start+2+int(tlen)])\n\tr.Value = string(i[start+2+int(tlen) : start+length])\n\treturn nil\n}", "func parsePTSOrDTS(i []byte) *ClockReference {\n\treturn newClockReference(int(uint64(i[0])>>1&0x7<<30|uint64(i[1])<<22|uint64(i[2])>>1&0x7f<<15|uint64(i[3])<<7|uint64(i[4])>>1&0x7f), 0)\n}", "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "func (hlp *Helper) unmarshal(ad *netlink.AttributeDecoder) error {\n\n\tfor ad.Next() {\n\t\tswitch helperType(ad.Type()) {\n\t\tcase ctaHelpName:\n\t\t\thlp.Name = ad.String()\n\t\tcase ctaHelpInfo:\n\t\t\thlp.Info = ad.Bytes()\n\t\tdefault:\n\t\t\treturn fmt.Errorf(errAttributeChild, ad.Type())\n\t\t}\n\t}\n\n\treturn ad.Err()\n}" ]
[ "0.7380473", "0.60085166", "0.58404934", "0.5604804", "0.5528614", "0.52840686", "0.5036604", "0.48920414", "0.48108783", "0.48038596", "0.47032255", "0.46916306", "0.46458298", "0.43914226", "0.4372695", "0.4316549", "0.43138635", "0.42837065", "0.42672035", "0.42277274", "0.42195016", "0.41949323", "0.41874012", "0.41819555", "0.41815546", "0.41500038", "0.41318402", "0.41227582", "0.41139874", "0.41052783", "0.41025162", "0.4099052", "0.40848047", "0.40834168", "0.40828356", "0.4077364", "0.40660754", "0.40592447", "0.40586388", "0.4051682", "0.40500456", "0.40426105", "0.4029893", "0.40264186", "0.4012608", "0.40095857", "0.40028173", "0.40018213", "0.39993954", "0.3998807", "0.39932033", "0.39867234", "0.39790207", "0.3976663", "0.39754304", "0.39716634", "0.3965331", "0.3965331", "0.3965331", "0.39646518", "0.3949883", "0.39450473", "0.3938848", "0.39369056", "0.39350063", "0.39301226", "0.39180613", "0.38925803", "0.3892114", "0.3890016", "0.38863963", "0.3877349", "0.38732964", "0.38686782", "0.38665164", "0.38619682", "0.38579667", "0.38570553", "0.38564047", "0.38541052", "0.3852068", "0.38517207", "0.3850454", "0.38398263", "0.38362336", "0.38360265", "0.38347718", "0.38292402", "0.38190228", "0.3815181", "0.38149744", "0.38104355", "0.38043082", "0.38009632", "0.37973973", "0.37973973", "0.37973973", "0.37973973", "0.37973973", "0.3791505" ]
0.7002758
1
countAuxFields examines the data of a SAM record's OPT field to determine the number of auxFields there are.
countAuxFields анализирует данные поля OPT записи SAM, чтобы определить количество полей-дополнений.
func countAuxFields(aux []byte) (int, error) { naux := 0 for i := 0; i+2 < len(aux); { t := aux[i+2] switch j := jumps[t]; { case j > 0: j += 3 i += j naux++ case j < 0: switch t { case 'Z', 'H': var ( j int v byte ) for j, v = range aux[i:] { if v == 0 { // C string termination break // Truncate terminal zero. } } i += j + 1 naux++ case 'B': if len(aux) < i+8 { return -1, errCorruptAuxField } length := binary.LittleEndian.Uint32(aux[i+4 : i+8]) j = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4 i += j naux++ } default: return -1, errCorruptAuxField } } return naux, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r MLDv2ReportMulticastAddressRecord) AuxDataLen() int {\n\treturn int(r[mldv2ReportMulticastAddressRecordAuxDataLenOffset]) * mldv2ReportMulticastAddressRecordAuxDataLenUnits\n}", "func NumFields(elemTyp reflect.Type, skipUnexported bool) int {\n\treturn len(lookupFields(elemTyp, skipUnexported, nil))\n}", "func (node FbsFile) CountOfField() int {\n return 3\n}", "func (fields List) Len() int {\n\tvar count int\n\tb := ptob(fields.p)\n\tvar i int\n\tfor {\n\t\tx, n := uvarint(b[i:])\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tif useSharedNames {\n\t\t\ti += n\n\t\t} else {\n\t\t\ti += n + x\n\t\t}\n\t\tisdatakind := datakind(Kind(b[i]))\n\t\ti++\n\t\tif isdatakind {\n\t\t\tx, n = uvarint(b[i:])\n\t\t\ti += n + x\n\t\t}\n\t\tcount++\n\t}\n\treturn count\n}", "func (f *Fields) Len() int", "func (f SubFields) Len() int { return len(f) }", "func (z *ZebraData) fieldsNotEmpty(isempty []bool) uint32 {\n\tif len(isempty) == 0 {\n\t\treturn 3\n\t}\n\tvar fieldsInUse uint32 = 3\n\tisempty[0] = (len(z.Userid) == 0) // string, omitempty\n\tif isempty[0] {\n\t\tfieldsInUse--\n\t}\n\tisempty[1] = (len(z.Username) == 0) // string, omitempty\n\tif isempty[1] {\n\t\tfieldsInUse--\n\t}\n\tisempty[2] = (len(z.Note) == 0) // string, omitempty\n\tif isempty[2] {\n\t\tfieldsInUse--\n\t}\n\n\treturn fieldsInUse\n}", "func (pr *prepareResult) numField() int { return len(pr.parameterFields) }", "func (pr *prepareResult) numField() int { return len(pr.parameterFields) }", "func (_DelegateProfile *DelegateProfileCallerSession) NumOfFields() (*big.Int, error) {\n\treturn _DelegateProfile.Contract.NumOfFields(&_DelegateProfile.CallOpts)\n}", "func (_DelegateProfile *DelegateProfileSession) NumOfFields() (*big.Int, error) {\n\treturn _DelegateProfile.Contract.NumOfFields(&_DelegateProfile.CallOpts)\n}", "func (f Unstructured) FieldsLen() int {\n\tif f.fields == nil {\n\t\treturn 0\n\t}\n\treturn len(f.fields)\n}", "func (_DelegateProfile *DelegateProfileCaller) NumOfFields(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _DelegateProfile.contract.Call(opts, out, \"numOfFields\")\n\treturn *ret0, err\n}", "func countEmittableStructFields(cfg *atlas.AtlasEntry, target_rv reflect.Value) int {\n\ttotal := 0\n\tfor _, fieldEntry := range cfg.StructMap.Fields {\n\t\tif fieldEntry.Ignore {\n\t\t\tcontinue\n\t\t}\n\t\tif !fieldEntry.OmitEmpty {\n\t\t\ttotal++\n\t\t\tcontinue\n\t\t}\n\t\tif !isEmptyValue(fieldEntry.ReflectRoute.TraverseToValue(target_rv)) {\n\t\t\ttotal++\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn total\n}", "func parseAux(aux []byte, aa []sam.Aux) {\n\tnaa := 0\n\tfor i := 0; i+2 < len(aux); {\n\t\tt := aux[i+2]\n\t\tswitch j := jumps[t]; {\n\t\tcase j > 0:\n\t\t\tj += 3\n\t\t\taa[naa] = sam.Aux(aux[i : i+j : i+j])\n\t\t\tnaa++\n\t\t\ti += j\n\t\tcase j < 0:\n\t\t\tswitch t {\n\t\t\tcase 'Z', 'H':\n\t\t\t\tvar (\n\t\t\t\t\tj int\n\t\t\t\t\tv byte\n\t\t\t\t)\n\t\t\t\tfor j, v = range aux[i:] {\n\t\t\t\t\tif v == 0 { // C string termination\n\t\t\t\t\t\tbreak // Truncate terminal zero.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taa[naa] = sam.Aux(aux[i : i+j : i+j])\n\t\t\t\tnaa++\n\t\t\t\ti += j + 1\n\t\t\tcase 'B':\n\t\t\t\tlength := binary.LittleEndian.Uint32(aux[i+4 : i+8])\n\t\t\t\tj = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4\n\t\t\t\taa[naa] = sam.Aux(aux[i : i+j : i+j])\n\t\t\t\tnaa++\n\t\t\t\ti += j\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"bam: unrecognised optional field type: %q\", t))\n\t\t}\n\t}\n}", "func (ss SectionSlice) TotalFields() int {\n\tfs := 0\n\tfor _, s := range ss {\n\t\tfor _, g := range s.Groups {\n\t\t\tfor _ = range g.Fields {\n\t\t\t\tfs++\n\t\t\t}\n\t\t}\n\t}\n\treturn fs\n}", "func (f *FieldList) NumFields() int {\n\tn := 0\n\tif f != nil {\n\t\tfor _, g := range f.List {\n\t\t\tm := len(g.Names)\n\t\t\tif m == 0 {\n\t\t\t\tm = 1 // anonymous field\n\t\t\t}\n\t\t\tn += m\n\t\t}\n\t}\n\treturn n\n}", "func (f DFields) Len() int { return len(f) }", "func (f CFields) Len() int { return len(f) }", "func (node FbsInvertedMapString) CountOfField() int {\n return 2\n}", "func (n *IdentList) NumFields() int {\n\tif n == nil {\n\t\treturn 0\n\t}\n\n\treturn len(n.List)\n}", "func NumFieldsExcp(numField uint64, fields ...uint64) uint64 {\n\treturn AllFieldsExcp(1<<numField-1, fields...)\n}", "func (params complexPropertyConversionParameters) countArraysAndMapsInConversionContext() int {\n\tresult := 0\n\tfor _, t := range params.conversionContext {\n\t\tswitch t.(type) {\n\t\tcase *astmodel.MapType:\n\t\t\tresult += 1\n\t\tcase *astmodel.ArrayType:\n\t\t\tresult += 1\n\t\t}\n\t}\n\n\treturn result\n}", "func (pr *prepareResult) numInputField() int {\n\tif !pr.fc.IsProcedureCall() {\n\t\treturn len(pr.parameterFields) // only input fields\n\t}\n\tnumField := 0\n\tfor _, f := range pr.parameterFields {\n\t\tif f.In() {\n\t\t\tnumField++\n\t\t}\n\t}\n\treturn numField\n}", "func (fw *Writer) PutAuxField(addr biopb.Coord, aa []sam.Aux) {\n\twb := fw.buf\n\twb.updateAddrBounds(addr)\n\twb.defaultBuf.PutUvarint64(uint64(len(aa)))\n\tfor _, a := range aa {\n\t\twb.blobBuf.PutBytes(a[:3])\n\t}\n\tfor _, a := range aa {\n\t\tswitch a[2] {\n\t\tcase 'A', 'c', 'C': // ascii, int8, uint8\n\t\t\tif len(a) != 4 {\n\t\t\t\tlog.Panic(a)\n\t\t\t}\n\t\t\twb.blobBuf.PutUint8(a[3])\n\t\tcase 's', 'S': // int16, uint16\n\t\t\tif len(a) != 5 {\n\t\t\t\tlog.Panic(a)\n\t\t\t}\n\t\t\twb.blobBuf.PutBytes(a[3:5])\n\t\tcase 'i', 'I', 'f': // int32, uint32, float32\n\t\t\tif len(a) != 7 {\n\t\t\t\tlog.Panic(a)\n\t\t\t}\n\t\t\twb.blobBuf.PutBytes(a[3:7])\n\t\tcase 'Z', 'H': // text, hexstr\n\t\t\twb.putLengthPrefixedBytes(a[3:])\n\t\tdefault:\n\t\t\tlog.Panic(a)\n\t\t}\n\t}\n}", "func (bits *BitArray) Count() int {\n\tlength := 0\n\n\tfor i := 0; i < bits.lenpad; i += _BytesPW {\n\t\tw := bytes2word(bits.bytes[i : i+_BytesPW])\n\t\tlength += countbits64(w)\n\t}\n\n\treturn length\n}", "func parseAux(aux []byte) ([]sam.Aux, error) {\n\tif len(aux) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Heuristically pre-allocate enough slots for the byte data.\n\t// Value chosen by experimentation and will not fit all inputs,\n\t// with the cost being over-allocation.\n\taa := make([]sam.Aux, 0, len(aux)/4)\n\n\tfor i := 0; i+2 < len(aux); {\n\t\tt := aux[i+2]\n\t\tswitch j := jumps[t]; {\n\t\tcase j > 0:\n\t\t\tj += 3\n\t\t\taa = append(aa, sam.Aux(aux[i:i+j:i+j]))\n\t\t\ti += j\n\t\tcase j < 0:\n\t\t\tswitch t {\n\t\t\tcase 'Z', 'H':\n\t\t\t\tj := bytes.IndexByte(aux[i:], 0)\n\t\t\t\tif j == -1 {\n\t\t\t\t\treturn nil, errors.New(\"bam: invalid zero terminated data: no zero\")\n\t\t\t\t}\n\t\t\t\taa = append(aa, sam.Aux(aux[i:i+j:i+j]))\n\t\t\t\ti += j + 1\n\t\t\tcase 'B':\n\t\t\t\tlength := binary.LittleEndian.Uint32(aux[i+4 : i+8])\n\t\t\t\tj = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4\n\t\t\t\tif j < 0 || i+j < 0 || i+j > len(aux) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"bam: invalid array length for aux data: %d\", length)\n\t\t\t\t}\n\t\t\t\taa = append(aa, sam.Aux(aux[i:i+j:i+j]))\n\t\t\t\ti += j\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"bam: unrecognised optional field type: %q\", t)\n\t\t}\n\t}\n\treturn aa, nil\n}", "func (p Profile) Len() int { return len(p.FieldPerms) }", "func buildAux(aa []sam.Aux) (aux []byte) {\n\tfor _, a := range aa {\n\t\t// TODO: validate each 'a'\n\t\taux = append(aux, []byte(a)...)\n\t\tswitch a.Type() {\n\t\tcase 'Z', 'H':\n\t\t\taux = append(aux, 0)\n\t\t}\n\t}\n\treturn\n}", "func (l *Loader) NAux(i Sym) int {\n\tif l.IsExternal(i) {\n\t\treturn 0\n\t}\n\tr, li := l.toLocal(i)\n\treturn r.NAux(li)\n}", "func scanFields(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif atEOF {\n\t\treturn 0, nil, io.EOF\n\t}\n\n\tif len(data) < 4 {\n\t\treturn 0, nil, nil\n\t}\n\n\ttotalSize := int(binary.BigEndian.Uint32(data[:4])) + 4\n\n\tif totalSize > len(data) {\n\t\treturn 0, nil, nil\n\t}\n\n\t// msgBytes := make([]byte, totalSize-4, totalSize-4)\n\t// copy(msgBytes, data[4:totalSize])\n\t// not copy here, copied by callee more reasonable\n\treturn totalSize, data[4:totalSize], nil\n}", "func buildAux(aa []sam.Aux, buf *[]byte) {\n\tfor _, a := range aa {\n\t\t// TODO: validate each 'a'\n\t\t*buf = append(*buf, []byte(a)...)\n\t\tswitch a.Type() {\n\t\tcase 'Z', 'H':\n\t\t\t*buf = append(*buf, 0)\n\t\t}\n\t}\n}", "func (m *AdapTuning) HasExtensionFields() bool {\n\treturn false\n}", "func (z *ZColorGroup) fieldsNotEmpty(isempty []bool) uint32 {\n\tif len(isempty) == 0 {\n\t\treturn 3\n\t}\n\tvar fieldsInUse uint32 = 3\n\tisempty[0] = (z.Id == 0) // number, omitempty\n\tif isempty[0] {\n\t\tfieldsInUse--\n\t}\n\tisempty[1] = (len(z.Name) == 0) // string, omitempty\n\tif isempty[1] {\n\t\tfieldsInUse--\n\t}\n\tisempty[2] = (len(z.Colors) == 0) // string, omitempty\n\tif isempty[2] {\n\t\tfieldsInUse--\n\t}\n\n\treturn fieldsInUse\n}", "func Count(v interface{}) (int, error) {\n\ta := reflect.ValueOf(v)\n\tif !a.IsValid() {\n\t\treturn 0, errors.New(\"failed to get reflection value\")\n\t}\n\treturn a.NumField(), nil\n}", "func (r *PrivateRR) len(off int, compression map[string]struct{}) int {\n\tl := r.Hdr.len(off, compression)\n\tl += r.Data.Len()\n\treturn l\n}", "func (i *GoStructFields) Len() int {\n\treturn len(*i)\n}", "func (fc *FileControl) TotalRecordCountField() string {\n\treturn fc.numericField(fc.TotalRecordCount, 8)\n}", "func (record) RecordCount(b []byte) int {\n\treturn len(b) / recordLength\n}", "func (attr *Attribute) CountSubAttributes() int {\n\treturn len(attr.subAttributes)\n}", "func (s *SmartCollectionServiceOp) CountMetafields(smartCollectionID int64, options interface{}) (int, error) {\n\tmetafieldService := &MetafieldServiceOp{client: s.client, resource: smartCollectionsResourceName, resourceID: smartCollectionID}\n\treturn metafieldService.Count(options)\n}", "func (m *DigicamControl) HasExtensionFields() bool {\n\treturn false\n}", "func NumberOfContainer(object interface{}) int {\r\n\r\n\ttyp := reflect.TypeOf(object)\r\n\tnumField := typ.Elem().NumField()\r\n\treturn numField\r\n}", "func (feature Feature) FieldCount() int {\n\tcount := C.OGR_F_GetFieldCount(feature.cval)\n\treturn int(count)\n}", "func (s StructFields) Len() int {\n\treturn len(s)\n}", "func (f *UserPlaneIPResourceInformationFields) MarshalLen() int {\n\tl := 1\n\tif (f.Flags>>2)&0x07 != 0 {\n\t\tl++\n\t}\n\tif has1stBit(f.Flags) {\n\t\tl += 4\n\t}\n\tif has2ndBit(f.Flags) {\n\t\tl += 16\n\t}\n\tif has6thBit(f.Flags) {\n\t\tl += len([]byte(f.NetworkInstance))\n\t}\n\tif has7thBit(f.Flags) {\n\t\tl++\n\t}\n\n\treturn l\n}", "func (q *ParsedRawQuery) NumFieldsForQuery() int {\n\tnumFieldsForQuery := 2 // Timestamp field and raw doc source field\n\tnumFieldsForQuery += q.NumFilters()\n\tnumFieldsForQuery += len(q.OrderBy)\n\treturn numFieldsForQuery\n}", "func (n *nodeHeader) prefixFields() (*uint16, []byte) {\n\tswitch n.typ {\n\tcase typLeaf:\n\t\t// Leaves have no prefix\n\t\treturn nil, nil\n\tcase typNode4:\n\t\tn4 := n.node4()\n\t\treturn &n4.prefixLen, n4.prefix[:]\n\n\tcase typNode16:\n\t\tn16 := n.node16()\n\t\treturn &n16.prefixLen, n16.prefix[:]\n\n\tcase typNode48:\n\t\tn48 := n.node48()\n\t\treturn &n48.prefixLen, n48.prefix[:]\n\n\tcase typNode256:\n\t\tn256 := n.node256()\n\t\treturn &n256.prefixLen, n256.prefix[:]\n\t}\n\tpanic(\"invalid type\")\n}", "func (is *InfoStore) infoCount() uint32 {\n\tcount := uint32(len(is.Infos))\n\tfor _, group := range is.Groups {\n\t\tcount += uint32(len(group.Infos))\n\t}\n\treturn count\n}", "func (r *InterRecord) Len() int {\n\tif r.Types != 0 {\n\t\treturn len(r.Raw)\n\t}\n\n\treturn len(r.Bytes())\n}", "func (f Fields) Len() int {\n\treturn len(f)\n}", "func (vs variableSet) count() int {\n\tc := 0\n\tif vs[0] != nil {\n\t\tc++\n\t}\n\tif vs[1] != nil {\n\t\tc++\n\t}\n\tif vs[2] != nil {\n\t\tc++\n\t}\n\tif vs[3] != nil {\n\t\tc++\n\t}\n\treturn c\n}", "func (cp *ConnectPacket) len() int {\r\n\ttotal := 0\r\n\r\n\tif cp.Version == Version31 {\r\n\t\t// 2 bytes protocol name length\r\n\t\t// 6 bytes protocol name\r\n\t\t// 1 byte protocol version\r\n\t\ttotal += 2 + 6 + 1\r\n\t} else {\r\n\t\t// 2 bytes protocol name length\r\n\t\t// 4 bytes protocol name\r\n\t\t// 1 byte protocol version\r\n\t\ttotal += 2 + 4 + 1\r\n\t}\r\n\r\n\t// 1 byte connect flags\r\n\t// 2 bytes keep alive timer\r\n\ttotal += 1 + 2\r\n\r\n\t// add the clientID length\r\n\ttotal += 2 + len(cp.ClientID)\r\n\r\n\t// add the will topic and will message length\r\n\tif cp.Will != nil {\r\n\t\ttotal += 2 + len(cp.Will.Topic) + 2 + len(cp.Will.Payload)\r\n\t}\r\n\r\n\t// add the username length\r\n\tif len(cp.Username) > 0 {\r\n\t\ttotal += 2 + len(cp.Username)\r\n\t}\r\n\r\n\t// add the password length\r\n\tif len(cp.Password) > 0 {\r\n\t\ttotal += 2 + len(cp.Password)\r\n\t}\r\n\r\n\treturn total\r\n}", "func (ds *DynamicStruct) NumField() int {\n\treturn ds.rt.NumField()\n}", "func (g *GroupedAVP) Len() int {\n\tvar l int\n\tfor _, a := range g.AVP {\n\t\tl += a.Len()\n\t}\n\treturn l\n}", "func (m *ComponentInformation) HasExtensionFields() bool {\n\treturn false\n}", "func (rdAddendumB *ReturnDetailAddendumB) AuxiliaryOnUsField() string {\n\treturn rdAddendumB.nbsmField(rdAddendumB.AuxiliaryOnUs, 15)\n}", "func PadCount(p *Pad) int {\n\treturn int(C.avfilter_pad_count((*C.struct_AVFilterPad)(p)))\n}", "func InfofWithFields(sl *SubLogger, extra ExtraFields, format string, a ...interface{}) { //nolint:goprintffuncname // False positive\n\tmu.RLock()\n\tdefer mu.RUnlock()\n\tif f := sl.getFields(); f != nil {\n\t\tf.structuredFields = extra\n\t\tf.stagef(f.logger.InfoHeader, format, a...)\n\t}\n}", "func sizeOfExtras(extras []interface{}) (l uint8) {\n\tfor _, e := range extras {\n\t\tswitch e.(type) {\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"mc: unknown extra type (%T)\", e))\n\t\tcase uint8:\n\t\t\tl += 8 / 8\n\t\tcase uint16:\n\t\t\tl += 16 / 8\n\t\tcase uint32:\n\t\t\tl += 32 / 8\n\t\tcase uint64:\n\t\t\tl += 64 / 8\n\t\t}\n\t}\n\treturn\n}", "func (r *RecordSlice) Len() int { return len(r.zvals) }", "func (a infoSlice) Len() int { return len(a) }", "func (f *FieldSet) NumOutputField() int {\n\tcnt := 0\n\tfor _, field := range f.fields {\n\t\tif field.out() {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}", "func (c *IfPair) InternalLen() int {\n\treturn 2\n}", "func (wb *fieldWriteBuf) totalLen() int {\n\treturn len(wb.defaultBuf) + len(wb.blobBuf)\n}", "func (f RawDataLengthField) Tag() quickfix.Tag { return tag.RawDataLength }", "func totalLen(spec []parseSpec) int {\n\tvar totLen int\n\tfor _, s := range spec {\n\t\ttotLen += len(s)\n\t}\n\treturn totLen\n}", "func (bs *endecBytes) calc(fields ...interface{}) int {\n\ttotal := 0\n\tfor _, val := range fields {\n\t\tswitch val.(type) {\n\t\tcase byte:\n\t\t\ttotal++\n\t\tcase uint16:\n\t\t\ttotal += 2\n\t\tcase uint32: // remaingLength\n\t\t\tremlen := val.(uint32)\n\t\t\tif remlen <= 127 {\n\t\t\t\ttotal++\n\t\t\t} else if remlen <= 16383 {\n\t\t\t\ttotal += 2\n\t\t\t} else if remlen <= 2097151 {\n\t\t\t\ttotal += 3\n\t\t\t} else if remlen <= 268435455 {\n\t\t\t\ttotal += 4\n\t\t\t}\n\t\tcase string:\n\t\t\ttotal += (2 + len([]byte(val.(string))))\n\t\tcase []string:\n\t\t\tfor _, s := range val.([]string) {\n\t\t\t\ttotal += (2 + len([]byte(s)))\n\t\t\t}\n\t\tcase []byte:\n\t\t\ttotal += len(val.([]byte))\n\t\tdefault: // unknown type\n\t\t\treturn -total\n\t\t}\n\t}\n\treturn total\n}", "func visitFields(typ reflect.Type, visitor func(f reflect.StructField) bool) int {\n\ttyp = indirectType(typ)\n\n\tfor n, i := typ.NumField(), 0; i < n; i++ {\n\t\tf := typ.Field(i)\n\t\tfound := visitor(f)\n\t\tif found {\n\t\t\treturn i\n\t\t}\n\t}\n\n\treturn -1\n}", "func countScalars(input []interface{}) int {\n\tfor i := 0; i < len(input); i++ {\n\t\tswitch input[i].(type) {\n\t\tcase keyvalser:\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(input)\n}", "func (bA *CompactBitArray) Count() int {\n\tif bA == nil {\n\t\treturn 0\n\t} else if bA.ExtraBitsStored == 0 {\n\t\treturn len(bA.Elems) * 8\n\t}\n\n\treturn (len(bA.Elems)-1)*8 + int(bA.ExtraBitsStored)\n}", "func len(v Type) int32 {}", "func (o HiveMetastoreConfigPtrOutput) AuxiliaryVersions() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *HiveMetastoreConfig) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AuxiliaryVersions\n\t}).(pulumi.StringMapOutput)\n}", "func (r *Record) Tag(tag []byte) (v Aux, ok bool) {\n\tif len(tag) < 2 {\n\t\tpanic(\"sam: tag too short\")\n\t}\n\tfor _, aux := range r.AuxFields {\n\t\tif aux.matches(tag) {\n\t\t\treturn aux, true\n\t\t}\n\t}\n\treturn nil, false\n}", "func Count(s string) int {\n\txs := strings.Fields(s)\n\treturn len(xs)\n}", "func Count(s string) int {\n\txs := strings.Fields(s)\n\treturn len(xs)\n}", "func (o *V0037DiagRpcm) HasCount() bool {\n\tif o != nil && o.Count != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func scanCount(Qi []keyindex, setsi []xorset) ([]keyindex, int) {\n\tQiSize := 0\n\n\t// len(setsi) = filter.BlockLength\n\tfor i := uint32(0); i < uint32(len(setsi)); i++ {\n\t\tif setsi[i].count == 1 {\n\t\t\tQi[QiSize].index = i\n\t\t\tQi[QiSize].hash = setsi[i].xormask\n\t\t\tQiSize++\n\t\t}\n\t}\n\n\treturn Qi, QiSize\n}", "func (a byCount) Len() int { return len(a) }", "func (o Array_ID_A) Len() uint64 {\n\treturn uint64(len(o.Items)) * 16\n}", "func sectionLength(psi []byte) uint16 {\n\treturn uint16(psi[1]&3)<<8 | uint16(psi[2])\n}", "func Length(i interface{}) (l int, ok bool) {\n\tv, k := preprocess(i)\n\tswitch k {\n\tcase reflect.Map, reflect.Array, reflect.Slice, reflect.String:\n\t\treturn v.Len(), true\n\t}\n\treturn 0, false\n}", "func getNumberOfResults(dtData dtPaginationData, aux []interface{}) error {\n\trows, err := dtData.db.Table(dtData.tableName).\n\t\tSelect(\"COUNT(*)\").\n\t\tWhere(generateDTWhereQuery(dtData.dtColumns), aux...).\n\t\tOrder(dtData.dtSortingColumn.dbColumnName).\n\t\tRows()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not execute query to get the number of results %w\", err)\n\t}\n\n\tdefer func() {\n\t\t_ = rows.Close()\n\n\t\terr = rows.Err()\n\t}()\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"row error occurred %w\", err)\n\t}\n\n\tfor rows.Next() {\n\t\terr = rows.Scan(&final)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not scan row to &final %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}", "func (o HiveMetastoreConfigResponseOutput) AuxiliaryVersions() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v HiveMetastoreConfigResponse) map[string]string { return v.AuxiliaryVersions }).(pulumi.StringMapOutput)\n}", "func (o HiveMetastoreConfigOutput) AuxiliaryVersions() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v HiveMetastoreConfig) map[string]string { return v.AuxiliaryVersions }).(pulumi.StringMapOutput)\n}", "func (f *Filter) Len() int {\n prog := (*C.struct_bpf_program)(f.Program())\n flen := C.bpf_get_len(prog)\n return int(flen)\n}", "func (o *A_2) Len() uint64 {\r\n\treturn 0 +\r\n\t\to.Cursor.Len() +\r\n\t\to.Limit.Len() +\r\n\t\t0\r\n}", "func (c col) countUnknown(known map[byte]struct{}) (n, i int) {\n\ti = -1\n\tfor j, cc := range c {\n\t\tif _, is := known[cc]; cc != 0 && !is {\n\t\t\tn++\n\t\t\tif i < 0 {\n\t\t\t\ti = j\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "func (f *FieldsWithValue) Len() int {\n\treturn len(f.fields)\n}", "func (d *DriverFile) NeedAuxXML() bool {\n\treturn (d.Type == constant.TypeObject && len(d.Elements) > 0) || (d.Type == constant.TypeView && d.Code != \"*\") || (d.Type == constant.TypeProcess && d.CopyPermissions != constant.Undefined) || (d.Type == constant.TypeMenu && len(d.Sections) > 0)\n}", "func PartCount(kcode []byte) int {\n\tr := regexp.MustCompile(`(partType)`)\n\tres := r.FindAllStringSubmatch(string(kcode), -1)\n\treturn len(res)\n}", "func checkFields(data types.TableContent, fields map[string]string) error {\n\tvar seen = make(map[string]struct{}, len(fields))\n\n\tfor i := range data {\n\t\tfor k := range data[i] {\n\t\t\tseen[k] = struct{}{}\n\t\t}\n\t}\n\n\tfor _, f := range fields {\n\t\tif _, ok := seen[f]; !ok {\n\t\t\treturn fmt.Errorf(\"%w: %q missing\", ErrMissingField, f)\n\t\t}\n\t}\n\n\treturn nil\n}", "func (o *IPFixGen) calcShortestRecord() (length int) {\n\tif !o.variableLengthFields {\n\t\tlength = len(o.dataBuffer)\n\t} else {\n\t\tlength = len(o.dataBuffer)\n\t\tfor i := range o.fields {\n\t\t\tif o.fields[i].isVariableLength() {\n\t\t\t\tlength += 1 // one for each variable length\n\t\t\t}\n\t\t}\n\t}\n\treturn length\n}", "func (e *LoadDataController) GetFieldCount() int {\n\treturn len(e.FieldMappings)\n}", "func (ms *multiSorter) Len() int {\n\treturn len(ms.vsrecs)\n}", "func (d *Dataset) RecordCount() int {\n\tcount := 0\n\tif d.BlockCount() > 0 {\n\t\tfor _, block := range d.blocks {\n\t\t\tcount += block.RecordCount()\n\t\t}\n\t}\n\n\treturn count\n}", "func (v *Version) Len() int {\n\treturn len(v.Fields)\n}", "func (s *Store) Len() int {\n\tcnt := 0\n\tdl := len(s.delim)\n\tfor i := range s.lines {\n\t\tcnt += s.lines[i].Len() + dl\n\t}\n\treturn cnt\n}", "func (s ObjectCountByEncryptionType) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CustomerManaged != nil {\n\t\tv := *s.CustomerManaged\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"customerManaged\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.KmsManaged != nil {\n\t\tv := *s.KmsManaged\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"kmsManaged\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.S3Managed != nil {\n\t\tv := *s.S3Managed\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"s3Managed\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.Unencrypted != nil {\n\t\tv := *s.Unencrypted\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"unencrypted\", protocol.Int64Value(v), metadata)\n\t}\n\treturn nil\n}", "func Count(s string) int {\n\t// write the code for this func\n\treturn len(strings.Fields(s))\n}" ]
[ "0.61733234", "0.57533646", "0.5688064", "0.5639402", "0.56135046", "0.56052715", "0.556544", "0.55280674", "0.55280674", "0.5502139", "0.5491858", "0.5484253", "0.54737127", "0.5459307", "0.5433384", "0.5412292", "0.5367275", "0.5298392", "0.52903736", "0.5258248", "0.52197254", "0.5194348", "0.5180859", "0.5179083", "0.51732236", "0.5138594", "0.512181", "0.510318", "0.51001316", "0.5050956", "0.5040395", "0.50094426", "0.5007424", "0.49910817", "0.49244952", "0.49046308", "0.4904626", "0.48424163", "0.48107526", "0.48006442", "0.4798049", "0.47895125", "0.47796696", "0.47707295", "0.4753215", "0.47466797", "0.47375682", "0.4730369", "0.47156706", "0.47030422", "0.4698608", "0.46971604", "0.46882504", "0.4681471", "0.46768388", "0.467654", "0.46764264", "0.4654387", "0.46511304", "0.46471", "0.4644819", "0.46431175", "0.46410275", "0.4628145", "0.46242344", "0.46161944", "0.45993993", "0.45723218", "0.45456836", "0.4531032", "0.45192882", "0.4518479", "0.45167208", "0.45115164", "0.45109633", "0.45109633", "0.45066163", "0.45007765", "0.44897467", "0.44684875", "0.44684306", "0.44657084", "0.44618273", "0.44592223", "0.445625", "0.445191", "0.44502145", "0.4449988", "0.44371128", "0.44285086", "0.44150636", "0.4406566", "0.43963072", "0.43936756", "0.43923068", "0.43883467", "0.43750957", "0.43674228", "0.43616438", "0.43602026" ]
0.7976709
0
UnmarshalHeader parses a sam.Header encoded in BAM binary format.
UnmarshalHeader парсит sam.Header, закодированный в бинарном формате BAM.
func UnmarshalHeader(buf []byte) (*sam.Header, error) { header, err := sam.NewHeader(nil, nil) if err != nil { return nil, err } hr := bytes.NewReader(buf) if err := header.DecodeBinary(hr); err != nil { return nil, err } if hr.Len() > 0 { return nil, fmt.Errorf("%d byte junk at the end of SAM header", hr.Len()) } return header, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func UnmarshalHeader(data []byte, m *MessageHeader) error {\n\tif len(data) < 16 {\n\t\treturn ErrMessageTooSmall\n\t}\n\td := decoder{buffer: data}\n\tm.Txid = uint32(d.readUint(4))\n\tm.Reserved = uint32(d.readUint(4))\n\tm.Flags = uint32(d.readUint(4))\n\tm.Ordinal = uint32(d.readUint(4))\n\treturn nil\n}", "func (hu *headerUnmarshaller) Unmarshal(r *bytes.Buffer, ev wire.Event) error {\n\tconsensusEv := ev.(*Header)\n\n\t// Decoding PubKey BLS\n\tif err := encoding.ReadVarBytes(r, &consensusEv.PubKeyBLS); err != nil {\n\t\treturn err\n\t}\n\n\treturn UnmarshalSignableVote(r, consensusEv)\n}", "func (h *Header) UnmarshalFrameHeader(b []byte) error {\n\tif len(b) < HeaderLength {\n\t\treturn ErrShortHeader\n\t}\n\n\th.Length = uint24(b)\n\th.Type = Type(b[3])\n\th.Flags = Flags(b[4])\n\th.StreamID = uint31(b[5:])\n\n\treturn nil\n}", "func (h *Header) UnmarshalBinary(buf []byte) (err error) {\r\n\t_, err = h.ReadFrom(bytes.NewReader(buf))\r\n\treturn\r\n}", "func (decoder *berDecoder) decodeHeader() (snmpBlockType, int, error) {\n\tblockType, err := decoder.ReadByte()\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"Couldn't read byte at pos %d, err: %s\", decoder.pos, err)\n\t}\n\tdecoder.pos++\n\tblockLength, err := decoder.decodeLength()\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif blockLength > decoder.Len() {\n\t\treturn 0, 0, fmt.Errorf(\"Length %d for block exceeds remaining message length %d\", blockLength, decoder.Len())\n\t}\n\treturn snmpBlockType(blockType), blockLength, nil\n}", "func (mh *MsgHeader) Unpack(b []byte) (err error) {\n\tmh.Leap = b[0] >> 6\n\tmh.Version = (b[0] >> 3) & 0x7\n\tmh.Mode = b[0] & 0x7\n\tmh.Stratum = b[1]\n\tmh.Poll = exponent(b[2])\n\tmh.Precision = exponent(b[3])\n\tmh.RootDelay = unpackShort(b[4:8])\n\tmh.RootDisp = unpackShort(b[8:12])\n\tmh.RefID = [4]byte{b[12], b[13], b[14], b[15]}\n\tmh.Org = unpackTimestamp(b[16:24])\n\tmh.Rec = unpackTimestamp(b[24:32])\n\tmh.Xmt = unpackTimestamp(b[32:40])\n\tmh.Dst = unpackTimestamp(b[40:48])\n\treturn nil\n}", "func parseHeader(r io.Reader, data *libmbd.MCellData) error {\n\n\t// skip first byte - this is a defect in the mcell binary output format\n\tdummy := make([]byte, 1)\n\tif _, err := io.ReadFull(r, dummy); err != nil {\n\t\treturn err\n\t}\n\n\tif err := parseBlockInfo(r, data); err != nil {\n\t\treturn err\n\t}\n\n\tif err := parseBlockNames(r, data); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (h *NalHeader) Unmarshal(buf []byte) error {\n\tif buf == nil {\n\t\treturn fmt.Errorf(\"invalid nil NalHeader\")\n\t}\n\n\tbufSize := len(buf)\n\n\tif bufSize < 1 {\n\t\treturn fmt.Errorf(\"buf is not large enough to container header\")\n\t}\n\t_ = (&h.ForbiddenZeroBit).Unmarshal(buf[ForbiddenZeroBitByteIndex:])\n\n\t_ = (&h.NalRefIdc).Unmarshal(buf[NalRefIdcByteIndex:])\n\n\t_ = (&h.NalUnitType).Unmarshal(buf[NalUnitTypeByteIndex:])\n\n\treturn nil\n}", "func DecodeHeader(na ipld.NodeAssembler, header types.Header) error {\n\tma, err := na.BeginMap(15)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, upFunc := range requiredUnpackFuncs {\n\t\tif err := upFunc(ma, header); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid DAG-ETH Header binary (%v)\", err)\n\t\t}\n\t}\n\treturn ma.Finish()\n}", "func Unmarshal(b []byte, header *sam.Header) (*sam.Record, error) {\n\tif len(b) < bamFixedBytes {\n\t\treturn nil, errRecordTooShort\n\t}\n\t// Need to use int(int32(uint32)) to ensure 2's complement extension of -1.\n\trec := sam.GetFromFreePool()\n\trefID := int(int32(binary.LittleEndian.Uint32(b)))\n\trec.Pos = int(int32(binary.LittleEndian.Uint32(b[4:])))\n\tnLen := int(b[8])\n\trec.MapQ = b[9]\n\tnCigar := int(binary.LittleEndian.Uint16(b[12:]))\n\trec.Flags = sam.Flags(binary.LittleEndian.Uint16(b[14:]))\n\tlSeq := int(binary.LittleEndian.Uint32(b[16:]))\n\tnextRefID := int(int32(binary.LittleEndian.Uint32(b[20:])))\n\trec.MatePos = int(int32(binary.LittleEndian.Uint32(b[24:])))\n\trec.TempLen = int(int32(binary.LittleEndian.Uint32(b[28:])))\n\n\t// Read variable length data.\n\tsrcVariableBytes := len(b) - bamFixedBytes\n\n\tnDoubletBytes := (lSeq + 1) >> 1\n\tsrcAuxOffset := bamFixedBytes + nLen + (nCigar * 4) + nDoubletBytes + lSeq\n\tif len(b) < srcAuxOffset {\n\t\treturn nil, fmt.Errorf(\"Corrupt BAM aux record: len(b)=%d, auxoffset=%d\", len(b), srcAuxOffset)\n\t}\n\tnAuxFields, err := countAuxFields(b[srcAuxOffset:])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tshadowCigarOffset := alignOffset(srcVariableBytes) // store the cigar int32s here\n\tshadowAuxOffset := alignOffset(shadowCigarOffset + (nCigar * 4)) // store the AuxFields here\n\tshadowSize := shadowAuxOffset + (nAuxFields * sizeofSliceHeader)\n\n\t// shadowBuf is used as an 'arena' from which all objects/slices\n\t// required to store the result of parsing the bam alignment record.\n\t// This reduces the load on GC and consequently allows for better\n\t// scalability with the number of cores used by clients of this package.\n\tsam.ResizeScratch(&rec.Scratch, shadowSize)\n\tshadowBuf := rec.Scratch\n\tcopy(shadowBuf, b[bamFixedBytes:])\n\n\tbufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&shadowBuf))\n\n\t// Note that rec.Name now points to the shadow buffer\n\thdr := (*reflect.StringHeader)(unsafe.Pointer(&rec.Name))\n\thdr.Data = uintptr(unsafe.Pointer(bufHdr.Data))\n\thdr.Len = nLen - 1 // drop trailing '\\0'\n\tshadowOffset := nLen\n\n\tvar sliceHdr *reflect.SliceHeader\n\tif nCigar > 0 {\n\t\tfor i := 0; i < nCigar; i++ {\n\t\t\t*(*uint32)(unsafe.Pointer(&shadowBuf[shadowCigarOffset+(i*4)])) = binary.LittleEndian.Uint32(shadowBuf[shadowOffset+(i*4):])\n\t\t}\n\t\trec.Cigar = UnsafeBytesToCigar(shadowBuf[shadowCigarOffset : shadowCigarOffset+nCigar*4])\n\t\tshadowOffset += nCigar * 4\n\t} else {\n\t\trec.Cigar = nil\n\t}\n\n\trec.Seq.Length = lSeq\n\trec.Seq.Seq = UnsafeBytesToDoublets(shadowBuf[shadowOffset : shadowOffset+nDoubletBytes])\n\tshadowOffset += nDoubletBytes\n\n\trec.Qual = shadowBuf[shadowOffset : shadowOffset+lSeq]\n\tshadowOffset += lSeq\n\tif nAuxFields > 0 {\n\t\t// Clear the array before updating rec.AuxFields. GC will be\n\t\t// confused otherwise.\n\t\tfor i := shadowAuxOffset; i < shadowAuxOffset+nAuxFields*sizeofSliceHeader; i++ {\n\t\t\tshadowBuf[i] = 0\n\t\t}\n\t\tsliceHdr = (*reflect.SliceHeader)(unsafe.Pointer(&rec.AuxFields))\n\t\tsliceHdr.Data = uintptr(unsafe.Pointer(bufHdr.Data + uintptr(shadowAuxOffset)))\n\t\tsliceHdr.Len = nAuxFields\n\t\tsliceHdr.Cap = sliceHdr.Len\n\t\tparseAux(shadowBuf[shadowOffset:srcVariableBytes], rec.AuxFields)\n\t}\n\n\trefs := len(header.Refs())\n\tif refID != -1 {\n\t\tif refID < -1 || refID >= refs {\n\t\t\treturn nil, fmt.Errorf(\"bam: reference id %v out of range\", refID)\n\t\t}\n\t\trec.Ref = header.Refs()[refID]\n\t}\n\tif nextRefID != -1 {\n\t\tif refID == nextRefID {\n\t\t\trec.MateRef = rec.Ref\n\t\t\treturn rec, nil\n\t\t}\n\t\tif nextRefID < -1 || nextRefID >= refs {\n\t\t\treturn nil, fmt.Errorf(\"bam: mate reference id %v out of range\", nextRefID)\n\t\t}\n\t\trec.MateRef = header.Refs()[nextRefID]\n\t}\n\treturn rec, nil\n}", "func (fh *frameHeader) Unmarshal(d []byte) error {\n\tif len(d) < marshaledFrameHeaderSize {\n\t\treturn errors.New(\"failed to unmarshal frame header due to not enough data being available\")\n\t}\n\tfh.id = binary.LittleEndian.Uint32(d[:4])\n\tfh.length = binary.LittleEndian.Uint32(d[4:8])\n\tfh.flags = binary.LittleEndian.Uint16(d[8:10])\n\treturn nil\n}", "func DeserializeHeader(bytes []byte) (Header, error) {\n\tvar header Header\n\tif len(bytes) < 12 {\n\t\treturn header, errors.New(fmt.Sprint(\"bytes too short to deserialize dnsmessage.Header, expected at least 12 bytes but got\", len(bytes)))\n\t}\n\theader.ID = binary.BigEndian.Uint16(bytes[0:2])\n\theader.parseFlag(binary.BigEndian.Uint16(bytes[2:4]))\n\theader.QuestionCount = binary.BigEndian.Uint16(bytes[4:6])\n\theader.AnswerRecordCount = binary.BigEndian.Uint16(bytes[6:8])\n\theader.AuthorityRecordCount = binary.BigEndian.Uint16(bytes[8:10])\n\theader.AdditionalRecordCount = binary.BigEndian.Uint16(bytes[10:12])\n\treturn header, nil\n}", "func (h *Header) UnmarshalBinary(data []byte) error {\n\tb := bytes.NewBuffer(data)\n\tvar reserved64 uint64\n\tvar otap, reserved16 uint16\n\tvar ar uint8\n\tvars := []interface{}{\n\t\t&h.Frame.Size,\n\t\t&otap,\n\t\t&h.Frame.Source,\n\t\t&h.FrameAddress.Target,\n\t\t&[6]uint8{}, // reserved\n\t\t&ar,\n\t\t&h.FrameAddress.Sequence,\n\t\t&reserved64, // reserved\n\t\t&h.ProtocolHeader.Type,\n\t\t&reserved16, // reserved\n\t}\n\tfor _, v := range vars {\n\t\tif err := binary.Read(b, endian, v); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\th.Frame.Tagged = otap&tagged != 0\n\th.FrameAddress.AcknowledgementRequired = ar&acknowledgement != 0\n\th.FrameAddress.ResponseRequired = ar&response != 0\n\n\tif int(h.Frame.Size) != len(data) {\n\t\treturn fmt.Errorf(\"expected %d bytes, got %d\", h.Frame.Size, len(data))\n\t}\n\n\treturn nil\n}", "func (d *decoder) decodeHeader() {\n\t// first byte is the number of leaf nodes\n\td.numChars = uint8(readByte(d.r))\n\n\t// read in the total number of characters in the encoded data\n\tbuf := make([]byte, 2)\n\tbuf[0] = readByte(d.r)\n\tbuf[1] = readByte(d.r)\n\n\td.numCharsEncoded = binary.LittleEndian.Uint16(buf)\n\n\t// deserialize the tree\n\td.root = d.createTree()\n}", "func (h *header) Decode(buf []byte) {\n\th.klen = binary.BigEndian.Uint32(buf[0:4])\n\th.vlen = binary.BigEndian.Uint32(buf[4:8])\n\th.meta = buf[8]\n\th.userMeta = buf[9]\n\th.casCounter = binary.BigEndian.Uint64(buf[10:18])\n\th.casCounterCheck = binary.BigEndian.Uint64(buf[18:26])\n}", "func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error) {\n\tchdr := &cb.ChannelHeader{}\n\terr := proto.Unmarshal(bytes, chdr)\n\treturn chdr, errors.Wrap(err, \"error unmarshaling ChannelHeader\")\n}", "func (d *Decoder) ParseHeader() error {\n\trecord, err := d.reader.Read()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.rowNumber++\n\n\td.header = ParseHeader(record)\n\td.headerRecord = append([]string(nil), record...)\n\treturn nil\n}", "func TestDecodeHeader(t *testing.T) {\n\tdata := []byte{\n\t\t// header\n\t\t0x00, 0x00, 0x00, 0x0B, 0x27, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23,\n\n\t\t// data\n\t\t0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x04,\n\t\t0x00, 0x00, 0x00, 0x0B, 0x00, 0x08, 0x03, 0xFF, 0xFD, 0xFF, 0x02, 0xFE,\n\t\t0xFE, 0xFE, 0x04, 0xEE, 0xED, 0x87, 0xFB, 0xCB, 0x2B, 0xFF, 0xAC,\n\t}\n\n\tr := reader.New(data)\n\td := &document{}\n\th, err := NewHeader(d, r, 0, OSequential)\n\trequire.NoError(t, err)\n\n\tassert.Equal(t, int64(11), h.HeaderLength)\n\tassert.Equal(t, uint64(11), h.SegmentDataStartOffset)\n\n\ts, err := h.subInputReader()\n\trequire.NoError(t, err)\n\n\tb, err := s.ReadByte()\n\trequire.NoError(t, err)\n\tassert.Equal(t, byte(0x00), b)\n\n\tthree := make([]byte, 3)\n\tread, err := s.Read(three)\n\trequire.NoError(t, err)\n\n\tassert.Equal(t, 3, read)\n\tassert.Equal(t, byte(0x36), three[2])\n}", "func (r *Record) UnmarshalSAM(h *Header, b []byte) error {\n\tf := bytes.Split(b, []byte{'\\t'})\n\tif len(f) < 11 {\n\t\treturn errors.New(\"sam: missing SAM fields\")\n\t}\n\t*r = Record{Name: string(f[0])}\n\t// TODO(kortschak): Consider parsing string format flags.\n\tflags, err := strconv.ParseUint(string(f[1]), 0, 16)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse flags: %v\", err)\n\t}\n\tr.Flags = Flags(flags)\n\tr.Ref, err = referenceForName(h, string(f[2]))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to assign reference: %v\", err)\n\t}\n\tr.Pos, err = strconv.Atoi(string(f[3]))\n\tr.Pos--\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse position: %v\", err)\n\t}\n\tmapQ, err := strconv.ParseUint(string(f[4]), 10, 8)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse map quality: %v\", err)\n\t}\n\tr.MapQ = byte(mapQ)\n\tr.Cigar, err = ParseCigar(f[5])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse cigar string: %v\", err)\n\t}\n\tif bytes.Equal(f[2], f[6]) || bytes.Equal(f[6], []byte{'='}) {\n\t\tr.MateRef = r.Ref\n\t} else {\n\t\tr.MateRef, err = referenceForName(h, string(f[6]))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"sam: failed to assign mate reference: %v\", err)\n\t\t}\n\t}\n\tr.MatePos, err = strconv.Atoi(string(f[7]))\n\tr.MatePos--\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse mate position: %v\", err)\n\t}\n\tr.TempLen, err = strconv.Atoi(string(f[8]))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sam: failed to parse template length: %v\", err)\n\t}\n\tif !bytes.Equal(f[9], []byte{'*'}) {\n\t\tr.Seq = NewSeq(f[9])\n\t\tif len(r.Cigar) != 0 && !r.Cigar.IsValid(r.Seq.Length) {\n\t\t\treturn errors.New(\"sam: sequence/CIGAR length mismatch\")\n\t\t}\n\t}\n\tif !bytes.Equal(f[10], []byte{'*'}) {\n\t\tr.Qual = append(r.Qual, f[10]...)\n\t\tfor i := range r.Qual {\n\t\t\tr.Qual[i] -= 33\n\t\t}\n\t} else if r.Seq.Length != 0 {\n\t\tr.Qual = make([]byte, r.Seq.Length)\n\t\tfor i := range r.Qual {\n\t\t\tr.Qual[i] = 0xff\n\t\t}\n\t}\n\tif len(r.Qual) != 0 && len(r.Qual) != r.Seq.Length {\n\t\treturn errors.New(\"sam: sequence/quality length mismatch\")\n\t}\n\tif len(f) > 11 {\n\t\tr.AuxFields = make([]Aux, len(f)-11)\n\t\tfor i, aux := range f[11:] {\n\t\t\ta, err := ParseAux(aux)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tr.AuxFields[i] = a\n\t\t}\n\t}\n\treturn nil\n}", "func (m *Mobi) parseHeader(p *pdb.Pdb) error {\n\th := &mobiHeader{}\n\trd := p.Records[0].Data\n\tb := bytes.NewReader(rd)\n\n\terr := binary.Read(b, binary.BigEndian, h)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.header = h\n\n\tmhi := &mobiHeaderID{}\n\terr = binary.Read(b, binary.BigEndian, mhi)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.headerID = mhi\n\n\tendOffset := mhi.HeaderLength + 24\n\trawMobi := rd[24:endOffset]\n\n\tmhd := &mobiHeaderData{}\n\tmb := bytes.NewReader(rawMobi)\n\terr = binary.Read(mb, binary.BigEndian, mhd)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error reading mhd: %v\", err)\n\t}\n\tm.headerData = mhd\n\n\tm.Name = string(rd[mhd.NameOffset : mhd.NameOffset+mhd.NameLength])\n\n\tswitch h.Compression {\n\tcase CompressionNone:\n\t\trawBookText := make([]byte, 0, h.RecordCount*4096)\n\t\tfor i := 1; i < int(mhd.FirstNonBookRecord); i++ {\n\t\t\trawBookText = append(rawBookText, m.trailStrip(p, i)...)\n\t\t}\n\t\tm.Contents = rawBookText\n\tcase CompressionPalmDOC:\n\t\trawBookText := make([]byte, 0, h.RecordCount*4096)\n\t\tfor i := 1; i < int(mhd.FirstNonBookRecord); i++ {\n\t\t\tc, err := lz77.Decompress(m.trailStrip(p, i))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error decompressing record %v: %v\", i, err)\n\t\t\t}\n\t\t\trawBookText = append(rawBookText, c...)\n\t\t}\n\t\tm.Contents = rawBookText\n\tdefault:\n\t\treturn fmt.Errorf(\"Unknown compression type %v\", h.Compression)\n\t}\n\n\treturn nil\n}", "func (hdr *Header) Unmarshal(data []byte) error {\n\thdr.Source = binary.BigEndian.Uint16(data[0:2])\n\thdr.Destination = binary.BigEndian.Uint16(data[2:4])\n\thdr.SeqNum = binary.BigEndian.Uint32(data[4:8])\n\thdr.AckNum = binary.BigEndian.Uint32(data[8:12])\n\n\thdr.DataOffset = data[12] >> 4\n\thdr.ECN = byte(data[13] >> 6 & 7) // 3 bits\n\thdr.Ctrl = Flag(byte(data[13] & 0x3f)) // bottom 6 bits\n\n\thdr.Window = binary.BigEndian.Uint16(data[14:16])\n\thdr.Checksum = binary.BigEndian.Uint16(data[16:18])\n\thdr.Urgent = binary.BigEndian.Uint16(data[18:20])\n\n\thdr.Options = hdr.opts[:0]\n\n\tif hdr.DataOffset < 5 {\n\t\treturn fmt.Errorf(\"Invalid TCP data offset %d < 5\", hdr.DataOffset)\n\t}\n\n\tdataStart := int(hdr.DataOffset) * 4\n\tif dataStart > len(data) {\n\t\thdr.Payload = nil\n\t\t//hdr.Contents = data\n\t\treturn errors.New(\"TCP data offset greater than packet length\")\n\t}\n\t//hdr.Contents = data[:dataStart]\n\thdr.Payload = data[dataStart:]\n\t// From here on, data points just to the header options.\n\tdata = data[20:dataStart]\nLoop:\n\tfor len(data) > 0 {\n\t\tif hdr.Options == nil {\n\t\t\t// Pre-allocate to avoid allocating a slice.\n\t\t\thdr.Options = hdr.opts[:0]\n\t\t}\n\t\thdr.Options = append(hdr.Options, Option{OptionType: OptionKind(data[0])})\n\t\topt := &hdr.Options[len(hdr.Options)-1]\n\t\tswitch opt.OptionType {\n\t\tcase optionKindEndList: // End of options\n\t\t\topt.OptionLength = 1\n\t\t\thdr.Padding = data[1:]\n\t\t\tbreak Loop\n\t\tcase optionKindNop: // 1 byte padding\n\t\t\topt.OptionLength = 1\n\t\tdefault:\n\t\t\topt.OptionLength = data[1]\n\t\t\tif opt.OptionLength < 2 {\n\t\t\t\treturn fmt.Errorf(\"Invalid TCP option length %d < 2\", opt.OptionLength)\n\t\t\t} else if int(opt.OptionLength) > len(data) {\n\t\t\t\treturn fmt.Errorf(\"Ivalid TCP option length %d exceeds remaining %d bytes\", opt.OptionLength, len(data))\n\t\t\t}\n\t\t\topt.OptionData = data[2:opt.OptionLength]\n\t\t}\n\t\tdata = data[opt.OptionLength:]\n\t}\n\n\treturn nil\n}", "func (h *Headers) UnmarshalFrame(hdr *Header, b []byte) error {\n\t// TODO(jc): implement security padding and stream prioritization from\n\t// initial Headers frame.\n\tif hdr.Flags.Has(FlagHeadersPadded) {\n\t\treturn fmt.Errorf(\"headers: padding not implemented\")\n\t} else if hdr.Flags.Has(FlagHeadersPriority) {\n\t\treturn fmt.Errorf(\"headers: priority not implemented\")\n\t}\n\n\tif hdr.Flags.Has(FlagHeadersEndStream) {\n\t\th.EndStream = true\n\t}\n\tif hdr.Flags.Has(FlagHeadersEndHeaders) {\n\t\th.EndHeaders = true\n\t}\n\n\th.Header = *hdr\n\th.Block = make([]byte, len(b))\n\tcopy(h.Block, b)\n\n\treturn nil\n}", "func (hd *ClaimHeader) Unmarshal(data []byte) error {\n\tvar json = jsoniter.ConfigCompatibleWithStandardLibrary\n\terr := json.Unmarshal(data, hd)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func UnpackHeader(any *codectypes.Any) (exported.Header, error) {\n\tif any == nil {\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnpackAny, \"protobuf Any message cannot be nil\")\n\t}\n\n\theader, ok := any.GetCachedValue().(exported.Header)\n\tif !ok {\n\t\treturn nil, sdkerrors.Wrapf(sdkerrors.ErrUnpackAny, \"cannot unpack Any into Header %T\", any)\n\t}\n\n\treturn header, nil\n}", "func (header *FuseInHeader) ParseBinary(bcontent []byte) error {\n\terr := common.ParseBinary(bcontent, header)\n\n\treturn err\n}", "func DecodeHeader(data []byte, bytesRead int, h *Header) (int, error) {\n\tif h == nil {\n\t\treturn 0, errors.New(\"Cannot decode bytes to nil Header\")\n\t}\n\n\tif len(data) < maxHeaderSize {\n\t\treturn 0, fmt.Errorf(\"Header bytes should be %d bytes, found %d\", maxHeaderSize, len(data))\n\t}\n\n\tvar err error\n\n\th.ID, bytesRead, err = decodeUint16(data, bytesRead)\n\tif err != nil {\n\t\treturn bytesRead, err\n\t}\n\n\tcurrentByte := data[bytesRead]\n\th.QR = QRType(getBitsAtIdx(currentByte, 0, 1))\n\th.OPCODE = Opcode(getBitsAtIdx(currentByte, 1, 4))\n\th.AA = getBitsAtIdx(currentByte, 5, 1)\n\th.TC = getBitsAtIdx(currentByte, 6, 1)\n\th.RD = getBitsAtIdx(currentByte, 7, 1)\n\tbytesRead++\n\n\tcurrentByte = data[bytesRead]\n\th.RA = getBitsAtIdx(currentByte, 0, 1)\n\th.Z = getBitsAtIdx(currentByte, 1, 3)\n\th.RCODE = ResponseCode(getBitsAtIdx(currentByte, 4, 4))\n\tbytesRead++\n\n\t// Set the remaining data\n\th.QDCOUNT, bytesRead, err = decodeUint16(data, bytesRead)\n\tif err != nil {\n\t\treturn bytesRead, err\n\t}\n\n\th.ANCOUNT, bytesRead, err = decodeUint16(data, bytesRead)\n\tif err != nil {\n\t\treturn bytesRead, err\n\t}\n\n\th.NSCOUNT, bytesRead, err = decodeUint16(data, bytesRead)\n\tif err != nil {\n\t\treturn bytesRead, err\n\t}\n\n\th.ARCOUNT, bytesRead, err = decodeUint16(data, bytesRead)\n\tif err != nil {\n\t\treturn bytesRead, err\n\t}\n\n\treturn bytesRead, err\n}", "func DecodeHeader(buf []byte, opts ...Option) (*Header, error) {\n\tconf := defaultConfig()\n\tfor _, opt := range opts {\n\t\topt(conf)\n\t}\n\n\tif len(buf) != 100 {\n\t\treturn nil, fmt.Errorf(\"have %d bytes, expecting >= 100\", len(buf))\n\t}\n\n\tcode := binary.BigEndian.Uint32(buf[0:4])\n\tif code != 0x0000270a {\n\t\treturn nil, fmt.Errorf(\"bad file code\")\n\t}\n\n\tshape := binary.LittleEndian.Uint32(buf[32:36])\n\tif !validShapeType(shape) {\n\t\treturn nil, fmt.Errorf(\"invalid shape type %d\", shape)\n\t}\n\n\tvar box *BoundingBox\n\tvar err error\n\tif conf.precision == nil {\n\t\tif box, err = DecodeBoundingBox(buf[36:]); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif box, err = DecodeBoundingBoxP(buf[36:], *conf.precision); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &Header{\n\t\t// file length is in 16-bit words - but bytes is more useful\n\t\tFileLength: binary.BigEndian.Uint32(buf[24:28]) * 2,\n\t\tVersion: binary.LittleEndian.Uint32(buf[28:32]),\n\t\tShapeType: ShapeType(shape),\n\t\tBoundingBox: *box,\n\t}, nil\n}", "func (h *Header) UnmarshalJSON(data []byte) error {\n\t// As block.Block and BlockMetadata are at the same level in json,\n\t// do unmarshalling separately for both structs.\n\tmeta := new(BlockMetadata)\n\terr := json.Unmarshal(data, meta)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = json.Unmarshal(data, &h.Header)\n\tif err != nil {\n\t\treturn err\n\t}\n\th.BlockMetadata = *meta\n\treturn nil\n}", "func (h *header) Decode(buf []byte) {\n\t// Copy over data from buf into h. Using *h=unsafe.pointer(...) leads to\n\t// pointer alignment issues. See https://github.com/dgraph-io/badger/issues/1096\n\t// and comment https://github.com/dgraph-io/badger/pull/1097#pullrequestreview-307361714\n\tcopy(((*[headerSize]byte)(unsafe.Pointer(h))[:]), buf[:headerSize])\n}", "func (h *header) Decode(buf []byte) {\n\t// Copy over data from buf into h. Using *h=unsafe.pointer(...) leads to\n\t// pointer alignment issues. See https://github.com/dgraph-io/badger/issues/1096\n\t// and comment https://github.com/dgraph-io/badger/pull/1097#pullrequestreview-307361714\n\tcopy(((*[headerSize]byte)(unsafe.Pointer(h))[:]), buf[:headerSize])\n}", "func (r *RawPacket) Unmarshal(b []byte) error {\n\tif len(b) < (headerLength) {\n\t\treturn errPacketTooShort\n\t}\n\t*r = b\n\n\tvar h Header\n\treturn h.Unmarshal(b)\n}", "func (cs *Record) ParseHeader(line string) error {\n\tarr := strings.Split(line, \":\")\n\tif len(arr) != 2 {\n\t\treturn ErrInvalidHeader\n\t}\n\n\tcs.Author = arr[0]\n\tcs.ID = arr[1]\n\n\treturn nil\n}", "func parseDirectoryHeader(b []byte) (*directoryHeader, error) {\n\tif len(b) < dirHeaderSize {\n\t\treturn nil, fmt.Errorf(\"Header was %d bytes, less than minimum %d\", len(b), dirHeaderSize)\n\t}\n\treturn &directoryHeader{\n\t\tcount: binary.LittleEndian.Uint32(b[0:4]) + 1,\n\t\tstartBlock: binary.LittleEndian.Uint32(b[4:8]),\n\t\tinode: binary.LittleEndian.Uint32(b[8:12]),\n\t}, nil\n}", "func readBlockHeader(r io.Reader, bh *BlockHeader) error {\n\treturn bh.Deserialize(r)\n}", "func decodeArrayHeader(b []byte) (arrayHeader, []byte, error) {\n\tif len(b) < 2 {\n\t\treturn arrayHeader{}, b, errors.Errorf(\"buffer too small\")\n\t}\n\thasNulls := b[0]&hasNullFlag != 0\n\tb = b[1:]\n\t_, dataOffset, _, encType, err := encoding.DecodeValueTag(b)\n\tif err != nil {\n\t\treturn arrayHeader{}, b, err\n\t}\n\tb = b[dataOffset:]\n\tb, _, length, err := encoding.DecodeNonsortingUvarint(b)\n\tif err != nil {\n\t\treturn arrayHeader{}, b, err\n\t}\n\tnullBitmap := []byte(nil)\n\tif hasNulls {\n\t\tb, nullBitmap = makeBitVec(b, int(length))\n\t}\n\treturn arrayHeader{\n\t\thasNulls: hasNulls,\n\t\t// TODO(justin): support multiple dimensions.\n\t\tnumDimensions: 1,\n\t\telementType: encType,\n\t\tlength: length,\n\t\tnullBitmap: nullBitmap,\n\t}, b, nil\n}", "func parseBTFHeader(r io.Reader, bo binary.ByteOrder) (*btfHeader, error) {\n\tvar header btfHeader\n\tif err := binary.Read(r, bo, &header); err != nil {\n\t\treturn nil, fmt.Errorf(\"can't read header: %v\", err)\n\t}\n\n\tif header.Magic != btfMagic {\n\t\treturn nil, fmt.Errorf(\"incorrect magic value %v\", header.Magic)\n\t}\n\n\tif header.Version != 1 {\n\t\treturn nil, fmt.Errorf(\"unexpected version %v\", header.Version)\n\t}\n\n\tif header.Flags != 0 {\n\t\treturn nil, fmt.Errorf(\"unsupported flags %v\", header.Flags)\n\t}\n\n\tremainder := int64(header.HdrLen) - int64(binary.Size(&header))\n\tif remainder < 0 {\n\t\treturn nil, errors.New(\"header length shorter than btfHeader size\")\n\t}\n\n\tif _, err := io.CopyN(internal.DiscardZeroes{}, r, remainder); err != nil {\n\t\treturn nil, fmt.Errorf(\"header padding: %v\", err)\n\t}\n\n\treturn &header, nil\n}", "func parseStunHeader(data []byte) *stunMessage {\n\tif len(data) < stunHeaderLength {\n\t\treturn nil\n\t}\n\n\t// The top two bits of the message type must be 0.\n\tmessageType := binary.BigEndian.Uint16(data[0:2])\n\tif messageType>>14 != 0 {\n\t\treturn nil\n\t}\n\n\t// The length must be a multiple of 4 bytes.\n\tlength := binary.BigEndian.Uint16(data[2:4])\n\tif length%4 != 0 {\n\t\treturn nil\n\t}\n\n\t// The magic cookie must be present.\n\tmagicCookie := binary.BigEndian.Uint32(data[4:8])\n\tif magicCookie != stunMagicCookie {\n\t\treturn nil\n\t}\n\n\tclass, method := decomposeMessageType(messageType)\n\tmsg := &stunMessage{\n\t\tlength: length,\n\t\tclass: class,\n\t\tmethod: method,\n\t\ttransactionID: string(data[8:20]),\n\t}\n\treturn msg\n}", "func (pe *File) ParseRichHeader() error {\r\n\r\n\trh := RichHeader{}\r\n\tntHeaderOffset := pe.DosHeader.AddressOfNewEXEHeader\r\n\trichSigOffset := bytes.Index(pe.data[:ntHeaderOffset], []byte(RichSignature))\r\n\r\n\t// For example, .NET executable files do not use the MSVC linker and these\r\n\t// executables do not contain a detectable Rich Header.\r\n\tif richSigOffset < 0 {\r\n\t\treturn nil\r\n\t}\r\n\r\n\t// The DWORD following the \"Rich\" sequence is the XOR key stored by and\r\n\t// calculated by the linker. It is actually a checksum of the DOS header with\r\n\t// the e_lfanew zeroed out, and additionally includes the values of the\r\n\t// unencrypted \"Rich\" array. Using a checksum with encryption will not only\r\n\t// obfuscate the values, but it also serves as a rudimentary digital\r\n\t// signature. If the checksum is calculated from scratch once the values\r\n\t// have been decrypted, but doesn't match the stored key, it can be assumed\r\n\t// the structure had been tampered with. For those that go the extra step to\r\n\t// recalculate the checksum/key, this simple protection mechanism can be bypassed.\r\n\trh.XorKey = binary.LittleEndian.Uint32(pe.data[richSigOffset+4:])\r\n\r\n\t// To decrypt the array, start with the DWORD just prior to the `Rich` sequence\r\n\t// and XOR it with the key. Continue the loop backwards, 4 bytes at a time,\r\n\t// until the sequence `DanS` is decrypted.\r\n\tvar decRichHeader []uint32\r\n\tdansSigOffset := -1\r\n\testimatedBeginDans := richSigOffset - 4 - binary.Size(ImageDosHeader{})\r\n\tfor it := 0; it < estimatedBeginDans; it += 4 {\r\n\t\tbuff := binary.LittleEndian.Uint32(pe.data[richSigOffset-4-it:])\r\n\t\tres := buff ^ rh.XorKey\r\n\t\tif res == DansSignature {\r\n\t\t\tdansSigOffset = richSigOffset - it - 4\r\n\t\t\tbreak\r\n\t\t}\r\n\r\n\t\tdecRichHeader = append(decRichHeader, res)\r\n\t}\r\n\r\n\t// Probe we successfuly found the `DanS` magic.\r\n\tif dansSigOffset == -1 {\r\n\t\tpe.Anomalies = append(pe.Anomalies, AnoDansSigNotFound)\r\n\t\treturn nil\r\n\t}\r\n\r\n\t// Anomaly check: dansSigOffset is usually found in offset 0x80.\r\n\tif dansSigOffset != 0x80 {\r\n\t\tpe.Anomalies = append(pe.Anomalies, AnoDanSMagicOffset)\r\n\t}\r\n\r\n\trh.DansOffset = dansSigOffset\r\n\trh.Raw = pe.data[dansSigOffset : richSigOffset+8]\r\n\r\n\t// Reverse the decrypted rich header\r\n\tfor i, j := 0, len(decRichHeader)-1; i < j; i, j = i+1, j-1 {\r\n\t\tdecRichHeader[i], decRichHeader[j] = decRichHeader[j], decRichHeader[i]\r\n\t}\r\n\r\n\t// After the `DanS` signature, there are some zero-padded In practice,\r\n\t// Microsoft seems to have wanted the entries to begin on a 16-byte\r\n\t// (paragraph) boundary, so the 3 leading padding DWORDs can be safely\r\n\t// skipped as not belonging to the data.\r\n\tif decRichHeader[0] != 0 || decRichHeader[1] != 0 || decRichHeader[2] != 0 {\r\n\t\tpe.Anomalies = append(pe.Anomalies, AnoPaddingDwordNotZero)\r\n\t}\r\n\r\n\t// The array stores entries that are 8-bytes each, broken into 3 members.\r\n\t// Each entry represents either a tool that was employed as part of building\r\n\t// the executable or a statistic.\r\n\t// The @compid struct should be multiple of 8 (bytes), some malformed pe\r\n\t// files have incorrect number of entries.\r\n\tvar lenCompIDs int\r\n\tif (len(decRichHeader)-3)%2 != 0 {\r\n\t\tlenCompIDs = len(decRichHeader) - 1\r\n\t} else {\r\n\t\tlenCompIDs = len(decRichHeader)\r\n\t}\r\n\r\n\tfor i := 3; i < lenCompIDs; i += 2 {\r\n\t\tcid := CompID{}\r\n\t\tcompid := make([]byte, binary.Size(cid))\r\n\t\tbinary.LittleEndian.PutUint32(compid, decRichHeader[i])\r\n\t\tbinary.LittleEndian.PutUint32(compid[4:], decRichHeader[i+1])\r\n\t\tbuf := bytes.NewReader(compid)\r\n\t\terr := binary.Read(buf, binary.LittleEndian, &cid)\r\n\t\tif err != nil {\r\n\t\t\treturn err\r\n\t\t}\r\n\t\tcid.Unmasked = binary.LittleEndian.Uint32(compid)\r\n\t\trh.CompIDs = append(rh.CompIDs, cid)\r\n\t}\r\n\r\n\tpe.RichHeader = &rh\r\n\r\n\tchecksum := pe.RichHeaderChecksum()\r\n\tif checksum != rh.XorKey {\r\n\t\tpe.Anomalies = append(pe.Anomalies, \"Invalid rich header checksum\")\r\n\t}\r\n\treturn nil\r\n}", "func DecodeHeader(r *bitio.Reader) (nEncoded uint32, root *Node, err error) {\n\tvar buf uint64\n\tbuf, err = r.ReadBits(32)\n\tnEncoded = uint32(buf)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\tbuf, err = r.ReadBits(8)\n\tnTree := byte(buf)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\troot, err = decodeTree(r, nTree)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\treturn nEncoded, root, nil\n}", "func (h *Header) ReadFrom(rd io.Reader) (n int64, err error) {\r\n\treturn int64(binary.Size(h)), binary.Read(rd, endianness, h)\r\n}", "func ParseHeader(ctx context.Context, r io.ReaderAt) (*Header, error) {\n\tvar h Header\n\tif err := h.Parse(ctx, r); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &h, nil\n}", "func (h *Header) Parse(ctx context.Context, r io.ReaderAt) error {\n\tif err := h.loadArenas(ctx, r); err != nil {\n\t\treturn fmt.Errorf(\"rpm: failed to parse header: %w\", err)\n\t}\n\tvar isBDB bool\n\tswitch err := h.verifyRegion(ctx); {\n\tcase errors.Is(err, nil):\n\tcase errors.Is(err, errNoRegion):\n\t\tisBDB = true\n\tdefault:\n\t\treturn fmt.Errorf(\"rpm: failed to parse header: %w\", err)\n\t}\n\tif err := h.verifyInfo(ctx, isBDB); err != nil {\n\t\treturn fmt.Errorf(\"rpm: failed to parse header: %w\", err)\n\t}\n\treturn nil\n}", "func (consensus *Consensus) VerifyHeader(chain ChainReader, header *types.Header, seal bool) error {\n\t// TODO: implement this\n\treturn nil\n}", "func DecryptHeader(m1 Literal, kr openpgp.KeyRing) (hdr message.Header,size int, err0 error) {\n\tvar rest bytes.Buffer\n\tvar rd io.Reader\n\tvar md *openpgp.MessageDetails\n\tvar inh map[string]string\n\tm1,err0 = removeHeaderIfAny(m1)\n\tif err0!=nil { return }\n\t\n\tmd,inh,err0 = decodeNcrypt2(m1,kr)\n\tif err0!=nil { return }\n\t\n\tfmt.Sscan(inh[\"Rfc822-Size\"],&size)\n\t\n\thdr,rd,err0 = parseMessageHeader(md.UnverifiedBody)\n\t\n\trest.ReadFrom(rd)\n\t\n\t/* Propagate Signature errors. */\n\tif md.SignatureError!=nil && err0==nil { err0 = md.SignatureError }\n\treturn\n}", "func (v *Header) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjson171edd05DecodeGithubComEmirmuminogluJwt(&r, v)\n\treturn r.Error()\n}", "func (h *BlockHeader) Deserialize(r io.Reader) error { //TODO parse blockheader data\n\t// At the current time, there is no difference between the wire encoding\n\t// at protocol version 0 and the stable long-term storage format. As\n\t// a result, make use of readBlockHeader.\n\treturn nil\n}", "func (d *Decoder) readHeader() (Header, error) {\n\tvar h Header\n\tvar err error\n\n\th.Version, err = readByte(d)\n\tif err != nil {\n\t\treturn h, err\n\t}\n\n\th.PublicID, err = mbUint32(d)\n\tif err != nil {\n\t\treturn h, err\n\t}\n\tif h.PublicID == 0 {\n\t\th.PublicID, err = mbUint32(d)\n\t}\n\n\th.Charset, err = mbUint32(d)\n\tif err != nil {\n\t\treturn h, err\n\t}\n\n\tlength, err := mbUint32(d)\n\tif err != nil {\n\t\treturn h, err\n\t}\n\tbuf := make([]byte, length)\n\tn, err := d.r.Read(buf)\n\tif err != nil {\n\t\treturn h, err\n\t}\n\td.offset += n\n\th.StringTable = buf\n\treturn h, nil\n}", "func (it *Iterator) readHeader() error {\n\tvar size int\n\tvar hlen uint64\n\tsize, hlen, it.err = ReadUvarint(it.reader)\n\n\tif it.err != nil {\n\t\treturn it.err\n\t}\n\n\thdr := make([]byte, hlen)\n\t_, it.err = it.reader.Read(hdr)\n\tif it.err != nil {\n\t\treturn it.err\n\t}\n\n\t// Parse header\n\theader := store.SegmentHeader{}\n\tit.err = header.Unmarshal(hdr)\n\tif it.err != nil {\n\t\treturn it.err\n\t}\n\t// Build header\n\tit.timestamp = int64(header.Timestamp)\n\tit.logID = int64(header.LogID)\n\n\t// Read 'End' byte\n\tit.code, it.err = it.reader.ReadByte()\n\tif it.err != nil {\n\t\treturn it.err\n\t}\n\tif it.code != End {\n\t\treturn ErrExpectedEnd\n\t}\n\n\t// Increase position to right past 'End' byte\n\tit.pos += int64(size+len(hdr)) + 1\n\n\treturn nil\n}", "func (s *Stream) ParseHeader() error {\n\t_, err := s.file.Seek(0, 0)\n\tr := bufio.NewReader(s.file)\n\tb, err := r.ReadBytes('\\n')\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Store header byte sequence\n\ts.OriginalHeader = b\n\t// Set defaults\n\ts.Chroma = \"420jpeg\"\n\ts.Interlacing = \"?\"\n\ts.FrameRate = &Ratio{0, 0}\n\ts.SampleAspectRatio = &Ratio{0, 0}\n\tfields := bytes.Fields(b)\n\tfor k := 0; k < len(fields); k++ {\n\t\tfield := string(fields[k])\n\t\tkey := field[0]\n\t\tval := field[1:]\n\t\tswitch key {\n\t\tcase 'Y':\n\t\t\t// do nothing\n\t\tcase 'W':\n\t\t\ts.Width, err = strconv.Atoi(val)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase 'H':\n\t\t\ts.Height, err = strconv.Atoi(val)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase 'F':\n\t\t\tratio, err := stringToRatio(val)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ts.FrameRate = ratio\n\t\tcase 'I':\n\t\t\ts.Interlacing = val\n\t\tcase 'A':\n\t\t\tratio, err := stringToRatio(val)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ts.SampleAspectRatio = ratio\n\t\tcase 'C':\n\t\t\ts.Chroma = val\n\t\tcase 'X':\n\t\t\ts.Metadata = append(s.Metadata, val)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Unrecognized stream header field: %c\\n\", key)\n\t\t}\n\t}\n\t// Seek to end of header\n\t_, err = s.file.Seek(int64(len(s.OriginalHeader)), 0)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn nil\n}", "func (dec *Decoder) Header() (*Header, error) {\n\t// deserialize the file header\n\treturn dec.header, dec.readOSMHeader()\n}", "func parseHeader(line string, cb *models.CircularBuffer) {\n\tif fieldsRE.MatchString(line) {\n\t\tfields = strings.Split(line, \" \")[1:]\n\t}\n}", "func (amqp *amqpPlugin) decodeHeaderFrame(s *amqpStream, buf []byte) bool {\n\tif len(buf) < 14 {\n\t\tlogp.Warn(\"Header frame too small, waiting for mode data\")\n\t\treturn true\n\t}\n\ts.message.bodySize = binary.BigEndian.Uint64(buf[4:12])\n\tdebugf(\"Received Header frame. A message of %d bytes is expected\", s.message.bodySize)\n\n\tif amqp.parseHeaders == true {\n\t\terr := getMessageProperties(s, buf[12:])\n\t\tif err {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "func (h *BlockHeader) Deserialize(r io.Reader) error {\n\t// At the current time, there is no difference between the wire encoding\n\t// at protocol version 0 and the stable long-term storage format. As\n\t// a result, make use of readBlockHeader.\n\treturn readBlockHeader(r, 0, h)\n}", "func (h *BlockHeader) Deserialize(r io.Reader) error {\n\t// At the current time, there is no difference between the wire encoding\n\t// at protocol version 0 and the stable long-term storage format. As\n\t// a result, make use of readBlockHeader.\n\treturn readBlockHeader(r, 0, h)\n}", "func ParseHeader(header []byte) uint32 {\n\tlength := uint32(header[0])<<24 | uint32(header[1])<<16 | uint32(header[2])<<8 | uint32(header[3])\n\tlength = length & ^uint32(0x80000000)\n\n\treturn length\n}", "func (consensus *Consensus) verifyHeader(chain ChainReader, header, parent *types.Header, uncle bool, seal bool) error {\n\treturn nil\n}", "func (h *Header) UnmarshalPacket(data io.Reader, order binary.ByteOrder) (err error) {\n\tif err = h.Frame.UnmarshalPacket(data, order); err != nil {\n\t\treturn\n\t}\n\n\tif err = h.FrameAddress.UnmarshalPacket(data, order); err != nil {\n\t\treturn\n\t}\n\n\tif err = h.ProtocolHeader.UnmarshalPacket(data, order); err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "func (header *Header) ReadHeader(rbuf Reader, vfmt uint8, csi uint32, lastheader *Header) (n int, err error) {\n\theader.Fmt = vfmt\n\theader.ChunkStreamID = csi\n\tvar b byte\n\ttmpBuf := make([]byte, 4)\n\tswitch header.Fmt {\n\tcase HEADER_FMT_FULL:\n\t\t// Chunks of Type 0 are 11 bytes long. This type MUST be used at the\n\t\t// start of a chunk stream, and whenever the stream timestamp goes\n\t\t// backward (e.g., because of a backward seek).\n\t\t//\n\t\t// 0 1 2 3\n\t\t// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// | timestamp |message length |\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// | message length (cont) |message type id| msg stream id |\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// | message stream id (cont) |\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// Figure 9 Chunk Message Header – Type 0\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf[1:], 3)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 3\n\t\theader.Timestamp = binary.BigEndian.Uint32(tmpBuf)\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf[1:], 3)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 3\n\t\theader.MessageLength = binary.BigEndian.Uint32(tmpBuf)\n\t\tb, err = ReadByteFromNetwork(rbuf)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 1\n\t\theader.MessageTypeID = uint8(b)\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf, 4)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 4\n\t\theader.MessageStreamID = binary.LittleEndian.Uint32(tmpBuf)\n\tcase HEADER_FMT_SAME_STREAM:\n\t\t// Chunks of Type 1 are 7 bytes long. The message stream ID is not\n\t\t// included; this chunk takes the same stream ID as the preceding chunk.\n\t\t// Streams with variable-sized messages (for example, many video\n\t\t// formats) SHOULD use this format for the first chunk of each new\n\t\t// message after the first.\n\t\t//\n\t\t// 0 1 2 3\n\t\t// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// | timestamp delta |message length |\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// | message length (cont) |message type id|\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// Figure 10 Chunk Message Header – Type 1\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf[1:], 3)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 3\n\t\theader.Timestamp = binary.BigEndian.Uint32(tmpBuf)\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf[1:], 3)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 3\n\t\theader.MessageLength = binary.BigEndian.Uint32(tmpBuf)\n\t\tb, err = ReadByteFromNetwork(rbuf)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 1\n\t\theader.MessageTypeID = uint8(b)\n\n\tcase HEADER_FMT_SAME_LENGTH_AND_STREAM:\n\t\t// Chunks of Type 2 are 3 bytes long. Neither the stream ID nor the\n\t\t// message length is included; this chunk has the same stream ID and\n\t\t// message length as the preceding chunk. Streams with constant-sized\n\t\t// messages (for example, some audio and data formats) SHOULD use this\n\t\t// format for the first chunk of each message after the first.\n\t\t//\n\t\t// 0 1 2\n\t\t// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// | timestamp delta |\n\t\t// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\t// Figure 11 Chunk Message Header – Type 2\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf[1:], 3)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 3\n\t\theader.Timestamp = binary.BigEndian.Uint32(tmpBuf)\n\n\tcase HEADER_FMT_CONTINUATION:\n\t\t// Chunks of Type 3 have no header. Stream ID, message length and\n\t\t// timestamp delta are not present; chunks of this type take values from\n\t\t// the preceding chunk. When a single message is split into chunks, all\n\t\t// chunks of a message except the first one, SHOULD use this type. Refer\n\t\t// to example 2 in section 6.2.2. Stream consisting of messages of\n\t\t// exactly the same size, stream ID and spacing in time SHOULD use this\n\t\t// type for all chunks after chunk of Type 2. Refer to example 1 in\n\t\t// section 6.2.1. If the delta between the first message and the second\n\t\t// message is same as the time stamp of first message, then chunk of\n\t\t// type 3 would immediately follow the chunk of type 0 as there is no\n\t\t// need for a chunk of type 2 to register the delta. If Type 3 chunk\n\t\t// follows a Type 0 chunk, then timestamp delta for this Type 3 chunk is\n\t\t// the same as the timestamp of Type 0 chunk.\n\t}\n\t// [Extended Timestamp]\n\t// This field is transmitted only when the normal time stamp in the\n\t// chunk message header is set to 0x00ffffff. If normal time stamp is\n\t// set to any value less than 0x00ffffff, this field MUST NOT be\n\t// present. This field MUST NOT be present if the timestamp field is not\n\t// present. Type 3 chunks MUST NOT have this field.\n\t// !!!!!! crtmpserver set this field in Type 3 !!!!!!\n\t// Todo: Test with FMS\n\tif (header.Fmt != HEADER_FMT_CONTINUATION && header.Timestamp >= 0xffffff) ||\n\t\t(header.Fmt == HEADER_FMT_CONTINUATION && lastheader != nil && lastheader.ExtendedTimestamp > 0) {\n\t\t_, err = ReadAtLeastFromNetwork(rbuf, tmpBuf, 4)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tn += 4\n\t\theader.ExtendedTimestamp = binary.BigEndian.Uint32(tmpBuf)\n\t\tlogger.ModulePrintf(LOG_LEVEL_TRACE,\n\t\t\t\"Extened timestamp: %d, timestamp: %d, fmt: %d\\n\", header.ExtendedTimestamp, header.Timestamp, header.Fmt)\n\t\theader.Dump(\"Extended timestamp\")\n\t} else {\n\t\theader.ExtendedTimestamp = 0\n\t}\n\treturn\n}", "func (f *File) parseFileHeader() error {\n\tif err := struc.Unpack(f.r, &f.FileHeader); err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\t// Verify Smacker signature.\n\tswitch f.Signature {\n\tcase \"SMK2\", \"SMK4\":\n\t\t// Smacker version 2 and 4, respectively.\n\tdefault:\n\t\treturn errors.Errorf(`invalid Smacker signature; got %q, want \"SMK2\" or \"SMK4\"`, f.Signature)\n\t}\n\treturn nil\n}", "func (h *Header) Parse(data []byte) error {\n\treturn binary.Read(bytes.NewReader(data), binary.LittleEndian, h)\n}", "func (dec *Decoder) readHeader() (err error) {\n\tif dec.started {\n\t\treturn nil\n\t}\n\tdec.started = true\n\tif len(dec.Header) > 0 {\n\t\treturn nil\n\t}\n\tdec.Header, err = dec.r.Read()\n\treturn\n}", "func VirtualReadHeader(bts []byte, in *ringbuffer.RingBuffer) (h Header, err error) {\n\tif in.Length() < 6 {\n\t\terr = ErrHeaderNotReady\n\t\treturn\n\t}\n\n\tbts = bts[:2]\n\t// Prepare to hold first 2 bytes to choose size of next read.\n\t_, _ = in.VirtualRead(bts)\n\n\th.Fin = bts[0]&bit0 != 0\n\th.Rsv = (bts[0] & 0x70) >> 4\n\th.OpCode = OpCode(bts[0] & 0x0f)\n\n\tvar extra int\n\n\tif bts[1]&bit0 != 0 {\n\t\th.Masked = true\n\t\textra += 4\n\t}\n\n\tlength := bts[1] & 0x7f\n\tswitch {\n\tcase length < 126:\n\t\th.Length = int64(length)\n\n\tcase length == 126:\n\t\textra += 2\n\n\tcase length == 127:\n\t\textra += 8\n\n\tdefault:\n\t\terr = ErrHeaderLengthUnexpected\n\t\treturn\n\t}\n\n\tif extra == 0 {\n\t\treturn\n\t}\n\n\t// Increase len of bts to extra bytes need to read.\n\t// Overwrite first 2 bytes that was read before.\n\tbts = bts[:extra]\n\t_, _ = in.VirtualRead(bts)\n\n\tswitch {\n\tcase length == 126:\n\t\th.Length = int64(binary.BigEndian.Uint16(bts[:2]))\n\t\tbts = bts[2:]\n\n\tcase length == 127:\n\t\tif bts[0]&0x80 != 0 {\n\t\t\terr = ErrHeaderLengthMSB\n\t\t\treturn\n\t\t}\n\t\th.Length = int64(binary.BigEndian.Uint64(bts[:8]))\n\t\tbts = bts[8:]\n\t}\n\n\tif h.Masked {\n\t\tcopy(h.Mask[:], bts)\n\t}\n\n\treturn\n}", "func ReadHeader(r io.Reader) (*Header, error) {\n\tvar h Header\n\n\t// Attempt to read the header\n\terr := binary.Read(r, binary.LittleEndian, &h)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Skip over arbitrary chunks that are not the data chunk\n\tfor h.File.Valid() && h.Format.Valid() && h.Data.ID != 0x61746164 {\n\t\tunused := int(h.Data.Size)\n\t\t_, err := io.ReadFull(r, make([]byte, unused))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr = binary.Read(r, binary.LittleEndian, &h.Data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Make sure the header is valid\n\tif !h.Valid() {\n\t\treturn nil, ErrInvalid\n\t}\n\n\t// Make sure we support the bitrate\n\tsSize := h.Format.BitsPerSample\n\tif sSize != 8 && sSize != 16 {\n\t\treturn nil, ErrSampleSize\n\t}\n\n\treturn &h, nil\n}", "func ParseReceiveHeader(conn net.TCPConn, expectCmd int, expectContentLength int64) Header {\n\tvar header = new([ FdfsProtoPkgLenSize + 2]byte)\n\n\tcount, err := conn.Read(header[:]);\n\tCheckError(err)\n\tif count != len(header) {\n\t\tfmt.Fprintf(os.Stderr, \"received package size %d != %d\", count, len(header))\n\t}\n\n\tif int(header[ProtoHeaderCmdIndex]) != expectCmd {\n\t\tfmt.Fprintf(os.Stderr, \"received cmd: %d is not correct, expect cmd: %d\", header[ProtoHeaderCmdIndex], expectCmd)\n\t}\n\n\tif header[ProtoHeaderStatusIndex] != 0 {\n\t\treturn Header{header[ProtoHeaderStatusIndex], 0}\n\t}\n\n\tpkgLength := Buff2Uint(header[:], 0)\n\n\tif pkgLength < 0 {\n\t\tfmt.Fprintf(os.Stderr, \"received package length %d < 0 !\", pkgLength)\n\t}\n\n\tif expectContentLength > 0 && int64(pkgLength) != expectContentLength {\n\t\tfmt.Fprintf(os.Stderr, \"received package length : %d is not correct, expect package length: %d\", pkgLength, expectContentLength)\n\t}\n\n\treturn Header{0, int64(pkgLength)}\n}", "func (s *Flattener) HandleHeader(hdr *sfgo.SFHeader) error {\n\treturn nil\n}", "func MarshalHeader(header *sam.Header) ([]byte, error) {\n\tbb := bytes.Buffer{}\n\tif err := header.EncodeBinary(&bb); err != nil {\n\t\treturn nil, err\n\t}\n\treturn bb.Bytes(), nil\n}", "func (k *ClientClaimsInfo) Unmarshal(b []byte) error {\n\tch, _, p, err := ndr.ReadHeaders(&b)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing byte stream headers: %v\", err)\n\t}\n\te := &ch.Endianness\n\n\t//The next 4 bytes are an RPC unique pointer referent. We just skip these\n\tp += 4\n\n\tk.Claims = mstypes.ReadClaimsSetMetadata(&b, &p, e)\n\n\t//Check that there is only zero padding left\n\tif len(b) >= p {\n\t\tfor _, v := range b[p:] {\n\t\t\tif v != 0 {\n\t\t\t\treturn ndr.Malformed{EText: \"Non-zero padding left over at end of data stream\"}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "func verifyHeader(msg syscall.NetlinkMessage) error {\n\tswitch msg.Header.Type {\n\tcase syscall.NLMSG_DONE:\n\t\treturn fmt.Errorf(\"expected a response, got nil\")\n\tcase syscall.NLMSG_ERROR:\n\t\tbuf := bytes.NewBuffer(msg.Data)\n\t\tvar errno int32\n\t\terr := binary.Read(buf, Endian, errno)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"netlink request failed with error %s\", syscall.Errno(-errno))\n\t}\n\treturn nil\n}", "func ReceiveHeader(conn io.Reader) (hdr *Header, err error) {\n\tbuf := make([]byte, 16)\n\t_, err = io.ReadFull(conn, buf)\n\tif err != nil {\n\t\treturn\n\t}\n\thdr = new(Header)\n\thdr.Init(buf, 0)\n\treturn\n}", "func (sh *SubdirectoryHeader) fromBytes(buf []byte) {\n\tif len(buf) != 0x27 {\n\t\tpanic(fmt.Sprintf(\"VolumeDirectoryHeader should be 0x27 bytes long; got 0x%02x\", len(buf)))\n\t}\n\tsh.TypeAndNameLength = buf[0]\n\tcopyBytes(sh.SubdirectoryName[:], buf[1:0x10])\n\tsh.SeventyFive = buf[0x10]\n\tcopyBytes(sh.Unused1[:], buf[0x11:0x18])\n\tsh.Creation.fromBytes(buf[0x18:0x1c])\n\tsh.Version = buf[0x1c]\n\tsh.MinVersion = buf[0x1d]\n\tsh.Access = Access(buf[0x1e])\n\tsh.EntryLength = buf[0x1f]\n\tsh.EntriesPerBlock = buf[0x20]\n\tsh.FileCount = binary.LittleEndian.Uint16(buf[0x21:0x23])\n\tsh.ParentPointer = binary.LittleEndian.Uint16(buf[0x23:0x25])\n\tsh.ParentEntry = buf[0x25]\n\tsh.ParentEntryLength = buf[0x26]\n}", "func (bh *BlockHeader) Deserialize(r io.Reader) error {\n\t// At the current time, there is no difference between the protos encoding\n\t// at protocol version 0 and the stable long-term storage format. As\n\t// a result, make use of readBlockHeader.\n\tif err := serialization.ReadUint32(r, (*uint32)(unsafe.Pointer(&bh.Version))); err != nil {\n\t\treturn err\n\t}\n\tif err := serialization.ReadNBytes(r, bh.PrevBlock[:], common.HashLength); err != nil {\n\t\treturn err\n\t}\n\tif err := serialization.ReadNBytes(r, bh.MerkleRoot[:], common.HashLength); err != nil {\n\t\treturn err\n\t}\n\tif err := serialization.ReadUint64(r, (*uint64)(unsafe.Pointer(&bh.Timestamp))); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadNBytes(r, bh.StateRoot[:], common.HashLength); err != nil {\n\t\treturn err\n\t}\n\tif err := serialization.ReadUint64(r, &bh.GasLimit); err != nil {\n\t\treturn err\n\t}\n\tif err := serialization.ReadUint64(r, &bh.GasUsed); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadUint32(r, &bh.Round); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadUint16(r, &bh.SlotIndex); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadUint16(r, &bh.Weight); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadNBytes(r, bh.PoaHash[:], common.HashLength); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadUint32(r, (*uint32)(unsafe.Pointer(&bh.Height))); err != nil {\n\t\treturn err\n\t}\n\n\tif err := serialization.ReadNBytes(r, bh.CoinBase[:], common.AddressLength); err != nil {\n\t\treturn err\n\t}\n\n\terr := serialization.ReadNBytes(r, bh.SigData[:], HashSignLen)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (e *engineImpl) VerifyHeader(chain engine.ChainReader, header *block.Header, seal bool) error {\n\tparentHeader := chain.GetHeader(header.ParentHash(), header.Number().Uint64()-1)\n\tif parentHeader == nil {\n\t\treturn engine.ErrUnknownAncestor\n\t}\n\tif seal {\n\t\tif err := e.VerifySeal(chain, header); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func readHeader(conn net.Conn) (mtype MTypeID, datalen uint16, err error) {\n\tvar _mtype MTypeID\n\tvar _datalen uint16\n\n\t// Block forever to read the fixed length header.\n\theader, err := readData(conn, MessageHdrLen, time.Duration(0))\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\t_mtype = MTypeID(header[0]) | (MTypeID(header[1]) << 8)\n\t_datalen = uint16(header[2]) | (uint16(header[3]) << 8)\n\n\treturn _mtype, _datalen, nil\n}", "func (c *Chunk) ReadHeader(rd io.Reader) (length uint32, err error) {\n\tc.typ, err = midilib.ReadNBytes(4, rd)\n\n\tif err != nil {\n\t\tc.typ = nil\n\t\treturn\n\t}\n\n\treturn midilib.ReadUint32(rd)\n}", "func (h *HSTIMParser) ParseHeader(msg []byte) (HSTIMHeader, error) {\n\theader := HSTIMHeader{}\n\theader.ProcessingID = 'P'\n\n\t// Verify the first character is `H`, which indicates it's a header\n\tif (msg[0]) != 'H' {\n\t\treturn header, &ParseError{fmt.Sprintf(\"Not a header\")}\n\t}\n\n\t// Slice off everything before <CR><EXT>\n\tmsgStr := removeTrailingValues(msg)\n\n\t// The next 4 characters are always the delimeters\n\theader.Delimeters = strings.Split(msgStr[1:5], \"\")\n\n\tsplits := strings.Split(msgStr[5:], \"|\")\n\tif len(splits) != 13 {\n\t\treturn header, &ParseError{fmt.Sprintf(\"Expected 13 fields, got %d\", len(splits))}\n\t}\n\n\theader.FWVersion = splits[11]\n\n\t// Parse the time\n\tt, err := time.Parse(hstimTimeFmt, splits[12])\n\tif err != nil {\n\t\treturn header, &ParseError{fmt.Sprintf(\"Cannot parse `%s` as valid timestamp\", splits[12])}\n\t}\n\theader.Timestamp = t\n\n\treturn header, nil\n}", "func TestParseHeader(t *testing.T) {\n\tt.Parallel()\n\n\tparsed, err := parseHeader(bytes.NewReader(thb))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif parsed != th {\n\t\tt.Fatalf(\"Expected: %v, got: %v\", th, parsed)\n\t}\n}", "func (db *CDB) readHeader(data []byte) {\n\tfor i := range db.header {\n\t\tdb.header[i].pos = binary.LittleEndian.Uint32(data)\n\t\tdb.header[i].nslots = binary.LittleEndian.Uint32(data[4:])\n\t\tdata = data[headerWidth:]\n\t}\n}", "func (this *SIPMessage) RemoveHeader(headerName string) {\n\ttoRemove := this.nameTable[strings.ToLower(headerName)]\n\t// nothing to do then we are done.\n\tif toRemove == nil {\n\t\treturn\n\t}\n\tdelete(this.nameTable, strings.ToLower(headerName))\n\t// Remove the fast accessor fields.\n\tvar ok bool\n\tif _, ok = toRemove.(*header.From); ok {\n\t\tthis.fromHeader = nil\n\t} else if _, ok = toRemove.(*header.To); ok {\n\t\tthis.toHeader = nil\n\t} else if _, ok = toRemove.(*header.CSeq); ok {\n\t\tthis.cSeqHeader = nil\n\t} else if _, ok = toRemove.(*header.CallID); ok {\n\t\tthis.callIdHeader = nil\n\t} else if _, ok = toRemove.(*header.MaxForwards); ok {\n\t\tthis.maxForwardsHeader = nil\n\t} else if _, ok = toRemove.(*header.ContentLength); ok {\n\t\tthis.contentLengthHeader = nil\n\t}\n\n\tfor li := this.headers.Front(); li != nil; li = li.Next() {\n\t\tsipHeader := li.Value.(header.Header)\n\t\tif strings.ToLower(sipHeader.GetName()) == strings.ToLower(headerName) {\n\t\t\tthis.headers.Remove(li)\n\t\t}\n\t}\n}", "func GetHeader(md *MQMD, buf []byte) (interface{}, int, error) {\n\tswitch md.Format {\n\tcase MQFMT_DEAD_LETTER_HEADER:\n\t\treturn getHeaderDLH(md, buf)\n\t}\n\n\tmqreturn := &MQReturn{MQCC: int32(MQCC_FAILED),\n\t\tMQRC: int32(MQRC_FORMAT_NOT_SUPPORTED),\n\t}\n\n\treturn nil, 0, mqreturn\n}", "func Header(r io.Reader, data *libmbd.MCellData) (*libmbd.MCellData, error) {\n\tif err := parseHeader(r, data); err != nil {\n\t\treturn nil, err\n\t}\n\treturn data, nil\n}", "func parseHeaderStr(header string) (*Header, error) {\n\tif 0 == len(header) {\n\t\treturn nil, errors.New(\"Header string is empty\")\n\t}\n\tvar (\n\t\treader *textproto.Reader = textproto.NewReader(bufio.NewReader(bytes.NewBufferString(header)))\n\t\tmHeader textproto.MIMEHeader\n\t\terr error\n\t)\n\tif mHeader, err = reader.ReadMIMEHeader(); err != nil && err != io.EOF {\n\t\treturn nil, err\n\t}\n\t//\t\tfor key, val := range mHeader {\n\t//\t\t\tfmt.Printf(\"&&&& %s -> %s\\n\", key, val)\n\t//\t\t}\n\treturn parseMainHeaderContent(mHeader)\n}", "func ReadHeader(buffer *BytePacketBuffer) (Header, error) {\n\tid, err := buffer.ReadU16()\n\tif err != nil {\n\t\treturn Header{}, err\n\t}\n\n\tflags, err := buffer.ReadU16()\n\tif err != nil {\n\t\treturn Header{}, err\n\t}\n\n\tlowFlags := uint8(flags >> 8)\n\trecursionDesired := lowFlags&(1<<0) > 0\n\ttruncatedMessage := lowFlags&(1<<1) > 0\n\tauthoritativeAnswer := lowFlags&(1<<2) > 0\n\topcode := (lowFlags >> 3) & 0x0F\n\tresponse := lowFlags&(1<<7) > 0\n\n\thighFlags := uint8(flags & 0xFF)\n\trescode := ResultCode(highFlags & 0x0F)\n\tcheckingDisabled := highFlags&(1<<4) > 0\n\tauthedData := highFlags&(1<<5) > 0\n\tz := highFlags&(1<<6) > 0\n\trecursionAvailable := highFlags&(1<<7) > 0\n\n\tquestions, err := buffer.ReadU16()\n\tif err != nil {\n\t\treturn Header{}, err\n\t}\n\n\tanswers, err := buffer.ReadU16()\n\tif err != nil {\n\t\treturn Header{}, err\n\t}\n\n\tauthoritativeEntires, err := buffer.ReadU16()\n\tif err != nil {\n\t\treturn Header{}, err\n\t}\n\n\tresourceEntries, err := buffer.ReadU16()\n\tif err != nil {\n\t\treturn Header{}, err\n\t}\n\n\treturn Header{\n\t\tid: id,\n\t\trecursionDesired: recursionDesired,\n\t\ttruncatedMessage: truncatedMessage,\n\t\tauthoritativeAnswer: authoritativeAnswer,\n\t\topcode: opcode,\n\t\tresponse: response,\n\t\trescode: rescode,\n\t\tcheckingDisabled: checkingDisabled,\n\t\tauthedData: authedData,\n\t\tz: z,\n\t\trecursionAvailable: recursionAvailable,\n\t\tquestions: questions,\n\t\tanswers: answers,\n\t\tauthoritativeEntires: authoritativeEntires,\n\t\tresourceEntries: resourceEntries,\n\t}, nil\n}", "func (header *ConnectHeader) parse(b []byte) error {\n\theader.PackType = int(b[0] >> 4)\n\tremainLenDigits, err := ParseRemainLenDigits(b[1:5])\n\tif err != nil {\n\t\treturn err\n\t}\n\tremainLen, err := DecodeRemainLen(remainLenDigits)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Println(\"remain_len_parsed => \", remainLen)\n\theaderLen := 1 + len(remainLenDigits) + VarHeaderLen\n\tvarHeaderStartIdx := 1 + len(remainLenDigits)\n\theader.RemainLen = remainLen\n\theader.ProtocNameLenLSB = int(b[varHeaderStartIdx])\n\theader.ProtocNameLenMSB = int(b[varHeaderStartIdx+1])\n\theader.ProtocName = string(b[varHeaderStartIdx+2 : varHeaderStartIdx+6])\n\theader.ProtocLevel = int(b[varHeaderStartIdx+6])\n\theader.Flags = int(b[varHeaderStartIdx+7])\n\theader.KeepAliveMSB = int(b[varHeaderStartIdx+8])\n\tlog.Println(\"len(b) => \", len(b), \"varHeaderStartIdx+9 => \", varHeaderStartIdx+9)\n\theader.KeepAliveLSB = int(b[varHeaderStartIdx+9])\n\theader.KeepAlive = int(binary.BigEndian.Uint16(b[varHeaderStartIdx+8 : headerLen]))\n\tfmt.Printf(\"parsed_header => %#v\\n\", header)\n\treturn nil\n}", "func (p *atomReader) ReadAtomHeader() *atom {\n\ta := new(atom)\n\tfullAtomSize := int64(p.Read4())\n\ta.atomType = p.Read4()\n\tif fullAtomSize == 1 { // full box\n\t\tfullAtomSize = int64(p.Read8())\n\t\ta.headerSize = 16\n\t} else {\n\t\ta.headerSize = 8\n\t}\n\ta.bodySize = fullAtomSize - int64(a.headerSize)\n\treturn a\n}", "func (ml *MaticChainListener) ProcessHeader(newHeader *types.Header) {\n\tml.Logger.Debug(\"New block detected\", \"blockNumber\", newHeader.Number)\n\n\t// check and send span task\n\tgo ml.checkAndSendSpanTask(newHeader)\n\n\t// Marshall header block and publish to queue\n\theaderBytes, err := newHeader.MarshalJSON()\n\tif err != nil {\n\t\tml.Logger.Error(\"Error marshalling header block\", \"error\", err)\n\t\treturn\n\t}\n\tml.sendTaskWithDelay(\"sendCheckpointToHeimdall\", headerBytes, 0)\n\n}", "func decodeLegacyUbootHeader(data []byte) (legacyUbootHeader, error) {\n\tvar header legacyUbootHeader\n\terr := binary.Read(bytes.NewBuffer(data[:]), binary.BigEndian, &header)\n\tif err != nil {\n\t\treturn header, errors.Errorf(\"Unable to decode legacy uboot header data into struct: %v\",\n\t\t\terr)\n\t}\n\n\terr = header.validate()\n\tif err != nil {\n\t\treturn header, err\n\t}\n\n\treturn header, nil\n}", "func (f *frame) Unmarshal(d []byte) error {\n\tvar fh frameHeader\n\terr := fh.Unmarshal(d)\n\tif err != nil {\n\t\treturn errors.AddContext(err, \"failed to unmarshal header\")\n\t}\n\tif uint32(len(d[marshaledFrameHeaderSize:])) < fh.length {\n\t\treturn errors.New(\"failed to unmarshal frame due to not enough data being available\")\n\t}\n\t*f = frame{\n\t\tframeHeader: fh,\n\t\tpayload: d[marshaledFrameHeaderSize:][:fh.length],\n\t}\n\treturn nil\n}", "func GetHeader(bytes []byte) (*common.Header, error) {\n\thdr := &common.Header{}\n\terr := proto.Unmarshal(bytes, hdr)\n\treturn hdr, err\n}", "func execmWordDecoderDecodeHeader(_ int, p *gop.Context) {\n\targs := p.GetArgs(2)\n\tret, ret1 := args[0].(*mime.WordDecoder).DecodeHeader(args[1].(string))\n\tp.Ret(2, ret, ret1)\n}", "func readMessageHeader(r io.Reader) (*messageHeader, error) {\n\tvar command [commandSize]byte\n\n\thdr := messageHeader{}\n\terr := readElements(r, &hdr.magic, &command, &hdr.length, &hdr.checksum)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Strip trailing zeros from command string.\n\thdr.command = string(bytes.TrimRight(command[:], string(0)))\n\n\treturn &hdr, nil\n}", "func (h *HTTPHeader) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", h, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &h.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"value\":\n\t\t\terr = unpopulate(val, \"Value\", &h.Value)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", h, err)\n\t\t}\n\t}\n\treturn nil\n}", "func (j *DSGit) ParseHeader(ctx *Ctx, line string) (parsed bool, err error) {\n\tif line == \"\" {\n\t\tj.ParseState = GitParseStateMessage\n\t\tparsed = true\n\t\treturn\n\t}\n\tm := MatchGroups(GitHeaderPattern, line)\n\tif len(m) == 0 {\n\t\terr = fmt.Errorf(\"invalid header format, line %d: '%s'\", j.CurrLine, line)\n\t\treturn\n\t}\n\t// Not too many properties, ES has 1000 fields limit, and each commit can have\n\t// different properties, so value around 300 should(?) be safe\n\tif len(j.Commit) < GitMaxCommitProperties {\n\t\tif m[\"name\"] != \"\" {\n\t\t\tj.Commit[m[\"name\"]] = m[\"value\"]\n\t\t}\n\t}\n\tparsed = true\n\treturn\n}", "func (msg *Message) parseFormat1HeaderBytes(data []byte) error {\n\tif headerSize := len(data); headerSize < Format1HeaderSize {\n\t\treturn fmt.Errorf(errorShortMessageSize, (headerSize + FrameHeaderSize), (Format1HeaderSize + FrameHeaderSize))\n\t}\n\n\t// SEOJ\n\n\tmsg.seoj[0] = data[0]\n\tmsg.seoj[1] = data[1]\n\tmsg.seoj[2] = data[2]\n\n\t// DEOJ\n\n\tmsg.deoj[0] = data[3]\n\tmsg.deoj[1] = data[4]\n\tmsg.deoj[2] = data[5]\n\n\t// ESV\n\n\tmsg.esv = ESV(data[6])\n\n\t// OPC\n\n\terr := msg.SetOPC(int(data[7]))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (fr *FormatReaders) matchHeader(knownHdrs *image.Headers) (*image.Header, error) {\n\t_, err := fr.read(fr.buf) // read current header\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// append multi-reader so that the header data can be re-read by subsequent readers\n\tfr.appendReader(rdrMulti, bytes.NewReader(fr.buf))\n\n\t// loop through known headers until a match\n\tfor format, kh := range *knownHdrs {\n\t\tif kh.Match(fr.buf) {\n\t\t\t// delete this header format key so that it's not processed again\n\t\t\tdelete(*knownHdrs, format)\n\t\t\treturn &kh, nil\n\t\t}\n\t}\n\treturn nil, nil // no match\n}", "func parseRequestHeader(bufHeader []byte) (RequestHeader, error) {\n\tret := RequestHeader{}\n\tbuf := bufHeader\n\n\tret.Magic = uint8(buf[0])\n\tif ret.Magic != MagicRequest {\n\t\treturn RequestHeader{}, fmt.Errorf(\"Magic byte is not 0x80: %x\", ret.Magic)\n\t}\n\tbuf = buf[1:]\n\n\tret.Opcode = uint8(buf[0])\n\t_, ok := OpHandler[ret.Opcode]\n\tif !ok {\n\t\treturn RequestHeader{}, fmt.Errorf(\"Opcode byte is not recognized: %x\", ret.Opcode)\n\t}\n\tbuf = buf[1:]\n\n\tret.KeyLength = GetUint16(buf)\n\tbuf = buf[2:]\n\n\tret.ExtraLength = uint8(buf[0])\n\tbuf = buf[1:]\n\n\tret.DataType = uint8(buf[0])\n\tif ret.DataType != 0x00 {\n\t\treturn RequestHeader{}, fmt.Errorf(\"DataType byte is supposed to be 0x00: %x\", ret.DataType)\n\t}\n\tbuf = buf[1:]\n\n\tret.VBucketID = GetUint16(buf)\n\tbuf = buf[2:]\n\n\tret.TotalBodyLength = GetUint32(buf)\n\tif uint64(ret.TotalBodyLength) < uint64(ret.KeyLength)+uint64(ret.ExtraLength) {\n\t\treturn RequestHeader{}, fmt.Errorf(\"TotaoBodyLength is supposed to be no less than KeyLength + ExtraLength: total: %d key: %d extra %d\", ret.TotalBodyLength, ret.KeyLength, ret.ExtraLength)\n\t}\n\tbuf = buf[4:]\n\n\tret.Opaque = GetUint32(buf)\n\tbuf = buf[4:]\n\n\tret.CAS = GetUint64(buf)\n\n\treturn ret, nil\n}", "func (decoder *QpackDecoder) ReadHeaderBlock(r io.Reader, id uint64) ([]HeaderField, error) {\n\treader := NewReader(r)\n\tlargestBase, base, err := decoder.readBase(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theaders := []HeaderField{}\n\taddHeader := func(h *HeaderField) {\n\t\tdecoder.logger.Printf(\"add %v\", h)\n\t\theaders = append(headers, *h)\n\t}\n\n\tfor {\n\t\tb, err := reader.ReadBit()\n\t\tif err == io.EOF {\n\t\t\tbreak // Success!\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif b == 1 {\n\t\t\th, err := decoder.readIndexed(reader, base)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\taddHeader(h)\n\t\t\tcontinue\n\t\t}\n\n\t\tb, err = reader.ReadBit()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif b == 1 {\n\t\t\th, err := decoder.readLiteralWithNameReference(reader, base)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\taddHeader(h)\n\t\t\tcontinue\n\t\t}\n\n\t\tb, err = reader.ReadBit()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif b == 1 {\n\t\t\th, err := decoder.readLiteralWithNameLiteral(reader, base)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\taddHeader(h)\n\t\t\tcontinue\n\t\t}\n\n\t\tb, err = reader.ReadBit()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar h *HeaderField\n\t\tif b == 1 {\n\t\t\th, err = decoder.readPostBaseIndexed(reader, base)\n\t\t} else {\n\t\t\th, err = decoder.readLiteralWithPostBaseNameReference(reader, base)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\taddHeader(h)\n\t}\n\n\tif largestBase > 0 {\n\t\tdecoder.acknowledged <- &headerBlockAck{id, largestBase}\n\t}\n\treturn headers, nil\n}", "func Header(payload []byte, name []byte) (value []byte, headerStart, valueStart, headerEnd int) {\n\theaderStart = bytes.Index(payload, name)\n\n\tif headerStart == -1 {\n\t\treturn\n\t}\n\n\tvalueStart = headerStart + len(name) + 1 // Skip \":\" after header name\n\tif payload[valueStart] == ' ' { // Ignore empty space after ':'\n\t\tvalueStart += 1\n\t}\n\theaderEnd = valueStart + bytes.IndexByte(payload[valueStart:], '\\r')\n\tvalue = payload[valueStart:headerEnd]\n\n\treturn\n}", "func processVorbisIDHeader(b []byte) (vorbisIDHeader, error) {\n\tvih := vorbisIDHeader{}\n\t//Identification header is 23 bytes long\n\tif err := checkLen(b, 23); err != nil {\n\t\treturn nil, err\n\t}\n\tvih[VersionKey] = getUint32LittleAsInt64(b[0:4])\n\tvih[ChannelsKey] = b[4]\n\tvih[SampleRateKey] = getUint32LittleAsInt64(b[5:9])\n\tvih[MaximumBitrateKey] = getInt32LittleAsInt(b[9:13])\n\tvih[AverageBitrateKey] = getInt32LittleAsInt(b[13:17]) //aka nominal bitrate\n\tvih[MinimumBitrateKey] = getInt32LittleAsInt(b[17:21])\n\t//Use bits 0-3 of byte 21 to make a uint and use that as an exponent of 2\n\tvih[MinimumBlockSizeKey] = 1 << binary.LittleEndian.Uint16([]byte{b[21] & 0x0F, 0})\n\t//Use bits 4-7 of byte 21 to make a uint and use that as an exponent of 2\n\tvih[MaximumBlockSizeKey] = 1 << binary.LittleEndian.Uint16([]byte{b[21] >> 4, 0})\n\t//Last byte is the framing flag.\n\tvih[\"framing\"] = b[22]\n\treturn vih, nil\n}", "func (h *Header) DecodeJSON(v interface{}) error {\n\tif len(*h) < 7 {\n\t\treturn ErrNonJSONHeader\n\t}\n\n\treturn json.Unmarshal(*h, &v)\n}", "func FromHeader(r *http.Request) (string, error) {\n\tauth := r.Header.Get(HeaderAuthorization)\n\tif auth == \"\" {\n\t\treturn \"\", nil\n\t}\n\n\tauthHeaderParts := strings.Split(auth, \" \")\n\tif len(authHeaderParts) != 2 || strings.ToLower(authHeaderParts[0]) != Bearer {\n\t\treturn \"\", ErrorAuthHeaderFormat\n\t}\n\n\treturn authHeaderParts[1], nil\n}" ]
[ "0.7207782", "0.6948204", "0.68720686", "0.67847025", "0.6483132", "0.6428106", "0.63860524", "0.63735026", "0.63142973", "0.6302375", "0.6265352", "0.62517077", "0.6154132", "0.6125591", "0.6122402", "0.61045206", "0.6078034", "0.602972", "0.5967966", "0.5937088", "0.5928305", "0.5915737", "0.5879726", "0.5875682", "0.5859229", "0.57926714", "0.5770022", "0.5703208", "0.57027584", "0.57027584", "0.5675365", "0.5670874", "0.5633237", "0.5629186", "0.56273854", "0.56210494", "0.5608195", "0.5604574", "0.55831575", "0.557944", "0.55774075", "0.55091244", "0.5491318", "0.54558855", "0.54512626", "0.5445606", "0.54257804", "0.541651", "0.54139704", "0.5410634", "0.5401022", "0.5370235", "0.53638417", "0.53638417", "0.53497744", "0.5341539", "0.53099793", "0.5295492", "0.5295394", "0.5286745", "0.52590305", "0.5255635", "0.5254715", "0.5240292", "0.5213222", "0.52104694", "0.5196298", "0.5194906", "0.51896304", "0.5181202", "0.5176856", "0.51760256", "0.51414937", "0.51388055", "0.51021403", "0.5099483", "0.5091457", "0.508563", "0.5083203", "0.50755095", "0.5071229", "0.5059828", "0.50289327", "0.501985", "0.50156707", "0.49948412", "0.498149", "0.49811247", "0.4975913", "0.49717006", "0.49568966", "0.49547753", "0.49326307", "0.49263525", "0.49108532", "0.49029827", "0.49026304", "0.49008235", "0.489784", "0.48873973" ]
0.79296327
0
NewPodService returns a new Pod KubeService.
NewPodService возвращает новый Pod KubeService.
func NewPodService(kubeClient kubernetes.Interface, logger log.Logger, metricsRecorder metrics.Recorder) *PodService { logger = logger.With("service", "k8s.pod") return &PodService{ kubeClient: kubeClient, logger: logger, metricsRecorder: metricsRecorder, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewService(name string, namespace string, servicePorts []core.ServicePort) *core.Service {\n\n\tlabels := GetCommonLabels()\n\n\treturn &core.Service{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Service\",\n\t\t\tAPIVersion: core.SchemeGroupVersion.String(),\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: core.ServiceSpec{\n\t\t\tSelector: map[string]string{\n\t\t\t\t\"component\": AppName,\n\t\t\t},\n\t\t\tPorts: servicePorts,\n\t\t},\n\t}\n}", "func newService(namespace, name string) *v1.Service {\n\treturn &v1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: labelMap(),\n\t\t},\n\t\tSpec: v1.ServiceSpec{\n\t\t\tSelector: labelMap(),\n\t\t\tPorts: []v1.ServicePort{\n\t\t\t\t{Name: \"port-1338\", Port: 1338, Protocol: \"TCP\", TargetPort: intstr.FromInt(1338)},\n\t\t\t\t{Name: \"port-1337\", Port: 1337, Protocol: \"TCP\", TargetPort: intstr.FromInt(1337)},\n\t\t\t},\n\t\t},\n\t}\n\n}", "func NewService() (service.Service, error) {\n\treturn &Service{}, nil\n}", "func NewService() Service {\n\treturn Service{}\n}", "func NewService(log zerolog.Logger, config *rest.Config, builder APIBuilder) (*Service, error) {\n\tvar c client.Client\n\tctx := context.Background()\n\tif err := retry.Do(ctx, func(ctx context.Context) error {\n\t\tvar err error\n\t\tc, err = client.New(config, client.Options{})\n\t\treturn err\n\t}, retry.Timeout(constants.TimeoutK8sClient)); err != nil {\n\t\treturn nil, err\n\t}\n\tns, err := constants.GetNamespace()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tpodName, err := constants.GetPodName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tpipelineName, err := constants.GetPipelineName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tlinkName, err := constants.GetLinkName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tport, err := constants.GetAPIPort()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tdnsName, err := constants.GetDNSName()\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tvar p corev1.Pod\n\tpodKey := client.ObjectKey{\n\t\tName: podName,\n\t\tNamespace: ns,\n\t}\n\tif err := retry.Do(ctx, func(ctx context.Context) error {\n\t\treturn c.Get(ctx, podKey, &p)\n\t}, retry.Timeout(constants.TimeoutAPIServer)); err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to get own pod\")\n\t\treturn nil, maskAny(err)\n\t}\n\tavReg, err := avclient.NewAnnotatedValueRegistryClient()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to create annotated value registry client\")\n\t\treturn nil, maskAny(err)\n\t}\n\tagentReg, err := pipelinecl.CreateAgentRegistryClient()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to create agent registry client\")\n\t\treturn nil, maskAny(err)\n\t}\n\tstatsSink, err := trackingcl.CreateStatisticsSinkClient()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to create statistics sink client\")\n\t\treturn nil, maskAny(err)\n\t}\n\turi := newLinkURI(dnsName, port, &p)\n\tstatistics := &tracking.LinkStatistics{\n\t\tName: linkName,\n\t\tURI: uri,\n\t}\n\tdeps := APIDependencies{\n\t\tClient: c,\n\t\tPipelineName: pipelineName,\n\t\tLinkName: linkName,\n\t\tNamespace: ns,\n\t\tURI: uri,\n\t\tAnnotatedValueRegistry: avReg,\n\t\tAgentRegistry: agentReg,\n\t\tStatistics: statistics,\n\t}\n\tavPublisher, err := builder.NewAnnotatedValuePublisher(deps)\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\tavSource, err := builder.NewAnnotatedValueSource(deps)\n\tif err != nil {\n\t\treturn nil, maskAny(err)\n\t}\n\treturn &Service{\n\t\tlog: log,\n\t\tport: port,\n\t\tlinkName: linkName,\n\t\turi: uri,\n\t\tstatistics: statistics,\n\t\tavPublisher: avPublisher,\n\t\tavSource: avSource,\n\t\tavRegistry: avReg,\n\t\tagentRegistry: agentReg,\n\t\tstatisticsSink: statsSink,\n\t}, nil\n}", "func NewService(ctx *pulumi.Context,\n\tname string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.TaskSpec == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'TaskSpec'\")\n\t}\n\tvar resource Service\n\terr := ctx.RegisterResource(\"docker:index/service:Service\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewService() *Service {\n\treturn &Service{}\n}", "func NewService() *Service {\n\treturn &Service{}\n}", "func NewService() *Service {\n\treturn &Service{}\n}", "func NewService() *Service {\n\treturn &Service{}\n}", "func NewService() Service {\n\treturn &service{}\n}", "func NewService() Service {\n\treturn &service{}\n}", "func NewService() Service {\n\treturn &service{}\n}", "func NewService() *Service {\n\treturn new(Service)\n}", "func NewService(ctx *pulumi.Context,\n\tname string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.NamespaceId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'NamespaceId'\")\n\t}\n\tif args.ServiceId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ServiceId'\")\n\t}\n\treplaceOnChanges := pulumi.ReplaceOnChanges([]string{\n\t\t\"location\",\n\t\t\"namespaceId\",\n\t\t\"project\",\n\t\t\"serviceId\",\n\t})\n\topts = append(opts, replaceOnChanges)\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Service\n\terr := ctx.RegisterResource(\"google-native:servicedirectory/v1:Service\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func newService(kogitoApp *v1alpha1.KogitoApp, deploymentConfig *appsv1.DeploymentConfig) (service *corev1.Service) {\n\tif deploymentConfig == nil {\n\t\t// we can't create a service without a DC\n\t\treturn nil\n\t}\n\n\tports := buildServicePorts(deploymentConfig)\n\tif len(ports) == 0 {\n\t\treturn nil\n\t}\n\n\tservice = &corev1.Service{\n\t\tObjectMeta: *deploymentConfig.ObjectMeta.DeepCopy(),\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tSelector: deploymentConfig.Spec.Selector,\n\t\t\tType: corev1.ServiceTypeClusterIP,\n\t\t\tPorts: ports,\n\t\t},\n\t}\n\n\tmeta.SetGroupVersionKind(&service.TypeMeta, meta.KindService)\n\taddDefaultMeta(&service.ObjectMeta, kogitoApp)\n\taddServiceLabels(&service.ObjectMeta, kogitoApp)\n\timportPrometheusAnnotations(deploymentConfig, service)\n\tservice.ResourceVersion = \"\"\n\treturn service\n}", "func NewService(logger kitlog.Logger, tagSvc tags.Service, playlistSvc playlists.Service) Service {\n\treturn &service{\n\t\tlogger: logger,\n\t\ttagSvc: tagSvc,\n\t\tplaylistSvc: playlistSvc,\n\t}\n}", "func NewService(name string) *Service {\n\treturn &Service{\n\t\tname: name,\n\t}\n}", "func NewService(ctx *pulumi.Context,\n\tname string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.ServiceName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ServiceName'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Service\n\terr := ctx.RegisterResource(\"gcp:endpoints/service:Service\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewService(config ServiceConfig) Service {\n\treturn Service{}\n}", "func NewService() Service {\n\treturn Service{\n\t\trepo: newRepository(),\n\t}\n}", "func NewService(cli helmcli.Client) Service {\n\treturn Service{cli}\n}", "func NewService(ctx context.Context, apiService *api.Service) (*Service, error) {\n\tif apiService == nil {\n\t\treturn nil, errors.New(\"apiService is nil\")\n\t}\n\ts := &Service{}\n\ts.api = apiService\n\treturn s, nil\n}", "func NewService() *Service {\n\treturn &Service{\n\t\tStore: NewStore(),\n\t}\n}", "func New() *service {\n\treturn &service{}\n}", "func NewService(repository Repository) Service {\n\treturn &defaultService{repository}\n}", "func NewService(name string, service *Service) *Service {\n\tservice.Name = name\n\treturn service\n}", "func NewService(conf Config, deps Dependencies) (Service, error) {\n\treturn &service{\n\t\tConfig: conf,\n\t\tDependencies: deps,\n\t}, nil\n}", "func NewService(config Config) *Service {\n\n\treturn &Service{\n\t\tclient: NewClient(config),\n\t}\n}", "func NewPod(clientSet kubernetes.Interface) *Pod {\n\treturn &Pod{\n\t\tclientSet: clientSet,\n\t}\n}", "func newService(m *influxdatav1alpha1.Influxdb) *corev1.Service {\n\tls := labelsForInfluxdb(m.Name)\n\n\treturn &corev1.Service{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"v1\",\n\t\t\tKind: \"Service\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: m.Name + \"-svc\",\n\t\t\tNamespace: m.Namespace,\n\t\t\tLabels: ls,\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tSelector: ls,\n\t\t\tType: \"ClusterIP\",\n\t\t\tPorts: newServicePorts(m),\n\t\t},\n\t}\n}", "func NewService(clusterUID, apiName string, queue Queue, storage Storage, logger *zap.SugaredLogger) Service {\n\treturn &service{\n\t\tlogger: logger,\n\t\tqueue: queue,\n\t\tstorage: storage,\n\t\tclusterUID: clusterUID,\n\t\tapiName: apiName,\n\t}\n}", "func NewService(client *clients.Client) *Service {\n\treturn &Service{\n\t\tclient: client,\n\t}\n}", "func NewService(ctx *pulumi.Context,\n\tname string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\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 Service\n\terr := ctx.RegisterResource(\"gcp:cloudrun/service:Service\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (r *ReconcileNameService) newService(nameService *rocketmqv1beta1.NameService) *corev1.Service {\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: nameService.Name,\n\t\t\tNamespace: nameService.Namespace,\n\t\t\tOwnerReferences: []metav1.OwnerReference{\n\t\t\t\t{\n\t\t\t\t\tName: nameService.GetName(),\n\t\t\t\t\tKind: nameService.Kind,\n\t\t\t\t\tAPIVersion: nameService.APIVersion,\n\t\t\t\t\tUID: nameService.GetUID(),\n\t\t\t\t\tController: &(share.BoolTrue),\n\t\t\t\t\tBlockOwnerDeletion: &(share.BoolTrue),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tClusterIP: \"None\",\n\t\t\tPorts: []corev1.ServicePort{\n\t\t\t\t{\n\t\t\t\t\tName: \"cluster\",\n\t\t\t\t\tPort: cons.NameServiceMainContainerPort,\n\t\t\t\t\tTargetPort: intstr.FromInt(cons.NameServiceMainContainerPort),\n\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t},\n\t\t\t},\n\t\t\tSelector: map[string]string{\n\t\t\t\t\"app\": nameService.Name,\n\t\t\t},\n\t\t},\n\t}\n}", "func newService(cr *argoprojv1a1.ArgoCD) *corev1.Service {\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name,\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: argoutil.LabelsForCluster(cr),\n\t\t},\n\t}\n}", "func NewService(ctx *pulumi.Context,\n\tname string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {\n\tif args == nil {\n\t\targs = &ServiceArgs{}\n\t}\n\tvar resource Service\n\terr := ctx.RegisterResource(\"aws:servicediscovery/service:Service\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewService() storage.Service {\n\treturn &service{}\n}", "func (f *Framework) CreateServiceForEchoPod(pod *corev1.Pod) (*corev1.Service, error) {\n\treturn f.CreateService(pod.Namespace, pod.Name, func(service *corev1.Service) {\n\t\tservice.Labels = pod.Labels\n\t\tservice.Spec.Selector = pod.Labels\n\t\tservice.Spec.Type = corev1.ServiceTypeNodePort\n\t\tservice.Spec.Ports = []corev1.ServicePort{\n\t\t\t{\n\t\t\t\tName: pod.Name,\n\t\t\t\tPort: echoServicePort,\n\t\t\t\tTargetPort: intstr.FromInt(int(pod.Spec.Containers[0].Ports[0].ContainerPort)),\n\t\t\t},\n\t\t}\n\t})\n}", "func NewService(config ServiceConfig) *Service {\n\treturn &Service{\n\t\tstore: config.Store,\n\t\ttags: config.Tags,\n\t\tencrypt: config.Encrypt,\n\t\tjwt: config.Jwt,\n\t}\n}", "func NewService(input NewServiceInput) *Service {\n\treturn &Service{\n\t\tdataSvc: input.DataSvc,\n\t}\n}", "func NewService(group, name string, allowedMethods []string, shutdownFunc ShutdownFunc, version BuildVersion,\n\tmeta map[string]string) Service {\n\n\topt := NewServiceOptions(group, name, allowedMethods, shutdownFunc, version, meta)\n\n\treturn NewCustomService(opt)\n}", "func NewService(cfg Config) (*Service, error) {\n\tallowedTopicsExpr, err := compileRegexes(cfg.TopicNames)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Service{\n\t\tcfg: cfg,\n\t\tAllowedTopicsExpr: allowedTopicsExpr,\n\t}, nil\n}", "func NewService(ctx context.Context, path dbus.ObjectPath) (*Service, error) {\n\tph, err := NewPropertyHolder(ctx, dbusService, dbusServiceInterface, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Service{PropertyHolder: ph}, nil\n}", "func NewService(config *Config) storage.Service {\n\treturn &service{config: config}\n}", "func NewService(cli APIPackageInstanceAuthClient, cfg ServiceConfig) *Service {\n\treturn &Service{\n\t\tdirectorCli: cli,\n\t\toperationPollingInterval: cfg.OperationPollingInterval,\n\t\toperationPollingTimeout: cfg.OperationPollingTimeout,\n\t}\n}", "func New() Service {\n\treturn &service{}\n}", "func New() Service {\n\treturn &service{}\n}", "func NewService(http webreq.HTTP, secret string) Service {\n\treturn Service{\n\t\thttp: http,\n\t\tsecret: secret,\n\t}\n}", "func NewPetService(storer Storer) *Service {\n\treturn &Service{\n\t\tstore: storer,\n\t}\n}", "func New() *Service {\n\treturn &Service{}\n}", "func New() *Service {\n\treturn &Service{}\n}", "func New() *Service {\n\treturn &Service{}\n}", "func NewService(name string) (*Service, error) {\n\t\n\tif !(len(name) > 0) {\n\t\treturn nil, fmt.Errorf(\"Service name is incorrect.\")\n\t}\n\n\tservice := Service{\n\t\tname: name,\n\t}\n\n\treturn &service, nil\n}", "func NewService(args []string, p person.Service, ns serializer.Serializer) error {\n\tcli := service{args, p, ns}\n\tif err := cli.checkArgs(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := cli.runArgs(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func NewService(\n\tconf *config.ChaosServerConfig,\n\tcli client.Client,\n\tarchive core.ExperimentStore,\n\tevent core.EventStore,\n) *Service {\n\treturn &Service{\n\t\tconf: conf,\n\t\tkubeCli: cli,\n\t\tarchive: archive,\n\t\tevent: event,\n\t}\n}", "func newService(serviceName string) *Service {\n\treturn &Service{\n\t\tpluginDir: serverless.PluginDir,\n\t\tname: serviceName,\n\t\tinterf: nil,\n\t}\n}", "func NewService(name, version string, store store.KeyValueStore) (*Service, error) {\n\tlog.Debugf(\"[Azure CNS] Going to create a service object with name: %v. version: %v.\", name, version)\n\n\tsvc := &Service{\n\t\tName: name,\n\t\tVersion: version,\n\t\tOptions: make(map[string]interface{}),\n\t\tStore: store,\n\t}\n\n\tlog.Debugf(\"[Azure CNS] Finished creating service object with name: %v. version: %v.\", name, version)\n\treturn svc, nil\n}", "func NewService(serviceName string) *ServiceObject {\n\tserviceObject := ServiceObject{}\n\tserviceObject.serviceName = serviceName\n\tserviceObject.serviceStatusHandle = 0\n\tserviceObject.serviceExit = make(chan bool)\n\treturn &serviceObject\n}", "func NewService(repository Repository) Service {\n\treturn &service{repository}\n}", "func NewService(\n\tapp *userproductapp.App,\n) *Service {\n\treturn &Service{\n\t\tapp: app,\n\t}\n}", "func NewService(\n\tlc fx.Lifecycle,\n\tcfg *config.Config,\n\tcfgManager *config.DynamicConfigManager,\n\tcustomProvider *region.DataProvider,\n\tetcdClient *clientv3.Client,\n\tpdClient *pd.Client,\n\tdb *dbstore.DB,\n\ttidbClient *tidb.Client,\n) *Service {\n\ts := &Service{\n\t\tstatus: utils.NewServiceStatus(),\n\t\tconfig: cfg,\n\t\tcfgManager: cfgManager,\n\t\tcustomProvider: customProvider,\n\t\tetcdClient: etcdClient,\n\t\tpdClient: pdClient,\n\t\tdb: db,\n\t\ttidbClient: tidbClient,\n\t}\n\n\tlc.Append(s.managerHook())\n\n\treturn s\n}", "func newK8sService(config *K8sServiceConfig) *k8sService {\n\tif config == nil {\n\t\tconfig = &K8sServiceConfig{}\n\t}\n\n\tlog.Infof(\"k8sConfig %#v\", config)\n\treturn &k8sService{\n\t\tobservers: make([]types.K8sPodEventObserver, 0),\n\t\tconfig: *config,\n\t\tgetContainerInfo: utils.GetContainerInfo,\n\t}\n}", "func NewService(\n\trootPrefix string,\n\tauthService auth.HTTPAuthService,\n\tstore store.Store,\n\tiOpts instrument.Options,\n\tclockOpts clock.Options,\n) mservice.Service {\n\treturn &service{\n\t\trootPrefix: rootPrefix,\n\t\tstore: store,\n\t\tauthService: authService,\n\t\tlogger: iOpts.Logger(),\n\t\tnowFn: clockOpts.NowFn(),\n\t\tmetrics: newServiceMetrics(iOpts.MetricsScope(), iOpts.TimerOptions()),\n\t}\n}", "func NewService(config Config) *Service {\n\treturn &Service{\n\t\tinstances: new(sync.Map),\n\t\tconfig: config,\n\t}\n}", "func NewService(config *Config, fileStorage storage.FileStorage, pastelClient pastel.Client, nodeClient node.Client, p2pClient p2p.Client, rqClient rqnode.Client, ddClient dupedetection.Client) *Service {\n\treturn &Service{\n\t\tconfig: config,\n\t\tpastelClient: pastelClient,\n\t\tnodeClient: nodeClient,\n\t\tp2pClient: p2pClient,\n\t\trqClient: rqClient,\n\t\tddClient: ddClient,\n\t\tWorker: task.NewWorker(),\n\t\tStorage: artwork.NewStorage(fileStorage),\n\t}\n}", "func newPod(name string) *corev1.Pod {\n\treturn &corev1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{},\n\t\tObjectMeta: metav1.ObjectMeta{Name: name},\n\t\tSpec: corev1.PodSpec{},\n\t\tStatus: corev1.PodStatus{},\n\t}\n}", "func NewService(repo interfaces.IRepository) interfaces.IService {\n\treturn &Service{\n\t\trepo: repo,\n\t}\n}", "func NewPod(ns, name string) (*Pod, error) {\n\tkey := fmt.Sprintf(\"%s/%s\", ns, name)\n\titem, exists, err := podInformer.GetIndexer().GetByKey(key)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get pod: %s failed, error: %s\", name, err)\n\t} else if exists == false {\n\t\treturn nil, fmt.Errorf(\"pod: %s is not exists\", name)\n\t}\n\n\tpod, ok := item.(*core_v1.Pod)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"type assertion is wrong, shoud be pod\")\n\t}\n\n\treturn &Pod{Pod: pod}, nil\n}", "func NewService(ctx context.Context, client *http.Client) (*Service, error) {\n\tmsClient := NewClient(ctx, client)\n\tsvc := &Service{\n\t\tctx: ctx,\n\t\tclient: msClient,\n\t}\n\treturn svc, nil\n}", "func NewService(config *Config) *Service {\n\tsvc := new(Service)\n\n\tsvc.config = config\n\n\treturn svc\n}", "func NewService(kind, ip string, port int) *Service {\n\treturn &Service{\n\t\tKind: kind,\n\t\tIP: ip,\n\t\tPort: port,\n\t\tPoints: 0,\n\t}\n}", "func NewService(r repository.Repository) *Service {\n\treturn &Service{\n\t\trepo: r,\n\t}\n}", "func NewService(store Store) Service {\n\treturn &service{store: store}\n}", "func NewService(s Storage) *Service {\n\treturn &Service{s}\n}", "func NewService(s Storage) *Service {\n\treturn &Service{s}\n}", "func NewService(server string) (Service, error) {\n\tif strings.HasPrefix(server, \"ssh://\") {\n\t\treturn NewSSHService(server)\n\t}\n\n\tif strings.HasPrefix(server, \"mrt://\") {\n\t\treturn NewMarathonService(server)\n\t}\n\n\treturn nil, ErrServiceNotFound\n}", "func NewService(subscriptionID string) *Service {\n\treturn &Service{\n\t\tDisksClient: compute.NewDisksClient(subscriptionID),\n\t\tVirtualMachinesClient: compute.NewVirtualMachinesClient(subscriptionID),\n\t\tctx: context.Background(),\n\t}\n}", "func NewService(devices device.Datastore, cs command.Service) Service {\n\treturn &service{\n\t\tcommands: cs,\n\t\tdevices: devices,\n\t}\n}", "func NewService() *Service {\n\tservice := &Service{\n\t\tmu: &sync.RWMutex{},\n\t}\n\treturn service\n}", "func NewService(repo rel.Repository) *Service {\n\treturn &Service{repository: repo}\n}", "func NewService(m *manager.Manager, hot ffs.HotStorage) *Service {\n\treturn &Service{\n\t\tm: m,\n\t\thot: hot,\n\t}\n}", "func NewService(repository todo.Repository) Service {\n\treturn &service{repository}\n}", "func NewService(pub Publisher, st Storer) *Service {\n\treturn &Service{pub: pub, st: st}\n}", "func NewService(repository Repository) Service {\n\treturn &service{\n\t\trepository,\n\t\tvalidator.New(),\n\t}\n}", "func NewService(repo *Repository) Service {\n\treturn &service{repo: repo}\n}", "func New() *Service {\n\ts := Service{}\n\ts.app = core.New()\n\n\treturn &s\n}", "func NewService(host, dockerAPIVersion string, defaultHeaders map[string]string) *Service {\n\tclient, err := client.NewClient(host, dockerAPIVersion, nil, defaultHeaders)\n\tif err != nil {\n\t\tfmt.Printf(\"Something went wrong when tries to connect on the docker host: %s\", err.Error())\n\t}\n\n\treturn &Service{\n\t\thost,\n\t\tclient,\n\t}\n}", "func NewService() *Service {\n\treturn &Service{\n\t\tclients: make(map[Client]bool),\n\t\tregister: make(chan Client),\n\t\tunregister: make(chan Client),\n\t\tbroadcast: make(chan *payload),\n\t}\n}", "func NewService(sp view2.ServiceProvider, discovery Discovery) (*service, error) {\n\ter := &service{\n\t\tsp: sp,\n\t\tDiscovery: discovery,\n\t\tpkiResolvers: []driver.PKIResolver{},\n\t}\n\treturn er, nil\n}", "func NewService(db *bolt.DB) (*Service, error) {\n\terr := internal.CreateBucket(db, BucketName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Service{\n\t\tdb: db,\n\t}, nil\n}", "func NewService(db *bolt.DB) (*Service, error) {\n\terr := internal.CreateBucket(db, BucketName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Service{\n\t\tdb: db,\n\t}, nil\n}", "func NewService(options *Options) *Service {\n\treturn &Service{\n\t\tConfig: NewServiceConfig(options),\n\t}\n}", "func NewService(config ServiceConfig, deps ServiceDependencies) (*Service, error) {\n\treturn &Service{\n\t\tServiceConfig: config,\n\t\tServiceDependencies: deps,\n\t}, nil\n}", "func NewService(ds ReserveStore) Service {\n\treturn &service{\n\t\tds: ds,\n\t}\n}", "func newPod(ctx context.Context, cl client.Client, ns, name, image string, cmd []string) (*corev1.Pod, error) {\n\tc := corev1.Container{\n\t\tName: name,\n\t\tImage: image,\n\t\tCommand: cmd,\n\t}\n\tp := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: ns,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tContainers: []corev1.Container{c},\n\t\t\t// Kill the pod immediately so it exits quickly on deletion.\n\t\t\tTerminationGracePeriodSeconds: pointer.Int64Ptr(0),\n\t\t},\n\t}\n\tif err := cl.Create(ctx, p); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create pod %s/%s: %v\", p.Namespace, p.Name, err)\n\t}\n\treturn p, nil\n}", "func NewService(ctx context.Context) (*Service, error) {\n\tclient, _, err := htransport.NewClient(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsvc := &Service{client: client, BasePath: basePath}\n\tsvc.API = New(svc)\n\n\treturn svc, nil\n}", "func NewService(client ethereum.Client, txManager transactions.Manager, queue *queue.Server) id.ServiceDID {\n\treturn service{client: client, txManager: txManager, queue: queue}\n}", "func NewService(name, url string) Service {\n\treturn Service{\n\t\tName: name,\n\t\tURL: url,\n\t}\n}", "func NewService(m map[string]interface{}) Service {\n\treturn m\n}" ]
[ "0.6994864", "0.67725277", "0.677059", "0.6735671", "0.6686454", "0.667864", "0.6664134", "0.6664134", "0.6664134", "0.6664134", "0.66502446", "0.66502446", "0.66502446", "0.6645156", "0.6600781", "0.6594829", "0.65936637", "0.65918815", "0.65541756", "0.65410894", "0.6506458", "0.6496128", "0.64924645", "0.64796835", "0.64679366", "0.6464721", "0.6440744", "0.6435491", "0.6431927", "0.64314944", "0.6411194", "0.6405508", "0.6404095", "0.6392463", "0.6392247", "0.6385931", "0.63826334", "0.63772136", "0.6361133", "0.6354021", "0.6347612", "0.6347511", "0.6346353", "0.63450825", "0.63429517", "0.6339377", "0.6330055", "0.6330055", "0.6325838", "0.63257664", "0.63214314", "0.63214314", "0.63214314", "0.6319849", "0.63186616", "0.6317757", "0.63176537", "0.6305459", "0.630017", "0.6296059", "0.6289589", "0.62743753", "0.62712127", "0.6265513", "0.6261687", "0.6250479", "0.62499946", "0.6248116", "0.6245989", "0.6240861", "0.62386054", "0.62350035", "0.6233769", "0.62334794", "0.6233294", "0.6233294", "0.62325794", "0.62261987", "0.62245965", "0.6221038", "0.6218263", "0.62165076", "0.6209871", "0.6203406", "0.6202734", "0.6196289", "0.6194169", "0.61919546", "0.61894584", "0.61876166", "0.6186834", "0.6186834", "0.6185637", "0.6179219", "0.616885", "0.61656475", "0.6165103", "0.61648864", "0.616117", "0.61600834" ]
0.78941596
0
CreateProject gets incoming data and creates a project.
CreateProject получает входные данные и создает проект.
func CreateProject(w http.ResponseWriter, r *http.Request) { // Get incoming data, content n' stuff // Pass those data and create em' // Return new project and response }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateProject(w http.ResponseWriter, r *http.Request) {\n\tvar p models.Project\n\n\tu := mw.GetUser(r.Context())\n\tif u == nil || !u.IsAdmin {\n\t\tw.WriteHeader(403)\n\t\tw.Write(apiError(\"you must be logged in as a system administrator to create a project\"))\n\t\treturn\n\t}\n\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&p)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tw.Write(apiError(\"invalid body\"))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\terr = Store.Projects().New(&p)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tw.Write(apiError(err.Error()))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tsendJSON(w, p)\n}", "func (h *Handler) CreateProject(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\tvar project data.Project\n\tvar projects []data.Project\n\n\tif err = json.NewDecoder(r.Body).Decode(&project); err != nil {\n\t\tresponse.Error(w, err)\n\t\treturn\n\t}\n\n\tif projects, err = h.TodoGo.CreateProject(r.Context(), project); err != nil {\n\t\tresponse.Error(w, err)\n\t\treturn\n\t}\n\n\tresponse.Success(201, w, projects)\n}", "func (p *Projects) CreateProject(rw http.ResponseWriter, r *http.Request) {\n\tproject := r.Context().Value(KeyProject{}).(*data.Project)\n\townerID := data.GetUserIDFromContext(r.Context())\n\tp.l.Printf(\"[DEBUG] Inserting user: %#v, from owner with id: %#v\\n\", project, ownerID)\n\taddedProject := data.AddProject(*project, ownerID)\n\tdata.ToJSON(addedProject, rw)\n}", "func ProjectCreate(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab url path variables\n\turlVars := mux.Vars(r)\n\turlProject := urlVars[\"project\"]\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\trefUserUUID := gorillaContext.Get(r, \"auth_user_uuid\").(string)\n\n\t// Read POST JSON body\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\terr := APIErrorInvalidRequestBody()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Parse pull options\n\tpostBody, err := projects.GetFromJSON(body)\n\tif err != nil {\n\t\terr := APIErrorInvalidArgument(\"Project\")\n\t\trespondErr(w, err)\n\t\tlog.Error(string(body[:]))\n\t\treturn\n\t}\n\n\tuuid := uuid.NewV4().String() // generate a new uuid to attach to the new project\n\tcreated := time.Now().UTC()\n\t// Get Result Object\n\n\tres, err := projects.CreateProject(uuid, urlProject, created, refUserUUID, postBody.Description, refStr)\n\n\tif err != nil {\n\t\tif err.Error() == \"exists\" {\n\t\t\terr := APIErrorConflict(\"Project\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Output result to JSON\n\tresJSON, err := res.ExportJSON()\n\tif err != nil {\n\t\terr := APIErrExportJSON()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n\n}", "func CreateProject(p *pm.Project) error {\n\tbcsCCConf := config.GlobalConf.BCSCC\n\tif !bcsCCConf.Enable {\n\t\treturn nil\n\t}\n\treqURL := fmt.Sprintf(\"%s%s\", bcsCCConf.Host, createProjectPath)\n\tdata := constructProjectData(p)\n\treq := gorequest.SuperAgent{\n\t\tUrl: reqURL,\n\t\tMethod: \"POST\",\n\t\tData: data,\n\t}\n\treq.QueryData = url.Values{}\n\tif bcsCCConf.UseGateway {\n\t\tdata[\"app_code\"] = config.GlobalConf.App.Code\n\t\tdata[\"app_secret\"] = config.GlobalConf.App.Secret\n\t} else {\n\t\taccessToken, err := GetAccessToken()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treq.QueryData.Add(\"access_token\", accessToken)\n\t}\n\t// 获取返回\n\treturn requestCommonAndParse(req)\n}", "func CreateProject(name, projType, modelType, visibility string) (string, error) {\n\tconfig := config.Load()\n\tactive := config.GetActive()\n\tclient := graphql.NewClient(active.Endpoint + \"/graphql\")\n\n\t// make a request\n\treq := graphql.NewRequest(`\n\t\tmutation ($name: String!, $type: PROJECT_TYPE, $imported: Boolean, $modelType: IMPORTED_MODEL_TYPE, $visibility: PROJECT_VISIBILITY) {\n\t\t\tcreateProject(name: $name, type: $type, imported: $imported, modelType: $modelType, visibility: $visibility) {\n\t\t\t\tid\n\t\t\t}\n\t\t}\n\t`)\n\treq.Header.Set(\"key\", active.Key)\n\treq.Header.Set(\"altitoken\", active.Token)\n\n\t// set create project variables\n\treq.Var(\"name\", name)\n\treq.Var(\"type\", projType)\n\tif modelType != \"\" {\n\t\treq.Var(\"modelType\", modelType)\n\t\treq.Var(\"imported\", true)\n\t}\n\treq.Var(\"visibility\", visibility)\n\n\t// define a Context for the request\n\tctx := context.Background()\n\n\t// run it and capture the response\n\tvar res createProjRes\n\tif err := client.Run(ctx, req, &res); err != nil {\n\t\treturn \"\", err\n\t}\n\tpid := res.CreateProject.ID\n\tif pid == \"\" {\n\t\treturn \"\", errors.ErrProjCreate\n\t}\n\treturn pid, nil\n}", "func CreateProject(contextName string) map[string]interface{} {\n\tmessage := fmt.Sprint(\"Creating new \", contextName, \" project on Rollbar ...\", \"\\n\")\n\tlog.Println(message)\n\n\tprojectName := fmt.Sprint(strings.Title(contextName))\n\tprojectData := map[string]interface{}{\n\t\t\"name\": projectName,\n\t}\n\n\turl := fmt.Sprint(config.Reader.RollbarAPIEndpoint, \"/projects\")\n\tresp := httphelper.ExecutePostReqAndParseResp(projectData, url, client)\n\treturn resp.(map[string]interface{})\n}", "func ProjectCreate(c *gin.Context) error {\n\tuserID, err := GetIDParam(c, userIDParam)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := CheckUserPermission(c, *userID); err != nil {\n\t\treturn err\n\t}\n\n\tform := new(projectForm)\n\n\tif err := common.BindForm(c, form); err != nil {\n\t\treturn err\n\t}\n\n\tproject := &model.Project{UserID: *userID}\n\n\tif err := saveProject(form, project); err != nil {\n\t\treturn err\n\t}\n\n\treturn common.APIResponse(c, http.StatusCreated, project)\n}", "func CreateProjectHandler(w http.ResponseWriter, r *http.Request) {\n\tvar user models.User\n\tuser = context.Get(r, config.RequestUser).(models.User)\n\n\tvar projectStruct models.Project\n\n\t// Obtain project info from JSON\n\tdec := json.NewDecoder(r.Body)\n\terr := dec.Decode(&projectStruct)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"Error decoding JSON\"))\n\t\treturn\n\t}\n\n\tprojectStruct.UserID = user.ID\n\n\t// Attempt to create the project in the database\n\tproject, err := models.CreateProject(&projectStruct)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(\"Error creating project\"))\n\t\treturn\n\t}\n\n\t// Attempt to create JSON encoded project info, then send a response\n\trs, err := json.Marshal(project)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(\"Error Marshalling project info to JSON\"))\n\t\treturn\n\t}\n\n\tlog.Println(\"Created Project: \", project.Name)\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusCreated)\n\tw.Write(rs)\n\treturn\n}", "func CreateProject(host string, verifyTLS bool, apiKey string, name string, description string) (models.ProjectInfo, Error) {\n\tpostBody := map[string]string{\"name\": name, \"description\": description}\n\tbody, err := json.Marshal(postBody)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Invalid project info\"}\n\t}\n\n\turl, err := generateURL(host, \"/v3/projects\", nil)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Unable to generate url\"}\n\t}\n\n\tstatusCode, _, response, err := PostRequest(url, verifyTLS, apiKeyHeader(apiKey), body)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Unable to create project\", Code: statusCode}\n\t}\n\n\tvar result map[string]interface{}\n\terr = json.Unmarshal(response, &result)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Unable to parse API response\", Code: statusCode}\n\t}\n\n\tresultProject, ok := result[\"project\"].(map[string]interface{})\n\tif !ok {\n\t\treturn models.ProjectInfo{}, Error{Err: fmt.Errorf(\"Unexpected type for project, expected map[string]interface{}, got %T\", result[\"project\"]), Message: \"Unable to parse API response\", Code: statusCode}\n\t}\n\tprojectInfo := models.ParseProjectInfo(resultProject)\n\treturn projectInfo, Error{}\n}", "func (c *RollbarAPIClient) CreateProject(name string) (*Project, error) {\n\tu := c.BaseURL + pathProjectCreate\n\tl := log.With().\n\t\tStr(\"name\", name).\n\t\tLogger()\n\tl.Debug().Msg(\"Creating new project\")\n\n\tresp, err := c.Resty.R().\n\t\tSetBody(map[string]interface{}{\"name\": name}).\n\t\tSetResult(projectResponse{}).\n\t\tSetError(ErrorResult{}).\n\t\tPost(u)\n\tif err != nil {\n\t\tl.Err(err).Msg(\"Error creating project\")\n\t\treturn nil, err\n\t}\n\terr = errorFromResponse(resp)\n\tif err != nil {\n\t\tl.Err(err).Send()\n\t\treturn nil, err\n\t}\n\tl.Debug().Msg(\"Project successfully created\")\n\tpr := resp.Result().(*projectResponse)\n\treturn &pr.Result, nil\n\n}", "func (o *OpenShot) CreateProject(project *Project) (*Project, error) {\n\tlog := getLogger(\"CreateProject\").WithField(\"projectName\", project.Name)\n\tfillDefaults(project)\n\tlog.Debug(\"Creating project \", *project)\n\tvar createdProject Project\n\n\terr := o.http.Post(log, o.projectsURL(), project, &createdProject)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &createdProject, nil\n}", "func (c *ClientImpl) CreateProject(ctx context.Context, hcpHostURL string, input models.HCPCreateProjectInput) (string, error) {\n\tspan, _ := opentracing.StartSpanFromContext(ctx, \"Create HCP Project\")\n\tdefer span.Finish()\n\n\tsession, err := c.getSession(ctx, hcpHostURL, hcpUserName, hcpPassword)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tstatus = Failure\n\tmonitor := metrics.StartExternalCall(externalSvcName, \"Create Project in HCP\")\n\tdefer func() { monitor.RecordWithStatus(status) }()\n\n\trequestBody, _ := json.Marshal(input)\n\tresp, err := mlopsHttp.ExecuteHTTPRequest(\n\t\tctx,\n\t\tc.client,\n\t\thcpHostURL+projectPathV1,\n\t\thttp.MethodPost,\n\t\tmap[string]string{sessionHeader: session},\n\t\tbytes.NewReader(requestBody),\n\t)\n\tif err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"while creating project in MLOps controller platform.\")\n\t}\n\n\tstatus = Success\n\n\t// Extract the ID fof the project from the response headers\n\tprojectURI := resp.Header.Get(\"Location\")\n\tprojectParameters := strings.Split(projectURI, \"/\")\n\tprojectID := projectParameters[len(projectParameters)-1]\n\n\terr = c.deleteSession(ctx, hcpHostURL, session)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn projectID, nil\n}", "func (c *Client) CreateProject(name, description string) (*LogProject, error) {\n\ttype Body struct {\n\t\tProjectName string `json:\"projectName\"`\n\t\tDescription string `json:\"description\"`\n\t}\n\tbody, err := json.Marshal(Body{\n\t\tProjectName: name,\n\t\tDescription: description,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\th := map[string]string{\n\t\t\"x-log-bodyrawsize\": fmt.Sprintf(\"%d\", len(body)),\n\t\t\"Content-Type\": \"application/json\",\n\t\t\"Accept-Encoding\": \"deflate\", // TODO: support lz4\n\t}\n\n\turi := \"/\"\n\tproj := convert(c, name)\n\tresp, err := request(proj, \"POST\", uri, h, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\treturn proj, nil\n}", "func CreateProject(orgID, name, paymentID string) error {\n\tclient, err := NewPacketClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq := packngo.ProjectCreateRequest{\n\t\tOrganizationID: orgID,\n\t\tName: name,\n\t\tPaymentMethodID: paymentID,\n\t}\n\n\tp, _, err := client.Projects.Create(&req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\te := MarshallAndPrint(p)\n\treturn e\n}", "func (p *Provider) CreateProject(projectName string, clusterID int) (int, error) {\n\t// Response struct\n\tresponse := struct {\n\t\tCreateProject *struct {\n\t\t\tProjectID int\n\t\t} `json:\"manager_createProject\"`\n\t}{}\n\n\t// Do the request\n\terr := p.GrapqhlRequest(`\n\t\tmutation($clusterID: Int!, $projectName: String!) {\n\t\t\tmanager_createProject(clusterID: $clusterID, projectName: $projectName) {\n\t\t\t\tProjectID\n\t\t\t}\n\t\t}\n\t`, map[string]interface{}{\n\t\t\"projectName\": projectName,\n\t\t\"clusterID\": clusterID,\n\t}, &response)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// Check result\n\tif response.CreateProject == nil {\n\t\treturn 0, errors.New(\"Couldn't create project: returned answer is null\")\n\t}\n\n\treturn response.CreateProject.ProjectID, nil\n}", "func (g *projectGateway) CreateProjectAction(params project.CreateProjectParams) middleware.Responder {\n\trsp, err := g.projectClient.Create(context.TODO(), &proto.CreateRequest{\n\t\tName: params.Body.Name,\n\t\tDescription: params.Body.Description,\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn project.NewCreateProjectInternalServerError()\n\t}\n\n\tif uint32(codes.OK) == rsp.Status {\n\t\tfmt.Println(fmt.Sprintf(\"project.client: ok. Id = %v\", rsp.Uuid))\n\t} else {\n\t\tfmt.Println(\"project.client: create fail. \")\n\t}\n\n\treadRsp, err := g.projectClient.Read(context.TODO(), &proto.ReadRequest{\n\t\tUuid: rsp.Uuid,\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn project.NewCreateProjectInternalServerError()\n\t}\n\n\tpr := &models.Project{\n\t\tUUID: strfmt.UUID(readRsp.Project.Uuid),\n\t\tName: readRsp.Project.Name,\n\t\tDescription: readRsp.Project.Description,\n\t}\n\n\treturn project.NewCreateProjectCreated().WithPayload(pr)\n}", "func (s *Server) Create(ctx context.Context, q *ProjectCreateRequest) (*v1alpha1.AppProject, error) {\n\tif !s.enf.EnforceClaims(ctx.Value(\"claims\"), \"projects\", \"create\", q.Project.Name) {\n\t\treturn nil, grpc.ErrPermissionDenied\n\t}\n\tif q.Project.Name == common.DefaultAppProjectName {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"name '%s' is reserved and cannot be used as a project name\", q.Project.Name)\n\t}\n\terr := validateProject(q.Project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Create(q.Project)\n\tif err == nil {\n\t\ts.logEvent(res, ctx, argo.EventReasonResourceCreated, \"create\")\n\t}\n\treturn res, err\n}", "func ProjectCreate(p project.APIProject, c *cli.Context) error {\n\toptions := options.Create{\n\t\tNoRecreate: c.Bool(\"no-recreate\"),\n\t\tForceRecreate: c.Bool(\"force-recreate\"),\n\t\tNoBuild: c.Bool(\"no-build\"),\n\t}\n\terr := p.Create(context.Background(), options, c.Args()...)\n\tif err != nil {\n\t\treturn cli.NewExitError(err.Error(), 1)\n\t}\n\treturn nil\n}", "func (p *ProjectClient) Create(teamID int, request *CreateProject) (Project, *Response, error) {\n\n\tteamIDString := strconv.Itoa(teamID)\n\n\tvar trans Project\n\n\tplansPath := strings.Join([]string{baseProjectPath, teamIDString, endProjectPath}, \"/\")\n\n\tresp, err := p.client.MakeRequest(\"POST\", plansPath, request, &trans)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Error: %v\", err)\n\t}\n\treturn trans, resp, err\n}", "func (a *Client) CreateProject(params *CreateProjectParams) (*CreateProjectCreated, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateProjectParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createProject\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/projects\",\n\t\tProducesMediaTypes: []string{\"application/release-manager.v1+json\"},\n\t\tConsumesMediaTypes: []string{\"application/release-manager.v1+json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CreateProjectReader{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\treturn result.(*CreateProjectCreated), nil\n\n}", "func resourceAliyunDatahubProjectCreate(d *schema.ResourceData, meta interface{}) error {\n\tdh := meta.(*AliyunClient).dhconn\n\n\tprojectName := d.Get(\"name\").(string)\n\tprojectComment := d.Get(\"comment\").(string)\n\n\terr := dh.CreateProject(projectName, projectComment)\n\tif err != nil {\n\t\tif NotFoundError(err) {\n\t\t\td.SetId(\"\")\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"failed to create project '%s' with error: %s\", projectName, err)\n\t}\n\n\td.SetId(projectName)\n\treturn resourceAliyunDatahubProjectUpdate(d, meta)\n}", "func CreateProject(projs map[string]*objects.Project) *Project {\n\tout := Project{\n\t\tprojs: projs,\n\t}\n\n\treturn &out\n}", "func (s *ProjectService) Create(\n\tproject *models.Project,\n\torganizationName string,\n) *ProjectService {\n\tif s.err != nil {\n\t\treturn s\n\t}\n\n\tvar organizationID uint\n\ts.pickOrganization(organizationName, &organizationID)\n\tif s.err != nil {\n\t\treturn s\n\t}\n\n\t// Remote Project Creation\n\t*project, s.err = s.cli.Project(\"\").Init(project.Name, organizationID)\n\n\t// Handle invalid token\n\tif s.err != nil {\n\t\treturn s\n\t}\n\n\t// Update the ksfile\n\t// So that it keeps secrets and files\n\t// if the file exited without a project-id\n\ts.ksfile.ProjectId = project.UUID\n\ts.ksfile.ProjectName = project.Name\n\n\tif s.err = s.ksfile.Save().Err(); s.err != nil {\n\t\treturn s\n\t}\n\n\treturn s\n}", "func (repo *repo) CreateProject(projectModel *models.Project) (*models.Project, error) {\n\t// Generate a new project ID\n\tprojectID, err := uuid.NewV4()\n\tif err != nil {\n\t\tlog.Warnf(\"Unable to generate a UUID for a new project request, error: %v\", err)\n\t\treturn nil, err\n\t}\n\n\t_, currentTimeString := utils.CurrentTime()\n\tinput := &dynamodb.PutItemInput{\n\t\tItem: map[string]*dynamodb.AttributeValue{},\n\t\tTableName: aws.String(fmt.Sprintf(\"cla-%s-projects\", repo.stage)),\n\t}\n\n\t//var individualDocs []*dynamodb.AttributeValue\n\t//var corporateDocs []*dynamodb.AttributeValue\n\taddStringAttribute(input.Item, \"project_id\", projectID.String())\n\taddStringAttribute(input.Item, \"project_external_id\", projectModel.ProjectExternalID)\n\taddStringAttribute(input.Item, \"project_name\", projectModel.ProjectName)\n\taddStringAttribute(input.Item, \"project_name_lower\", strings.ToLower(projectModel.ProjectName))\n\taddStringSliceAttribute(input.Item, \"project_acl\", projectModel.ProjectACL)\n\taddBooleanAttribute(input.Item, \"project_icla_enabled\", projectModel.ProjectICLAEnabled)\n\taddBooleanAttribute(input.Item, \"project_ccla_enabled\", projectModel.ProjectCCLAEnabled)\n\taddBooleanAttribute(input.Item, \"project_ccla_requires_icla_signature\", projectModel.ProjectCCLARequiresICLA)\n\n\t// Empty documents for now - will add the template details later\n\taddListAttribute(input.Item, \"project_corporate_documents\", []*dynamodb.AttributeValue{})\n\taddListAttribute(input.Item, \"project_individual_documents\", []*dynamodb.AttributeValue{})\n\taddListAttribute(input.Item, \"project_member_documents\", []*dynamodb.AttributeValue{})\n\n\taddStringAttribute(input.Item, \"date_created\", currentTimeString)\n\taddStringAttribute(input.Item, \"date_modified\", currentTimeString)\n\taddStringAttribute(input.Item, \"version\", \"v1\")\n\n\t_, err = repo.dynamoDBClient.PutItem(input)\n\tif err != nil {\n\t\tlog.Warnf(\"Unable to create a new project record, error: %v\", err)\n\t\treturn nil, err\n\t}\n\n\t// Re-use the provided model - just update the dynamically assigned values\n\tprojectModel.ProjectID = projectID.String()\n\tprojectModel.DateCreated = currentTimeString\n\tprojectModel.DateModified = currentTimeString\n\tprojectModel.Version = \"v1\"\n\n\treturn projectModel, nil\n}", "func CreateProject(e Executor, userID, name string, address *ProjectAddress, absoluteTransformation *ProjectTransformation) error {\n\tp := ProjectSimple{Name: name, Owner: userID}\n\n\tb := new(bytes.Buffer)\n\tjson.NewEncoder(b).Encode(p)\n\n\treq, _ := http.NewRequest(\"POST\", RexBaseURL+apiProjects, b)\n\tresp, err := e.Execute(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\n\tif resp.StatusCode != 201 {\n\t\treturn fmt.Errorf(\"Got server status %d with error: %s \", resp.StatusCode, body)\n\t}\n\tio.Copy(ioutil.Discard, resp.Body)\n\n\tprojectSelfLink := gjson.Get(string(body), \"_links.self.href\").String()\n\tuuid := uuid.New().String()\n\n\t// Create a RexReference as well\n\trexReference := Reference{\n\t\tProject: projectSelfLink,\n\t\tRootReference: true,\n\t\tKey: uuid,\n\t\tAddress: address,\n\t\tAbsTransform: absoluteTransformation,\n\t}\n\n\t_, err = createRexReference(e, &rexReference)\n\treturn err\n}", "func (c *Client) CreateProject(name string, labels map[string]string) (models.Project, error) {\n\tnewProject := models.Project{\n\t\tName: name,\n\t\tLabels: labels,\n\t}\n\n\treq, err := c.newRequest(\"POST\", projectPath, newProject)\n\tif err != nil {\n\t\treturn models.Project{}, err\n\t}\n\n\tresult := models.Project{}\n\n\tresp, err := c.do(req, &result)\n\tif err != nil {\n\t\treturn models.Project{}, err\n\t}\n\n\t// StatusCodes 401 and 409 mean empty response and should be treated as such\n\tif resp.StatusCode == 401 || resp.StatusCode == 409 {\n\t\treturn models.Project{}, nil\n\t}\n\n\tif resp.StatusCode >= 299 {\n\t\treturn models.Project{}, errors.New(\"Got non-2xx return code: \" + strconv.Itoa(resp.StatusCode))\n\t}\n\n\treturn result, nil\n}", "func (pg *MongoDb) CreateProject(ctx context.Context, pID string, p *prpb.Project) (*prpb.Project, error) {\n\tpName := name.FormatProject(pID)\n\tproject := bson.D{primitive.E{Key: \"name\", Value: pName}}\n\t_, err := pg.Collection(\"projects\").InsertOne(context.TODO(), project)\n\tif err != nil {\n\t\tlog.Println(\"Failed to insert Project in database\", err)\n\t\treturn nil, status.Error(codes.Internal, \"Failed to insert Project in database\")\n\t}\n\n\treturn p, nil\n}", "func (p *ProjectHandler) CreateProject(ctx context.Context,\n\treq *proto.CreateProjectRequest, resp *proto.ProjectResponse) error {\n\t// 创建项目\n\tca := project.NewCreateAction(p.model)\n\tprojectInfo, e := ca.Do(ctx, req)\n\tif e != nil {\n\t\treturn e\n\t}\n\tauthUser, err := middleware.GetUserFromContext(ctx)\n\tif err == nil && authUser.Username != \"\" {\n\t\t// 授权创建者项目编辑和查看权限\n\t\tif err := iam.GrantProjectCreatorActions(authUser.Username, projectInfo.ProjectID, projectInfo.Name); err != nil {\n\t\t\tlogging.Error(\"grant project %s for creator %s permission failed, err: %s\",\n\t\t\t\tprojectInfo.ProjectID, authUser.Username, err.Error())\n\t\t}\n\t}\n\t// 处理返回数据及权限\n\tsetResp(resp, projectInfo)\n\treturn nil\n}", "func (u *Projects) Create(c echo.Context) error {\n\tuc, ok := c.(*middlewares.LoginContext)\n\tif !ok {\n\t\terr := errors.New(\"Can not cast context\")\n\t\tlogging.SharedInstance().ControllerWithStacktrace(err, c).Error(err)\n\t\treturn err\n\t}\n\tcurrentUser := uc.CurrentUser\n\n\tnewProjectForm := new(NewProjectForm)\n\terr := c.Bind(newProjectForm)\n\tif err != nil {\n\t\terr := errors.Wrap(err, \"wrong parameter\")\n\t\tlogging.SharedInstance().ControllerWithStacktrace(err, c).Error(err)\n\t\treturn err\n\t}\n\tlogging.SharedInstance().Controller(c).Debugf(\"post new project parameter: %+v\", newProjectForm)\n\n\tvalid, err := validators.ProjectCreateValidation(\n\t\tnewProjectForm.Title,\n\t\tnewProjectForm.Description,\n\t\tnewProjectForm.RepositoryID,\n\t)\n\tif err != nil || !valid {\n\t\tlogging.SharedInstance().Controller(c).Infof(\"validation error: %v\", err)\n\t\treturn NewValidationError(err, http.StatusUnprocessableEntity, c)\n\t}\n\n\tp, err := board.CreateProject(\n\t\tcurrentUser.ID,\n\t\tnewProjectForm.Title,\n\t\tnewProjectForm.Description,\n\t\tnewProjectForm.RepositoryID,\n\t\tcurrentUser.OauthToken,\n\t)\n\tif err != nil {\n\t\tlogging.SharedInstance().ControllerWithStacktrace(err, c).Error(err)\n\t\treturn err\n\t}\n\n\tjsonProject, err := views.ParseProjectJSON(p)\n\tif err != nil {\n\t\tlogging.SharedInstance().ControllerWithStacktrace(err, c).Error(err)\n\t\treturn err\n\t}\n\tlogging.SharedInstance().Controller(c).Info(\"success to create project\")\n\treturn c.JSON(http.StatusOK, jsonProject)\n}", "func CreateProject(userID int, name string) (*ProjectPrint, error) {\n\tvar lastInsertID int\n\n\terr := DB.QueryRow(\"INSERT INTO projects(name,created_by) VALUES($1,$2) returning id;\", name, userID).Scan(&lastInsertID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Println(\"last inserted id =\", lastInsertID)\n\tproject := ProjectPrint{\n\t\tID: lastInsertID,\n\t\tName: name,\n\t\tCreatedBy: userID,\n\t}\n\tproject.Issues = GetAllIssuesByID(project.ID)\n\tproject.Owner = GetUserByID(project.CreatedBy)\n\treturn &project, nil\n}", "func (router *router) createProject(request *restful.Request, response *restful.Response) {\n\tproject := &model.Project{}\n\tcreatedProject, err := router.projectManager.CreateProject(project)\n\tif err != nil {\n\t\tlog.Fatalf(\"create Project failed,err msg%s\", err)\n\t}\n\tresponse.WriteHeaderAndEntity(http.StatusCreated, createdProject)\n}", "func CreateProject(\n\tmet metadata.MetaData,\n\trelPath string,\n\torg *Organization,\n\tpricePerTrx float64,\n\tshareToProcessors float64,\n\tshareToLeaders float64,\n\tshareToVerifiers float64,\n\tshareToBlocker float64,\n\tshareToShareHolders float64,\n\tamountOfQuotasNeededPerBlock uint,\n\tblockDuration time.Duration,\n) (*Project, error) {\n\n\tallShares := shareToProcessors + shareToLeaders + shareToVerifiers + shareToBlocker + shareToShareHolders\n\tif allShares != float64(1) {\n\t\tstr := fmt.Sprintf(\"the cumulative shares does not equal 1. It equals: %f\", allShares)\n\t\treturn nil, errors.New(str)\n\t}\n\n\tout := Project{\n\t\tMet: met.(*concrete_metadata.MetaData),\n\t\tRelPath: relPath,\n\t\tOrg: org,\n\t\tPricePerTrx: pricePerTrx,\n\t\tShareToProcessors: shareToProcessors,\n\t\tShareToLeaders: shareToLeaders,\n\t\tShareToVerifiers: shareToVerifiers,\n\t\tShareToBlocker: shareToBlocker,\n\t\tShareToShareHolders: shareToShareHolders,\n\t\tAmountOfQuotasNeededPerBlock: amountOfQuotasNeededPerBlock,\n\t\tBlockDuration: blockDuration,\n\t}\n\n\treturn &out, nil\n}", "func (s *Server) Create(ctx context.Context, q *project.ProjectCreateRequest) (*v1alpha1.AppProject, error) {\n\tif q.Project == nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"missing payload 'project' in request\")\n\t}\n\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceProjects, rbacpolicy.ActionCreate, q.Project.Name); err != nil {\n\t\treturn nil, err\n\t}\n\tq.Project.NormalizePolicies()\n\terr := validateProject(q.Project)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error validating project: %w\", err)\n\t}\n\tres, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Create(ctx, q.Project, metav1.CreateOptions{})\n\tif apierr.IsAlreadyExists(err) {\n\t\texisting, getErr := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Get(ctx, q.Project.Name, metav1.GetOptions{})\n\t\tif getErr != nil {\n\t\t\treturn nil, status.Errorf(codes.Internal, \"unable to check existing project details: %v\", getErr)\n\t\t}\n\t\tif q.GetUpsert() {\n\t\t\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceProjects, rbacpolicy.ActionUpdate, q.GetProject().Name); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\texisting.Spec = q.GetProject().Spec\n\t\t\tres, err = s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Update(ctx, existing, metav1.UpdateOptions{})\n\t\t} else {\n\t\t\tif !reflect.DeepEqual(existing.Spec, q.GetProject().Spec) {\n\t\t\t\treturn nil, status.Errorf(codes.InvalidArgument, argo.GenerateSpecIsDifferentErrorMessage(\"project\", existing.Spec, q.GetProject().Spec))\n\t\t\t}\n\t\t\treturn existing, nil\n\t\t}\n\t}\n\tif err == nil {\n\t\ts.logEvent(res, ctx, argo.EventReasonResourceCreated, \"created project\")\n\t}\n\treturn res, err\n}", "func (p *Postgres) CreateProject(projectName string, data []byte) error {\n\t_, err := p.db.Exec(\"INSERT INTO trees (project, data) VALUES ($1, $2)\", projectName, data)\n\treturn err\n}", "func (s *ProjectsService) CreateProject(projectName string, input *ProjectInput) (*ProjectInfo, *Response, error) {\n\tu := fmt.Sprintf(\"projects/%s/\", url.QueryEscape(projectName))\n\n\tv := new(ProjectInfo)\n\tresp, err := s.client.Call(\"PUT\", u, input, v)\n\treturn v, resp, err\n}", "func Create(ctx context.Context, client *selvpcclient.ServiceClient, createOpts CreateOpts) (*Project, *selvpcclient.ResponseResult, error) {\n\t// Nest create options into the parent \"project\" JSON structure.\n\ttype createProject struct {\n\t\tOptions CreateOpts `json:\"project\"`\n\t}\n\tcreateProjectOpts := &createProject{Options: createOpts}\n\trequestBody, err := json.Marshal(createProjectOpts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl := strings.Join([]string{client.Endpoint, resourceURL}, \"/\")\n\tresponseResult, err := client.DoRequest(ctx, http.MethodPost, url, bytes.NewReader(requestBody))\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif responseResult.Err != nil {\n\t\treturn nil, responseResult, responseResult.Err\n\t}\n\n\t// Extract a project from the response body.\n\tvar result struct {\n\t\tProject *Project `json:\"project\"`\n\t}\n\terr = responseResult.ExtractResult(&result)\n\tif err != nil {\n\t\treturn nil, responseResult, err\n\t}\n\n\treturn result.Project, responseResult, nil\n}", "func ProjectCreate(opts *gitlab.CreateProjectOptions) (*gitlab.Project, error) {\n\tp, _, err := lab.Projects.CreateProject(opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}", "func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall {\n\tc := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "func CreateProjectHandler(c *gin.Context) {\r\n\tprojectRequest := new(CreateProjectRequest)\r\n\terr := c.Bind(projectRequest)\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n\tres, err := CreateProjectCore(projectRequest)\r\n\tc.JSON(201, res)\r\n}", "func (p *ProjectListAPIView) POST(w http.ResponseWriter, r *http.Request) {\n\n\tvar err error\n\n\t// get auth user to check permissions\n\tusermanager := models.NewUserManager(p.context)\n\tuser := usermanager.NewUser()\n\tif err = usermanager.GetAuthUser(user, r); err != nil {\n\t\t// this should not happened\n\t\tresponse.New(http.StatusUnauthorized).Write(w, r)\n\t\treturn\n\t}\n\n\t// unmarshal posted data\n\tserializer := ProjectCreateSerializer{}\n\n\tif err = p.context.Bind(&serializer); err != nil {\n\t\tresponse.New(http.StatusBadRequest).Write(w, r)\n\t}\n\n\t// validate struct\n\tif vr := serializer.Validate(p.context); !vr.IsValid() {\n\t\tresponse.New(http.StatusBadRequest).Error(vr).Write(w, r)\n\t\treturn\n\t}\n\n\t// get team from serializer.TeamID\n\tteam := models.NewTeam()\n\tif err = team.Manager(p.context).GetByID(team, serializer.TeamID); err != nil {\n\t\tresponse.New(http.StatusNotFound).Write(w, r)\n\t\treturn\n\t}\n\n\t// check permissions (IsSuperuser, member type)\n\ttmm := models.NewTeamMemberManager(p.context)\n\tvar mt models.MemberType\n\t// not superuser so we have to check member type for permissions\n\tif !user.IsSuperuser {\n\t\tif mt, err = tmm.MemberType(team, user); err != nil || mt != models.MEMBER_TYPE_ADMIN {\n\t\t\tresponse.New(http.StatusForbidden).Write(w, r)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// // create project\n\tproject := models.NewProject(func(proj *models.Project) {\n\t\tproj.Name = serializer.Name\n\t\tproj.Platform = serializer.Platform\n\t\tproj.TeamID = types.ForeignKey(team.ID)\n\t})\n\n\tif vr, _ := project.Validate(p.context); !vr.IsValid() {\n\t\tresponse.New(http.StatusBadRequest).Error(vr).Write(w, r)\n\t\treturn\n\t}\n\n\tif err = project.Insert(p.context); err != nil {\n\t\tresponse.New(http.StatusInternalServerError).Error(err).Write(w, r)\n\t\treturn\n\t}\n\n\t// create new project key\n\tpk := models.NewProjectKey(func(projectKey *models.ProjectKey) {\n\t\tprojectKey.UserID = types.ForeignKey(user.ID)\n\t\tprojectKey.UserAddedID = types.ForeignKey(user.ID)\n\t\tprojectKey.ProjectID = project.ID.ToForeignKey()\n\t})\n\n\tif err = pk.Insert(p.context); err != nil {\n\t\tresponse.New(http.StatusInternalServerError).Error(err).Write(w, r)\n\t\treturn\n\t}\n\n\t// everything went ok\n\tresponse.New(http.StatusCreated).Result(project).Write(w, r)\n}", "func (d *Driver) ProjectCreate(pcr ProjectCreateRequest) (*ProjectCreateResponse, error) {\n\tresponse := &ProjectCreateResponse{}\n\n\tcreateProject := &models.V1ProjectCreateRequest{\n\t\tName: pcr.Name,\n\t\tDescription: pcr.Description,\n\t\tTenant: &pcr.Tenant,\n\t}\n\trequest := project.NewCreateProjectParams()\n\trequest.SetBody(createProject)\n\tresp, err := d.project.CreateProject(request, d.auth)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\tresponse.Project = resp.Payload\n\treturn response, nil\n}", "func (impl *ProjectAPIClient) Create(ctx context.Context, token *api.Token) (reply *application.Definition, err error) {\n\terr = client.CallHTTP(ctx, impl.BaseURL, \"ProjectAPI.Create\", atomic.AddUint64(&impl.sequence, 1), &reply, token)\n\treturn\n}", "func (v *ProjectClient) CreateProject(p Project, exists bool) (Project, error) {\n\n\t//Construct the composite key to select the entry\n\tkey := ProjectKey{\n\t\tProjectName: p.MetaData.Name,\n\t}\n\n\t//Check if this Project already exists\n\t_, err := v.GetProject(p.MetaData.Name)\n\tif err == nil && !exists {\n\t\treturn Project{}, pkgerrors.New(\"Project already exists\")\n\t}\n\n\terr = db.DBconn.Insert(v.storeName, key, nil, v.tagMeta, p)\n\tif err != nil {\n\t\treturn Project{}, pkgerrors.Wrap(err, \"Creating DB Entry\")\n\t}\n\n\treturn p, nil\n}", "func (c *FakeProjectRequests) Create(projectRequest *v1.ProjectRequest) (result *v1.Project, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewRootCreateAction(projectrequestsResource, projectRequest), &v1.Project{})\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1.Project), err\n}", "func (ps *ProjectsPG) Create(ctx context.Context, newProj *api.NewProject, customerId string) (*api.Project, error) {\n\n\tresProj := api.Project{}\n\n\tqry := sqlf.Sprintf(\"INSERT INTO projects(customer_id, name, description, labels) VALUES(%s, %s, %s, %s)\",\n\t\tcustomerId, newProj.Name, newProj.Description, pq.Array(newProj.Labels))\n\n\terr := db.WithTransaction(ctx, ps.dbconn, func(tx db.Transaction) error {\n\t\treturn tx.QueryRowContext(\n\t\t\tctx, qry.Query(sqlf.PostgresBindVar)+\" RETURNING id, name, description, labels, created_at, updated_at\", qry.Args()...,\n\t\t).Scan(&resProj.Id, &resProj.Name, &resProj.Description, pq.Array(&resProj.Labels), &resProj.CreatedAt, &resProj.UpdatedAt)\n\t})\n\tif err != nil {\n\t\tif pqErr, ok := err.(*pq.Error); ok {\n\t\t\tswitch pqErr.Constraint {\n\t\t\tcase \"projects_customer_id_name_key\":\n\t\t\t\treturn nil, ErrProjectNameAlreadyExists\n\t\t\t}\n\t\t}\n\t\treturn nil, errors.Wrapf(err, \"failed to create project with name: %s customerId: %s\", newProj.Name, customerId)\n\t}\n\n\treturn &resProj, nil\n}", "func APIProjectCreateHandler(er *Errorly) http.HandlerFunc {\n\treturn func(rw http.ResponseWriter, r *http.Request) {\n\t\tsession, _ := er.Store.Get(r, sessionName)\n\t\tdefer er.SaveSession(session, r, rw)\n\n\t\tif err := r.ParseForm(); err != nil {\n\t\t\ter.Logger.Error().Err(err).Msg(\"Failed to parse form\")\n\t\t\tpassResponse(rw, \"Failed to parse form\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Authenticate the user\n\t\tauth, user := er.AuthenticateSession(session)\n\t\tif !auth {\n\t\t\tpassResponse(rw, \"You must be logged in to do this\", false, http.StatusForbidden)\n\n\t\t\treturn\n\t\t}\n\n\t\tprojectName := r.PostFormValue(\"display_name\")\n\t\tif len(projectName) < 3 {\n\t\t\tpassResponse(rw, \"Invalid name was passed\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tprojectURL := r.PostFormValue(\"url\")\n\t\tif projectURL != \"\" {\n\t\t\t_, err := url.Parse(projectURL)\n\t\t\tif err != nil {\n\t\t\t\tpassResponse(rw, \"Invalid URL was passed\", false, http.StatusBadRequest)\n\t\t\t}\n\t\t}\n\n\t\tprojectPrivate, err := strconv.ParseBool(r.PostFormValue(\"private\"))\n\t\tif err != nil {\n\t\t\tprojectPrivate = false\n\t\t}\n\n\t\tprojectLimited, err := strconv.ParseBool(r.PostFormValue(\"limited\"))\n\t\tif err != nil {\n\t\t\tprojectLimited = false\n\t\t}\n\n\t\tuserProjects := make([]structs.Project, 0)\n\n\t\terr = er.Postgres.Model(&userProjects).\n\t\t\tWhere(\"created_by_id = ?\", user.ID).\n\t\t\tSelect()\n\t\tif err != nil {\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\treturn\n\t\t}\n\n\t\tfor _, userProject := range userProjects {\n\t\t\tif userProject.Settings.DisplayName == projectName {\n\t\t\t\tpassResponse(rw, \"You cannot have multiple projects with the same name\", false, http.StatusBadRequest)\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tproject := structs.Project{\n\t\t\tID: er.IDGen.GenerateID(),\n\n\t\t\tCreatedAt: time.Now().UTC(),\n\t\t\tCreatedByID: user.ID,\n\n\t\t\tIntegrations: make([]*structs.User, 0),\n\t\t\tWebhooks: make([]*structs.Webhook, 0),\n\n\t\t\tSettings: structs.ProjectSettings{\n\t\t\t\tDisplayName: projectName,\n\n\t\t\t\tDescription: r.PostFormValue(\"description\"),\n\t\t\t\tURL: projectURL,\n\n\t\t\t\tArchived: false,\n\t\t\t\tPrivate: projectPrivate,\n\n\t\t\t\tLimited: projectLimited,\n\t\t\t},\n\t\t}\n\n\t\t_, err = er.Postgres.Model(&project).Insert()\n\t\tif err != nil {\n\t\t\ter.Logger.Error().Err(err).Msg(\"Failed to insert project\")\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\treturn\n\t\t}\n\n\t\tuser.ProjectIDs = append(user.ProjectIDs, project.ID)\n\n\t\t_, err = er.Postgres.Model(user).\n\t\t\tWherePK().\n\t\t\tUpdate()\n\t\tif err != nil {\n\t\t\ter.Logger.Error().Err(err).Msg(\"Failed to update user projects\")\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\treturn\n\t\t}\n\n\t\tpassResponse(rw, structs.PartialProject{\n\t\t\tID: project.ID,\n\t\t\tName: project.Settings.DisplayName,\n\t\t\tDescription: project.Settings.Description,\n\t\t\tArchived: project.Settings.Archived,\n\t\t\tPrivate: project.Settings.Private,\n\t\t\tOpenIssues: project.OpenIssues,\n\t\t\tActiveIssues: project.ActiveIssues,\n\t\t\tResolvedIssues: project.ResolvedIssues,\n\t\t}, true, http.StatusOK)\n\t}\n}", "func (r *mongoRepository) CreateProject(ctx context.Context, projectStrut *project.Project) error {\n\t//get the collection\n\tcollection := r.getProjectsCollection()\n\n\t//insert into the db\n\t_, err := collection.InsertOne(ctx, projectStrut)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"repository.Project.CreateProject\")\n\t}\n\treturn nil\n}", "func (p *ProjectService) Create(ctx iris.Context) {\r\n\r\n\tvar request map[string]interface{}\r\n\terr := ctx.ReadJSON(&request)\r\n\tif err != nil { c.BadRequestAfterErrorResponse(ctx,err); return }\r\n\t\r\n\tdocLoader := gojsonschema.NewGoLoader(request)\r\n\tresult, err := p.ProjectSchema.Validate(docLoader)\r\n\tif err != nil {\r\n\t\tc.BadRequestAfterErrorResponse(ctx,err)\r\n\t\treturn\r\n\t}\r\n\r\n\tvar dbData = map[string]interface{}{ \r\n\t\t\"dbName\" : c.SysDBName, \r\n\t\t\"collectionName\" : c.TrionConfig.DBConfig.MongoConfig.ProjectsColl,\r\n\t}\r\n\r\n\tif result.Valid() {\r\n\t\trequest[\"schema_rev\"] = schemas.ProjectJSchemaVersion\r\n\t\titemsMap, err:= p.DSS.Create(nil, request, dbData) //save to DB\r\n\t\tif err != nil { \r\n\t\t\tc.APIErrorSwitch(ctx,err,c.SliceMapToJSONString(itemsMap))\r\n\t\t} else {\r\n\t\t\tc.StatusJSON(ctx,iris.StatusOK,\"%v\",c.SliceMapToJSONString(itemsMap))\r\n\t\t}\r\n\t} else { c.BadRequestAfterJSchemaValidationResponse(ctx,result) }\r\n\treturn\r\n}", "func createProject(tb testing.TB, name, desc string) *gogitlab.Project {\n\tn := name + RandomString(4)\n\tproj, _, err := GitLabClient.Projects.CreateProject(&gogitlab.CreateProjectOptions{\n\t\tName: &n,\n\t\tDescription: &desc,\n\t})\n\tif err != nil {\n\t\t// The failure happens at wherever we were called, not here\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif !ok {\n\t\t\ttb.Fatalf(\"Unable to get caller\")\n\t\t}\n\t\ttb.Fatalf(\"%s:%v %v\", path.Base(file), line, err)\n\t}\n\treturn proj\n}", "func (s *projectService) createNewProject(projectName, owner string) (*schema.Project, error) {\n\tproject := schema.NewProject(projectName, owner)\n\treturn s.projects.Insert(&project)\n}", "func createProject(project *Project, uid int64) error {\n\tvar dummy string\n\n\t// create project\n\tdb.QueryRow(\"INSERT INTO projects (gh_id, name, clone_url)\"+\n\t\t\" VALUES ($1, $2, $3)\", project.GH_Id, project.Name, project.Clone_url).\n\t\tScan(&dummy)\n\n\tif err := fillProject(project, uid); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (h *H) CreateProject(name string) {\n\tproj, err := h.createProject(name)\n\tExpect(err).To(BeNil(), \"error creating project\")\n\th.proj = proj\n}", "func CreateProjectCmd(cdc *wire.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"createProject projectJson sovrinDiD\",\n\t\tShort: \"Create a new ProjectDoc signed by the sovrinDID of the project\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := context.NewCLIContext().\n\t\t\t\tWithCodec(cdc).\n\t\t\t\tWithLogger(os.Stdout)\n\n\t\t\tif len(args) != 2 || len(args[0]) == 0 || len(args[1]) == 0 {\n\t\t\t\treturn errors.New(\"You must provide the project data and the projects private key\")\n\t\t\t}\n\n\t\t\t//\t\t\tsig := sovrin.SignMessage([]byte(\"A\"), \"BGsfxvVMmzcUEnYmXvso3fEGjmbk5He9HpuuPvEdPNUg\", \"6xRWNCMc4CiJ2A3kgjpFdkJFT7oboy41dtjB8J1F7U52\")\n\t\t\t//\t\t\tfmt.Println(hex.EncodeToString(sig))\n\t\t\tprojectDoc := project.ProjectDoc{}\n\t\t\terr := json.Unmarshal([]byte(args[0]), &projectDoc)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tsovrinDid := unmarshalSovrinDID(args[1])\n\n\t\t\t// create the message\n\t\t\tmsg := project.NewCreateProjectMsg(projectDoc, sovrinDid)\n\n\t\t\treturn ixoSignAndBroadcast(cdc, ctx, msg, sovrinDid)\n\t\t},\n\t}\n}", "func (s *projectService) createProject(projectName, owner string, mustNotExist bool) (*schema.Project, bool, error) {\n\tproject, err := s.projects.ByName(projectName, owner)\n\tswitch {\n\tcase err == app.ErrNotFound:\n\t\tproj, err := s.createNewProject(projectName, owner)\n\t\treturn proj, false, err\n\n\tcase err != nil:\n\t\treturn nil, false, err\n\n\tdefault:\n\t\tif mustNotExist {\n\t\t\treturn nil, true, app.ErrExists\n\t\t}\n\n\t\treturn project, true, nil\n\t}\n}", "func ProjectUserCreate(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab url path variables\n\turlVars := mux.Vars(r)\n\turlUser := urlVars[\"user\"]\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\trefUserUUID := gorillaContext.Get(r, \"auth_user_uuid\").(string)\n\trefProjUUID := gorillaContext.Get(r, \"auth_project_uuid\").(string)\n\n\t// Read POST JSON body\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\terr := APIErrorInvalidRequestBody()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Parse pull options\n\tpostBody, err := auth.GetUserFromJSON(body)\n\tif err != nil {\n\t\terr := APIErrorInvalidArgument(\"User\")\n\t\trespondErr(w, err)\n\t\tlog.Error(string(body[:]))\n\t\treturn\n\t}\n\n\t// omit service wide roles\n\tpostBody.ServiceRoles = []string{}\n\n\t// allow the user to be created to only have reference to the project under which is being created\n\tprName := projects.GetNameByUUID(refProjUUID, refStr)\n\tif prName == \"\" {\n\t\terr := APIErrGenericInternal(\"Internal Error\")\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\tprojectRoles := auth.ProjectRoles{}\n\n\tfor _, p := range postBody.Projects {\n\t\tif p.Project == prName {\n\t\t\tprojectRoles.Project = prName\n\t\t\tprojectRoles.Roles = p.Roles\n\t\t\tprojectRoles.Topics = p.Topics\n\t\t\tprojectRoles.Subs = p.Subs\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// if the project was not mentioned in the creation, add it\n\tif projectRoles.Project == \"\" {\n\t\tprojectRoles.Project = prName\n\t}\n\n\tpostBody.Projects = []auth.ProjectRoles{projectRoles}\n\n\tuuid := uuid.NewV4().String() // generate a new uuid to attach to the new project\n\ttoken, err := auth.GenToken() // generate a new user token\n\tcreated := time.Now().UTC()\n\n\t// Get Result Object\n\tres, err := auth.CreateUser(uuid, urlUser, \"\", \"\", \"\", \"\", postBody.Projects, token, postBody.Email, postBody.ServiceRoles, created, refUserUUID, refStr)\n\n\tif err != nil {\n\t\tif err.Error() == \"exists\" {\n\t\t\terr := APIErrorConflict(\"User\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif strings.HasPrefix(err.Error(), \"invalid\") {\n\t\t\terr := APIErrorInvalidData(err.Error())\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif strings.HasPrefix(err.Error(), \"duplicate\") {\n\t\t\terr := APIErrorInvalidData(err.Error())\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Output result to JSON\n\tresJSON, err := res.ExportJSON()\n\tif err != nil {\n\t\terr := APIErrExportJSON()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n\n}", "func (r *mutationResolver) CreateProject(ctx context.Context, input models.CreateProjectInput) (*models.CreateProject, error) {\n\treturn r.project.CreateProject(ctx, input)\n}", "func createProjectClient(ctx iris.Context) {\n\tprojectID := ctx.Params().Get(\"projectID\")\n\tif projectID == \"\" {\n\t\thandleError(ctx, apiErrors.ErrBadRequest)\n\t\treturn\n\t}\n\n\tpc := model.ProjectClient{}\n\terrs := decodeAndValidate(ctx, &pc)\n\tif errs != nil {\n\t\trender.Error(ctx, iris.StatusUnprocessableEntity, errs)\n\t\treturn\n\t}\n\tsecret, err := generateClientSecret(clientSecretBytes)\n\tif err != nil {\n\t\thandleError(ctx, apiErrors.ErrInternal)\n\t\treturn\n\t}\n\tpc.Secret = secret\n\tpc.ProjectID = projectID\n\n\tresult, err := store.CreateProjectClient(pc)\n\tif err != nil {\n\t\thandleError(ctx, err)\n\t\treturn\n\t}\n\n\trender.JSON(ctx, iris.StatusCreated, result)\n}", "func (s *Sonar) CreateProject(url, token string, projectKey, projectName string) error {\n\turl = strings.TrimSuffix(url, \"/\")\n\tpath := fmt.Sprintf(\"%s/api/projects/create?project=%s&name=%s\",\n\t\turl, projectKey, projectName)\n\n\tlog.Infof(\"test path:%s\", path)\n\treq, err := http.NewRequest(http.MethodPost, path, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// -u your-token: , colon(:) is needed.\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Basic %s\", base64.StdEncoding.EncodeToString([]byte(token+\":\"))))\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tlog.Errorf(\"Fail to create sonarqube project as %s\", err.Error())\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\tlog.Errorf(\"Fail to create sonarqube project as %s\", err.Error())\n\t\treturn err\n\t}\n\n\tif resp.StatusCode/100 == 2 {\n\t\treturn nil\n\t}\n\n\terr = fmt.Errorf(\"Fail to create sonarqube project as %s, resp code: %v \", body, resp.StatusCode)\n\treturn err\n}", "func Test_pgProjectsRepository_CreateProject(t *testing.T) {\n\ttype fields struct {\n\t\tconn *sqlx.DB\n\t}\n\ttype args struct {\n\t\tproject domain.Project\n\t}\n\n\ttests := []struct {\n\t\tname string\n\t\tfields fields\n\t\targs args\n\t\twant int\n\t\twantErr bool\n\t}{\n\t\t{\"happy project spec\", fields{conn: getConn()},\n\t\t\targs{domain.Project{ID: 0,\n\t\t\t\tName: String(\"ori\"),\n\t\t\t\tVertical: String(\"tools\"),\n\t\t\t\tEvent: String(\"tag\")}},\n\t\t\t1, false},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\ttr := repository.NewPgProjectsRepository(\n\t\t\t\ttt.fields.conn,\n\t\t\t)\n\t\t\tgot, err := tr.CreateProject(tt.args.project)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"pgProjectsRepository.CreateProject() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif got != tt.want {\n\t\t\t\tt.Errorf(\"pgProjectsRepository.CreateProject() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}", "func (a *IamProjectApiService) IamProjectCreate(ctx context.Context) ApiIamProjectCreateRequest {\n\treturn ApiIamProjectCreateRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "func NewProject() *app.Command {\n\tdesc := \"Create a project.\"\n\tcmd := app.NewCommand(\"project\", desc, func(ctx *app.Context) error {\n\t\targs := &struct {\n\t\t\tGroup string `option:\"group\"`\n\t\t\tArtifact string `option:\"artifact\"`\n\t\t}{}\n\t\tif err := config.Unmarshal(args); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif args.Group == \"\" {\n\t\t\treturn errors.New(\"group is missing\")\n\t\t}\n\n\t\twd, err := os.Getwd()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"acquire work directory failed\")\n\t\t}\n\n\t\tif len(ctx.Args()) == 0 {\n\t\t\treturn errors.New(\"project name is missing\")\n\t\t}\n\n\t\tname := ctx.Args()[0]\n\t\tif args.Artifact == \"\" {\n\t\t\targs.Artifact = name\n\t\t}\n\n\t\t// check dir exist\n\t\tdir := filepath.Join(wd, name)\n\t\tif file.Exist(dir) {\n\t\t\treturn errors.New(\"directory already exist: \" + dir)\n\t\t}\n\n\t\tdata := map[string]string{\n\t\t\t\"GroupID\": args.Group,\n\t\t\t\"ArtifactID\": args.Artifact,\n\t\t}\n\n\t\t// create files\n\t\tfiles := make(map[string]string)\n\t\tfiles[filepath.Join(dir, \"pom.xml\")] = \"project/pom.xml\"\n\t\tfiles[filepath.Join(dir, \"README.md\")] = \"project/README.md\"\n\t\tfiles[filepath.Join(dir, \".gitignore\")] = \"project/gitignore\"\n\t\tif err = tpl.Execute(files, data); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Println(\"finished.\")\n\t\treturn nil\n\t})\n\tcmd.Flags.Register(flag.Help)\n\tcmd.Flags.String(\"group\", \"g\", \"\", \"group id\")\n\tcmd.Flags.String(\"artifact\", \"a\", \"\", \"artifact id\")\n\treturn cmd\n}", "func ProjectsPOST(c *gin.Context) {\n\tuser := c.MustGet(\"user\").(*User)\n\treq := &ProjectRequest{}\n\tif err := c.BindJSON(req); err != nil {\n\t\treturn\n\t}\n\n\tdateStart, errDateStart := time.Parse(\"2006-01-02\", req.DateStart)\n\tdateEnd, errDateEnd := time.Parse(\"2006-01-02\", req.DateEnd)\n\tif errDateStart != nil || errDateEnd != nil {\n\t\tc.AbortWithStatus(http.StatusBadRequest)\n\t\treturn\n\t}\n\tproject, err := user.NewProject(req.Name, req.Slug, dateStart, dateEnd, req.WordCountStart, req.WordCountGoal)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tc.Header(\"Location\", fmt.Sprintf(\"/users/%s/projects/%s\", user.Username, project.Slug))\n\tc.Status(http.StatusOK)\n}", "func (a *IamProjectApiService) IamProjectCreateExecute(r ApiIamProjectCreateRequest) (*Project, *http.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = http.MethodPost\n\t\tlocalVarPostBody interface{}\n\t\tformFiles []formFile\n\t\tlocalVarReturnValue *Project\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"IamProjectApiService.IamProjectCreate\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/iam/project\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\tif r.iamProjectCreate == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"iamProjectCreate is required and must be specified\")\n\t}\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\tif r.xIdempotencyKey != nil {\n\t\tlocalVarHeaderParams[\"x-idempotency-key\"] = parameterToString(*r.xIdempotencyKey, \"\")\n\t}\n\tif r.xDryRun != nil {\n\t\tlocalVarHeaderParams[\"x-dry-run\"] = parameterToString(*r.xDryRun, \"\")\n\t}\n\t// body params\n\tlocalVarPostBody = r.iamProjectCreate\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\t\tvar v InlineResponseDefault\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\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}", "func CreateRenewProject(ctx iris.Context) {\n\tvar req renewProjectReq\n\tif err := ctx.ReadJSON(&req); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Création de projet de renouvellement, décodage : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := req.RenewProject.Validate(); err != nil {\n\t\tctx.StatusCode(http.StatusBadRequest)\n\t\tctx.JSON(jsonError{\"Création de projet de renouvellement : \" + err.Error()})\n\t\treturn\n\t}\n\tdb := ctx.Values().Get(\"db\").(*sql.DB)\n\tif err := req.RenewProject.Create(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Création de projet de renouvellement, requête : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusCreated)\n\tctx.JSON(req)\n}", "func Create_account_project(account, project string) {\n\tmyuuid, _ := securerandom.Uuid()\n\tCreate_uuid_account_project(myuuid, account, project)\n}", "func CreateProjectTask(ctx context.Context, cfg *config.Config, db *gorp.DbMap, t *model.Task) (r gin.H, err error) {\n\targs := struct {\n\t\tNodeCount uint16 `json:\"node_count\"`\n\t}{}\n\n\terr = json.Unmarshal(t.RawArgs, &args)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"unmarshal task args failed\")\n\t\treturn\n\t}\n\n\ttx, dbID, key, err := createDatabase(db, t.Developer, t.Account, args.NodeCount)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"create database failed\")\n\t\treturn\n\t}\n\n\t// wait for transaction to complete in several cycles\n\ttimeoutCtx, cancelCtx := context.WithTimeout(ctx, 3*time.Minute)\n\tdefer cancelCtx()\n\n\tlastState, err := waitForTxState(timeoutCtx, tx)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"wait for database creation confirmation failed\")\n\t\tr = gin.H{\n\t\t\t\"project\": dbID,\n\t\t\t\"db\": dbID,\n\t\t\t\"tx\": tx.String(),\n\t\t\t\"state\": lastState.String(),\n\t\t}\n\n\t\treturn\n\t}\n\n\t// wait for projectDB to ready deployed\n\ttime.Sleep(30 * time.Second)\n\n\t_, err = initProjectDB(dbID, key)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"init project database meta tables failed\")\n\t\treturn\n\t}\n\n\t// bind database to current developer\n\t_, err = model.AddProject(db, dbID, t.Developer, t.Account)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"register project failed\")\n\t}\n\n\tr = gin.H{\n\t\t\"tx\": tx.String(),\n\t\t\"state\": lastState.String(),\n\t\t\"project\": dbID,\n\t\t\"db\": dbID,\n\t}\n\n\treturn\n}", "func (r CreateProjectRequest) Send() (*CreateProjectOutput, error) {\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn r.Request.Data.(*CreateProjectOutput), nil\n}", "func Create(managementDirPath, name, goRootPath, goPath string) (p *Project, err error) {\n\n\t// Create project data direcotry\n\tprojectDirPath := filepath.Join(goPath, DataDirName)\n\tif err := os.MkdirAll(projectDirPath, os.ModePerm); err != nil {\n\t\treturn nil, err\n\t}\n\n\tp = &Project{\n\t\tName: name,\n\t\tGoRootPath: goRootPath,\n\t\tGoPath: goPath,\n\t\tManagementDirPath: managementDirPath}\n\n\tif err := p.createScripts(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p, nil\n}", "func (w *ServerInterfaceWrapper) NewProject(ctx echo.Context) error {\n\tvar err error\n\n\t// HasSecurity is set\n\n\tctx.Set(\"OpenId.Scopes\", []string{\"exitus/project.write\"})\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.NewProject(ctx)\n\treturn err\n}", "func (s *service) Project(name string) error {\n\tresp := ProjectResponse{}\n\tdata := struct {\n\t\tName string `json:\"name\"`\n\t}{\n\t\tName: name,\n\t}\n\tif err := post(s.getServerURL(\"/project\"), &data, &resp); err != nil {\n\t\treturn err\n\t}\n\n\tif !resp.Success {\n\t\treturn errors.New(\"failed to obtain token\")\n\t}\n\n\ts.token = resp.Token\n\n\treturn nil\n}", "func (h *Handlers) CreateRecord(c *gin.Context) {\n\tproject := c.Param(\"project\")\n\tprojectIndex := &ProjectIndex{}\n\tc.BindJSON(projectIndex)\n\n\terr := h.db.AddProjectData(project, projectIndex.Data, projectIndex.Meta)\n\tif err != nil {\n\t\ttErr := h.db.TranslateError(err)\n\t\tc.JSON(tErr.Code, tErr.Error())\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusCreated, gin.H{})\n}", "func (projectController *ProjectController) Create() func(c *gin.Context) {\n\treturn func(c *gin.Context) {\n\n\t\t// Traer Usuario\n\t\tuser := userModel.LoadFromContext(c)\n\t\tvar project model.Project\n\t\terr := c.Bind(&project)\n\t\tif err != nil {\n\t\t\tc.JSON(http.StatusBadRequest, util.GetError(\"No se pudo decodificar json\", err))\n\t\t\treturn\n\t\t}\n\t\t// Asignar owner\n\t\tproject.Owner = user.ID\n\t\terr = projectModel.Create(&project)\n\t\tif err != nil {\n\t\t\tc.JSON(http.StatusBadRequest, util.GetError(\"No se pudo insertar perro\", err))\n\t\t\treturn\n\t\t}\n\n\t\tc.JSON(http.StatusOK, project)\n\t}\n}", "func (project *ProjectV1) CreateProject(createProjectOptions *CreateProjectOptions) (result *Project, response *core.DetailedResponse, err error) {\n\treturn project.CreateProjectWithContext(context.Background(), createProjectOptions)\n}", "func loadCreateProjectRequest(t *testing.T, filename string) (r *requests.CreateProject) {\n\tloadJSON(t, filename, &r)\n\treturn\n}", "func AddProject(data map[string]interface{}) error {\n\tproject := Project{\n\t\tName: data[\"name\"].(string),\n\t\tDescription: data[\"description\"].(string),\n\t\t//CreatedBy: data[\"created_by\"].(string),\n\t\tState: data[\"state\"].(string),\n\t}\n\tif err := db.Debug().Create(&project).Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func NewProject(ctx *pulumi.Context,\n\tname string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) {\n\tif args == nil || args.Artifacts == nil {\n\t\treturn nil, errors.New(\"missing required argument 'Artifacts'\")\n\t}\n\tif args == nil || args.Environment == nil {\n\t\treturn nil, errors.New(\"missing required argument 'Environment'\")\n\t}\n\tif args == nil || args.ServiceRole == nil {\n\t\treturn nil, errors.New(\"missing required argument 'ServiceRole'\")\n\t}\n\tif args == nil || args.Source == nil {\n\t\treturn nil, errors.New(\"missing required argument 'Source'\")\n\t}\n\tif args == nil {\n\t\targs = &ProjectArgs{}\n\t}\n\tvar resource Project\n\terr := ctx.RegisterResource(\"aws:codebuild/project:Project\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func TestProject_CreateProject_DoesNotSwallowErrorFromFailedCreateCall(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tcoreClient := azdosdkmocks.NewMockCoreClient(ctrl)\n\tclients := &client.AggregatedClient{\n\t\tCoreClient: coreClient,\n\t\tCtx: context.Background(),\n\t}\n\n\texpectedProjectCreateArgs := core.QueueCreateProjectArgs{ProjectToCreate: &testProject}\n\n\tcoreClient.\n\t\tEXPECT().\n\t\tQueueCreateProject(clients.Ctx, expectedProjectCreateArgs).\n\t\tReturn(nil, errors.New(\"QueueCreateProject() Failed\")).\n\t\tTimes(1)\n\n\terr := createProject(clients, &testProject, 5)\n\trequire.Equal(t, \"QueueCreateProject() Failed\", err.Error())\n}", "func (test *Test) CreateOrUpdateProject(projectName models.Project) error {\n\treturn nil\n}", "func (r CreateProjectRequest) Send(ctx context.Context) (*CreateProjectResponse, error) {\n\tr.Request.SetContext(ctx)\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &CreateProjectResponse{\n\t\tCreateProjectOutput: r.Request.Data.(*CreateProjectOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "func (r CreateProjectRequest) Send(ctx context.Context) (*CreateProjectResponse, error) {\n\tr.Request.SetContext(ctx)\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &CreateProjectResponse{\n\t\tCreateProjectOutput: r.Request.Data.(*CreateProjectOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "func NewProject(packageLabel, path, name string) *ProjectAdd {\n\treturn &ProjectAdd{\n\t\tPath: path,\n\t\tName: name,\n\t\tPackage: packageLabel,\n\t}\n}", "func NewProject(ctx *pulumi.Context,\n\tname string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) {\n\tif args == nil || args.ProjectName == nil {\n\t\treturn nil, errors.New(\"missing required argument 'ProjectName'\")\n\t}\n\tif args == nil || args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"missing required argument 'ResourceGroupName'\")\n\t}\n\tif args == nil {\n\t\targs = &ProjectArgs{}\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:migrate/v20191001:Project\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource Project\n\terr := ctx.RegisterResource(\"azure-nextgen:migrate/latest:Project\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func APIProjectIntegrationCreate(er *Errorly) http.HandlerFunc {\n\treturn func(rw http.ResponseWriter, r *http.Request) {\n\t\tsession, _ := er.Store.Get(r, sessionName)\n\t\tdefer er.SaveSession(session, r, rw)\n\n\t\tvars := mux.Vars(r)\n\n\t\t// Authenticate the user\n\t\tauth, user := er.AuthenticateSession(session)\n\t\tif !auth {\n\t\t\tpassResponse(rw, \"You must be logged in to do this\", false, http.StatusForbidden)\n\n\t\t\treturn\n\t\t}\n\n\t\tproject, viewable, elevated, ok := verifyProjectVisibility(er, rw, vars, user, auth, true)\n\t\tif !ok {\n\t\t\t// If ok is False, an error has already been provided to the ResponseWriter so we should just return\n\t\t\treturn\n\t\t}\n\n\t\tif !viewable {\n\t\t\t// No permission to view project. We will treat like the project\n\t\t\t// does not exist.\n\t\t\tpassResponse(rw, \"Could not find this project\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tif !elevated {\n\t\t\t// No permission to execute on project. We will simply tell them\n\t\t\t// they cannot do this.\n\t\t\tpassResponse(rw, \"Guests to a project cannot do this\", false, http.StatusForbidden)\n\n\t\t\treturn\n\t\t}\n\n\t\tintegrationName := r.FormValue(\"display_name\")\n\t\tif len(integrationName) < 3 {\n\t\t\tpassResponse(rw, \"Invalid name was passed\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tintegration := &structs.User{\n\t\t\tID: er.IDGen.GenerateID(),\n\t\t\tName: integrationName,\n\n\t\t\tUserType: structs.IntegrationUser,\n\n\t\t\tCreatedAt: time.Now().UTC(),\n\n\t\t\tProjectID: project.ID,\n\t\t\tCreatedByID: user.ID,\n\t\t\tIntegration: true,\n\t\t}\n\n\t\t_, rand := CreateUserToken(integration)\n\t\tintegration.Token = rand\n\n\t\t_, err := er.Postgres.Model(integration).\n\t\t\tInsert()\n\t\tif err != nil {\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\t\t}\n\n\t\tpassResponse(rw, integration, true, http.StatusOK)\n\t}\n}", "func newProject(projectName string) (p *project, err error) {\n\tmatches := reGithubProject.FindStringSubmatch(projectName)\n\tif len(matches) < 2 {\n\t\terr = fmt.Errorf(\"bad project name: %s\", projectName)\n\t\treturn\n\t}\n\n\tp = &project{\n\t\towner: matches[1],\n\t\trepo: matches[2],\n\t\tpath: matches[4],\n\t\tref: matches[6],\n\t}\n\n\t// Add \"/\" suffix to path.\n\tif len(p.path) > 0 && p.path[len(p.path)-1] != '/' {\n\t\tp.path = p.path + \"/\"\n\t}\n\n\t// If ref is Semver, add 'tags/' prefix to make it a valid ref.\n\tif reSemver.MatchString(p.ref) {\n\t\tp.ref = \"tags/\" + p.ref\n\t}\n\n\terr = verifyRef(p.ref)\n\treturn\n}", "func NewProject(path string, packageName string) Project {\n\n\tif absPath, err := filepath.Abs(path); err == nil {\n\t\tpath = absPath\n\t}\n\n\treturn Project{\n\t\tPath: path,\n\t\tpackageName: packageName,\n\t}\n\n}", "func (r *ResourceHandler) CreateProjectResources(project string, resources []*models.Resource) (string, error) {\n\tr.ensureHandlerIsSet()\n\treturn r.resourceHandler.CreateProjectResources(context.TODO(), project, resources, v2.ResourcesCreateProjectResourcesOptions{})\n}", "func (s *ProjectService) NewCreateProjectParams(displaytext string, name string) *CreateProjectParams {\n\tp := &CreateProjectParams{}\n\tp.p = make(map[string]interface{})\n\tp.p[\"displaytext\"] = displaytext\n\tp.p[\"name\"] = name\n\treturn p\n}", "func NewCreateProjectOK() *CreateProjectOK {\n\n\treturn &CreateProjectOK{}\n}", "func ExampleDeviceFarm_CreateProject_shared00() {\n\tsvc := devicefarm.New(session.New())\n\tinput := &devicefarm.CreateProjectInput{\n\t\tName: aws.String(\"MyProject\"),\n\t}\n\n\tresult, err := svc.CreateProject(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase devicefarm.ErrCodeArgumentException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeNotFoundException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeLimitExceededException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeServiceAccountException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeTagOperationException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeTagOperationException, aerr.Error())\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}", "func NewProject(id string, name string) *Project {\n\tthis := Project{}\n\tthis.Id = id\n\tthis.Name = name\n\treturn &this\n}", "func NewProject(ctx *pulumi.Context,\n\tname string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) {\n\tif args == nil {\n\t\targs = &ProjectArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Project\n\terr := ctx.RegisterResource(\"google-native:cloudresourcemanager/v3:Project\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewProjectFromPostForm(pf url.Values) (*Project, error) {\n\tp := NewProject()\n\tdecoder := schema.NewDecoder()\n\n\tif err := decoder.Decode(p, pf); err != nil {\n\t\tfmt.Println(err)\n\t\treturn nil, errors.New(\"Invalid project input. Form-data expected\")\n\t}\n\n\tif !p.IsValid() {\n\t\treturn nil, errors.New(\"Incomplete project data\")\n\t}\n\n\treturn p, nil\n}", "func Create(c *gin.Context) {\n\tvar (\n\t\tp environment\n\t)\n\tif err := c.ShouldBind(&p); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tresult, err := p.create()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Error occured while performing db query\")\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": \"Internal Server Error\"})\n\t} else {\n\t\tc.JSON(http.StatusCreated, gin.H{\"projectId\": result})\n\t}\n}", "func (context *Context) NewProject(name string, licenses Licenses) *Project {\n\tproject := &Project{PName: name, LicenseList: licenses, context: context.Cache, Deps: []string{}}\n\tcontext.Cache.Register(project)\n\treturn project\n}", "func NewProject(projectName string) *Project {\n\tif projectName == \"\" {\n\t\treturn nil\n\t}\n\n\tp := new(Project)\n\tp.name = projectName\n\n\t// 1. Find already created protect.\n\tp.absPath = findPackage(projectName)\n\n\t// 2. If there are no created project with this path, and user is in GOPATH,\n\t// then use GOPATH/src/projectName.\n\tif p.absPath == \"\" {\n\t\twd, err := os.Getwd()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tfor _, srcPath := range srcPaths {\n\t\t\tgoPath := filepath.Dir(srcPath)\n\t\t\tif filepathHasPrefix(wd, goPath) {\n\t\t\t\tp.absPath = filepath.Join(srcPath, projectName)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. If user is not in GOPATH, then use (first GOPATH)/src/projectName.\n\tif p.absPath == \"\" {\n\t\tp.absPath = filepath.Join(srcPaths[0], projectName)\n\t}\n\n\treturn p\n}", "func NewProject(name string, tempo int, steps int, tracks []*track.Track, triggers map[int][]*track.Track) *Project {\n\tp := &Project{\n\t\tName: name,\n\t\tTempo: tempo,\n\t\tSteps: steps,\n\t\tTracks: tracks,\n\t\tTriggers: triggers,\n\t}\n\n\treturn p\n}", "func NewProject(model store.ProjectModel) *ProjectHandler {\n\treturn &ProjectHandler{\n\t\tmodel: model,\n\t}\n}", "func (b Build) Create(c *gin.Context) {\n\tpost := models.PostBuild{}\n\tc.BindJSON(&post)\n\n\tif !sugar.ValidateRequest(c, post) {\n\t\treturn\n\t}\n\t// Ensure that the project exists, and the user has permissions for it\n\tproject := models.Project{}\n\terr := Project{}.Query(c).First(&project, \"projects.id = ?\", post.ProjectID).Error\n\tif err != nil {\n\t\tsugar.NotFoundOrError(c, err)\n\t\treturn\n\t}\n\n\tnewBuild := models.Build{Project: project, Message: post.Message, Token: uniuri.NewLen(64)}\n\tif err := db.Create(&newBuild).Error; err != nil {\n\t\tsugar.InternalError(c, err)\n\t\treturn\n\t}\n\tsugar.EnqueueEvent(b.Events, c, \"Posted Build\", project.UserID, map[string]interface{}{\"build_id\": newBuild.ID, \"project_name\": newBuild.Project.Name})\n\tsugar.SuccessResponse(c, 201, newBuild)\n}", "func createSnykProject(token, org, integrationID, owner, name, branch string) {\n\tclient, err := snyk.NewClient(snyk.WithToken(token))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tcb, err := client.OrganizationImportProject(context.TODO(), org, integrationID, snyk.GitHubImport(owner, name, branch, nil))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(cb)\n}" ]
[ "0.838281", "0.8108102", "0.8092922", "0.80711776", "0.7862171", "0.78485775", "0.7846764", "0.7839464", "0.7783809", "0.7779148", "0.7746391", "0.7695536", "0.7629132", "0.7626169", "0.7617919", "0.7612046", "0.76049435", "0.7562666", "0.75614625", "0.7513948", "0.74994123", "0.74779683", "0.7450593", "0.74400026", "0.7401466", "0.73996717", "0.73957986", "0.7360887", "0.7306045", "0.7276786", "0.72766364", "0.72676855", "0.72566235", "0.7227672", "0.7225538", "0.7204189", "0.7203285", "0.71131617", "0.70947385", "0.70848066", "0.70436704", "0.70274657", "0.70091105", "0.7004013", "0.6987657", "0.69765234", "0.694431", "0.6924008", "0.6922084", "0.6915586", "0.68932086", "0.6880767", "0.68783605", "0.68705773", "0.68661606", "0.68569076", "0.6845031", "0.68012863", "0.6743898", "0.67425203", "0.67080724", "0.66425455", "0.66296643", "0.6586484", "0.65758264", "0.6566449", "0.6532839", "0.6504531", "0.64694506", "0.6457825", "0.64169383", "0.6351678", "0.6343214", "0.6318082", "0.62650484", "0.62604946", "0.625859", "0.62488985", "0.6220113", "0.6204112", "0.6204112", "0.61985785", "0.6193868", "0.6192796", "0.6191974", "0.6174663", "0.6150243", "0.6143925", "0.6098389", "0.6097903", "0.6093435", "0.6070096", "0.6057447", "0.605348", "0.6002168", "0.60015136", "0.59766966", "0.59646523", "0.5964598", "0.5962352" ]
0.8574186
0
UpdateProject gets incoming data and updates project data.
UpdateProject получает входные данные и обновляет данные проекта.
func UpdateProject(w http.ResponseWriter, r *http.Request) { // Get Project ID. // Perform db stuff. // Return a response. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func UpdateProject(w http.ResponseWriter, r *http.Request) {\n\tvar p models.Project\n\n\tu := mw.GetUser(r.Context())\n\tif u == nil || !u.IsAdmin {\n\t\tw.WriteHeader(403)\n\t\tw.Write(apiError(\"you must be logged in as a system administrator to create a project\"))\n\t\treturn\n\t}\n\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&p)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tw.Write(apiError(\"invalid body\"))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\terr = Store.Projects().New(&p)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tw.Write(apiError(err.Error()))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tsendJSON(w, p)\n}", "func (h *Handler) UpdateProject(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\tvar project data.Project\n\n\tprojectID, _ := strconv.ParseUint(getUrlParams(r, \"id\"), 10, 64)\n\n\tif project, err = h.TodoGo.GetProjectByID(r.Context(), projectID); err != nil {\n\t\tresponse.Error(w, err)\n\t\treturn\n\t}\n\n\tif err = json.NewDecoder(r.Body).Decode(&project); err != nil {\n\t\tresponse.Error(w, err)\n\t\treturn\n\t}\n\n\tif project, err = h.TodoGo.UpdateProject(r.Context(), projectID, project); err != nil {\n\t\tresponse.Error(w, err)\n\t\treturn\n\t}\n\n\tresponse.Success(200, w, project)\n}", "func ProjectUpdate(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\tprojectUUID := gorillaContext.Get(r, \"auth_project_uuid\").(string)\n\t// Read POST JSON body\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\terr := APIErrorInvalidRequestBody()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Parse pull options\n\tpostBody, err := projects.GetFromJSON(body)\n\tif err != nil {\n\t\terr := APIErrorInvalidRequestBody()\n\t\trespondErr(w, err)\n\t\tlog.Error(string(body[:]))\n\t\treturn\n\t}\n\n\tmodified := time.Now().UTC()\n\t// Get Result Object\n\n\tres, err := projects.UpdateProject(projectUUID, postBody.Name, postBody.Description, modified, refStr)\n\n\tif err != nil {\n\t\tif err.Error() == \"not found\" {\n\t\t\terr := APIErrorNotFound(\"ProjectUUID\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif strings.HasPrefix(err.Error(), \"invalid\") {\n\t\t\terr := APIErrorInvalidData(err.Error())\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Output result to JSON\n\tresJSON, err := res.ExportJSON()\n\tif err != nil {\n\t\terr := APIErrExportJSON()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n\n}", "func UpdateProject(p *pm.Project) error {\n\tbcsCCConf := config.GlobalConf.BCSCC\n\tif !bcsCCConf.Enable {\n\t\treturn nil\n\t}\n\trealPath := fmt.Sprintf(updateProjectPath, p.ProjectID)\n\treqURL := fmt.Sprintf(\"%s%s\", bcsCCConf.Host, realPath)\n\tdata := constructProjectData(p)\n\treq := gorequest.SuperAgent{\n\t\tUrl: reqURL,\n\t\tMethod: \"PUT\",\n\t\tData: data,\n\t}\n\treq.QueryData = url.Values{}\n\tif bcsCCConf.UseGateway {\n\t\tdata[\"app_code\"] = config.GlobalConf.App.Code\n\t\tdata[\"app_secret\"] = config.GlobalConf.App.Secret\n\t} else {\n\t\taccessToken, err := GetAccessToken()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treq.QueryData.Add(\"access_token\", accessToken)\n\t}\n\treturn requestCommonAndParse(req)\n}", "func UpdateProject(projectID, name, paymentID string) error {\n\tclient, err := NewPacketClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq := packngo.ProjectUpdateRequest{\n\t\tName: &name,\n\t\tPaymentMethodID: &paymentID,\n\t}\n\n\tp, _, err := client.Projects.Update(projectID, &req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\te := MarshallAndPrint(p)\n\treturn e\n}", "func ProjectUpdate(c *gin.Context) error {\n\tform := new(projectForm)\n\n\tif err := common.BindForm(c, form); err != nil {\n\t\treturn err\n\t}\n\n\tproject, err := GetProject(c)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := CheckUserPermission(c, project.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif form.MainScreen != nil {\n\t\tproject.MainScreen = *form.MainScreen\n\t}\n\n\tif err := saveProject(form, project); err != nil {\n\t\treturn err\n\t}\n\n\tif form.Elements != nil {\n\t\toption := &model.ElementQueryOption{\n\t\t\tProjectID: &project.ID,\n\t\t}\n\n\t\tif err := model.UpdateElementOrder(option, *form.Elements); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn common.APIResponse(c, http.StatusOK, project)\n}", "func (s *StubTodoStore) UpdateProject(project model.Project) error {\n\ts.Projects[project.Name] = project.Archived\n\treturn nil\n}", "func (p *ProjectHandler) UpdateProject(ctx context.Context,\n\treq *proto.UpdateProjectRequest, resp *proto.ProjectResponse) error {\n\tua := project.NewUpdateAction(p.model)\n\tprojectInfo, e := ua.Do(ctx, req)\n\tif e != nil {\n\t\treturn e\n\t}\n\t// 处理返回数据及权限\n\tsetResp(resp, projectInfo)\n\treturn nil\n}", "func (a *App) UpdateProject(w http.ResponseWriter, req *http.Request) {\n\n\tdb := context.Get(req, \"db\").(*mgo.Database)\n\tif db == nil {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Unable to connect to database\"})\n\t\treturn\n\t}\n\tvars := mux.Vars(req)\n\tpid, ok := vars[\"pid\"]\n\tif !ok {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Missing of invalid project id\"})\n\t\treturn\n\t}\n\n\tbody, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Unable to read request body\"})\n\t\treturn\n\t}\n\tvar doc lair.Project\n\tif err := json.Unmarshal(body, &doc); err != nil {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: err.Error()})\n\t\treturn\n\t}\n\n\tforcePorts := false\n\t// Read 'force-ports' URL parameter\n\tforcePortsStr := req.FormValue(\"force-ports\")\n\tif forcePortsStr == \"true\" {\n\t\tforcePorts = true\n\t}\n\n\tlimitHosts := false\n\t// Read 'all-hosts' URL parameter\n\tlimitHostsStr := req.FormValue(\"limit-hosts\")\n\tif limitHostsStr == \"true\" {\n\t\tlimitHosts = true\n\t}\n\n\t// Start of import\n\n\t// Validate versions\n\tvar v lair.Version\n\tif err := db.C(a.C.Versions).Find(nil).One(&v); err != nil || v.Value != a.Version {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Incompatible versions\"})\n\t\treturn\n\t}\n\n\tdoc.ID = pid\n\t// Validate required fields\n\tif doc.ID == \"\" || doc.Commands == nil || len(doc.Commands) <= 0 || doc.Tool == \"\" {\n\t\ta.R.JSON(w, http.StatusBadRequest, &Response{Status: \"Error\", Message: \"Missing required field or invalid format\"})\n\t\treturn\n\t}\n\n\t// Lookup project\n\tvar project lair.Project\n\tif err := db.C(a.C.Projects).FindId(doc.ID).One(&project); err != nil {\n\t\ta.R.JSON(w, http.StatusNotFound, &Response{Status: \"Error\", Message: \"Invalid project id\"})\n\t\treturn\n\t}\n\n\tfor _, transform := range a.Transforms {\n\t\ttransform.Update(&doc)\n\t}\n\n\t// Append new commands\n\tproject.Commands = append(project.Commands, doc.Commands...)\n\n\t// Append new notes\n\tproject.Notes = removeDuplicateNotes(append(project.Notes, doc.Notes...))\n\n\t// Add owner if necessary\n\tif project.Owner == \"\" {\n\t\tproject.Owner = doc.Owner\n\t}\n\n\t// Add industry if necessary\n\tif project.Industry == \"\" {\n\t\tproject.Industry = doc.Industry\n\t}\n\n\t// Add creation date if necessary\n\tif project.CreatedAt == \"\" {\n\t\tproject.CreatedAt = doc.CreatedAt\n\t}\n\n\t// Add description if necessary\n\tif project.Description == \"\" {\n\t\tproject.Description = doc.Description\n\t}\n\n\t// Used for tracking any hosts that were skipped for exceeding MAXPORTS limit\n\tskippedHosts := map[string]bool{}\n\n\t// Insert auth interfaces\n\tfor _, docAI := range doc.AuthInterfaces {\n\t\tai := &lair.AuthInterface{\n\t\t\tID: bson.NewObjectId().Hex(),\n\t\t\tProjectID: pid,\n\t\t\tIsMultifactor: docAI.IsMultifactor,\n\t\t\tKind: docAI.Kind,\n\t\t\tURL: docAI.URL,\n\t\t\tDescription: docAI.Description,\n\t\t}\n\t\tdb.C(a.C.AuthInterfaces).Insert(ai)\n\t}\n\n\t// Insert credentials\n\tfor _, docCred := range doc.Credentials {\n\t\tm := bson.M{\n\t\t\t\"projectId\": pid,\n\t\t\t\"username\": docCred.Username,\n\t\t\t\"hash\": docCred.Hash,\n\t\t}\n\t\t// Determine if the credential is already in database\n\t\tcred := &lair.Credential{}\n\t\tif err := db.C(a.C.Credentials).Find(m).One(&cred); err != nil {\n\t\t\tcred.ID = bson.NewObjectId().Hex()\n\t\t\tcred.ProjectID = pid\n\t\t\tcred.Username = docCred.Username\n\t\t\tcred.Password = docCred.Password\n\t\t\tcred.Format = docCred.Format\n\t\t\tcred.Hash = docCred.Hash\n\t\t\tcred.Host = docCred.Host\n\t\t\tcred.Service = docCred.Service\n\t\t} else {\n\t\t\tcred.Password = docCred.Password\n\t\t\tcred.Format = docCred.Format\n\t\t\tcred.Host = docCred.Host\n\t\t}\n\n\t\t// Upsert changes\n\t\tdb.C(a.C.Credentials).UpsertId(cred.ID, cred)\n\t}\n\n\t// Insert People\n\tfor _, docPerson := range doc.People {\n\t\tperson := &lair.Person{\n\t\t\tID: bson.NewObjectId().Hex(),\n\t\t\tProjectID: pid,\n\t\t\tPrincipalName: docPerson.PrincipalName,\n\t\t\tSAMAccountName: docPerson.SAMAccountName,\n\t\t\tDistinguishedName: docPerson.DistinguishedName,\n\t\t\tFirstName: docPerson.FirstName,\n\t\t\tMiddleName: docPerson.MiddleName,\n\t\t\tLastName: docPerson.LastName,\n\t\t\tDisplayName: docPerson.DisplayName,\n\t\t\tDepartment: docPerson.Department,\n\t\t\tDescription: docPerson.Description,\n\t\t\tAddress: docPerson.Address,\n\t\t\tEmails: docPerson.Emails,\n\t\t\tPhones: docPerson.Phones,\n\t\t\tReferences: docPerson.References,\n\t\t\tGroups: docPerson.Groups,\n\t\t\tLastLogon: docPerson.LastLogon,\n\t\t\tLastLogoff: docPerson.LastLogoff,\n\t\t\tLoggedIn: docPerson.LoggedIn,\n\t\t}\n\t\tdb.C(a.C.People).Insert(person)\n\t}\n\n\t// Insert netblocks\n\tfor _, docNetblock := range doc.Netblocks {\n\t\tnetblock := &lair.Netblock{}\n\t\tknownNetblock := true\n\t\t// Determine if the netblock is already in database\n\t\tm := bson.M{\"projectId\": pid, \"cidr\": docNetblock.CIDR}\n\t\tif err := db.C(a.C.Netblocks).Find(m).One(&netblock); err != nil {\n\t\t\tknownNetblock = false\n\t\t}\n\n\t\t// Used for checking if the netblock has changed during import\n\t\tdata := []byte(fmt.Sprintf(\"%+v\", netblock))\n\t\tpreMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\tnetblock.ProjectID = pid\n\t\tnetblock.CIDR = docNetblock.CIDR\n\n\t\tif netblock.ASN == \"\" {\n\t\t\tnetblock.ASN = docNetblock.ASN\n\t\t}\n\n\t\tif netblock.ASNCountryCode == \"\" {\n\t\t\tnetblock.ASNCountryCode = docNetblock.ASNCountryCode\n\t\t}\n\n\t\tif netblock.ASNCIDR == \"\" {\n\t\t\tnetblock.ASNCIDR = docNetblock.ASNCIDR\n\t\t}\n\n\t\tif netblock.ASNDate == \"\" {\n\t\t\tnetblock.ASNDate = docNetblock.ASNDate\n\t\t}\n\n\t\tif netblock.ASNRegistry == \"\" {\n\t\t\tnetblock.ASNRegistry = docNetblock.ASNRegistry\n\t\t}\n\n\t\tif netblock.AbuseEmails == \"\" {\n\t\t\tnetblock.AbuseEmails = docNetblock.AbuseEmails\n\t\t}\n\n\t\tif netblock.MiscEmails == \"\" {\n\t\t\tnetblock.MiscEmails = docNetblock.MiscEmails\n\t\t}\n\n\t\tif netblock.TechEmails == \"\" {\n\t\t\tnetblock.TechEmails = docNetblock.TechEmails\n\t\t}\n\n\t\tif netblock.Name == \"\" {\n\t\t\tnetblock.Name = docNetblock.Name\n\t\t}\n\n\t\tif netblock.Address == \"\" {\n\t\t\tnetblock.Address = docNetblock.Address\n\t\t}\n\n\t\tif netblock.State == \"\" {\n\t\t\tnetblock.State = docNetblock.State\n\t\t}\n\n\t\tif netblock.City == \"\" {\n\t\t\tnetblock.City = docNetblock.City\n\t\t}\n\n\t\tif netblock.Country == \"\" {\n\t\t\tnetblock.Country = docNetblock.Country\n\t\t}\n\n\t\tif netblock.PostalCode == \"\" {\n\t\t\tnetblock.PostalCode = docNetblock.PostalCode\n\t\t}\n\n\t\tif netblock.Created == \"\" {\n\t\t\tnetblock.Created = docNetblock.Created\n\t\t}\n\n\t\tif netblock.Updated == \"\" {\n\t\t\tnetblock.Updated = docNetblock.Updated\n\t\t}\n\n\t\tif netblock.Description == \"\" {\n\t\t\tnetblock.Description = docNetblock.Description\n\t\t}\n\n\t\tif netblock.Handle == \"\" {\n\t\t\tnetblock.Handle = docNetblock.Handle\n\t\t}\n\n\t\tif !knownNetblock {\n\t\t\tmsg := fmt.Sprintf(\"%s - New netblock found: %s\", time.Now().String(), docNetblock.CIDR)\n\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t}\n\n\t\tdata = []byte(fmt.Sprintf(\"%+v\", netblock))\n\t\tpostMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t// Check if host was changed\n\t\tif preMD5 != postMD5 {\n\t\t\tif !knownNetblock {\n\t\t\t\tid := bson.NewObjectId().Hex()\n\t\t\t\tnetblock.ID = id\n\t\t\t}\n\n\t\t\t// Upsert changes\n\t\t\tdb.C(a.C.Netblocks).UpsertId(netblock.ID, netblock)\n\t\t}\n\t}\n\n\t// Process the hosts\n\tfor _, docHost := range doc.Hosts {\n\t\tif len(docHost.Services) > MAXPORTS && !forcePorts {\n\t\t\t// Host exceeds max number of allowable ports. Skip it.\n\t\t\tskippedHosts[docHost.IPv4] = true\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%s - Host skipped. Exceeded maximum number of ports: %s\",\n\t\t\t\ttime.Now().String(),\n\t\t\t\tdocHost.IPv4,\n\t\t\t)\n\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(docHost.Services) <= 0 && limitHosts {\n\t\t\t// Host has no open ports and client opted to ignore these hosts. Skit it.\n\t\t\tskippedHosts[docHost.IPv4] = true\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%s - Host skipped. No open ports: %s\",\n\t\t\t\ttime.Now().String(),\n\t\t\t\tdocHost.IPv4,\n\t\t\t)\n\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !validIPAddress.MatchString(docHost.IPv4) {\n\t\t\tskippedHosts[docHost.IPv4] = true\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%s - Host skipped. Invalid IP address format: %s\",\n\t\t\t\ttime.Now().String(),\n\t\t\t\tdocHost.IPv4,\n\t\t\t)\n\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t\tcontinue\n\t\t}\n\t\thost := &lair.Host{}\n\t\tknownHost := true\n\t\t// Determine if the host is already in database\n\t\tm := bson.M{\"projectId\": pid, \"ipv4\": docHost.IPv4}\n\t\tif err := db.C(a.C.Hosts).Find(m).One(&host); err != nil {\n\t\t\tknownHost = false\n\t\t}\n\n\t\t// Used for checking if the host values changed during import\n\t\tdata := []byte(fmt.Sprintf(\"%+v\", host))\n\t\tpreMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t// Initialize basic host info\n\t\thost.ProjectID = pid\n\t\thost.IPv4 = docHost.IPv4\n\t\thost.LongIPv4Addr = ip.IpToInt(net.ParseIP(host.IPv4))\n\n\t\tif host.MAC == \"\" {\n\t\t\tif len(docHost.MAC) > 200 {\n\t\t\t\t// Don't let string of MACs exceed 200 chars in length\n\t\t\t\tdocHost.MAC = docHost.MAC[:200]\n\t\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\t\"%s - MAC data cropped. Excessive MAC address values: %s\",\n\t\t\t\t\ttime.Now().String(),\n\t\t\t\t\tdocHost.IPv4,\n\t\t\t\t)\n\t\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t\t}\n\t\t\thost.MAC = docHost.MAC\n\t\t}\n\n\t\t// Append all host notes\n\t\thost.Notes = removeDuplicateNotes(append(host.Notes, docHost.Notes...))\n\t\t// Append all tags\n\t\thost.Tags = removeDuplicates(append(host.Tags, docHost.Tags...))\n\n\t\t// Add any new files\n\t\tfor idx, docFile := range docHost.Files {\n\t\t\tknownFile := false\n\t\t\tfor k, f := range host.Files {\n\t\t\t\tif docFile.FileName == f.FileName {\n\t\t\t\t\t// File exists, update URL\n\t\t\t\t\tknownFile = true\n\t\t\t\t\thost.Files[k].URL = docFile.URL\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !knownFile {\n\t\t\t\thost.Files = append(host.Files, docHost.Files[idx])\n\t\t\t}\n\t\t}\n\n\t\t// Add any new hostnames\n\t\tfor _, docHostname := range docHost.Hostnames {\n\t\t\tfound := false\n\t\t\tfor _, dbHostname := range host.Hostnames {\n\t\t\t\tif dbHostname == docHostname {\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\thost.Hostnames = removeDuplicates(append(host.Hostnames, docHostname))\n\t\t\t\thost.LastModifiedBy = doc.Tool\n\t\t\t}\n\t\t}\n\n\t\t// Add any new OS\n\t\tif host.OS.Weight < docHost.OS.Weight {\n\t\t\thost.OS = docHost.OS\n\t\t\thost.LastModifiedBy = doc.Tool\n\t\t}\n\n\t\tdata = []byte(fmt.Sprintf(\"%+v\", host))\n\t\tpostMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t// Check if host was changed\n\t\tif preMD5 != postMD5 {\n\t\t\thost.LastModifiedBy = doc.Tool\n\t\t\tif !knownHost {\n\t\t\t\tid := bson.NewObjectId().Hex()\n\t\t\t\thost.ID = id\n\t\t\t\thost.Status = docHost.Status\n\t\t\t\tif !a.IsValidStatus(docHost.Status) {\n\t\t\t\t\thost.Status = lair.StatusGrey\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Upsert changes\n\t\t\tdb.C(a.C.Hosts).UpsertId(host.ID, host)\n\n\t\t}\n\n\t\tif !knownHost {\n\t\t\tmsg := fmt.Sprintf(\"%s - New host found: %s\", time.Now().String(), docHost.IPv4)\n\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t}\n\n\t\t// Process web directories\n\t\tfor _, docDir := range docHost.WebDirectories {\n\t\t\tm := bson.M{\n\t\t\t\t\"projectId\": pid,\n\t\t\t\t\"hostId\": host.ID,\n\t\t\t\t\"path\": docDir.Path,\n\t\t\t\t\"port\": docDir.Port,\n\t\t\t}\n\t\t\t// Determine if the web directory is already in database\n\t\t\twebDir := &lair.WebDirectory{}\n\t\t\tif err := db.C(a.C.WebDirectories).Find(m).One(&webDir); err != nil {\n\t\t\t\t// Web directory doesn't exist, create a new one\n\t\t\t\twebDir.ID = bson.NewObjectId().Hex()\n\t\t\t\twebDir.ProjectID = pid\n\t\t\t\twebDir.HostID = host.ID\n\t\t\t\twebDir.Path = docDir.Path\n\t\t\t\twebDir.Port = docDir.Port\n\t\t\t\twebDir.ResponseCode = docDir.ResponseCode\n\t\t\t\twebDir.LastModifiedBy = docDir.LastModifiedBy\n\t\t\t\twebDir.IsFlagged = docDir.IsFlagged\n\t\t\t} else {\n\t\t\t\t// Web directory exists in database, update relevant fields\n\t\t\t\twebDir.ResponseCode = docDir.ResponseCode\n\t\t\t\twebDir.LastModifiedBy = docDir.LastModifiedBy\n\t\t\t\twebDir.IsFlagged = docDir.IsFlagged\n\t\t\t}\n\n\t\t\t// Upsert changes\n\t\t\tdb.C(a.C.WebDirectories).UpsertId(webDir.ID, webDir)\n\t\t}\n\n\t\tfor _, docService := range docHost.Services {\n\n\t\t\tm := bson.M{\n\t\t\t\t\"projectId\": pid,\n\t\t\t\t\"hostId\": host.ID,\n\t\t\t\t\"port\": docService.Port,\n\t\t\t\t\"protocol\": docService.Protocol,\n\t\t\t}\n\t\t\t// Determine if the host is already in database\n\t\t\tservice := &lair.Service{}\n\t\t\tknownPort := true\n\t\t\tif err := db.C(a.C.Services).Find(m).One(&service); err != nil {\n\t\t\t\tknownPort = false\n\t\t\t}\n\n\t\t\t// Used for tracking if changes were made to service\n\t\t\tdata = []byte(fmt.Sprintf(\"%+v\", service))\n\t\t\tpreMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t\tservice.HostID = host.ID\n\t\t\tservice.ProjectID = pid\n\t\t\tservice.Protocol = docService.Protocol\n\t\t\tservice.Port = docService.Port\n\n\t\t\tif service.Product == \"\" || strings.ToLower(service.Product) == \"unknown\" {\n\t\t\t\tservice.Product = docService.Product\n\t\t\t}\n\n\t\t\tif service.Service == \"\" || strings.ToLower(service.Service) == \"unknown\" || strings.Contains(service.Service, \"?\") {\n\t\t\t\tservice.Service = docService.Service\n\t\t\t}\n\n\t\t\t// Append all service notes\n\t\t\tservice.Notes = removeDuplicateNotes(append(service.Notes, docService.Notes...))\n\n\t\t\t// Add any new files\n\t\t\tfor idx, docFile := range docService.Files {\n\t\t\t\tknownFile := false\n\t\t\t\tfor k, f := range service.Files {\n\t\t\t\t\tif docFile.FileName == f.FileName {\n\t\t\t\t\t\t// File exists, update URL\n\t\t\t\t\t\tknownFile = true\n\t\t\t\t\t\tservice.Files[k].URL = docFile.URL\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !knownFile {\n\t\t\t\t\tservice.Files = append(service.Files, docService.Files[idx])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !knownPort {\n\t\t\t\tid := bson.NewObjectId().Hex()\n\t\t\t\tservice.ID = id\n\t\t\t\tservice.Status = docService.Status\n\t\t\t\tif !a.IsValidStatus(service.Status) {\n\t\t\t\t\tservice.Status = lair.StatusGrey\n\t\t\t\t}\n\t\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\t\"%s - New service found: %d/%s (%s)\",\n\t\t\t\t\ttime.Now().String(),\n\t\t\t\t\tdocService.Port,\n\t\t\t\t\tdocService.Protocol,\n\t\t\t\t\tdocService.Service,\n\t\t\t\t)\n\t\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t\t}\n\n\t\t\t// Used for tracking if changes were made to service\n\t\t\tdata = []byte(fmt.Sprintf(\"%+v\", service))\n\t\t\tpostMD5 = fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t\t// Upsert any changes\n\t\t\tif preMD5 != postMD5 {\n\t\t\t\tservice.LastModifiedBy = doc.Tool\n\t\t\t\tdb.C(a.C.Services).UpsertId(service.ID, service)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, docIssue := range doc.Issues {\n\t\tpluginM := bson.M{\n\t\t\t\"$all\": docIssue.PluginIDs,\n\t\t}\n\t\tm := bson.M{\n\t\t\t\"projectId\": pid,\n\t\t\t\"pluginIds\": pluginM,\n\t\t}\n\t\tissue := &lair.Issue{}\n\t\tknownIssue := true\n\t\tif err := db.C(a.C.Issues).Find(m).One(&issue); err != nil {\n\t\t\tknownIssue = false\n\t\t}\n\n\t\tif !knownIssue {\n\t\t\thostList := []lair.IssueHost{}\n\t\t\t// Build a list of hosts NOT marked as 'skipped' meaning they didn't exceed\n\t\t\t// port count limit.\n\t\t\tfor idx, host := range docIssue.Hosts {\n\t\t\t\tif _, skipped := skippedHosts[host.IPv4]; !skipped {\n\t\t\t\t\thostList = append(hostList, docIssue.Hosts[idx])\n\t\t\t\t}\n\t\t\t}\n\t\t\tid := bson.NewObjectId().Hex()\n\t\t\tissue.ID = id\n\t\t\tissue.ProjectID = pid\n\t\t\tissue.Title = docIssue.Title\n\t\t\tissue.Description = docIssue.Description\n\t\t\tissue.Solution = docIssue.Solution\n\t\t\tissue.Evidence = docIssue.Evidence\n\t\t\tissue.CVSS = docIssue.CVSS\n\t\t\tissue.Rating = calcRating(issue.CVSS)\n\t\t\tissue.IsConfirmed = docIssue.IsConfirmed\n\t\t\tissue.IsFlagged = docIssue.IsFlagged\n\t\t\tissue.LastModifiedBy = doc.Tool\n\t\t\tissue.IdentifiedBy = []lair.IdentifiedBy{lair.IdentifiedBy{Tool: doc.Tool}}\n\t\t\tissue.Status = docIssue.Status\n\t\t\tissue.Files = append(issue.Files, docIssue.Files...)\n\t\t\tif !a.IsValidStatus(issue.Status) {\n\t\t\t\tissue.Status = lair.StatusGrey\n\t\t\t}\n\t\t\tissue.PluginIDs = docIssue.PluginIDs\n\t\t\tissue.CVEs = docIssue.CVEs\n\t\t\tissue.Notes = docIssue.Notes\n\t\t\tissue.Hosts = hostList\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%s - New issue found: %s\",\n\t\t\t\ttime.Now().String(),\n\t\t\t\tdocIssue.Title,\n\t\t\t)\n\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\n\t\t\tif err := db.C(a.C.Issues).Insert(issue); err != nil {\n\t\t\t\tproject.DroneLog = append(project.DroneLog, fmt.Sprintf(\"Failed to import issue %s\", issue.Title))\n\t\t\t}\n\t\t}\n\n\t\tif knownIssue {\n\n\t\t\t// Used for tracking if changes were made to issue\n\t\t\tdata := []byte(fmt.Sprintf(\"%+v\", issue))\n\t\t\tpreMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t\tissue.Title = docIssue.Title\n\t\t\tissue.Description = docIssue.Description\n\t\t\tissue.Solution = docIssue.Solution\n\t\t\tif issue.Evidence != docIssue.Evidence {\n\t\t\t\tissue.Evidence = issue.Evidence + \"\\n\\n\" + docIssue.Evidence\n\t\t\t}\n\n\t\t\t// Add any new CVEs\n\t\t\tfor _, docCVE := range docIssue.CVEs {\n\t\t\t\tfound := false\n\t\t\t\tfor _, dbCVE := range issue.CVEs {\n\t\t\t\t\tif dbCVE == docCVE {\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\tissue.CVEs = removeDuplicates(append(issue.CVEs, docCVE))\n\t\t\t\t\tissue.LastModifiedBy = doc.Tool\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add any new files\n\t\t\tfor idx, docFile := range docIssue.Files {\n\t\t\t\tknownFile := false\n\t\t\t\tfor k, f := range issue.Files {\n\t\t\t\t\tif docFile.FileName == f.FileName {\n\t\t\t\t\t\t// File exists, update URL\n\t\t\t\t\t\tknownFile = true\n\t\t\t\t\t\tissue.Files[k].URL = docFile.URL\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !knownFile {\n\t\t\t\t\tissue.Files = append(issue.Files, docIssue.Files[idx])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add any new hosts\n\t\t\tfor _, hk := range docIssue.Hosts {\n\t\t\t\tif _, skipped := skippedHosts[hk.IPv4]; skipped {\n\t\t\t\t\t// Host is marked as skipped, meaning it exceeded port limit. Do not process it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfound := false\n\t\t\t\tfor _, dbHk := range issue.Hosts {\n\t\t\t\t\tif dbHk.IPv4 == hk.IPv4 && dbHk.Port == hk.Port && dbHk.Protocol == hk.Protocol {\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\tissue.Hosts = append(issue.Hosts, hk)\n\t\t\t\t\tissue.LastModifiedBy = doc.Tool\n\t\t\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\t\t\"%s - %s:%d/%s - New issue found: %s\",\n\t\t\t\t\t\ttime.Now().String(),\n\t\t\t\t\t\thk.IPv4,\n\t\t\t\t\t\thk.Port,\n\t\t\t\t\t\thk.Protocol,\n\t\t\t\t\t\tdocIssue.Title,\n\t\t\t\t\t)\n\t\t\t\t\tproject.DroneLog = append(project.DroneLog, msg)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add any new plugins\n\t\t\tfor _, docPlugin := range docIssue.PluginIDs {\n\t\t\t\tfound := false\n\t\t\t\tfor _, dbPlugin := range issue.PluginIDs {\n\t\t\t\t\tif dbPlugin.Tool == docPlugin.Tool && dbPlugin.ID == docPlugin.ID {\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\tissue.PluginIDs = append(issue.PluginIDs, docPlugin)\n\t\t\t\t\tissue.LastModifiedBy = doc.Tool\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Append notes\n\t\t\tissue.Notes = removeDuplicateNotes(append(issue.Notes, docIssue.Notes...))\n\n\t\t\t// Add any new 'Identified By' info\n\t\t\tfound := false\n\t\t\tfor _, idBy := range issue.IdentifiedBy {\n\t\t\t\tif idBy.Tool == doc.Tool {\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\tissue.IdentifiedBy = append(issue.IdentifiedBy, lair.IdentifiedBy{Tool: doc.Tool})\n\t\t\t\tissue.LastModifiedBy = doc.Tool\n\t\t\t}\n\n\t\t\t// Only set flag to 'true', don't unset it\n\t\t\tif docIssue.IsFlagged {\n\t\t\t\tissue.IsFlagged = true\n\t\t\t}\n\n\t\t\t// Only set confirmed to 'true', don't unset it\n\t\t\tif docIssue.IsConfirmed {\n\t\t\t\tissue.IsConfirmed = true\n\t\t\t}\n\n\t\t\t// Check if issue data was changed\n\t\t\tdata = []byte(fmt.Sprintf(\"%+v\", issue))\n\t\t\tpostMD5 := fmt.Sprintf(\"%x\", md5.Sum(data))\n\n\t\t\tif preMD5 != postMD5 {\n\t\t\t\t// Upsert changes\n\t\t\t\tissue.LastModifiedBy = doc.Tool\n\t\t\t\tdb.C(a.C.Issues).UpsertId(issue.ID, issue)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Ensure the correct drone log hisory size is maintained\n\tif len(project.DroneLog) > a.History {\n\t\tproject.DroneLog = project.DroneLog[len(project.DroneLog)-a.History:]\n\t}\n\n\t// Update project\n\tdb.C(a.C.Projects).UpdateId(project.ID, project)\n\n\t// End of import\n\ta.R.JSON(w, http.StatusOK, &Response{Status: \"Ok\"})\n}", "func UpdateProject(host string, verifyTLS bool, apiKey string, project string, name string, description ...string) (models.ProjectInfo, Error) {\n\tpostBody := map[string]string{\"name\": name}\n\tif len(description) > 0 {\n\t\tdesc := description[0]\n\t\tpostBody[\"description\"] = desc\n\t}\n\n\tbody, err := json.Marshal(postBody)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Invalid project info\"}\n\t}\n\n\tvar params []queryParam\n\tparams = append(params, queryParam{Key: \"project\", Value: project})\n\n\turl, err := generateURL(host, \"/v3/projects/project\", params)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Unable to generate url\"}\n\t}\n\n\tstatusCode, _, response, err := PostRequest(url, verifyTLS, apiKeyHeader(apiKey), body)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Unable to update project\", Code: statusCode}\n\t}\n\n\tvar result map[string]interface{}\n\terr = json.Unmarshal(response, &result)\n\tif err != nil {\n\t\treturn models.ProjectInfo{}, Error{Err: err, Message: \"Unable to parse API response\", Code: statusCode}\n\t}\n\n\tresultProject, ok := result[\"project\"].(map[string]interface{})\n\tif !ok {\n\t\treturn models.ProjectInfo{}, Error{Err: fmt.Errorf(\"Unexpected type for project, expected map[string]interface{}, got %T\", result[\"project\"]), Message: \"Unable to parse API response\", Code: statusCode}\n\t}\n\tprojectInfo := models.ParseProjectInfo(resultProject)\n\treturn projectInfo, Error{}\n}", "func UpdateProject(queryProject *model.Project, updatedFields *model.Project) (*model.Project, error) {\n\tif _, err := queryProject.FindById(); err != nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"project %d not found\", queryProject.ID))\n\t}\n\tif updatedFields.Path != \"\" {\n\t\tqueryProject.Path = updatedFields.Path\n\t}\n\tif updatedFields.Name != \"\" {\n\t\tqueryProject.Name = updatedFields.Name\n\t}\n\tif _, err := queryProject.Update(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn queryProject, nil\n}", "func (b *ProjectModels) UpdateProject(id int, data Project) error {\n\terr := configs.GetDB.Table(PROJECT).Where(\"id = ?\", id).Updates(&data).Error\n\treturn err\n}", "func (c *ClientImpl) UpdateProject(ctx context.Context, hcpHostURL, projectID string, input patch.JSONPatch) error {\n\tspan, _ := opentracing.StartSpanFromContext(ctx, \"Update HCP Project\")\n\tdefer span.Finish()\n\n\tsession, err := c.getSession(ctx, hcpHostURL, hcpUserName, hcpPassword)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstatus = Failure\n\tmonitor := metrics.StartExternalCall(externalSvcName, \"Update Project in HCP\")\n\tdefer func() { monitor.RecordWithStatus(status) }()\n\n\trequestBody, _ := json.Marshal(input)\n\t_, err = mlopsHttp.ExecuteHTTPRequest(\n\t\tctx,\n\t\tc.client,\n\t\thcpHostURL+projectPathV2+projectID,\n\t\thttp.MethodPatch,\n\t\tmap[string]string{sessionHeader: session},\n\t\tbytes.NewReader(requestBody),\n\t)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"while updating project in MLOps controller platform.\")\n\t}\n\n\tstatus = Success\n\n\terr = c.deleteSession(ctx, hcpHostURL, session)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (w *ServerInterfaceWrapper) UpdateProject(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"id\" -------------\n\tvar id string\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// HasSecurity is set\n\n\tctx.Set(\"OpenId.Scopes\", []string{\"exitus/project.write\"})\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.UpdateProject(ctx, id)\n\treturn err\n}", "func (c *ClusterTx) UpdateProject(name string, object api.ProjectPut) error {\n\tid, err := c.GetProjectID(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Fetch project ID: %w\", err)\n\t}\n\n\tstmt := c.stmt(projectUpdate)\n\tresult, err := stmt.Exec(object.Description, id)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Update project: %w\", err)\n\t}\n\n\tn, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Fetch affected rows: %w\", err)\n\t}\n\tif n != 1 {\n\t\treturn fmt.Errorf(\"Query updated %d rows instead of 1\", n)\n\t}\n\n\t// Clear config.\n\t_, err = c.tx.Exec(`\nDELETE FROM projects_config WHERE projects_config.project_id = ?\n`, id)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Delete project config: %w\", err)\n\t}\n\n\terr = c.UpdateConfig(\"project\", int(id), object.Config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Insert config for project: %w\", err)\n\t}\n\n\treturn nil\n}", "func UpdateProject(name string, id int) (*ProjectPrint, error) {\n\n\t_, err := DB.Query(\"UPDATE projects SET name = $1 WHERE id = $2\", name, id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trow, err := DB.Query(\"SELECT id,name,created_by FROM project WHERE id = $1\", id)\n\tcheckErr(err)\n\tvar u ProjectPrint\n\tfor row.Next() {\n\t\trow.Scan(&u.ID, &u.Name, &u.CreatedBy)\n\t}\n\tu.Issues = GetAllIssuesByID(u.ID)\n\tu.Owner = GetUserByID(u.CreatedBy)\n\treturn &u, nil\n}", "func UpdateProject(p Project) Project {\n\tDB.Save(&p)\n\treturn p\n}", "func (a *Client) UpdateProject(params *UpdateProjectParams) (*UpdateProjectOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewUpdateProjectParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"updateProject\",\n\t\tMethod: \"PUT\",\n\t\tPathPattern: \"/projects/{uuid}\",\n\t\tProducesMediaTypes: []string{\"application/release-manager.v1+json\"},\n\t\tConsumesMediaTypes: []string{\"application/release-manager.v1+json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &UpdateProjectReader{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\treturn result.(*UpdateProjectOK), nil\n\n}", "func updateProject(project *Project, uid int64) error {\n\tvar dummy string\n\n\t// update project information\n\tdb.QueryRow(\"UPDATE projects SET name=$1, clone_url=$2 WHERE gh_id=$3\",\n\t\tproject.Name, project.Clone_url, project.GH_Id).Scan(&dummy)\n\n\tif err := fillProject(project, uid); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func resourceAliyunDatahubProjectUpdate(d *schema.ResourceData, meta interface{}) error {\n\tdh := meta.(*AliyunClient).dhconn\n\n\td.Partial(true)\n\tif !d.IsNewResource() && d.HasChange(\"comment\") {\n\t\tprojectName := d.Id()\n\t\tprojectComment := d.Get(\"comment\").(string)\n\t\terr := dh.UpdateProject(projectName, projectComment)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to update project '%s' with error: %s\", projectName, err)\n\t\t}\n\t}\n\td.Partial(false)\n\treturn resourceAliyunDatahubProjectRead(d, meta)\n}", "func (g *projectGateway) UpdateProjectAction(params project.UpdateProjectParams) middleware.Responder {\n\trsp, err := g.projectClient.Update(context.TODO(), &proto.UpdateRequest{\n\t\tUuid: string(params.UUID),\n\t\tName: params.Body.Name,\n\t\tDescription: params.Body.Description,\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn project.NewCreateProjectInternalServerError()\n\t}\n\n\tif uint32(codes.OK) == rsp.Status {\n\t\tfmt.Println(fmt.Sprintf(\"project.client update: ok. Id = %v\", params.UUID))\n\t} else if uint32(codes.NotFound) == rsp.Status {\n\t\treturn project.NewUpdateProjectNotFound()\n\t} else {\n\t\tfmt.Println(fmt.Sprintf(\"project.client: update fail. Id = %v, status = %v\", params.UUID, rsp.Status))\n\t\treturn project.NewCreateProjectInternalServerError()\n\t}\n\n\treadRsp, err := g.projectClient.Read(context.TODO(), &proto.ReadRequest{\n\t\tUuid: string(params.UUID),\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn project.NewCreateProjectInternalServerError()\n\t}\n\n\tpr := &models.Project{\n\t\tUUID: strfmt.UUID(readRsp.Project.Uuid),\n\t\tName: readRsp.Project.Name,\n\t\tDescription: readRsp.Project.Description,\n\t}\n\n\treturn project.NewUpdateProjectOK().WithPayload(pr)\n}", "func (s *Server) Update(ctx context.Context, q *project.ProjectUpdateRequest) (*v1alpha1.AppProject, error) {\n\tif q.Project == nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"missing payload 'project' in request\")\n\t}\n\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceProjects, rbacpolicy.ActionUpdate, q.Project.Name); err != nil {\n\t\treturn nil, err\n\t}\n\tq.Project.NormalizePolicies()\n\tq.Project.NormalizeJWTTokens()\n\terr := validateProject(q.Project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts.projectLock.Lock(q.Project.Name)\n\tdefer s.projectLock.Unlock(q.Project.Name)\n\n\toldProj, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Get(ctx, q.Project.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, cluster := range difference(q.Project.Spec.DestinationClusters(), oldProj.Spec.DestinationClusters()) {\n\t\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceClusters, rbacpolicy.ActionUpdate, cluster); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tfor _, repoUrl := range difference(q.Project.Spec.SourceRepos, oldProj.Spec.SourceRepos) {\n\t\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceRepositories, rbacpolicy.ActionUpdate, repoUrl); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tclusterResourceWhitelistsEqual := reflect.DeepEqual(q.Project.Spec.ClusterResourceWhitelist, oldProj.Spec.ClusterResourceWhitelist)\n\tclusterResourceBlacklistsEqual := reflect.DeepEqual(q.Project.Spec.ClusterResourceBlacklist, oldProj.Spec.ClusterResourceBlacklist)\n\tnamespacesResourceBlacklistsEqual := reflect.DeepEqual(q.Project.Spec.NamespaceResourceBlacklist, oldProj.Spec.NamespaceResourceBlacklist)\n\tnamespacesResourceWhitelistsEqual := reflect.DeepEqual(q.Project.Spec.NamespaceResourceWhitelist, oldProj.Spec.NamespaceResourceWhitelist)\n\tif !clusterResourceWhitelistsEqual || !clusterResourceBlacklistsEqual || !namespacesResourceBlacklistsEqual || !namespacesResourceWhitelistsEqual {\n\t\tfor _, cluster := range q.Project.Spec.DestinationClusters() {\n\t\t\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceClusters, rbacpolicy.ActionUpdate, cluster); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\tappsList, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar srcValidatedApps []v1alpha1.Application\n\tvar dstValidatedApps []v1alpha1.Application\n\tgetProjectClusters := func(project string) ([]*v1alpha1.Cluster, error) {\n\t\treturn s.db.GetProjectClusters(ctx, project)\n\t}\n\n\tfor _, a := range argo.FilterByProjects(appsList.Items, []string{q.Project.Name}) {\n\t\tif oldProj.IsSourcePermitted(a.Spec.GetSource()) {\n\t\t\tsrcValidatedApps = append(srcValidatedApps, a)\n\t\t}\n\n\t\tdstPermitted, err := oldProj.IsDestinationPermitted(a.Spec.Destination, getProjectClusters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif dstPermitted {\n\t\t\tdstValidatedApps = append(dstValidatedApps, a)\n\t\t}\n\t}\n\n\tinvalidSrcCount := 0\n\tinvalidDstCount := 0\n\n\tfor _, a := range srcValidatedApps {\n\t\tif !q.Project.IsSourcePermitted(a.Spec.GetSource()) {\n\t\t\tinvalidSrcCount++\n\t\t}\n\t}\n\tfor _, a := range dstValidatedApps {\n\t\tdstPermitted, err := q.Project.IsDestinationPermitted(a.Spec.Destination, getProjectClusters)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif !dstPermitted {\n\t\t\tinvalidDstCount++\n\t\t}\n\t}\n\n\tvar parts []string\n\tif invalidSrcCount > 0 {\n\t\tparts = append(parts, fmt.Sprintf(\"%d applications source became invalid\", invalidSrcCount))\n\t}\n\tif invalidDstCount > 0 {\n\t\tparts = append(parts, fmt.Sprintf(\"%d applications destination became invalid\", invalidDstCount))\n\t}\n\tif len(parts) > 0 {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"as a result of project update %s\", strings.Join(parts, \" and \"))\n\t}\n\n\tres, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Update(ctx, q.Project, metav1.UpdateOptions{})\n\tif err == nil {\n\t\ts.logEvent(res, ctx, argo.EventReasonResourceUpdated, \"updated project\")\n\t}\n\treturn res, err\n}", "func UpdateProject(ctx context.Context, project string, notify NotifyCallback) error {\n\tneed, existingPC, err := needsUpdate(ctx, project)\n\tswitch {\n\tcase err != nil:\n\t\treturn err\n\tcase !need:\n\t\treturn nil\n\t}\n\n\tcfg, meta, err := fetchCfg(ctx, project)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvctx := &lucivalidation.Context{Context: ctx}\n\tif err := validation.ValidateProject(vctx, cfg, project); err != nil {\n\t\treturn errors.Annotate(err, \"ValidateProject\").Err()\n\t}\n\tif verr := vctx.Finalize(); verr != nil {\n\t\tlogging.Errorf(ctx, \"UpdateProject %q on invalid config: %s\", project, verr)\n\t}\n\n\t// Write out ConfigHashInfo if missing and all ConfigGroups.\n\tlocalHash := prjcfg.ComputeHash(cfg)\n\tcgNames := make([]string, len(cfg.GetConfigGroups()))\n\tfor i, cg := range cfg.GetConfigGroups() {\n\t\tcgNames[i] = cg.GetName()\n\t}\n\ttargetEVersion := existingPC.EVersion + 1\n\n\terr = datastore.RunInTransaction(ctx, func(ctx context.Context) error {\n\t\thashInfo := prjcfg.ConfigHashInfo{\n\t\t\tHash: localHash,\n\t\t\tProject: prjcfg.ProjectConfigKey(ctx, project),\n\t\t}\n\t\tswitch err := datastore.Get(ctx, &hashInfo); {\n\t\tcase err != nil && err != datastore.ErrNoSuchEntity:\n\t\t\treturn errors.Annotate(err, \"failed to get ConfigHashInfo(Hash=%q)\", localHash).Tag(transient.Tag).Err()\n\t\tcase err == nil && hashInfo.ProjectEVersion >= targetEVersion:\n\t\t\treturn nil // Do not go backwards.\n\t\tdefault:\n\t\t\thashInfo.ProjectEVersion = targetEVersion\n\t\t\thashInfo.UpdateTime = datastore.RoundTime(clock.Now(ctx)).UTC()\n\t\t\thashInfo.ConfigGroupNames = cgNames\n\t\t\thashInfo.GitRevision = meta.Revision\n\t\t\thashInfo.SchemaVersion = prjcfg.SchemaVersion\n\t\t\treturn errors.Annotate(datastore.Put(ctx, &hashInfo), \"failed to put ConfigHashInfo(Hash=%q)\", localHash).Tag(transient.Tag).Err()\n\t\t}\n\t}, nil)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to run transaction to update ConfigHashInfo\").Tag(transient.Tag).Err()\n\t}\n\n\tif err := putConfigGroups(ctx, cfg, project, localHash); err != nil {\n\t\treturn err\n\t}\n\n\tupdated := false\n\terr = datastore.RunInTransaction(ctx, func(ctx context.Context) error {\n\t\tupdated = false\n\t\tpc := prjcfg.ProjectConfig{Project: project}\n\t\tswitch err := datastore.Get(ctx, &pc); {\n\t\tcase err != nil && err != datastore.ErrNoSuchEntity:\n\t\t\treturn errors.Annotate(err, \"failed to get ProjectConfig(project=%q)\", project).Tag(transient.Tag).Err()\n\t\tcase pc.EVersion != existingPC.EVersion:\n\t\t\treturn nil // Already updated by concurrent updateProject.\n\t\tdefault:\n\t\t\tpc = prjcfg.ProjectConfig{\n\t\t\t\tProject: project,\n\t\t\t\tEnabled: true,\n\t\t\t\tUpdateTime: datastore.RoundTime(clock.Now(ctx)).UTC(),\n\t\t\t\tEVersion: targetEVersion,\n\t\t\t\tHash: localHash,\n\t\t\t\tExternalHash: meta.ContentHash,\n\t\t\t\tConfigGroupNames: cgNames,\n\t\t\t\tSchemaVersion: prjcfg.SchemaVersion,\n\t\t\t}\n\t\t\tupdated = true\n\t\t\tif err := datastore.Put(ctx, &pc); err != nil {\n\t\t\t\treturn errors.Annotate(err, \"failed to put ProjectConfig(project=%q)\", project).Tag(transient.Tag).Err()\n\t\t\t}\n\t\t\treturn notify(ctx)\n\t\t}\n\t}, nil)\n\n\tswitch {\n\tcase err != nil:\n\t\treturn errors.Annotate(err, \"failed to run transaction to update ProjectConfig\").Tag(transient.Tag).Err()\n\tcase updated:\n\t\tlogging.Infof(ctx, \"updated project %q to rev %s hash %s \", project, meta.Revision, localHash)\n\t}\n\treturn nil\n}", "func UpdateProjectHandler(c *gin.Context) {\r\n\tuuid := c.Param(\"uuid\")\r\n\tprojectRequest := new(CreateProjectRequest)\r\n\terr := c.Bind(projectRequest)\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n\tres, err := UpdateProjectCore(uuid, projectRequest)\r\n\tif err != nil {\r\n\t\tc.JSON(404, ErrorResponse{ErrorCode: 404, ErrorMessage: err.Error()})\r\n\t} else {\r\n\t\tc.JSON(200, res)\r\n\t}\r\n}", "func (repo *repo) UpdateProject(projectModel *models.Project) (*models.Project, error) {\n\ttableName := fmt.Sprintf(\"cla-%s-projects\", repo.stage)\n\n\tif projectModel.ProjectID == \"\" {\n\t\treturn nil, ErrProjectIDMissing\n\t}\n\n\texistingProject, getErr := repo.GetProjectByID(projectModel.ProjectID)\n\tif getErr != nil {\n\t\tlog.Warnf(\"update - error locating the project id: %s, error: %+v\", projectModel.ProjectID, getErr)\n\t\treturn nil, getErr\n\t}\n\n\tif existingProject == nil {\n\t\treturn nil, ErrProjectDoesNotExist\n\t}\n\n\texpressionAttributeNames := map[string]*string{}\n\texpressionAttributeValues := map[string]*dynamodb.AttributeValue{}\n\tupdateExpression := \"SET \"\n\n\tif projectModel.ProjectName != \"\" {\n\t\tlog.Debugf(\"UpdateProject - adding project_name: %s\", projectModel.ProjectName)\n\t\texpressionAttributeNames[\"#N\"] = aws.String(\"project_name\")\n\t\texpressionAttributeValues[\":n\"] = &dynamodb.AttributeValue{S: aws.String(projectModel.ProjectName)}\n\t\tupdateExpression = updateExpression + \" #N = :n, \"\n\t\tlog.Debugf(\"UpdateProject- adding project name lower: %s\", strings.ToLower(projectModel.ProjectName))\n\t\texpressionAttributeNames[\"#LOW\"] = aws.String(\"project_name_lower\")\n\t\texpressionAttributeValues[\":low\"] = &dynamodb.AttributeValue{S: aws.String(strings.ToLower(projectModel.ProjectName))}\n\t\tupdateExpression = updateExpression + \" #LOW = :low, \"\n\t}\n\tif projectModel.ProjectACL != nil && len(projectModel.ProjectACL) > 0 {\n\t\tlog.Debugf(\"UpdateProject - adding project_acl: %s\", projectModel.ProjectACL)\n\t\texpressionAttributeNames[\"#A\"] = aws.String(\"project_acl\")\n\t\texpressionAttributeValues[\":a\"] = &dynamodb.AttributeValue{SS: aws.StringSlice(projectModel.ProjectACL)}\n\t\tupdateExpression = updateExpression + \" #A = :a, \"\n\t}\n\n\tlog.Debugf(\"UpdateProject - adding project_icla_enabled: %t\", projectModel.ProjectICLAEnabled)\n\texpressionAttributeNames[\"#I\"] = aws.String(\"project_icla_enabled\")\n\texpressionAttributeValues[\":i\"] = &dynamodb.AttributeValue{BOOL: aws.Bool(projectModel.ProjectICLAEnabled)}\n\tupdateExpression = updateExpression + \" #I = :i, \"\n\n\tlog.Debugf(\"UpdateProject - adding project_ccla_enabled: %t\", projectModel.ProjectCCLAEnabled)\n\texpressionAttributeNames[\"#C\"] = aws.String(\"project_ccla_enabled\")\n\texpressionAttributeValues[\":c\"] = &dynamodb.AttributeValue{BOOL: aws.Bool(projectModel.ProjectCCLAEnabled)}\n\tupdateExpression = updateExpression + \" #C = :c, \"\n\n\tlog.Debugf(\"UpdateProject - adding project_ccla_requires_icla_signature: %t\", projectModel.ProjectCCLARequiresICLA)\n\texpressionAttributeNames[\"#CI\"] = aws.String(\"project_ccla_requires_icla_signature\")\n\texpressionAttributeValues[\":ci\"] = &dynamodb.AttributeValue{BOOL: aws.Bool(projectModel.ProjectCCLARequiresICLA)}\n\tupdateExpression = updateExpression + \" #CI = :ci, \"\n\n\t_, currentTimeString := utils.CurrentTime()\n\tlog.Debugf(\"UpdateProject - adding date_modified: %s\", currentTimeString)\n\texpressionAttributeNames[\"#M\"] = aws.String(\"date_modified\")\n\texpressionAttributeValues[\":m\"] = &dynamodb.AttributeValue{S: aws.String(currentTimeString)}\n\tupdateExpression = updateExpression + \" #M = :m \"\n\n\t// Assemble the query input parameters\n\tupdateInput := &dynamodb.UpdateItemInput{\n\t\tKey: map[string]*dynamodb.AttributeValue{\n\t\t\t\"project_id\": {\n\t\t\t\tS: aws.String(existingProject.ProjectID),\n\t\t\t},\n\t\t},\n\t\tExpressionAttributeNames: expressionAttributeNames,\n\t\tExpressionAttributeValues: expressionAttributeValues,\n\t\tUpdateExpression: &updateExpression,\n\t\tTableName: aws.String(tableName),\n\t}\n\t//log.Debugf(\"Update input: %+V\", updateInput.GoString())\n\n\t// Make the DynamoDB Update API call\n\t_, updateErr := repo.dynamoDBClient.UpdateItem(updateInput)\n\tif updateErr != nil {\n\t\tlog.Warnf(\"error updating project by projectID: %s, error: %v\", projectModel.ProjectID, updateErr)\n\t\treturn nil, updateErr\n\t}\n\n\t// Read the updated record back from the DB and return - probably could\n\t// just create/update a new model in memory and return it to make it fast,\n\t// but this approach return exactly what the DB has\n\treturn repo.GetProjectByID(projectModel.ProjectID)\n}", "func UpdateProject(project Project) error {\n\tif strings.ToLower(project.Member.Role) == \"admin\" {\n\t\t_, err := database.DB.Exec(`UPDATE users SET owner = array_append(owner, '` + project.ProjectId + `') WHERE id = '` + project.Member.Fid + `';`)\n\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error at UpdateProject User.go : %v\", err)\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t_, err := database.DB.Exec(`UPDATE users SET owner = array_remove(owner, '` + project.ProjectId + `') WHERE id = '` + project.Member.Fid + `';`)\n\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error at UpdateProject User.go : %v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "func (s *Server) Update(ctx context.Context, q *ProjectUpdateRequest) (*v1alpha1.AppProject, error) {\n\tif q.Project.Name == common.DefaultAppProjectName {\n\t\treturn nil, grpc.ErrPermissionDenied\n\t}\n\tif !s.enf.EnforceClaims(ctx.Value(\"claims\"), \"projects\", \"update\", q.Project.Name) {\n\t\treturn nil, grpc.ErrPermissionDenied\n\t}\n\terr := validateProject(q.Project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts.projectLock.Lock(q.Project.Name)\n\tdefer s.projectLock.Unlock(q.Project.Name)\n\n\toldProj, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Get(q.Project.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tappsList, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).List(metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tremovedDst := getRemovedDestination(oldProj, q.Project)\n\tremovedSrc := getRemovedSources(oldProj, q.Project)\n\n\tremovedDstUsed := make([]v1alpha1.ApplicationDestination, 0)\n\tremovedSrcUsed := make([]string, 0)\n\n\tfor _, a := range argo.FilterByProjects(appsList.Items, []string{q.Project.Name}) {\n\t\tif dest, ok := removedDst[fmt.Sprintf(\"%s/%s\", a.Spec.Destination.Server, a.Spec.Destination.Namespace)]; ok {\n\t\t\tremovedDstUsed = append(removedDstUsed, dest)\n\t\t}\n\t\tif _, ok := removedSrc[a.Spec.Source.RepoURL]; ok {\n\t\t\tremovedSrcUsed = append(removedSrcUsed, a.Spec.Source.RepoURL)\n\t\t}\n\t}\n\tif len(removedDstUsed) > 0 {\n\t\tformattedRemovedUsedList := make([]string, len(removedDstUsed))\n\t\tfor i := 0; i < len(removedDstUsed); i++ {\n\t\t\tformattedRemovedUsedList[i] = fmt.Sprintf(\"server: %s, namespace: %s\", removedDstUsed[i].Server, removedDstUsed[i].Namespace)\n\t\t}\n\t\treturn nil, status.Errorf(\n\t\t\tcodes.InvalidArgument, \"following destinations are used by one or more application and cannot be removed: %s\", strings.Join(formattedRemovedUsedList, \";\"))\n\t}\n\tif len(removedSrcUsed) > 0 {\n\t\treturn nil, status.Errorf(\n\t\t\tcodes.InvalidArgument, \"following source repos are used by one or more application and cannot be removed: %s\", strings.Join(removedSrcUsed, \";\"))\n\t}\n\n\tres, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Update(q.Project)\n\tif err == nil {\n\t\ts.logEvent(res, ctx, argo.EventReasonResourceUpdated, \"update\")\n\t}\n\treturn res, err\n}", "func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opt *ProjectOptions) (*Project, *Response, error) {\n\tu := fmt.Sprintf(\"projects/%v\", id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opt)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// TODO: remove custom Accept headers when APIs fully launch.\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\tproject := &Project{}\n\tresp, err := s.client.Do(ctx, req, project)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn project, resp, nil\n}", "func (c *Client) UpdateProject(ctx context.Context, params *UpdateProjectInput, optFns ...func(*Options)) (*UpdateProjectOutput, error) {\n\tif params == nil {\n\t\tparams = &UpdateProjectInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"UpdateProject\", params, optFns, c.addOperationUpdateProjectMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*UpdateProjectOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "func UpdateRenewProject(ctx iris.Context) {\n\tvar req renewProjectReq\n\tif err := ctx.ReadJSON(&req); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification de projet de renouvellement, décodage : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := req.RenewProject.Validate(); err != nil {\n\t\tctx.StatusCode(http.StatusBadRequest)\n\t\tctx.JSON(jsonError{\"Modification de projet de renouvellement : \" + err.Error()})\n\t\treturn\n\t}\n\tdb := ctx.Values().Get(\"db\").(*sql.DB)\n\tif err := req.RenewProject.Update(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification de projet de renouvellement, requête : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusCreated)\n\tctx.JSON(req)\n}", "func (p rProjects) Update(project *schema.Project) error {\n\treturn model.Projects.Qs(p.session).Update(project.ID, project)\n}", "func (r UpdateProjectRequest) Send() (*UpdateProjectOutput, error) {\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn r.Request.Data.(*UpdateProjectOutput), nil\n}", "func APIProjectUpdateHandler(er *Errorly) http.HandlerFunc {\n\treturn func(rw http.ResponseWriter, r *http.Request) {\n\t\tsession, _ := er.Store.Get(r, sessionName)\n\t\tdefer er.SaveSession(session, r, rw)\n\n\t\tvars := mux.Vars(r)\n\n\t\tif err := r.ParseForm(); err != nil {\n\t\t\ter.Logger.Error().Err(err).Msg(\"Failed to parse form\")\n\t\t\tpassResponse(rw, \"Failed to parse form\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Authenticate the user\n\t\tauth, user := er.AuthenticateSession(session)\n\t\tif !auth {\n\t\t\tpassResponse(rw, \"You must be logged in to do this\", false, http.StatusForbidden)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Retrieve project and user permissions\n\t\tproject, viewable, elevated, ok := verifyProjectVisibility(er, rw, vars, user, auth, true)\n\t\tif !ok {\n\t\t\t// If ok is False, an error has already been provided to the ResponseWriter so we should just return\n\t\t\treturn\n\t\t}\n\n\t\tif !elevated {\n\t\t\tpassResponse(rw, \"You do not have permission to do this\", false, http.StatusForbidden)\n\n\t\t\treturn\n\t\t}\n\n\t\tif !viewable {\n\t\t\t// No permission to view project. We will treat like the project\n\t\t\t// does not exist.\n\t\t\tpassResponse(rw, \"Could not find this project\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tif _displayName := r.FormValue(\"display_name\"); _displayName != \"\" {\n\t\t\t_displayName = strings.TrimSpace(_displayName)\n\t\t\tif len(_displayName) > 3 && _displayName != project.Settings.DisplayName {\n\t\t\t\t// ensure there is no other project with the same display name\n\t\t\t\tuserProjects := make([]structs.Project, 0)\n\n\t\t\t\terr := er.Postgres.Model(&userProjects).\n\t\t\t\t\tWhere(\"created_by_id = ?\", user.ID).\n\t\t\t\t\tSelect()\n\t\t\t\tif err != nil {\n\t\t\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor _, userProject := range userProjects {\n\t\t\t\t\tif userProject.Settings.DisplayName == _displayName {\n\t\t\t\t\t\tpassResponse(rw, \"You cannot have multiple projects with the same name\",\n\t\t\t\t\t\t\tfalse, http.StatusBadRequest)\n\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproject.Settings.DisplayName = _displayName\n\t\t\t}\n\t\t}\n\n\t\tif _description := r.FormValue(\"description\"); _description != \"\" {\n\t\t\tproject.Settings.Description = _description\n\t\t}\n\n\t\tif _url := r.FormValue(\"url\"); _url != \"\" {\n\t\t\t_, err := url.ParseRequestURI(_url)\n\t\t\tif err == nil {\n\t\t\t\tproject.Settings.URL = _url\n\t\t\t}\n\t\t}\n\n\t\tif _archived, err := strconv.ParseBool(r.FormValue(\"archived\")); err == nil {\n\t\t\tproject.Settings.Archived = _archived\n\t\t}\n\n\t\tif _private, err := strconv.ParseBool(r.FormValue(\"private\")); err == nil {\n\t\t\tproject.Settings.Private = _private\n\t\t}\n\n\t\tif _limited, err := strconv.ParseBool(r.FormValue(\"limited\")); err == nil {\n\t\t\tproject.Settings.Limited = _limited\n\t\t}\n\n\t\t_contributorIDs := []int64{}\n\t\tif err := json.UnmarshalFromString(r.FormValue(\"contributors\"), &_contributorIDs); err != nil {\n\t\t\tproject.Settings.ContributorIDs = _contributorIDs\n\t\t}\n\n\t\t_, err := er.Postgres.Model(project).\n\t\t\tWherePK().\n\t\t\tUpdate()\n\t\tif err != nil {\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\treturn\n\t\t}\n\n\t\tpassResponse(rw, structs.APIProjectUpdate{\n\t\t\tSettings: project.Settings,\n\t\t}, true, http.StatusOK)\n\t}\n}", "func (p *ProjectClient) Update(projectID string, request *UpdateProject) (Project, *Response, error) {\n\n\tvar trans Project\n\n\tprojectPath := strings.Join([]string{baseIPSPath, projectID}, \"/\")\n\n\tresp, err := p.client.MakeRequest(\"PUT\", projectPath, request, &trans)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Error: %v\", err)\n\t}\n\treturn trans, resp, err\n}", "func (r *ResourceHandler) UpdateProjectResource(project string, resource *models.Resource) (string, error) {\n\tr.ensureHandlerIsSet()\n\treturn r.resourceHandler.UpdateResourceByURI(context.TODO(), r.Scheme+\"://\"+r.BaseURL+v1ProjectPath+\"/\"+project+pathToResource+\"/\"+url.QueryEscape(*resource.ResourceURI), resource)\n}", "func (m *ModelProject) UpdateProject(ctx context.Context, project *Project) error {\n\tif err := m.ensureTable(ctx); err != nil {\n\t\treturn err\n\t}\n\tcond := operator.NewLeafCondition(operator.Eq, operator.M{\n\t\tprojectIDField: project.ProjectID,\n\t})\n\t// update project info\n\treturn m.db.Table(m.tableName).Upsert(ctx, cond, operator.M{\"$set\": project})\n}", "func (s projectService) Update(project *Project) (*Project, error) {\n\tpath, err := getUpdatePath(s, project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := apiUpdate(s.getClient(), project, new(Project), path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.(*Project), nil\n}", "func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall {\n\tc := &ProjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.projectId = projectId\n\tc.project = project\n\treturn c\n}", "func ProjectUserUpdate(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab url path variables\n\turlVars := mux.Vars(r)\n\turlUser := urlVars[\"user\"]\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\trefProjUUID := gorillaContext.Get(r, \"auth_project_uuid\").(string)\n\trefRoles := gorillaContext.Get(r, \"auth_roles\").([]string)\n\n\t// allow the user to be updated to only have reference to the project under which is being updated\n\tprName := projects.GetNameByUUID(refProjUUID, refStr)\n\tif prName == \"\" {\n\t\terr := APIErrGenericInternal(\"Internal Error\")\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Read POST JSON body\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\terr := APIErrorInvalidRequestBody()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Parse pull options\n\tpostBody, err := auth.GetUserFromJSON(body)\n\tif err != nil {\n\t\terr := APIErrorInvalidArgument(\"User\")\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\tu, err := auth.FindUsers(\"\", \"\", urlUser, true, refStr)\n\tif err != nil {\n\t\tif err.Error() == \"not found\" {\n\t\t\terr := APIErrorNotFound(\"User\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\terr := APIErrQueryDatastore()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// from the post request keep only the reference to the current project\n\tprojectRoles := auth.ProjectRoles{}\n\n\tfor _, p := range postBody.Projects {\n\t\tif p.Project == prName {\n\t\t\tprojectRoles.Project = prName\n\t\t\tprojectRoles.Roles = p.Roles\n\t\t\tprojectRoles.Topics = p.Topics\n\t\t\tprojectRoles.Subs = p.Subs\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// if the user is already a member of the project, update it with the accepted contents of the post body\n\tfound := false\n\tfor idx, p := range u.One().Projects {\n\t\tif p.Project == projectRoles.Project {\n\t\t\tu.One().Projects[idx].Roles = projectRoles.Roles\n\t\t\tu.One().Projects[idx].Topics = projectRoles.Topics\n\t\t\tu.One().Projects[idx].Subs = projectRoles.Subs\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\terr := APIErrorForbiddenWithMsg(\"User is not a member of the project\")\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// check that user is indeed a service admin in order to be privileged to see full user info\n\tprivileged := auth.IsServiceAdmin(refRoles)\n\n\t// Get Result Object\n\tuserUUID := u.One().UUID\n\tmodified := time.Now().UTC()\n\tuserProjects := u.One().Projects\n\tuserEmail := u.One().Email\n\tuserSRoles := u.One().ServiceRoles\n\tuserName := u.One().Name\n\tuserFN := u.One().FirstName\n\tuserLN := u.One().LastName\n\tuserOrg := u.One().Organization\n\tuserDesc := u.One().Description\n\n\t_, err = auth.UpdateUser(userUUID, userFN, userLN, userOrg, userDesc, userName, userProjects, userEmail, userSRoles, modified, false, refStr)\n\n\tif err != nil {\n\n\t\t// In case of invalid project or role in post body\n\t\tif err.Error() == \"not found\" {\n\t\t\terr := APIErrorNotFound(\"User\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif strings.HasPrefix(err.Error(), \"invalid\") {\n\t\t\terr := APIErrorInvalidData(err.Error())\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif strings.HasPrefix(err.Error(), \"duplicate\") {\n\t\t\terr := APIErrorInvalidData(err.Error())\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\tstored, err := auth.FindUsers(refProjUUID, userUUID, urlUser, privileged, refStr)\n\n\tif err != nil {\n\n\t\tif err.Error() == \"not found\" {\n\t\t\terr := APIErrorNotFound(\"User\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\n\t}\n\n\t// Output result to JSON\n\tresJSON, err := json.MarshalIndent(stored.One(), \"\", \" \")\n\tif err != nil {\n\t\terr := APIErrExportJSON()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n\n}", "func (project *ProjectV1) UpdateProject(updateProjectOptions *UpdateProjectOptions) (result *Project, response *core.DetailedResponse, err error) {\n\treturn project.UpdateProjectWithContext(context.Background(), updateProjectOptions)\n}", "func (s *ProjectService) Update(project *Project) (*Project, error) {\n\tif project == nil {\n\t\treturn nil, internal.CreateInvalidParameterError(constants.OperationUpdate, constants.ParameterProject)\n\t}\n\n\tpath, err := services.GetUpdatePath(s, project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tproject.Links = nil\n\tresp, err := services.ApiUpdate(s.GetClient(), project, new(Project), path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.(*Project), nil\n}", "func (d *Driver) ProjectUpdate(pcr ProjectUpdateRequest) (*ProjectCreateResponse, error) {\n\tresponse := &ProjectCreateResponse{}\n\n\tupdateProject := &models.V1ProjectUpdateRequest{\n\t\tID: &pcr.ID,\n\t\tName: pcr.Name,\n\t\tDescription: pcr.Description,\n\t}\n\trequest := project.NewUpdateProjectParams()\n\trequest.SetBody(updateProject)\n\tresp, err := d.project.UpdateProject(request, d.auth)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\tresponse.Project = resp.Payload\n\treturn response, nil\n}", "func (t *strictTestCommitStatusUpdater) UpdateProject(ctx context.Context, projectCtx command.ProjectContext, cmdName fmt.Stringer, status models.VCSStatus, url string, statusID string) (string, error) {\n\tif t.count > (len(t.statusUpdaters) - 1) {\n\t\treturn \"\", errors.New(\"more calls than expected\")\n\t}\n\n\tstatusID, err := t.statusUpdaters[t.count].UpdateProject(ctx, projectCtx, cmdName, status, url, statusID)\n\tt.count++\n\treturn statusID, err\n}", "func EditProject(id uint, data interface{}) error {\n\tif err := db.Model(&Project{}).Where(\"id = ? AND deleted_on = ? \", id, 0).Updates(data).Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (b *ProjectModels) UpdateProjectDetail(id int, data ProjectDetail) error {\n\terr := configs.GetDB.Table(TblProjectDetail).Where(\"project_id = ?\", id).Updates(&data).Error\n\treturn err\n}", "func (r UpdateProjectRequest) Send(ctx context.Context) (*UpdateProjectResponse, error) {\n\tr.Request.SetContext(ctx)\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &UpdateProjectResponse{\n\t\tUpdateProjectOutput: r.Request.Data.(*UpdateProjectOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "func (cmd *UpdateProjectCommand) Run(c *client.Client, args []string) error {\n\tvar path string\n\tif len(args) > 0 {\n\t\tpath = args[0]\n\t} else {\n\t\tpath = fmt.Sprintf(\"/projects/%v\", cmd.ProjectID)\n\t}\n\tvar payload client.AddProjectPayload\n\tif cmd.Payload != \"\" {\n\t\terr := json.Unmarshal([]byte(cmd.Payload), &payload)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to deserialize payload: %s\", err)\n\t\t}\n\t}\n\tlogger := goa.NewLogger(log.New(os.Stderr, \"\", log.LstdFlags))\n\tctx := goa.WithLogger(context.Background(), logger)\n\tresp, err := c.UpdateProject(ctx, path, &payload)\n\tif err != nil {\n\t\tgoa.LogError(ctx, \"failed\", \"err\", err)\n\t\treturn err\n\t}\n\n\tgoaclient.HandleResponse(c.Client, resp, cmd.PrettyPrint)\n\treturn nil\n}", "func (a *IamProjectApiService) IamProjectUpdateExecute(r ApiIamProjectUpdateRequest) (*Project, *http.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = http.MethodPatch\n\t\tlocalVarPostBody interface{}\n\t\tformFiles []formFile\n\t\tlocalVarReturnValue *Project\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"IamProjectApiService.IamProjectUpdate\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/iam/project/{projectId}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"projectId\"+\"}\", url.PathEscape(parameterToString(r.projectId, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\tif r.iamProjectUpdate == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"iamProjectUpdate is required and must be specified\")\n\t}\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 = r.iamProjectUpdate\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\t\tvar v InlineResponseDefault\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\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}", "func UpdateProjects(values interface{}, token string) ([]*Project, error) {\n\t// declarations\n\tprojects := make([]*Project, len(makeSlice(values)))\n\tvar uid int64\n\tif user, err := GetUser(token); err != nil {\n\t\treturn nil, err\n\t} else {\n\t\tuid = user.Id\n\t}\n\tidentifier := make(map[int64]bool)\n\n\t// update or insert projects\n\tfor i, value := range makeSlice(values) {\n\t\tentry := makeStringMap(value)\n\t\tgh_id := makeInt64(entry[\"id\"])\n\t\tidentifier[gh_id] = true\n\t\tproject := Project{\n\t\t\tGH_Id: gh_id,\n\t\t\tName: makeString(entry[\"full_name\"]),\n\t\t\tClone_url: makeString(entry[\"html_url\"]),\n\t\t}\n\n\t\tif existsProject(project.GH_Id) {\n\t\t\tif err := updateProject(&project, uid); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := createProject(&project, uid); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tprojects[i] = &project\n\t}\n\n\t// delete projects that no longer exist\n\trows, err := db.Query(\"SELECT gh_id, pid, uid FROM projects\"+\n\t\t\" INNER JOIN members ON projects.id=members.pid WHERE uid=$1\", uid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer rows.Close()\n\tvar gh_id, pid int64\n\tfor rows.Next() {\n\t\tif err := rows.Scan(&gh_id, &pid, &uid); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, ok := identifier[gh_id]; !ok {\n\t\t\tvar dummy string\n\t\t\tdb.QueryRow(\"DELETE FROM members WHERE uid=$1 AND pid=$2\", uid,\n\t\t\t\tpid).Scan(&dummy)\n\t\t\tvar count int64 = -1\n\t\t\tif err := db.QueryRow(\"SELECT count(*) FROM members WHERE pid=$1\",\n\t\t\t\tpid).Scan(&count); err == nil && count == 0 {\n\t\t\t\tdb.QueryRow(\"DELETE FROM projects WHERE id=$1\", pid).\n\t\t\t\t\tScan(&dummy)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn projects, nil\n}", "func (p *Postgres) UpdateProjectKey(projectName string, data []byte, keys ...string) error {\n\tkeysFormat := strings.Join(keys, \",\")\n\t_, err := p.db.Exec(fmt.Sprintf(\"UPDATE trees set data=jsonb_set(data, '{%s}', $1) WHERE project=$2\", keysFormat), data, projectName)\n\treturn err\n}", "func (ps *ProjectsPG) Update(ctx context.Context, updatedProject *api.UpdatedProject, id string, customerId string) (*api.Project, error) {\n\n\tfields := []*sqlf.Query{sqlf.Sprintf(\"name=%s, labels=%s, updated_at=%s\", updatedProject.Name, pq.Array(updatedProject.Labels), time.Now())}\n\n\tif updatedProject.Description != nil {\n\t\tfields = append(fields, sqlf.Sprintf(\"description=%s\", updatedProject.Description))\n\t}\n\n\tqry := sqlf.Sprintf(\"UPDATE projects SET %s WHERE id=%s AND customer_id=%s\", sqlf.Join(fields, \",\"), id, customerId)\n\n\tif _, err := ps.dbconn.ExecContext(ctx, qry.Query(sqlf.PostgresBindVar), qry.Args()...); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to update project by id: %s customerId: %s\", id, customerId)\n\t}\n\n\treturn ps.GetByID(ctx, id, customerId)\n}", "func (ua *UpdateAction) Do(ctx context.Context, req *proto.UpdateProjectRequest) (*pm.Project, error) {\n\tua.ctx = ctx\n\tua.req = req\n\n\tif err := ua.validate(); err != nil {\n\t\treturn nil, errorx.NewParamErr(err)\n\t}\n\n\t// 获取要更新的项目信息\n\tp, err := ua.model.GetProject(ua.ctx, req.ProjectID)\n\tif err != nil {\n\t\tlogging.Error(\"project: %s not found\", req.ProjectID)\n\t\treturn nil, errorx.NewParamErr(err)\n\t}\n\tif err := ua.updateProject(p); err != nil {\n\t\treturn nil, errorx.NewDBErr(err)\n\t}\n\n\t// 更新 bcs cc 中的数据\n\tgo bcscc.UpdateProject(p)\n\n\treturn p, nil\n}", "func (p *ProjectProvider) Update(userInfo *provider.UserInfo, newProject *kubermaticapiv1.Project) (*kubermaticapiv1.Project, error) {\n\tif userInfo == nil {\n\t\treturn nil, errors.New(\"a user is missing but required\")\n\t}\n\tmasterImpersonatedClient, err := createImpersonationClientWrapperFromUserInfo(userInfo, p.createMasterImpersonatedClient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := masterImpersonatedClient.Update(context.Background(), newProject); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newProject, nil\n}", "func (r *ResourceHandler) UpdateProjectResources(project string, resources []*models.Resource) (string, error) {\n\tr.ensureHandlerIsSet()\n\treturn r.resourceHandler.UpdateProjectResources(context.TODO(), project, resources, v2.ResourcesUpdateProjectResourcesOptions{})\n}", "func (m *MockProjectServiceIface) UpdateProject(p *UpdateProjectParams) (*UpdateProjectResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateProject\", p)\n\tret0, _ := ret[0].(*UpdateProjectResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (a *IamProjectApiService) IamProjectUpdate(ctx context.Context, projectId string) ApiIamProjectUpdateRequest {\n\treturn ApiIamProjectUpdateRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tprojectId: projectId,\n\t}\n}", "func (f *FakeProjectProvider) Update(userInfo *provider.UserInfo, newProject *kubermaticapiv1.Project) (*kubermaticapiv1.Project, error) {\n\treturn nil, errors.New(\"not implemented\")\n}", "func ExampleDeviceFarm_UpdateProject_shared00() {\n\tsvc := devicefarm.New(session.New())\n\tinput := &devicefarm.UpdateProjectInput{\n\t\tArn: aws.String(\"arn:aws:devicefarm:us-west-2:123456789101:project:8f75187d-101e-4625-accc-12345EXAMPLE\"),\n\t\tName: aws.String(\"NewName\"),\n\t}\n\n\tresult, err := svc.UpdateProject(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase devicefarm.ErrCodeArgumentException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeNotFoundException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeLimitExceededException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())\n\t\t\tcase devicefarm.ErrCodeServiceAccountException:\n\t\t\t\tfmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}", "func (r *ReferenceAdapter) UpdateProjectID() error {\n\tprojectID, err := GenerateProjectID()\n\tif err != nil {\n\t\treturn err\n\t}\n\tr.ProjectReference.Spec.GCPProjectID = projectID\n\treturn r.kubeClient.Update(context.TODO(), r.ProjectReference)\n}", "func (op *updateProjectUpdateProjectOperation) do(ctx context.Context, r *Project, c *Client) error {\n\t_, err := c.GetProject(ctx, r.urlNormalized())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tu, err := r.updateURL(c.Config.BasePath, \"UpdateProject\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq, err := newUpdateProjectUpdateProjectRequest(ctx, r, c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.Config.Logger.Infof(\"Created update: %#v\", req)\n\tbody, err := marshalUpdateProjectUpdateProjectRequest(c, req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := dcl.SendRequest(ctx, c.Config, \"PUT\", u, bytes.NewBuffer(body), c.Config.RetryProvider)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar o operations.CRMOperation\n\tif err := dcl.ParseResponse(resp.Response, &o); err != nil {\n\t\treturn err\n\t}\n\terr = o.Wait(ctx, c.Config, \"https://cloudresourcemanager.googleapis.com/\", \"GET\")\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (manager *ConfigManager) UpdateProjectUpdateConfig(projectUpdateConfig project_update_lib.ProjectUpdateConfig) error {\n\treturn manager.updateConfig(func(config aggregateConfig) (aggregateConfig, error) {\n\t\tconfig.ProjectUpdateConfig = projectUpdateConfig\n\t\treturn config, nil\n\t})\n}", "func UpdateProjectBoard(board *ProjectBoard) error {\n\treturn updateProjectBoard(x, board)\n}", "func (o *UpdateBuildPropertiesParams) SetProject(project string) {\n\to.Project = project\n}", "func ValidateProjectUpdate(newProject, oldProject *core.Project) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\n\tallErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&newProject.ObjectMeta, &oldProject.ObjectMeta, field.NewPath(\"metadata\"))...)\n\tallErrs = append(allErrs, ValidateProject(newProject)...)\n\n\tif oldProject.Spec.CreatedBy != nil {\n\t\tallErrs = append(allErrs, apivalidation.ValidateImmutableField(newProject.Spec.CreatedBy, oldProject.Spec.CreatedBy, field.NewPath(\"spec\", \"createdBy\"))...)\n\t}\n\tif oldProject.Spec.Namespace != nil {\n\t\tallErrs = append(allErrs, apivalidation.ValidateImmutableField(newProject.Spec.Namespace, oldProject.Spec.Namespace, field.NewPath(\"spec\", \"namespace\"))...)\n\t}\n\tif oldProject.Spec.Owner != nil && newProject.Spec.Owner == nil {\n\t\tallErrs = append(allErrs, field.Invalid(field.NewPath(\"spec\", \"owner\"), newProject.Spec.Owner, \"owner cannot be reset\"))\n\t}\n\n\treturn allErrs\n}", "func ValidateProjectUpdate(newProject, oldProject *core.Project) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\n\tallErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&newProject.ObjectMeta, &oldProject.ObjectMeta, field.NewPath(\"metadata\"))...)\n\tallErrs = append(allErrs, ValidateProject(newProject)...)\n\n\tif oldProject.Spec.CreatedBy != nil {\n\t\tallErrs = append(allErrs, apivalidation.ValidateImmutableField(newProject.Spec.CreatedBy, oldProject.Spec.CreatedBy, field.NewPath(\"spec\", \"createdBy\"))...)\n\t}\n\tif oldProject.Spec.Namespace != nil {\n\t\tallErrs = append(allErrs, apivalidation.ValidateImmutableField(newProject.Spec.Namespace, oldProject.Spec.Namespace, field.NewPath(\"spec\", \"namespace\"))...)\n\t}\n\tif oldProject.Spec.Owner != nil && newProject.Spec.Owner == nil {\n\t\tallErrs = append(allErrs, field.Invalid(field.NewPath(\"spec\", \"owner\"), newProject.Spec.Owner, \"owner cannot be reset\"))\n\t}\n\n\treturn allErrs\n}", "func UpdateProjects(ctx context.Context) error {\n\t// Fetch freshest configs from the LUCI Config.\n\tfetchedConfigs, err := fetchLatestProjectConfigs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar errs []error\n\tparsedConfigs := make(map[string]*fetchedProjectConfig)\n\tfor project, fetch := range fetchedConfigs {\n\t\tvalCtx := validation.Context{Context: ctx}\n\t\tvalCtx.SetFile(fetch.Path)\n\t\tmsg := validateProjectConfigRaw(&valCtx, fetch.Content)\n\t\tif err := valCtx.Finalize(); err != nil {\n\t\t\tblocking := err.(*validation.Error).WithSeverity(validation.Blocking)\n\t\t\tif blocking != nil {\n\t\t\t\t// Continue through validation errors to ensure a validation\n\t\t\t\t// error in one project does not affect other projects.\n\t\t\t\terrs = append(errs, errors.Annotate(blocking, \"validation errors for %q\", project).Err())\n\t\t\t\tmsg = nil\n\t\t\t}\n\t\t}\n\t\t// We create an entry even for invalid config (where msg == nil),\n\t\t// because we want to signal that config for this project still exists\n\t\t// and existing config should be retained instead of being deleted.\n\t\tparsedConfigs[project] = &fetchedProjectConfig{\n\t\t\tConfig: msg,\n\t\t\tMeta: fetch.Meta,\n\t\t}\n\t}\n\tforceUpdate := false\n\tsuccess := true\n\tif err := updateStoredConfig(ctx, parsedConfigs, forceUpdate); err != nil {\n\t\terrs = append(errs, err)\n\t\tsuccess = false\n\t}\n\t// Report success for all projects that passed validation, assuming the\n\t// update succeeded.\n\tfor project, config := range parsedConfigs {\n\t\tstatus := \"success\"\n\t\tif !success || config.Config == nil {\n\t\t\tstatus = \"failure\"\n\t\t}\n\t\timportAttemptCounter.Add(ctx, 1, project, status)\n\t}\n\n\tif len(errs) > 0 {\n\t\treturn errors.NewMultiError(errs...)\n\t}\n\treturn nil\n}", "func (c *ClientWithResponses) UpdateProjectWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*updateProjectResponse, error) {\n\trsp, err := c.UpdateProjectWithBody(ctx, id, contentType, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ParseupdateProjectResponse(rsp)\n}", "func (m *MockCoreClient) UpdateProject(arg0 context.Context, arg1 core.UpdateProjectArgs) (*operations.OperationReference, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateProject\", arg0, arg1)\n\tret0, _ := ret[0].(*operations.OperationReference)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func Update(ctx context.Context, client *selvpcclient.ServiceClient, id string, updateOpts UpdateOpts) (*Project, *selvpcclient.ResponseResult, error) {\n\t// Nest update options into the parent \"project\" JSON structure.\n\ttype updateProject struct {\n\t\tOptions UpdateOpts `json:\"project\"`\n\t}\n\tupdateProjectOpts := &updateProject{Options: updateOpts}\n\trequestBody, err := json.Marshal(updateProjectOpts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl := strings.Join([]string{client.Endpoint, resourceURL, id}, \"/\")\n\tresponseResult, err := client.DoRequest(ctx, http.MethodPatch, url, bytes.NewReader(requestBody))\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif responseResult.Err != nil {\n\t\treturn nil, responseResult, responseResult.Err\n\t}\n\n\t// Extract a project from the response body.\n\tvar result struct {\n\t\tProject *Project `json:\"project\"`\n\t}\n\terr = responseResult.ExtractResult(&result)\n\tif err != nil {\n\t\treturn nil, responseResult, err\n\t}\n\n\treturn result.Project, responseResult, nil\n}", "func UpdateTradeProjectID(tradeData *TradeData) bool{\n\t//\n\t//fmt.Printf(\"UpdateTradeProjectID - ProjectID=%d for id:%d\\n\",\n\t//\ttradeData.ProjectID, tradeData.id)\n\n\tquery := `UPDATE trade_list SET ProjectID=? WHERE id=?`\n\n\tres, err := DBCon.Exec(query,\n\t\ttradeData.ProjectID,\n\t\ttradeData.id,\n\t)\n\n\tif err != nil {\n\t\tlevel.Error(logger).Log(\"DBCon.Exec\", err)\n\t\treturn false\n\t}\n\n\trowsAffected, _ := res.RowsAffected()\n\tif rowsAffected>=0 {\n\t\treturn true\n\t}else{\n\t\treturn false\n\t}\n}", "func (r *RedisDB) UpdateProjectStatus(pull models.PullRequest, workspace string, repoRelDir string, newStatus models.ProjectPlanStatus) error {\n\tkey, err := r.pullKey(pull)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcurrStatusPtr, err := r.getPull(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif currStatusPtr == nil {\n\t\treturn nil\n\t}\n\tcurrStatus := *currStatusPtr\n\n\t// Update the status.\n\tfor i := range currStatus.Projects {\n\t\t// NOTE: We're using a reference here because we are\n\t\t// in-place updating its Status field.\n\t\tproj := &currStatus.Projects[i]\n\t\tif proj.Workspace == workspace && proj.RepoRelDir == repoRelDir {\n\t\t\tproj.Status = newStatus\n\t\t\tbreak\n\t\t}\n\t}\n\n\terr = r.writePull(key, currStatus)\n\treturn errors.Wrap(err, \"db transaction failed\")\n}", "func (r *ReferenceAdapter) updateProjectID() error {\n\tprojectId, err := GenerateProjectID()\n\tif err != nil {\n\t\treturn err\n\t}\n\tr.projectReference.Spec.GCPProjectID = projectId\n\treturn r.kubeClient.Update(context.TODO(), r.projectReference)\n}", "func (u *PrivatecaCaPoolIamUpdater) SetProject(project string) {\n\tu.project = project\n}", "func UnmarshalProject(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(Project)\n\terr = core.UnmarshalPrimitive(m, \"name\", &obj.Name)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"description\", &obj.Description)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"id\", &obj.ID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"crn\", &obj.Crn)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"configs\", &obj.Configs, UnmarshalProjectConfig)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"metadata\", &obj.Metadata, UnmarshalProjectMetadata)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "func (project *ProjectV1) UpdateProjectWithContext(ctx context.Context, updateProjectOptions *UpdateProjectOptions) (result *Project, response *core.DetailedResponse, err error) {\n\terr = core.ValidateNotNil(updateProjectOptions, \"updateProjectOptions cannot be nil\")\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.ValidateStruct(updateProjectOptions, \"updateProjectOptions\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpathParamsMap := map[string]string{\n\t\t\"id\": *updateProjectOptions.ID,\n\t}\n\n\tbuilder := core.NewRequestBuilder(core.PATCH)\n\tbuilder = builder.WithContext(ctx)\n\tbuilder.EnableGzipCompression = project.GetEnableGzipCompression()\n\t_, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}`, pathParamsMap)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor headerName, headerValue := range updateProjectOptions.Headers {\n\t\tbuilder.AddHeader(headerName, headerValue)\n\t}\n\n\tsdkHeaders := common.GetSdkHeaders(\"project\", \"V1\", \"UpdateProject\")\n\tfor headerName, headerValue := range sdkHeaders {\n\t\tbuilder.AddHeader(headerName, headerValue)\n\t}\n\tbuilder.AddHeader(\"Accept\", \"application/json\")\n\tbuilder.AddHeader(\"Content-Type\", \"application/json\")\n\n\tbody := make(map[string]interface{})\n\tif updateProjectOptions.Name != nil {\n\t\tbody[\"name\"] = updateProjectOptions.Name\n\t}\n\tif updateProjectOptions.Description != nil {\n\t\tbody[\"description\"] = updateProjectOptions.Description\n\t}\n\t_, err = builder.SetBodyContentJSON(body)\n\tif err != nil {\n\t\treturn\n\t}\n\n\trequest, err := builder.Build()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar rawResponse map[string]json.RawMessage\n\tresponse, err = project.Service.Request(request, &rawResponse)\n\tif err != nil {\n\t\treturn\n\t}\n\tif rawResponse != nil {\n\t\terr = core.UnmarshalModel(rawResponse, \"\", &result, UnmarshalProject)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tresponse.Result = result\n\t}\n\n\treturn\n}", "func (o *Project) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tprojectUpdateCacheMut.RLock()\n\tcache, cached := projectUpdateCache[key]\n\tprojectUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tprojectAllColumns,\n\t\t\tprojectPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update project, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `project` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, projectPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(projectType, projectMapping, append(wl, projectPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update project row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for project\")\n\t}\n\n\tif !cached {\n\t\tprojectUpdateCacheMut.Lock()\n\t\tprojectUpdateCache[key] = cache\n\t\tprojectUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func updateGitLabProjects(ctx context.Context, conn *gitlabConnection) {\n\tprojs, err := conn.listAllProjects(ctx)\n\tif err != nil {\n\t\tlog15.Error(\"failed to list some gitlab projects\", \"error\", err.Error())\n\t}\n\n\trepoChan := make(chan repoCreateOrUpdateRequest)\n\tdefer close(repoChan)\n\tgo createEnableUpdateRepos(ctx, fmt.Sprintf(\"gitlab:%s\", conn.config.Token), repoChan)\n\tfor _, proj := range projs {\n\t\trepoChan <- repoCreateOrUpdateRequest{\n\t\t\tRepoCreateOrUpdateRequest: api.RepoCreateOrUpdateRequest{\n\t\t\t\tRepoName: gitlabProjectToRepoPath(conn, proj),\n\t\t\t\tExternalRepo: gitlab.ExternalRepoSpec(proj, *conn.baseURL),\n\t\t\t\tDescription: proj.Description,\n\t\t\t\tFork: proj.ForkedFromProject != nil,\n\t\t\t\tArchived: proj.Archived,\n\t\t\t\tEnabled: conn.config.InitialRepositoryEnablement,\n\t\t\t},\n\t\t\tURL: conn.authenticatedRemoteURL(proj),\n\t\t}\n\t}\n}", "func APIProjectHandler(er *Errorly) http.HandlerFunc {\n\treturn func(rw http.ResponseWriter, r *http.Request) {\n\t\tsession, _ := er.Store.Get(r, sessionName)\n\t\tdefer er.SaveSession(session, r, rw)\n\n\t\tvars := mux.Vars(r)\n\n\t\t// Authenticate the user\n\t\tauth, user := er.AuthenticateSession(session)\n\n\t\t// Retrieve project and user permissions\n\t\tproject, viewable, elevated, ok := verifyProjectVisibility(er, rw, vars, user, auth, false)\n\t\tif !ok {\n\t\t\t// If ok is False, an error has already been provided to the ResponseWriter so we should just return\n\t\t\treturn\n\t\t}\n\n\t\tif !elevated {\n\t\t\tproject.Integrations = make([]*structs.User, 0)\n\t\t\tproject.Webhooks = make([]*structs.Webhook, 0)\n\t\t\tproject.InviteCodes = make([]*structs.InviteCode, 0)\n\t\t}\n\n\t\tif !viewable {\n\t\t\t// No permission to view project. We will treat like the project\n\t\t\t// does not exist.\n\t\t\tpassResponse(rw, \"Could not find this project\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tpassResponse(rw, structs.APIProject{\n\t\t\tProject: project,\n\t\t\tElevated: elevated,\n\t\t\t// Contributors: contributors,\n\t\t}, true, http.StatusOK)\n\t}\n}", "func (o *Project) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\tqueries.SetScanner(&o.UpdatedAt, currTime)\n\t}\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tprojectUpdateCacheMut.RLock()\n\tcache, cached := projectUpdateCache[key]\n\tprojectUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tprojectAllColumns,\n\t\t\tprojectPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update projects, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `projects` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, projectPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(projectType, projectMapping, append(wl, projectPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update projects row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for projects\")\n\t}\n\n\tif !cached {\n\t\tprojectUpdateCacheMut.Lock()\n\t\tprojectUpdateCache[key] = cache\n\t\tprojectUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "func (mr *MockCoreClientMockRecorder) UpdateProject(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpdateProject\", reflect.TypeOf((*MockCoreClient)(nil).UpdateProject), arg0, arg1)\n}", "func (project *Project) Update(tx *gorm.DB) error {\n\tif tx == nil {\n\t\ttx = db\n\t}\n\tlog.Info(\"Update project in database: \", project)\n\tlog.Info(\"Update project with GitRepository in database: \", project.GitRepository)\n\terr := tx.Model(&project).Association(\"GitRepository\").Error\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ttx.Save(project)\n\tif err := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Updates(project).Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func ProjectCreate(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab url path variables\n\turlVars := mux.Vars(r)\n\turlProject := urlVars[\"project\"]\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\trefUserUUID := gorillaContext.Get(r, \"auth_user_uuid\").(string)\n\n\t// Read POST JSON body\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\terr := APIErrorInvalidRequestBody()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Parse pull options\n\tpostBody, err := projects.GetFromJSON(body)\n\tif err != nil {\n\t\terr := APIErrorInvalidArgument(\"Project\")\n\t\trespondErr(w, err)\n\t\tlog.Error(string(body[:]))\n\t\treturn\n\t}\n\n\tuuid := uuid.NewV4().String() // generate a new uuid to attach to the new project\n\tcreated := time.Now().UTC()\n\t// Get Result Object\n\n\tres, err := projects.CreateProject(uuid, urlProject, created, refUserUUID, postBody.Description, refStr)\n\n\tif err != nil {\n\t\tif err.Error() == \"exists\" {\n\t\t\terr := APIErrorConflict(\"Project\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Output result to JSON\n\tresJSON, err := res.ExportJSON()\n\tif err != nil {\n\t\terr := APIErrExportJSON()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n\n}", "func updateProjectClientName(ctx iris.Context) {\n\tprojectID := ctx.Params().Get(\"projectID\")\n\tif projectID == \"\" {\n\t\thandleError(ctx, apiErrors.ErrBadRequest)\n\t\treturn\n\t}\n\tclientID := ctx.Params().Get(\"clientID\")\n\tif clientID == \"\" {\n\t\thandleError(ctx, apiErrors.ErrBadRequest)\n\t\treturn\n\t}\n\n\tpc := model.ProjectClient{}\n\terrs := decodeAndValidate(ctx, &pc)\n\tif errs != nil {\n\t\trender.Error(ctx, iris.StatusUnprocessableEntity, errs)\n\t\treturn\n\t}\n\tpc.ProjectID = projectID\n\tpc.ClientID = clientID\n\n\tresult, err := store.UpdateProjectClientName(pc)\n\tif err != nil {\n\t\thandleError(ctx, err)\n\t\treturn\n\t}\n\n\trender.JSON(ctx, iris.StatusOK, result)\n}", "func (o *ExportUsingGETParams) SetProject(project *string) {\n\to.Project = project\n}", "func (p *Project) Sync() {\n\t*p = *InitedProject(p.Id)\n}", "func (d *dao) Update(ctx context.Context, projectID int64, name, value string) error {\n\tqs, err := orm.QuerySetter(ctx, &models.ProjectMetadata{}, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tqs = qs.Filter(\"project_id\", projectID).Filter(\"name\", name)\n\n\t_, err = qs.Update(orm.Params{\"value\": value})\n\treturn err\n}", "func ProjectDelete(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\n\t// Get Result Object\n\t// Get project UUID First to use as reference\n\tprojectUUID := gorillaContext.Get(r, \"auth_project_uuid\").(string)\n\t// RemoveProject removes also attached subs and topics from the datastore\n\terr := projects.RemoveProject(projectUUID, refStr)\n\tif err != nil {\n\t\tif err.Error() == \"not found\" {\n\t\t\terr := APIErrorNotFound(\"ProjectUUID\")\n\t\t\trespondErr(w, err)\n\t\t\treturn\n\t\t}\n\t\terr := APIErrGenericInternal(err.Error())\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// TODO Stop any relevant push subscriptions when deleting a project\n\n\t// Write empty response if anything ok\n\trespondOK(w, output)\n\n}", "func (mr *MockProjectServiceIfaceMockRecorder) UpdateProject(p interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpdateProject\", reflect.TypeOf((*MockProjectServiceIface)(nil).UpdateProject), p)\n}", "func (s *service) Project(name string) error {\n\tresp := ProjectResponse{}\n\tdata := struct {\n\t\tName string `json:\"name\"`\n\t}{\n\t\tName: name,\n\t}\n\tif err := post(s.getServerURL(\"/project\"), &data, &resp); err != nil {\n\t\treturn err\n\t}\n\n\tif !resp.Success {\n\t\treturn errors.New(\"failed to obtain token\")\n\t}\n\n\ts.token = resp.Token\n\n\treturn nil\n}", "func fillProject(project *Project, uid int64) error {\n\t// declarations\n\tvar name, clone_url, fs_path sql.NullString\n\n\t// fetch project information\n\tif err := db.QueryRow(\"SELECT * FROM projects WHERE gh_id=$1\",\n\t\tproject.GH_Id).Scan(&project.Id, &project.GH_Id, &name, &clone_url,\n\t\t&fs_path); err != nil {\n\t\treturn err\n\t}\n\n\t// set remaining fields\n\tif name.Valid {\n\t\tproject.Name = name.String\n\t}\n\tif clone_url.Valid {\n\t\tproject.Clone_url = clone_url.String\n\t}\n\tif fs_path.Valid {\n\t\tproject.Fs_path = fs_path.String\n\t}\n\n\t// update member relation\n\tif err := db.QueryRow(\"SELECT * FROM members WHERE uid=$1 AND pid=$2\", uid,\n\t\tproject.Id).Scan(&uid, &project.Id); err == sql.ErrNoRows {\n\t\tvar dummy string\n\t\tdb.QueryRow(\"INSERT INTO members VALUES ($1, $2)\", uid, project.Id).\n\t\t\tScan(&dummy)\n\t}\n\n\treturn nil\n}", "func (e *BcsDataManager) GetProjectInfo(ctx context.Context,\n\treq *bcsdatamanager.GetProjectInfoRequest, rsp *bcsdatamanager.GetProjectInfoResponse) error {\n\tblog.Infof(\"Received GetProjectInfo.Call request. Project id: %s, dimension:%s, startTime=%s, endTime=%s\",\n\t\treq.GetProject(), req.GetDimension(), time.Unix(req.GetStartTime(), 0),\n\t\ttime.Unix(req.GetEndTime(), 0))\n\tstart := time.Now()\n\tif req.GetProject() == \"\" && req.GetProjectCode() == \"\" && req.GetBusiness() == \"\" {\n\t\trsp.Message = fmt.Sprintf(\"get project info error, projectId, businessID or projectCode is required\")\n\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\tblog.Errorf(rsp.Message)\n\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\treturn nil\n\t}\n\tif req.GetProject() == \"\" && req.GetBusiness() == \"\" && req.GetProjectCode() != \"\" {\n\t\tproject, err := e.resourceGetter.GetProjectInfo(ctx, \"\", req.GetProjectCode(), nil)\n\t\tif err != nil {\n\t\t\trsp.Message = fmt.Sprintf(\"get project info err:%v\", err)\n\t\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\t\tblog.Errorf(rsp.Message)\n\t\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\t\treturn nil\n\t\t}\n\t\tif project == nil {\n\t\t\trsp.Message = fmt.Sprintf(\"cannot get project info by project code:%s\", req.GetProjectCode())\n\t\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\t\tblog.Errorf(rsp.Message)\n\t\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\t\treturn nil\n\t\t}\n\t\treq.Project = project.ProjectID\n\t}\n\tresult, err := e.model.GetProjectInfo(ctx, req)\n\tif err != nil {\n\t\trsp.Message = fmt.Sprintf(\"get project info error: %v\", err)\n\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\tblog.Errorf(rsp.Message)\n\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\treturn nil\n\t}\n\trsp.Data = result\n\trsp.Message = bcsCommon.BcsSuccessStr\n\trsp.Code = bcsCommon.BcsSuccess\n\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusOK, start)\n\treturn nil\n}", "func newUpdateProjectUpdateProjectRequest(ctx context.Context, f *Project, 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}", "func (o *ProformaArray) SetProject(v string) {\n\to.Project = &v\n}", "func (wou *WorkOrderUpdate) SetProject(p *Project) *WorkOrderUpdate {\n\treturn wou.SetProjectID(p.ID)\n}", "func (wouo *WorkOrderUpdateOne) SetProject(p *Project) *WorkOrderUpdateOne {\n\treturn wouo.SetProjectID(p.ID)\n}", "func (r *versionResolver) UpstreamProject(ctx context.Context, obj *restModel.APIVersion) (*UpstreamProject, error) {\n\tv, err := model.VersionFindOneId(utility.FromStringPtr(obj.Id))\n\tif err != nil {\n\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"finding version %s: '%s'\", *obj.Id, err.Error()))\n\t}\n\tif v == nil {\n\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Version %s not found\", *obj.Id))\n\t}\n\tif v.TriggerID == \"\" || v.TriggerType == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tvar projectID string\n\tvar upstreamProject *UpstreamProject\n\tif v.TriggerType == model.ProjectTriggerLevelTask {\n\t\tupstreamTask, err := task.FindOneId(v.TriggerID)\n\t\tif err != nil {\n\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"finding upstream task %s: '%s'\", v.TriggerID, err.Error()))\n\t\t}\n\t\tif upstreamTask == nil {\n\t\t\treturn nil, ResourceNotFound.Send(ctx, \"upstream task not found\")\n\t\t}\n\n\t\tapiTask := restModel.APITask{}\n\t\tif err = apiTask.BuildFromService(ctx, upstreamTask, nil); err != nil {\n\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Error building APITask from service for `%s`: %s\", upstreamTask.Id, err.Error()))\n\t\t}\n\n\t\tprojectID = upstreamTask.Project\n\t\tupstreamProject = &UpstreamProject{\n\t\t\tRevision: upstreamTask.Revision,\n\t\t\tTask: &apiTask,\n\t\t}\n\t} else if v.TriggerType == model.ProjectTriggerLevelBuild {\n\t\tupstreamBuild, err := build.FindOneId(v.TriggerID)\n\t\tif err != nil {\n\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"finding upstream build %s: '%s'\", v.TriggerID, err.Error()))\n\t\t}\n\t\tif upstreamBuild == nil {\n\t\t\treturn nil, ResourceNotFound.Send(ctx, fmt.Sprintf(\"Upstream build %s not found\", v.TriggerID))\n\t\t}\n\n\t\tupstreamVersion, err := model.VersionFindOneId(utility.FromStringPtr(&upstreamBuild.Version))\n\t\tif err != nil {\n\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"finding upstream version %s: '%s'\", *obj.Id, err.Error()))\n\t\t}\n\t\tif upstreamVersion == nil {\n\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"upstream version %s not found\", *obj.Id))\n\t\t}\n\n\t\tapiVersion := restModel.APIVersion{}\n\t\tapiVersion.BuildFromService(*upstreamVersion)\n\n\t\tprojectID = upstreamVersion.Identifier\n\t\tupstreamProject = &UpstreamProject{\n\t\t\tRevision: upstreamBuild.Revision,\n\t\t\tVersion: &apiVersion,\n\t\t}\n\t}\n\tupstreamProjectRef, err := model.FindBranchProjectRef(projectID)\n\tif err != nil {\n\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"finding upstream project, project: %s, error: '%s'\", projectID, err.Error()))\n\t}\n\tif upstreamProjectRef == nil {\n\t\treturn nil, ResourceNotFound.Send(ctx, fmt.Sprintf(\"Upstream project %s not found\", projectID))\n\t}\n\n\tupstreamProject.Owner = upstreamProjectRef.Owner\n\tupstreamProject.Repo = upstreamProjectRef.Repo\n\tupstreamProject.Project = upstreamProjectRef.Identifier\n\tupstreamProject.TriggerID = v.TriggerID\n\tupstreamProject.TriggerType = v.TriggerType\n\treturn upstreamProject, nil\n}", "func (pr *Project) Update() *ProjectUpdateOne {\n\treturn (&ProjectClient{pr.config}).UpdateOne(pr)\n}", "func (a *App) IndexProject(w http.ResponseWriter, req *http.Request) {\n\tdb := context.Get(req, \"db\").(*mgo.Database)\n\tif db == nil {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Unable to access database\"})\n\t\treturn\n\t}\n\n\tuser := context.Get(req, \"user\").(*User)\n\tif user == nil {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Unable to retrieve user\"})\n\t\treturn\n\t}\n\n\t// Ensure query is restricted to only projects to which the user is authorized\n\tor := &bson.M{\n\t\t\"$or\": []bson.M{\n\t\t\tbson.M{\"owner\": user.ID},\n\t\t\tbson.M{\"contributors\": user.ID},\n\t\t},\n\t}\n\tvar projects []lair.Project\n\tif err := db.C(a.C.Projects).Find(or).All(&projects); err != nil {\n\t\ta.R.JSON(w, http.StatusInternalServerError, &Response{Status: \"Error\", Message: \"Unable to retrieve project index\"})\n\t\treturn\n\t}\n\ta.R.JSON(w, http.StatusOK, projects)\n}", "func ProjectsSlugPUT(c *gin.Context) {\n\tproject := c.MustGet(\"project\").(*Project)\n\treq := &ProjectRequest{}\n\tif err := c.BindJSON(req); err != nil {\n\t\treturn\n\t}\n\n\tif project.Slug != req.Slug {\n\t\tc.AbortWithStatus(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tdateStart, errDateStart := time.Parse(\"2006-01-02\", req.DateStart)\n\tdateEnd, errDateEnd := time.Parse(\"2006-01-02\", req.DateEnd)\n\tif errDateStart != nil || errDateEnd != nil {\n\t\tc.AbortWithStatus(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tproject.Name = req.Name\n\tproject.DateStart = dateStart\n\tproject.DateEnd = dateEnd\n\tproject.WordCountStart = req.WordCountStart\n\tproject.WordCountGoal = req.WordCountGoal\n\tif err := project.Update(); err != nil {\n\t\tc.AbortWithStatus(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tc.Status(http.StatusOK)\n}", "func (ps *ProjectStore) Save(project models.Project) error {\n\t_, err := ps.db.Exec(`UPDATE projects SET\n\t\t\t\t\t\t (name, key, repo, homepage, icon_url, lead_id) \n\t\t\t\t\t\t = ($1, $2, $3, $4, $5, $6)\n\t\t\t\t\t\t WHERE projects.id = $7;`,\n\t\tproject.Name, project.Key, project.Repo, project.Homepage,\n\t\tproject.IconURL, project.Lead.ID, project.ID)\n\n\treturn handlePqErr(err)\n}" ]
[ "0.7809559", "0.7789207", "0.7772251", "0.7736949", "0.7716326", "0.7592858", "0.75240904", "0.74874264", "0.74486184", "0.73906296", "0.73197263", "0.7312109", "0.7310997", "0.72480655", "0.711599", "0.70102924", "0.6985994", "0.6947166", "0.69454956", "0.688732", "0.68768054", "0.68378115", "0.6837098", "0.68306404", "0.67606753", "0.65975875", "0.659104", "0.65704554", "0.6569484", "0.6547255", "0.653384", "0.6527687", "0.65210426", "0.6493584", "0.64461416", "0.64404035", "0.6439268", "0.6425717", "0.64198846", "0.6351202", "0.6335181", "0.6322625", "0.6306974", "0.62928885", "0.6250252", "0.6236541", "0.62104505", "0.6129475", "0.6116829", "0.6079112", "0.6077317", "0.60549194", "0.60470486", "0.6045748", "0.6028626", "0.602222", "0.5997585", "0.59910744", "0.5982379", "0.5959033", "0.59349924", "0.59091634", "0.5907564", "0.5852743", "0.5852743", "0.5851192", "0.5813504", "0.5788948", "0.57842153", "0.5755336", "0.5719155", "0.57066935", "0.57039046", "0.5697075", "0.5696355", "0.5694569", "0.5652273", "0.56422234", "0.56361", "0.5620104", "0.55871224", "0.5575612", "0.5556147", "0.5553011", "0.55501515", "0.55039644", "0.5495577", "0.5478991", "0.5476043", "0.54755807", "0.5474947", "0.54679656", "0.5437445", "0.54313713", "0.541701", "0.5410218", "0.54015034", "0.5396012", "0.5389481", "0.5383316" ]
0.78469765
0
GetProjects gets incoming id array of project IDs and return their info.
GetProjects получает входной массив идентификаторов проектов и возвращает их информацию.
func GetProjects(w http.ResponseWriter, r *http.Request) { // Get IDs for projects // Grab those projects. // Return those cool projects and response }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetProjects(w http.ResponseWriter, r *http.Request, auth string) []Project {\n\tvar projects []Project\n\tprojectFileName := auth + globals.PROJIDFILE\n\t//First see if project already exist\n\tstatus, filepro := caching.ShouldFileCache(projectFileName, globals.PROJIDDIR)\n\tdefer filepro.Close()\n\tif status == globals.Error || status == globals.DirFail {\n\t\thttp.Error(w, \"Failed to create a file\", http.StatusInternalServerError)\n\t\treturn nil\n\t}\n\tif status == globals.Exist {\n\t\t//The file exist\n\t\t//We read from file\n\t\terr := caching.ReadFile(filepro, &projects)\n\t\tif err != nil {\n\t\t\terrmsg := \"The Failed Reading from file with error\" + err.Error()\n\t\t\thttp.Error(w, errmsg, http.StatusInternalServerError)\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\t//Else we need to query to get it\n\t\tfor i := 0; i < globals.MAXPAGE; i++ {\n\t\t\tvar subProj []Project\n\t\t\tquery := globals.GITAPI + globals.PROJQ + globals.PAGEQ + strconv.Itoa(i+1)\n\t\t\terr := apiGetCall(w, query, auth, &subProj)\n\t\t\tif err != nil {\n\t\t\t\t//The API call has failed\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\t//When it's empty we no longer need to do calls\n\t\t\tif len(subProj) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tprojects = append(projects, subProj...)\n\t\t}\n\t\tcaching.CacheStruct(filepro, projects)\n\n\t}\n\treturn projects\n}", "func GetProjects() []m.Project {\n body, err := authenticatedGet(\"projects\")\n if err != nil {\n panic(err.Error())\n } else {\n var responseData projectResponse\n err = json.Unmarshal(body, &responseData)\n if err != nil {\n panic(err.Error())\n }\n\n return responseData.Data\n }\n}", "func (h *Handler) GetProjects(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\tvar projects []data.Project\n\n\tif projects, err = h.TodoGo.GetProjects(r.Context()); err != nil {\n\t\tresponse.Error(w, err)\n\t\treturn\n\t}\n\tresponse.Success(200, w, projects)\n}", "func getProjects(r *http.Request) ([]byte, error) {\n\tm := bson.M{}\n\tif pid, e := convert.Id(r.FormValue(\"id\")); e == nil {\n\t\tm[db.ID] = pid\n\t}\n\tp, e := db.Projects(m, nil)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn util.JSON(map[string]interface{}{\"projects\": p})\n}", "func GetProjects() (projects []m.Project, err error) {\n\tfmt.Println(\"GetProjects()\")\n\tbody, err := authenticatedGet(\"projects\")\n\tif err != nil {\n\t\tfmt.Printf(\"Got an error loading projects: %s\", err.Error())\n\t\treturn\n\t}\n\n\tvar responseData projectResponse\n\terr = json.Unmarshal(body, &responseData)\n\tif err != nil {\n\t\tfmt.Printf(\"Got an error parsing unmarshalling projects response: %s\\n\", err.Error())\n\t\treturn\n\t}\n\n\tprojects = responseData.Data\n\n\treturn\n}", "func (c Client) GetProjects() ([]Project, error) {\n\tlog.Print(\"[TodoistClient#GetProjects] Fetching projects\")\n\treq, err := c.newRequest(http.MethodGet, fmt.Sprintf(\"%s/projects\", apiURL))\n\tif err != nil {\n\t\tlog.Print(\"[TodoistClient#GetProjects] Error fetching projects\", err)\n\t\treturn nil, err\n\t}\n\n\tres, err := httpClient.Do(req)\n\tif err != nil {\n\t\tlog.Print(\"[TodoistClient#GetProjects] Error fetching projects\", err)\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\n\tprojects := make([]Project, 0)\n\terr = json.NewDecoder(res.Body).Decode(&projects)\n\tif err != nil {\n\t\tlog.Print(\"[TodoistClient#GetProjects] Error during decoding todoist response\", err)\n\t\treturn nil, err\n\t}\n\n\tlog.Print(\"[TodoistClient#GetProjects] Projects fetched successfully\")\n\treturn projects, nil\n}", "func GetProjects(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tname := vars[\"name\"]\n\n\tsite, err := database.GetSiteByName(name)\n\tif err != nil {\n\t\tutils.RespondWithJSON(w, http.StatusNotFound, \"not_found\", nil)\n\t\treturn\n\t}\n\n\tprojects, err := database.GetProjects(site.ID)\n\tif err != nil {\n\t\tutils.RespondWithJSON(w, http.StatusNotFound, err.Error(), nil)\n\t\treturn\n\t}\n\tutils.RespondWithJSON(w, http.StatusOK, \"success\", projects)\n\treturn\n}", "func GetProjects(_ *router.WebRequest) *model.Container {\n\tlist, err := factory.GetGitClient().ListProjects()\n\tif err != nil {\n\t\treturn model.ErrorResponse(model.MessageItem{\n\t\t\tCode: \"list-error\",\n\t\t\tMessage: err.Error(),\n\t\t}, 500)\n\t}\n\tdata := make([]interface{}, 0)\n\tfor _, item := range list {\n\t\tdata = append(data, item)\n\t}\n\treturn model.ListResponse(data)\n}", "func (w *ServerInterfaceWrapper) GetProjects(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 GetProjectsParams\n\t// ------------- Optional query parameter \"query\" -------------\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"query\", ctx.QueryParams(), &params.Query)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter query: %s\", err))\n\t}\n\n\t// ------------- Optional query parameter \"identifier\" -------------\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"identifier\", ctx.QueryParams(), &params.Identifier)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter identifier: %s\", err))\n\t}\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.GetProjects(ctx, params)\n\treturn err\n}", "func (pu *ProjectUtil) GetProjects(name string) ([]models.ExistingProject, error) {\n\turl := pu.rootURI + \"/api/v2.0/projects\"\n\tif len(strings.TrimSpace(name)) > 0 {\n\t\turl = url + \"?name=\" + name\n\t}\n\tdata, err := pu.testingClient.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar pros []models.ExistingProject\n\tif err = json.Unmarshal(data, &pros); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn pros, nil\n}", "func GetProjectsHandler(w http.ResponseWriter, r *http.Request) {\n\tvar user models.User\n\tuser = context.Get(r, config.RequestUser).(models.User)\n\tvar projects []models.Project\n\n\tdatabase.DB.Where(\"user_id = ?\", user.ID).Find(&projects)\n\tjsonProjects, err := json.Marshal(projects)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(\"Error Marshalling project info to JSON\"))\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(jsonProjects)\n\treturn\n}", "func GetProjects(e Executor, userID string) (*ProjectSimpleList, error) {\n\treq, _ := http.NewRequest(\"GET\", RexBaseURL+apiProjectByOwner+userID, nil)\n\n\tresp, err := e.Execute(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tio.Copy(ioutil.Discard, resp.Body)\n\t}()\n\n\tvar projects ProjectSimpleList\n\terr = json.NewDecoder(resp.Body).Decode(&projects)\n\n\t// set ID for convenience\n\tfor i, p := range projects.Embedded.Projects {\n\t\tre, _ := regexp.Compile(\"/projects/(.*)\")\n\t\tvalues := re.FindStringSubmatch(p.Links.Self.Href)\n\t\tif len(values) > 0 {\n\t\t\tprojects.Embedded.Projects[i].ID = values[1]\n\t\t}\n\t}\n\treturn &projects, err\n}", "func ProjectsGET(c *gin.Context) {\n\tuser := c.MustGet(\"user\").(*User)\n\tif err := user.FetchProjects(); err != nil {\n\t\tc.JSON(http.StatusInternalServerError, nil)\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, user.Projects)\n}", "func (w *ServerInterfaceWrapper) GetProjectsId(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"id\" -------------\n\tvar id string\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.GetProjectsId(ctx, id)\n\treturn err\n}", "func (c *Client) GetProjects(ret *[]Project) error {\n\treturn c.makeGetRequest(\"projects\", ret, nil)\n}", "func (a *DefaultApiService) Projects(ctx context.Context) ([]Project, *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 \tsuccessPayload []Project\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/projects\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"application/json; charset=utf-8\", }\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\t\t\"application/json\",\n\t\t}\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\tlocalVarQueryParams.Add(\"circle-token\", key)\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 successPayload, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\tdefer localVarHttpResponse.Body.Close()\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tbodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)\n\t\treturn successPayload, localVarHttpResponse, reportError(\"Status: %v, Body: %s\", localVarHttpResponse.Status, bodyBytes)\n\t}\n\n\tif err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\n\n\treturn successPayload, localVarHttpResponse, err\n}", "func (repo *repo) GetProjects(params *project.GetProjectsParams) (*models.Projects, error) {\n\ttableName := fmt.Sprintf(\"cla-%s-projects\", repo.stage)\n\n\t// Use the nice builder to create the expression\n\texpr, err := expression.NewBuilder().WithProjection(buildProjection()).Build()\n\tif err != nil {\n\t\tlog.Warnf(\"error building expression for project scan, error: %v\", err)\n\t}\n\n\t// Assemble the query input parameters\n\tscanInput := &dynamodb.ScanInput{\n\t\tExpressionAttributeNames: expr.Names(),\n\t\tExpressionAttributeValues: expr.Values(),\n\t\tFilterExpression: expr.Filter(),\n\t\tProjectionExpression: expr.Projection(),\n\t\tTableName: aws.String(tableName),\n\t}\n\n\t// If we have the next key, set the exclusive start key value\n\tif params.NextKey != nil && *params.NextKey != \"\" {\n\t\tlog.Debugf(\"Received a nextKey, value: %s\", *params.NextKey)\n\t\t// The primary key of the first item that this operation will evaluate.\n\t\t// and the query key (if not the same)\n\t\tscanInput.ExclusiveStartKey = map[string]*dynamodb.AttributeValue{\n\t\t\t\"project_id\": {\n\t\t\t\tS: params.NextKey,\n\t\t\t},\n\t\t}\n\t}\n\n\t// If we have a page size, set the limit value - make sure it's a positive value\n\tif params.PageSize != nil && *params.PageSize > 0 {\n\t\tlog.Debugf(\"Received a pageSize parameter, value: %d\", *params.PageSize)\n\t\t// The primary key of the first item that this operation will evaluate.\n\t\t// and the query key (if not the same)\n\t\tscanInput.Limit = params.PageSize\n\t} else {\n\t\t// Default page size\n\t\t*params.PageSize = 50\n\t}\n\n\tvar projects []models.Project\n\tvar lastEvaluatedKey string\n\n\t// Loop until we have all the records\n\tfor ok := true; ok; ok = lastEvaluatedKey != \"\" {\n\t\tresults, errQuery := repo.dynamoDBClient.Scan(scanInput)\n\t\tif errQuery != nil {\n\t\t\tlog.Warnf(\"error retrieving projects, error: %v\", errQuery)\n\t\t\treturn nil, errQuery\n\t\t}\n\n\t\t// Convert the list of DB models to a list of response models\n\t\tprojectList, modelErr := repo.buildProjectModels(results.Items)\n\t\tif modelErr != nil {\n\t\t\tlog.Warnf(\"error converting project DB model to response model, error: %v\",\n\t\t\t\tmodelErr)\n\t\t\treturn nil, modelErr\n\t\t}\n\n\t\t// Add to the project response models to the list\n\t\tprojects = append(projects, projectList...)\n\n\t\tif results.LastEvaluatedKey[\"project_id\"] != nil {\n\t\t\tlastEvaluatedKey = *results.LastEvaluatedKey[\"project_id\"].S\n\t\t\tscanInput.ExclusiveStartKey = map[string]*dynamodb.AttributeValue{\n\t\t\t\t\"project_id\": {\n\t\t\t\t\tS: aws.String(lastEvaluatedKey),\n\t\t\t\t},\n\t\t\t}\n\t\t} else {\n\t\t\tlastEvaluatedKey = \"\"\n\t\t}\n\n\t\tif int64(len(projects)) >= *params.PageSize {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn &models.Projects{\n\t\tLastKeyScanned: lastEvaluatedKey,\n\t\tPageSize: *params.PageSize,\n\t\tProjects: projects,\n\t}, nil\n}", "func (a *Client) GetProjects(params *GetProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProjectsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetProjectsParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"GetProjects\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/projects\",\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: &GetProjectsReader{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.(*GetProjectsOK)\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 GetProjects: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func ProjectGet(w http.ResponseWriter, r *http.Request) {\n\tdb := utils.GetDB()\n\tdefer db.Close()\n\n\tvar projects []models.Project\n\terr := db.Find(&projects).Error\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), 400)\n\t\tutils.LOG.Println(err)\n\t\treturn\n\t}\n\n\terr = json.NewEncoder(w).Encode(projects)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), 500)\n\t\tutils.LOG.Println(err)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(`success`))\n\n}", "func (p *Provider) GetProjects() []string {\n\treturn p.opts.projects\n}", "func (o *OpenShot) GetProjects() (*Projects, error) {\n\tlog := getLogger(\"GetProjects\")\n\tvar projects Projects\n\n\terr := o.http.Get(log, o.projectsURL(), nil, &projects)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &projects, nil\n}", "func (a ProjectGroupsApi) ApiProjectgroupsIdProjectsGet(skip int32, take int32) (*ResourceCollectionProjectGroupResource, *APIResponse, error) {\n\n\tvar localVarHttpMethod = strings.ToUpper(\"Get\")\n\t// create path and map variables\n\tlocalVarPath := a.Configuration.BasePath + \"/api/projectgroups/{id}/projects\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := make(map[string]string)\n\tvar localVarPostBody interface{}\n\tvar localVarFileName string\n\tvar localVarFileBytes []byte\n\t// authentication '(APIKeyHeader)' required\n\t// set key with prefix in header\n\tlocalVarHeaderParams[\"X-Octopus-ApiKey\"] = a.Configuration.GetAPIKeyWithPrefix(\"X-Octopus-ApiKey\")\n\t// authentication '(APIKeyQuery)' required\n\t// set key with prefix in query string\n\tlocalVarQueryParams[\"ApiKey\"] = a.Configuration.GetAPIKeyWithPrefix(\"ApiKey\")\n\t// authentication '(NugetApiKeyHeader)' required\n\t// set key with prefix in header\n\tlocalVarHeaderParams[\"X-NuGet-ApiKey\"] = a.Configuration.GetAPIKeyWithPrefix(\"X-NuGet-ApiKey\")\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\tlocalVarHeaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\tlocalVarQueryParams.Add(\"skip\", a.Configuration.APIClient.ParameterToString(skip, \"\"))\n\tlocalVarQueryParams.Add(\"take\", a.Configuration.APIClient.ParameterToString(take, \"\"))\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tvar successPayload = new(ResourceCollectionProjectGroupResource)\n\tlocalVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\n\tvar localVarURL, _ = url.Parse(localVarPath)\n\tlocalVarURL.RawQuery = localVarQueryParams.Encode()\n\tvar localVarAPIResponse = &APIResponse{Operation: \"ApiProjectgroupsIdProjectsGet\", Method: localVarHttpMethod, RequestURL: localVarURL.String()}\n\tif localVarHttpResponse != nil {\n\t\tlocalVarAPIResponse.Response = localVarHttpResponse.RawResponse\n\t\tlocalVarAPIResponse.Payload = localVarHttpResponse.Body()\n\t}\n\n\tif err != nil {\n\t\treturn successPayload, localVarAPIResponse, err\n\t}\n\terr = json.Unmarshal(localVarHttpResponse.Body(), &successPayload)\n\treturn successPayload, localVarAPIResponse, err\n}", "func (b *ProjectModels) GetProjects(addwhere string, limit string, offset string, orderby string) ([]ProjectAll, error) {\n\tresult := make([]ProjectAll, 0)\n\tjoin := fmt.Sprintf(\"join %s on %s.id = %s.project_id \", TblProjectDetail, PROJECT, TblProjectDetail)\n\tselects := fmt.Sprintf(\"%s.*,%s.*\", PROJECT, TblProjectDetail)\n\torder := fmt.Sprintf(\"%s.%s\", PROJECT, orderby)\n\twhere := `(name LIKE \"%` + addwhere + `%\" OR description LIKE \"%` + addwhere + `%\" OR address LIKE \"%` + addwhere + `%\")`\n\n\terr := configs.GetDB.Table(PROJECT).Select(selects).Joins(join).Where(where).Limit(limit).Offset(offset).Order(order).Find(&result).Error\n\treturn result, err\n}", "func (r *ProjectsService) Get(projectId string) *ProjectsGetCall {\n\tc := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.projectId = projectId\n\treturn c\n}", "func (c *Client) Projects(page int, per_page int) ([]*Project, error) {\n\n\turl, opaque := c.ResourceUrl(projectsUrl, nil, QMap{\n\t\t\"page\": strconv.Itoa(page),\n\t\t\"per_page\": strconv.Itoa(per_page),\n\t})\n\n\tvar projects []*Project\n\n\tcontents, err := c.Do(\"GET\", url, opaque, nil)\n\tif err == nil {\n\t\terr = json.Unmarshal(contents, &projects)\n\t}\n\n\treturn projects, err\n}", "func (w *ServerInterfaceWrapper) Projects(ctx echo.Context) error {\n\tvar err error\n\n\t// HasSecurity is set\n\n\tctx.Set(\"OpenId.Scopes\", []string{\"exitus/project.read\"})\n\n\t// Parameter object where we will unmarshal all parameters from the context\n\tvar params ProjectsParams\n\t// ------------- Optional query parameter \"q\" -------------\n\tif paramValue := ctx.QueryParam(\"q\"); paramValue != \"\" {\n\t}\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"q\", ctx.QueryParams(), &params.Q)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter q: %s\", err))\n\t}\n\n\t// ------------- Optional query parameter \"offset\" -------------\n\tif paramValue := ctx.QueryParam(\"offset\"); paramValue != \"\" {\n\t}\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"offset\", ctx.QueryParams(), &params.Offset)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter offset: %s\", err))\n\t}\n\n\t// ------------- Optional query parameter \"limit\" -------------\n\tif paramValue := ctx.QueryParam(\"limit\"); paramValue != \"\" {\n\t}\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"limit\", ctx.QueryParams(), &params.Limit)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter limit: %s\", err))\n\t}\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.Projects(ctx, params)\n\treturn err\n}", "func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {\n\tc := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.profileId = profileId\n\tc.id = id\n\treturn c\n}", "func GetProjects() ([]Project, error) {\n\tvar prjs []Project\n\tprjList := db.Find(&prjs)\n\terr := prjList.Error\n\treturn prjs, err\n}", "func (a *Client) GetProjectsProjectID(params *GetProjectsProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProjectsProjectIDOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetProjectsProjectIDParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"GetProjectsProjectID\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/projects/{project_id}\",\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: &GetProjectsProjectIDReader{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.(*GetProjectsProjectIDOK)\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 GetProjectsProjectID: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func GetProjectsByID(id int) *[]ProjectPrint {\n\trow, err := DB.Query(\"SELECT id,name,created_by FROM users WHERE created_by = $1\", id)\n\tcheckErr(err)\n\tvar projects []ProjectPrint\n\tfor row.Next() {\n\t\tvar u ProjectPrint\n\t\trow.Scan(&u.ID, &u.Name, &u.CreatedBy)\n\t\tprojects = append(projects, u)\n\t}\n\tdefer row.Close()\n\treturn &projects\n}", "func GetProjectTasks(projectID string) []m.ProjectTask {\n // Get list of IDs\n idsList := getProjectTaskIDS(projectID)\n\n // Concurrently expand the list of project tasks\n tasksLength := len(idsList)\n\n type empty struct {} // Semaphore for timing and sequencing\n sem := make(chan empty, tasksLength) // as we are loading tasks\n\n // Empty slice to hold our tasks details\n projectTaskDetails := make([]m.ProjectTask, tasksLength)\n\n for i, task := range idsList {\n // Spin up a goroutine as a closure over the\n // results slice and loop through each task\n go func (i int, taskID int) {\n projectTaskDetails[i] = getProjectTaskDetail(taskID)\n // Ping back on the channel when it is done\n sem <- empty{}\n } (i, task.ID)\n }\n // Wait for each goroutine on the channel to ping back\n for i := 0; i < tasksLength; i++ { <- sem }\n\n return projectTaskDetails\n}", "func GetProjectTasks(id int, status int, db *sql.DB) []Task {\n\n\tsqlStatement1 := `SELECT name FROM projects WHERE id = $1;`\n\n\tvar projectName string\n\n\terr = db.QueryRow(sqlStatement1, id).Scan(&projectName)\n\n\tif err != nil {\n\t\t//Do something\n\t}\n\n\tsqlStatement := `SELECT name, description, due_date\n FROM tasks WHERE project = $1 AND status = $2 ORDER BY due_date ASC;`\n\n\trows, err := db.Query(sqlStatement, id, status)\n\n\tif err != nil {\n\t\t//Do something\n\t}\n\n\tvar ProjectTasks = make([]Task, 0)\n\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar tsk Task\n\n\t\terr = rows.Scan(&tsk.Name, &tsk.Description, &tsk.Due_date)\n\n\t\ttsk.Status = status\n\t\ttsk.Project_name = projectName\n\n\t\tif err != nil {\n\t\t\t//Do something\n\t\t}\n\n\t\tProjectTasks = append(ProjectTasks, tsk)\n\t}\n\n\treturn ProjectTasks\n}", "func (c *Client) GetProjects(p GetProjectsParam) ([]dto.Project, error) {\n\tvar ps, tmpl []dto.Project\n\n\terr := c.paginate(\n\t\t\"GET\",\n\t\tfmt.Sprintf(\n\t\t\t\"v1/workspaces/%s/projects\",\n\t\t\tp.Workspace,\n\t\t),\n\t\tp.PaginationParam,\n\t\tdto.GetProjectRequest{\n\t\t\tName: p.Name,\n\t\t\tArchived: p.Archived,\n\t\t\tPagination: dto.NewPagination(p.Page, p.PageSize),\n\t\t},\n\t\t&tmpl,\n\t\tfunc(res interface{}) (int, error) {\n\t\t\tif res == nil {\n\t\t\t\treturn 0, nil\n\t\t\t}\n\t\t\tls := *res.(*[]dto.Project)\n\n\t\t\tps = append(ps, ls...)\n\t\t\treturn len(ls), nil\n\t\t},\n\t)\n\n\treturn ps, err\n}", "func (s *Server) Get(ctx context.Context, q *ProjectQuery) (*v1alpha1.AppProject, error) {\n\tif !s.enf.EnforceClaims(ctx.Value(\"claims\"), \"projects\", \"get\", q.Name) {\n\t\treturn nil, grpc.ErrPermissionDenied\n\t}\n\treturn s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Get(q.Name, metav1.GetOptions{})\n}", "func (a *DeploymentsApiService) ApiProjectsIdDeploymentsGet(ctx context.Context, id string) ApiApiProjectsIdDeploymentsGetRequest {\n\treturn ApiApiProjectsIdDeploymentsGetRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tid: id,\n\t}\n}", "func (r *Redis) getProjectIDs(projectID, indexName string) ([]string, error) {\n\tconn := r.pool.Get()\n\tdefer conn.Close()\n\n\t//get all IDs from index\n\tkey := fmt.Sprintf(\"%s:project#%s\", indexName, projectID)\n\tIDs, err := redis.Strings(conn.Do(\"SMEMBERS\", key))\n\tif err != nil {\n\t\tif err == redis.ErrNil {\n\t\t\treturn []string{}, nil\n\t\t}\n\n\t\treturn nil, err\n\t}\n\n\treturn IDs, nil\n}", "func (pc *ProjectCategory) GetProjects() []Project {\n\tp := []Project{}\n\trows, _ := Db.Query(projectSelectBaseQuery() + \n\t` join project_category_project on project_category_project.project_id = projects.id\n\t join project_categories on project_categories.id = project_category_project.project_category_id where project_categories.id = ?`, pc.Id)\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tproject_p := baseScanProject(rows)\n\t\tif project_p != nil {\n\t\t\tp = append(p, *project_p)\n\t\t}\n\t}\n\treturn p;\n}", "func GetProjectList(tasks []api.Task) []api.Task {\n\tvar result []api.Task\n\tfor _, task := range tasks {\n\t\tif task.IsProject() {\n\t\t\tresult = append(result, task)\n\t\t}\n\t}\n\treturn result\n}", "func GetListProjAll(c *gin.Context) {\r\n\t/* var listproj []model.Project\r\n\r\n\tres := model.GetProj(listproj)\r\n\r\n\tutils.WrapAPIData(c, map[string]interface{}{\r\n\t\t\"Data\": res,\r\n\t}, http.StatusOK, \"success\") */\r\n\r\n\tvar proj1 []model.Project\r\n\r\n\tmodel.DB.Preload(clause.Associations).Find(&proj1)\r\n\r\n\tutils.WrapAPIData(c, map[string]interface{}{\r\n\t\t\"Data\": proj1,\r\n\t}, http.StatusOK, \"success\")\r\n\r\n}", "func (s projectService) Get(projectsQuery ProjectsQuery) (*Projects, error) {\n\tv, _ := query.Values(projectsQuery)\n\tpath := s.BasePath\n\tencodedQueryString := v.Encode()\n\tif len(encodedQueryString) > 0 {\n\t\tpath += \"?\" + encodedQueryString\n\t}\n\n\tresp, err := apiGet(s.getClient(), new(Projects), path)\n\tif err != nil {\n\t\treturn &Projects{}, err\n\t}\n\n\treturn resp.(*Projects), nil\n}", "func Get(ctx context.Context, client *selvpcclient.ServiceClient, id string) (*Project, *selvpcclient.ResponseResult, error) {\n\turl := strings.Join([]string{client.Endpoint, resourceURL, id}, \"/\")\n\tresponseResult, err := client.DoRequest(ctx, http.MethodGet, url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif responseResult.Err != nil {\n\t\treturn nil, responseResult, responseResult.Err\n\t}\n\n\t// Extract a project from the response body.\n\tvar result struct {\n\t\tProject *Project `json:\"project\"`\n\t}\n\terr = responseResult.ExtractResult(&result)\n\tif err != nil {\n\t\treturn nil, responseResult, err\n\t}\n\n\treturn result.Project, responseResult, nil\n}", "func (s Step) Projects(\n\tctx context.Context,\n\tafter *string,\n\tbefore *string,\n\tfirst *int,\n\tlast *int,\n) (ProjectConnection, error) {\n\treturn PaginateProjectIDSliceContext(ctx, s.ProjectIDs, after, before, first, last)\n}", "func GetRenewProjects(ctx iris.Context) {\n\tvar resp renewProjectsResp\n\tdb := ctx.Values().Get(\"db\").(*sql.DB)\n\tif err := resp.RenewProjects.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête RU : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := resp.Cities.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête villes : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := resp.RPEventTypes.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête événements types : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := resp.Commissions.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête commissions : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := resp.BudgetActions.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête actions budgétaires : \" + err.Error()})\n\t\treturn\n\t}\n\tyear := (int64)(time.Now().Year())\n\tif err := resp.FcPreProgs.GetAllOfKind(year, models.KindRenewProject, db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête préprogrammation : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := resp.RPMultiAnnualReports.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des projets de renouvellement, requête rapport pluriannuel : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusOK)\n\tctx.JSON(resp)\n}", "func GetProjects() ([]*github.Repository) {\n\n\tctx := context.Background()\n\tts := oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: os.Getenv(\"GITHUB_PAT\")},\n\t)\n\ttc := oauth2.NewClient(ctx, ts)\n\n\tclient := github.NewClient(tc)\n\n\t// list all repositories for the authenticated user\n\trepos, _, _ := client.Repositories.List(ctx, \"\", nil)\n\n\t// for _, repo := range repos {\n \n // fmt.Println(*repo.HTMLURL)\n // }\n\n\treturn repos\n}", "func (github *Github) GetProjects() (models.Projects, error) {\n\treturn github.FetchProjects()\n}", "func (p *ProjectListAPIView) GET(w http.ResponseWriter, r *http.Request) {\n\tmanager := models.NewProjectManager(p.context)\n\tpaging := manager.NewPagingFromRequest(r)\n\tprojects := manager.NewProjectList()\n\n\tif err := manager.FilterPaged(&projects, paging); err != nil {\n\t\tglog.Error(err)\n\t\tresponse.New(http.StatusInternalServerError).Write(w, r)\n\t\treturn\n\t}\n\n\t// update paging\n\tresponse.New(http.StatusOK).Result(projects).Paging(paging).Write(w, r)\n}", "func (a *Client) GetProjectsProjectIDMembers(params *GetProjectsProjectIDMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProjectsProjectIDMembersOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetProjectsProjectIDMembersParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"GetProjectsProjectIDMembers\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/projects/{project_id}/members\",\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: &GetProjectsProjectIDMembersReader{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.(*GetProjectsProjectIDMembersOK)\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 GetProjectsProjectIDMembers: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func NewGetProjects(rt GetProjectsRequestType, id string) *GetProjects {\n\treturn &GetProjects{requestType: rt, projectID: id, responseCh: make(chan *GetProjectsResponse)}\n}", "func (t *TeamsService) ListProjects(teamID int) (*TeamProjectAssocListResponse, *simpleresty.Response, error) {\n\tvar result *TeamProjectAssocListResponse\n\turlStr := t.client.http.RequestURL(\"/team/%d/projects\", teamID)\n\n\t// Set the correct authentication header\n\tt.client.setAuthTokenHeader(t.client.accountAccessToken)\n\n\t// Execute the request\n\tresponse, getErr := t.client.http.Get(urlStr, &result, nil)\n\n\treturn result, response, getErr\n}", "func GetAllProjects(w http.ResponseWriter, r *http.Request) {\n\tu := mw.GetUser(r.Context())\n\tif u == nil {\n\t\tw.WriteHeader(403)\n\t\tw.Write(apiError(\"you must be logged in to view all projects\"))\n\t\treturn\n\t}\n\n\tprojects, err := Store.Projects().GetAll()\n\tif err != nil {\n\t\tw.WriteHeader(500)\n\t\tw.Write(apiError(err.Error()))\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tsendJSON(w, projects)\n}", "func (b *ProjectModels) GetProject(id string) (ProjectAll, error) {\n\tvar result ProjectAll\n\tjoin := fmt.Sprintf(\"join %s on %s.id = %s.project_id \", TblProjectDetail, PROJECT, TblProjectDetail)\n\twhere := fmt.Sprintf(\"%s.id = ?\", PROJECT)\n\tselects := fmt.Sprintf(\"%s.*,%s.*\", PROJECT, TblProjectDetail)\n\n\terr := configs.GetDB.Table(PROJECT).Select(selects).Joins(join).Where(where, id).Find(&result).Error\n\treturn result, err\n}", "func (d *Db) GetAllProjects() []Project {\n\t// Prepare query\n\tstmt, err := d.Prepare(\"SELECT * FROM projects\")\n\tif err != nil {\n\t\tfmt.Println(\"GetAllProjects Preperation Err: \", err)\n\t}\n\n\t// Make query\n\trows, err := stmt.Query()\n\tif err != nil {\n\t\tfmt.Println(\"GetAllProjects Query Err: \", err)\n\t}\n\n\t// Receive response of projects\n\tvar project Project\n\tprojects := []Project{}\n\tfor rows.Next() {\n\t\terr = rows.Scan(\n\t\t\t&project.Title,\n\t\t\t&project.ID,\n\t\t\t&project.Subtitle,\n\t\t\t&project.WorkInProgress,\n\t\t\t&project.Date,\n\t\t\tpq.Array(&project.Summary),\n\t\t\tpq.Array(&project.MoreInfo),\n\t\t\t&project.Source,\n\t\t\tpq.Array(&project.Videos),\n\t\t\tpq.Array(&project.Images),\n\t\t)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error scanning rows: \", err)\n\t\t}\n\t\tprojects = append(projects, project)\n\t}\n\n\treturn projects\n}", "func (s *service) GetProjects() ([]*brigademodel.Project, error) {\n\tprjs, err := s.client.GetProjects()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Sort projects by name.\n\tsort.Slice(prjs, func(i, j int) bool {\n\t\treturn prjs[i].Name < prjs[j].Name\n\t})\n\n\tprjList := make([]*brigademodel.Project, len(prjs))\n\tfor i, prj := range prjs {\n\t\tp := brigademodel.Project(*prj)\n\t\tprjList[i] = &p\n\t}\n\n\treturn prjList, nil\n}", "func (k *Keystone) ListProjectsAPI(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\ttoken, err := k.validateToken(c.Request())\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfigEndpoint, err := k.setAssignment(clusterID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tuserProjects := []*keystone.Project{}\n\tuser := token.User\n\tprojects := k.Assignment.ListProjects()\n\tif configEndpoint == \"\" {\n\t\tfor _, project := range projects {\n\t\t\tfor _, role := range user.Roles {\n\t\t\t\tif role.Project.Name == project.Name {\n\t\t\t\t\tuserProjects = append(userProjects, role.Project)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tuserProjects = append(userProjects, projects...)\n\t}\n\tprojectsResponse := &ProjectListResponse{\n\t\tProjects: userProjects,\n\t}\n\treturn c.JSON(http.StatusOK, projectsResponse)\n}", "func GetUserProjects(w http.ResponseWriter, r *http.Request) {\n\tregisteredUsers := user.Users{}\n\tregisteredUsersResp := getData(registeredUsersEndpoint)\n\tregisteredUsers.UnmarshalUsers(registeredUsersResp)\n\n\tunregisteredUsers := user.Users{}\n\tunregisteredUsersResp := getData(unregisteredusersEndpoint)\n\tunregisteredUsers.UnmarshalUsers(unregisteredUsersResp)\n\n\tusers := user.Users{}\n\tusers.UserList = append(registeredUsers.UserList, unregisteredUsers.UserList...)\n\n\tvar projects []project.Project = project.UnmarshalProjects(getData(projectsEndpoint))\n\tusersprojects := processUserProjects(users, projects)\n\n\tw.WriteHeader(http.StatusOK)\n\tresp, err := usersprojects.ToJSON()\n\terrs.HandleError(err)\n\tfmt.Fprintf(w, string(resp))\n}", "func (pg *MongoDb) ListProjects(ctx context.Context, filter string, pageSize int, pageToken string) ([]*prpb.Project, string, error) {\n\t//id := decryptInt64(pageToken, pg.PaginationKey, 0)\n\t//TODO\n\treturn nil, \"\", nil\n}", "func (s *ProjectsService) Get(ctx context.Context, projectName string) (*Project, error) {\n\tquery := url.Values{\n\t\t\"name\": []string{projectName},\n\t}\n\treq, err := s.Client.NewRequest(ctx, http.MethodGet, newURI(projectsURI), WithQuery(query))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get project request creation failed: %w\", err)\n\t}\n\tres, resp, err := s.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get project failed: %w\", err)\n\t}\n\n\tif resp != nil && resp.StatusCode == http.StatusNotFound {\n\t\treturn nil, ErrNotFound\n\t}\n\n\tp := &ProjectsList{\n\t\tProjects: []*Project{},\n\t}\n\tif err := json.Unmarshal(res, &p); err != nil {\n\t\treturn nil, fmt.Errorf(\"get project failed, unable to unmarshal repository list json: %w\", err)\n\t}\n\n\tp.Projects[0].Session.set(resp)\n\treturn p.Projects[0], nil\n\n}", "func (s *ProjectService) Get(projectsQuery ProjectsQuery) (*resources.Resources[*Project], error) {\n\tv, _ := query.Values(projectsQuery)\n\tpath := s.BasePath\n\tencodedQueryString := v.Encode()\n\tif len(encodedQueryString) > 0 {\n\t\tpath += \"?\" + encodedQueryString\n\t}\n\n\tresp, err := api.ApiGet(s.GetClient(), new(resources.Resources[*Project]), path)\n\tif err != nil {\n\t\treturn &resources.Resources[*Project]{}, err\n\t}\n\n\treturn resp.(*resources.Resources[*Project]), nil\n}", "func (k *Keystone) ListAuthProjectsAPI(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\ttoken, err := k.validateToken(c.Request())\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfigEndpoint, err := k.setAssignment(clusterID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tuserProjects := []*keystone.Project{}\n\tuser := token.User\n\tprojects := k.Assignment.ListProjects()\n\tif configEndpoint == \"\" {\n\t\tfor _, project := range projects {\n\t\t\tfor _, role := range user.Roles {\n\t\t\t\tif role.Project.Name == project.Name {\n\t\t\t\t\tuserProjects = append(userProjects, role.Project)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tuserProjects = append(userProjects, projects...)\n\t}\n\tprojectsResponse := &asfkeystone.ProjectListResponse{\n\t\tProjects: userProjects,\n\t}\n\treturn c.JSON(http.StatusOK, projectsResponse)\n}", "func GetProject(w http.ResponseWriter, r *http.Request) {\n\t// Get item params\n\t// Perform get, db n' stuff.\n\t// render.JSON(w, r)\n}", "func (e *BcsDataManager) GetProjectInfo(ctx context.Context,\n\treq *bcsdatamanager.GetProjectInfoRequest, rsp *bcsdatamanager.GetProjectInfoResponse) error {\n\tblog.Infof(\"Received GetProjectInfo.Call request. Project id: %s, dimension:%s, startTime=%s, endTime=%s\",\n\t\treq.GetProject(), req.GetDimension(), time.Unix(req.GetStartTime(), 0),\n\t\ttime.Unix(req.GetEndTime(), 0))\n\tstart := time.Now()\n\tif req.GetProject() == \"\" && req.GetProjectCode() == \"\" && req.GetBusiness() == \"\" {\n\t\trsp.Message = fmt.Sprintf(\"get project info error, projectId, businessID or projectCode is required\")\n\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\tblog.Errorf(rsp.Message)\n\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\treturn nil\n\t}\n\tif req.GetProject() == \"\" && req.GetBusiness() == \"\" && req.GetProjectCode() != \"\" {\n\t\tproject, err := e.resourceGetter.GetProjectInfo(ctx, \"\", req.GetProjectCode(), nil)\n\t\tif err != nil {\n\t\t\trsp.Message = fmt.Sprintf(\"get project info err:%v\", err)\n\t\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\t\tblog.Errorf(rsp.Message)\n\t\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\t\treturn nil\n\t\t}\n\t\tif project == nil {\n\t\t\trsp.Message = fmt.Sprintf(\"cannot get project info by project code:%s\", req.GetProjectCode())\n\t\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\t\tblog.Errorf(rsp.Message)\n\t\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\t\treturn nil\n\t\t}\n\t\treq.Project = project.ProjectID\n\t}\n\tresult, err := e.model.GetProjectInfo(ctx, req)\n\tif err != nil {\n\t\trsp.Message = fmt.Sprintf(\"get project info error: %v\", err)\n\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\tblog.Errorf(rsp.Message)\n\t\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusErr, start)\n\t\treturn nil\n\t}\n\trsp.Data = result\n\trsp.Message = bcsCommon.BcsSuccessStr\n\trsp.Code = bcsCommon.BcsSuccess\n\tprom.ReportAPIRequestMetric(\"GetProjectInfo\", \"grpc\", prom.StatusOK, start)\n\treturn nil\n}", "func (a *Client) GetProjectsUUID(params *GetProjectsUUIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetProjectsUUIDOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetProjectsUUIDParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetProjectsUUID\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/projects/{uuid}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetProjectsUUIDReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*GetProjectsUUIDOK), nil\n\n}", "func GetRenewProjectDatas(ctx iris.Context) {\n\tID, err := ctx.Params().GetInt64(\"ID\")\n\tif err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, paramètre : \" + err.Error()})\n\t\treturn\n\t}\n\tvar resp renewProjectDataResp\n\tdb := ctx.Values().Get(\"db\").(*sql.DB)\n\tresp.RenewProject.ID = ID\n\tif err = resp.RenewProject.GetByID(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête renewProject : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.RPLinkedCommitments.Get(ID, db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête commitments : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.Payments.GetLinkedToRenewProject(ID, db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête commitments : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.RenewProjectForecasts.Get(ID, db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête forecasts : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.Commissions.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête commissions : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.BudgetActions.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête actions : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.RPEventTypes.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête RPEventType : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.FullRPEvents.GetLinked(db, ID); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête FullRPEvents : \" + err.Error()})\n\t\treturn\n\t}\n\tif err = resp.RPCmtCityJoins.GetLinked(db, ID); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Datas de projet de renouvellement, requête lien engagements ville : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusOK)\n\tctx.JSON(resp)\n}", "func GetListProj(c *gin.Context) {\r\n\t//var gp []model.GrupProject\r\n\t//var gp1 model.GrupProject\r\n\tvar gp3 []model.Project\r\n\r\n\t/*if err := c.Bind(&u); err != nil {\r\n\t\tutils.WrapAPIError(c, err.Error(), http.StatusBadRequest)\r\n\t\treturn\r\n\t}\r\n\t//log.Println(\"LOGIN\") */\r\n\r\n\t//di save >> save\r\n\r\n\taID := c.Param(\"username\")\r\n\r\n\t//model.DB.Where(\"username = ?\", aID).Preload(\"GrupProject\", \"username\", aID).Find(&gp3)\r\n\r\n\tmodel.DB.Preload(\"GrupProject\", \"username\", aID).Find(&gp3)\r\n\t//model.DB.Raw(\"Select * from projct group by username order by trending desc limit 3\").Scan(&trending_membership)\r\n\r\n\t//model.DB.Where(\"grup_projects.username = ?\", aID).Preload(\"GrupProject\", \"username\", aID).Find(&gp3)\r\n\r\n\t//model.DB.Model(&gp1).Where(\"username=?\", aID).Scan(&gp)\r\n\t//model.DB.Model(&gp).Where(\"id_project=?\", gp.id_project).Scan(&gp3)\r\n\r\n\tutils.WrapAPIData(c, map[string]interface{}{\r\n\t\t\"Anggota\": gp3,\r\n\t}, http.StatusOK, \"success\")\r\n}", "func (repo *repo) GetProjectsByExternalID(params *project.GetProjectsByExternalIDParams) (*models.Projects, error) {\n\tlog.Debugf(\"Project - Repository Service - GetProjectsByExternalID - ExternalID: %s\", params.ExternalID)\n\ttableName := fmt.Sprintf(\"cla-%s-projects\", repo.stage)\n\n\t// This is the key we want to match\n\tcondition := expression.Key(\"project_external_id\").Equal(expression.Value(params.ExternalID))\n\n\t// Use the nice builder to create the expression\n\texpr, err := expression.NewBuilder().WithKeyCondition(condition).WithProjection(buildProjection()).Build()\n\tif err != nil {\n\t\tlog.Warnf(\"error building expression for project scan, error: %v\", err)\n\t}\n\n\t// Assemble the query input parameters\n\tqueryInput := &dynamodb.QueryInput{\n\t\tKeyConditionExpression: expr.KeyCondition(),\n\t\tExpressionAttributeNames: expr.Names(),\n\t\tExpressionAttributeValues: expr.Values(),\n\t\tProjectionExpression: expr.Projection(),\n\t\tTableName: aws.String(tableName),\n\t\tIndexName: aws.String(\"external-project-index\"),\n\t}\n\n\t// If we have the next key, set the exclusive start key value\n\tif params.NextKey != nil && *params.NextKey != \"\" {\n\t\tlog.Debugf(\"Received a nextKey, value: %s\", *params.NextKey)\n\t\t// The primary key of the first item that this operation will evaluate.\n\t\t// and the query key (if not the same)\n\t\tqueryInput.ExclusiveStartKey = map[string]*dynamodb.AttributeValue{\n\t\t\t\"project_id\": {\n\t\t\t\tS: params.NextKey,\n\t\t\t},\n\t\t}\n\t}\n\n\tvar pageSize *int64\n\t// If we have a page size, set the limit value - make sure it's a positive value\n\tif params.PageSize != nil && *params.PageSize > 0 {\n\t\tlog.Debugf(\"Received a pageSize parameter, value: %d\", *params.PageSize)\n\t\tpageSize = params.PageSize\n\t} else {\n\t\t// Default page size\n\t\tpageSize = aws.Int64(50)\n\t}\n\tqueryInput.Limit = pageSize\n\n\tvar projects []models.Project\n\tvar lastEvaluatedKey string\n\n\t// Loop until we have all the records\n\tfor ok := true; ok; ok = lastEvaluatedKey != \"\" {\n\t\tresults, errQuery := repo.dynamoDBClient.Query(queryInput)\n\t\tif errQuery != nil {\n\t\t\tlog.Warnf(\"error retrieving projects, error: %v\", errQuery)\n\t\t\treturn nil, errQuery\n\t\t}\n\n\t\t// Convert the list of DB models to a list of response models\n\t\tprojectList, modelErr := repo.buildProjectModels(results.Items)\n\t\tif modelErr != nil {\n\t\t\tlog.Warnf(\"error converting project DB model to response model, error: %v\",\n\t\t\t\tmodelErr)\n\t\t\treturn nil, modelErr\n\t\t}\n\n\t\t// Add to the project response models to the list\n\t\tprojects = append(projects, projectList...)\n\n\t\tif results.LastEvaluatedKey[\"project_id\"] != nil {\n\t\t\tlastEvaluatedKey = *results.LastEvaluatedKey[\"project_id\"].S\n\t\t\tqueryInput.ExclusiveStartKey = map[string]*dynamodb.AttributeValue{\n\t\t\t\t\"project_id\": {\n\t\t\t\t\tS: aws.String(lastEvaluatedKey),\n\t\t\t\t},\n\t\t\t}\n\t\t} else {\n\t\t\tlastEvaluatedKey = \"\"\n\t\t}\n\n\t\tif int64(len(projects)) >= *pageSize {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn &models.Projects{\n\t\tLastKeyScanned: lastEvaluatedKey,\n\t\tPageSize: *pageSize,\n\t\tResultCount: int64(len(projects)),\n\t\tProjects: projects,\n\t}, nil\n}", "func (k *Keystone) ListProjectsAPI(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\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\treturn c.JSON(http.StatusOK, &asfkeystone.ProjectListResponse{\n\t\tProjects: k.Assignment.ListProjects(),\n\t})\n}", "func GetProjectResources(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ProjectResourcesState, opts ...pulumi.ResourceOption) (*ProjectResources, error) {\n\tvar resource ProjectResources\n\terr := ctx.ReadResource(\"digitalocean:index/projectResources:ProjectResources\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (k *Keystone) GetProjectAPI(c echo.Context) error {\n\tclusterID := c.Request().Header.Get(xClusterIDKey)\n\tif ke := getKeystoneEndpoints(clusterID, k.endpointStore); len(ke) > 0 {\n\t\tc.Request().URL.Path = path.Join(c.Request().URL.Path, c.Param(\"id\"))\n\t\treturn k.proxyRequest(c)\n\t}\n\n\ttoken, err := k.validateToken(c.Request())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TODO(dfurman): prevent panic: use fields without pointers in models and/or provide getters with nil checks\n\tfor _, role := range token.User.Roles {\n\t\tif role.Project.ID == c.Param(\"id\") {\n\t\t\treturn c.JSON(http.StatusOK, &asfkeystone.ProjectResponse{\n\t\t\t\tProject: role.Project,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn c.JSON(http.StatusNotFound, nil)\n}", "func (w Workspace) Projects(\n\tctx context.Context,\n\tafter *string,\n\tbefore *string,\n\tfirst *int,\n\tlast *int,\n) (ProjectConnection, error) {\n\treturn PaginateProjectIDSliceContext(ctx, w.ProjectIDs, after, before, first, last)\n}", "func (c *ProjectService) Get(id string) (*Project, *http.Response, error) {\n\tproject := new(Project)\n\tapiError := new(APIError)\n\tpath := fmt.Sprintf(\"%s\", id)\n\tresp, err := c.sling.New().Get(path).Receive(project, apiError)\n\treturn project, resp, relevantError(err, *apiError)\n}", "func (c Client) Projects() ([]Project, error) {\n\tu := mustParseURL(c.baseURL)\n\tu.Path += \"projects\"\n\n\tprojects := make([]Project, 0)\n\n\t// if there's more projects than returned by default by the API, links array will\n\t// be provided. The object that has the 'rel' field with the value of 'next' will\n\t// also contain the 'href' with the complete link to the next page.\n\tfor u != nil {\n\t\tresp, err := c.request(http.MethodGet, u, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"fetching files failed: %s\", err.Error())\n\t\t}\n\t\tdefer resp.Close()\n\n\t\tvar r struct {\n\t\t\tapiOKResponseTemplate\n\t\t\tProjects []Project `json:\"items\"`\n\t\t}\n\t\tif err := json.NewDecoder(resp).Decode(&r); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unmarshalling response failed: %s\", err.Error())\n\t\t}\n\t\tprojects = append(projects, r.Projects...)\n\n\t\tu = nil\n\t\tfor _, link := range r.Links {\n\t\t\tif link.Rel == \"next\" {\n\t\t\t\tu = mustParseURL(link.Href)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn projects, nil\n}", "func (test *Test) GetProjects() ([]models.Project, error) {\n\treturn tests.NormalProjects, nil\n}", "func (k *Keystone) GetProjectAPI(c echo.Context) error {\n\tclusterID := c.Request().Header.Get(xClusterIDKey)\n\tif ke := getKeystoneEndpoints(clusterID, k.endpointStore); len(ke) > 0 {\n\t\tc.Request().URL.Path = path.Join(c.Request().URL.Path, c.Param(\"id\"))\n\t\treturn k.proxyRequest(c, ke)\n\t}\n\n\ttoken, err := k.validateToken(c.Request())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TODO(dfurman): prevent panic: use fields without pointers in models and/or provide getters with nil checks\n\tfor _, role := range token.User.Roles {\n\t\tif role.Project.ID == c.Param(\"id\") {\n\t\t\treturn c.JSON(http.StatusOK, &ProjectResponse{\n\t\t\t\tProject: role.Project,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn c.JSON(http.StatusNotFound, nil)\n}", "func getProjectClients(ctx iris.Context) {\n\tprojectID := ctx.Params().Get(\"projectID\")\n\tif projectID == \"\" {\n\t\thandleError(ctx, apiErrors.ErrBadRequest)\n\t\treturn\n\t}\n\n\tresult, err := store.GetProjectClients(projectID)\n\tif err != nil {\n\t\thandleError(ctx, err)\n\t\treturn\n\t}\n\n\trender.JSON(ctx, iris.StatusOK, result)\n}", "func (s *Server) Get(ctx context.Context, q *project.ProjectQuery) (*v1alpha1.AppProject, error) {\n\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceProjects, rbacpolicy.ActionGet, q.Name); err != nil {\n\t\treturn nil, err\n\t}\n\tproj, err := s.appclientset.ArgoprojV1alpha1().AppProjects(s.ns).Get(ctx, q.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproj.NormalizeJWTTokens()\n\treturn proj, err\n}", "func ProjectList(c *gin.Context) error {\n\tuserID, err := GetIDParam(c, userIDParam)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toption := &model.ProjectQueryOption{\n\t\tUserID: userID,\n\t}\n\n\tif limit := c.Query(\"limit\"); limit != \"\" {\n\t\tif i, err := strconv.Atoi(limit); err == nil {\n\t\t\toption.Limit = i\n\t\t}\n\t}\n\n\tif offset := c.Query(\"offset\"); offset != \"\" {\n\t\tif i, err := strconv.Atoi(offset); err == nil {\n\t\t\toption.Offset = i\n\t\t}\n\t}\n\n\tif order := c.Query(\"order\"); order != \"\" {\n\t\toption.Order = order\n\t} else {\n\t\toption.Order = \"-created_at\"\n\t}\n\n\tif err := CheckUserPermission(c, *userID); err == nil {\n\t\toption.Private = true\n\t}\n\n\tlist, err := model.GetProjectList(option)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn common.APIResponse(c, http.StatusOK, list)\n}", "func (c *Client) getProjectID(owner, repoName, projURL string) (int64, error) {\n\tvar cancels []context.CancelFunc\n\tdefer func() {\n\t\tfor _, cancel := range cancels {\n\t\t\tcancel()\n\t\t}\n\t}()\n\tvar page int\n\tfor {\n\t\tplo := &gh.ProjectListOptions{\n\t\t\tListOptions: gh.ListOptions{\n\t\t\t\tPage: page,\n\t\t\t\tPerPage: 10,\n\t\t\t},\n\t\t}\n\t\tctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\n\t\tcancels = append(cancels, cancel)\n\t\tprojects, resp, err := c.GHClient.Repositories.ListProjects(ctx, owner, repoName, plo)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tfor _, project := range projects {\n\t\t\tif project.GetHTMLURL() == projURL {\n\t\t\t\treturn project.GetID(), nil\n\t\t\t}\n\t\t}\n\t\tpage = resp.NextPage\n\t\tif page == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn 0, nil\n}", "func Company_get_multiple_by_project () {\n\n // GET /projects/{project_id}/companies.json\n\n }", "func (w *ServerInterfaceWrapper) GetProject(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"id\" -------------\n\tvar id string\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// HasSecurity is set\n\n\tctx.Set(\"OpenId.Scopes\", []string{\"exitus/project.read\"})\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.GetProject(ctx, id)\n\treturn err\n}", "func (c *TransferJobsGetCall) ProjectId(projectId string) *TransferJobsGetCall {\n\tc.urlParams_.Set(\"projectId\", projectId)\n\treturn c\n}", "func (s *service) filterClaProjects(ctx context.Context, projects []*v2ProjectServiceModels.ProjectOutput) []*v2ProjectServiceModels.ProjectOutput { //nolint\n\tresults := make([]*v2ProjectServiceModels.ProjectOutput, 0)\n\tprChan := make(chan *v2ProjectServiceModels.ProjectOutput)\n\tfor _, v := range projects {\n\t\tgo func(projectOutput *v2ProjectServiceModels.ProjectOutput) {\n\t\t\tproject, err := s.projectRepo.GetCLAGroupsByExternalID(ctx, &v1ProjectParams.GetProjectsByExternalIDParams{\n\t\t\t\tProjectSFID: projectOutput.ID,\n\t\t\t\tPageSize: aws.Int64(1),\n\t\t\t}, DontLoadRepoDetails)\n\t\t\tif err != nil {\n\t\t\t\tlog.Warnf(\"Unable to fetch project details for project with external id %s. error = %s\", projectOutput.ID, err)\n\t\t\t\tprChan <- nil\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif project.ResultCount == 0 {\n\t\t\t\tprChan <- nil\n\t\t\t\treturn\n\t\t\t}\n\t\t\tprChan <- projectOutput\n\t\t}(v)\n\t}\n\tfor range projects {\n\t\tproject := <-prChan\n\t\tif project != nil {\n\t\t\tresults = append(results, project)\n\t\t}\n\t}\n\treturn results\n}", "func (c *CodeShipProvider) GetProjectsList() ([]string, error) {\n\tres, _, err := c.API.ListProjects(c.Context)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.Projects = res.Projects\n\n\tvar strs []string\n\tfor index, project := range res.Projects {\n\t\tstrs = append(strs, fmt.Sprintf(\"[%d] %s\", index, project.Name))\n\t}\n\n\treturn strs, nil\n}", "func Projects() map[string]Project {\n\t// todo don't expose map here\n\treturn projects\n}", "func (ps *ProjectStore) GetAll() ([]models.Project, error) {\n\tvar projects []models.Project\n\n\trows, err := ps.db.Query(`SELECT p.id, p.created_date, p.name, \n\t\t\t\t\t\t\t\t p.key, p.repo, p.homepage,\n\t\t\t\t\t\t\t\t p.icon_url, \n\t\t\t\t\t\t\t \t json_build_object('id', lead.id, 'username', lead.username, 'email', lead.email, 'full_name', lead.full_name, 'profile_picture', lead.profile_picture) AS lead\n\t\t\t\t\t\t\t FROM projects AS p\n\t\t\t\t\t\t\t JOIN users AS lead ON p.lead_id = lead.id;`)\n\tif err != nil {\n\t\treturn projects, handlePqErr(err)\n\t}\n\n\tfor rows.Next() {\n\t\tvar p models.Project\n\n\t\terr = intoProject(rows, &p)\n\t\tif err != nil {\n\t\t\treturn projects, handlePqErr(err)\n\t\t}\n\n\t\tprojects = append(projects, p)\n\t}\n\n\treturn projects, nil\n}", "func (gp *GetProjects) Execute(fed FederatorInterface) error {\n\tvar wg sync.WaitGroup\n\tvar projects hubapi.ProjectList\n\n\thubs := fed.GetHubs()\n\tlog.Debugf(\"GetProjects federator hubs: %+v\", hubs)\n\thubCount := len(hubs)\n\tprojectsListCh := make(chan *hubapi.ProjectList, hubCount)\n\n\twg.Add(hubCount)\n\tfor hubURL, client := range hubs {\n\t\tgo func(client *hub.Client, url string, id string, rt GetProjectsRequestType) {\n\t\t\tdefer wg.Done()\n\t\t\tif rt == ProjectsGetAll {\n\t\t\t\tlog.Debugf(\"querying all projects\")\n\t\t\t\tlist, err := client.ListAllProjects()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Warningf(\"failed to get projects from %s: %v\", url, err)\n\t\t\t\t\tprojectsListCh <- nil\n\t\t\t\t} else {\n\t\t\t\t\tprojectsListCh <- list\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlink := hubapi.ResourceLink{Href: fmt.Sprintf(\"https://%s/api/projects/%s\", url, id)}\n\t\t\t\tlog.Debugf(\"querying project %s\", link.Href)\n\t\t\t\tcl, err := client.GetProject(link)\n\t\t\t\tlog.Debugf(\"response to project query from %s: %+v\", link.Href, cl)\n\t\t\t\tif err != nil {\n\t\t\t\t\tprojectsListCh <- nil\n\t\t\t\t} else {\n\t\t\t\t\tlist := &hubapi.ProjectList{\n\t\t\t\t\t\tTotalCount: 1,\n\t\t\t\t\t\tItems: []hubapi.Project{*cl},\n\t\t\t\t\t}\n\t\t\t\t\tprojectsListCh <- list\n\t\t\t\t}\n\t\t\t}\n\t\t}(client, hubURL, gp.projectID, gp.requestType)\n\t}\n\n\twg.Wait()\n\tfor i := 0; i < hubCount; i++ {\n\t\tresponse := <-projectsListCh\n\t\tif response != nil {\n\t\t\tlog.Debugf(\"a hub responded with project list: %+v\", response)\n\t\t\tgp.mergeProjectList(&projects, response)\n\t\t}\n\t}\n\n\tgetResponse := GetProjectsResponse{\n\t\trequestType: gp.requestType,\n\t\tprojectID: gp.projectID,\n\t\tallProjects: &projects,\n\t}\n\n\tgp.responseCh <- &getResponse\n\treturn nil\n}", "func ProjectListAll(w http.ResponseWriter, r *http.Request) {\n\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Grab context references\n\trefStr := gorillaContext.Get(r, \"str\").(stores.Store)\n\n\t// Get Results Object\n\n\tres, err := projects.Find(\"\", \"\", refStr)\n\n\tif err != nil && err.Error() != \"not found\" {\n\t\terr := APIErrQueryDatastore()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Output result to JSON\n\tresJSON, err := res.ExportJSON()\n\n\tif err != nil {\n\t\terr := APIErrExportJSON()\n\t\trespondErr(w, err)\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n\n}", "func GetProjectDetails(projectID string) m.ProjectDetails {\n body, err := authenticatedGet(\"projects/\" + projectID)\n if err != nil {\n panic(err.Error())\n }\n\n // Get the Project body\n var responseData projectDetailsResponse\n err = json.Unmarshal(body, &responseData)\n if err != nil {\n panic(err.Error())\n }\n\n return responseData.Data\n}", "func getRequestedProjects(names []string, all bool) ([]*ddevapp.DdevApp, error) {\n\trequestedProjects := make([]*ddevapp.DdevApp, 0)\n\n\t// If no project is specified, return the current project\n\tif len(names) == 0 && !all {\n\t\tproject, err := ddevapp.GetActiveApp(\"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn append(requestedProjects, project), nil\n\t}\n\n\tallDockerProjects := ddevapp.GetDockerProjects()\n\n\t// If all projects are requested, return here\n\tif all {\n\t\treturn allDockerProjects, nil\n\t}\n\n\t// Convert all projects slice into map indexed by project name to prevent duplication\n\tallDockerProjectMap := map[string]*ddevapp.DdevApp{}\n\tfor _, project := range allDockerProjects {\n\t\tallDockerProjectMap[project.Name] = project\n\t}\n\n\t// Select requested projects\n\trequestedProjectsMap := map[string]*ddevapp.DdevApp{}\n\tfor _, name := range names {\n\t\tvar exists bool\n\t\t// If the requested project name is found in the docker map, OK\n\t\t// If not, if we find it in the globl project list, OK\n\t\t// Otherwise, error.\n\t\tif requestedProjectsMap[name], exists = allDockerProjectMap[name]; !exists {\n\t\t\tif _, exists = globalconfig.DdevGlobalConfig.ProjectList[name]; exists {\n\t\t\t\trequestedProjectsMap[name] = &ddevapp.DdevApp{Name: name}\n\t\t\t} else {\n\t\t\t\treturn nil, fmt.Errorf(\"could not find requested project %s\", name)\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// Convert map back to slice\n\tfor _, project := range requestedProjectsMap {\n\t\trequestedProjects = append(requestedProjects, project)\n\t}\n\n\treturn requestedProjects, nil\n}", "func (k *Client) GetProjectIDByName(\n\tctx context.Context, id, password, projectName string, domain *Domain) (string, error) {\n\t// Fetch unscoped token\n\ttoken, err := k.obtainUnscopedToken(ctx, id, password, domain)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// Get project list with unscoped token\n\trequest, err := http.NewRequest(http.MethodGet, k.getURL(\"/auth/projects\"), nil)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"creating HTTP request failed\")\n\t}\n\trequest = request.WithContext(ctx) // TODO(mblotniak): use http.NewRequestWithContext after go 1.13 upgrade\n\thttputil.SetContextHeaders(request)\n\trequest.Header.Set(xAuthTokenHeader, token)\n\n\tvar output *projectListResponse\n\tresp, err := k.HTTPDoer.Do(request)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"issuing HTTP request failed\")\n\t}\n\tdefer resp.Body.Close() // nolint: errcheck\n\n\tif err = httputil.CheckStatusCode([]int{http.StatusOK}, resp.StatusCode); err != nil {\n\t\treturn \"\", httputil.ErrorFromResponse(err, resp)\n\t}\n\n\tif err = json.NewDecoder(resp.Body).Decode(&output); err != nil {\n\t\treturn \"\", errors.Wrapf(httputil.ErrorFromResponse(err, resp), \"decoding response body failed\")\n\t}\n\n\tfor _, project := range output.Projects {\n\t\tif project.Name == projectName {\n\t\t\treturn project.ID, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"'%s' not a valid project name\", projectName)\n}", "func GetProjectTasks(projectID string) (tasks []m.ProjectTask, err error) {\n\t// Get list of IDs\n\tidsList, err := getProjectTaskIDS(projectID)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Concurrently expand the list of project tasks\n\ttasksLength := len(idsList)\n\n\ttype empty struct{} // Semaphore for timing and sequencing\n\tsem := make(chan empty, tasksLength) // as we are loading tasks\n\ttaskErrorChan := make(chan error)\n\n\t// Empty slice to hold our tasks details\n\ttasks = make([]m.ProjectTask, tasksLength)\n\n\tfor i, task := range idsList {\n\t\t// Spin up a goroutine as a closure over the\n\t\t// results slice and loop through each task\n\t\tgo func(i int, taskID int) {\n\t\t\ttasks[i], err = getProjectTaskDetail(taskID)\n\t\t\tif err != nil {\n\t\t\t\ttaskErrorChan <- err\n\t\t\t}\n\t\t\t// Ping back on the channel when it is done\n\t\t\tsem <- empty{}\n\t\t}(i, task.ID)\n\t}\n\t// Wait for each goroutine on the channel to ping back\n\tfor i := 0; i < tasksLength; i++ {\n\t\tselect {\n\t\tcase _ = <-sem: // Do nothing\n\t\tcase err := <-taskErrorChan:\n\t\t\tfmt.Printf(\"Error when loading task details: %s\\n\", err.Error())\n\t\t\t// Bail early from further processing\n\t\t\tbreak\n\t\t}\n\t}\n\n\tclose(taskErrorChan)\n\tclose(sem)\n\n\treturn\n}", "func getRequestedProjects(names []string, all bool) ([]*ddevapp.DdevApp, error) {\n\trequestedProjects := make([]*ddevapp.DdevApp, 0)\n\n\t// If no project is specified, return the current project\n\tif len(names) == 0 && !all {\n\t\tproject, err := ddevapp.GetActiveApp(\"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn append(requestedProjects, project), nil\n\t}\n\n\tallProjects := ddevapp.GetApps()\n\n\t// If all projects are requested, return here\n\tif all {\n\t\treturn allProjects, nil\n\t}\n\n\t// Convert all projects slice into map indexed by project name to prevent duplication\n\tallProjectsMap := map[string]*ddevapp.DdevApp{}\n\tfor _, project := range allProjects {\n\t\tallProjectsMap[project.Name] = project\n\t}\n\n\t// Select requested projects\n\trequestedProjectsMap := map[string]*ddevapp.DdevApp{}\n\tfor _, name := range names {\n\t\tvar exists bool\n\t\tif requestedProjectsMap[name], exists = allProjectsMap[name]; !exists {\n\t\t\treturn nil, fmt.Errorf(\"could not find project %s\", name)\n\t\t}\n\t}\n\n\t// Convert map back to slice\n\tfor _, project := range requestedProjectsMap {\n\t\trequestedProjects = append(requestedProjects, project)\n\t}\n\n\treturn requestedProjects, nil\n}", "func (c *ProjectsService) GetByTeam(teamID string) ([]Project, *Response, error) {\n\turlStr := fmt.Sprintf(\"teams/%s/projects\", teamID)\n\n\treq, err := c.client.NewRequest(http.MethodGet, urlStr, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tv := new([]Project)\n\n\tresp, err := c.client.Do(req, v)\n\n\treturn *v, resp, err\n}", "func GetProjectList(client *rancher.Client, clusterID string) (*management.ProjectCollection, error) {\n\tvar projectsList *management.ProjectCollection\n\n\tprojectsList, err := client.Management.Project.List(&types.ListOpts{\n\t\tFilters: map[string]interface{}{\n\t\t\t\"clusterId\": clusterID,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn projectsList, err\n\t}\n\n\treturn projectsList, nil\n}", "func (s *service) filterClaProjects(projects []*v2ProjectServiceModels.ProjectOutput) []*v2ProjectServiceModels.ProjectOutput { //nolint\n\tresults := make([]*v2ProjectServiceModels.ProjectOutput, 0)\n\tprChan := make(chan *v2ProjectServiceModels.ProjectOutput)\n\tfor _, v := range projects {\n\t\tgo func(projectOutput *v2ProjectServiceModels.ProjectOutput) {\n\t\t\tproject, err := s.projectRepo.GetCLAGroupsByExternalID(&v1ProjectParams.GetProjectsByExternalIDParams{\n\t\t\t\tProjectSFID: projectOutput.ID,\n\t\t\t\tPageSize: aws.Int64(1),\n\t\t\t}, DontLoadRepoDetails)\n\t\t\tif err != nil {\n\t\t\t\tlog.Warnf(\"Unable to fetch project details for project with external id %s. error = %s\", projectOutput.ID, err)\n\t\t\t\tprChan <- nil\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif project.ResultCount == 0 {\n\t\t\t\tprChan <- nil\n\t\t\t\treturn\n\t\t\t}\n\t\t\tprChan <- projectOutput\n\t\t}(v)\n\t}\n\tfor range projects {\n\t\tproject := <-prChan\n\t\tif project != nil {\n\t\t\tresults = append(results, project)\n\t\t}\n\t}\n\treturn results\n}", "func (s projectService) GetAll() ([]*Project, error) {\n\titems := []*Project{}\n\tpath, err := getAllPath(s)\n\tif err != nil {\n\t\treturn items, err\n\t}\n\n\t_, err = apiGet(s.getClient(), &items, path)\n\treturn items, err\n}", "func ProjectGetHandler(w http.ResponseWriter, r *http.Request) {\n\tsession, _ := usession.Store.Get(r, \"session\")\n\tuserSession := getUserSession(session)\n\tuserDB := data.UserDB{Email: userSession.Email}\n\n\t// If user is unauthenticated, add flash message and return\n\tif auth := userSession.Authenticated; !auth {\n\t\tsession.AddFlash(\"Sign in your account!\")\n\t\terr := session.Save(r, w)\n\n\t\tif err != nil {\n\t\t\tutils.Error(err, \"Error occurred while trying to save session.\\n\")\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\thttp.Redirect(w, r, \"/signin\", http.StatusSeeOther)\n\t\treturn\n\t}\n\n\tvars := mux.Vars(r)\n\tprojectUUID := vars[\"key\"]\n\n\t// If user tries to get an access to project in which he's not in, he gets an error\n\tif exists := userDB.IsInProject(projectUUID); !exists {\n\t\tsession.AddFlash(\"You have no access to this project!\")\n\t\terr := session.Save(r, w)\n\n\t\tif err != nil {\n\t\t\tutils.Error(err, \"Error occurred while trying to save session.\\n\")\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\thttp.Redirect(w, r, \"/projects\", http.StatusSeeOther)\n\t\treturn\n\t}\n\n\tprojectDB := data.ProjectDB{Uuid: projectUUID}\n\n\terr := projectDB.ReadName()\n\tif err != nil {\n\t\tutils.Error(err, \"Error occurred while trying to read project's name.\\n\")\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\terr = projectDB.ReadProjectDescription()\n\tif err != nil {\n\t\tutils.Error(err, \"Error occurred while trying to read project's description.\\n\")\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\temployees, err := projectDB.ReadEmployees()\n\tif err != nil {\n\t\tutils.Error(err, \"Error occurred while trying to read employees of project.\\n\")\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tvar specialty string\n\n\tfor _, employee := range employees {\n\t\tif employee.Email == userDB.Email {\n\t\t\tspecialty = employee.Specialty\n\t\t\tbreak\n\t\t}\n\t}\n\n\ttype ViewData struct {\n\t\tUsername string\n\t\tSpecialty string\n\t\tEmployees []data.Employee\n\t\tProject data.ProjectDB\n\t}\n\n\tdata := ViewData{\n\t\tUsername: userDB.Email,\n\t\tSpecialty: specialty,\n\t\tProject: projectDB,\n\t\tEmployees: employees,\n\t}\n\n\tutils.GenerateHTML(w, data, \"project_layout\", \"navbar\", \"project_main\")\n}", "func projectHandler(w http.ResponseWriter, r *http.Request) {\n\n\thelper.GetProjects(w, r)\n\n}", "func (d *Driver) ProjectGet(partitionID string) (*ProjectGetResponse, error) {\n\tresponse := &ProjectGetResponse{}\n\tgetProject := project.NewFindProjectParams()\n\tgetProject.ID = partitionID\n\tresp, err := d.project.FindProject(getProject, d.auth)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\tresponse.Project = resp.Payload\n\treturn response, nil\n}", "func (d *Dao) HubProjects(c context.Context, projectName string) (projects []*model.HubProject, err error) {\n\tvar req *http.Request\n\n\turl := d.c.BiliHub.Host + _projectURI + \"?page=1&page_size=15&name=\" + projectName\n\tif req, err = d.newRequest(http.MethodGet, url, nil); err != nil {\n\t\treturn\n\t}\n\n\treq.SetBasicAuth(d.c.BiliHub.Username, d.c.BiliHub.Password)\n\n\tif err = d.httpClient.Do(c, req, &projects); err != nil {\n\t\tlog.Error(\"d.HubProjects url(%s) err(%v)\", url, err)\n\t\terr = ecode.MerlinHubRequestErr\n\t\treturn\n\t}\n\n\treturn\n}", "func (mockProvider) GetAllProjectConfigs(c context.Context) (map[string]*tricium.ProjectConfig, error) {\n\treturn map[string]*tricium.ProjectConfig{}, nil\n}" ]
[ "0.76841617", "0.76231533", "0.7400665", "0.73783094", "0.7172055", "0.7072802", "0.7026091", "0.69904083", "0.6946848", "0.6946312", "0.69244397", "0.69090414", "0.6883423", "0.67496324", "0.67429686", "0.6737116", "0.66872513", "0.66619146", "0.66527873", "0.66122216", "0.6600862", "0.6595588", "0.6587969", "0.6586183", "0.6538298", "0.6533801", "0.6469894", "0.64388335", "0.6429367", "0.6413127", "0.6392884", "0.63677526", "0.6355276", "0.6329932", "0.63246304", "0.6307012", "0.6304611", "0.6298123", "0.629317", "0.62843734", "0.62795365", "0.6275108", "0.62644845", "0.62615675", "0.6255546", "0.62540734", "0.62407076", "0.6228218", "0.6216894", "0.6198458", "0.6197494", "0.6192778", "0.6178518", "0.61756843", "0.61663824", "0.61549675", "0.615135", "0.6149308", "0.613814", "0.6132859", "0.61074626", "0.6107118", "0.6093035", "0.60873634", "0.6078798", "0.60761076", "0.60554016", "0.60449725", "0.6027734", "0.6003323", "0.5995886", "0.59787536", "0.59749526", "0.5955844", "0.5935926", "0.5933674", "0.59253013", "0.59132814", "0.5895991", "0.5894057", "0.5884941", "0.5881107", "0.5876", "0.5874654", "0.5874588", "0.5851291", "0.5848924", "0.58289397", "0.5827571", "0.58182186", "0.5814886", "0.58068985", "0.57993007", "0.579657", "0.5796369", "0.57959193", "0.5794653", "0.57808214", "0.57807535", "0.5766625" ]
0.8194551
0
GetPeerIdentity gets the connection's peer identity.
GetPeerIdentity получает идентичность узла соединения.
func (client *Client) GetPeerIdentity() (*identity.PeerIdentity, error) { return client.conn.PeerIdentity() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) GetIdentity(ctx context.Context) (string, error) {\n\tres, err := c.RpcClient.GetIdentity(ctx)\n\terr = checkRpcResult(res.GeneralResponse, err)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn res.Result.Identity, nil\n}", "func (ac *authenticatedConnection) RemotePeer() peer.ID {\n\treturn ac.remotePeerID\n}", "func (s *MessagesSendEncryptedServiceRequest) GetPeer() (value InputEncryptedChat) {\n\tif s == nil {\n\t\treturn\n\t}\n\treturn s.Peer\n}", "func (c *cConn) Peer() string {\n\treturn c.peer\n}", "func (c *clientConn) PeerID() (spiffeid.ID, error) {\n\treturn PeerIDFromConnectionState(c.Conn.ConnectionState())\n}", "func (c *Component) GetPeerConn(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (*grpc.ClientConn, error) {\n\treturn c.cluster.GetPeerConn(ctx, role, ids)\n}", "func (m *BgpConfiguration) GetPeerIpAddress()(*string) {\n val, err := m.GetBackingStore().Get(\"peerIpAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func GetConnIdentity(logf logger.Logf, c net.Conn) (ci *ConnIdentity, err error) {\n\tci = &ConnIdentity{conn: c}\n\th, ok := c.(interface {\n\t\tFd() uintptr\n\t})\n\tif !ok {\n\t\treturn ci, fmt.Errorf(\"not a windows handle: %T\", c)\n\t}\n\tpid, err := getNamedPipeClientProcessId(windows.Handle(h.Fd()))\n\tif err != nil {\n\t\treturn ci, fmt.Errorf(\"getNamedPipeClientProcessId: %v\", err)\n\t}\n\tci.pid = int(pid)\n\tuid, err := pidowner.OwnerOfPID(ci.pid)\n\tif err != nil {\n\t\treturn ci, fmt.Errorf(\"failed to map connection's pid to a user (WSL?): %w\", err)\n\t}\n\tci.userID = ipn.WindowsUserID(uid)\n\tu, err := LookupUserFromID(logf, uid)\n\tif err != nil {\n\t\treturn ci, fmt.Errorf(\"failed to look up user from userid: %w\", err)\n\t}\n\tci.user = u\n\treturn ci, nil\n}", "func (a *MessagesAcceptUrlAuthRequest) GetPeer() (value InputPeerClass) {\n\treturn a.Peer\n}", "func (o *TenantWithOfferWeb) GetIdentityProvider() string {\n\tif o == nil || o.IdentityProvider == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.IdentityProvider\n}", "func (peer *peerImp) GetID() types.UInt128 {\n\treturn peer.id.Clone()\n}", "func (o *IppoolPoolMember) GetPeer() IppoolIpLeaseRelationship {\n\tif o == nil || o.Peer == nil {\n\t\tvar ret IppoolIpLeaseRelationship\n\t\treturn ret\n\t}\n\treturn *o.Peer\n}", "func (cfg *Config) GetIdentity() (*core.Member, error) {\n\tif cfg.KeyStore.Key == \"\" {\n\t\treturn nil, errors.New(\"The key should not be nil\")\n\t}\n\tprivKey, err := crypto.LoadPrivateKeyFromFile(cfg.KeyStore.Key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tidentity, err := core.NewMember(privKey.PubKey(), \"self\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn identity, nil\n}", "func (n *NotifyPeer) GetPeer() (value PeerClass) {\n\tif n == nil {\n\t\treturn\n\t}\n\treturn n.Peer\n}", "func (clientHello *ClientHello) GetIdentity() string {\n\treturn clientHello.identity\n}", "func (g *MessagesGetDiscussionMessageRequest) GetPeer() (value InputPeerClass) {\n\tif g == nil {\n\t\treturn\n\t}\n\treturn g.Peer\n}", "func (g *MessagesGetMessagesViewsRequest) GetPeer() (value InputPeerClass) {\n\tif g == nil {\n\t\treturn\n\t}\n\treturn g.Peer\n}", "func (c *Connection) Identity() *identity.Identity {\n\treturn c.identity\n}", "func (pc peerConn) ID() ID {\r\n\treturn PubKeyToID(pc.conn.(*tmconn.SecretConnection).RemotePubKey())\r\n}", "func CtxPeerId(ctx context.Context) (string, error) {\n\tif peerId, ok := ctx.Value(contextKeyPeerId).(string); ok {\n\t\treturn peerId, nil\n\t}\n\tif conn, ok := ctx.Value(drpcctx.TransportKey{}).(sec.SecureConn); ok {\n\t\treturn conn.RemotePeer().String(), nil\n\t}\n\treturn \"\", ErrPeerIdNotFoundInContext\n}", "func (g *MessagesGetPeerSettingsRequest) GetPeer() (value InputPeerClass) {\n\tif g == nil {\n\t\treturn\n\t}\n\treturn g.Peer\n}", "func (o *ResourcepoolPoolMember) GetPeer() ResourcepoolLeaseRelationship {\n\tif o == nil || o.Peer == nil {\n\t\tvar ret ResourcepoolLeaseRelationship\n\t\treturn ret\n\t}\n\treturn *o.Peer\n}", "func (p *Provider) GetIdentity(tok *oauth2.Token) (*id.User, error) {\n\tclient := p.config.Client(oauth2.NoContext, tok)\n\n\t// Twitch doesn't follow the Oauth2 spec correctly. The\n\t// spec states that the access token should be passed\n\t// as a `Bearer` token, but Twitch wants an `Oauth`\n\t// token, so we must include this header.\n\treq, err := http.NewRequest(\"GET\", p.IdentityURL, nil)\n\treq.Header.Add(\"Accept\", \"application/vnd.twitchtv.v3+json\")\n\treq.Header.Add(\"Authorization\", \"OAuth\"+tok.AccessToken)\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tuser := readBody(resp.Body)\n\treturn user, nil\n}", "func (c *BaseAwsClient) GetIdentity() (*identity.Identity, error) {\n\treturn c.getIdentity()\n}", "func (c *Component) GetPeer(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (cluster.Peer, error) {\n\treturn c.cluster.GetPeer(ctx, role, ids)\n}", "func (m *ChatMessage) GetChannelIdentity()(ChannelIdentityable) {\n return m.channelIdentity\n}", "func (this *Protocol) GetMe() PeerId {\n\tifaces, err := net.Interfaces()\n\n\tif err != nil {\n\t\tLog.Warn.Println(err)\n\t}\n\n\tfor _, i := range ifaces {\n\t\taddrs, err := i.Addrs()\n\n\t\tif err == nil {\n\t\t\tfor _, addr := range addrs {\n\t\t\t\tswitch addr.(type) {\n\t\t\t\tcase *net.IPAddr:\n\t\t\t\t\treturn PeerId{Address: addr.String(), Port: this.port}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn PeerId{Address: \"127.0.0.1\", Port: this.port}\n}", "func (m *OnlineMeetingInfo) GetConferenceId()(*string) {\n val, err := m.GetBackingStore().Get(\"conferenceId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func GetIdentity(ctx context.Context) auth.Identity {\n\treturn auth.GetIdentity(ctx)\n}", "func (e *EncryptedChat) GetParticipantID() (value int) {\n\treturn e.ParticipantID\n}", "func (p *Project) GetIdentity() *metadata.Identity {\n\treturn p.Identity\n}", "func (r *MessagesReportRequest) GetPeer() (value InputPeerClass) {\n\tif r == nil {\n\t\treturn\n\t}\n\treturn r.Peer\n}", "func (s *MessagesSendMessageRequest) GetPeer() (value InputPeerClass) {\n\tif s == nil {\n\t\treturn\n\t}\n\treturn s.Peer\n}", "func (d *Dialog) GetInputPeer() TL {\n\tswitch d.Type {\n\tcase DIALOG_TYPE_CHAT:\n\t\treturn TL_inputPeerChat{\n\t\t\tChat_id: d.PeerID,\n\t\t}\n\tcase DIALOG_TYPE_CHANNEL:\n\t\treturn TL_inputPeerChannel{\n\t\t\tChannel_id: d.PeerID,\n\t\t\tAccess_hash: d.PeerAccessHash,\n\t\t}\n\tcase DIALOG_TYPE_USER:\n\t\treturn TL_inputPeerUser{\n\t\t\tUser_id: d.PeerID,\n\t\t}\n\tdefault:\n\t\treturn nil\n\t}\n}", "func (m *ConnectedOrganizationMembers) GetConnectedOrganizationId()(*string) {\n return m.connectedOrganizationId\n}", "func (m *SocialIdentityProvider) GetClientId()(*string) {\n val, err := m.GetBackingStore().Get(\"clientId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (client IdentityClient) GetIdentityProvider(ctx context.Context, request GetIdentityProviderRequest) (response GetIdentityProviderResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.getIdentityProvider, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = GetIdentityProviderResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = GetIdentityProviderResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(GetIdentityProviderResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into GetIdentityProviderResponse\")\n\t}\n\treturn\n}", "func (pc peerConn) RemoteIP() net.IP {\r\n\tif pc.ip != nil {\r\n\t\treturn pc.ip\r\n\t}\r\n\r\n\t// In test cases a conn could not be present at all or be an in-memory\r\n\t// implementation where we want to return a fake ip.\r\n\tif pc.conn == nil || pc.conn.RemoteAddr().String() == \"pipe\" {\r\n\t\tpc.ip = net.IP{172, 16, 0, byte(atomic.AddUint32(&testIPSuffix, 1))}\r\n\r\n\t\treturn pc.ip\r\n\t}\r\n\r\n\thost, _, err := net.SplitHostPort(pc.conn.RemoteAddr().String())\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tips, err := net.LookupIP(host)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tpc.ip = ips[0]\r\n\r\n\treturn pc.ip\r\n}", "func (k *KeyPair) GetID() (peer.ID, error) {\n\treturn peer.IDFromPublicKey(k.GetPublicKey())\n}", "func (e *EncryptedChatRequested) GetParticipantID() (value int) {\n\treturn e.ParticipantID\n}", "func (p *Provider) GetIdentity(tok *oauth2.Token) (*id.User, error) {\n\tclient := p.config.Client(oauth2.NoContext, tok)\n\n\tresp, err := client.Get(p.IdentityURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tuser := readBody(resp.Body)\n\treturn user, nil\n}", "func (pub *Publisher) GetIdentity() *types.PublisherIdentityMessage {\n\tident, _ := pub.registeredIdentity.GetFullIdentity()\n\treturn &ident.PublisherIdentityMessage\n}", "func PeerID() string {\n\treturn \"-UT3530-\" + Base62String(12)\n}", "func GetIdentityProvider(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *IdentityProviderState, opts ...pulumi.ResourceOption) (*IdentityProvider, error) {\n\tvar resource IdentityProvider\n\terr := ctx.ReadResource(\"azure-native:apimanagement/v20190101:IdentityProvider\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (ac *authenticatedConnection) LocalPeer() peer.ID {\n\treturn ac.localPeerID\n}", "func (q *CoreClient) GetIdentity() (identity JenkinsIdentity, err error) {\n\terr = q.RequestWithData(http.MethodGet, \"/instance\", nil, nil, 200, &identity)\n\treturn\n}", "func (o *UserDisco) GetIdentity() FullIdentity {\n\tif o == nil || o.Identity == nil {\n\t\tvar ret FullIdentity\n\t\treturn ret\n\t}\n\treturn *o.Identity\n}", "func (obj *MessengerUser) Identity() string {\n\tproxyResult := /*pr4*/ C.vssq_messenger_user_identity(obj.cCtx)\n\n\truntime.KeepAlive(obj)\n\n\treturn C.GoString(C.vsc_str_chars(proxyResult)) /* r5.1 */\n}", "func (o *MacpoolPoolMemberAllOf) GetPeer() MacpoolLeaseRelationship {\n\tif o == nil || o.Peer == nil {\n\t\tvar ret MacpoolLeaseRelationship\n\t\treturn ret\n\t}\n\treturn *o.Peer\n}", "func GetTouchPeer() *TouchPeer {\n\tLogDebug(\"IN\")\n\tif touchPeer == nil {\n\t\ttouchPeer = &TouchPeer{}\n\t}\n\tLogDebug(\"OUT\")\n\treturn touchPeer\n}", "func (g *MessagesGetScheduledMessagesRequest) GetPeer() (value InputPeerClass) {\n\tif g == nil {\n\t\treturn\n\t}\n\treturn g.Peer\n}", "func (r BytesRecord) GetIdentity() RID {\n\treturn r.RID\n}", "func (o *IdentityCredentialIdentifierOidcProperties) GetProvider() string {\n\tif o == nil || o.Provider == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Provider\n}", "func (ch *CertHandler) GetParticipantID() string {\n\t// TODO: implement\n\treturn \"participant1\"\n}", "func (o *VirtualizationBaseHostPciDeviceAllOf) GetIdentity() string {\n\tif o == nil || o.Identity == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Identity\n}", "func (m *IncomingContext) GetObservedParticipantId()(*string) {\n return m.observedParticipantId\n}", "func (n *NotifyForumTopic) GetPeer() (value PeerClass) {\n\tif n == nil {\n\t\treturn\n\t}\n\treturn n.Peer\n}", "func (p *presignerT) PresignGetCallerIdentity(ctx context.Context) (\n\t*v4.PresignedHTTPRequest, error) {\n\treturn p.presignGetCallerIdentity(ctx)\n}", "func GetPeer(id string) (*Peer, error) {\n\tpair, err := context.Store.Get(peerPrefix + id)\n\tif err != nil || pair == nil {\n\t\treturn nil, err\n\t}\n\n\tvar p Peer\n\tif err := json.Unmarshal(pair.Value, &p); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &p, nil\n}", "func (c VpnCredential) GetID() string { return c.ID }", "func (c *clientIdentityImpl) GetID() (string, error) {\n\t// The leading \"x509::\" distinguishes this as an X509 certificate, and\n\t// the subject and issuer DNs uniquely identify the X509 certificate.\n\t// The resulting ID will remain the same if the certificate is renewed.\n\tid := fmt.Sprintf(\"x509::%s::%s\", getDN(&c.cert.Subject), getDN(&c.cert.Issuer))\n\treturn base64.StdEncoding.EncodeToString([]byte(id)), nil\n}", "func (p *ProofRequestHolder) GetVerifierIdentity() did.DID {\n\treturn p.ProofRequest.ProofRequest.Verifier\n}", "func (ep *epInfoCache) GetIdentity() identity.NumericIdentity {\n\treturn ep.identity\n}", "func (ci *ConnectionInfo) GetID() (id string) {\n\tci.RLock()\n\tid = ci.id\n\tci.RUnlock()\n\treturn\n}", "func (o *VersionedConnection) GetIdentifier() string {\n\tif o == nil || o.Identifier == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Identifier\n}", "func (o *FcNeighborAllOf) GetPeerIpAddress() string {\n\tif o == nil || o.PeerIpAddress == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PeerIpAddress\n}", "func (m *AzureCommunicationServicesUserConversationMember) GetAzureCommunicationServicesId()(*string) {\n val, err := m.GetBackingStore().Get(\"azureCommunicationServicesId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func GetIdentity(externalID string, externalIDType string, accessToken string) (client.Identity, error) {\n\tif provider != nil {\n\t\treturn provider.GetIdentity(externalID, externalIDType, accessToken)\n\t}\n\treturn client.Identity{}, fmt.Errorf(\"No auth provider configured\")\n}", "func (n *Node) GetPeerInfo(ctx context.Context, req *api.PeerRequest) (*api.PeerInfo, error) {\n\tif err := checkSource(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// food for discovery\n\thost := api.GrpcPeerHost(ctx)\n\tn.CheckPeerIsKnown(host, nil)\n\n\tvar id hash.Peer\n\n\tif req.PeerID == \"\" {\n\t\tid = n.ID\n\t} else {\n\t\tid = hash.HexToPeer(req.PeerID)\n\t}\n\n\tif id == n.ID { // self\n\t\tinfo := n.AsPeer()\n\t\treturn info.ToWire(), nil\n\t}\n\n\tinfo := n.store.GetWirePeer(id)\n\tif info == nil {\n\t\treturn nil, status.Error(codes.NotFound, fmt.Sprintf(\"peer not found: %s\", req.PeerID))\n\t}\n\n\treturn info, nil\n}", "func (m *AuthenticationContext) 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}", "func PeerIDFromConn(conn net.Conn) (spiffeid.ID, error) {\n\tif getter, ok := conn.(PeerIDGetter); ok {\n\t\treturn getter.PeerID()\n\t}\n\treturn spiffeid.ID{}, spiffetlsErr.New(\"connection does not expose peer ID\")\n}", "func (m *TeamworkConversationIdentity) GetConversationIdentityType()(*TeamworkConversationIdentityType) {\n return m.conversationIdentityType\n}", "func (c *Client) GetEmailIdentity(ctx context.Context, params *GetEmailIdentityInput, optFns ...func(*Options)) (*GetEmailIdentityOutput, error) {\n\tif params == nil {\n\t\tparams = &GetEmailIdentityInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetEmailIdentity\", params, optFns, c.addOperationGetEmailIdentityMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetEmailIdentityOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "func (c *clientIdentityImpl) getIdentity() (*msp.SerializedIdentity, error) {\n\tsid := &msp.SerializedIdentity{}\n\n\terr := proto.Unmarshal(c.creator, sid)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to unmarshal transaction invoker's identity\")\n\t}\n\treturn sid, nil\n}", "func (device *SilentStepperBrick) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "func (validator *validatorImpl) GetID() []byte {\n\treturn validator.peer.GetID()\n}", "func (c *Config) GetIdP() string { //nolint: golint\n\treturn c.member.GetString(identityProviderName)\n}", "func (m *CommunicationsIdentitySet) GetAssertedIdentity()(Identityable) {\n val, err := m.GetBackingStore().Get(\"assertedIdentity\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(Identityable)\n }\n return nil\n}", "func (t *MessagesTranslateTextRequest) GetPeer() (value InputPeerClass, ok bool) {\n\tif t == nil {\n\t\treturn\n\t}\n\tif !t.Flags.Has(0) {\n\t\treturn value, false\n\t}\n\treturn t.Peer, true\n}", "func (c *CallSession) GetPeer(_ context.Context) (*CallSession, error) {\n\tvar (\n\t\tpeercall *CallSession\n\t\terr error\n\t)\n\n\tif len(c.CallPeer.CallID) > 0 && c.Blade != nil {\n\t\tpeercall, err = c.Blade.EventCalling.Cache.GetCallCache(c.CallPeer.CallID)\n\t}\n\n\treturn peercall, err\n}", "func (m *SocialIdentityProvider) GetClientId()(*string) {\n return m.clientId\n}", "func (e *Engine) GetPeerConnectionStatus(peerKey string) *Status {\n\te.peerMux.Lock()\n\tdefer e.peerMux.Unlock()\n\n\tconn, exists := e.conns[peerKey]\n\tif exists && conn != nil {\n\t\treturn &conn.Status\n\t}\n\n\treturn nil\n}", "func (peer *Peer) GetAddr() *common.NetAddress {\n\tpeer.lock.RLock()\n\tdefer peer.lock.RUnlock()\n\treturn peer.addr\n}", "func (u *User) GetPhotoID(tx *pop.Connection) (*string, error) {\n\tif err := tx.Load(u, \"PhotoFile\"); err != nil {\n\t\treturn nil, err\n\t}\n\tif u.FileID.Valid {\n\t\tphotoID := u.PhotoFile.UUID.String()\n\t\treturn &photoID, nil\n\t}\n\n\treturn nil, nil\n}", "func (p *Packet) GetConnectionID() (ConnectionID [16]byte) {\n\t// UIP don't support ConnectionID == 0!\n\t// Hack situation || DDoS attack || ...\n}", "func (m *Identity) GetCertificate() []byte {\n\tif m != nil {\n\t\treturn m.Certificate\n\t}\n\treturn nil\n}", "func (sm *SyncManager) SyncPeerID() uint64 {\n\treply := make(chan uint64)\n\tsm.msgChan <- getSyncPeerMsg{reply: reply}\n\treturn <-reply\n}", "func (sm *SyncManager) SyncPeerID() uint64 {\n\treply := make(chan uint64)\n\tsm.msgChan <- getSyncPeerMsg{reply: reply}\n\treturn <-reply\n}", "func (validator *validatorImpl) GetEnrollmentID() string {\n\treturn validator.peer.GetEnrollmentID()\n}", "func (p *peer) GetAddr() *bnet.IP {\n\treturn p.addr\n}", "func (client PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *PeerExpressRouteCircuitConnectionsGetOptions) (PeerExpressRouteCircuitConnectionResponse, error) {\n\treq, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options)\n\tif err != nil {\n\t\treturn PeerExpressRouteCircuitConnectionResponse{}, err\n\t}\n\tresp, err := client.Pipeline().Do(req)\n\tif err != nil {\n\t\treturn PeerExpressRouteCircuitConnectionResponse{}, err\n\t}\n\tif !resp.HasStatusCode(http.StatusOK) {\n\t\treturn PeerExpressRouteCircuitConnectionResponse{}, client.getHandleError(resp)\n\t}\n\tresult, err := client.getHandleResponse(resp)\n\tif err != nil {\n\t\treturn PeerExpressRouteCircuitConnectionResponse{}, err\n\t}\n\treturn result, nil\n}", "func (ci CertIdentity) GetPEM() []byte {\n\treturn pem.EncodeToMemory(&pem.Block{\n\t\tType: `CERTIFICATE`,\n\t\tBytes: ci.Cert.Raw,\n\t})\n}", "func (m *IncomingContext) GetSourceParticipantId()(*string) {\n return m.sourceParticipantId\n}", "func (m *ChatMessageAttachment) 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}", "func (e *Credential) GetID() *identity.ID {\n\treturn e.ID\n}", "func (o ConnectionAzurePtrOutput) Identity() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConnectionAzure) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Identity\n\t}).(pulumi.StringPtrOutput)\n}", "func (client IdentityClient) getIdentityProvider(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/identityProviders/{identityProviderId}\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response GetIdentityProviderResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &identityprovider{})\n\treturn response, err\n}", "func (m *CommunicationsIdentitySet) GetEncrypted()(Identityable) {\n val, err := m.GetBackingStore().Get(\"encrypted\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(Identityable)\n }\n return nil\n}", "func (ac *authenticatedConnection) RemotePublicKey() libp2pcrypto.PubKey {\n\treturn ac.remotePeerPublicKey\n}", "func (fds SocketPair) PeerConn() (net.Conn, error) {\n\tfile := fds.PeerFile()\n\tdefer file.Close()\n\tconn, err := net.FileConn(file)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create net.Conn for %s[1]: %w\", fds.fileName(), err)\n\t}\n\treturn conn, nil\n}" ]
[ "0.60653913", "0.59982324", "0.5994207", "0.59636384", "0.5954036", "0.58539706", "0.5807599", "0.58044755", "0.57964677", "0.56881976", "0.5614483", "0.5551721", "0.55338156", "0.55311227", "0.5515146", "0.5501002", "0.54259455", "0.5424778", "0.54058045", "0.53819424", "0.5351896", "0.5346837", "0.5316637", "0.530405", "0.52888954", "0.5275428", "0.52704185", "0.5264655", "0.5260496", "0.52386475", "0.5215985", "0.52077734", "0.520739", "0.5179721", "0.5174176", "0.516106", "0.51576585", "0.51549315", "0.5144425", "0.5142948", "0.513849", "0.5128426", "0.5123017", "0.5119452", "0.50989676", "0.5082475", "0.506668", "0.50420743", "0.50252724", "0.50161874", "0.5011144", "0.5004526", "0.50035846", "0.50005424", "0.49981394", "0.49920097", "0.4990664", "0.49820232", "0.49818933", "0.49746162", "0.4974483", "0.49727982", "0.49717373", "0.49677214", "0.49416897", "0.49313045", "0.49219206", "0.49194875", "0.49176568", "0.49137253", "0.49135673", "0.49047133", "0.48931652", "0.4878727", "0.487039", "0.4866042", "0.4862095", "0.4850108", "0.4847349", "0.4838942", "0.48062846", "0.4797823", "0.4796125", "0.47882247", "0.47839406", "0.4775982", "0.4770867", "0.4770867", "0.47581565", "0.47566044", "0.47523132", "0.4748467", "0.4742652", "0.47235942", "0.4714224", "0.4713219", "0.4701113", "0.46990886", "0.46981943", "0.4697962" ]
0.8242226
0
ignoreEOF is an utility func for ignoring EOF error, when it's not important.
ignoreEOF — это вспомогательная функция для игнорирования ошибки EOF, когда это не важно.
func ignoreEOF(err error) error { if errors.Is(err, io.EOF) { return nil } return err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func IgnoreEOF(err error) error {\n\tif err == io.EOF {\n\t\treturn nil\n\t}\n\treturn err\n}", "func EOF(x error) error { return x }", "func eof(err error) bool { return err == io.EOF }", "func treatEOFErrorsAsNil(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\tif errors.Is(err, io.EOF) {\n\t\treturn nil\n\t}\n\tvar te TTransportException\n\tif errors.As(err, &te) && te.TypeId() == END_OF_FILE {\n\t\treturn nil\n\t}\n\treturn err\n}", "func (c *Conn) parseEOFPacket(b []byte) bool {\n\tvar off int\n\n\toff++ // [fe] the EOF header (= _PACKET_EOF)\n\t// TODO: reset warning count\n\tc.warnings += binary.LittleEndian.Uint16(b[off : off+2])\n\toff += 2\n\tc.statusFlags = binary.LittleEndian.Uint16(b[off : off+2])\n\n\treturn c.reportWarnings()\n}", "func eol(p *Parser, next statefn) statefn {\n\t// TODO: add \"expected bool\" param; if unexpected log a warning\n\terr := consume(p.reader, isEOL) // consume all newline runes\n\tif err != nil {\n\t\treturn errorScanning(p, err)\n\t}\n\treturn next\n}", "func IgnoreIoError(_ int, _ error) {}", "func IsEOF(err error) bool {\n\terr = errs.Cause(err)\n\tif err == io.EOF {\n\t\treturn true\n\t}\n\tif ok, err := libCause(err); ok {\n\t\treturn IsEOF(err)\n\t}\n\treturn false\n}", "func TestEOF(t *testing.T) {\n\tc, s := setUp(t)\n\t// Since we're not using tearDown() here, manually call Finish()\n\tdefer s.ctrl.Finish()\n\n\t// Set up a handler to detect whether disconnected handlers are called\n\tdcon := callCheck(t)\n\tc.Handle(DISCONNECTED, dcon)\n\n\t// Simulate EOF from server\n\ts.nc.Close()\n\n\t// Verify that disconnected handler was called\n\tdcon.assertWasCalled(\"Conn did not call disconnected handlers.\")\n\n\t// Verify that the connection no longer thinks it's connected\n\tif c.Connected() {\n\t\tt.Errorf(\"Conn still thinks it's connected to the server.\")\n\t}\n}", "func (s *scanner) eof() int {\n\tif s.err != nil {\n\t\treturn scanError\n\t}\n\tif s.endTop {\n\t\treturn scanEnd\n\t}\n\ts.step(s, ' ')\n\tif s.endTop {\n\t\treturn scanEnd\n\t}\n\tif s.err == nil {\n\t\ts.err = &SyntaxError{\"unexpected end of Oscript input\", s.bytes}\n\t}\n\n\treturn scanError\n}", "func IsEOF(c rune, n int) bool {\n\treturn n == 0\n}", "func forceEOF(yylex interface{}) {\n\tyylex.(*Tokenizer).ForceEOF = true\n}", "func forceEOF(yylex interface{}) {\n\tyylex.(*Tokenizer).ForceEOF = true\n}", "func forceEOF(yylex interface{}) {\n\tyylex.(*Tokenizer).ForceEOF = true\n}", "func forceEOF(yylex interface{}) {\n\tyylex.(*Tokenizer).ForceEOF = true\n}", "func forceEOF(yylex interface{}) {\n\tyylex.(*Tokenizer).ForceEOF = true\n}", "func isEOF(err error) bool {\n\tstrerr := err.Error()\n\terrlen := len(strerr)\n\treturn errlen >= 3 && strerr[errlen-3:] == io.EOF.Error()\n}", "func isEOF(err error) bool {\n\tstrerr := err.Error()\n\terrlen := len(strerr)\n\treturn errlen >= 3 && strerr[errlen-3:] == io.EOF.Error()\n}", "func (s *Slave) nextEOF() (*Packet, error) {\n\treturn nil, io.EOF\n}", "func Catch(err error) {\n\tif err == io.EOF {\n\t\treturn\n\t} else if err != nil {\n\t\tlogger.Error(err.Error())\n\t}\n}", "func isEOF(tk Token) bool {\n\treturn tk.GetName() == EOF\n}", "func TestIgnoreTruncatedPacketEOF(t *testing.T) {\n\toutputFile, err := ioutil.TempFile(\"\", \"joincap_output_\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\toutputFile.Close()\n\tdefer os.Remove(outputFile.Name())\n\n\terr = joincap([]string{\"joincap\",\n\t\t\"-v\", \"-w\", outputFile.Name(),\n\t\t\"test_pcaps/unexpected_eof_on_second_packet.pcap\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttestIsOrdered(t, outputFile.Name())\n\n\tif packetCount(t, outputFile.Name()) != 1 {\n\t\tt.Fatal(\"error counting\")\n\t}\n}", "func TestExactReadCloserExpectEOF(t *testing.T) {\n\tbuf := bytes.NewBuffer(make([]byte, 10))\n\trc := NewExactReadCloser(&readerNilCloser{buf}, 1)\n\tif _, err := rc.Read(make([]byte, 10)); err != ErrExpectEOF {\n\t\tt.Fatalf(\"expected %v, got %v\", ErrExpectEOF, err)\n\t}\n}", "func (e LogEntry) IsEOF() bool {\n\treturn e.LineNo == -2\n}", "func parseEOFTok(p *parser) parserStateFn {\n\ttok := p.next()\n\tif tok.typ != tokTypeEOF {\n\t\tlg.Fatalf(\"parseEOFTok called with token other than EOF: '%s'\", tok.typ)\n\t}\n\tif p.incompleteBoolOp {\n\t\t// E.g.: \"foo and\"\n\t\treturn p.errorfAt(tok.pos, \"incomplete boolean operator\")\n\t}\n\t// Append all remaining staged ops.\n\t// Note: Lexing already handles unclosed open parens, so we need not check\n\t// that here.\n\tfor p.stagedOps.Len() > 0 {\n\t\tp.filter.addBoolOp(p.stagedOps.Pop())\n\t}\n\treturn nil\n}", "func TestFetchNanNumberEndByNonEOF(t *testing.T) {\n\tinputs := [][]byte{[]byte(\"aN \"), []byte(\"aN{\"), []byte(\"aN}\"), []byte(\"aN[\"), []byte(\"aN]\"), []byte(\"aN:\"), []byte(\"aN,\")}\n\texpected := \"NaN\"\n\n\tfor _, input := range inputs {\n\t\tlex := NewLexer(bytes.NewReader(input))\n\t\terr := lex.fetchNanNumber()\n\t\tif err != nil {\n\t\t\tt.Error(err.Error())\n\t\t\treturn\n\t\t}\n\n\t\ttoken := lex.tokens[0]\n\t\tif token.String() != expected {\n\t\t\tt.Errorf(\"unexpected '%s', expecting '%s'\", token.String(), expected)\n\t\t\treturn\n\t\t}\n\t}\n}", "func (r *chanReader) eof() {\n\tif !r.dataClosed {\n\t\tr.dataClosed = true\n\t\tclose(r.data)\n\t}\n}", "func TestMultiReaderFinalEOF(t *testing.T) {\n\tr := MultiReader(bytes.NewReader(nil), byteAndEOFReader('a'))\n\tbuf := make([]byte, 2)\n\tn, err := r.Read(buf)\n\tif n != 1 || err != EOF {\n\t\tt.Errorf(\"got %v, %v; want 1, EOF\", n, err)\n\t}\n}", "func checkError(e error) {\n\tif e != io.EOF && e != io.ErrUnexpectedEOF {\n\t\tcobra.CheckErr(e)\n\t}\n}", "func drainIteratorIgnoreErrors(ctx *sql.Context, iter sql.RowIter) {\n\tif iter == nil {\n\t\treturn\n\t}\n\n\tfor {\n\t\t_, err := iter.Next(ctx)\n\t\tif err == io.EOF {\n\t\t\treturn\n\t\t}\n\t}\n}", "func TestReadEmptyAtEOF(t *testing.T) {\n\tb := new(Builder)\n\tslice := make([]byte, 0)\n\tn, err := b.Read(slice)\n\tif err != nil {\n\t\tt.Errorf(\"read error: %v\", err)\n\t}\n\tif n != 0 {\n\t\tt.Errorf(\"wrong count; got %d want 0\", n)\n\t}\n}", "func commitEOF() error {\n\treturn cliutil.ActionError(clitypes.CommitEOF)\n}", "func lookErr(err error) error {\n\tif err != nil && err != io.EOF {\n\t\tklog.Warning(err)\n\t}\n\treturn err\n}", "func (p *Buffer) EOF() bool {\n\treturn ulen(p.buf) == p.index\n}", "func TestMultiReaderSingleByteWithEOF(t *testing.T) {\n\tgot, err := ReadAll(LimitReader(MultiReader(byteAndEOFReader('a'), byteAndEOFReader('b')), 10))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tconst want = \"ab\"\n\tif string(got) != want {\n\t\tt.Errorf(\"got %q; want %q\", got, want)\n\t}\n}", "func (s *lexStream) ignore(delim *charGroup) {\r\n\tfor delim.matches(s.peek()) {\r\n\t\ts.next()\r\n\t}\r\n}", "func epipecheck(file *File, e error) {\n\tif e == syscall.EPIPE && file.stdoutOrErr {\n\t\tsigpipe()\n\t}\n}", "func (lex *Lexer) IsEOF() bool {\n\treturn lex.Token == scanner.TEOF\n}", "func (d *Decoder) takeEOL() bool {\n\tif !d.ensure(1) {\n\t\t// End of input.\n\t\treturn true\n\t}\n\tswitch d.at(0) {\n\tcase '\\n':\n\t\t// Regular NL.\n\t\td.advance(1)\n\t\td.line++\n\t\treturn true\n\tcase '\\r':\n\t\tif !d.ensure(2) {\n\t\t\t// CR at end of input.\n\t\t\td.advance(1)\n\t\t\treturn true\n\t\t}\n\t\tif d.at(1) == '\\n' {\n\t\t\t// CR-NL\n\t\t\td.advance(2)\n\t\t\td.line++\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (r *jsonReader) ignoreNext() (raw []byte, err error) {\n\tr.skipWS()\n\n\tsnapshot := r.Snapshot()\n\tbefore := r.Len()\n\n\te, _, err := r.step()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch e {\n\tcase arrStart:\n\t\terr = ignoreKind(r, arrEnd)\n\tcase dictStart:\n\t\terr = ignoreKind(r, dictEnd)\n\tdefault:\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tafter := r.Len()\n\tr.Restore(snapshot)\n\n\tbytes, _ := r.Collect(before - after)\n\treturn bytes, nil\n}", "func TestIgnoreInputFileCorruptGlobalHeader(t *testing.T) {\n\toutputFile, err := ioutil.TempFile(\"\", \"joincap_output_\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\toutputFile.Close()\n\tdefer os.Remove(outputFile.Name())\n\n\terr = joincap([]string{\"joincap\",\n\t\t\"-v\", \"-w\", outputFile.Name(),\n\t\t\"test_pcaps/bad_global.pcap\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif packetCount(t, outputFile.Name()) != 0 {\n\t\tt.Fatal(\"error counting\")\n\t}\n}", "func Ignore(err error) {\n\tif err != nil {\n\t\tlog.Printf(\"ignored: %s\", err)\n\t}\n}", "func skipECS(file io.Reader) error {\n\tbuf := make([]byte, len(EncryptConfirmString))\n\tif _, err := io.ReadFull(file, buf); err != nil {\n\t\treturn err\n\t}\n\tif string(buf) != EncryptConfirmString {\n\t\treturn errors.New(\"data does not start with ECS\")\n\t}\n\treturn nil\n}", "func IgnoreClose(cr io.Closer) {\n\terr := cr.Close()\n\tIgnoreError(err)\n}", "func (c *minecraftConn) handleReadErr(err error) (recoverable bool) {\n\tvar silentErr *errs.SilentError\n\tif errors.As(err, &silentErr) {\n\t\tc.log.V(1).Info(\"silentErr: error reading next packet, unrecoverable and closing connection\", \"err\", err)\n\t\treturn false\n\t}\n\t// Immediately retry for EAGAIN\n\tif errors.Is(err, syscall.EAGAIN) {\n\t\treturn true\n\t}\n\tvar netErr *net.OpError\n\tif errors.As(err, &netErr) {\n\t\tif netErr.Temporary() {\n\t\t\t// Immediately retry for temporary network errors\n\t\t\treturn true\n\t\t} else if netErr.Timeout() {\n\t\t\t// Read timeout, disconnect\n\t\t\tc.log.Error(err, \"read timeout\")\n\t\t\treturn false\n\t\t} else if errs.IsConnClosedErr(netErr.Err) {\n\t\t\t// Connection is already closed\n\t\t\treturn false\n\t\t}\n\t}\n\t// Immediately break for known unrecoverable errors\n\tif errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) ||\n\t\terrors.Is(err, io.ErrNoProgress) || errors.Is(err, io.ErrClosedPipe) ||\n\t\terrors.Is(err, io.ErrShortBuffer) || errors.Is(err, syscall.EBADF) ||\n\t\tstrings.Contains(err.Error(), \"use of closed file\") {\n\t\treturn false\n\t}\n\tc.log.Error(err, \"error reading next packet, unrecoverable and closing connection\")\n\treturn false\n}", "func (rign *CFGoReadIgnore) End(stateNode *snreader.StateNode) (isEnd bool, err error) {\n\treturn true, nil\n}", "func (c *ConsoleWrapper) ExpectEOF() {\n\tout, err := c.console.ExpectEOF()\n\tassert.NoError(c.tester, err, \"Expected EOF. Got %q\", stripansi.Strip(out))\n}", "func (c *ConsoleWrapper) ExpectEOF() {\n\tout, err := c.console.ExpectEOF()\n\tassert.NoError(c.tester, err, \"Expected EOF. Got %q\", stripansi.Strip(out))\n}", "func (l *Lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *Lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *Lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *Lexer) ignore() {\n\tl.start = l.pos\n}", "func skipHeader(f *os.File) error {\n\tbuf := make([]byte, len(TweetJsHeader))\n\tn, err := f.Read(buf)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read from file: %w\", err)\n\t}\n\tif n != len(buf) || string(buf) != TweetJsHeader {\n\t\treturn fmt.Errorf(\"file does not start with expected header. read='%s'\", string(buf))\n\t}\n\treturn nil\n}", "func (d *Decoder) IgnoreUnknownKeys(i bool) {\n\td.ignoreUnknownKeys = i\n}", "func TestFetchExponentNumberEndByNonEOF(t *testing.T) {\n\tinputs := []string{\"123 \", \"123{\", \"123}\", \"123[\", \"123]\", \"123:\", \"123,\"}\n\texpected := \"123\"\n\tfor _, input := range inputs {\n\t\treader := bytes.NewReader([]byte(input))\n\t\tlex := NewLexer(reader)\n\t\tif err := lex.fetchExponentNumber(); err != nil {\n\t\t\tt.Errorf(err.Error())\n\t\t\treturn\n\t\t}\n\n\t\ttoken := lex.tokens[0]\n\n\t\tif token.String() != expected {\n\t\t\tt.Errorf(\"unexpected '%s', expecting '%s'\", token.String(), expected)\n\t\t\treturn\n\t\t}\n\t}\n}", "func (p *Parser) SkipToEndOfLine() {\n\tp.lex.skipToNewline()\n}", "func (s *Scanner) isEof(c byte) bool {\n\tre := regexp.MustCompile(string(\"\"))\n\treturn re.MatchString(string(c))\n}", "func NewEOFToken(s *Source) *EOFToken {\n\treturn &EOFToken{}\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n}", "func readDiscardBody(req *http.Request, resp *http.Response) int64 {\n\tif req.Method == http.MethodHead {\n\t\treturn 0\n\t}\n\n\tw := ioutil.Discard\n\tbytes, err := io.Copy(w, resp.Body)\n\tif err != nil {\n\t\tlog.Printf(\"reading HTTP response body: %v\", err)\n\t}\n\treturn bytes\n}", "func (sc *SrcCursor) Eof() bool {\n\treturn sc.rdOffset >= len(sc.src)-1\n}", "func (l *lexer) ignore() {\r\n\tl.start = l.pos\r\n}", "func (lx *Lexer) ignore() {\n\tlx.start = lx.pos\n}", "func (ps *Parser) EOF() bool {\n\treturn ps.Offset >= len(ps.Runes)\n}", "func (l *Lexer) Ignore() {\n\tl.start = l.pos\n}", "func (l *Lexer) Ignore() {\n\tl.start = l.pos\n}", "func (l *Lexer) Ignore() {\n\tl.start = l.pos\n}", "func (s *ss) mustReadRune() (r rune) {\n\tr = s.getRune()\n\tif r == eof {\n\t\ts.error(io.ErrUnexpectedEOF)\n\t}\n\treturn\n}", "func (l *lexer) ignore() {\n\tl.start = l.pos\n\tl.runeCnt = 0\n}", "func TestFileAddendaOutsideBatch(t *testing.T) {\n\taddenda := mockAddenda()\n\tr := NewReader(strings.NewReader(addenda.String()))\n\t_, err := r.Read()\n\tif err != nil {\n\t\tif p, ok := err.(*ParseError); ok {\n\t\t\tif e, ok := p.Err.(*FileError); ok {\n\t\t\t\tif e.Msg != msgFileBatchOutside {\n\t\t\t\t\tt.Errorf(\"%T: %s\", e, e)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"%T: %s\", err, err)\n\t\t}\n\t}\n}", "func (parser *PdfParser) seekToEOFMarker(fSize int64) error {\n\t// Define the starting point (from the end of the file) to search from.\n\tvar offset int64\n\n\t// Define an buffer length in terms of how many bytes to read from the end of the file.\n\tvar buflen int64 = 1000\n\n\tfor offset < fSize {\n\t\tif fSize <= (buflen + offset) {\n\t\t\tbuflen = fSize - offset\n\t\t}\n\n\t\t// Move back enough (as we need to read forward).\n\t\t_, err := parser.rs.Seek(-offset-buflen, io.SeekEnd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Read the data.\n\t\tb1 := make([]byte, buflen)\n\t\tparser.rs.Read(b1)\n\t\tcommon.Log.Trace(\"Looking for EOF marker: \\\"%s\\\"\", string(b1))\n\t\tind := reEOF.FindAllStringIndex(string(b1), -1)\n\t\tif ind != nil {\n\t\t\t// Found it.\n\t\t\tlastInd := ind[len(ind)-1]\n\t\t\tcommon.Log.Trace(\"Ind: % d\", ind)\n\t\t\tparser.rs.Seek(-offset-buflen+int64(lastInd[0]), io.SeekEnd)\n\t\t\treturn nil\n\t\t}\n\n\t\tcommon.Log.Debug(\"Warning: EOF marker not found! - continue seeking\")\n\t\toffset += buflen\n\t}\n\n\tcommon.Log.Debug(\"Error: EOF marker was not found.\")\n\treturn errors.New(\"EOF not found\")\n}", "func (l *lexer) ignore() {\n\t// l.line += strings.Count(l.input[l.start:l.pos], \"\\n\")\n\tl.start = l.pos\n\tl.startLine = l.line\n}", "func (l *lexer) ignore() {\n\tl.start = l.position\n}", "func (l *lexer) ignore() {\n\tl.start = l.position\n}", "func skip(r *bufio.Reader, delim rune) error {\n\tfor {\n\t\tr1, err := readRune(r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif r1 == delim {\n\t\t\treturn nil\n\t\t}\n\t}\n}", "func TestRMParseCorrupt(t *testing.T) {\n\n\tfiler, err := os.Open(\"../testfiles/7cbc50c9-8d68-48cf-8f77-e70f2e87b732.rm\")\n\tif err != nil {\n\t\tt.Errorf(\"Could not open corrupt rm file %v\", err)\n\t}\n\tdefer filer.Close()\n\n\trm, err := RMParse(filer)\n\tif err != nil {\n\t\tt.Error(\"The corrupted rm file could not be setup for parsing\")\n\t}\n\tok := true\n\tfor rm.Parse() {\n\t\tok = false // should not get here\n\t}\n\tif ok == true {\n\t\tt.Error(\"The corrupted rm file was skipped parsing\")\n\t}\n\n}", "func TestReadUsingNopEncoding(t *testing.T) {\n\ttcs := []struct {\n\t\ttestName string\n\t\tinput []byte\n\t\ttest func(*testing.T, chan *entry.Entry)\n\t}{\n\t\t{\n\t\t\t\"simple\",\n\t\t\t[]byte(\"testlog1\"),\n\t\t\tfunc(t *testing.T, c chan *entry.Entry) {\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog1\"))\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"longer than maxlogsize\",\n\t\t\t[]byte(\"testlog1testlog2testlog3\"),\n\t\t\tfunc(t *testing.T, c chan *entry.Entry) {\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog1\"))\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog2\"))\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog3\"))\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"doesn't hit max log size before eof\",\n\t\t\t[]byte(\"testlog1testlog2test\"),\n\t\t\tfunc(t *testing.T, c chan *entry.Entry) {\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog1\"))\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog2\"))\n\t\t\t\twaitForByteMessage(t, c, []byte(\"test\"))\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"special characters\",\n\t\t\t[]byte(\"testlog1\\n\\ttestlog2\\n\\t\"),\n\t\t\tfunc(t *testing.T, c chan *entry.Entry) {\n\t\t\t\twaitForByteMessage(t, c, []byte(\"testlog1\"))\n\t\t\t\twaitForByteMessage(t, c, []byte(\"\\n\\ttestlo\"))\n\t\t\t\twaitForByteMessage(t, c, []byte(\"g2\\n\\t\"))\n\t\t\t},\n\t\t},\n\t}\n\n\tt.Parallel()\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.testName, func(t *testing.T) {\n\t\t\toperator, logReceived, tempDir := newTestFileOperator(t, func(cfg *Config) {\n\t\t\t\tcfg.MaxLogSize = 8\n\t\t\t\tcfg.Splitter.Encoding = \"nop\"\n\t\t\t})\n\t\t\t// Create a file, then start\n\t\t\ttemp := openTemp(t, tempDir)\n\t\t\tbytesWritten, err := temp.Write(tc.input)\n\t\t\trequire.Greater(t, bytesWritten, 0)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.NoError(t, operator.Start(testutil.NewMockPersister(\"test\")))\n\t\t\tdefer func() {\n\t\t\t\trequire.NoError(t, operator.Stop())\n\t\t\t}()\n\n\t\t\ttc.test(t, logReceived)\n\t\t})\n\t}\n}", "func errorHandler(errp *error) {\n\tif e := recover(); e != nil {\n\t\tif se, ok := e.(scanError); ok { // catch local error\n\t\t\t*errp = se.err\n\t\t} else if eof, ok := e.(error); ok && eof == io.EOF { // out of input\n\t\t\t*errp = eof\n\t\t} else {\n\t\t\tpanic(e)\n\t\t}\n\t}\n}", "func (t *Tokeniser) ignore() {\n\tt.start = t.pos\n\tt.prevLine = t.line\n\tt.prevCol = t.col\n}", "func (lex *Lexer) ignore() {\n\tlex.start = lex.pos\n}", "func (p *parser) skipNewline() {\n\tnl := false\n\tfor {\n\t\ttok := p.l.fetch()\n\t\tif tok != NEWLINE {\n\t\t\tp.l.putTok(tok)\n\t\t\tbreak\n\t\t}\n\t\tnl = true\n\t}\n\tif !nl {\n\t\tpanic(errors.Wrap(errSyntax, \"newline\"))\n\t}\n}", "func (lx *exprLexerImpl) trySkipInteger(c byte) (byte, bool, bool) {\n\thasDigit := false\n\t// skip sign\n\tif c == '+' || c == '-' {\n\t\tlx.head++ // capture +-\n\t\tc = lx.nextByte()\n\t\tif lx.err != nil {\n\t\t\tgoto AllowEOF // allow single +-\n\t\t}\n\t}\n\tif c < '0' || c > '9' {\n\t\treturn c, false, false\n\t}\n\thasDigit = true\n\t// try skip integer part\n\tfor i := lx.head + 1; ; i++ {\n\t\tif i == lx.tail {\n\t\t\tif lx.readMore(); lx.err != nil {\n\t\t\t\tlx.head = i // capture the current integer part\n\t\t\t\tgoto AllowEOF // allow EOF\n\t\t\t}\n\t\t}\n\t\tc = lx.buffer[i]\n\t\tif c < '0' || c > '9' {\n\t\t\tlx.head = i\n\t\t\treturn c, hasDigit, false\n\t\t}\n\t}\nAllowEOF:\n\tif lx.err == io.EOF {\n\t\tlx.err = nil\n\t\treturn 0, hasDigit, true\n\t}\n\t// lx.err != nil\n\treturn 0, hasDigit, false\n}", "func (s *BaseCobol85PreprocessorListener) ExitSkipStatement(ctx *SkipStatementContext) {}", "func (expect *ExpectEngine) DiscardUntil(expected []byte) error {\n\ti := 0\n\tfor {\n\t\tif i == len(expected) {\n\t\t\treturn nil\n\t\t}\n\t\tb, err := expect.reader.ReadByte()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif i < len(expected) && expected[i] == b {\n\t\t\ti++\n\t\t} else if i > 0 {\n\t\t\ti = 0\n\t\t\texpect.reader.UnreadByte()\n\t\t}\n\t}\n}", "func TestEOFOrLengthEncodedIntFuzz(t *testing.T) {\n\tfor i := 0; i < 100; i++ {\n\t\tbytes := make([]byte, rand.Intn(16)+1)\n\t\t_, err := crypto_rand.Read(bytes)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"error doing rand.Read\")\n\t\t}\n\t\tbytes[0] = 0xfe\n\n\t\t_, _, isInt := readLenEncInt(bytes, 0)\n\t\tisEOF := isEOFPacket(bytes)\n\t\tif (isInt && isEOF) || (!isInt && !isEOF) {\n\t\t\tt.Fatalf(\"0xfe bytestring is EOF xor Int. Bytes %v\", bytes)\n\t\t}\n\t}\n}", "func TestConnReadNonzeroAndEOF(t *testing.T) {\n\t// This test is racy: it assumes that after a write to a\n\t// localhost TCP connection, the peer TCP connection can\n\t// immediately read it. Because it's racy, we skip this test\n\t// in short mode, and then retry it several times with an\n\t// increasing sleep in between our final write (via srv.Close\n\t// below) and the following read.\n\tif testing.Short() {\n\t\tt.Skip(\"skipping in short mode\")\n\t}\n\tvar err error\n\tfor delay := time.Millisecond; delay <= 64*time.Millisecond; delay *= 2 {\n\t\tif err = testConnReadNonzeroAndEOF(t, delay); err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\tt.Error(err)\n}", "func (p *parser) _skipTo(tok token.Token) {\n\tfor p.tok != tok && p.tok != token.EOF {\n\t\tp.next()\n\t}\n\tp.next()\n}", "func TestConnReadNonzeroAndEOF(t *testing.T) {\n\t// This test is racy: it assumes that after a write to a\n\t// localhost TCP connection, the peer TCP connection can\n\t// immediately read it. Because it's racy, we skip this test\n\t// in short mode, and then retry it several times with an\n\t// increasing sleep in between our final write (via srv.Close\n\t// below) and the following read.\n\tif testing.Short() {\n\t\tt.Skip(\"skipping in short mode\")\n\t}\n\tvar err error\n\tfor delay := time.Millisecond; delay <= 64*time.Millisecond; delay *= 2 {\n\t\tif err = testConnReadNonzeroAndEOF(t, delay); err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\tt.Error(err)\n}", "func (r *Reader) SkipLong() {\n\tvar offset int8\n\tfor r.Error == nil {\n\t\tif offset == maxLongBufSize {\n\t\t\treturn\n\t\t}\n\n\t\tb := r.readByte()\n\t\tif b&0x80 == 0 {\n\t\t\tbreak\n\t\t}\n\t\toffset++\n\t}\n}" ]
[ "0.8521816", "0.66316926", "0.6306891", "0.6257713", "0.5980924", "0.59166044", "0.5870907", "0.5784568", "0.5784294", "0.57793224", "0.5767844", "0.57236004", "0.57236004", "0.57236004", "0.57236004", "0.57236004", "0.5638349", "0.5638349", "0.55618286", "0.5451496", "0.5416356", "0.5398454", "0.53948134", "0.5377773", "0.5359797", "0.5329749", "0.52838635", "0.5269281", "0.5144712", "0.51225317", "0.5115413", "0.50817674", "0.5078483", "0.5045754", "0.49886718", "0.49806213", "0.49800748", "0.4972273", "0.49677503", "0.49613214", "0.49107188", "0.48955998", "0.48193055", "0.47726008", "0.47523418", "0.47341305", "0.4708513", "0.4708513", "0.4703689", "0.4703689", "0.4703689", "0.4703689", "0.4698749", "0.46964347", "0.46955645", "0.4691528", "0.4681973", "0.4647718", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.46476322", "0.4627292", "0.46163842", "0.46093494", "0.46015942", "0.4601545", "0.45930818", "0.45930818", "0.45930818", "0.45706302", "0.45652223", "0.45583153", "0.45578146", "0.45497793", "0.45413646", "0.45413646", "0.45321947", "0.45123935", "0.4505922", "0.45040405", "0.44892487", "0.44884053", "0.44730723", "0.4471234", "0.44706923", "0.44558358", "0.44515145", "0.44500935", "0.44494963", "0.44475725", "0.44380376" ]
0.8567482
0
Function to convert a gravity to a string. Returns an empty string if the gravity type is unknown (or invalid)
Функция для преобразования гравитации в строку. Возвращает пустую строку, если тип гравитации неизвестен (или недействителен)
func (g *Gravity) String() string { // Iterate over the gravity types for name, gravity := range GravityTypes { // If the horizontal and vertical gravity is a match if g.HorizGravity == gravity.HorizGravity && g.VertGravity == gravity.VertGravity { return name } } // Otherwise return an empty string return "" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c CurveType) String() string {\n\tswitch c {\n\tcase Hilbert:\n\t\treturn \"Hilbert\"\n\tcase Morton:\n\t\treturn \"Morton\"\n\t}\n\treturn \"\"\n}", "func (o SpaceInformationType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "func (me Tangle360Type) String() string { return xsdt.Double(me).String() }", "func (t *Type) String() string {\n\tif t.Precision != nil && t.Scale != nil {\n\t\treturn fmt.Sprintf(\"%s(%s,%s)\", t.Name.Name, t.Precision.String(), t.Scale.String())\n\t} else if t.Precision != nil {\n\t\treturn fmt.Sprintf(\"%s(%s)\", t.Name.Name, t.Precision.String())\n\t} else if t.Scale != nil {\n\t\t// I'm not sure how you're supposed to tell this from the t.Precision case.\n\t\treturn fmt.Sprintf(\"%s(%s)\", t.Name.Name, t.Scale.String())\n\t}\n\treturn t.Name.Name\n}", "func (t KnownBuildType) String() string {\n\treturn string(t)\n}", "func (me Tangle90Type) String() string { return xsdt.Double(me).String() }", "func (t FillType) String() string {\n\treturn fromFillType[t]\n}", "func (dw *DrawingWand) GetGravity() GravityType {\n\treturn GravityType(C.MagickDrawGetGravity(dw.dw))\n}", "func (f ApproximationType) String() string {\n\n\tif f < approximationTypeEnd {\n\t\treturn approximationTypeLookup[f]\n\t}\n\n\treturn \"\"\n}", "func (r FloatBoundedStrictly) String() string { return FloatBounded(r).String() }", "func (t Type) String() string {\n\tswitch t {\n\tcase Immutable:\n\t\treturn \"IMMUTABLE\"\n\tcase Temporal:\n\t\treturn \"TEMPORAL\"\n\tdefault:\n\t\treturn \"UNKNOWN\"\n\t}\n}", "func (me Tangle180Type) String() string { return xsdt.Double(me).String() }", "func (t Type) String() string {\n\tswitch t {\n\tdefault:\n\t\treturn \"Unknown\"\n\tcase '+':\n\t\treturn \"SimpleString\"\n\tcase '-':\n\t\treturn \"Error\"\n\tcase ':':\n\t\treturn \"Integer\"\n\tcase '$':\n\t\treturn \"BulkString\"\n\tcase '*':\n\t\treturn \"Array\"\n\tcase 'R':\n\t\treturn \"RDB\"\n\t}\n}", "func (rt ReleaseType) String() string {\n\tswitch rt {\n\tcase ReleaseTypeError:\n\t\t// Developer error. Panic as we can't call Critical here.\n\t\tpanic(\"uninitialized release type\")\n\tcase Release:\n\t\treturn \"release\"\n\tcase Dev:\n\t\treturn \"dev\"\n\tcase Testing:\n\t\treturn \"testing\"\n\tdefault:\n\t\t// Developer error. Panic as we can't call Critical here.\n\t\tpanic(\"unknown release type\")\n\t}\n}", "func (me Tanglepos180Type) String() string { return xsdt.Double(me).String() }", "func (me TFontFamilyValueType) String() string { return xsdt.String(me).String() }", "func (t Type) String() string {\n\tswitch t {\n\tcase UNKNOWN:\n\t\treturn \"unknown\"\n\tcase STRING:\n\t\treturn \"string\"\n\tcase BOOLEAN:\n\t\treturn \"boolean\"\n\tcase NUMBER:\n\t\treturn \"number\"\n\tcase DATE:\n\t\treturn \"date\"\n\tcase TIME:\n\t\treturn \"time\"\n\tcase DATETIME:\n\t\treturn \"datetime\"\n\tcase LOCATION:\n\t\treturn \"location\"\n\tcase ADDRESS:\n\t\treturn \"address\"\n\t}\n\treturn \"unsupported\"\n}", "func (v *Variant) TypeString() string {\n\t// the string returned from this belongs to GVariant and must not be freed.\n\treturn C.GoString((*C.char)(C.g_variant_get_type_string(v.native())))\n}", "func toFullString(f float64) string {\n\treturn strconv.FormatFloat(f, 'g', 6, 64)\n}", "func (me TSAFPTtextTypeMandatoryMax90Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TFontFamilyValueType) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (g Grade) String() string {\n\tswitch g {\n\tcase Bad:\n\t\treturn \"Bad\"\n\tcase Legacy:\n\t\treturn \"Legacy\"\n\tcase Good:\n\t\treturn \"Good\"\n\tcase Skipped:\n\t\treturn \"Skipped\"\n\tdefault:\n\t\treturn \"Invalid\"\n\t}\n}", "func ParseGravity(value string, def Gravity) (Gravity, error) {\n\t// Convert the string to lowercase\n\tvalue = strings.ToLower(value)\n\t// If the value isn't given, use the default\n\tif value == \"\" {\n\t\treturn def, nil\n\t}\n\t// Try to get the gravity type from the map\n\tgravity, ok := GravityTypes[value]\n\tif ok {\n\t\treturn gravity, nil\n\t} else {\n\t\treturn Gravity{}, errors.New(\"invalid gravity '\" + value + \"'\")\n\t}\n}", "func (me TPositiveFloatType) String() string { return xsdt.Float(me).String() }", "func getStringFromGivenType(v interface{}) string {\n\tvar str string\n\tswitch v.(type) {\n\tcase int:\n\t\tstr = strconv.Itoa(v.(int))\n\tcase int64:\n\t\tstr = strconv.FormatInt(v.(int64), 10)\n\tcase string:\n\t\tstr, _ = v.(string)\n\tcase decimal.Decimal:\n\t\tstr = v.(decimal.Decimal).String()\n\tdefault:\n\t\tstr = \"\"\n\t}\n\treturn str\n}", "func (t Type) String() string {\n\tswitch t {\n\tcase Int32:\n\t\treturn \"int32\"\n\tcase Int64:\n\t\treturn \"int64\"\n\tcase Float64:\n\t\treturn \"float64\"\n\tcase String:\n\t\treturn \"string\"\n\tcase Bool:\n\t\treturn \"bool\"\n\tcase Timestamp:\n\t\treturn \"timestamp\"\n\tcase JSON:\n\t\treturn \"json\"\n\tdefault:\n\t\treturn \"unsupported\"\n\t}\n}", "func (me TSAFPTtextTypeMandatoryMax210Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TSAFPTtextTypeMandatoryMax70Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (dt DataType) String() string {\n\tswitch dt {\n\tcase DSA:\n\t\treturn \"DSA\"\n\tcase DFA:\n\t\treturn \"DFA\"\n\tcase DDA:\n\t\treturn \"DDA\"\n\tcase DSB:\n\t\treturn \"DSB\"\n\tcase DFB:\n\t\treturn \"DFB\"\n\tcase DDB:\n\t\treturn \"DDB\"\n\tdefault:\n\t\treturn \"unknown data type\" // unreachable code\n\t}\n}", "func (me TSAFPTtextTypeMandatoryMax50Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TSAFPTtextTypeMandatoryMax254Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (o VolumeCompAggrAttributesType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "func (airspeed AirspeedSupersonic) ToString() string {\n\n\tif airspeed == 0 {\n\t\treturn \"no velocity information\"\n\t} else if airspeed >= 1023 {\n\t\treturn \">4086 kt\"\n\t} else {\n\t\treturn fmt.Sprintf(\"%v kt\", airspeed.GetAirspeed())\n\t}\n}", "func (d DBType) String() string {\n\tswitch d {\n\tcase DBNumber:\n\t\treturn \"Number\"\n\tcase DBText:\n\t\treturn \"Text\"\n\tcase DBDate:\n\t\treturn \"Date\"\n\tcase DBTime:\n\t\treturn \"Time\"\n\tcase DBBytes:\n\t\treturn \"Bytes\"\n\t}\n\n\treturn \"Unknown\"\n}", "func (me TSAFPTtextTypeMandatoryMax60Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (a APIType) String() string {\n\tswitch a {\n\tcase EGL:\n\t\treturn \"EGL\"\n\tcase GLES2:\n\t\treturn \"GLES2\"\n\tcase GLES3:\n\t\treturn \"GLES3\"\n\tcase GLES31:\n\t\treturn \"GLES31\"\n\tcase VK:\n\t\treturn \"VK\"\n\t}\n\treturn fmt.Sprintf(\"UNKNOWN (%d)\", a)\n}", "func (x *Float) String() string {}", "func (me TSAFmonetaryType) String() string { return xsdt.Decimal(me).String() }", "func (t Topology) String() string {\n\tswitch t {\n\tcase Linear:\n\t\treturn \"linear\"\n\tcase Circular:\n\t\treturn \"circular\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "func (vt VolumeType) String() string {\n\treturn string(vt)\n}", "func (me TSAFPTtextTypeMandatoryMax172Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (geom Geometry) ToWKT() (string, error) {\n\tvar p *C.char\n\terr := C.OGR_G_ExportToWkt(geom.cval, &p).Err()\n\twkt := C.GoString(p)\n\tdefer C.free(unsafe.Pointer(p))\n\treturn wkt, err\n}", "func (me TSAFPTtextTypeMandatoryMax35Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TFontSizeValueType) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TSAFPTtextTypeMandatoryMax30Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (t Type) String() string {\n\tswitch t {\n\tdefault:\n\t\treturn \"Unknown\"\n\tcase Null:\n\t\treturn \"Null\"\n\tcase RESP:\n\t\treturn \"RESP\"\n\tcase Telnet:\n\t\treturn \"Telnet\"\n\tcase Native:\n\t\treturn \"Native\"\n\tcase HTTP:\n\t\treturn \"HTTP\"\n\tcase WebSocket:\n\t\treturn \"WebSocket\"\n\tcase JSON:\n\t\treturn \"JSON\"\n\t}\n}", "func (me TSAFPTtextTypeMax40Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (o GoogleCloudRetailV2alphaProductResponseOutput) Gtin() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleCloudRetailV2alphaProductResponse) string { return v.Gtin }).(pulumi.StringOutput)\n}", "func (me TPreserveAspectRatioSpecType) String() string { return xsdt.String(me).String() }", "func (e EngineType) String() string {\n\tswitch e {\n\tcase EngineTiDB:\n\t\treturn \"EngineTiDB\"\n\tcase EngineTiKV:\n\t\treturn \"EngineTiKV\"\n\tcase EngineTiFlash:\n\t\treturn \"EngineTiFlash\"\n\t}\n\treturn \"UnknownEngineType\"\n}", "func (me TSAFPTtextTypeMandatoryMax255Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (t ObjectType) String() string {\n\treturn fromObjectType[t]\n}", "func (gdt *Vector3) AsString() String {\n\targ0 := gdt.getBase()\n\n\tret := C.go_godot_vector3_as_string(GDNative.api, arg0)\n\n\tutfStr := C.go_godot_string_utf8(GDNative.api, &ret)\n\tchar := C.go_godot_char_string_get_data(GDNative.api, &utfStr)\n\tgoStr := C.GoString(char)\n\tC.go_godot_char_string_destroy(GDNative.api, &utfStr)\n\n\treturn String(goStr)\n\n}", "func (ft *FieldType) String() string {\n\tstrs := []string{ft.CompactStr()}\n\tif mysql.HasUnsignedFlag(ft.flag) {\n\t\tstrs = append(strs, \"UNSIGNED\")\n\t}\n\tif mysql.HasZerofillFlag(ft.flag) {\n\t\tstrs = append(strs, \"ZEROFILL\")\n\t}\n\tif mysql.HasBinaryFlag(ft.flag) && ft.GetType() != mysql.TypeString {\n\t\tstrs = append(strs, \"BINARY\")\n\t}\n\n\tif IsTypeChar(ft.GetType()) || IsTypeBlob(ft.GetType()) {\n\t\tif ft.charset != \"\" && ft.charset != charset.CharsetBin {\n\t\t\tstrs = append(strs, fmt.Sprintf(\"CHARACTER SET %s\", ft.charset))\n\t\t}\n\t\tif ft.collate != \"\" && ft.collate != charset.CharsetBin {\n\t\t\tstrs = append(strs, fmt.Sprintf(\"COLLATE %s\", ft.collate))\n\t\t}\n\t}\n\n\treturn strings.Join(strs, \" \")\n}", "func (me TPreserveAspectRatioSpecType) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (t Type) String() string {\n\tif t >= 0 && int(t) < len(biomesNames) {\n\t\treturn string(biomesNames[t])\n\t}\n\treturn \"<invalid biome type>\"\n}", "func (g Grid) String() string {\n\tb := bytes.NewBuffer(nil)\n\tif _, err := g.WriteTo(b); err != nil {\n\t\treturn fmt.Sprintf(\"Error: %s\", err)\n\t}\n\treturn b.String()\n}", "func (me TFontSizeValueType) String() string { return xsdt.String(me).String() }", "func (me TSAFPTtextTypeMandatoryMax21Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TSAFPTtextTypeMandatoryMax200Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (me TSAFPTtextTypeMandatoryMax20Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (this *Variable) String() string {\n\ttyp := this.GetType()\n\tif types.IsList(typ) {\n\t\ttypes.ListToSingle(typ)\n\t}\n\tswitch typ {\n\tcase types.SINGLE_DOUBLE:\n\t\treturn \"$double\"\n\tcase types.SINGLE_INT:\n\t\treturn \"$int\"\n\tcase types.SINGLE_UINT:\n\t\treturn \"$uint\"\n\tcase types.SINGLE_BOOL:\n\t\treturn \"$bool\"\n\tcase types.SINGLE_STRING:\n\t\treturn \"$string\"\n\tcase types.SINGLE_BYTES:\n\t\treturn \"$[]byte\"\n\t}\n\tpanic(fmt.Errorf(\"unknown type %s\", this.GetType()))\n}", "func (x PackageType) String() string {\n\tif str, ok := _PackageTypeMap[x]; ok {\n\t\treturn str\n\t}\n\treturn fmt.Sprintf(\"PackageType(%d)\", x)\n}", "func (me TSAFPTtextTypeMandatoryMax90Car) String() string { return xsdt.String(me).String() }", "func (me TPaintType) String() string { return xsdt.String(me).String() }", "func RatFloatString(x *big.Rat, prec int) string", "func (rt RouterType) String() string {\n\tvar typeStr string\n\tswitch rt {\n\tcase LegacyT:\n\t\ttypeStr = \"Legacy\"\n\tcase AxT:\n\t\ttypeStr = \"AX\"\n\tcase OpenWrtT:\n\t\ttypeStr = \"OpenWrt\"\n\tcase UnknownT:\n\t\ttypeStr = \"Unknown\"\n\tdefault:\n\t\ttypeStr = string(rune(rt))\n\t}\n\treturn typeStr\n}", "func (t Type) String() string {\n\treturn string(t)\n}", "func (t Type) String() string {\n\treturn string(t)\n}", "func (me TSAFPTtextTypeMandatoryMax100Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (st StatType) String() string {\n\tswitch st {\n\tcase Avg:\n\t\treturn ElemAvg\n\tcase Max:\n\t\treturn ElemMax\n\tcase Min:\n\t\treturn ElemMin\n\t}\n\treturn \"unknown\"\n}", "func (h HazardType) String() string {\n\tjh, _ := json.Marshal(h)\n\treturn string(jh)\n}", "func (tvs TvSystem) String() string {\n\tif tvs == NtscTv {\n\t\treturn \"NTSC\"\n\t} else if tvs == PalTv {\n\t\treturn \"PAL\"\n\t}\n\treturn \"DualCompatible\"\n}", "func (t TileType) String() string {\n\tswitch t {\n\tcase Wall:\n\t\treturn \"Wall\"\n\n\tcase Road:\n\t\treturn \"Road\"\n\n\tcase Exit:\n\t\treturn \"Exit\"\n\n\tcase Duplicate:\n\t\treturn \"Duplicate\"\n\n\tdefault:\n\t\treturn \"error,wrong input\"\n\t}\n}", "func (b *Bound) String() string {\n\t// west, south, west, north, east, north, east, south, west, south\n\treturn fmt.Sprintf(\"POLYGON((%g %g, %g %g, %g %g, %g %g, %g %g))\", b.sw[0], b.sw[1], b.sw[0], b.ne[1], b.ne[0], b.ne[1], b.ne[0], b.sw[1], b.sw[0], b.sw[1])\n}", "func (f *Format) String() string {\n\tswitch *f {\n\tcase EOT:\n\t\treturn \"eot\"\n\tcase WOFF:\n\t\treturn \"woff\"\n\tcase TTF:\n\t\treturn \"ttf\"\n\tcase ODT:\n\t\treturn \"odt\"\n\t}\n\treturn \"\"\n}", "func VMTypeToStringPanic(tag vm_grpc.VMTypeTag) string {\n\tif val, ok := vm_grpc.VMTypeTag_name[int32(tag)]; !ok {\n\t\tpanic(fmt.Errorf(\"can't find string representation of type %d, check correctness of type value\", tag))\n\t} else {\n\t\treturn val\n\t}\n}", "func stringOfBigFloat(n *big.Float) string {\n\treturn n.Text('g', -1)\n}", "func (me TPaintType) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (gt GrantType) String() string {\n\tswitch gt {\n\tcase GrantTypeAuthorizationCode:\n\t\treturn string(grantTypeAuthorizationCodeJSON[1:19])\n\tcase GrantTypeRefreshToken:\n\t\treturn string(grantTypeRefreshTokenJSON[1:14])\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "func (me TSAFPTtextTypeMandatoryMax10Car) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (m MarkerType) String() string {\n\treturn string(m)\n}", "func (m MarkerType) String() string {\n\treturn string(m)\n}", "func (me TSAFPTtextTypeMandatoryMax70Car) String() string { return xsdt.String(me).String() }", "func (m *CirconusMetrics) gaugeValString(val interface{}) string {\n\tvs := \"\"\n\tswitch v := val.(type) {\n\tdefault:\n\t\t// ignore it, unsupported type\n\tcase int:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase int8:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase int16:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase int32:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase int64:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase uint:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase uint8:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase uint16:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase uint32:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase uint64:\n\t\tvs = fmt.Sprintf(\"%d\", v)\n\tcase float32:\n\t\tvs = fmt.Sprintf(\"%f\", v)\n\tcase float64:\n\t\tvs = fmt.Sprintf(\"%f\", v)\n\t}\n\treturn vs\n}", "func (ct ConstraintType) String() string {\n\tswitch ct {\n\tcase CheckConstraint:\n\t\treturn \"CheckConstraint\"\n\tcase NotNullConstraint:\n\t\treturn \"NotNullConstraint\"\n\tcase UniqueConstraint:\n\t\treturn \"UniqueConstraint\"\n\tcase PrimaryKeyConstraint:\n\t\treturn \"PrimaryKeyConstraint\"\n\tcase ForeignKeyConstraint:\n\t\treturn \"ForeignKeyConstraint\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "func (me TSAFPTtextTypeMandatoryMax210Car) String() string { return xsdt.String(me).String() }", "func (wt WordType) String() string {\n\treturn wordTypeMap[wt]\n}", "func getMetricTypeAsString(metric telegraf.Metric) (metricType string, err error) {\n\tswitch metric.Type() {\n\tcase telegraf.Counter:\n\t\tmetricType = \"counter\"\n\tcase telegraf.Gauge:\n\t\tmetricType = \"gauge\"\n\tcase telegraf.Summary:\n\t\tmetricType = \"summary\"\n\t\terr = fmt.Errorf(\"summary metrics will be sent as gauges\")\n\tcase telegraf.Histogram:\n\t\tmetricType = \"histogram\"\n\t\terr = fmt.Errorf(\"histogram metrics will be sent as gauges\")\n\tcase telegraf.Untyped:\n\t\tmetricType = \"untyped\"\n\t\terr = fmt.Errorf(\"untyped metrics will be sent as gauges\")\n\tdefault:\n\t\tmetricType = \"unrecognized\"\n\t\terr = fmt.Errorf(\"unrecognized metric type defaulting to gauge\")\n\t}\n\treturn metricType, err\n}", "func FloatToString(f float64) string {\n\treturn strconv.FormatFloat(float64(f), 'g', -1, 64)\n}", "func (me TFontSizeAdjustValueType) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (m mapType) String() string {\n\tswitch m {\n\tcase mapTypeIPv4TCPLocal:\n\t\treturn \"Local IPv4 TCP CT map\"\n\tcase mapTypeIPv6TCPLocal:\n\t\treturn \"Local IPv6 TCP CT map\"\n\tcase mapTypeIPv4TCPGlobal:\n\t\treturn \"Global IPv4 TCP CT map\"\n\tcase mapTypeIPv6TCPGlobal:\n\t\treturn \"Global IPv6 TCP CT map\"\n\tcase mapTypeIPv4AnyLocal:\n\t\treturn \"Local IPv4 non-TCP CT map\"\n\tcase mapTypeIPv6AnyLocal:\n\t\treturn \"Local IPv6 non-TCP CT map\"\n\tcase mapTypeIPv4AnyGlobal:\n\t\treturn \"Global IPv4 non-TCP CT map\"\n\tcase mapTypeIPv6AnyGlobal:\n\t\treturn \"Global IPv6 non-TCP CT map\"\n\t}\n\treturn fmt.Sprintf(\"Unknown (%d)\", int(m))\n}", "func (m mapType) String() string {\n\tswitch m {\n\tcase mapTypeIPv4TCPLocal:\n\t\treturn \"Local IPv4 TCP CT map\"\n\tcase mapTypeIPv6TCPLocal:\n\t\treturn \"Local IPv6 TCP CT map\"\n\tcase mapTypeIPv4TCPGlobal:\n\t\treturn \"Global IPv4 TCP CT map\"\n\tcase mapTypeIPv6TCPGlobal:\n\t\treturn \"Global IPv6 TCP CT map\"\n\tcase mapTypeIPv4AnyLocal:\n\t\treturn \"Local IPv4 non-TCP CT map\"\n\tcase mapTypeIPv6AnyLocal:\n\t\treturn \"Local IPv6 non-TCP CT map\"\n\tcase mapTypeIPv4AnyGlobal:\n\t\treturn \"Global IPv4 non-TCP CT map\"\n\tcase mapTypeIPv6AnyGlobal:\n\t\treturn \"Global IPv6 non-TCP CT map\"\n\t}\n\treturn fmt.Sprintf(\"Unknown (%d)\", int(m))\n}", "func (me TSAFPTtextTypeMandatoryMax60Car) String() string { return xsdt.String(me).String() }", "func (h HotRegionType) String() string {\n\tswitch h {\n\tcase WriteType:\n\t\treturn \"write\"\n\tcase ReadType:\n\t\treturn \"read\"\n\t}\n\treturn \"unimplemented\"\n}", "func (x EnvironmentType) String() string {\n\tif str, ok := _EnvironmentTypeMap[x]; ok {\n\t\treturn str\n\t}\n\treturn fmt.Sprintf(\"EnvironmentType(%d)\", x)\n}", "func (b Bet) String() string {\n\tif b.Amount != 0. {\n\t\treturn fmt.Sprintf(\"%s %.2f\", string(b.Type), b.Amount)\n\t}\n\treturn string(b.Type)\n}", "func (geom Geometry) ToGML_Ex(options []string) string {\n\tlength := len(options)\n\topts := make([]*C.char, length+1)\n\tfor i := 0; i < length; i++ {\n\t\topts[i] = C.CString(options[i])\n\t\tdefer C.free(unsafe.Pointer(opts[i]))\n\t}\n\topts[length] = (*C.char)(unsafe.Pointer(nil))\n\n\tval := C.OGR_G_ExportToGMLEx(geom.cval, (**C.char)(unsafe.Pointer(&opts[0])))\n\treturn C.GoString(val)\n}", "func (me TGlyphOrientationHorizontalValueType) ToXsdtString() xsdt.String { return xsdt.String(me) }", "func (s *Send) Golang() string {\n\tvar buf bytes.Buffer\n\tswitch len(s.Vals) {\n\tcase 0:\n\t\tbuf.WriteString(fmt.Sprintf(\"%s <- struct{}{};\", s.Chan.Name()))\n\tcase 1:\n\t\tbuf.WriteString(fmt.Sprintf(\"%s <- %s;\", s.Chan.Name(), s.Vals[0].Name()))\n\tdefault:\n\t\tbuf.WriteString(fmt.Sprintf(\"%s <- struct {\", s.Chan.Name()))\n\t\tfor i := 0; i < len(s.Vals); i++ {\n\t\t\tif i != 0 {\n\t\t\t\tbuf.WriteRune(';')\n\t\t\t}\n\t\t\tbuf.WriteString(fmt.Sprintf(\"e%d %s\", i, s.Vals[i].Type()))\n\t\t}\n\t\tbuf.WriteString(fmt.Sprintf(\"}{\"))\n\t\tfor i, v := range s.Vals {\n\t\t\tif i != 0 {\n\t\t\t\tbuf.WriteRune(',')\n\t\t\t}\n\t\t\tbuf.WriteString(v.Name())\n\t\t}\n\t\tbuf.WriteString(fmt.Sprintf(\"}\"))\n\n\t}\n\treturn buf.String()\n}" ]
[ "0.5575802", "0.5499247", "0.5484856", "0.5476465", "0.54468846", "0.54457223", "0.54219407", "0.5417401", "0.541277", "0.5407705", "0.53995806", "0.53897923", "0.5382045", "0.536176", "0.5355089", "0.53541756", "0.5338253", "0.53325325", "0.53228474", "0.53225034", "0.5310002", "0.52692646", "0.5265296", "0.5265283", "0.5254271", "0.5243691", "0.5236827", "0.5228219", "0.52119416", "0.5203864", "0.5202512", "0.51991236", "0.5198446", "0.51971865", "0.5194243", "0.5190309", "0.51832664", "0.51827544", "0.5180472", "0.5179268", "0.5170563", "0.5167349", "0.5163913", "0.516258", "0.5158568", "0.5153482", "0.51480484", "0.51457125", "0.5144618", "0.5143191", "0.51420254", "0.51388913", "0.5132329", "0.51305914", "0.51267755", "0.51267034", "0.51168764", "0.5111769", "0.5107575", "0.5107401", "0.51061773", "0.50933564", "0.50821745", "0.50785947", "0.50720453", "0.50652695", "0.5048492", "0.5040324", "0.5040324", "0.50393045", "0.5038266", "0.50353485", "0.50332063", "0.5032469", "0.5026474", "0.5026064", "0.501948", "0.50179553", "0.50139415", "0.5011526", "0.5010123", "0.50013995", "0.50013995", "0.50011754", "0.49969712", "0.49924552", "0.4992344", "0.49920616", "0.4989155", "0.49756646", "0.49745506", "0.4973887", "0.4973887", "0.49714833", "0.49681655", "0.4968092", "0.49664876", "0.4958654", "0.49584317", "0.49535233" ]
0.7351317
0
Function to parse a string into a gravity type. If value is not a valid gravity, the function returns an error. If the value is an empty string, the default gravity 'def' is used instead
Функция для парсинга строки в тип гравитации. Если значение не является допустимым типом гравитации, функция возвращает ошибку. Если значение — пустая строка, используется вместо этого default-гравитация 'def'
func ParseGravity(value string, def Gravity) (Gravity, error) { // Convert the string to lowercase value = strings.ToLower(value) // If the value isn't given, use the default if value == "" { return def, nil } // Try to get the gravity type from the map gravity, ok := GravityTypes[value] if ok { return gravity, nil } else { return Gravity{}, errors.New("invalid gravity '" + value + "'") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ParseStringToStorageClassType(value string) (ret StorageClassType) {\n\tswitch value {\n\tcase \"STANDARD\":\n\t\tret = StorageClassStandard\n\tcase \"STANDARD_IA\", \"WARM\":\n\t\tret = StorageClassWarm\n\tcase \"GLACIER\", \"COLD\":\n\t\tret = StorageClassCold\n\tdefault:\n\t\tret = \"\"\n\t}\n\treturn\n}", "func parseStorageClass(in storageclass.Type) (string, error) {\n\tswitch in {\n\tcase storageclass.Hot:\n\t\treturn s3.ObjectStorageClassStandard, nil\n\tcase storageclass.Warm:\n\t\treturn s3.ObjectStorageClassStandardIa, nil\n\tcase storageclass.Cold:\n\t\treturn s3.ObjectStorageClassGlacier, nil\n\tdefault:\n\t\treturn \"\", types.ErrStorageClassNotSupported\n\t}\n}", "func UsageTypeEnumFromValue(value string) UsageTypeEnum {\r\n switch value {\r\n case \"kArchival\":\r\n return UsageType_KARCHIVAL\r\n case \"kCloudSpill\":\r\n return UsageType_KCLOUDSPILL\r\n default:\r\n return UsageType_KARCHIVAL\r\n }\r\n}", "func (g *Gravity) String() string {\n\t// Iterate over the gravity types\n\tfor name, gravity := range GravityTypes {\n\t\t// If the horizontal and vertical gravity is a match\n\t\tif g.HorizGravity == gravity.HorizGravity &&\n\t\t\tg.VertGravity == gravity.VertGravity {\n\t\t\treturn name\n\t\t}\n\t}\n\t// Otherwise return an empty string\n\treturn \"\"\n}", "func StorageTypeFromString(in string) StorageType {\n\tin = strings.ToLower(in)\n\tin = strings.TrimSpace(in)\n\n\tswitch in {\n\tcase \"\":\n\t\treturn StorageBolt\n\tcase \"memory\":\n\t\treturn StorageMemory\n\tcase \"bolt\":\n\t\treturn StorageBolt\n\tcase \"mysql\":\n\t\treturn StorageMysql\n\tcase \"filesystem\":\n\t\treturn StorageFilesystem\n\t}\n\n\treturn StorageInvalid\n}", "func Parse(s string) (interface{}, error) {\n\tsentence := Sentence{}\n\tif err := sentence.Parse(s); err != nil {\n\t\treturn nil, err\n\t}\n\tif sentence.SType == PrefixGPGGA {\n\t\tgpgga := GPGGA{}\n\t\tif err := gpgga.Parse(s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn gpgga, nil\n\t}\n\tif sentence.SType == PrefixGPGSA {\n\t\tgpgsa := GPGSA{}\n\t\tif err := gpgsa.Parse(s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn gpgsa, nil\n\t}\n\tif sentence.SType == PrefixGPRMC {\n\t\tgprmc := GPRMC{}\n\t\tif err := gprmc.Parse(s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn gprmc, nil\n\t}\n\tif sentence.SType == PrefixGPVTG {\n\t\tgpvtg := GPVTG{}\n\t\tif err := gpvtg.Parse(s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn gpvtg, nil\n\t}\n\tif sentence.SType == PrefixPSRFTXT {\n\t\tpsrf := PSRFTXT{}\n\t\tif err := psrf.Parse(s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn psrf, nil\n\t}\n\treturn sentence, nil\n}", "func PkgTypeEnumFromValue(value string) PkgTypeEnum {\r\n switch value {\r\n case \"kScript\":\r\n return PkgType_KSCRIPT\r\n case \"kRPM\":\r\n return PkgType_KRPM\r\n case \"kSuseRPM\":\r\n return PkgType_KSUSERPM\r\n case \"kDEB\":\r\n return PkgType_KDEB\r\n default:\r\n return PkgType_KSCRIPT\r\n }\r\n}", "func TypeFromStr(ct string) (Type, error) {\n\tswitch ct {\n\tcase \"bitcoin\":\n\t\treturn Bitcoin, nil\n\tcase \"skycoin\":\n\t\treturn Skycoin, nil\n\tdefault:\n\t\treturn -1, fmt.Errorf(\"unknow coin type:%s\", ct)\n\t}\n}", "func formatStorageClass(in string) (storageclass.Type, error) {\n\tswitch in {\n\tcase s3.ObjectStorageClassStandard:\n\t\treturn storageclass.Hot, nil\n\tcase s3.ObjectStorageClassStandardIa:\n\t\treturn storageclass.Warm, nil\n\tcase s3.ObjectStorageClassGlacier:\n\t\treturn storageclass.Cold, nil\n\tdefault:\n\t\treturn \"\", types.ErrStorageClassNotSupported\n\t}\n\n}", "func TranslateStringToType(tagType TagTypePrimitive, valueString string) (value interface{}, err error) {\n\tdefer func() {\n\t\tif state := recover(); state != nil {\n\t\t\terr = log.Wrap(state.(error))\n\t\t}\n\t}()\n\n\tif tagType == TypeUndefined {\n\t\t// The caller should just call String() on the decoded type.\n\t\tlog.Panicf(\"undefined-type values are not supported\")\n\t}\n\n\tif tagType == TypeByte {\n\t\twide, err := strconv.ParseInt(valueString, 16, 8)\n\t\tlog.PanicIf(err)\n\n\t\treturn byte(wide), nil\n\t} else if tagType == TypeAscii || tagType == TypeAsciiNoNul {\n\t\t// Whether or not we're putting an NUL on the end is only relevant for\n\t\t// byte-level encoding. This function really just supports a user\n\t\t// interface.\n\n\t\treturn valueString, nil\n\t} else if tagType == TypeShort {\n\t\tn, err := strconv.ParseUint(valueString, 10, 16)\n\t\tlog.PanicIf(err)\n\n\t\treturn uint16(n), nil\n\t} else if tagType == TypeLong {\n\t\tn, err := strconv.ParseUint(valueString, 10, 32)\n\t\tlog.PanicIf(err)\n\n\t\treturn uint32(n), nil\n\t} else if tagType == TypeRational {\n\t\tparts := strings.SplitN(valueString, \"/\", 2)\n\n\t\tnumerator, err := strconv.ParseUint(parts[0], 10, 32)\n\t\tlog.PanicIf(err)\n\n\t\tdenominator, err := strconv.ParseUint(parts[1], 10, 32)\n\t\tlog.PanicIf(err)\n\n\t\treturn Rational{\n\t\t\tNumerator: uint32(numerator),\n\t\t\tDenominator: uint32(denominator),\n\t\t}, nil\n\t} else if tagType == TypeSignedLong {\n\t\tn, err := strconv.ParseInt(valueString, 10, 32)\n\t\tlog.PanicIf(err)\n\n\t\treturn int32(n), nil\n\t} else if tagType == TypeFloat {\n\t\tn, err := strconv.ParseFloat(valueString, 32)\n\t\tlog.PanicIf(err)\n\n\t\treturn float32(n), nil\n\t} else if tagType == TypeDouble {\n\t\tn, err := strconv.ParseFloat(valueString, 64)\n\t\tlog.PanicIf(err)\n\n\t\treturn float64(n), nil\n\t} else if tagType == TypeSignedRational {\n\t\tparts := strings.SplitN(valueString, \"/\", 2)\n\n\t\tnumerator, err := strconv.ParseInt(parts[0], 10, 32)\n\t\tlog.PanicIf(err)\n\n\t\tdenominator, err := strconv.ParseInt(parts[1], 10, 32)\n\t\tlog.PanicIf(err)\n\n\t\treturn SignedRational{\n\t\t\tNumerator: int32(numerator),\n\t\t\tDenominator: int32(denominator),\n\t\t}, nil\n\t}\n\n\tlog.Panicf(\"from-string encoding for type not supported; this shouldn't happen: [%s]\", tagType.String())\n\treturn nil, nil\n}", "func TypeString(s string) (Type, error) {\n\tif val, ok := _TypeNameToValueMap[s]; ok {\n\t\treturn val, nil\n\t}\n\ts = strings.ToLower(s)\n\tif val, ok := _TypeNameToValueMap[s]; ok {\n\t\treturn val, nil\n\t}\n\treturn 0, fmt.Errorf(\"%s does not belong to Type values\", s)\n}", "func (me TxsdMovementType) IsGt() bool { return me.String() == \"GT\" }", "func parseTyped(value_str string) interface{} {\n\tvalueInt, err := strconv.ParseInt(strings.TrimSpace(value_str), 10, 64)\n\tif err == nil {\n\t\treturn valueInt\n\t}\n\tvalueFloat, err := strconv.ParseFloat(value_str, 64)\n\tif err == nil {\n\t\treturn valueFloat\n\t}\n\treturn value_str\n}", "func parseGPUType(annotations map[string]string) string {\n\tif val, found := annotations[gpuTypeKey]; found {\n\t\treturn val\n\t}\n\treturn \"\"\n}", "func (vl StringValue) GetType() int {\n\treturn ParticleType.STRING\n}", "func (vl StringValue) GetType() int {\n\treturn ParticleType.STRING\n}", "func (me TxsdMovementType) IsGd() bool { return me.String() == \"GD\" }", "func (t FieldType) Parse(value string) (interface{}, error) {\n\tswitch t {\n\tcase STRING, PICKLIST, MULTIPICKLIST, COMBOBOX, REFERENCE, BASE64, TEXTAREA, PHONE, ID, URL, EMAIL, ENCRYPTEDSTRING, DATACATEGORYGROUPREFERENCE:\n\t\treturn conv.STRING.Parse(value)\n\tcase BOOLEAN:\n\t\treturn conv.BOOLEAN.Parse(value)\n\tcase CURRENCY, INT, DOUBLE, PERCENT:\n\t\treturn conv.NUMBER.Parse(value)\n\tcase DATE:\n\t\treturn conv.DATE.Parse(value)\n\tcase TIME:\n\t\treturn conv.TIME.Parse(value)\n\tcase DATETIME:\n\t\treturn conv.DATETIME.Parse(value)\n\tcase LOCATION, ADDRESS, ANYTYPE:\n\t\treturn nil, errors.New(fmt.Sprint(\"unsupported type\"))\n\t}\n\treturn nil, errors.New(fmt.Sprint(\"unknown type\"))\n}", "func ParseGenPluginType(s string) (GenPluginType, error) {\n\tgenPluginType, ok := _stringToGenPluginType[strings.ToLower(s)]\n\tif !ok {\n\t\treturn GenPluginTypeNone, fmt.Errorf(\"could not parse %s to a GenPluginType\", s)\n\t}\n\treturn genPluginType, nil\n}", "func ParseAndRequireString(\n\tt *types.T, s string, ctx ParseTimeContext,\n) (d Datum, dependsOnContext bool, err error) {\n\tswitch t.Family() {\n\tcase types.ArrayFamily:\n\t\td, dependsOnContext, err = ParseDArrayFromString(ctx, s, t.ArrayContents())\n\tcase types.BitFamily:\n\t\td, err = ParseDBitArray(s)\n\tcase types.BoolFamily:\n\t\td, err = ParseDBool(s)\n\tcase types.BytesFamily:\n\t\td, err = ParseDByte(s)\n\tcase types.DateFamily:\n\t\td, dependsOnContext, err = ParseDDate(ctx, s)\n\tcase types.DecimalFamily:\n\t\td, err = ParseDDecimal(s)\n\tcase types.FloatFamily:\n\t\td, err = ParseDFloat(s)\n\tcase types.INetFamily:\n\t\td, err = ParseDIPAddrFromINetString(s)\n\tcase types.IntFamily:\n\t\td, err = ParseDInt(s)\n\tcase types.IntervalFamily:\n\t\titm, typErr := t.IntervalTypeMetadata()\n\t\tif typErr != nil {\n\t\t\treturn nil, false, typErr\n\t\t}\n\t\td, err = ParseDIntervalWithTypeMetadata(s, itm)\n\tcase types.GeographyFamily:\n\t\td, err = ParseDGeography(s)\n\tcase types.GeometryFamily:\n\t\td, err = ParseDGeometry(s)\n\tcase types.JsonFamily:\n\t\td, err = ParseDJSON(s)\n\tcase types.OidFamily:\n\t\ti, err := ParseDInt(s)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\td = NewDOid(*i)\n\tcase types.StringFamily:\n\t\t// If the string type specifies a limit we truncate to that limit:\n\t\t// 'hello'::CHAR(2) -> 'he'\n\t\t// This is true of all the string type variants.\n\t\tif t.Width() > 0 {\n\t\t\ts = utils.TruncateString(s, int(t.Width()))\n\t\t}\n\t\treturn NewDString(s), false, nil\n\tcase types.TimeFamily:\n\t\td, dependsOnContext, err = ParseDTime(ctx, s, TimeFamilyPrecisionToRoundDuration(t.Precision()))\n\tcase types.TimeTZFamily:\n\t\td, dependsOnContext, err = ParseDTimeTZ(ctx, s, TimeFamilyPrecisionToRoundDuration(t.Precision()))\n\tcase types.TimestampFamily:\n\t\td, dependsOnContext, err = ParseDTimestamp(ctx, s, TimeFamilyPrecisionToRoundDuration(t.Precision()))\n\tcase types.TimestampTZFamily:\n\t\td, dependsOnContext, err = ParseDTimestampTZ(ctx, s, TimeFamilyPrecisionToRoundDuration(t.Precision()))\n\tcase types.UuidFamily:\n\t\td, err = ParseDUuidFromString(s)\n\tcase types.EnumFamily:\n\t\td, err = MakeDEnumFromLogicalRepresentation(t, s)\n\tdefault:\n\t\treturn nil, false, errors.AssertionFailedf(\"unknown type %s (%T)\", t, t)\n\t}\n\treturn d, dependsOnContext, err\n}", "func (f *Feature) SingleGenotype(gen string, order map[string]uint64) (*Genotype, error) {\n\tif loc, ok := order[gen]; ok { //gen is a valid genotype\n\t\tif preParsed, ok := f.ParsedGenotypes[gen]; ok { //gen has already been accessed for this feature\n\t\t\treturn preParsed, nil\n\t\t} else { //gen needs to be extracted from the info field\n\t\t\tinfo := bytes.Split(f.Genotypes[loc], []byte{':'})\n\t\t\tif len(info) != len(f.Format) { //info is improperly formatted\n\t\t\t\treturn nil, errors.New(\"genotype has improperly formatted data\")\n\t\t\t} else {\n\t\t\t\tparsedGT := Genotype{PhasedGT: false}\n\t\t\t\tparsedGT.Id = gen\n\t\t\t\tparsedGT.Fields = make(map[string]string, len(f.Format))\n\t\t\t\tfor key, value := range f.Format {\n\t\t\t\t\tparsedGT.Fields[key] = string(info[value])\n\t\t\t\t\tif key == \"GT\" {\n\t\t\t\t\t\tgt := bytes.Split(info[value], []byte{'|'})\n\t\t\t\t\t\tif len(gt) > 1 {\n\t\t\t\t\t\t\tparsedGT.PhasedGT = true\n\t\t\t\t\t\t} else if len(gt) == 1 {\n\t\t\t\t\t\t\tgt = bytes.Split(info[value], []byte{'/'})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparsedGT.GT = make([]int, len(gt))\n\t\t\t\t\t\tfor i := range gt {\n\t\t\t\t\t\t\tif string(gt[i]) == \".\" {\n\t\t\t\t\t\t\t\tparsedGT.GT[i] = -1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tval, _ := strconv.Atoi(string(gt[i]))\n\t\t\t\t\t\t\t\tparsedGT.GT[i] = val\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 len(f.ParsedGenotypes) == 0 {\n\t\t\t\t\tf.ParsedGenotypes = make(map[string]*Genotype)\n\t\t\t\t}\n\t\t\t\tf.ParsedGenotypes[gen] = &parsedGT\n\t\t\t\treturn &parsedGT, nil\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn nil, errors.New(\"genotype not in vcf\")\n\t}\n}", "func (me TxsdMovementType) IsGr() bool { return me.String() == \"GR\" }", "func (fOpenType FileOpenType) ParseString(\n valueString string,\n caseSensitive bool) (FileOpenType, error) {\n\n ePrefix := \"FileOpenType.ParseString() \"\n\n fOpenType.checkInitializeMaps(false)\n\n result := FileOpenType(0)\n\n lenValueStr := len(valueString)\n\n if strings.HasSuffix(valueString, \"()\") {\n valueString = valueString[0 : lenValueStr-2]\n lenValueStr -= 2\n }\n\n if lenValueStr < 3 {\n return result,\n fmt.Errorf(ePrefix+\n \"Input parameter 'valueString' is INVALID! valueString='%v' \", valueString)\n }\n\n var ok bool\n var idx int\n\n if caseSensitive {\n\n if !strings.HasPrefix(valueString, \"Type\") {\n valueString = \"Type\" + valueString\n }\n\n idx, ok = mFileOpenTypeStringToInt[valueString]\n\n if !ok {\n return FileOpenType(0),\n fmt.Errorf(ePrefix+\n \"'valueString' did NOT MATCH a FileOpenType. valueString='%v' \", valueString)\n }\n\n result = FileOpenType(idx)\n\n } else {\n\n valueString = strings.ToLower(valueString)\n\n if !strings.HasPrefix(valueString, \"type\") {\n valueString = \"type\" + valueString\n }\n\n idx, ok = mFileOpenTypeLwrCaseStringToInt[valueString]\n\n if !ok {\n return FileOpenType(0),\n fmt.Errorf(ePrefix+\n \"'valueString' did NOT MATCH a FileOpenType. valueString='%v' \", valueString)\n }\n\n result =\n FileOpenType(idx)\n }\n\n return result, nil\n}", "func MustParse(s string) float64 {\n\tv, err := Parse(s)\n\tif err != nil {\n\t\tlog.Fatalf(\"bad string %q: %v\", s, err)\n\t}\n\treturn v\n}", "func (t PostgresTyper) GetType(in string) string {\n\tif t.IsFloat(in) {\n\t\treturn \"decimal\"\n\t} else if t.IsInt(in) {\n\t\treturn \"int\"\n\t} else if t.IsBool(in) {\n\t\treturn \"bool\"\n\t} else {\n\t\treturn \"character varying\"\n\t}\n}", "func TypeofFormat(s string) Format {\n\tif f, ok := formatMap[strings.ToLower(s)]; ok {\n\t\treturn f\n\t}\n\treturn FormUnknown\n}", "func String(f string) Interface {\n\treturn &valueType{\n\t\tname: f,\n\t\tempty: \"\",\n\t\tget: func(g Getter) interface{} {\n\t\t\treturn g.GetString(f)\n\t\t},\n\t}\n}", "func (t Type) Parse(value string) (interface{}, error) {\n\tif len(value) == 0 {\n\t\treturn nil, nil\n\t}\n\tswitch t {\n\tcase STRING:\n\t\treturn value, nil\n\tcase BOOLEAN:\n\t\tif value == \"true\" {\n\t\t\treturn true, nil\n\t\t} else if value == \"false\" {\n\t\t\treturn false, nil\n\t\t} else {\n\t\t\treturn nil, errors.New(fmt.Sprint(\"not a boolean: \", value))\n\t\t}\n\tcase NUMBER:\n\t\tif r, ok := new(big.Rat).SetString(value); ok {\n\t\t\treturn r, nil\n\t\t} else {\n\t\t\treturn nil, errors.New(fmt.Sprint(\"not a number: \", value))\n\t\t}\n\tcase DATE:\n\t\tif d, err := time.ParseInLocation(FORMAT_DATE, value, LOCATION_DATE); err == nil {\n\t\t\treturn d, nil\n\t\t} else {\n\t\t\treturn nil, errors.New(fmt.Sprint(\"not a date: \", value))\n\t\t}\n\tcase TIME:\n\t\tif t, err := time.Parse(FORMAT_TIME, value); err == nil {\n\t\t\treturn time.Date(1, 1, 1, t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), LOCATION_TIME), nil\n\t\t} else {\n\t\t\treturn nil, errors.New(fmt.Sprint(\"not a time: \", value))\n\t\t}\n\tcase DATETIME:\n\t\tif dt, err := time.Parse(FORMAT_DATETIME, value); err == nil {\n\t\t\treturn dt, nil\n\t\t} else {\n\t\t\treturn nil, errors.New(fmt.Sprint(\"not a datetime: \", value))\n\t\t}\n\t}\n\treturn nil, errors.New(fmt.Sprint(\"illegal value `\", value, \"` for type \", t.String()))\n}", "func (s *String) Type() ObjectType { return STRING_OBJ }", "func GAFromString(s string) GroupAddress {\n\tga := GroupAddress{Main: 0, Middle: 0, Sub: 0}\n\tif _, err := fmt.Sscanf(s, \"%d/%d/%d\", &ga.Main, &ga.Middle, &ga.Sub); err == nil {\n\t\treturn ga\n\t}\n\tlog.Printf(\"Error parsing GA: %s\", s)\n\treturn ga\n}", "func (t *VLStrStr) GoType() string {\n\treturn \"VLStrStr\"\n}", "func MustParse(value string) *Swift {\n\tswft, err := Parse(value)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn swft\n}", "func (c CanonType) MustParse(s string) Tag {\n\tt, err := c.Parse(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn t\n}", "func parseString(rawString string) (interface{}, error) {\n\tdefaultValue, err := parseDefault(rawString)\n\tif err == nil {\n\t\treturn defaultValue, nil\n\t} else {\n\t\treturn data.HollowString{Value: rawString}, nil\n\t}\n}", "func (_type *Type) UnmarshalGQL(val interface{}) error {\n\tstr, ok := val.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"enum %T must be a string\", val)\n\t}\n\t*_type = Type(str)\n\tif err := TypeValidator(*_type); err != nil {\n\t\treturn fmt.Errorf(\"%s is not a valid Type\", str)\n\t}\n\treturn nil\n}", "func (_type *Type) UnmarshalGQL(val interface{}) error {\n\tstr, ok := val.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"enum %T must be a string\", val)\n\t}\n\t*_type = Type(str)\n\tif err := TypeValidator(*_type); err != nil {\n\t\treturn fmt.Errorf(\"%s is not a valid Type\", str)\n\t}\n\treturn nil\n}", "func (s *Sampling) Parse(value string) error {\n\tswitch strings.ToLower(value) {\n\tcase \"disabled\":\n\t\t*s = Disabled\n\tcase \"testing\":\n\t\t*s = Testing\n\tcase \"production\":\n\t\t*s = Production\n\tdefault:\n\t\tf, err := strconv.ParseFloat(value, 64)\n\t\tif err != nil {\n\t\t\treturn instrumentationError(\"invalid Sampling value '%s': %v\", value, err)\n\t\t}\n\t\t*s = Sampling(f)\n\t}\n\treturn nil\n}", "func ParseBumpStrategyType(value string) BumpStrategyType {\n\tswitch strings.ToLower(value) {\n\tcase \"major\":\n\t\treturn MAJOR\n\tcase \"minor\":\n\t\treturn MINOR\n\tcase \"patch\":\n\t\treturn PATCH\n\tdefault:\n\t\treturn AUTO\n\t}\n}", "func StringToPledgeType(sType string) (PledgeType, error) {\n\tswitch strings.ToLower(sType) {\n\tcase \"network\", \"confidant\":\n\t\treturn Network, nil\n\tcase \"vote\":\n\t\treturn Vote, nil\n\tcase \"oracle\":\n\t\treturn Oracle, nil\n\tdefault:\n\t\treturn Invalid, fmt.Errorf(\"unsupport type: %s\", sType)\n\t}\n}", "func ReadGDEF(fp string, print bool) (*Definition, error) {\n\tfile, err := os.Open(fp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ReadGDEF: %v\", err)\n\t}\n\tdefer file.Close()\n\n\treader, a, l := bufio.NewReader(file), make([]string, 6), 0\n\tfor {\n\t\tline, _, err := reader.ReadLine()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn nil, fmt.Errorf(\"ReadTextLines: %v\", err)\n\t\t}\n\t\ta[l] = string(line)\n\t\tl++\n\t\tif l == 6 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tparseHeader := func(a []string, print bool) (Definition, bool, error) {\n\t\tstErr, uni := make([]string, 0), false\n\t\terrfunc := func(v string, err error) {\n\t\t\tstErr = append(stErr, fmt.Sprintf(\" failed to read '%v': %v\", v, err))\n\t\t}\n\n\t\toe, err := strconv.ParseFloat(a[0], 64)\n\t\tif err != nil {\n\t\t\terrfunc(\"OE\", err)\n\t\t}\n\t\ton, err := strconv.ParseFloat(a[1], 64)\n\t\tif err != nil {\n\t\t\terrfunc(\"ON\", err)\n\t\t}\n\t\trot, err := strconv.ParseFloat(a[2], 64)\n\t\tif err != nil {\n\t\t\terrfunc(\"ROT\", err)\n\t\t}\n\t\tnr, err := strconv.ParseInt(a[3], 10, 32)\n\t\tif err != nil {\n\t\t\terrfunc(\"NR\", err)\n\t\t}\n\t\tnc, err := strconv.ParseInt(a[4], 10, 32)\n\t\tif err != nil {\n\t\t\terrfunc(\"NC\", err)\n\t\t}\n\t\tcs, err := strconv.ParseFloat(a[5], 64)\n\t\tif err != nil {\n\t\t\tif a[5][0] == 85 { // 85 = acsii code for 'U'\n\t\t\t\tuni = true\n\t\t\t} else {\n\t\t\t\terrfunc(\"CS\", err)\n\t\t\t}\n\t\t\tcs, err = strconv.ParseFloat(a[5][1:len(a[5])], 64)\n\t\t\tif err != nil {\n\t\t\t\terrfunc(\"CS\", err)\n\t\t\t}\n\t\t} else {\n\t\t\t// stErr = append(stErr, \" *** Fatal error: ReadGDEF.parseHeader: non-uniform grids currently not supported ***\")\n\t\t\tcs = -1.\n\t\t}\n\n\t\t// error handling\n\t\tif len(stErr) > 0 {\n\t\t\treturn Definition{}, uni, fmt.Errorf(\"fatal error(s): ReadGDEF.parseHeader:\\n%s\", strings.Join(stErr, \"\\n\"))\n\t\t}\n\n\t\tgd := Definition{Eorig: oe, Norig: on, Rotation: rot, Cwidth: cs, Nrow: int(nr), Ncol: int(nc)}\n\t\tif print {\n\t\t\tfmt.Printf(\"\\n opened %s\\n\", fp)\n\t\t\tfmt.Printf(\" xul\\t\\t%.1f\\n\", oe)\n\t\t\tfmt.Printf(\" yul\\t\\t%.1f\\n\", on)\n\t\t\tfmt.Printf(\" rotation\\t%f\\n\", rot)\n\t\t\tfmt.Printf(\" nrows\\t\\t%d\\n\", nr)\n\t\t\tfmt.Printf(\" ncols\\t\\t%d\\n\", nc)\n\t\t\tfmt.Printf(\" cell size\\t%.3f\\n\", cs)\n\t\t\tfmt.Printf(\" is uniform:\\t%t\\n\", uni)\n\t\t}\n\n\t\treturn gd, uni, nil\n\t}\n\tgd, isuniform, err := parseHeader(a, print)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif gd.Rotation != 0. {\n\t\treturn nil, fmt.Errorf(\"ReadGDEF error: rotation no yet supported\")\n\t}\n\tif !isuniform {\n\t\t// slst := make([]float64, gd.Nrow+gd.Ncol)\n\t\t// slst[0], _ = strconv.ParseFloat(a[5], 64)\n\t\t// for i := 1; i < gd.Nrow+gd.Ncol; i++ {\n\t\t// \tline, _, err := reader.ReadLine()\n\t\t// \tif err == io.EOF {\n\t\t// \t\treturn nil, fmt.Errorf(\"ReadTextLines (cell widths): %v\", err)\n\t\t// \t} else if err != nil {\n\t\t// \t\treturn nil, fmt.Errorf(\"ReadTextLines (cell widths): %v\", err)\n\t\t// \t}\n\t\t// \tslst[i], _ = strconv.ParseFloat(string(line), 64)\n\t\t// }\n\t\t// gd.VCwidth = slst\n\n\t\tgd.cwidths, gd.cheights = make([]float64, gd.Ncol), make([]float64, gd.Nrow)\n\t\tgd.cheights[0], _ = strconv.ParseFloat(a[5], 64)\n\t\tfor i := 1; i < gd.Nrow; i++ {\n\t\t\tline, _, err := reader.ReadLine()\n\t\t\tif err == io.EOF {\n\t\t\t\treturn nil, fmt.Errorf(\"ReadTextLines (cell widths): %v\", err)\n\t\t\t} else if err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"ReadTextLines (cell widths): %v\", err)\n\t\t\t}\n\t\t\tgd.cheights[i], _ = strconv.ParseFloat(string(line), 64)\n\t\t}\n\t\tfor j := 0; j < gd.Ncol; j++ {\n\t\t\tline, _, err := reader.ReadLine()\n\t\t\tif err == io.EOF {\n\t\t\t\treturn nil, fmt.Errorf(\"ReadTextLines (cell heights): %v\", err)\n\t\t\t} else if err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"ReadTextLines (cell heights): %v\", err)\n\t\t\t}\n\t\t\tgd.cwidths[j], _ = strconv.ParseFloat(string(line), 64)\n\t\t}\n\t}\n\n\tnc := gd.Nrow * gd.Ncol\n\tcn, cx := 0, nc\n\tif nc%8 != 0 {\n\t\tnc += 8 - nc%8 // add padding\n\t}\n\tnc /= 8\n\n\tb1 := make([]byte, nc)\n\tif err := binary.Read(reader, binary.LittleEndian, b1); err != nil { // no active cells\n\t\tif err != io.EOF {\n\t\t\treturn nil, fmt.Errorf(\"fatal error: read actives failed: %v\", err)\n\t\t}\n\t\tif print {\n\t\t\tfmt.Printf(\" (no active cells)\\n\")\n\t\t}\n\t\tgd.Sactives = make([]int, cx)\n\t\tgd.act = make(map[int]bool, cx)\n\t\tgd.Nact = cx\n\t\tfor i := 0; i < cx; i++ {\n\t\t\tgd.Sactives[i] = i\n\t\t\tgd.act[i] = true\n\t\t}\n\t\tgd.Coord = make(map[int]mmaths.Point, cx)\n\t\tcid := 0\n\t\tfor i := 0; i < gd.Nrow; i++ {\n\t\t\tfor j := 0; j < gd.Ncol; j++ {\n\t\t\t\tp := mmaths.Point{X: gd.Eorig + gd.Cwidth*(float64(j)+0.5), Y: gd.Norig - gd.Cwidth*(float64(i)+0.5)}\n\t\t\t\tgd.Coord[cid] = p\n\t\t\t\tcid++\n\t\t\t}\n\t\t}\n\t} else { // active cells\n\t\tt := make([]byte, 1)\n\t\tif v, _ := reader.Read(t); v != 0 {\n\t\t\treturn nil, fmt.Errorf(\"fatal error: EOF not reached when expected\")\n\t\t}\n\t\tgd.Sactives = []int{}\n\t\tgd.act = make(map[int]bool, cx)\n\t\tfor _, b := range b1 {\n\t\t\tfor i := uint(0); i < 8; i++ {\n\t\t\t\tif b&(1<<i)>>i == 1 {\n\t\t\t\t\tgd.Sactives = append(gd.Sactives, cn)\n\t\t\t\t\tgd.act[cn] = true\n\t\t\t\t\tgd.Nact++\n\t\t\t\t}\n\t\t\t\tcn++\n\t\t\t\tif cn >= cx {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif cn != cx {\n\t\t\treturn nil, fmt.Errorf(\"fatal error(s): ReadGDEF:\\n number of cells found (%d) not equal to total (%d): %v\", cn, cx, err)\n\t\t}\n\t\tif gd.Nact > 0 && print {\n\t\t\tfmt.Printf(\" %s active cells\\n\", mmio.Thousands(int64(gd.Nact))) //11,118,568\n\t\t}\n\t\tgd.Coord = make(map[int]mmaths.Point, gd.Nact)\n\t\tcid := 0\n\t\tfor i := 0; i < gd.Nrow; i++ {\n\t\t\tfor j := 0; j < gd.Ncol; j++ {\n\t\t\t\tif _, ok := gd.act[cid]; ok {\n\t\t\t\t\tp := mmaths.Point{X: gd.Eorig + gd.Cwidth*(float64(j)+0.5), Y: gd.Norig - gd.Cwidth*(float64(i)+0.5)}\n\t\t\t\t\tgd.Coord[cid] = p\n\t\t\t\t}\n\t\t\t\tcid++\n\t\t\t}\n\t\t}\n\t}\n\tif print {\n\t\tfmt.Println()\n\t}\n\treturn &gd, nil\n}", "func ParseFloatDef(s string, def float64) float64 {\n\tif f, err := strconv.ParseFloat(s, 32); err == nil {\n\t\treturn f\n\t}\n\treturn def\n}", "func (t *VLStr) GoType() string {\n\treturn \"VLStr\"\n}", "func (sat *SignatureAlgoType) LoadString(str string) error {\n\tswitch str {\n\tcase SignatureAlgoEd25519Specifier.String():\n\t\t*sat = SignatureAlgoEd25519\n\tcase SignatureAlgoNilSpecifier.String():\n\t\t*sat = SignatureAlgoNil\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown SignatureAlgoType string: %s\", str)\n\t}\n\treturn nil\n}", "func (t *TherapistType) FromString(s string) error {\n\tswitch s {\n\tcase \"unknown\":\n\t\t*t = UnknownTherapistType\n\tcase \"ergo\":\n\t\t*t = OccupationalTherapist\n\tcase \"physio\":\n\t\t*t = Physiotherapist\n\tcase \"logo\":\n\t\t*t = SpeechTherapist\n\tdefault:\n\t\treturn errors.New(\"unknown therapist type '\" + s + \"'\")\n\t}\n\treturn nil\n}", "func formatValue(s string) string {\n\tif KEYWORD(s).isValid() {\n\t\treturn s\n\t}\n\treturn fmt.Sprintf(\"'%s'\", s)\n}", "func (me TxsdFeDisplacementMapTypeXChannelSelector) IsG() bool { return me.String() == \"G\" }", "func (f flagString) Parse(value string) interface{} {\n\treturn value\n}", "func (req *PBSRequest) ParseGDPR() string {\n\tif req == nil || req.Regs == nil || len(req.Regs.Ext) == 0 {\n\t\treturn \"\"\n\t}\n\tval, err := jsonparser.GetInt(req.Regs.Ext, \"gdpr\")\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\tgdpr := strconv.Itoa(int(val))\n\n\treturn gdpr\n}", "func (this *NowStr) Type() value.Type { return value.STRING }", "func (parser *Parser) parsePredefined(resolvedInput string, targetType reflect.Type) (interface{}, error) {\n\tvar result interface{}\n\tvar err error\n\tswitch targetType.Kind() {\n\tcase reflect.Bool:\n\t\tresult, err = strconv.ParseBool(resolvedInput)\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tresult, err = strconv.ParseInt(resolvedInput, 0, targetType.Bits())\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tresult, err = strconv.ParseUint(resolvedInput, 0, targetType.Bits())\n\tcase reflect.Float32, reflect.Float64:\n\t\tresult, err = strconv.ParseFloat(resolvedInput, targetType.Bits())\n\tcase reflect.String:\n\t\tresult, err = resolvedInput, nil\n\tdefault:\n\t\tresult, err = nil, errors.New(\"\")\n\t}\n\tif err == nil {\n\t\treturn reflect.ValueOf(result).Convert(targetType).Interface(), nil\n\t}\n\treturn nil, toErrorf(\"Could not convert '%v' to type '%v'\", resolvedInput, targetType.String())\n}", "func MustParse(str string) Quantity {\n\tq, err := ParseQuantity(str)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"cannot parse '%v': %v\", str, err))\n\t}\n\treturn q\n}", "func DataTypeFromString(str string) DataType {\n\tif dataType, exist := StringToDataType[str]; exist {\n\t\treturn dataType\n\t}\n\treturn Unknown\n}", "func stringAutoType(ambiguous string) interface{} {\n\tif ambiguous == \"\" {\n\t\treturn nil\n\t}\n\tif parsedInt, err := strconv.ParseInt(ambiguous, 10, 64); err == nil {\n\t\treturn parsedInt\n\t}\n\tif parsedBool, err := strconv.ParseBool(ambiguous); err == nil {\n\t\treturn parsedBool\n\t}\n\treturn ambiguous\n}", "func ParseGender(name string) (Gender, error) {\n\tif x, ok := _GenderValue[name]; ok {\n\t\treturn x, nil\n\t}\n\treturn Gender(0), fmt.Errorf(\"%s is not a valid Gender\", name)\n}", "func (v *Variant) TypeString() string {\n\t// the string returned from this belongs to GVariant and must not be freed.\n\treturn C.GoString((*C.char)(C.g_variant_get_type_string(v.native())))\n}", "func parseTimeQuantum(v string) (TimeQuantum, error) {\n\tq := TimeQuantum(strings.ToUpper(v))\n\tif !q.Valid() {\n\t\treturn \"\", ErrInvalidTimeQuantum\n\t}\n\treturn q, nil\n}", "func ProposalStateFromStr(val string) ProposalStateType {\n\tswitch val {\n\tcase \"invalid\":\n\t\treturn InvalidState\n\tcase \"unvetted\":\n\t\treturn UnvettedState\n\tcase \"vetted\":\n\t\treturn VettedState\n\tdefault:\n\t\treturn UnknownState\n\t}\n}", "func (script *Script) Type(name string) (Type, bool) {\n\tgslangType, ok := script.types[name]\n\n\treturn gslangType, ok\n}", "func tryParse(s string, typ typeof.Type) (interface{}, bool) {\n\tswitch typ {\n\n\t// Happy Path, return the string\n\tcase typeof.String, typeof.JSON:\n\t\treturn s, true\n\n\t// Try and parse boolean value\n\tcase typeof.Bool:\n\t\tif v, err := strconv.ParseBool(s); err == nil {\n\t\t\treturn v, true\n\t\t}\n\n\t// Try and parse integer value\n\tcase typeof.Int32:\n\t\tif v, err := strconv.ParseInt(s, 10, 32); err == nil {\n\t\t\treturn int32(v), true\n\t\t}\n\n\t// Try and parse integer value\n\tcase typeof.Int64:\n\t\tif v, err := strconv.ParseInt(s, 10, 64); err == nil {\n\t\t\treturn v, true\n\t\t}\n\n\t// Try and parse float value\n\tcase typeof.Float64:\n\t\tif v, err := strconv.ParseFloat(s, 64); err == nil {\n\t\t\treturn v, true\n\t\t}\n\n\tcase typeof.Timestamp:\n\t\tif v, err := time.Parse(time.RFC3339, s); err == nil {\n\t\t\treturn v, true\n\t\t}\n\t}\n\n\treturn nil, false\n}", "func TypeOf(data []byte) Type {\n\tt := data[0]\n\n\t// FIXME: add additional validation\n\n\tswitch {\n\tdefault:\n\t\treturn invalid\n\tcase t == 'i':\n\t\treturn integer\n\tcase t >= '0' && t <= '9':\n\t\treturn str\n\tcase t == 'l':\n\t\treturn list\n\tcase t == 'd':\n\t\treturn dictionary\n\t}\n}", "func BoxTypeAv1C() gomp4.BoxType { return gomp4.StrToBoxType(\"av1C\") }", "func (l settableString) Type() string { return \"<string>\" }", "func DataTypeString(s string) (DataType, error) {\n\tif val, ok := _DataTypeNameToValueMap[s]; ok {\n\t\treturn val, nil\n\t}\n\treturn 0, fmt.Errorf(\"%s does not belong to DataType values\", s)\n}", "func StringToElementType(s string) ElementType {\n\tswitch s {\n\tcase \"PostSyn\":\n\t\treturn PostSyn\n\tcase \"PreSyn\":\n\t\treturn PreSyn\n\tcase \"Gap\":\n\t\treturn Gap\n\tcase \"Note\":\n\t\treturn Note\n\tdefault:\n\t\treturn UnknownElem\n\t}\n}", "func Parse(ctx context.Context, args ...core.Value) (core.Value, error) {\n\terr := core.ValidateArgs(args, 1, 1)\n\n\tif err != nil {\n\t\treturn values.None, err\n\t}\n\n\terr = core.ValidateType(args[0], core.StringType)\n\n\tif err != nil {\n\t\treturn values.None, err\n\t}\n\n\tdrv, err := drivers.StaticFrom(ctx)\n\n\tif err != nil {\n\t\treturn values.None, err\n\t}\n\n\tstr := args[0].(values.String)\n\n\treturn drv.ParseDocument(ctx, str)\n}", "func (l *License) GuessType() error {\n\tnewlineRegexp := regexp.MustCompile(\"(\\r\\n|\\n)\")\n\tspaceRegexp := regexp.MustCompile(\"\\\\s{2,}\")\n\n\t// Lower case everything to make comparison more adaptable\n\tcomp := strings.ToLower(l.Text)\n\n\t// Kill the newlines, since it is not clear if the provided license will\n\t// contain them or not, and either way it does not change the terms of the\n\t// license, so one is not \"more correct\" than the other. This just replaces\n\t// them with spaces. Also replace multiple spaces with a single space to\n\t// make comparison more simple.\n\tcomp = newlineRegexp.ReplaceAllLiteralString(comp, \" \")\n\tcomp = spaceRegexp.ReplaceAllLiteralString(comp, \" \")\n\n\tswitch {\n\tcase scan(comp, \"permission is hereby granted, free of charge, to any \"+\n\t\t\"person obtaining a copy of this software\"):\n\t\tl.Type = LicenseMIT\n\n\tcase scan(comp, \"permission to use, copy, modify, and/or distribute this \"+\n\t\t\"software for any\"):\n\t\tl.Type = LicenseISC\n\n\tcase scan(comp, \"apache license version 2.0, january 2004\") ||\n\t\tscan(comp, \"http://www.apache.org/licenses/license-2.0\"):\n\t\tl.Type = LicenseApache20\n\n\tcase scan(comp, \"gnu general public license version 2, june 1991\"):\n\t\tl.Type = LicenseGPL20\n\n\tcase scan(comp, \"gnu general public license version 3, 29 june 2007\"):\n\t\tl.Type = LicenseGPL30\n\n\tcase scan(comp, \"gnu lesser general public license version 2.1, \"+\n\t\t\"february 1999\"):\n\t\tl.Type = LicenseLGPL21\n\n\tcase scan(comp, \"gnu lesser general public license version 3, \"+\n\t\t\"29 june 2007\"):\n\t\tl.Type = LicenseLGPL30\n\n\tcase scan(comp, \"gnu affero general public license \"+\n\t\t\"version 3, 19 november 2007\"):\n\t\tl.Type = LicenseAGPL30\n\n\tcase scan(comp, \"mozilla public license\") && scan(comp, \"version 2.0\"):\n\t\tl.Type = LicenseMPL20\n\n\tcase scan(comp, \"redistribution and use in source and binary forms\"):\n\t\tswitch {\n\t\tcase scan(comp, \"neither the name of\"):\n\t\t\tl.Type = LicenseNewBSD\n\t\tdefault:\n\t\t\tl.Type = LicenseFreeBSD\n\t\t}\n\n\tcase scan(comp, \"common development and distribution license (cddl) \"+\n\t\t\"version 1.0\"):\n\t\tl.Type = LicenseCDDL10\n\n\tcase scan(comp, \"eclipse public license - v 1.0\"):\n\t\tl.Type = LicenseEPL10\n\n\tcase scan(comp, \"this is free and unencumbered software released into \"+\n\t\t\"the public domain\"):\n\t\tl.Type = LicenseUnlicense\n\n\tdefault:\n\t\treturn ErrUnrecognizedLicense\n\t}\n\n\treturn nil\n}", "func PureTypeEnumFromValue(value string) PureTypeEnum {\r\n switch value {\r\n case \"kStorageArray\":\r\n return PureType_KSTORAGEARRAY\r\n case \"kVolume\":\r\n return PureType_KVOLUME\r\n default:\r\n return PureType_KSTORAGEARRAY\r\n }\r\n}", "func (me TxsdMovementType) IsGa() bool { return me.String() == \"GA\" }", "func (t *VLIntStr) GoType() string {\n\treturn \"VLIntStr\"\n}", "func ParseFormat(s string) (Format, error) {\n\tswitch s {\n\tcase \"\", \"text\":\n\t\treturn FormatText, nil\n\tcase \"json\":\n\t\treturn FormatJSON, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown format: %s\", s)\n\t}\n}", "func GetCompressionType(rawValue string) (CompressionType, error) {\n\tval := strings.TrimSpace(rawValue)\n\tif strings.ToUpper(val) == string(GZIP) {\n\t\treturn GZIP, nil\n\t}\n\treturn \"\", fmt.Errorf(\"Compression Type : %v is not yet supported\", val) //nolint:golint\n}", "func parseValue(s string) (float64, error) {\n\tcaps := valueRE.FindStringSubmatch(s)\n\tif len(caps) == 0 {\n\t\treturn 0, fmt.Errorf(\"Unparsable value: %s\", s)\n\t}\n\tv, err := strconv.ParseFloat(caps[1], 64)\n\tif err != nil {\n\t\treturn 0.0, errors.Wrapf(err, \"Error parsing value: %s\", s)\n\t}\n\n\tswitch u := caps[2]; u {\n\tcase \"\":\n\t\tfallthrough\n\tcase \"px\":\n\t\treturn v, nil\n\tcase \"in\":\n\t\treturn v * dpi, nil\n\tcase \"mm\":\n\t\treturn v * (dpi / mmPerInch), nil\n\tcase \"cm\":\n\t\treturn v * (mmPerCm * dpi / mmPerInch), nil\n\tcase \"pt\":\n\t\treturn v * (dpi / ptPerInch), nil\n\tcase \"pc\":\n\t\treturn v * (ptPerPc * dpi / ptPerInch), nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"Unknown unit: %s\", u)\n\t}\n}", "func strToFloat(str string, typeAbbreviation string) float64 {\n\t// Remove space\n\tif strings.Contains(str, \" \") {\n\t\tstr = strings.ReplaceAll(str, \" \", \"\")\n\t}\n\tstr = strings.ReplaceAll(str, typeAbbreviation, \"\")\n\tf, err := strconv.ParseFloat(str, 10)\n\tif err != nil {\n\t\tErrorLog(\"cannot parse string to float: %s\", str)\n\t\treturn 0\n\t}\n\tInfoLogV1(\"strToFloat %f\", f)\n\treturn f\n}", "func GoFieldType(n *ecsgen.Node) string {\n\t// create a buffer to determine type\n\ttypeBuf := new(bytes.Buffer)\n\n\t// add array syntax if the field normalizes out to an array\n\tif n.IsArray() {\n\t\ttypeBuf.WriteString(\"[]\")\n\t}\n\n\t// if Node is an Object, we need to return this object's type. For example,\n\t// Node(\"client.nat\") needs to return \"ClientNAT\" as it's Go type.\n\tif n.IsObject() {\n\t\ttypeBuf.WriteString(n.TypeIdent().Pascal())\n\t\treturn typeBuf.String()\n\t}\n\n\t// Special cases denoted by the ECS developers.\n\tswitch {\n\tcase n.Name == \"duration\" && n.Definition.Type == \"long\":\n\t\ttypeBuf.WriteString(\"time.Duration\")\n\t\treturn typeBuf.String()\n\tcase n.Name == \"args\" && n.Definition.Type == \"keyword\":\n\t\ttypeBuf.WriteString(\"[]string\")\n\t\treturn typeBuf.String()\n\tcase n.Path == \"labels\":\n\t\ttypeBuf.WriteString(\"map[string]interface{}\")\n\t\treturn typeBuf.String()\n\t}\n\n\t// Find the right type!\n\tswitch n.Definition.Type {\n\tcase \"keyword\", \"text\", \"ip\", \"geo_point\":\n\t\ttypeBuf.WriteString(\"string\")\n\t\treturn typeBuf.String()\n\tcase \"long\":\n\t\ttypeBuf.WriteString(\"int64\")\n\t\treturn typeBuf.String()\n\tcase \"integer\":\n\t\ttypeBuf.WriteString(\"int32\")\n\t\treturn typeBuf.String()\n\tcase \"float\":\n\t\ttypeBuf.WriteString(\"float64\")\n\t\treturn typeBuf.String()\n\tcase \"date\":\n\t\ttypeBuf.WriteString(\"time.Time\")\n\t\treturn typeBuf.String()\n\tcase \"boolean\":\n\t\ttypeBuf.WriteString(\"bool\")\n\t\treturn typeBuf.String()\n\tcase \"object\":\n\t\ttypeBuf.WriteString(\"map[string]interface{}\")\n\t\treturn typeBuf.String()\n\tdefault:\n\t\tpanic(fmt.Errorf(\"no translation for %v (field %s)\", n.Definition.Type, n.Name))\n\t}\n}", "func DefaultUnitType(name string) string {\n\treturn fmt.Sprintf(\"%s.service\", name)\n}", "func ParseString(str string, algorithm geo.Algorithm) (*geo.GPX, error) {\n\treturn gxml.ParseBytes([]byte(str), algorithm)\n}", "func Must(grammarString string) (*grammar.Grammar, tree.Reducer) {\n\tg, r, err := New(grammarString)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn g, r\n}", "func parseGCV(val string) string {\r\n\tif val == \"\" || val == \" \" {\r\n\t\treturn val\r\n\t}\r\n\tvar nval []string\r\n\tsval := strings.Split(val, \"\")\r\n\tfor _, s := range sval {\r\n\t\tif s == \" \" || s == \"0\" {\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tnval = append(nval, s)\r\n\t}\r\n\treturn strings.Join(nval, \"\")\r\n}", "func LoadString(s string) (*types.TypeRegistry, *types.Scope, error) {\n\tTR = types.NewTypeRegistry()\n\tGlobalScope = types.NewScope()\n\n\t_, err := Parse(\"string\", []byte(s))\n\treturn TR, GlobalScope, err\n}", "func ToGoTypeName(value string) (string, classes.Usage) {\n\tif ret, ok := cgoBuiltInTypeMap[value]; ok {\n\t\treturn ret, classes.USAGE_GO_PRIMATIVE\n\t}\n\n\tgoTypeName := ToPascalCase(stripGodotPrefix(value))\n\n\tt, u := classes.GoTypeAndUsage(goTypeName)\n\n\tswitch u {\n\tcase classes.USAGE_GODOT_STRING:\n\t\treturn \"String\", u\n\tcase classes.USAGE_GODOT_STRING_NAME:\n\t\treturn \"StringName\", u\n\t}\n\n\treturn t, u\n}", "func AutotypeValue(input interface{}) interface{} {\n\tif strValue, ok := input.(string); ok {\n\t\tif intVal, err := strconv.ParseInt(strValue, 10, 64); err == nil {\n\t\t\treturn intVal\n\t\t} else if floatVal, err := strconv.ParseFloat(strValue, 64); err == nil {\n\t\t\treturn floatVal\n\t\t} else if strValue == \"true\" {\n\t\t\treturn true\n\t\t} else if strValue == \"false\" {\n\t\t\treturn false\n\t\t} else if strValue == \"null\" {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn input\n}", "func (c *bls12381MapG1) RequiredGas(input []byte) uint64 {\n\treturn params.Bls12381MapG1Gas\n}", "func (t *VTStrStr) GoType() string {\n\treturn \"VTStrStr\"\n}", "func (t *VMStrTPStrStr) GoType() string {\n\treturn \"VMStrTPStrStr\"\n}", "func generalizeType(t1, t2 string) (string, bool) {\n\tif t1 == t2 {\n\t\treturn t1, true\n\t}\n\n\tif t1 == \"\" {\n\t\treturn t2, true\n\t}\n\n\tif t2 == \"\" {\n\t\treturn t1, true\n\t}\n\n\tswitch t1 {\n\tcase indexer.IntegerType:\n\t\tif t2 == indexer.FloatType {\n\t\t\treturn indexer.FloatType, true\n\t\t}\n\n\tcase indexer.FloatType:\n\t\tif t2 == indexer.IntegerType {\n\t\t\treturn indexer.FloatType, true\n\t\t}\n\n\tcase indexer.TextType:\n\t\tswitch t2 {\n\t\tcase indexer.StringType, indexer.DateType:\n\t\t\treturn indexer.TextType, true\n\t\t}\n\n\tcase indexer.StringType:\n\t\tswitch t2 {\n\t\tcase indexer.TextType, indexer.DateType:\n\t\t\treturn indexer.TextType, true\n\t\t}\n\n\tcase indexer.DateType:\n\t\tswitch t2 {\n\t\tcase indexer.StringType:\n\t\t\treturn indexer.StringType, true\n\t\tcase indexer.TextType:\n\t\t\treturn indexer.TextType, true\n\t\t}\n\t}\n\n\treturn \"\", false\n}", "func toBoundary(s string) (BoundaryValue, error) {\n\tvar (\n\t\terr error\n\t\tbv BoundaryValue\n\t)\n\tflag, sK, eK, pK := true, \"start:\", \"end:\", \",\"\n\tf := func(ss, p string) bool { return strings.Contains(ss, p) }\n\n\t// triage function\n\ttrait := func(ts0, ts1, sk, ek string) (bv BoundaryValue, err error) {\n\t\tts0, ts1 = strings.Replace(ts0, sk, \"\", 1), strings.Replace(ts1, ek, \"\", 1)\n\t\tif bv.Start, err = toUint32(ts0); err != nil {\n\t\t\treturn bv, err\n\t\t}\n\t\tbv.End, err = toUint32(ts1)\n\t\treturn bv, err\n\t}\n\n\tswitch flag {\n\tcase f(s, pK) && f(s, sK) && f(s, eK): // e.g. \"start:10,end:15\" or \"end:15,start:10\"\n\t\tts := strings.Split(s, pK)\n\t\tif ts0, ts1 := ts[0], ts[1]; f(ts0, sK) && f(ts1, eK) { // ts0=\"start:10\" and ts1=\"end:15\"\n\t\t\treturn trait(ts0, ts1, sK, eK)\n\t\t} else if ts0, ts1 := ts[0], ts[1]; f(ts0, eK) && f(ts1, sK) { // ts0=\"end:15\" and ts1=\"start:10\"\n\t\t\treturn trait(ts1, ts0, sK, eK)\n\t\t} else {\n\t\t\treturn bv, fmt.Errorf(\"unsupported format %s\", s)\n\t\t}\n\tcase f(s, pK) && !f(s, sK) && !f(s, eK): // e.g. \"10,15\"\n\t\tts := strings.Split(s, pK)\n\t\treturn trait(ts[0], ts[1], \"\", \"\")\n\tcase (f(s, sK) || (f(s, pK) && f(s, sK))) && !f(s, eK): // e.g. \"start:10\" or \"start:10,\"\n\t\tts := strings.Replace(s, sK, \"\", 1)\n\t\tts = strings.Replace(ts, pK, \"\", 1)\n\t\tbv.End = math.MaxUint32\n\t\tbv.Start, err = toUint32(ts)\n\t\treturn bv, err\n\tcase (f(s, eK) || (f(s, pK) && f(s, eK))) && !f(s, sK): // e.g. \"end:15\" or \"end:15,\"\n\t\tts := strings.Replace(s, eK, \"\", 1)\n\t\tts = strings.Replace(ts, pK, \"\", 1)\n\t\tbv.End, err = toUint32(ts)\n\t\treturn bv, err\n\tdefault: // e.g. \"10\"\n\t\tbv.Start, err = toUint32(s)\n\t\tbv.End = math.MaxUint32\n\t\treturn bv, err\n\t}\n}", "func GeoShapeFromString(str string) (GeoShapeGo, error) {\n\tcharsToTrim := \"polygon() \"\n\tpolygonStrs := regexp.MustCompile(`\\),\\s*\\(`).Split(strings.TrimFunc(strings.ToLower(str), func(r rune) bool {\n\t\treturn strings.IndexRune(charsToTrim, r) >= 0\n\t}), -1)\n\n\tshape := GeoShapeGo{}\n\tshape.Polygons = make([][]GeoPointGo, 0, len(polygonStrs))\n\tfor _, polygonStr := range polygonStrs {\n\t\tlngLatPairs := strings.Split(polygonStr, \",\")\n\t\tpolygon := make([]GeoPointGo, 0, len(lngLatPairs))\n\t\tfor _, lngLatPair := range lngLatPairs {\n\t\t\tlngLat := strings.Fields(lngLatPair)\n\t\t\tif len(lngLat) != 2 {\n\t\t\t\treturn GeoShapeGo{}, utils.StackError(nil, \"invalid point format %s\", lngLatPair)\n\t\t\t}\n\t\t\tlng, err := strconv.ParseFloat(lngLat[0], 32)\n\t\t\tif err != nil || lng < -180 || lng > 180 {\n\t\t\t\treturn GeoShapeGo{}, utils.StackError(err, \"invalid longitude, expect float number in [-180, 180], got %s\", lngLat[0])\n\t\t\t}\n\t\t\tlat, err := strconv.ParseFloat(lngLat[1], 32)\n\t\t\tif err != nil || lat < -90 || lat > 90 {\n\t\t\t\treturn GeoShapeGo{}, utils.StackError(err, \"invalid latitude, expect float number in [-90, 90], got %s\", lngLat[1])\n\t\t\t}\n\t\t\tpoint := GeoPointGo{float32(lat), float32(lng)}\n\t\t\tpolygon = append(polygon, point)\n\t\t}\n\t\tshape.Polygons = append(shape.Polygons, polygon)\n\t}\n\treturn shape, nil\n}", "func (me TxsdMovementType) IsGc() bool { return me.String() == \"GC\" }", "func (String) IsGround() bool {\n\treturn true\n}", "func mustParseTimeQuantum(v string) TimeQuantum {\n\tq, err := parseTimeQuantum(v)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn q\n}", "func AnimalFromString(str string) Animal {\n\tswitch str {\n\tcase animalStringZebra:\n\t\treturn AnimalZebra\n\tcase animalStringGiraffe:\n\t\treturn AnimalGiraffe\n\tcase animalStringCoyote:\n\t\treturn AnimalCoyote\n\tdefault:\n\t\treturn AnimalUnknown\n\t}\n}", "func parse(s string, unit map[string]float64) (int64, error) {\n\tvar size int64\n\tvar ok bool\n\tfor {\n\t\ts = strings.TrimSpace(s)\n\t\tm := sizeRE.FindStringSubmatch(s)\n\t\tif m == nil {\n\t\t\tbreak\n\t\t}\n\t\tv, err := strconv.ParseFloat(m[1], 64)\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"sizeflag: invalid size %q\", m[0])\n\t\t\t// Should not be structurally possible, though.\n\t\t}\n\t\tif mul, ok := unit[strings.ToLower(m[2])]; ok {\n\t\t\tv *= mul\n\t\t} else {\n\t\t\treturn size, fmt.Errorf(\"sizeflag: invalid unit %q\", m[2])\n\t\t}\n\t\tsize += int64(v)\n\t\ts = s[len(m[0]):]\n\t\tok = true\n\t}\n\tif s = strings.TrimSpace(s); s != \"\" {\n\t\tv, err := strconv.ParseInt(s, 10, 64)\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"sizeflag: invalid size %q\", s)\n\t\t}\n\t\tsize += v\n\t} else if !ok {\n\t\treturn 0, fmt.Errorf(\"sizeflag: invalid size %q\", s)\n\t}\n\treturn size, nil\n}", "func StringValue(s string) Value { return Value{Typ: '$', Str: []byte(s)} }", "func StringToDataType(s string) (DataType, error) {\n\tswitch s {\n\tcase \"DSA\":\n\t\treturn DSA, nil\n\tcase \"DFA\":\n\t\treturn DFA, nil\n\tcase \"DDA\":\n\t\treturn DDA, nil\n\tcase \"DSB\":\n\t\treturn DSB, nil\n\tcase \"DFB\":\n\t\treturn DFB, nil\n\tcase \"DDB\":\n\t\treturn DDB, nil\n\tdefault:\n\t\treturn 0, ErrUnknownDataType\n\t}\n}", "func (i *Type) UnmarshalGQL(value interface{}) error {\n\tstr, ok := value.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Type should be a string, got %T\", value)\n\t}\n\n\tvar err error\n\t*i, err = TypeString(str)\n\treturn err\n}", "func (me TFontFamilyValueType) String() string { return xsdt.String(me).String() }", "func SyncTypeParse(v string) (SyncType, error) {\n\tif strings.EqualFold(v, string(SyncTypeIFrame)) {\n\t\treturn SyncTypeIFrame, nil\n\t}\n\n\tif strings.EqualFold(v, string(SyncTypeRedirect)) {\n\t\treturn SyncTypeRedirect, nil\n\t}\n\n\treturn SyncTypeUnknown, fmt.Errorf(\"invalid sync type `%s`\", v)\n}", "func (o *Cvtermsynonym) TypeG(mods ...qm.QueryMod) cvtermQuery {\n\treturn o.Type(boil.GetDB(), mods...)\n}", "func parseBaseType(node *node32) (Type, error) {\n\tswitch node.pegRule {\n\tcase ruleINT:\n\t\treturn IntType{}, nil\n\tcase ruleBOOL:\n\t\treturn BoolType{}, nil\n\tcase ruleCHAR:\n\t\treturn CharType{}, nil\n\tcase ruleSTRING:\n\t\treturn ArrayType{base: CharType{}}, nil\n\tcase ruleVOID:\n\t\treturn VoidType{}, nil\n\tcase ruleCLASSTYPE:\n\t\treturn &ClassType{name: node.up.match}, nil\n\tcase ruleENUMTYPE:\n\t\treturn &EnumType{ident: node.up.next.match}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unknown type: %s\", node.up.match)\n\t}\n}", "func FromCodon(input string) (string, error) {\n if input == \"UAA\" || input == \"UAG\" || input == \"UGA\" {\n return \"\", STOP\n }\n if _, ok := codons[input]; ok != true {\n return \"\", ErrInvalidBase\n }\n return codons[input], nil\n}" ]
[ "0.5375152", "0.53319323", "0.518015", "0.5162776", "0.51477826", "0.50997907", "0.50446767", "0.49252293", "0.4923826", "0.49124753", "0.4878213", "0.487216", "0.48520857", "0.48334092", "0.47779343", "0.47779343", "0.47713298", "0.4755434", "0.47027177", "0.4701107", "0.46960124", "0.46709839", "0.46305326", "0.45946395", "0.4583976", "0.45795268", "0.45785674", "0.45778954", "0.45746836", "0.45471445", "0.45451662", "0.45449045", "0.45365113", "0.45340538", "0.45288563", "0.45288563", "0.4522384", "0.45024142", "0.44954208", "0.44895536", "0.44827792", "0.44800347", "0.44659647", "0.44550005", "0.4439521", "0.44372177", "0.44280845", "0.4408836", "0.44049153", "0.4398793", "0.43964142", "0.4391645", "0.43899962", "0.43898323", "0.4377778", "0.4374698", "0.43732375", "0.43679568", "0.43665966", "0.43628946", "0.43598938", "0.4352128", "0.43456817", "0.43432277", "0.43415323", "0.43300313", "0.4326642", "0.43215194", "0.43004695", "0.4298222", "0.4298076", "0.42946362", "0.42931744", "0.42805004", "0.42799425", "0.42789292", "0.4265511", "0.42650607", "0.4246335", "0.42460695", "0.42408133", "0.4239186", "0.42273676", "0.42148557", "0.42145714", "0.42142382", "0.42124066", "0.4209468", "0.42033046", "0.42027158", "0.420156", "0.4199379", "0.41960937", "0.4192574", "0.41886318", "0.41853338", "0.4184771", "0.4183371", "0.41815135", "0.41783452" ]
0.80514586
0
GetConnectionDetails calls the data catalog service
GetConnectionDetails вызывает службу каталога данных
func GetConnectionDetails(datasetID string, req *modules.DataInfo, input *app.M4DApplication) error { // Set up a connection to the data catalog interface server. conn, err := grpc.Dial(utils.GetDataCatalogServiceAddress(), grpc.WithInsecure(), grpc.WithBlock()) if err != nil { return err } defer conn.Close() c := dc.NewDataCatalogServiceClient(conn) // Contact the server and print out its response. ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() response, err := c.GetDatasetInfo(ctx, &dc.CatalogDatasetRequest{ AppId: utils.CreateAppIdentifier(input), DatasetId: datasetID, }) if err != nil { return err } req.DataDetails = response.GetDetails().DeepCopy() return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetConnectionDetails(req *modules.DataInfo, input *app.M4DApplication) error {\n\t// Set up a connection to the data catalog interface server.\n\tconn, err := grpc.Dial(utils.GetDataCatalogServiceAddress(), grpc.WithInsecure(), grpc.WithBlock())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\tc := dc.NewDataCatalogServiceClient(conn)\n\n\t// Contact the server and print out its response.\n\tctx, cancel := context.WithTimeout(context.Background(), time.Minute)\n\tdefer cancel()\n\n\tresponse, err := c.GetDatasetInfo(ctx, &dc.CatalogDatasetRequest{\n\t\tAppId: utils.CreateAppIdentifier(input),\n\t\tDatasetId: req.Context.DataSetID,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdetails := response.GetDetails()\n\n\tprotocol, err := utils.GetProtocol(details)\n\tif err != nil {\n\t\treturn err\n\t}\n\tformat, err := utils.GetDataFormat(details)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconnection, err := serde.ToRawExtension(details.DataStore)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.DataDetails = &modules.DataDetails{\n\t\tName: details.Name,\n\t\tInterface: app.InterfaceDetails{\n\t\t\tProtocol: protocol,\n\t\t\tDataFormat: format,\n\t\t},\n\t\tGeography: details.Geo,\n\t\tConnection: *connection,\n\t}\n\n\treturn nil\n}", "func GetConnectionDetails(ctx context.Context, cluster *kubernetes.Cluster, secretNamespace, secretName string) (*ConnectionDetails, error) {\n\tdetails := ConnectionDetails{RegistryCredentials: []RegistryCredentials{}}\n\n\tsecret, err := cluster.GetSecret(ctx, secretNamespace, secretName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar dockerconfigjson DockerConfigJSON\n\terr = json.Unmarshal(secret.Data[\".dockerconfigjson\"], &dockerconfigjson)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdetails.Namespace = secret.ObjectMeta.Annotations[RegistrySecretNamespaceAnnotationKey]\n\n\tfor url, auth := range dockerconfigjson.Auths {\n\t\tdetails.RegistryCredentials = append(details.RegistryCredentials, RegistryCredentials{\n\t\t\tURL: url,\n\t\t\tUsername: auth.Username,\n\t\t\tPassword: auth.Password,\n\t\t})\n\t}\n\n\treturn &details, nil\n}", "func (tr *Service) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *CapacityProvider) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *MongoCollection) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *CassandraKeySpace) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *Account) GetConnectionDetailsMapping() map[string]string {\n\treturn map[string]string{\"connection_strings[*]\": \"status.atProvider.connectionStrings[*]\", \"primary_key\": \"status.atProvider.primaryKey\", \"primary_master_key\": \"status.atProvider.primaryMasterKey\", \"primary_readonly_key\": \"status.atProvider.primaryReadonlyKey\", \"primary_readonly_master_key\": \"status.atProvider.primaryReadonlyMasterKey\", \"secondary_key\": \"status.atProvider.secondaryKey\", \"secondary_master_key\": \"status.atProvider.secondaryMasterKey\", \"secondary_readonly_key\": \"status.atProvider.secondaryReadonlyKey\", \"secondary_readonly_master_key\": \"status.atProvider.secondaryReadonlyMasterKey\"}\n}", "func (tr *MongoDatabase) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *SQLDatabase) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *SQLContainer) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *SQLStoredProcedure) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *Cluster) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func GetConnectionDetails(device *packngo.Device) managed.ConnectionDetails {\n\t// RootPassword is only in the device responses for 24h\n\t// TODO(displague) Handle devices without public IPv4\n\tif device.RootPassword == \"\" || device.GetNetworkInfo().PublicIPv4 == \"\" {\n\t\treturn managed.ConnectionDetails{}\n\t}\n\n\t// TODO(displague) device.User is in the API but not included in packngo\n\tuser := \"root\"\n\tport := \"22\" // ssh\n\n\treturn managed.ConnectionDetails{\n\t\txpv1.ResourceCredentialsSecretEndpointKey: []byte(device.GetNetworkInfo().PublicIPv4),\n\t\txpv1.ResourceCredentialsSecretUserKey: []byte(user),\n\t\txpv1.ResourceCredentialsSecretPasswordKey: []byte(device.RootPassword),\n\t\txpv1.ResourceCredentialsSecretPortKey: []byte(port),\n\t}\n}", "func (tr *CassandraTable) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *SQLFunction) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *GremlinDatabase) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func GetCatalogDetails() string {\n\tvar s string\n\tfor _, book := range GetAllMappedBooks() {\n\t\ts += GetBookDetails(book.ID)\n\t}\n\n\treturn s\n}", "func (tr *Table) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (c DBConfig) ConnectionInfo() string {\n\n\tswitch c.DBDialect {\n\tcase \"postgres\":\n\t\tif c.Password == \"\" {\n\t\t\treturn fmt.Sprintf(\"host=%s port=%d user=%s dbname=%s sslmode=disable\", c.Host, c.Port, c.Usr, c.Name)\n\t\t}\n\t\treturn fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\", c.Host, c.Port, c.Usr, c.Password, c.Name)\n\n\tcase \"mssql\":\n\t\treturn fmt.Sprintf(\"sqlserver://%s:%s@l%s:%d?database=%s\", c.Usr, c.Password, c.Host, c.Port, c.Name)\n\n\tcase \"hdb\":\n\t\treturn fmt.Sprintf(\"hdb://%s:%s@%s:%d\", c.Usr, c.Password, c.Host, c.Port)\n\n\tcase \"sqlite\":\n\t\treturn fmt.Sprintf(\"%s\", c.Name)\n\n\tcase \"mysql\":\n\t\treturn fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s?charset=utf8&parseTime=True&loc=Local\", c.Usr, c.Password, c.Host, c.Port, c.Name)\n\n\tdefault:\n\t\tpanic(fmt.Errorf(\"dialect %s is not recognized\", c.DBDialect))\n\n\t}\n}", "func GetConnectionDetails(in v1beta1.Queue) managed.ConnectionDetails {\n\tif in.Status.AtProvider.URL == \"\" {\n\t\treturn nil\n\t}\n\treturn managed.ConnectionDetails{\n\t\txpv1.ResourceCredentialsSecretEndpointKey: []byte(in.Status.AtProvider.URL),\n\t}\n}", "func (tr *NotebookWorkspace) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *TaskDefinition) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (r *ProtocolIncus) GetConnectionInfo() (*ConnectionInfo, error) {\n\tinfo := ConnectionInfo{}\n\tinfo.Certificate = r.httpCertificate\n\tinfo.Protocol = \"incus\"\n\tinfo.URL = r.httpBaseURL.String()\n\tinfo.SocketPath = r.httpUnixPath\n\n\tinfo.Project = r.project\n\tif info.Project == \"\" {\n\t\tinfo.Project = \"default\"\n\t}\n\n\tinfo.Target = r.clusterTarget\n\tif info.Target == \"\" && r.server != nil {\n\t\tinfo.Target = r.server.Environment.ServerName\n\t}\n\n\turls := []string{}\n\tif r.httpProtocol == \"https\" {\n\t\turls = append(urls, r.httpBaseURL.String())\n\t}\n\n\tif r.server != nil && len(r.server.Environment.Addresses) > 0 {\n\t\tfor _, addr := range r.server.Environment.Addresses {\n\t\t\tif strings.HasPrefix(addr, \":\") {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\turl := fmt.Sprintf(\"https://%s\", addr)\n\t\t\tif !shared.StringInSlice(url, urls) {\n\t\t\t\turls = append(urls, url)\n\t\t\t}\n\t\t}\n\t}\n\n\tinfo.Addresses = urls\n\n\treturn &info, nil\n}", "func (tr *GremlinGraph) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (tr *SQLTrigger) GetConnectionDetailsMapping() map[string]string {\n\treturn nil\n}", "func (s *Simple) GetConnectionData() json.RawMessage {\n\n\tauthentication := MetaAuthentication{Action: \"authenticate\", Resource: s.Resource}\n\tauthentication.Type = s.BusinessId + \".\" + s.DeploymentId + \".simple\"\n\tdata := loginData{Login: s.Login, Password: s.Password}\n\tauthentication.Data = data\n\n\textAuthent := ExtAuthent{Authentication: authentication}\n\treturnByteArray, _ := json.Marshal(extAuthent)\n\n\tgo s.waitForHandshake()\n\n\treturn json.RawMessage(returnByteArray)\n}", "func (c PostgresConfig) ConnectionInfo() string {\n\tif c.Password == \"\" {\n\t\treturn fmt.Sprintf(\"host=%s port=%d user=%s dbname=%s sslmode=disable\",\n\t\t\tc.Host, c.Port, c.User, c.Name)\n\t}\n\treturn fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\tc.Host, c.Port, c.User, c.Password, c.Name)\n}", "func (mg *OpenIDConnectProvider) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *SQLContainer) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *MongoCollection) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *CassandraKeySpace) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (_Energyconsumption *EnergyconsumptionCallerSession) GetConsAccntDetails(_consAccntAddr common.Address) (string, string, uint32, string, uint32, uint32, string, error) {\n\treturn _Energyconsumption.Contract.GetConsAccntDetails(&_Energyconsumption.CallOpts, _consAccntAddr)\n}", "func (mg *Subnetwork) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (_Energyconsumption *EnergyconsumptionSession) GetConsAccntDetails(_consAccntAddr common.Address) (string, string, uint32, string, uint32, uint32, string, error) {\n\treturn _Energyconsumption.Contract.GetConsAccntDetails(&_Energyconsumption.CallOpts, _consAccntAddr)\n}", "func (mg *SQLFunction) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *SQLDatabase) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *MongoDatabase) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *ManagedSSLCertificate) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *SQLStoredProcedure) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (a *DeploymentsApiService) ApiDeploymentsIdConnectionInfoGet(ctx context.Context, id string) ApiApiDeploymentsIdConnectionInfoGetRequest {\n\treturn ApiApiDeploymentsIdConnectionInfoGetRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tid: id,\n\t}\n}", "func GetConnectionString() string {\n\treturn fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\", host, port, user, password, dbname)\n}", "func (c *Client) GetDataSetDetails(ctx context.Context, params *GetDataSetDetailsInput, optFns ...func(*Options)) (*GetDataSetDetailsOutput, error) {\n\tif params == nil {\n\t\tparams = &GetDataSetDetailsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetDataSetDetails\", params, optFns, c.addOperationGetDataSetDetailsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetDataSetDetailsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "func (mg *GremlinDatabase) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *CassandraTable) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (m *AccessPackage) GetCatalog()(AccessPackageCatalogable) {\n return m.catalog\n}", "func GetDbConnectionURL() string {\n\tvar dbinfo string\n\n\tif c.dbEnv != \"\" {\n\t\tif containsDbConfiguration() {\n\t\t\tlog.Print(\"INFO - Configuration file contains environment setup , all others setup for db will be ignored (host,user,password,dbname,port)\")\n\t\t}\n\t\treturn os.Getenv(c.dbEnv)\n\t} else if c.db.password == \"\" {\n\t\tdbinfo = fmt.Sprintf(\"user=%s dbname=%s sslmode=disable\",\n\t\t\tc.db.user, c.db.db)\n\t} else {\n\t\tdbinfo = fmt.Sprintf(\"user=%s password=%s dbname=%s sslmode=disable\",\n\t\t\tc.db.user, c.db.password, c.db.db)\n\t}\n\treturn dbinfo\n}", "func (mg *Network) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (_Energyconsumption *EnergyconsumptionCaller) GetConsAccntDetails(opts *bind.CallOpts, _consAccntAddr common.Address) (string, string, uint32, string, uint32, uint32, string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t\tret1 = new(string)\n\t\tret2 = new(uint32)\n\t\tret3 = new(string)\n\t\tret4 = new(uint32)\n\t\tret5 = new(uint32)\n\t\tret6 = new(string)\n\t)\n\tout := &[]interface{}{\n\t\tret0,\n\t\tret1,\n\t\tret2,\n\t\tret3,\n\t\tret4,\n\t\tret5,\n\t\tret6,\n\t}\n\terr := _Energyconsumption.contract.Call(opts, out, \"getConsAccntDetails\", _consAccntAddr)\n\treturn *ret0, *ret1, *ret2, *ret3, *ret4, *ret5, *ret6, err\n}", "func (sci SQLConnectionInfo) AsConnectionInfo() (*ConnectionInfo, bool) {\n\treturn nil, false\n}", "func (q *quicTracer) getConnectionsInfo() (conns []connInfo) {\n\tq.mu.Lock()\n\tdefer q.mu.Unlock()\n\n\tfor _, tracer := range q.tracers {\n\t\tconns = append(conns, connInfo{\n\t\t\tid: tracer.id,\n\t\t\tpackets: tracer.packets,\n\t\t})\n\t}\n\n\treturn conns\n}", "func (mg *GremlinGraph) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (sdk *SDKSteps) GetConnection(from, to string) (*didexClient.Connection, error) {\n\tconnections, err := sdk.context.DIDExchangeClients[from].QueryConnections(&didexClient.QueryConnectionsParams{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s failed to fetch their connections : %w\", from, err)\n\t}\n\n\tfor _, c := range connections {\n\t\tif c.TheirLabel == to {\n\t\t\treturn c, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"no connection %s -> %s\", from, to)\n}", "func (mg *InstanceProfile) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *Instance) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *AccessKey) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *Group) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *Policy) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *Account) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (a *ibmcAccessDetails) DriverInfo(bmcCreds Credentials) map[string]interface{} {\n\n\tibmcAddress := []string{}\n\tschemes := strings.Split(a.bmcType, \"+\")\n\tif len(schemes) > 1 {\n\t\tibmcAddress = append(ibmcAddress, schemes[1])\n\t} else {\n\t\tibmcAddress = append(ibmcAddress, ibmcDefaultScheme)\n\t}\n\tibmcAddress = append(ibmcAddress, \"://\")\n\tibmcAddress = append(ibmcAddress, a.host)\n\tibmcAddress = append(ibmcAddress, a.path)\n\n\tresult := map[string]interface{}{\n\t\t\"ibmc_username\": bmcCreds.Username,\n\t\t\"ibmc_password\": bmcCreds.Password,\n\t\t\"ibmc_address\": strings.Join(ibmcAddress, \"\"),\n\t}\n\n\tif a.disableCertificateVerification {\n\t\tresult[\"ibmc_verify_ca\"] = false\n\t}\n\n\treturn result\n}", "func (mg *Router) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *Role) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func GetInfoFromConnection(conn *amqp.Connection) ConnectionInfo {\n\treturn ConnectionInfo{\n\t\tVhost: conn.Config.Vhost,\n\t\tMajor: conn.Major,\n\t\tMinor: conn.Minor,\n\t\tLocales: conn.Locales,\n\t\tServer: conn.Properties,\n\t\tChannelMax: conn.Config.ChannelMax,\n\t\tFrameSize: conn.Config.FrameSize,\n\t\tHeartbeat: conn.Config.Heartbeat,\n\t\tLocale: conn.Config.Locale,\n\t\tProperties: conn.Config.Properties,\n\t\tTLS: conn.Config.TLSClientConfig,\n\t}\n}", "func (mg *Firewall) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (i *Info) GetDetails() (customerInfo *models.CustomerInfo, err error) {\n\tcustomerInfo = new(models.CustomerInfo)\n\n\terr = DB.Select().\n\t\tFrom(\"view_customer_info\").\n\t\tWhere(dbx.HashExp{\"customer_id\": i.cs.CustomerID}).\n\t\tOne(customerInfo)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\terr = ErrCustomerNotFound\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn\n}", "func GetConnStr(address, user, pass, catalog string) string {\n\tformat := \"https://%s:%s@%s?custom_client=insight&catalog=%s\"\n\tconnStr := fmt.Sprintf(format, user, pass, address, catalog)\n\treturn connStr\n}", "func (mg *User) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (client *WANIPConnection1) GetConnectionTypeInfoCtx(\n\tctx context.Context,\n) (NewConnectionType string, NewPossibleConnectionTypes string, err error) {\n\t// Request structure.\n\trequest := interface{}(nil)\n\t// BEGIN Marshal arguments into request.\n\n\t// END Marshal arguments into request.\n\n\t// Response structure.\n\tresponse := &struct {\n\t\tNewConnectionType string\n\t\tNewPossibleConnectionTypes string\n\t}{}\n\n\t// Perform the SOAP call.\n\tif err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, \"GetConnectionTypeInfo\", request, response); err != nil {\n\t\treturn\n\t}\n\n\t// BEGIN Unmarshal arguments from response.\n\n\tif NewConnectionType, err = soap.UnmarshalString(response.NewConnectionType); err != nil {\n\t\treturn\n\t}\n\tif NewPossibleConnectionTypes, err = soap.UnmarshalString(response.NewPossibleConnectionTypes); err != nil {\n\t\treturn\n\t}\n\t// END Unmarshal arguments from response.\n\treturn\n}", "func (sci SQLConnectionInfo) AsBasicConnectionInfo() (BasicConnectionInfo, bool) {\n\treturn &sci, true\n}", "func (mg *SQLTrigger) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *Table) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (mg *NotebookWorkspace) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (t TenantConnectionInformation) GetConnection() (*gorm.DB, error) {\n\n\tif len(strings.TrimSpace(t.ConnectionString)) == 0 {\n\t\treturn nil, errors.New(\"Connection string was not found or was empty..\")\n\t}\n\n\tdb, err := gorm.Open(\"postgres\", t.ConnectionString)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "func (o DatabaseAccountConnectionStringResponseOutput) ConnectionString() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DatabaseAccountConnectionStringResponse) string { return v.ConnectionString }).(pulumi.StringOutput)\n}", "func (mg *RouterNAT) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (a *CloudCostBudgetsApiService) GetCostDetails(ctx context.Context, accountIdentifier string, id string) (ResponseDtoBudgetData, *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 ResponseDtoBudgetData\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/ccm/api/budgets/{id}/costDetails\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\tlocalVarQueryParams.Add(\"accountIdentifier\", parameterToString(accountIdentifier, \"\"))\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 == 400 {\n\t\t\tvar v Failure\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 ModelError\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 == 0 {\n\t\t\tvar v ResponseDtoBudgetData\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}", "func (t *TMDB) NetworkDetails(id int64) (*CompanyDetails, error) {\n\tc := new(CompanyDetails)\n\tif err := t.get(c, fmt.Sprintf(\"/3/network/%d\", id), url.Values{}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn c, nil\n}", "func getConsumber(c *cli.Context) error {\n\tid := c.String(\"id\")\n\tusername := c.String(\"username\")\n\n\tvar requestURL string\n\tif id != \"\" {\n\t\trequestURL = fmt.Sprintf(\"%s/%s\", CONSUMER_RESOURCE_OBJECT, id)\n\t} else if username != \"\" {\n\t\trequestURL = fmt.Sprintf(\"%s/%s\", CONSUMER_RESOURCE_OBJECT, username)\n\t} else {\n\t\treturn fmt.Errorf(\"username and id invalid.\")\n\t}\n\n\tctx, cannel := context.WithTimeout(context.Background(), 30*time.Second)\n\tdefer cannel()\n\n\tserverResponse, err := client.GatewayClient.Get(ctx, requestURL, 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}", "func (m *ExternalConnection) GetDescription()(*string) {\n return m.description\n}", "func (ci ConnectionInfo) AsConnectionInfo() (*ConnectionInfo, bool) {\n\treturn &ci, true\n}", "func (f *IBMPICloudConnectionClient) GetAll(powerinstanceid string, timeout time.Duration) (*models.CloudConnections, error) {\n\n\tparams := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetallParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid)\n\tresp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to get all cloud connection %s\", err)\n\t}\n\treturn resp.Payload, nil\n}", "func (client *WANPPPConnection1) GetConnectionTypeInfoCtx(\n\tctx context.Context,\n) (NewConnectionType string, NewPossibleConnectionTypes string, err error) {\n\t// Request structure.\n\trequest := interface{}(nil)\n\t// BEGIN Marshal arguments into request.\n\n\t// END Marshal arguments into request.\n\n\t// Response structure.\n\tresponse := &struct {\n\t\tNewConnectionType string\n\t\tNewPossibleConnectionTypes string\n\t}{}\n\n\t// Perform the SOAP call.\n\tif err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, \"GetConnectionTypeInfo\", request, response); err != nil {\n\t\treturn\n\t}\n\n\t// BEGIN Unmarshal arguments from response.\n\n\tif NewConnectionType, err = soap.UnmarshalString(response.NewConnectionType); err != nil {\n\t\treturn\n\t}\n\tif NewPossibleConnectionTypes, err = soap.UnmarshalString(response.NewPossibleConnectionTypes); err != nil {\n\t\treturn\n\t}\n\t// END Unmarshal arguments from response.\n\treturn\n}", "func GetConnection(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ConnectionState, opts ...pulumi.ResourceOption) (*Connection, error) {\n\tvar resource Connection\n\terr := ctx.ReadResource(\"gcp:bigquery/connection:Connection\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (mg *Address) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func NewGetPublishConnectionDetailsTo(receiver, runtime string) New {\n\treturn func(f *jen.File, o types.Object) {\n\t\tf.Commentf(\"GetPublishConnectionDetailsTo of this %s.\", o.Name())\n\t\tf.Func().Params(jen.Id(receiver).Op(\"*\").Id(o.Name())).Id(\"GetPublishConnectionDetailsTo\").Params().Op(\"*\").Qual(runtime, \"PublishConnectionDetailsTo\").Block(\n\t\t\tjen.Return(jen.Id(receiver).Dot(fields.NameSpec).Dot(\"PublishConnectionDetailsTo\")),\n\t\t)\n\t}\n}", "func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) {\n\treturn client.GetConnectionTypeInfoCtx(context.Background())\n}", "func ExampleTimeSeriesDatabaseConnectionsClient_Get() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armdigitaltwins.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewTimeSeriesDatabaseConnectionsClient().Get(ctx, \"resRg\", \"myDigitalTwinsService\", \"myConnection\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.TimeSeriesDatabaseConnection = armdigitaltwins.TimeSeriesDatabaseConnection{\n\t// \tName: to.Ptr(\"myConnection\"),\n\t// \tType: to.Ptr(\"Microsoft.DigitalTwins/digitalTwinsInstances/timeSeriesDatabaseConnections\"),\n\t// \tID: to.Ptr(\"/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourcegroups/resRg/providers/Microsoft.DigitalTwins/digitalTwinsInstances/myDigitalTwinsService/timeSeriesDatabaseConnections/myConnection\"),\n\t// \tProperties: &armdigitaltwins.AzureDataExplorerConnectionProperties{\n\t// \t\tConnectionType: to.Ptr(armdigitaltwins.ConnectionTypeAzureDataExplorer),\n\t// \t\tProvisioningState: to.Ptr(armdigitaltwins.TimeSeriesDatabaseConnectionStateSucceeded),\n\t// \t\tAdxDatabaseName: to.Ptr(\"myDatabase\"),\n\t// \t\tAdxEndpointURI: to.Ptr(\"https://mycluster.kusto.windows.net\"),\n\t// \t\tAdxResourceID: to.Ptr(\"/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster\"),\n\t// \t\tAdxTableName: to.Ptr(\"myTable\"),\n\t// \t\tEventHubConsumerGroup: to.Ptr(\"$Default\"),\n\t// \t\tEventHubEndpointURI: to.Ptr(\"sb://myeh.servicebus.windows.net/\"),\n\t// \t\tEventHubEntityPath: to.Ptr(\"myeh\"),\n\t// \t\tEventHubNamespaceResourceID: to.Ptr(\"/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh\"),\n\t// \t},\n\t// }\n}", "func (m *VpnConfiguration) GetConnectionName()(*string) {\n val, err := m.GetBackingStore().Get(\"connectionName\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (t *TMDB) CollectionDetails(id int64, params ...option) (*CollectionDetails, error) {\n\tc := new(CollectionDetails)\n\tif err := t.get(c, fmt.Sprintf(\"/3/collection/%d\", id), url.Values{}, params...); err != nil {\n\t\treturn nil, err\n\t}\n\treturn c, nil\n}", "func GetDetails(w http.ResponseWriter, r *http.Request) {\n\tvar ac Account\n\taccountName := r.URL.Query().Get(\"name\")\n\t(&ac).GetAccount(accountName)\n\tres, _ := json.Marshal(ac)\n\tfmt.Fprintf(w, string(res))\n}", "func (mg *RolePolicyAttachment) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}", "func (ci ConnectionInfo) AsBasicConnectionInfo() (BasicConnectionInfo, bool) {\n\treturn &ci, true\n}", "func EnvDetails(envID string) (*model.Response, error) {\n\turl := helpers.BuildURL(connectionString(), \"environments\", envID)\n\treturn client.Get(url)\n}", "func (f *IBMPICloudConnectionClient) Get(pclouddef *p_cloud_cloud_connections.PcloudCloudconnectionsGetParams) (*models.CloudConnection, error) {\n\n\tparams := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetParams().WithCloudInstanceID(pclouddef.CloudInstanceID).WithCloudConnectionID(pclouddef.CloudConnectionID)\n\tresp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, ibmpisession.NewAuth(f.session, pclouddef.CloudInstanceID))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to get cloud connection %s\", err)\n\t}\n\treturn resp.Payload, nil\n}", "func (b *Bucket) DBInfo(ctx context.Context) (info db.Info, cc db.CollectionConfig, err error) {\n\tctx, err = b.Context(ctx)\n\tif err != nil {\n\t\treturn\n\t}\n\tid, err := b.Thread()\n\tif err != nil {\n\t\treturn\n\t}\n\tinfo, err = b.clients.Threads.GetDBInfo(ctx, id)\n\tif err != nil {\n\t\treturn\n\t}\n\tcc, err = b.clients.Threads.GetCollectionInfo(ctx, id, buckets.CollectionName)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn info, cc, nil\n}", "func (l *Libvirt) ConnectGetSysinfo(Flags uint32) (rSysinfo string, err error) {\n\tvar buf []byte\n\n\targs := ConnectGetSysinfoArgs {\n\t\tFlags: Flags,\n\t}\n\n\tbuf, err = encode(&args)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar r response\n\tr, err = l.requestStream(203, constants.Program, buf, nil, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Return value unmarshaling\n\ttpd := typedParamDecoder{}\n\tct := map[string]xdr.TypeDecoder{\"libvirt.TypedParam\": tpd}\n\trdr := bytes.NewReader(r.Payload)\n\tdec := xdr.NewDecoderCustomTypes(rdr, 0, ct)\n\t// Sysinfo: string\n\t_, err = dec.Decode(&rSysinfo)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "func (o *OCMProvider) GetConnection() *ocm.Connection {\n\treturn o.conn\n}", "func (t *MedLabPharmaChaincode) GetContainerDetails(stub shim.ChaincodeStubInterface, container_id string) ([]byte, error) {\n\tfmt.Println(\"runnin GetContainerDetails \")\n\tvar key, jsonResp string\n\tvar err error\n\n\tif container_id == \"\" {\n\t\treturn nil, errors.New(\"Incorrect number of arguments. Expecting name of the key to query\")\n\t}\n\n\tfmt.Println(\"key:\" + container_id)\n\tvalAsbytes, err := stub.GetState(container_id)\n\tfmt.Println(valAsbytes)\n\tif err != nil {\n\t\tjsonResp = \"{\\\"Error\\\":\\\"Failed to get state for \" + key + \"\\\"}\"\n\t\treturn nil, errors.New(jsonResp)\n\t}\n\n\treturn valAsbytes, nil\n}", "func dialMetainfoDB(ctx context.Context, project *Project) (_ *metaclient.DB, err error) {\n\treturn project.dialMetainfoDB(ctx)\n}", "func Details(configFlags *genericclioptions.ConfigFlags, args []string) error {\n\tclientcfg := configFlags.ToRawKubeConfigLoader()\n\tcfg, err := clientcfg.RawConfig()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Can't assemble raw config\")\n\t}\n\tif len(args) < 1 {\n\t\treturn errors.New(\"need a cluster to operate on, please provide the cluster name\")\n\t}\n\tclusterID := args[0]\n\tcluster := cfg.Clusters[clusterID]\n\tif cluster == nil {\n\t\treturn errors.New(fmt.Sprintf(\"cluster %q not found in kubeconfig\", clusterID))\n\t}\n\n\tfmt.Printf(\"API server endpoint: %v\\n\", cluster.Server)\n\tcontext := contextOf(cfg, clusterID)\n\tcoreres, err := coreResDetails(cfg, context)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"\\n%v\\n\", coreres)\n\treturn nil\n}", "func (mg *UserPolicyAttachment) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo {\n\treturn mg.Spec.PublishConnectionDetailsTo\n}" ]
[ "0.7811777", "0.64218867", "0.6247037", "0.6234979", "0.6198452", "0.61878574", "0.61641467", "0.61612487", "0.6139142", "0.61310023", "0.60981506", "0.6091691", "0.6087747", "0.59778386", "0.5948832", "0.5941653", "0.58762443", "0.57883453", "0.573324", "0.56949484", "0.566347", "0.56435907", "0.5643346", "0.5630021", "0.56179786", "0.5545095", "0.5426052", "0.5418313", "0.53810626", "0.53621686", "0.534958", "0.5319464", "0.5313756", "0.53010774", "0.5292344", "0.52831155", "0.52607065", "0.5251149", "0.522812", "0.5211654", "0.5154901", "0.5151801", "0.51489586", "0.5144176", "0.51399356", "0.5124792", "0.51205873", "0.51125497", "0.50904024", "0.5086176", "0.5070041", "0.50587964", "0.5058542", "0.5057715", "0.50537443", "0.503418", "0.50331044", "0.5028188", "0.5027855", "0.5016949", "0.4985442", "0.4966095", "0.4955507", "0.49530035", "0.4949982", "0.49343368", "0.493427", "0.49273303", "0.49192384", "0.49156246", "0.4911491", "0.490869", "0.4904012", "0.48856938", "0.48702142", "0.48656943", "0.4857278", "0.48571545", "0.48534092", "0.48502052", "0.48428768", "0.484146", "0.4833811", "0.47966498", "0.47870123", "0.47842866", "0.47805634", "0.47728044", "0.47703245", "0.4767", "0.47654986", "0.47557682", "0.47554624", "0.47499818", "0.47464734", "0.47429815", "0.47369614", "0.47238553", "0.47221488", "0.4710382" ]
0.77983415
1
FormatDiscoveryMessage returns string reparesentation of Playlist Summary
FormatDiscoveryMessage возвращает строковое представление Playlist Summary
func FormatDiscoveryMessage(summary *types.PlaylistTracksSummary) string { builder := &strings.Builder{} builder.WriteString(fmt.Sprintf("Playlist '%v' summary:\n", summary.Name)) for i, t := range summary.Tracks { str := fmt.Sprintf("#%v. [%v - %v](%v)\n", i+1, t.Artist, t.Name, t.Link) builder.WriteString(str) } return builder.String() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func discover(logger *zap.Logger, overlay *kademlia.Protocol) string {\n\tids := overlay.Discover()\n\n\tvar str []string\n\tvar info string\n\tfor _, id := range ids {\n\t\tstr = append(str, fmt.Sprintf(\"%s(%s)\", id.Address, id.PubKey.String()[:PrintedLength]))\n\t}\n\n\tif len(ids) > 0 {\n\t\tlogger.Info(fmt.Sprintf(\"Discovered %d peer(s)\", len(ids)),\n\t\t\tzap.String(\"detail\", strings.Join(str, \", \")),\n\t\t)\n\t\tinfo = fmt.Sprintf(`{\"discovered_peers\":%d,\"detail\":\"%s\"}`, len(ids), strings.Join(str, \",\"))\n\t} else {\n\t\tlogger.Error(\"Did not discover any peers.\")\n\t\tinfo = `{\"discovered_peers\":0,\"detail\":\"\"}`\n\t}\n\treturn info\n}", "func (p *protocol) DiscoveryID(chanID int) string {\n\treturn fmt.Sprintf(\"/pcp/%d/%d\", p.TimeSlotStart().UnixNano(), chanID)\n}", "func (s ServiceDiscovery) String() string {\n\treturn awsutil.Prettify(s)\n}", "func descriptionContents(shuffledData *ClipJSON) string {\n\tcontents := `\\n\\n` // Start with new line to seperate message at top\n\tcurrentTime := 0\n\n\tfor _, clip := range shuffledData.Clips {\n\t\tcontents += fmt.Sprintf(\"Title: %s\\nVod: %s\\nTime: %s\\n\\n\", clip.Title, clip.Vod.URL, youtubeTimify(currentTime))\n\t\t// Convert clip.Duration to milliseconds, then round in to the nearest millisecond\n\t\tcurrentTime += int(math.Floor(clip.Duration + 0.5))\n\t}\n\n\treturn contents\n}", "func (s GetDiscoverySummaryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (s GetDiscoverySummaryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (id StreamingLocatorId) String() string {\n\tcomponents := []string{\n\t\tfmt.Sprintf(\"Subscription: %q\", id.SubscriptionId),\n\t\tfmt.Sprintf(\"Resource Group Name: %q\", id.ResourceGroupName),\n\t\tfmt.Sprintf(\"Media Service Name: %q\", id.MediaServiceName),\n\t\tfmt.Sprintf(\"Streaming Locator Name: %q\", id.StreamingLocatorName),\n\t}\n\treturn fmt.Sprintf(\"Streaming Locator (%s)\", strings.Join(components, \"\\n\"))\n}", "func (s DnsServiceDiscovery) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (m BulkMessage) String() string {\n\tmd, _ := json.Marshal(m.Metadata)\n\tb := strings.Builder{}\n\tb.WriteString(fmt.Sprintf(\"[BulkMessage] topic='%s' metadata=%s entries=%d\", m.Topic, md, len(m.Entries)))\n\tfor i, e := range m.Entries {\n\t\tb.WriteString(fmt.Sprintf(\"\\n%d: \", i))\n\t\tb.WriteString(e.String())\n\t}\n\treturn b.String()\n}", "func (o LookupNoteResultOutput) Discovery() DiscoveryResponseOutput {\n\treturn o.ApplyT(func(v LookupNoteResult) DiscoveryResponse { return v.Discovery }).(DiscoveryResponseOutput)\n}", "func (s Playlist) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (p *peer) Info() string {\n\treturn fmt.Sprintf(\"%s delay %d (%d of %d success, %d of %d fails)\\n\",\n\t\tp.Url, p.Delay, p.Pings, p.Limit, p.Fails, p.Maxfail)\n}", "func (o *Screenrecordingmetadatarequest) String() string {\n \n \n o.MetaData = []Screenrecordingmetadata{{}} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "func (m InfoMessage) Format() string {\n\treturn wrapInfo(m.Text)\n}", "func strFormatOut(input *gofeed.Item) string {\n\tvar output string = input.Title + \"\\n\" + input.Link + \"\\n\"\n\treturn output\n}", "func (h aliasMessage) String() string {\n\tswitch h.op {\n\tcase \"list\":\n\t\t// Create a new pretty table with cols configuration\n\t\tt := newPrettyRecord(2,\n\t\t\tRow{\"Alias\", \"Alias\"},\n\t\t\tRow{\"URL\", \"URL\"},\n\t\t\tRow{\"AccessKey\", \"AccessKey\"},\n\t\t\tRow{\"SecretKey\", \"SecretKey\"},\n\t\t\tRow{\"API\", \"API\"},\n\t\t\tRow{\"Path\", \"Path\"},\n\t\t)\n\t\t// Handle deprecated lookup\n\t\tpath := h.Path\n\t\tif path == \"\" {\n\t\t\tpath = h.Lookup\n\t\t}\n\t\treturn t.buildRecord(h.Alias, h.URL, h.AccessKey, h.SecretKey, h.API, path)\n\tcase \"remove\":\n\t\treturn console.Colorize(\"AliasMessage\", \"Removed `\"+h.Alias+\"` successfully.\")\n\tcase \"add\": // add is deprecated\n\t\tfallthrough\n\tcase \"set\":\n\t\treturn console.Colorize(\"AliasMessage\", \"Added `\"+h.Alias+\"` successfully.\")\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "func (req AddToClusterMessage) String() string {\n\treturn \"AddToClusterMessage:{\\nsource:\" + req.Source.String() + \",\\ndest: \" + req.Dest.String() + \",\\nmessage:\" + req.Message + \" }\"\n}", "func (node *PartitionSpec) Format(buf *TrackedBuffer) {\n\tswitch node.Action {\n\tcase ReorganizeAction:\n\t\tbuf.astPrintf(node, \"%s %v into (\", ReorganizeStr, node.Name)\n\t\tvar prefix string\n\t\tfor _, pd := range node.Definitions {\n\t\t\tbuf.astPrintf(node, \"%s%v\", prefix, pd)\n\t\t\tprefix = \", \"\n\t\t}\n\t\tbuf.astPrintf(node, \")\")\n\tdefault:\n\t\tpanic(\"unimplemented\")\n\t}\n}", "func (rl ResolutionList) String() string {\n\tvar sb strings.Builder\n\tfmt.Fprintf(&sb, \"[\")\n\tsep := \"\"\n\tfor _, r := range rl {\n\t\tfmt.Fprintf(&sb, \"%s%s\", sep, r.asString())\n\t\tsep = \", \"\n\t}\n\tfmt.Fprintf(&sb, \"]\")\n\treturn sb.String()\n}", "func (m BulkMessageEntry) String() string {\n\tmd, _ := json.Marshal(m.Metadata)\n\treturn fmt.Sprintf(\"[BulkMessageEntry] entryId='%s' data='%s' content-type='%s' metadata=%s\", m.EntryId, string(m.Event), m.ContentType, md)\n}", "func (m *ChatMessage) GetSummary()(*string) {\n return m.summary\n}", "func (s AwsCloudMapServiceDiscovery) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (h *BotSnack) Descr() string {\n\treturn \"Consumes a botsnack. This pleases mcchunkie and brings balance to the universe.\"\n}", "func (*CMsgGCToClientManageFavoritesResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{339}\n}", "func formatCmdDisplay(results client.StorageFormatResults, summary bool) (string, error) {\n\tout := &bytes.Buffer{}\n\n\tgroups, mixedGroups, err := groupFormatResults(results, summary)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(groups) > 0 {\n\t\tfmt.Fprintf(out, \"\\n%s\\n\", groups)\n\t}\n\n\treturn formatHostGroups(out, mixedGroups), nil\n}", "func (*ListNodePlanningsResponse) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_plannings_services_proto_rawDescGZIP(), []int{15}\n}", "func (*ListNamespacePlanningsResponse) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_plannings_services_proto_rawDescGZIP(), []int{13}\n}", "func ShowQueryingChannelEventsMsgDetail(Status string) {\n\tswitch Status {\n\tcase \"200 OK\":\n\t\tlog.Println(\"Successful query\")\n\tcase \"400 Bad Request\":\n\t\tlog.Println(\"The provided query string is malformed\")\n\tcase \"404 Not Found\":\n\t\tlog.Println(\"The channel does not exist\")\n\tcase \"500 Server Error\":\n\t\tlog.Println(\"Internal Raiden node error\")\n\tcase \"504 TimeOut\":\n\t\tlog.Println(\"No response,timeout\")\n\tdefault:\n\t\tlog.Println(\"Unknown error,QueryingChannelEvents Failure:\", Status)\n\t}\n}", "func (c *Check) String() (string) {\n\tvar s string\n\n\t// Service Status\n\ts = fmt.Sprintf(\"%s:\", c.Status.String())\n\n\t// First line of message\n\tif len(c.message) == 0 {\n\t\ts += \"Message must not be empty!!!\"\n\t\treturn s\n\t}\n\ts += fmt.Sprintf(\" %s\", c.message[0])\n\n\t// Performancedata. Note: Currently all perfdata will be sent in first line\n\tif len(c.perfdata) > 0 {\n\t\ts += \"|\"\n\n\t\tfor _, p := range c.perfdata {\n\t\t\ts += fmt.Sprintf(\"%s \", p.String()) \n\t\t}\n\t\ts = strings.TrimRight(s, \" \")\n\t}\n\n\t// Additional message lines\n\tif len(c.message) > 1 {\n\t\tfor i := 1; i < len(c.message); i++ {\n\t\t\ts += fmt.Sprintf(\"\\n%s\", c.message[i])\n\t\t}\n\t}\n\n\treturn s\n}", "func (s GetDiscoverySummaryInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (s GetDiscoverySummaryInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (*WebRTCSDP) Descriptor() ([]byte, []int) {\n\treturn file_signalling_proto_rawDescGZIP(), []int{8}\n}", "func (s ChannelDefinition) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (s Song) Details() (string) {\n return fmt.Sprintf(\"Song: %s, Length: %d\", s.Name, s.Length)\n}", "func (s CreateJobPlaylist) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (statsResult *Result) Format() string {\n\tformat := \"\"\n\tformat += fmt.Sprintln(\"Summary:\")\n\tformat += fmt.Sprintf(\"\\tClients:\\t%d\\n\", statsResult.Clients)\n\tformat += fmt.Sprintf(\"\\tParallel calls per client:\\t%d\\n\", statsResult.Parallels)\n\tformat += fmt.Sprintf(\"\\tTotal calls:\\t%d\\n\", statsResult.TotalCalls)\n\tformat += fmt.Sprintf(\"\\tTotal time:\\t%.3fs\\n\", statsResult.TotalTime)\n\tformat += fmt.Sprintf(\"\\tRequests per second:\\t%.3f\\n\", statsResult.RequestsPerSecond)\n\tformat += fmt.Sprintf(\"\\tFastest time for request:\\t%.6fms\\n\", statsResult.FastestTimeForRequest)\n\tformat += fmt.Sprintf(\"\\tAverage time per request:\\t%.6fms\\n\", statsResult.AverageTimePerRequest)\n\tformat += fmt.Sprintf(\"\\tSlowest time for request:\\t%.6fms\\n\\n\", statsResult.SlowestTimeForRequest)\n\tformat += fmt.Sprintln(\"Time:\")\n\tformat += fmt.Sprintf(\"\\t00.0001%%\\ttime for request:\\t%.6fms\\n\", statsResult.N000001thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t00.0010%%\\ttime for request:\\t%.6fms\\n\", statsResult.N000010thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t00.0100%%\\ttime for request:\\t%.6fms\\n\", statsResult.N000100thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t00.1000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N001000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t01.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N010000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t05.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N050000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t10.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N100000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t25.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N250000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t50.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N500000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t75.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N750000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t90.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N900000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t95.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N950000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t99.0000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N990000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t99.9000%%\\ttime for request:\\t%.6fms\\n\", statsResult.N999000thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t99.9900%%\\ttime for request:\\t%.6fms\\n\", statsResult.N999900thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t99.9990%%\\ttime for request:\\t%.6fms\\n\", statsResult.N999990thMillionthTime)\n\tformat += fmt.Sprintf(\"\\t99.9999%%\\ttime for request:\\t%.6fms\\n\\n\", statsResult.N999999thMillionthTime)\n\n\tif statsResult.TotalRequestBodySizes > 0 {\n\t\tformat += fmt.Sprintln(\"Request:\")\n\t\tformat += fmt.Sprintf(\"\\tTotal request body sizes:\\t%d\\n\", statsResult.TotalRequestBodySizes)\n\t\tformat += fmt.Sprintf(\"\\tAverage body size per request:\\t%.2f Byte\\n\", statsResult.AverageBodySizePerRequest)\n\t\tformat += fmt.Sprintf(\"\\tRequest rate per second:\\t%.2f Byte/s (%.2f MByte/s)\\n\\n\", statsResult.RequestRateBytePerSecond, statsResult.RequestRateMBytePerSecond)\n\t}\n\tif statsResult.TotalResponseBodySizes > 0 {\n\t\tformat += fmt.Sprintln(\"Response:\")\n\t\tformat += fmt.Sprintf(\"\\tTotal response body sizes:\\t%d\\n\", statsResult.TotalResponseBodySizes)\n\t\tformat += fmt.Sprintf(\"\\tAverage body size per response:\\t%.2f Byte\\n\", statsResult.AverageBodySizePerResponse)\n\t\tformat += fmt.Sprintf(\"\\tResponse rate per second:\\t%.2f Byte/s (%.2f MByte/s)\\n\\n\", statsResult.ResponseRateBytePerSecond, statsResult.ResponseRateMBytePerSecond)\n\t}\n\tformat += fmt.Sprintln(\"Result:\")\n\tformat += fmt.Sprintf(\"\\tResponse ok:\\t%d (%.3f%%)\\n\", statsResult.ResponseOk, statsResult.ResponseOkPercentile)\n\tformat += fmt.Sprintf(\"\\tErrors:\\t%d (%.3f%%)\\n\", statsResult.Errors, statsResult.ErrorsPercentile)\n\treturn format\n}", "func (p *ubDebugPayload) String() string {\n\treturn fmt.Sprintf(\"[%s][%s][%s][%s]\", formatFlags(p.flags), p.suffix, p.original, p.list)\n}", "func makeDescription(draconResult map[string]string, extras []string) string {\n\tdesc := \"This issue was automatically generated by the Dracon security pipeline.\\n\\n\" +\n\t\t\"*\" + draconResult[\"description\"] + \"*\" + \"\\n\\n\"\n\n\t// Append the extra fields to the description\n\tif len(extras) > 0 {\n\t\tdesc = desc + \"{code:}\" + \"\\n\"\n\t\tfor _, s := range extras {\n\t\t\tdesc = desc + fmt.Sprintf(\"%s: %*s\\n\", s, 25-len(s)+len(draconResult[s]), draconResult[s])\n\t\t}\n\t\tdesc = desc + \"{code}\" + \"\\n\"\n\t}\n\treturn desc\n}", "func (p *DiscoveryProtocol) onDiscoveryResponse(s inet.Stream) {\n\tdata := &api.DiscoveryResponse{}\n\tdecodeProtoMessage(data, s)\n\n\t// Authenticate integrity and authenticity of the message\n\tif valid := authenticateProtoMsg(data, data.DiscoveryMsgData.MessageData); !valid {\n\t\tlog.Println(\"Failed to authenticate message\")\n\t\treturn\n\t}\n\n\tdiscoveryPeer := s.Conn().RemotePeer()\n\tpubKey := data.DiscoveryMsgData.InitHash // TODO: InitHash is a temporary solution for the public key.\n\tlog.Println(\"pubKey: \", pubKey)\n\tp.mu.Lock()\n\tp.NodeIDs[pubKey] = append(p.NodeIDs[pubKey], discoveryPeer.Pretty())\n\tif len(p.NodeIDs[pubKey]) == cap(p.NodeIDs[pubKey]) {\n\t\t// TODO: Return the nodes as an event here\n\t\t// TODO: Remove the key of this map\n\t}\n\tp.mu.Unlock()\n\n\tlog.Printf(\"%s: Received discovery response from %s. Message id:%s. Message: %s.\", s.Conn().LocalPeer(), discoveryPeer, data.DiscoveryMsgData.MessageData.Id, data.Message)\n}", "func (v *Visibilities) Message() string {\n\tvar msg string\n\n\tif len(v.Visibilities) == 0 {\n\t\tmsg = \"No visibilities registered.\"\n\t} else if len(v.Visibilities) == 1 {\n\t\tmsg = \"One visibility registered.\"\n\t} else {\n\t\tmsg = fmt.Sprintf(\"%d visibilities registered.\", len(v.Visibilities))\n\t}\n\n\treturn msg\n}", "func (r *Recommendation) Format() string {\n\tscore := \"Scored\"\n\tif !r.Scored {\n\t\tscore = \"Not Scored\"\n\t}\n\treturn fmt.Sprintf(\"CIS %v - %v (%v)\", r.CisID, r.Name, score)\n}", "func (p *ubPayload) String() string {\n\treturn fmt.Sprintf(\"[%s][%s]\", formatFlags(p.flags), p.suffix)\n}", "func describeNeighbor(nb interface{}) string {\n\tdesc := decoders.MapGetString(nb, \"description\", \"\")\n\tif desc != \"\" {\n\t\treturn desc\n\t}\n\n\taddr := decoders.MapGetString(nb, \"remote_addr\", \"invalid_address\")\n\tasn := decoders.MapGetString(nb, \"remote_as\", \"\")\n\treturn fmt.Sprintf(\"PEER AS%s %s\", asn, addr)\n}", "func convertDiscoverRequestToDnsMsg(request *namingpb.DiscoverRequest, id uint16) (*dns.Msg, error) {\n\tif request == nil {\n\t\treturn nil, model.NewSDKError(model.ErrCodeAPIInvalidArgument, nil, \"invalid namingpb.DiscoverRequest\")\n\t}\n\tdnsReqMsg := dns.Msg{\n\t\tMsgHdr: dns.MsgHdr{\n\t\t\tId: id,\n\t\t\tResponse: false,\n\t\t\tOpcode: dns.OpCodePolarisGetResource,\n\t\t\tAuthoritative: false,\n\t\t\tTruncated: false,\n\t\t\tRecursionDesired: false,\n\t\t\tRecursionAvailable: false,\n\t\t\tZero: false,\n\t\t\tAuthenticatedData: false,\n\t\t\tCheckingDisabled: false,\n\t\t\tRcode: 0,\n\t\t\tQdcount: 1,\n\t\t\tAncount: 0,\n\t\t\tNscount: 0,\n\t\t\tArcount: 0,\n\t\t},\n\t}\n\tquestion := dns.PolarisGetResourceQuestion{\n\t\tBasePolarisQuestion: dns.BasePolarisQuestion{},\n\t\tReq: request,\n\t}\n\tdnsReqMsg.Question = append(dnsReqMsg.Question, &question)\n\treturn &dnsReqMsg, nil\n}", "func (s ChannelSummary) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (s AutomatedDiscoveryInformation) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (t TelemetryTalker) String(spacesn string) (result string) {\n\tspaces3 := \" \"\n\tspacesn3 := spacesn + spaces3\n\tspacesn6 := spacesn3 + spaces3\n\tif t.SpoofedStatus != nil {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %t\\n\", spacesn3, \"spoofed-status\", *t.SpoofedStatus)\n\t}\n\tif t.SourcePrefix != nil {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %s\\n\", spacesn3, \"source-prefix\", *t.SourcePrefix)\n\t}\n\tfor k, v := range t.SourcePortRange {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"source-port-range\", k+1)\n\t\tif v.LowerPort != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"lower-port\", *v.LowerPort)\n\t\t}\n\t\tif v.UpperPort != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"upper-port\", *v.UpperPort)\n\t\t}\n\t}\n\tfor k, v := range t.SourceIcmpTypeRange {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"source-icmp-type-range\", k+1)\n\t\tif v.LowerType != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"lower-type\", *v.LowerType)\n\t\t}\n\t\tif v.UpperType != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"upper-type\", *v.UpperType)\n\t\t}\n\t}\n\tfor k, v := range t.TotalAttackTraffic {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"total-attack-traffic\", k+1)\n\t\tresult += v.String(spacesn3)\n\t}\n\tif t.TotalAttackConnection != nil {\n\t\tresult += t.TotalAttackConnection.String(spacesn3)\n\t}\n\treturn\n}", "func (*CMsgGCToClientBattlePassRollupListResponse_EventInfo) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{227, 0}\n}", "func (s FirewallRuleGroupMetadata) String() string {\n\treturn awsutil.Prettify(s)\n}", "func Info(ctx *dgc.Ctx) *discordgo.MessageEmbed {\n\t// Read the memstats\n\tvar memStats runtime.MemStats\n\truntime.ReadMemStats(&memStats)\n\theapInUse := datasize.ByteSize(memStats.HeapInuse)\n\tstackInUse := datasize.ByteSize(memStats.StackInuse)\n\n\treturn &discordgo.MessageEmbed{\n\t\tTitle: \"Information\",\n\t\tTimestamp: time.Now().Format(time.RFC3339),\n\t\tColor: 0x0893d8,\n\t\tFields: []*discordgo.MessageEmbedField{\n\t\t\t{\n\t\t\t\tName: \"Application\",\n\t\t\t\tValue: \"Mode: `\" + static.Mode + \"`\" +\n\t\t\t\t\t\"\\nVersion: `\" + static.Version + \"`\" +\n\t\t\t\t\t\"\\nUptime: `\" + time.Since(static.StartupTime).Round(time.Second).String() + \"`\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"Discord\",\n\t\t\t\tValue: \"Guilds: `\" + strconv.Itoa(len(ctx.Session.State.Guilds)) + \"`\" +\n\t\t\t\t\t\"\\nAPI latency: `\" + ctx.Session.HeartbeatLatency().Round(time.Millisecond).String() + \"`\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"System\",\n\t\t\t\tValue: \"OS: `\" + runtime.GOOS + \"`\" +\n\t\t\t\t\t\"\\nArchitecture: `\" + runtime.GOARCH + \"`\" +\n\t\t\t\t\t\"\\nCurrent Goroutines: `\" + strconv.Itoa(runtime.NumGoroutine()) + \"`\" +\n\t\t\t\t\t\"\\nOccupied heap: `\" + heapInUse.HumanReadable() + \"`\" +\n\t\t\t\t\t\"\\nOccupied stack: `\" + stackInUse.HumanReadable() + \"`\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"General\",\n\t\t\t\tValue: \"Developer(s): `Lukaesebrot#8001`\" +\n\t\t\t\t\t\"\\nGitHub repository: [here](http://github.com/Lukaesebrot/asterisk)\" +\n\t\t\t\t\t\"\\nInvite me: [here](https://discord.com/api/oauth2/authorize?client_id=\" + static.Self.ID + \"&permissions=0&scope=bot)\" +\n\t\t\t\t\t\"\\nSupport guild: [here](https://discord.gg/ddz9b86)\",\n\t\t\t},\n\t\t},\n\t}\n}", "func (*ListClusterPlanningsResponse) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_plannings_services_proto_rawDescGZIP(), []int{17}\n}", "func (ev *Event) Format(format string) string {\n\treturn fmt.Sprintf(\"Start um %s - Name %s\\n\", ev.Start.Format(\"15:04\"), ev.Name)\n\t//return fmt.Sprintf(\"Start um %s - Name %s\\n%s\\n\", ev.Start.Format(\"15:04\"), ev.Name, ev.Info)\n}", "func generateDiscoveryDoc(apiConfig *endpoints.ApiDescriptor, apiFormat apiFormat) (string, error) {\n\tpath := \"apis/generate/\" + string(apiFormat)\n\tconfig, err := json.Marshal(apiConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequestMap := map[string]interface{}{\"config\": string(config)}\n\trequestBody, err := json.Marshal(requestMap)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn dispatchDiscoveryRequest(path, string(requestBody))\n}", "func (cfg *Config) FormatDSN() string {\n\treturn fmt.Sprintf(`%s:%s@%s?env=%s&with=%s&verbose=%s&curr_project=%s&scheme=%s`,\n\t\tcfg.POPAccessID, cfg.POPAccessSecret, cfg.POPURL, encodeJSONB64(cfg.Env),\n\t\tencodeJSONB64(cfg.With), strconv.FormatBool(cfg.Verbose), cfg.Project, cfg.POPScheme)\n}", "func (s *APIImpl) Discovery(ctx echo.Context) error {\n\treturn ctx.JSON(http.StatusOK, &s.metadata)\n}", "func printDistroWatchNews(m map[string]string) string {\n\trelease := parseUrlforStu(m[\"news\"])\n\tvar output string\n\tfor _, thing := range release.Items {\n\t\tif strings.Contains(thing.Title, \"DistroWatch Weekly\") {\n\t\t\toutput += strFormatOut(thing)\n\t\t\toutput += \"\\n\"\n\t\t}\n\t}\n\treturn output\n}", "func (t Talker) String(spacesn string) (result string) {\n\tspaces3 := \" \"\n\tspacesn3 := spacesn + spaces3\n\tspacesn6 := spacesn3 + spaces3\n\tif t.SpoofedStatus != nil {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %t\\n\", spacesn3, \"spoofed-status\", *t.SpoofedStatus)\n\t}\n\tif t.SourcePrefix != nil {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %s\\n\", spacesn3, \"source-prefix\", *t.SourcePrefix)\n\t}\n\tfor k, v := range t.SourcePortRange {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"source-port-range\", k+1)\n\t\tif v.LowerPort != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"lower-port\", *v.LowerPort)\n\t\t}\n\t\tif v.UpperPort != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"upper-port\", *v.UpperPort)\n\t\t}\n\t}\n\tfor k, v := range t.SourceIcmpTypeRange {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"source-icmp-type-range\", k+1)\n\t\tif v.LowerType != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"lower-type\", *v.LowerType)\n\t\t}\n\t\tif v.UpperType != nil {\n\t\t\tresult += fmt.Sprintf(\"%s\\\"%s\\\": %d\\n\", spacesn6, \"upper-type\", *v.UpperType)\n\t\t}\n\t}\n\tfor k, v := range t.TotalAttackTraffic {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"total-attack-traffic\", k+1)\n\t\tresult += v.String(spacesn3)\n\t}\n\tfor k, v := range t.TotalAttackConnectionProtocol {\n\t\tresult += fmt.Sprintf(\"%s\\\"%s[%d]\\\":\\n\", spacesn3, \"total-attack-connection-protocol\", k+1)\n\t\tresult += v.String(spacesn3)\n\t}\n\treturn\n}", "func (e *Engine) display(m *nats.Msg) {\n\tsubjectSize := len(m.Subject)\n\tif subjectSize > e.longestSubSize {\n\t\te.longestSubSize = subjectSize\n\t}\n\tpaddingSize := e.longestSubSize - subjectSize\n\tpadding := strings.Repeat(\" \", paddingSize)\n\n\tvar text string\n\tswitch e.format {\n\tcase \"docker-logs\":\n\t\t// Use colorized Docker logging output format\n\t\tl := make(map[string]interface{})\n\t\terr := json.Unmarshal(m.Data, &l)\n\t\tif err != nil {\n\t\t\ttext = fmt.Sprintf(\"%s%s | %s\\n\", m.Subject, padding, err)\n\t\t\treturn\n\t\t}\n\n\t\tif e.showTimestamp {\n\t\t\ttext = fmt.Sprintf(\"%s%s | %-30s -- %s\\n\", hashColor(m.Subject), padding, l[\"time\"], l[\"text\"])\n\t\t} else {\n\t\t\ttext = fmt.Sprintf(\"%s%s | %s\\n\", hashColor(m.Subject), padding, l[\"text\"])\n\t\t}\n\tcase \"raw\":\n\t\ttext = fmt.Sprintf(\"%s%s | %s\\n\", hashColor(m.Subject), padding, string(m.Data))\n\tdefault:\n\t\t// Unsupported format\n\t\tlog.Fatalf(\"Unsupported output format\")\n\t}\n\n\tlog.Printf(text)\n\n\treturn\n}", "func (r Result) String() string { return r.Title + \"\\n\" }", "func messageSummary(msg btcwire.Message) string {\n\tswitch msg := msg.(type) {\n\tcase *btcwire.MsgVersion:\n\t\treturn fmt.Sprintf(\"agent %s, pver %d, block %d\",\n\t\t\tmsg.UserAgent, msg.ProtocolVersion, msg.LastBlock)\n\n\tcase *btcwire.MsgVerAck:\n\t\t// No summary.\n\n\tcase *btcwire.MsgGetAddr:\n\t\t// No summary.\n\n\tcase *btcwire.MsgAddr:\n\t\treturn fmt.Sprintf(\"%d addr\", len(msg.AddrList))\n\n\tcase *btcwire.MsgPing:\n\t\t// No summary - perhaps add nonce.\n\n\tcase *btcwire.MsgPong:\n\t\t// No summary - perhaps add nonce.\n\n\tcase *btcwire.MsgAlert:\n\t\t// No summary.\n\n\tcase *btcwire.MsgMemPool:\n\t\t// No summary.\n\n\tcase *btcwire.MsgTx:\n\t\thash, _ := msg.TxSha()\n\t\treturn fmt.Sprintf(\"hash %s, %d inputs, %d outputs, lock %s\",\n\t\t\thash, len(msg.TxIn), len(msg.TxOut),\n\t\t\tformatLockTime(msg.LockTime))\n\n\tcase *btcwire.MsgBlock:\n\t\theader := &msg.Header\n\t\thash, _ := msg.BlockSha()\n\t\treturn fmt.Sprintf(\"hash %s, ver %d, %d tx, %s\", hash,\n\t\t\theader.Version, len(msg.Transactions), header.Timestamp)\n\n\tcase *btcwire.MsgInv:\n\t\treturn invSummary(msg.InvList)\n\n\tcase *btcwire.MsgNotFound:\n\t\treturn invSummary(msg.InvList)\n\n\tcase *btcwire.MsgGetData:\n\t\treturn invSummary(msg.InvList)\n\n\tcase *btcwire.MsgGetBlocks:\n\t\treturn locatorSummary(msg.BlockLocatorHashes, &msg.HashStop)\n\n\tcase *btcwire.MsgGetHeaders:\n\t\treturn locatorSummary(msg.BlockLocatorHashes, &msg.HashStop)\n\n\tcase *btcwire.MsgHeaders:\n\t\treturn fmt.Sprintf(\"num %d\", len(msg.Headers))\n\n\tcase *btcwire.MsgReject:\n\t\t// Ensure the variable length strings don't contain any\n\t\t// characters which are even remotely dangerous such as HTML\n\t\t// control characters, etc. Also limit them to sane length for\n\t\t// logging.\n\t\trejCommand := sanitizeString(msg.Cmd, btcwire.CommandSize)\n\t\trejReason := sanitizeString(msg.Reason, maxRejectReasonLen)\n\t\tsummary := fmt.Sprintf(\"cmd %v, code %v, reason %v\", rejCommand,\n\t\t\tmsg.Code, rejReason)\n\t\tif rejCommand == btcwire.CmdBlock || rejCommand == btcwire.CmdTx {\n\t\t\tsummary += fmt.Sprintf(\", hash %v\", msg.Hash)\n\t\t}\n\t\treturn summary\n\t}\n\n\t// No summary for other messages.\n\treturn \"\"\n}", "func (s NicerButSlowerFilmList) String() string {\n\tres := make([]string, 8)\n\tres[0] = \"FID: \" + reform.Inspect(s.FID, true)\n\tres[1] = \"Title: \" + reform.Inspect(s.Title, true)\n\tres[2] = \"Description: \" + reform.Inspect(s.Description, true)\n\tres[3] = \"Category: \" + reform.Inspect(s.Category, true)\n\tres[4] = \"Price: \" + reform.Inspect(s.Price, true)\n\tres[5] = \"Length: \" + reform.Inspect(s.Length, true)\n\tres[6] = \"Rating: \" + reform.Inspect(s.Rating, true)\n\tres[7] = \"Actors: \" + reform.Inspect(s.Actors, true)\n\treturn strings.Join(res, \", \")\n}", "func showFeedTask(feed feed.Feed, task ClientMessage) {\n\tpostByteArray := feed.ShowFeed()\n\tfeedArray := []PostData{}\n\tfor _, post := range(postByteArray) {\n\t\tvar pd PostData\n\t\terr := json.Unmarshal(post, &pd)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"error: \", err)\n\t\t}\n\t\tfeedArray = append(feedArray, pd)\n\t}\n\tsm, _ := json.MarshalIndent(ServerFeedMessage{Id: task.Id, Feed: feedArray}, \"\", \" \")\n\tfmt.Printf(\"%s\\n\", sm)\n}", "func (ulw Wrapper) Description() string {\n\tvar count int\n\tfor row := range ulw.ul.Results {\n\t\tif ulw.ul.Results[row].Username != \"\" {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"Activity by Username (processlist) %d rows\", count)\n}", "func (m *MessageDescriptor) Format(language string, data map[string]any) (msg string) {\n\tvar err error\n\tif fmt := m.translationFormats[language]; fmt != nil {\n\t\tmsg, err = fmt.FormatMap(data)\n\t} else {\n\t\tmsg, err = m.defaultFormat.FormatMap(data)\n\t}\n\tif err != nil {\n\t\tmsg = m.id // This shouldn't happen.\n\t}\n\treturn\n}", "func (e entry) String() string {\n\treturn fmt.Sprintf(`\nid %v\nday %v\nreceived %v\ndispatched %v\narrived %v\ncleared %v\ncall_type %v\ngrid_location %v\nas_observed %v\naddress %v\nclearance_code %v\nresp_officer %v\nunits %v\ndescription %v\ncall_comments %v\n`,\n\t\te.id, e.day, e.received, e.dispatched, e.arrived, e.cleared, e.call_type, e.grid_location, e.as_observed, e.address,\n\t\te.clearance_code, e.resp_officer, e.units, e.description, e.call_comments)\n\n}", "func (*GetAllDiscussGroupResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_group_group_proto_rawDescGZIP(), []int{6}\n}", "func List() {\n\tvar name string\n\tisGroup := false\n\n\tfmt.Printf(\"\\nShowing %v conversation(s):\\n\", len(jsonData))\n\n\t//jsonDataList := *jsonDatap\n\n\tfor i, block := range jsonData {\n\n\t\tfor _, participant := range block.Participants {\n\t\t\tif participant == master {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif len(block.Participants) >= 3 {\n\t\t\t\tisGroup = true\n\t\t\t}\n\t\t\tname = participant\n\t\t}\n\t\tif !isGroup {\n\t\t\tfmt.Printf(\"[%v] - %v\\n\", i, name)\n\t\t} else {\n\t\t\tfmt.Printf(\"[%v] - group: participants %+v\\n\", i, block.Participants)\n\t\t\tisGroup = false\n\t\t}\n\t}\n\n\tfmt.Println(\"\")\n}", "func (d *Dispatcher) getFormattedMessage(n *model.Notification) string {\n\ttrimmedMessage := strings.TrimSpace(n.Message)\n\tmessage := strings.Replace(html.EscapeString(trimmedMessage), \"\\n\", \"<br />\", -1) // default to text/plain\n\n\tif optionsDisplayRaw, ok := n.Extras[\"client::display\"]; ok {\n\t\toptionsDisplay, ok := optionsDisplayRaw.(map[string]interface{})\n\n\t\tif ok {\n\t\t\tif contentTypeRaw, ok := optionsDisplay[\"contentType\"]; ok {\n\t\t\t\tcontentType := fmt.Sprintf(\"%v\", contentTypeRaw)\n\t\t\t\tlog.Printf(\"Message content type: %s\", contentType)\n\n\t\t\t\tswitch contentType {\n\t\t\t\tcase \"html\", \"text/html\":\n\t\t\t\t\tmessage = strings.Replace(trimmedMessage, \"\\n\", \"<br />\", -1)\n\t\t\t\tcase \"markdown\", \"md\", \"text/md\", \"text/markdown\":\n\t\t\t\t\t// allow HTML in Markdown\n\t\t\t\t\tmessage = string(markdown.ToHTML([]byte(trimmedMessage), nil, nil))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn message\n}", "func (*CMsgDOTAGetRecentPlayTimeFriendsResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{260}\n}", "func (o *Screenrecordingmetadata) String() string {\n \n \n \n \n \n \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}", "func (s Set) FormatList() string {\n\tif len(s) == 0 {\n\t\treturn \"\"\n\t}\n\n\t// Collect members in a sorted list.\n\tm := s.SortedMembers()\n\n\t// Build list\n\tlist := \"\"\n\tfor len(m) > 0 {\n\t\t// Determine length of run.\n\t\tn := 0\n\t\tfor ; n < len(m) && m[n] == m[0]+uint(n); n++ {\n\t\t}\n\t\t// Append to list.\n\t\tif list != \"\" {\n\t\t\tlist += \",\"\n\t\t}\n\t\tlist += strconv.FormatUint(uint64(m[0]), 10)\n\t\tif n > 1 {\n\t\t\tlist += \"-\" + strconv.FormatUint(uint64(m[n-1]), 10)\n\t\t}\n\t\t// Advance.\n\t\tm = m[n:]\n\t}\n\n\treturn list\n}", "func (*CMsgClientToGCCavernCrawlUseItemOnRoomResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{294}\n}", "func outputPeerDiscovery(nodehost host.Host, peerchan <-chan peer.AddrInfo) int {\n\t// Iterate over the peer channel\n\ttotal := 0\n\tfor peer := range peerchan {\n\t\t// Ignore if the discovered peer is the host itself\n\t\tif peer.ID == nodehost.ID() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Connect to the peer\n\t\t//nodehost.Connect(context.Background(), peer)\n\t\tpeerJSON, _ := json.MarshalIndent(peer, \"\", \" \")\n\t\tfmt.Println(string(peerJSON[:]) + \",\")\n\t\ttotal++\n\t}\n\treturn total\n}", "func DiscoveryHandler(w http.ResponseWriter, r *http.Request) {\n\t// Return HTTP Status 200 Ok when a HTTP GET request is received.\n\tif r.Method == http.MethodGet {\n\t\tw.WriteHeader(http.StatusOK)\n\t\treturn\n\t}\n\n\t// Read The HTTP Request body\n\tbodyRaw, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tbody := string(bodyRaw)\n\n\t// Retrieve the MessageID From The Body For The Response\n\t// Note: The XML isn't parsed to keep this example simple but in your server it would have to have been\n\t// So ignore the strings.Replace and Regex stuff you wouldn't do it this way\n\tmessageID := strings.Replace(strings.Replace(regexp.MustCompile(`<a:MessageID>[\\s\\S]*?<\\/a:MessageID>`).FindStringSubmatch(body)[0], \"<a:MessageID>\", \"\", -1), \"</a:MessageID>\", \"\", -1)\n\n\tvar extraParams = \"\"\n\tif authPolicy == \"Federated\" {\n\t\textraParams += \"<AuthenticationServiceUrl>https://\" + domain + \"/EnrollmentServer/Auth</AuthenticationServiceUrl>\"\n\t}\n\n\t// Create response payload\n\tresponse := []byte(`<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\">\n <s:Header>\n <a:Action s:mustUnderstand=\"1\">http://schemas.microsoft.com/windows/management/2012/01/enrollment/IDiscoveryService/DiscoverResponse</a:Action>\n <ActivityId CorrelationId=\"8c6060c4-3d78-4d73-ae17-e8bce88426ee\" xmlns=\"http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics\">8c6060c4-3d78-4d73-ae17-e8bce88426ee</ActivityId>\n <a:RelatesTo>` + messageID + `</a:RelatesTo>\n </s:Header>\n <s:Body>\n <DiscoverResponse xmlns=\"http://schemas.microsoft.com/windows/management/2012/01/enrollment\">\n <DiscoverResult>\n\t\t\t\t<AuthPolicy>` + authPolicy + `</AuthPolicy>\n\t\t\t\t<EnrollmentVersion>4.0</EnrollmentVersion>\n\t\t\t\t<EnrollmentPolicyServiceUrl>https://` + domain + `/EnrollmentServer/Policy.svc</EnrollmentPolicyServiceUrl>\n\t\t\t\t<EnrollmentServiceUrl>https://` + domain + `/EnrollmentServer/Enrollment.svc</EnrollmentServiceUrl>\n\t\t\t\t` + extraParams + `\n </DiscoverResult>\n </DiscoverResponse>\n </s:Body>\n</s:Envelope>`)\n\n\t// Return request body\n\tw.Header().Set(\"Content-Type\", \"application/soap+xml; charset=utf-8\")\n\tw.Header().Set(\"Content-Length\", strconv.Itoa(len(response)))\n\tw.Write(response)\n}", "func (*ListPodPlanningsResponse) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_plannings_services_proto_rawDescGZIP(), []int{7}\n}", "func (*ConversationItem) Descriptor() ([]byte, []int) {\n\treturn file_box_search_proto_rawDescGZIP(), []int{1}\n}", "func sessionConfigurationPayloadDisplay(data *messages.SignalConfigs) {\n\tvar result string = \"\\n\"\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"session-id\", data.MitigatingConfig.SessionId)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"heartbeat-interval\", data.MitigatingConfig.HeartbeatInterval)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"missing-hb-allowed\", data.MitigatingConfig.MissingHbAllowed)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"max-retransmit\", data.MitigatingConfig.MaxRetransmit)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"ack-timeout\", data.MitigatingConfig.AckTimeout)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %f\\n\", \"ack-random-factor\", data.MitigatingConfig.AckRandomFactor)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"heartbeat-interval-idle\", data.IdleConfig.HeartbeatInterval)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"missing-hb-allowed-idle\", data.IdleConfig.MissingHbAllowed)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"max-retransmit-idle\", data.IdleConfig.MaxRetransmit)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"ack-timeout-idle\", data.IdleConfig.AckTimeout)\n\tresult += fmt.Sprintf(\" \\\"%s\\\": %f\\n\", \"ack-random-factor-idle\", data.IdleConfig.AckRandomFactor)\n\tlog.Infoln(result)\n}", "func (l legalHoldInfoMessage) String() string {\n\tif l.Err != nil {\n\t\treturn console.Colorize(\"LegalHoldMessageFailure\", \"Unable to get object legal hold status `\"+l.Key+\"`. \"+l.Err.Error())\n\t}\n\tvar msg string\n\n\tvar legalhold string\n\tswitch l.LegalHold {\n\tcase \"\":\n\t\tlegalhold = console.Colorize(\"LegalHoldNotSet\", \"Not set\")\n\tcase minio.LegalHoldEnabled:\n\t\tlegalhold = console.Colorize(\"LegalHoldOn\", l.LegalHold)\n\tcase minio.LegalHoldDisabled:\n\t\tlegalhold = console.Colorize(\"LegalHoldOff\", l.LegalHold)\n\t}\n\n\tmsg += \"[ \" + centerText(legalhold, 8) + \" ] \"\n\n\tif l.VersionID != \"\" {\n\t\tmsg += \" \" + console.Colorize(\"LegalHoldVersion\", l.VersionID) + \" \"\n\t}\n\n\tmsg += \" \"\n\tmsg += l.Key\n\treturn msg\n}", "func (s ConversationLevelSlotResolutionResultItem) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (*Discovery) Descriptor() ([]byte, []int) {\n\treturn file_raft_proto_rawDescGZIP(), []int{0}\n}", "func (*CBroadcast_GetBroadcastChatInfo_Response) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_broadcast_steamclient_proto_rawDescGZIP(), []int{21}\n}", "func (d *DNS) Info() string {\n\treturn fmt.Sprintf(\"DNS names\\t%s\", strings.Join(d.Names, \", \"))\n}", "func (*TopStoriesResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_news_proto_rawDescGZIP(), []int{4}\n}", "func (node Partitions) Format(buf *TrackedBuffer) {\n\tif node == nil {\n\t\treturn\n\t}\n\tprefix := \" partition (\"\n\tfor _, n := range node {\n\t\tbuf.astPrintf(node, \"%s%v\", prefix, n)\n\t\tprefix = \", \"\n\t}\n\tbuf.WriteString(\")\")\n}", "func (o *Botversionsummary) String() string {\n \n \n \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}", "func (p *MediaPlaylist) String() string {\n\treturn p.mkM3u8().String()\n}", "func (*CAccountHardware_VRCompatibilityCheck_Response_ComponentDisplay) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_accounthardware_steamclient_proto_rawDescGZIP(), []int{20, 1}\n}", "func (s FirewallDomainListMetadata) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (el EpisodeList) FormatLog(ec EpisodeCount) string {\n\tparts := make([]string, len(el))\n\tfor i, er := range el {\n\t\tswitch er.Type {\n\t\tcase EpisodeTypeRegular:\n\t\t\tparts[i] = er.FormatLog(ec.RegularCount)\n\t\tcase EpisodeTypeSpecial:\n\t\t\tparts[i] = er.FormatLog(ec.SpecialCount)\n\t\tcase EpisodeTypeCredits:\n\t\t\tparts[i] = er.FormatLog(ec.CreditsCount)\n\t\tcase EpisodeTypeOther:\n\t\t\tparts[i] = er.FormatLog(ec.OtherCount)\n\t\tcase EpisodeTypeTrailer:\n\t\t\tparts[i] = er.FormatLog(ec.TrailerCount)\n\t\tcase EpisodeTypeParody:\n\t\t\tparts[i] = er.FormatLog(ec.ParodyCount)\n\t\tdefault:\n\t\t\tparts[i] = er.Format(er.scale())\n\t\t}\n\t}\n\n\treturn strings.Join(parts, \",\")\n}", "func (jf JSONFormatter) Format(event eventbridge.ScanEvent) (*Message, error) {\n\n\tjs := jsonData{\n\t\tTitle: fmt.Sprintf(\"Vulnerabilities found in %s:\", event.Detail.RepositoryName),\n\t\tRepository: repository{\n\t\t\tName: event.Detail.RepositoryName,\n\t\t\tLink: formatLink(event),\n\t\t\tFindings: []vulnerablity{},\n\t\t},\n\t}\n\n\tfor _, key := range severity.SeverityList {\n\t\tif val, ok := event.Detail.FindingSeverityCounts[key]; ok {\n\t\t\tjs.Repository.Findings = append(js.Repository.Findings, vulnerablity{\n\t\t\t\tSeverity: key,\n\t\t\t\tCount: strconv.FormatInt(int64(*val), 10),\n\t\t\t})\n\t\t}\n\t}\n\n\tmsg, err := marshal(js)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Message{\n\t\tBody: string(msg),\n\t\tStatus: event.Detail.ScanStatus,\n\t\tRepositoryName: event.Detail.RepositoryName,\n\t}, nil\n}", "func (*CBroadcast_WebRTCAddViewerCandidate_Notification) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_broadcast_steamclient_proto_rawDescGZIP(), []int{76}\n}", "func (message *Message) ReadableFormat() string {\n\treturn message.UserName + \": \" + message.Body + \"\\n\"\n}", "func (v *Visibility) Message() string {\n\treturn \"\"\n}", "func (v *HandshakeResponse) 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\tfields[i] = fmt.Sprintf(\"APIVersion: %v\", v.APIVersion)\n\ti++\n\tfields[i] = fmt.Sprintf(\"Features: %v\", v.Features)\n\ti++\n\tif v.LibraryVersion != nil {\n\t\tfields[i] = fmt.Sprintf(\"LibraryVersion: %v\", *(v.LibraryVersion))\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"HandshakeResponse{%v}\", strings.Join(fields[:i], \", \"))\n}", "func (*ListPlanningsResponse) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_plannings_services_proto_rawDescGZIP(), []int{20}\n}", "func (m *CreateIdentifier) String() (result string) {\n\tresult = \"\\n\"\n\tfor key, alias := range m.Identifier.Alias {\n\t\tresult += fmt.Sprintf(\" \\\"%s[%d]\\\":\\n\", \"alias\", key+1)\n\t\tresult += fmt.Sprintf(\" \\\"%s\\\": %s\\n\", \"alias-name\", alias.AliasName)\n\t\tif alias.Ip != nil {\n\t\t\tfor k, v := range alias.Ip {\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s[%d]\\\": %s\\n\", \"ip\", k+1, v)\n\t\t\t}\n\t\t}\n\t\tif alias.Prefix != nil {\n\t\t\tfor k, v := range alias.Prefix {\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s[%d]\\\": %s\\n\", \"prefix\", k+1, v)\n\t\t\t}\n\t\t}\n\t\tif alias.PortRange != nil {\n\t\t\tfor k, v := range alias.PortRange {\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s[%d]\\\":\\n\", \"port-range\", k+1)\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"lower-port\", v.LowerPort)\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s\\\": %d\\n\", \"upper-port\", v.UpperPort)\n\t\t\t}\n\t\t}\n\t\tif alias.FQDN != nil {\n\t\t\tfor k, v := range alias.FQDN {\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s[%d]\\\": %s\\n\", \"FQDN\", k+1, v)\n\t\t\t}\n\t\t}\n\t\tif alias.URI != nil {\n\t\t\tfor k, v := range alias.URI {\n\t\t\t\tresult += fmt.Sprintf(\" \\\"%s[%d]\\\": %s\\n\", \"URI\", k+1, v)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "func makeSummary(draconResult map[string]string) (string, string) {\n\tsummary := filepath.Base(draconResult[\"target\"]) + \" \" + draconResult[\"title\"]\n\n\tif len(summary) > 255 { // jira summary field supports up to 255 chars\n\t\ttobytes := bytes.Runes([]byte(summary))\n\t\tsummary = string(tobytes[:254])\n\t\textra := string(tobytes[255:])\n\t\treturn summary, extra\n\t}\n\treturn summary, \"\"\n}", "func (s ChangeMessageVisibilityBatchResultEntry) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (o TopicRuleSnsOutput) MessageFormat() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v TopicRuleSns) *string { return v.MessageFormat }).(pulumi.StringPtrOutput)\n}", "func (m *MessageRule) GetDisplayName()(*string) {\n return m.displayName\n}" ]
[ "0.5028478", "0.48694223", "0.48003936", "0.4676342", "0.46760762", "0.46760762", "0.4615027", "0.45994487", "0.458241", "0.4579977", "0.45732588", "0.45495096", "0.45187613", "0.4513228", "0.44816542", "0.44712347", "0.44522518", "0.44487467", "0.4439808", "0.4423179", "0.44221777", "0.439296", "0.43905053", "0.43657207", "0.43520668", "0.43512097", "0.43359053", "0.43285385", "0.43255457", "0.43220937", "0.43220937", "0.43176198", "0.43155834", "0.4297629", "0.42951003", "0.4293079", "0.4292242", "0.42802337", "0.42762652", "0.42724496", "0.42660654", "0.42620683", "0.42608628", "0.42438152", "0.42401192", "0.4238748", "0.42369288", "0.42317155", "0.42242128", "0.42212647", "0.42176253", "0.4215275", "0.4212062", "0.4207762", "0.42067552", "0.41964865", "0.41943043", "0.4186911", "0.41839427", "0.41765702", "0.41738102", "0.41683543", "0.4168098", "0.4163615", "0.41636017", "0.41619128", "0.414969", "0.4146222", "0.41425318", "0.41414163", "0.41364503", "0.41297594", "0.41271245", "0.41254658", "0.412377", "0.41218337", "0.41210043", "0.4120163", "0.4118249", "0.41160095", "0.41145647", "0.41137284", "0.41098127", "0.41083398", "0.41037828", "0.40997428", "0.4094904", "0.40946445", "0.4092948", "0.40923527", "0.40903783", "0.40886176", "0.408848", "0.4087963", "0.40862623", "0.4084965", "0.40832764", "0.40807438", "0.40763757", "0.4072678" ]
0.8633062
0
GetCategory returns the Category name of the DockerModule
GetCategory возвращает имя категории DockerModule
func (m *Module) GetCategory() string { return "docker" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Lawrencium) GetCategory() string {\n\tvar c categoryType = actinoid\n\treturn c.get()\n}", "func Category() string {\n\treturn category\n}", "func (Samarium) GetCategory() string {\n\tvar c categoryType = lanthanoid\n\treturn c.get()\n}", "func (Sodium) GetCategory() string {\n\tvar c categoryType = alkaliMetal\n\treturn c.get()\n}", "func (Krypton) GetCategory() string {\n\tvar c categoryType = nobleGas\n\treturn c.get()\n}", "func (Technetium) GetCategory() string {\n\tvar c categoryType = transitionMetal\n\treturn c.get()\n}", "func (Tellurium) GetCategory() string {\n\tvar c categoryType = metalloid\n\treturn c.get()\n}", "func (Phosphorus) GetCategory() string {\n\tvar c categoryType = nonMetal\n\treturn c.get()\n}", "func (Molybdenum) GetCategory() string {\n\tvar c categoryType = transitionMetal\n\treturn c.get()\n}", "func (m *DirectoryAudit) GetCategory()(*string) {\n return m.category\n}", "func (Fermium) GetCategory() string {\n\tvar c categoryType = actinoid\n\treturn c.get()\n}", "func (Cadmium) GetCategory() string {\n\tvar c categoryType = transitionMetal\n\treturn c.get()\n}", "func (Manganese) GetCategory() string {\n\tvar c categoryType = transitionMetal\n\treturn c.get()\n}", "func (flag *flag) GetCategory() string {\n\treturn \"\"\n}", "func (l *Log) Category(name string) string {\n\tfor i := range l.Categories {\n\t\tif l.Categories[i].Name == name {\n\t\t\treturn l.Categories[i].Value\n\t\t}\n\t}\n\n\treturn \"\"\n}", "func tagToCategoryName(tagName string) string {\n\treturn fmt.Sprintf(\"openshift-%s\", tagName)\n}", "func (m *ManagementTemplateStep) GetCategory()(*ManagementCategory) {\n val, err := m.GetBackingStore().Get(\"category\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*ManagementCategory)\n }\n return nil\n}", "func (s *AdapterConfig) Category() string {\n\treturn base.CategoryAdapterConfig\n}", "func (f *FlagBase[T, C, V]) GetCategory() string {\n\treturn f.Category\n}", "func (c *ConsulServiceRegistry) Category() supervisor.ObjectCategory {\n\treturn Category\n}", "func (m *DeviceManagementConfigurationSettingDefinition) GetCategoryId()(*string) {\n val, err := m.GetBackingStore().Get(\"categoryId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (o *SoftwarerepositoryCategoryMapper) GetCategory() string {\n\tif o == nil || o.Category == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Category\n}", "func GetSingleCategory(id string) (ModuleCategory.Category, error) {\n\n\tdb := Database.CreateConnection()\n\tdefer db.Close()\n\n\tvar category ModuleCategory.Category\n\n\t// create the select sql query\n\tsqlStatement := `select\n\tcategory_id,\n\tcategory_name,\n\tcategory_description,\n\tcategory_logo,\n\tmodule_id\nfrom\n\tapp_category\nwhere\n\tcategory_id = $1`\n\n\t// execute the sql statement\n\trow := db.QueryRow(sqlStatement, id)\n\n\t// unmarshal the row object to user\n\terr := row.Scan(&category.Catid, &category.Name, &category.Description, &category.Logo, &category.Modid)\n\n\tswitch err {\n\tcase sql.ErrNoRows:\n\t\terr = errors.New(\"Нет данных\")\n\tcase nil:\n\t\treturn category, nil\n\tdefault:\n\t\tlog.Error(err)\n\t\terr = errors.New(\"Ошибка запроса\")\n\t}\n\n\t// return empty module on error\n\treturn category, err\n\n}", "func PackageCategoryFromName(category string) (PackageCategory, error) {\n\tswitch category {\n\tcase \"skip-prediction\":\n\t\treturn SkipCategoryPrediction, nil\n\tcase \"ai-machine-learning\":\n\t\treturn AIMachineLearning, nil\n\tcase \"database\":\n\t\treturn Database, nil\n\tcase \"integration-delivery\":\n\t\treturn IntegrationDelivery, nil\n\tcase \"monitoring-logging\":\n\t\treturn MonitoringLogging, nil\n\tcase \"networking\":\n\t\treturn Networking, nil\n\tcase \"security\":\n\t\treturn Security, nil\n\tcase \"storage\":\n\t\treturn Storage, nil\n\tcase \"streaming-messaging\":\n\t\treturn StreamingMessaging, nil\n\tdefault:\n\t\treturn -9, errors.New(\"invalid category name\")\n\t}\n}", "func (m *CloudPcAuditEvent) GetCategory()(*CloudPcAuditCategory) {\n val, err := m.GetBackingStore().Get(\"category\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*CloudPcAuditCategory)\n }\n return nil\n}", "func (o *IaasDeviceStatusAllOf) GetCategory() string {\n\tif o == nil || o.Category == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Category\n}", "func (o *BulletinDTO) GetCategory() string {\n\tif o == nil || o.Category == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Category\n}", "func (o ClusterNodeGroupSystemDiskOutput) Category() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeGroupSystemDisk) string { return v.Category }).(pulumi.StringOutput)\n}", "func GetCategory(p providers.CategoryProvider) func(c *fiber.Ctx) error {\n\treturn func(c *fiber.Ctx) error {\n\t\tcategoryID, _ := strconv.Atoi(c.Params(\"id\"))\n\t\tcategory, err := p.CategoryGet(categoryID)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// wrapped into array to it works in the template\n\t\tresult := make([]*models.Category, 0)\n\t\tresult = append(result, category)\n\t\treturn c.Render(\"category\", result)\n\t}\n}", "func (o *TransactionSplit) GetCategoryName() string {\n\tif o == nil || o.CategoryName.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CategoryName.Get()\n}", "func (c *Client) GetIrModuleCategory(id int64) (*IrModuleCategory, error) {\n\timcs, err := c.GetIrModuleCategorys([]int64{id})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif imcs != nil && len(*imcs) > 0 {\n\t\treturn &((*imcs)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"id %v of ir.module.category not found\", id)\n}", "func (m *GroupPolicyDefinition) GetCategory()(GroupPolicyCategoryable) {\n val, err := m.GetBackingStore().Get(\"category\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(GroupPolicyCategoryable)\n }\n return nil\n}", "func (o ClusterNodeGroupDataDiskOutput) Category() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeGroupDataDisk) string { return v.Category }).(pulumi.StringOutput)\n}", "func (m *WindowsMalwareCategoryCount) GetCategory()(*WindowsMalwareCategory) {\n val, err := m.GetBackingStore().Get(\"category\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*WindowsMalwareCategory)\n }\n return nil\n}", "func (s BuildResultStatus) Category() string {\n\tswitch s {\n\tcase PackageParsing, PackageParsed, ParseFailed:\n\t\treturn \"Parse\"\n\tcase TargetBuilding, TargetBuildStopped, TargetBuilt, TargetCached, TargetBuildFailed:\n\t\treturn \"Build\"\n\tcase TargetTesting, TargetTestStopped, TargetTested, TargetTestFailed:\n\t\treturn \"Test\"\n\tdefault:\n\t\treturn \"Other\"\n\t}\n}", "func (lb *Leaderboard) Category(embeds string) (*Category, *Error) {\n\t// we only have the category ID at hand\n\tasserted, okay := lb.CategoryData.(string)\n\tif okay {\n\t\treturn CategoryByID(asserted, embeds)\n\t}\n\n\treturn toCategory(lb.CategoryData, true), nil\n}", "func (da *DumbAnalyserImpl) GetCategory(message string) (cat string, confidence int) {\n\n\tfor k, v := range da.categories {\n\t\tfor _, keyword := range v {\n\t\t\tif strings.Contains(message, keyword) {\n\t\t\t\treturn k, 90\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\", 0\n}", "func (g *Goods) Category(c Context) {\n\t// TODO\n\tc.String(http.StatusOK, \"get goods category\")\n}", "func (dc DevCat) Category() Category {\n\treturn Category(dc[0])\n}", "func (s *Server) GetCategoryByName(ctx context.Context, in *api.CategoryQuery) (*api.Category, error) {\n\tdb, err := domain.GetConnection(utilities.GetConfiguration())\n\tif err != nil {\n\t\tlog.Fatalf(\"GetCategoryByName, error while connecting to database: %v\", err)\n\t}\n\tdefer db.Close()\n\treturn domain.GetCategoryByName(db, in)\n}", "func (e Endpoints) GetCategory(ctx context.Context) (c []io.TodoCategory, error error) {\n\trequest := GetCategoryRequest{}\n\tresponse, err := e.GetCategoryEndpoint(ctx, request)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn response.(GetCategoryResponse).C, response.(GetCategoryResponse).Error\n}", "func (m *SecureScoreControlProfile) GetControlCategory()(*string) {\n val, err := m.GetBackingStore().Get(\"controlCategory\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (k Ktype) Category() Category {\n\tswitch k {\n\tcase CreateProcess, TerminateProcess, OpenProcess, ProcessRundown:\n\t\treturn Process\n\tcase CreateThread, TerminateThread, OpenThread, ThreadRundown:\n\t\treturn Thread\n\tcase LoadImage, UnloadImage, ImageRundown:\n\t\treturn Image\n\tcase CreateFile, ReadFile, WriteFile, EnumDirectory, DeleteFile, RenameFile, CloseFile, SetFileInformation,\n\t\tFileRundown, FileOpEnd, ReleaseFile, MapViewFile, UnmapViewFile, MapFileRundown:\n\t\treturn File\n\tcase RegCreateKey, RegDeleteKey, RegOpenKey, RegCloseKey, RegQueryKey, RegQueryValue, RegSetValue, RegDeleteValue,\n\t\tRegKCBRundown, RegDeleteKCB, RegCreateKCB:\n\t\treturn Registry\n\tcase AcceptTCPv4, AcceptTCPv6,\n\t\tConnectTCPv4, ConnectTCPv6,\n\t\tReconnectTCPv4, ReconnectTCPv6,\n\t\tRetransmitTCPv4, RetransmitTCPv6,\n\t\tDisconnectTCPv4, DisconnectTCPv6,\n\t\tSendTCPv4, SendTCPv6, SendUDPv4, SendUDPv6,\n\t\tRecvTCPv4, RecvTCPv6, RecvUDPv4, RecvUDPv6,\n\t\tQueryDNS, ReplyDNS:\n\t\treturn Net\n\tcase CreateHandle, CloseHandle, DuplicateHandle:\n\t\treturn Handle\n\tcase VirtualAlloc, VirtualFree:\n\t\treturn Mem\n\tdefault:\n\t\treturn Unknown\n\t}\n}", "func (o *CatalogEntry) GetCategory() string {\n\tif o == nil || o.Category == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Category\n}", "func (m *SecureScoreControlProfile) GetControlCategory()(*string) {\n return m.controlCategory\n}", "func (w *withCode) Category() categories.Category {\n\tswitch code := w.Code().Int(); {\n\tcase code < 50:\n\t\treturn grpcCategory(w.Code())\n\tcase code >= 50 && code < 100:\n\t\treturn categories.Temporary\n\tcase code >= 100 && code < 150:\n\t\treturn categories.System\n\tcase code >= 150 && code < 200:\n\t\treturn categories.Data\n\tdefault:\n\t\treturn categories.Unknown\n\t}\n}", "func GetCategory(db *sql.DB, id int) (Category, error) {\n\tvar category Category\n\terr := db.QueryRow(`SELECT c.id, c.name FROM category c WHERE id = ($1)`,\n\t\tid).Scan(&category.ID, &category.Name)\n\n\tif err != nil {\n\t\treturn category, err\n\t}\n\n\treturn category, nil\n\n}", "func CategoryGet(c *gin.Context) {\n\tCategory, err := models.GetCategory(c.Param(\"name\"))\n\tif err != nil {\n\t\tc.HTML(http.StatusNotFound, \"errors/404\", nil)\n\t\treturn\n\t}\n\tvar filter models.DaoFilter\n\tfilter.Category.Name = Category.Name\n\tcount,_ := filter.GetPostsCount()\n\tcurrentPage, _ := strconv.Atoi(c.DefaultQuery(\"p\",\"1\"))\n\tlimit := 10\n\tPagination := helpers.NewPaginator(c,limit,count)\n\tlist, err := filter.GetPostsByPage(currentPage,limit)\n\tif err != nil {\n\t\tc.HTML(http.StatusNotFound, \"errors/404\", nil)\n\t\treturn\n\t}\n\n\th := helpers.DefaultH(c)\n\th[\"Title\"] = Category.Name\n\th[\"Category\"] = Category\n\th[\"Active\"] = \"categories\"\n\th[\"List\"] = list\n\th[\"Pagination\"] = Pagination\n\tc.HTML(http.StatusOK, \"categories/show\", h)\n}", "func (m *GroupPolicyDefinition) GetCategoryPath()(*string) {\n val, err := m.GetBackingStore().Get(\"categoryPath\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func (o *Transaction) GetCategory() []string {\n\tif o == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\n\treturn o.Category\n}", "func (o *IaasMostRunTasksAllOf) GetTaskCategory() string {\n\tif o == nil || o.TaskCategory == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.TaskCategory\n}", "func GetCat(catid uint32) (models.Category, error) {\n\tvar catInfo models.Category\n\n\terr := DB.Where(\"id = ?\", catid).First(&catInfo).Error\n\n\tif err == gorm.ErrRecordNotFound {\n\t\tlog.Info.Println(err)\n\t\treturn catInfo, ErrNotFound\n\t} else if err != nil {\n\t\tlog.Warning.Println(err)\n\t\treturn catInfo, ErrInternal\n\t}\n\treturn catInfo, nil\n}", "func (o *TransactionSplit) GetCategoryId() string {\n\tif o == nil || o.CategoryId.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CategoryId.Get()\n}", "func (e nlgElementData) Category() LexicalCategory {\n\treturn e.category\n}", "func (j *DSGitHub) ItemCategory(item interface{}) string {\n\treturn j.Category\n}", "func (g *GetTopChatsRequest) GetCategory() (value TopChatCategoryClass) {\n\tif g == nil {\n\t\treturn\n\t}\n\treturn g.Category\n}", "func (i ID) Category() Category {\n\treturn Category((i.Raw() & CategoryMask) >> BitwidthReserved)\n}", "func (m *TestcontainersModule) ContainerName() string {\n\tname := m.Lower()\n\n\tif m.IsModule {\n\t\tname = m.Title()\n\t} else {\n\t\tif m.TitleName != \"\" {\n\t\t\tr, n := utf8.DecodeRuneInString(m.TitleName)\n\t\t\tname = string(unicode.ToLower(r)) + m.TitleName[n:]\n\t\t}\n\t}\n\n\treturn name + \"Container\"\n}", "func (a *Adapter) Get(ctx context.Context, categoryCode string) (categoryDomain.Category, error) {\n\tt, err := a.categoryRepository.Category(ctx, categoryCode)\n\tif err == categoryDomain.ErrNotFound {\n\t\ta.logger.Warn(err)\n\t\treturn t, err\n\t}\n\tif err != nil {\n\t\ta.logger.Error(err)\n\t}\n\treturn t, err\n}", "func (_AccessIndexor *AccessIndexorCaller) CATEGORYGROUP(opts *bind.CallOpts) (uint8, error) {\n\tvar out []interface{}\n\terr := _AccessIndexor.contract.Call(opts, &out, \"CATEGORY_GROUP\")\n\n\tif err != nil {\n\t\treturn *new(uint8), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)\n\n\treturn out0, err\n\n}", "func (t Type) Category() orc.Category {\n\tswitch t {\n\tcase Int32:\n\t\treturn orc.CategoryInt\n\tcase Int64:\n\t\treturn orc.CategoryLong\n\tcase Float64:\n\t\treturn orc.CategoryDouble\n\tcase String:\n\t\treturn orc.CategoryString\n\tcase Bool:\n\t\treturn orc.CategoryBoolean\n\tcase Timestamp:\n\t\treturn orc.CategoryTimestamp\n\tcase JSON:\n\t\treturn orc.CategoryString\n\t}\n\n\tpanic(fmt.Errorf(\"typeof: orc type for %v is not found\", t))\n}", "func (m *DeviceCategory) GetDescription()(*string) {\n val, err := m.GetBackingStore().Get(\"description\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "func shouldCategory(cat Category, lvl Level) (ok bool, name string) {\n\tcatmx.RLock()\n\tif lvl >= categories[cat].lvl {\n\t\tok = true\n\t\tname = categories[cat].name\n\t}\n\tcatmx.RUnlock()\n\treturn\n}", "func (c *Client) FindIrModuleCategory(criteria *Criteria) (*IrModuleCategory, error) {\n\timcs := &IrModuleCategorys{}\n\tif err := c.SearchRead(IrModuleCategoryModel, criteria, NewOptions().Limit(1), imcs); err != nil {\n\t\treturn nil, err\n\t}\n\tif imcs != nil && len(*imcs) > 0 {\n\t\treturn &((*imcs)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"ir.module.category was not found with criteria %v\", criteria)\n}", "func (me TxsdSystemCategory) String() string { return xsdt.Nmtoken(me).String() }", "func (_BaseAccessWallet *BaseAccessWalletCaller) CATEGORYGROUP(opts *bind.CallOpts) (uint8, error) {\n\tvar out []interface{}\n\terr := _BaseAccessWallet.contract.Call(opts, &out, \"CATEGORY_GROUP\")\n\n\tif err != nil {\n\t\treturn *new(uint8), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)\n\n\treturn out0, err\n\n}", "func (c Controller) Category(id int) (*model.Category, error) {\n\treturn c.CategoriesRepository.Get(id, \"\")\n}", "func (cRepo *CategoryGormRepo) Category(id uint) (*entity.Category, []error) {\n\tctg := entity.Category{}\n\terrs := cRepo.conn.First(&ctg, id).GetErrors()\n\tif len(errs) > 0 {\n\t\treturn nil, errs\n\t}\n\treturn &ctg, errs\n}", "func (o *Transaction) GetCategoryId() string {\n\tif o == nil || o.CategoryId.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn *o.CategoryId.Get()\n}", "func (o *InlineResponse200115) GetCategory() InlineResponse2002Column {\n\tif o == nil || o.Category == nil {\n\t\tvar ret InlineResponse2002Column\n\t\treturn ret\n\t}\n\treturn *o.Category\n}", "func (_BaseAccessControlGroup *BaseAccessControlGroupCaller) CATEGORYGROUP(opts *bind.CallOpts) (uint8, error) {\n\tvar out []interface{}\n\terr := _BaseAccessControlGroup.contract.Call(opts, &out, \"CATEGORY_GROUP\")\n\n\tif err != nil {\n\t\treturn *new(uint8), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)\n\n\treturn out0, err\n\n}", "func (c *Client) GetCategories() string {\n\turl := fmt.Sprintf(c.baseURL + \"categories\")\n\n\tres, err := http.Get(url)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tbody, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\treturn string(body)\n}", "func (m *State) Category(channelID discord.Snowflake) bool {\n\tc, err := m.store.Channel(channelID)\n\tif err != nil || !c.CategoryID.Valid() {\n\t\treturn false\n\t}\n\n\treturn m.Channel(c.CategoryID)\n}", "func (m *ThreatAssessmentRequest) GetCategory()(*ThreatCategory) {\n val, err := m.GetBackingStore().Get(\"category\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*ThreatCategory)\n }\n return nil\n}", "func (m *DeviceCategory) 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}", "func (o LookupRegionCommitmentResultOutput) Category() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupRegionCommitmentResult) string { return v.Category }).(pulumi.StringOutput)\n}", "func (w *ServerInterfaceWrapper) GetCategoryCategoryId(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"categoryId\" -------------\n\tvar categoryId CategoryIdParameter\n\n\terr = runtime.BindStyledParameter(\"simple\", false, \"categoryId\", ctx.Param(\"categoryId\"), &categoryId)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter categoryId: %s\", err))\n\t}\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.GetCategoryCategoryId(ctx, categoryId)\n\treturn err\n}", "func GetCategory(response http.ResponseWriter, request *http.Request) {\n\t//var results TCategory\n\tvar errorResponse = ErrorResponse{\n\t\tCode: http.StatusInternalServerError, Message: \"Internal Server Error.\",\n\t}\n\n\tcollection := Client.Database(\"msdb\").Collection(\"t_cat_mg\")\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tcursor, err := collection.Find(ctx, bson.M{})\n\tvar results []bson.M\n\terr = cursor.All(ctx, &results)\n\n\tdefer cancel()\n\n\tif err != nil {\n\t\terrorResponse.Message = \"Document not found\"\n\t\treturnErrorResponse(response, request, errorResponse)\n\t} else {\n\t\tvar successResponse = SuccessResponse{\n\t\t\tCode: http.StatusOK,\n\t\t\tMessage: \"Success\",\n\t\t\tResponse: results,\n\t\t}\n\n\t\tsuccessJSONResponse, jsonError := json.Marshal(successResponse)\n\n\t\tif jsonError != nil {\n\t\t\treturnErrorResponse(response, request, errorResponse)\n\t\t}\n\t\tresponse.Header().Set(\"Content-Type\", \"application/json\")\n\t\tresponse.Write(successJSONResponse)\n\t}\n\n}", "func GetPathToCategory(category string) string {\n\treturn \"categories/\" + category + \"/category.yaml\"\n}", "func (o *InlineObject26) GetCategory() MessageCategoriesIdJsonCategory {\n\tif o == nil {\n\t\tvar ret MessageCategoriesIdJsonCategory\n\t\treturn ret\n\t}\n\n\treturn o.Category\n}", "func (m *ThreatAssessmentRequest) GetCategory()(*ThreatCategory) {\n return m.category\n}", "func (j *DSGit) Categories() map[string]struct{} {\n\treturn GitCategories\n}", "func (o *EventAttributes) GetSourcecategory() string {\n\tif o == nil || o.Sourcecategory == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Sourcecategory\n}", "func (cri *CategoryRepositoryImpl) Category(id int) (entity.Category, error) {\n\n\trow := cri.conn.QueryRow(\"SELECT * FROM categories WHERE id = $1\", id)\n\n\tc := entity.Category{}\n\n\terr := row.Scan(&c.ID, &c.Name, &c.Description, &c.Image)\n\tif err != nil {\n\t\treturn c, err\n\t}\n\n\treturn c, nil\n}", "func (j *DSGitHub) Categories() map[string]struct{} {\n\treturn GitHubCategories\n}", "func (_Mcapscontroller *McapscontrollerCallerSession) CategoryIndex() (*big.Int, error) {\n\treturn _Mcapscontroller.Contract.CategoryIndex(&_Mcapscontroller.CallOpts)\n}", "func getClusterNameLabel() string {\n\tkey := fmt.Sprintf(\"%s/cluster-name\", getCAPIGroup())\n\treturn key\n}", "func (client *Client) GetCategory(alias string, request CategoriesSearchParam) (response CategoryDetailResponse, err error) {\n\turl := fmt.Sprintf(\"/categories/%s\", alias)\n\n\tif err := client.query(url, &request, &response); err != nil {\n\t\treturn response, err\n\t}\n\treturn response, nil\n\n}", "func (n *natsDependency) GetContainerName() string {\n\treturn n.config.Name + n.config.Version\n}", "func GetCategories() []string {\n\tstmt := \"select name from category\"\n\trows := database.query(stmt)\n\tvar categories []string\n\tvar category string\n\n\tfor rows.Next() {\n\t\terr := rows.Scan(&category)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t\tcategories = append(categories, category)\n\t}\n\treturn categories\n}", "func (c Category) String() string {\n\ts := \"\"\n\tif c.Main != 0 {\n\t\ts += strconv.Itoa(int(c.Main))\n\t}\n\ts += \"_\"\n\tif c.Sub != 0 {\n\t\ts += strconv.Itoa(int(c.Sub))\n\t}\n\treturn s\n}", "func (m *Group) GetClassification()(*string) {\n return m.classification\n}", "func (f *FaasController) Category() supervisor.ObjectCategory {\n\treturn Category\n}", "func (m *WorkbookChartAxes) GetCategoryAxis()(WorkbookChartAxisable) {\n return m.categoryAxis\n}", "func (tk Kinds) Cat() Kinds {\n\treturn CatMap[tk]\n}", "func (_Mcapscontroller *McapscontrollerSession) CategoryIndex() (*big.Int, error) {\n\treturn _Mcapscontroller.Contract.CategoryIndex(&_Mcapscontroller.CallOpts)\n}", "func RenameCategory(oldCategoryName string, newCategoryName string) {\n\tfmt.Println(\"Rename category \" + oldCategoryName + \" to \" + newCategoryName + \".\")\n\n\tfile, err := ioutil.ReadFile(getConfigPath())\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tlines := strings.Split(string(file), \"\\n\")\n\n\tfor i, line := range lines {\n\t\tif strings.Contains(line, oldCategoryName) {\n\t\t\tsplittedLine := strings.Split(line, \" \")\n\t\t\tstreamerName := splittedLine[0]\n\t\t\tlines[i] = streamerName + \" \" + newCategoryName\n\t\t}\n\t}\n\n\toutput := strings.Join(lines, \"\\n\")\n\terr = ioutil.WriteFile(getConfigPath(), []byte(output), 0600)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}", "func getStatementCategory(sql string) binlogdatapb.BinlogTransaction_Statement_Category {\n\tif i := strings.IndexByte(sql, byte(' ')); i >= 0 {\n\t\tsql = sql[:i]\n\t}\n\treturn statementPrefixes[strings.ToLower(sql)]\n}", "func groupName(pkg *types.Package) string {\n\tm := types.ExtractCommentTags(\"+\", pkg.Comments)\n\tv := m[\"groupName\"]\n\tif len(v) == 1 {\n\t\treturn v[0]\n\t}\n\treturn \"\"\n}", "func (o OceanFiltersOutput) Categories() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v OceanFilters) []string { return v.Categories }).(pulumi.StringArrayOutput)\n}" ]
[ "0.7168049", "0.7056861", "0.6867676", "0.6864481", "0.6832735", "0.6789213", "0.6726447", "0.65613014", "0.6523389", "0.65107214", "0.64703894", "0.6399247", "0.63079035", "0.6284974", "0.6259871", "0.62503314", "0.6238926", "0.6224922", "0.61545014", "0.6119946", "0.6119148", "0.6106655", "0.6105961", "0.59979874", "0.5943719", "0.5907027", "0.58634055", "0.5859745", "0.5829525", "0.5828841", "0.5817301", "0.5806116", "0.5803165", "0.57916343", "0.57326233", "0.5674686", "0.56562907", "0.56549114", "0.5629631", "0.56213856", "0.55560607", "0.5555249", "0.5551122", "0.55483377", "0.5546087", "0.5505123", "0.5443805", "0.5443018", "0.54151803", "0.5410261", "0.5312004", "0.53078663", "0.53005564", "0.5277914", "0.52702034", "0.5247642", "0.5243633", "0.5238622", "0.5235148", "0.5213422", "0.5212833", "0.52026755", "0.51954925", "0.5192279", "0.5187067", "0.5164761", "0.514946", "0.51445425", "0.51341397", "0.5130941", "0.5129724", "0.5086965", "0.50824606", "0.507891", "0.50340354", "0.5029197", "0.5027562", "0.5020286", "0.5001745", "0.49910244", "0.4987954", "0.4987764", "0.49736673", "0.4967484", "0.49593538", "0.4956634", "0.49540132", "0.49494442", "0.49442312", "0.49328086", "0.49319", "0.4930525", "0.49246746", "0.49125206", "0.49021348", "0.48944038", "0.48826015", "0.4876676", "0.4870118", "0.48629174" ]
0.84576774
0
Code returns the option's code
Код возвращает код опции
func (op *OptIAAddress) Code() OptionCode { return OptionIAAddr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (op *OptVendorOpts) Code() OptionCode {\n\treturn OptionVendorOpts\n}", "func (o *BuildComboFormDescriptorOK) Code() int {\n\treturn 200\n}", "func (op *OptDHCPv4Msg) Code() OptionCode {\n\treturn OptionDHCPv4Msg\n}", "func (op *optClientLinkLayerAddress) Code() OptionCode {\n\treturn OptionClientLinkLayerAddr\n}", "func (op *optDNS) Code() OptionCode {\n\treturn OptionDNSRecursiveNameServer\n}", "func (o Option) StoreCode() (code string) {\n\tif sc, ok := o.Store.(StoreCoder); ok {\n\t\tcode = sc.StoreCode()\n\t}\n\treturn\n}", "func (e *HTMLApplet) Code(v string) *HTMLApplet {\n\te.a[\"code\"] = v\n\treturn e\n}", "func (o Option) WebsiteCode() (code string) {\n\tif wc, ok := o.Website.(WebsiteCoder); ok {\n\t\tcode = wc.WebsiteCode()\n\t}\n\treturn\n}", "func (op *OptDomainSearch) Code() OptionCode {\n\treturn OptionDNSDomainSearchList\n}", "func (w *WithCode) Code() AppErrCode { return w.code }", "func (coder defaultCoder) Code() int {\n\treturn coder.C\n\n}", "func (c *Control) GetCode() int {\n\treturn c.code\n}", "func (o *GetVersionStagesOK) Code() int {\n\treturn 200\n}", "func (o *GetVersionStagesDefault) Code() int {\n\treturn o._statusCode\n}", "func (c *Control) Code(code int) *Control {\n\tif code >= 200 && code < 600 {\n\t\tc.code = code\n\t}\n\treturn c\n}", "func (c CodeAuthenticatorFunc) Code(ctx context.Context) (string, error) {\n\treturn c(ctx)\n}", "func (o *CreateAntivirusServerDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetVpsServiceNameActiveOptionsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o BackendServiceCdnPolicyNegativeCachingPolicyOutput) Code() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v BackendServiceCdnPolicyNegativeCachingPolicy) *int { return v.Code }).(pulumi.IntPtrOutput)\n}", "func (o *GetVersionStagesForbidden) Code() int {\n\treturn 403\n}", "func (o DiagnosticConditionResponseOutput) Code() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DiagnosticConditionResponse) string { return v.Code }).(pulumi.StringOutput)\n}", "func (o *GetProductsByIDProductOptionsByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o BackendBucketCdnPolicyNegativeCachingPolicyOutput) Code() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v BackendBucketCdnPolicyNegativeCachingPolicy) *int { return v.Code }).(pulumi.IntPtrOutput)\n}", "func (s *NoFreeAddressesInSubnet) Code() string {\n\treturn \"NoFreeAddressesInSubnet\"\n}", "func (o BackendServiceCdnPolicyNegativeCachingPolicyResponseOutput) Code() pulumi.IntOutput {\n\treturn o.ApplyT(func(v BackendServiceCdnPolicyNegativeCachingPolicyResponse) int { return v.Code }).(pulumi.IntOutput)\n}", "func (scode Scancode) Code() Code {\n\treturn Code(C.SDL_GetKeyFromScancode(C.SDL_Scancode(scode)))\n}", "func (o *GetProductsByIDProductOptionsByIDValuesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o BackendBucketCdnPolicyNegativeCachingPolicyResponseOutput) Code() pulumi.IntOutput {\n\treturn o.ApplyT(func(v BackendBucketCdnPolicyNegativeCachingPolicyResponse) int { return v.Code }).(pulumi.IntOutput)\n}", "func (e Errorcode) Code() codes.Code {\n\treturn e.code\n}", "func Code(code int) {\n\tDefault.ExitCode = code\n\tpanic(msg{Default, \"\"})\n}", "func (o *GetVersionDefault) Code() int {\n\treturn o._statusCode\n}", "func (m *Country) Code() string {\n\treturn m.ID\n}", "func (s *IncorrectMountTargetState) Code() string {\n\treturn \"IncorrectMountTargetState\"\n}", "func (o *ListProviderPresetsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateAntivirusServerDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *IpAddressInUse) Code() string {\n\treturn \"IpAddressInUse\"\n}", "func (o *GetVersionStagesNotFound) Code() int {\n\treturn 404\n}", "func (e e) Code() int {\n\treturn e.ErrorCode\n}", "func (o *ListVirtualCircuitsDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *TooManyRequests) Code() string {\n\treturn \"TooManyRequests\"\n}", "func (o *GetBuildScriptDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *CreateServerSwitchingRuleDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetCurrentUserSettingsDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *EffectivePolicyNotFoundException) Code() string {\n\treturn \"EffectivePolicyNotFoundException\"\n}", "func (s *FileSystemLimitExceeded) Code() string {\n\treturn \"FileSystemLimitExceeded\"\n}", "func (fn *formulaFuncs) CODE(argsList *list.List) formulaArg {\n\treturn fn.code(\"CODE\", argsList)\n}", "func (o *ValidateRecipeDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetVersionOK) Code() int {\n\treturn 200\n}", "func (c *SeaterController) Code(code int) {\n\tc.Ctx.Output.SetStatus(code)\n}", "func (o GoogleRpcStatusResponseOutput) Code() pulumi.IntOutput {\n\treturn o.ApplyT(func(v GoogleRpcStatusResponse) int { return v.Code }).(pulumi.IntOutput)\n}", "func (s *AccessPointLimitExceeded) Code() string {\n\treturn \"AccessPointLimitExceeded\"\n}", "func (s *UnsupportedAvailabilityZone) Code() string {\n\treturn \"UnsupportedAvailabilityZone\"\n}", "func (o *GetAvailableExtensionsUUIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetDomainDataExtensionDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *SecurityGroupLimitExceeded) Code() string {\n\treturn \"SecurityGroupLimitExceeded\"\n}", "func (s *SecurityGroupNotFound) Code() string {\n\treturn \"SecurityGroupNotFound\"\n}", "func (s *IncorrectFileSystemLifeCycleState) Code() string {\n\treturn \"IncorrectFileSystemLifeCycleState\"\n}", "func (p *Matcher) Code() string {\n\treturn Code(p.Grammar, p.requireScanner())\n}", "func (o *GetAPIFeaturesNameDefault) Code() int {\n\treturn o._statusCode\n}", "func (o SslPolicyWarningsItemResponseOutput) Code() pulumi.StringOutput {\n\treturn o.ApplyT(func(v SslPolicyWarningsItemResponse) string { return v.Code }).(pulumi.StringOutput)\n}", "func (o *StartMySQLShowIndexActionDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *AccessPointNotFound) Code() string {\n\treturn \"AccessPointNotFound\"\n}", "func (o *GetSiteScriptDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *SubnetNotFound) Code() string {\n\treturn \"SubnetNotFound\"\n}", "func (o *GetPolicyUUIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (e ConstraintError) Code() (string, []any) {\n\treturn strconv.Quote(e.prefix() + e.msg), nil\n}", "func (coder *ErrCode) Code() int {\n\treturn coder.C\n}", "func (o *Giveaway) GetCode() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Code\n}", "func (s *NotSupportedOperationException) Code() string {\n\treturn \"NotSupportedOperationException\"\n}", "func (o StatusResponseOutput) Code() pulumi.IntOutput {\n\treturn o.ApplyT(func(v StatusResponse) int { return v.Code }).(pulumi.IntOutput)\n}", "func (o *GetAppsAppIDOperationsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetCatalogItemsUUIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DescribeServerOK) Code() int {\n\treturn 200\n}", "func (h *RegisterAccountHandler) Code() int {\n\treturn gamedefine.RegisterAccount\n}", "func (s *DryRunOperationException) Code() string {\n\treturn \"DryRunOperationException\"\n}", "func (s *ConnectorTimeoutException) Code() string {\n\treturn \"ConnectorTimeoutException\"\n}", "func (s *UnauthorizedOperationException) Code() string {\n\treturn \"UnauthorizedOperationException\"\n}", "func (v *Validator) Code(att *design.AttributeDefinition, nonzero, required, hasDefault bool, target, context string, depth int, private bool) string {\n\tif _, ok := att.Metadata[\"struct:field:type\"]; ok {\n\t\t// Skip validation generation for attributes with custom types\n\t\treturn \"\"\n\t}\n\tbuf := v.recurse(att, nonzero, required, hasDefault, target, context, depth, private)\n\treturn buf.String()\n}", "func (s *FileSystemInUse) Code() string {\n\treturn \"FileSystemInUse\"\n}", "func (e *CommandError) Code() int {\n\treturn e.code\n}", "func (o *GetAdmissionPluginDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *PerformIncidentActionDefault) Code() int {\n\treturn o._statusCode\n}", "func (s Style) Code() string {\n\treturn s.String()\n}", "func (s *InvalidPolicyDocument) Code() string {\n\treturn \"InvalidPolicyDocument\"\n}", "func (o *GetSiteAssetInfoDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *SignupDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetPassesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetLibcVersionDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetServerConfigImportsMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *CreateSettingsReportingEulaItemDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdatePrivilegeForbidden) Code() int {\n\treturn 403\n}", "func (s *PolicyNotFoundException) Code() string {\n\treturn \"PolicyNotFoundException\"\n}", "func (o *UpdateBuildScriptDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *TerminateInstanceDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *MountTargetNotFound) Code() string {\n\treturn \"MountTargetNotFound\"\n}", "func (o *CreateTagDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetServerConfigImportsDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *PolicyNotFound) Code() string {\n\treturn \"PolicyNotFound\"\n}", "func (s *InsufficientThroughputCapacity) Code() string {\n\treturn \"InsufficientThroughputCapacity\"\n}", "func (s *NetworkInterfaceLimitExceeded) Code() string {\n\treturn \"NetworkInterfaceLimitExceeded\"\n}" ]
[ "0.72313315", "0.69734895", "0.6881529", "0.6850448", "0.6735197", "0.6698436", "0.66969913", "0.66453904", "0.6608055", "0.653936", "0.65173614", "0.6516536", "0.6487242", "0.64759696", "0.64638144", "0.6413874", "0.6338029", "0.6321097", "0.63162625", "0.631467", "0.63056934", "0.6299882", "0.62966216", "0.62748593", "0.6271707", "0.62513274", "0.6246698", "0.6221488", "0.6213717", "0.6193116", "0.61830187", "0.6177885", "0.6177602", "0.6175101", "0.617282", "0.616695", "0.6165672", "0.6162941", "0.61556536", "0.6151114", "0.61493796", "0.61460376", "0.61364293", "0.6122413", "0.6121955", "0.6120275", "0.6119982", "0.611724", "0.61155266", "0.61143476", "0.6111215", "0.6092625", "0.6090237", "0.6083421", "0.60797685", "0.607416", "0.60716015", "0.60678476", "0.60630053", "0.606007", "0.605526", "0.60533804", "0.6048731", "0.6047951", "0.6035529", "0.60338104", "0.60335696", "0.6031156", "0.60275054", "0.6026367", "0.6026043", "0.6019838", "0.6015517", "0.6006246", "0.60060406", "0.60008234", "0.59995013", "0.59943616", "0.5989312", "0.59871095", "0.5984613", "0.59824395", "0.59775746", "0.59768337", "0.5972772", "0.59724736", "0.59708184", "0.5965497", "0.595764", "0.5957411", "0.59508955", "0.5941913", "0.5941374", "0.5940591", "0.5938806", "0.5934852", "0.5931823", "0.5923375", "0.59227204", "0.5921908" ]
0.71896785
1
ParseOptIAAddress builds an OptIAAddress structure from a sequence of bytes. The input data does not include option code and length bytes.
ParseOptIAAddress строит структуру OptIAAddress из последовательности байтов. Входные данные не включают байты кода опции и длины.
func ParseOptIAAddress(data []byte) (*OptIAAddress, error) { var opt OptIAAddress buf := uio.NewBigEndianBuffer(data) opt.IPv6Addr = net.IP(buf.CopyN(net.IPv6len)) opt.PreferredLifetime = buf.Read32() opt.ValidLifetime = buf.Read32() if err := opt.Options.FromBytes(buf.ReadAll()); err != nil { return nil, err } return &opt, buf.FinError() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ParseAddress(addr string) (*Address, error) {\n\taddr = strings.ToUpper(addr)\n\tl := len(addr)\n\tif l < 50 {\n\t\treturn nil, InvalidAccountAddrError{reason: \"length\"}\n\t}\n\ti := l - 50 // start index of hex\n\n\tidh, err := hex.DecodeString(addr[i:])\n\tif err != nil {\n\t\treturn nil, InvalidAccountAddrError{reason: \"hex\"}\n\t}\n\n\t_addr := &Address{}\n\t_addr.Code = addr[0:i]\n\t_addr.Type = AccountType(idh[0])\n\t_addr.Hash = idh[1:]\n\n\tif err = _addr.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn _addr, nil\n}", "func ParseAddress(address []byte, options AddressParserOptions) *AddressParserResponse {\n\tcaddress, _ := (*C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&address)).Data)), cgoAllocsUnknown\n\tcoptions, _ := options.PassValue()\n\t__ret := C.parse_address(caddress, coptions)\n\t__v := NewAddressParserResponseRef(unsafe.Pointer(__ret))\n\treturn __v\n}", "func DecodeAddress(b []byte) (net.IP, []byte, error) {\n\tif len(b) < 6 {\n\t\treturn nil, nil, errors.New(\"too short\")\n\t}\n\n\t// IPv4\n\tif b[0] == 4 && b[1] == 4 {\n\t\treturn net.IP(b[2:6]), b[6:], nil\n\t}\n\n\t// IPv6\n\tif len(b) < 18 {\n\t\treturn nil, nil, errors.New(\"too short\")\n\t}\n\tif b[0] == 6 && b[1] == 16 {\n\t\treturn net.IP(b[2:18]), b[18:], nil\n\t}\n\n\treturn nil, nil, errors.New(\"unrecognized format\")\n}", "func ParseAddress(address string) Address {\n\tif !TrackPositions {\n\t\treturn 0\n\t}\n\taddr, _ := strconv.ParseUint(address, 0, 64)\n\n\treturn Address(addr)\n}", "func ParseAddress(address string) (common.Address, error) {\n\tif common.IsHexAddress(address) {\n\t\treturn common.HexToAddress(address), nil\n\t}\n\treturn common.Address{}, fmt.Errorf(\"invalid address: %v\", address)\n}", "func ParseAddress(addr string) Address {\n\t// Handle IPv6 address in form as \"[2001:4860:0:2001::68]\"\n\tlenAddr := len(addr)\n\tif lenAddr > 0 && addr[0] == '[' && addr[lenAddr-1] == ']' {\n\t\taddr = addr[1 : lenAddr-1]\n\t}\n\taddr = strings.TrimSpace(addr)\n\n\tip := net.ParseIP(addr)\n\tif ip != nil {\n\t\treturn IPAddress(ip)\n\t}\n\treturn DomainAddress(addr)\n}", "func ParseAddress(address string) (*Address, errors.TracerError) {\n\taddr := &Address{}\n\tif ValidateIPv6Address(address) {\n\t\tclean, testPort := cleanIPv6(address)\n\t\thasPort := false\n\t\tport := 0\n\t\tif testPort > 0 {\n\t\t\thasPort = true\n\t\t\tport = testPort\n\t\t}\n\t\treturn &Address{Host: clean, Port: port, IsIPv6: true, HasPort: hasPort}, nil\n\t}\n\tcolons := strings.Count(address, \":\")\n\tif colons > 1 {\n\t\treturn nil, errors.New(\"Invalid address: too many colons '%s'\", address)\n\t} else if colons == 0 {\n\t\treturn &Address{Host: address, HasPort: false}, nil\n\t}\n\tsplit := strings.Split(address, \":\")\n\taddr.Host = split[0]\n\tport, err := strconv.Atoi(split[1])\n\tif err != nil {\n\t\treturn nil, errors.New(\"address '%s' is invalid: could not parse port data, %s\", address, err)\n\t}\n\tif port <= 0 || port > math.MaxUint16 {\n\t\treturn nil, errors.New(\"port '%d' is not a valid port number, must be uint16\", port)\n\t}\n\taddr.Port = port\n\taddr.HasPort = true\n\treturn addr, nil\n}", "func DecodeAddress(address string) (*Address, error) {\n\t// if address[:3] == \"BM-\" { // Clients should accept addresses without BM-\n\t//\taddress = address[3:]\n\t// }\n\t//\n\t// decodeAddress says this but then UI checks for a missingbm status from\n\t// decodeAddress, which doesn't exist. So I choose NOT to accept addresses\n\t// without the initial \"BM-\"\n\n\ti, err := base58.DecodeToBig([]byte(address[3:]))\n\tif err != nil {\n\t\treturn nil, errors.New(\"input address not valid base58 string\")\n\t}\n\tdata := i.Bytes()\n\n\thashData := data[:len(data)-4]\n\tchecksum := data[len(data)-4:]\n\n\t// Take two rounds of SHA512 hashes\n\tsha := sha512.New()\n\tsha.Write(hashData)\n\tcurrentHash := sha.Sum(nil)\n\tsha.Reset()\n\tsha.Write(currentHash)\n\n\tif !bytes.Equal(checksum, sha.Sum(nil)[0:4]) {\n\t\treturn nil, errors.New(\"checksum failed\")\n\t}\n\t// create the address\n\taddr := new(Address)\n\n\tbuf := bytes.NewReader(data)\n\n\terr = addr.Version.DeserializeReader(buf) // get the version\n\tif err != nil {\n\t\treturn nil, types.DeserializeFailedError(\"version: \" + err.Error())\n\t}\n\n\terr = addr.Stream.DeserializeReader(buf)\n\tif err != nil {\n\t\treturn nil, types.DeserializeFailedError(\"stream: \" + err.Error())\n\t}\n\n\tripe := make([]byte, buf.Len()-4) // exclude bytes already read and checksum\n\tn, err := buf.Read(ripe)\n\tif n != len(ripe) || err != nil {\n\t\treturn nil, types.DeserializeFailedError(\"ripe: \" + err.Error())\n\t}\n\n\tswitch addr.Version {\n\tcase 2:\n\t\tfallthrough\n\tcase 3:\n\t\tif len(ripe) > 20 || len(ripe) < 18 { // improper size\n\t\t\treturn nil, errors.New(\"version 3, the ripe length is invalid\")\n\t\t}\n\tcase 4:\n\t\t// encoded ripe data MUST have null bytes removed from front\n\t\tif ripe[0] == 0x00 {\n\t\t\treturn nil, errors.New(\"version 4, ripe data has null bytes in\" +\n\t\t\t\t\" the beginning, not properly encoded\")\n\t\t}\n\t\tif len(ripe) > 20 || len(ripe) < 4 { // improper size\n\t\t\treturn nil, errors.New(\"version 4, the ripe length is invalid\")\n\t\t}\n\tdefault:\n\t\treturn nil, errors.New(\"unsupported address version\")\n\t}\n\n\t// prepend null bytes to make sure that the total ripe length is 20\n\tnumPadding := 20 - len(ripe)\n\tripe = append(make([]byte, numPadding), ripe...)\n\tcopy(addr.Ripe[:], ripe)\n\n\treturn addr, nil\n}", "func ParseAddress(addr interface{}) (a Address, err error) {\n\t// handle the allowed types\n\tswitch addrVal := addr.(type) {\n\tcase string: // simple string value\n\t\tif addrVal == \"\" {\n\t\t\terr = errors.New(\"Recipient.Address may not be empty\")\n\t\t} else {\n\t\t\ta.Email = addrVal\n\t\t}\n\n\tcase Address:\n\t\ta = addr.(Address)\n\n\tcase map[string]interface{}:\n\t\t// auto-parsed nested json object\n\t\tfor k, v := range addrVal {\n\t\t\tswitch vVal := v.(type) {\n\t\t\tcase string:\n\t\t\t\tif strings.EqualFold(k, \"name\") {\n\t\t\t\t\ta.Name = vVal\n\t\t\t\t} else if strings.EqualFold(k, \"email\") {\n\t\t\t\t\ta.Email = vVal\n\t\t\t\t} else if strings.EqualFold(k, \"header_to\") {\n\t\t\t\t\ta.HeaderTo = vVal\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\terr = errors.New(\"strings are required for all Recipient.Address values\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\tcase map[string]string:\n\t\t// user-provided json literal (convenience)\n\t\tfor k, v := range addrVal {\n\t\t\tif strings.EqualFold(k, \"name\") {\n\t\t\t\ta.Name = v\n\t\t\t} else if strings.EqualFold(k, \"email\") {\n\t\t\t\ta.Email = v\n\t\t\t} else if strings.EqualFold(k, \"header_to\") {\n\t\t\t\ta.HeaderTo = v\n\t\t\t}\n\t\t}\n\n\tdefault:\n\t\terr = errors.Errorf(\"unsupported Recipient.Address value type [%T]\", addrVal)\n\t}\n\n\treturn\n}", "func ParseAddress(s string) (Address, error) {\n\n\tvar family uint8\n\tvar sn uint64\n\tvar crcStr string\n\tcnt, err := fmt.Sscanf(s, \"%x.%x.%s\", &family, &sn, &crcStr)\n\n\tif (nil != err) || (3 != cnt) || (sn != (0xffffffffffff & sn)) {\n\t\treturn 0, errors.New(\"onewire: invalid address \" + s)\n\t}\n\ta := sn<<8 | (uint64(family) << 56)\n\n\tbuf := make([]byte, 8)\n\tbinary.LittleEndian.PutUint64(buf, sn<<8|(uint64(family)<<56))\n\n\tcrc := RevCrc8(buf[1:])\n\n\tif \"--\" != crcStr {\n\t\tvar c uint8\n\t\tcnt, err = fmt.Sscanf(crcStr, \"%x\", &c)\n\t\tif c != crc {\n\t\t\treturn 0, errors.New(\"onewire: invalid crc \" + s)\n\t\t}\n\t}\n\n\ta |= 0xff & uint64(crc)\n\n\treturn Address(a), nil\n}", "func TestIAAddrUnmarshalBinary(t *testing.T) {\n\tvar tests = []struct {\n\t\tdesc string\n\t\tbuf []byte\n\t\tiaaddr *IAAddr\n\t\terr error\n\t}{\n\t\t{\n\t\t\tdesc: \"one byte IAAddr\",\n\t\t\tbuf: []byte{0},\n\t\t\terr: io.ErrUnexpectedEOF,\n\t\t},\n\t\t{\n\t\t\tdesc: \"23 bytes IAAddr\",\n\t\t\tbuf: bytes.Repeat([]byte{0}, 23),\n\t\t\terr: io.ErrUnexpectedEOF,\n\t\t},\n\t\t{\n\t\t\tdesc: \"preferred greater than valid lifetime\",\n\t\t\tbuf: append(net.IPv6zero, []byte{\n\t\t\t\t0, 0, 0, 2,\n\t\t\t\t0, 0, 0, 1,\n\t\t\t}...),\n\t\t\terr: ErrInvalidLifetimes,\n\t\t},\n\t\t{\n\t\t\tdesc: \"invalid options (length mismatch)\",\n\t\t\tbuf: append(net.IPv6zero, []byte{\n\t\t\t\t0, 0, 0, 1,\n\t\t\t\t0, 0, 0, 2,\n\t\t\t\t0, 1, 0, 1,\n\t\t\t}...),\n\t\t\terr: dhcp6.ErrInvalidOptions,\n\t\t},\n\t\t{\n\t\t\tdesc: \"IPv6 loopback, 1s preferred, 2s valid, no options\",\n\t\t\tbuf: append(net.IPv6loopback, []byte{\n\t\t\t\t0, 0, 0, 1,\n\t\t\t\t0, 0, 0, 2,\n\t\t\t}...),\n\t\t\tiaaddr: &IAAddr{\n\t\t\t\tIP: net.IPv6loopback,\n\t\t\t\tPreferredLifetime: 1 * time.Second,\n\t\t\t\tValidLifetime: 2 * time.Second,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"IPv6 loopback, 1s preferred, 2s valid, option client ID [0 1]\",\n\t\t\tbuf: append(net.IPv6loopback, []byte{\n\t\t\t\t0, 0, 0, 1,\n\t\t\t\t0, 0, 0, 2,\n\t\t\t\t0, 1, 0, 2, 0, 1,\n\t\t\t}...),\n\t\t\tiaaddr: &IAAddr{\n\t\t\t\tIP: net.IPv6loopback,\n\t\t\t\tPreferredLifetime: 1 * time.Second,\n\t\t\t\tValidLifetime: 2 * time.Second,\n\t\t\t\tOptions: dhcp6.Options{\n\t\t\t\t\tdhcp6.OptionClientID: [][]byte{{0, 1}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, tt := range tests {\n\t\tiaaddr := new(IAAddr)\n\t\tif err := iaaddr.UnmarshalBinary(tt.buf); err != nil {\n\t\t\tif want, got := tt.err, err; want != got {\n\t\t\t\tt.Fatalf(\"[%02d] test %q, unexpected error for parseIAAddr: %v != %v\",\n\t\t\t\t\ti, tt.desc, want, got)\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\twant, err := tt.iaaddr.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tgot, err := iaaddr.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif !bytes.Equal(want, got) {\n\t\t\tt.Fatalf(\"[%02d] test %q, unexpected IAAddr bytes for parseIAAddr:\\n- want: %v\\n- got: %v\",\n\t\t\t\ti, tt.desc, want, got)\n\t\t}\n\n\t\tfor _, v := range iaaddr.Options {\n\t\t\tfor ii := range v {\n\t\t\t\tif want, got := cap(v[ii]), cap(v[ii]); want != got {\n\t\t\t\t\tt.Fatalf(\"[%02d] test %q, unexpected capacity option data:\\n- want: %v\\n- got: %v\",\n\t\t\t\t\t\ti, tt.desc, want, got)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "func ParseAddress(s string) (Address, error) {\n\tvar addr Address\n\terr := addr.parse(s)\n\treturn addr, err\n}", "func ParseAddress(address string) (string, int) {\n\tmatch, err := gregex.MatchString(`^(.+):(\\d+)$`, address)\n\tif err == nil {\n\t\ti, _ := strconv.Atoi(match[2])\n\t\treturn match[1], i\n\t}\n\treturn \"\", 0\n}", "func ParseAddress(tp string) error {\n\t// check source\n\tif tp == conf.TypeDump || tp == conf.TypeSync || tp == conf.TypeRump {\n\t\tif err := parseAddress(tp, conf.Options.SourceAddress, conf.Options.SourceType, true); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif len(conf.Options.SourceAddressList) == 0 {\n\t\t\treturn fmt.Errorf(\"source address shouldn't be empty when type in {dump, sync, rump}\")\n\t\t}\n\t}\n\n\t// check target\n\tif tp == conf.TypeRestore || tp == conf.TypeSync || tp == conf.TypeRump {\n\t\tif err := parseAddress(tp, conf.Options.TargetAddress, conf.Options.TargetType, false); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif len(conf.Options.TargetAddressList) == 0 {\n\t\t\treturn fmt.Errorf(\"target address shouldn't be empty when type in {restore, sync, rump}\")\n\t\t}\n\t}\n\n\treturn nil\n}", "func (op *OptIAAddress) ToBytes() []byte {\n\tbuf := uio.NewBigEndianBuffer(nil)\n\tbuf.WriteBytes(op.IPv6Addr.To16())\n\tbuf.Write32(op.PreferredLifetime)\n\tbuf.Write32(op.ValidLifetime)\n\tbuf.WriteBytes(op.Options.ToBytes())\n\treturn buf.Data()\n}", "func DecodeAddress(address string) (*Address, error) {\n\tif address[:3] == \"BM-\" { // Clients should accept addresses without BM-\n\t\taddress = address[3:]\n\t}\n\n\tdata := base58.Decode(address)\n\tif len(data) <= 12 { // rough lower bound, also don't want it to be empty\n\t\treturn nil, ErrUnknownAddressType\n\t}\n\n\thashData := data[:len(data)-4]\n\tchecksum := data[len(data)-4:]\n\n\tif !bytes.Equal(checksum, DoubleSha512(hashData)[0:4]) {\n\t\treturn nil, ErrChecksumMismatch\n\t}\n\t// create the address\n\taddr := new(Address)\n\n\tbuf := bytes.NewReader(data)\n\tvar err error\n\n\taddr.Version, err = ReadVarInt(buf) // read version\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\taddr.Stream, err = ReadVarInt(buf) // read stream\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tripe := make([]byte, buf.Len()-4) // exclude bytes already read and checksum\n\tbuf.Read(ripe) // this can never cause an error\n\n\tswitch addr.Version {\n\tcase 2:\n\t\tfallthrough\n\tcase 3:\n\t\tif len(ripe) > 19 || len(ripe) < 18 { // improper size\n\t\t\treturn nil, errors.New(\"version 3, the ripe length is invalid\")\n\t\t}\n\tcase 4:\n\t\t// encoded ripe data MUST have null bytes removed from front\n\t\tif ripe[0] == 0x00 {\n\t\t\treturn nil, errors.New(\"version 4, ripe data has null bytes in\" +\n\t\t\t\t\" the beginning, not properly encoded\")\n\t\t}\n\t\tif len(ripe) > 19 || len(ripe) < 4 { // improper size\n\t\t\treturn nil, errors.New(\"version 4, the ripe length is invalid\")\n\t\t}\n\tdefault:\n\t\treturn nil, ErrUnknownAddressType\n\t}\n\n\t// prepend null bytes to make sure that the total ripe length is 20\n\tnumPadding := 20 - len(ripe)\n\tripe = append(make([]byte, numPadding), ripe...)\n\tcopy(addr.Ripe[:], ripe)\n\n\treturn addr, nil\n}", "func (_TokenVesting *TokenVestingSession) ParseAddr(data []byte) (common.Address, error) {\n\treturn _TokenVesting.Contract.ParseAddr(&_TokenVesting.CallOpts, data)\n}", "func DecodeAddress(addr string, params AddressParams) (Address, error) {\n\t// Parsing code for future address/script versions should be added as the\n\t// most recent case in the switch statement. The expectation is that newer\n\t// version addresses will become more common, so they should be checked\n\t// first.\n\tswitch {\n\tcase probablyV0Base58Addr(addr):\n\t\treturn DecodeAddressV0(addr, params)\n\t}\n\n\tstr := fmt.Sprintf(\"address %q is not a supported type\", addr)\n\treturn nil, makeError(ErrUnsupportedAddress, str)\n}", "func (p *AddressParser) Parse(address string) (*Address, error)", "func (op *optDNS) FromBytes(data []byte) error {\n\tbuf := uio.NewBigEndianBuffer(data)\n\tfor buf.Has(net.IPv6len) {\n\t\top.NameServers = append(op.NameServers, buf.CopyN(net.IPv6len))\n\t}\n\treturn buf.FinError()\n}", "func (_TokenVesting *TokenVestingCallerSession) ParseAddr(data []byte) (common.Address, error) {\n\treturn _TokenVesting.Contract.ParseAddr(&_TokenVesting.CallOpts, data)\n}", "func decodeAddress(address string) (uint32, error) {\n\tsplit := strings.Split(address, \".\")\n\tif len(split) != 4 {\n\t\treturn 0, errors.New(\"Error decoding IPv4 address: wrong amount of octets\")\n\t}\n\tvar IPaddress uint32\n\tfor i, octetstr := range split {\n\t\tsegment, err := strconv.Atoi(octetstr)\n\t\tif err != nil {\n\t\t\treturn 0, errors.Wrap(err, \"Error decoding IPv4 address\")\n\t\t}\n\t\tif segment > math.MaxUint8 {\n\t\t\treturn 0, errors.New(\"Error decoding IPv4 address: value overflow\")\n\t\t}\n\t\t// Shift octets by determined amount of bits.\n\t\tswitch i {\n\t\tcase 0:\n\t\t\tsegment = segment << 24\n\t\tcase 1:\n\t\t\tsegment = segment << 16\n\t\tcase 2:\n\t\t\tsegment = segment << 8\n\t\t}\n\t\tIPaddress += uint32(segment)\n\t}\n\treturn IPaddress, nil\n}", "func ParseAddr(s string) (Addr, error) {\n\tcomma := strings.IndexByte(s, ',')\n\tif comma < 0 {\n\t\treturn Addr{}, serrors.New(\"invalid address: expected comma\", \"value\", s)\n\t}\n\tia, err := ParseIA(s[0:comma])\n\tif err != nil {\n\t\treturn Addr{}, err\n\t}\n\th, err := ParseHost(s[comma+1:])\n\tif err != nil {\n\t\treturn Addr{}, err\n\t}\n\treturn Addr{IA: ia, Host: h}, nil\n}", "func ParseFromIPAddr(ipNet *net.IPNet) (*IPv4Address, *IPv6Address, error) {\n\tif ipNet == nil {\n\t\treturn nil, nil, fmt.Errorf(\"Nil address: %v\", ipNet)\n\t}\n\n\tif v4Addr := ipNet.IP.To4(); v4Addr != nil {\n\t\tcidr, _ := ipNet.Mask.Size()\n\t\tret := NewIPv4AddressFromBytes(v4Addr, uint(cidr))\n\t\treturn &ret, nil, nil\n\t}\n\tif v6Addr := ipNet.IP.To16(); v6Addr != nil {\n\t\tcidr, _ := ipNet.Mask.Size()\n\t\tret := NewIPv6Address(v6Addr, uint(cidr))\n\t\treturn nil, &ret, nil\n\t}\n\n\treturn nil, nil, fmt.Errorf(\"couldn't parse either v4 or v6 address: %v\", ipNet)\n}", "func ParseAddress(addr string) (proto string, path string, err error) {\n\tm := netAddrRx.FindStringSubmatch(addr)\n\tif m == nil {\n\t\treturn \"\", \"\", goof.WithField(\"address\", addr, \"invalid address\")\n\t}\n\treturn m[1], m[2], nil\n}", "func (_TokenVesting *TokenVestingCaller) ParseAddr(opts *bind.CallOpts, data []byte) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _TokenVesting.contract.Call(opts, out, \"parseAddr\", data)\n\treturn *ret0, err\n}", "func (o *CIBVAddress) FromStringArray(sa StringArray) error {\n\tvar err error\n\tvar val int\n\tif val, err = strconv.Atoi(sa[0]); err != nil {\n\t\treturn err\n\t}\n\to.Lid = uint16(val)\n\tif val, err = strconv.Atoi(sa[1]); err != nil {\n\t\treturn err\n\t}\n\to.Qpn = uint32(val)\n\tif val, err = strconv.Atoi(sa[2]); err != nil {\n\t\treturn err\n\t}\n\to.Psn = uint32(val)\n\tif val, err = strconv.Atoi(sa[3]); err != nil {\n\t\treturn err\n\t}\n\to.Raddr = uint64(val)\n\tif val, err = strconv.Atoi(sa[4]); err != nil {\n\t\treturn err\n\t}\n\to.Rkey = uint32(val)\n\tif val, err = strconv.Atoi(sa[5]); err != nil {\n\t\treturn err\n\t}\n\to.Flag = uint32(val)\n\to.uuid = sa[6]\n\treturn nil\n}", "func AddressToIp(addr *pb.Address) net.IP {\n\tswitch a := addr.AddressVariant.(type) {\n\tcase *pb.Address_Ipv4:\n\t\treturn Int32ToIp(a.Ipv4)\n\tcase *pb.Address_Ipv6:\n\t\treturn BytesToIp(a.Ipv6)\n\tcase *pb.Address_Port:\n\t\treturn nil\n\tdefault:\n\t\treturn nil\n\t}\n}", "func (_LvRecording *LvRecordingFilterer) ParseLogAddress(log types.Log) (*LvRecordingLogAddress, error) {\n\tevent := new(LvRecordingLogAddress)\n\tif err := _LvRecording.contract.UnpackLog(event, \"LogAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func ParseAddress(address string) (string, string) {\n\tsplit := strings.Split(address, \":\")\n\tip := split[0]\n\tport := split[1]\n\n\treturn ip, port\n}", "func Address(a string) Option {\n\treturn func(o *Options) {\n\t\to.Address = a\n\t}\n}", "func (s *OpenconfigInterfaces_Interfaces_Interface_Tunnel_Ipv6_Addresses_Address) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigInterfaces_Interfaces_Interface_Tunnel_Ipv6_Addresses_Address\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func addressFromBytes(b []byte) (Address, error) {\n\ta := Address{}\n\tkeyLen := len(a.Key)\n\tif len(b) != keyLen+len(a.Checksum)+1 {\n\t\treturn a, errors.New(\"Invalid address bytes\")\n\t}\n\tcopy(a.Key[:], b[:keyLen])\n\ta.Version = b[keyLen]\n\tcopy(a.Checksum[:], b[keyLen+1:])\n\tif !a.HasValidChecksum() {\n\t\treturn a, errors.New(\"Invalid checksum\")\n\t} else {\n\t\treturn a, nil\n\t}\n}", "func ParseAddress(address string) (*ParsedAddress, error) {\n\taddressParts := &ParsedAddress{}\n\taddressList := strings.Split(address, \"/\")\n\tif len(addressList) != 3 {\n\t\treturn addressParts, logThenErrorf(\"invalid address string %s\", address)\n\t}\n\n\taddressParts = &ParsedAddress{\n\t\tLocationSegment: addressList[0],\n\t\tNetworkSegment: addressList[1],\n\t\tViewSegment: addressList[2],\n\t}\n\n\treturn addressParts, nil\n}", "func (_Node *NodeFilterer) ParseLogAddress(log types.Log) (*NodeLogAddress, error) {\n\tevent := new(NodeLogAddress)\n\tif err := _Node.contract.UnpackLog(event, \"LogAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func parseOptClientLinkLayerAddress(data []byte) (*optClientLinkLayerAddress, error) {\n\tvar opt optClientLinkLayerAddress\n\tbuf := uio.NewBigEndianBuffer(data)\n\topt.LinkLayerType = iana.HWType(buf.Read16())\n\topt.LinkLayerAddress = buf.ReadAll()\n\treturn &opt, buf.FinError()\n}", "func (op *OptVendorOpts) FromBytes(data []byte) error {\n\tbuf := uio.NewBigEndianBuffer(data)\n\top.EnterpriseNumber = buf.Read32()\n\tif err := op.VendorOpts.FromBytesWithParser(buf.ReadAll(), vendParseOption); err != nil {\n\t\treturn err\n\t}\n\treturn buf.FinError()\n}", "func (_LvRecordableStream *LvRecordableStreamFilterer) ParseLogAddress(log types.Log) (*LvRecordableStreamLogAddress, error) {\n\tevent := new(LvRecordableStreamLogAddress)\n\tif err := _LvRecordableStream.contract.UnpackLog(event, \"LogAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func (s *OpenconfigInterfaces_Interfaces_Interface_Tunnel_Ipv4_Addresses_Address) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigInterfaces_Interfaces_Interface_Tunnel_Ipv4_Addresses_Address\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (_Content *ContentFilterer) ParseLogAddress(log types.Log) (*ContentLogAddress, error) {\n\tevent := new(ContentLogAddress)\n\tif err := _Content.contract.UnpackLog(event, \"LogAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func NewFromCashAddress(addr *cashaddress.Address) (*Address, error) {\n\tvar network = MainNet\n\tvar addrtype = P2SH\n\n\tswitch addr.Prefix {\n\tcase cashaddress.MainNet:\n\t\tnetwork = MainNet\n\tcase cashaddress.TestNet:\n\t\tnetwork = TestNet\n\tcase cashaddress.RegTest:\n\t\tnetwork = RegTest\n\tdefault:\n\t\treturn nil, errors.New(\"invalid address network\")\n\t}\n\n\tswitch addr.Version {\n\tcase cashaddress.P2KH:\n\t\taddrtype = P2KH\n\tcase cashaddress.P2SH:\n\t\taddrtype = P2SH\n\tdefault:\n\t\treturn nil, errors.New(\"invalid address type\")\n\t}\n\n\treturn &Address{\n\t\tNetwork: network,\n\t\tVersion: addrtype,\n\t\tPayload: addr.Payload,\n\t}, nil\n}", "func FromAddress(address string) interop.Hash160 {\n\treturn nil\n}", "func AddressParserParse(p *mail.AddressParser, address string) (*mail.Address, error)", "func ParseFromIP(ip *net.IP) (*IPv4Address, *IPv6Address, error) {\n\tif ip == nil {\n\t\treturn nil, nil, fmt.Errorf(\"Nil address: %v\", ip)\n\t}\n\n\tif v4Addr := ip.To4(); v4Addr != nil {\n\t\tret := NewIPv4AddressFromBytes(v4Addr, 32)\n\t\treturn &ret, nil, nil\n\t}\n\tif v6Addr := ip.To16(); v6Addr != nil {\n\t\tret := NewIPv6Address(v6Addr, 128)\n\t\treturn nil, &ret, nil\n\t}\n\n\treturn nil, nil, fmt.Errorf(\"couldn't parse either v4 or v6 address: %v\", ip)\n}", "func AsAddr(addr wallet.Address) (*Address, error) {\n\ta, ok := addr.(*Address)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid type: %T\", addr)\n\t}\n\treturn a, nil\n}", "func readAddr(r io.Reader, b []byte) (Addr, error) {\n\tif len(b) < MaxAddrLen {\n\t\treturn nil, io.ErrShortBuffer\n\t}\n\t_, err := io.ReadFull(r, b[:1]) // read 1st byte for address type\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch b[0] {\n\tcase AtypIPv4:\n\t\t_, err = io.ReadFull(r, b[1:1+net.IPv4len+2])\n\t\treturn b[:1+net.IPv4len+2], err\n\tcase AtypDomainName:\n\t\t_, err = io.ReadFull(r, b[1:2]) // read 2nd byte for domain length\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t_, err = io.ReadFull(r, b[2:2+int(b[1])+2])\n\t\treturn b[:1+1+int(b[1])+2], err\n\tcase AtypIPv6:\n\t\t_, err = io.ReadFull(r, b[1:1+net.IPv6len+2])\n\t\treturn b[:1+net.IPv6len+2], err\n\t}\n\n\treturn nil, ErrAddressNotSupported\n}", "func DecodeRawAddress(s []byte) (Address, error) {\n\tif len(s) == 0 {\n\t\treturn nil, errors.New(\"empty address\")\n\t}\n\n\theader := s[0]\n\tnetwork := Network(header & 0x0f)\n\n\treadAddrCred := func(bit byte, pos int) StakeCredential {\n\t\thashBytes := s[pos : pos+Hash28Size]\n\t\tif header&(1<<bit) == 0 {\n\t\t\treturn StakeCredential{Kind: KeyStakeCredentialType, Data: hashBytes}\n\t\t}\n\t\treturn StakeCredential{Kind: ScriptStakeCredentialype, Data: hashBytes}\n\t}\n\n\tswitch (header & 0xf0) >> 4 {\n\t// Base type\n\tcase 0b0000, 0b0001, 0b0010, 0b0011:\n\t\t// header + keyhash\n\t\tif len(s) != 57 {\n\t\t\treturn nil, errors.New(\"Invalid length for base address\")\n\t\t}\n\t\treturn &BaseAddress{Network: network, Payment: readAddrCred(4, 1),\n\t\t\tStake: readAddrCred(5, Hash28Size+1)}, nil\n\t// Pointer type\n\tcase 0b0100, 0b0101:\n\t\t// header + keyhash + 3 natural numbers (min 1 byte each)\n\t\tif len(s) < 32 {\n\t\t\treturn nil, errors.New(\"Invalid length for pointer address\")\n\t\t}\n\t\tbyteIndex := 1\n\t\tpaymentCred := readAddrCred(4, 1)\n\t\tslot, slotBytes, ok := VariableNatDecode(s[byteIndex:])\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"slot variable decode failed\")\n\t\t}\n\t\tbyteIndex += slotBytes\n\n\t\ttxIndex, txBytes, ok := VariableNatDecode(s[byteIndex:])\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"txIndex variable decode failed\")\n\t\t}\n\t\tbyteIndex += txBytes\n\n\t\tcertIndex, certBytes, ok := VariableNatDecode(s[byteIndex:])\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"certIndex variable decode failed\")\n\t\t}\n\t\tbyteIndex += certBytes\n\n\t\tif byteIndex > len(s) {\n\t\t\treturn nil, errors.New(\"byte index is out range of pointer lenght\")\n\t\t}\n\n\t\treturn &PointerAddress{\n\t\t\tNetwork: network, Payment: paymentCred,\n\t\t\tStake: StakePoint{Slot: slot, TxIndex: txIndex, CertIndex: certIndex},\n\t\t}, nil\n\t// Enterprise type\n\tcase 0b0110, 0b0111:\n\t\t// header + keyhash\n\t\tif len(s) != 29 {\n\t\t\treturn nil, errors.New(\"invalid length for enterprise address\")\n\t\t}\n\t\treturn &EnterpriseAddress{Network: network, Payment: readAddrCred(4, 1)}, nil\n\t// Reward type\n\tcase 0b1110, 0b1111:\n\t\tif len(s) != 29 {\n\t\t\treturn nil, errors.New(\"invalid length for reward address\")\n\t\t}\n\t\treturn &Reward{Network: network, Payment: readAddrCred(4, 1)}, nil\n\t// Legacy byron type\n\tcase 0b1000:\n\t\tvar byron LegacyAddress\n\t\tif err := cbor.Unmarshal(s, &byron); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &byron, nil\n\t}\n\treturn nil, errors.New(\"unsupports address type\")\n}", "func (_LvStreamRightsHolder *LvStreamRightsHolderFilterer) ParseLogAddress(log types.Log) (*LvStreamRightsHolderLogAddress, error) {\n\tevent := new(LvStreamRightsHolderLogAddress)\n\tif err := _LvStreamRightsHolder.contract.UnpackLog(event, \"LogAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func (s *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (_BaseAccessWallet *BaseAccessWalletFilterer) ParseDbgAddress(log types.Log) (*BaseAccessWalletDbgAddress, error) {\n\tevent := new(BaseAccessWalletDbgAddress)\n\tif err := _BaseAccessWallet.contract.UnpackLog(event, \"dbgAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func DecodeAddr(address []byte) string {\n\tvar stringAddr string\n\tvar ip []byte\n\tvar port []byte\n\n\tip = address[:4]\n\tport = address[4:]\n\n\t// Decode IP\n\tfor index, octet := range ip {\n\t\tstringAddr = stringAddr + strconv.Itoa(int(octet))\n\t\tif index != 3 {\n\t\t\tstringAddr += \".\"\n\t\t}\n\t}\n\tstringAddr += \":\"\n\n\t// Decode Port\n\tb := make([]byte, 8)\n\tfor i := 0; i < 6; i++ {\n\t\tb[i] = byte(0)\n\t}\n\tb[6] = port[0]\n\tb[7] = port[1]\n\tp := binary.BigEndian.Uint64(b)\n\tstringAddr += strconv.FormatUint(p, 10)\n\t//fmt.Println(\"Complete IP:\", stringAddr)\n\treturn stringAddr\n}", "func UserAddressFromAddress(a Address) *UserAddress {\n\tvar streetNum, streetName string\n\tparts := strings.Split(a.LineOne(), \" \")\n\n\tif _, err := strconv.Atoi(parts[0]); err == nil {\n\t\tstreetNum = parts[0]\n\t}\n\tstreetName = strings.Join(parts[1:], \" \")\n\n\tif addr, ok := a.(*UserAddress); ok {\n\t\tif len(addr.StreetNumber) == 0 {\n\t\t\taddr.StreetNumber = streetNum\n\t\t}\n\t\tif len(addr.StreetName) == 0 {\n\t\t\taddr.StreetName = streetName\n\t\t}\n\t\treturn addr\n\t}\n\n\treturn &UserAddress{\n\t\tStreet: a.LineOne(),\n\t\tStreetNumber: streetNum,\n\t\tStreetName: streetName,\n\t\tCityName: a.City(),\n\t\tPostalCode: a.Zip(),\n\t\tRegion: a.StateCode(),\n\t}\n}", "func (t *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func AddressFromBytes(buf []byte) (Address, error) {\n\tif 8 != len(buf) {\n\t\treturn Address(0), errors.New(\"onewire: invalid buffer length\")\n\t}\n\tcrc := Crc8(buf[:7])\n\tif buf[7] != crc {\n\t\treturn 0, errors.New(\"onewire: invalid crc\")\n\t}\n\n\treturn Address(binary.BigEndian.Uint64(buf)), nil\n}", "func DecodeAddress(raw string) (res Address, err error) {\n\tvar rbytes []byte\n\tvar prefix string\n\n\tif strings.HasPrefix(raw, B32Prefix) || strings.HasPrefix(raw, StakePrefix) {\n\t\tprefix, rbytes, err = bech32.Decode(raw)\n\t} else {\n\t\trbytes, err = base58.Decode(raw)\n\t}\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tres, err = DecodeRawAddress(rbytes)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif p := res.Prefix(); p != prefix {\n\t\terr = errors.New(\"invalid address prefix\")\n\t}\n\n\treturn\n}", "func (op *OptNetworkInterfaceID) FromBytes(data []byte) error {\n\tbuf := uio.NewBigEndianBuffer(data)\n\top.Typ = NetworkInterfaceType(buf.Read8())\n\top.Major = buf.Read8()\n\top.Minor = buf.Read8()\n\treturn buf.FinError()\n}", "func (_BaseAccessControlGroup *BaseAccessControlGroupFilterer) ParseDbgAddress(log types.Log) (*BaseAccessControlGroupDbgAddress, error) {\n\tevent := new(BaseAccessControlGroupDbgAddress)\n\tif err := _BaseAccessControlGroup.contract.UnpackLog(event, \"dbgAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func ParseDevAddr(input string) (addr DevAddr, err error) {\n\tbytes, err := ParseHEX(input, 4)\n\tif err != nil {\n\t\treturn\n\t}\n\tcopy(addr[:], bytes)\n\treturn\n}", "func ParseAddress(address string) (*mail.Address, error)", "func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) }", "func HexToAddress(s string) types.Address { return BytesToAddress(FromHex(s)) }", "func (in *ActionUserRequestChangeResolveInput) SetAddress(value string) *ActionUserRequestChangeResolveInput {\n\tin.Address = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Address\"] = nil\n\treturn in\n}", "func ParseAdvertiseAddr(advertiseIP string) (string, string, error) {\n\tadvertiseIP = strings.TrimSpace(advertiseIP)\n\thost := advertiseIP\n\tport := \"\"\n\tif len(net.ParseIP(host)) == 0 && strings.Contains(advertiseIP, \":\") {\n\t\tvar err error\n\t\thost, port, err = net.SplitHostPort(advertiseIP)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", trace.BadParameter(\"failed to parse address %q\", advertiseIP)\n\t\t}\n\t\tif _, err := strconv.Atoi(port); err != nil {\n\t\t\treturn \"\", \"\", trace.BadParameter(\"bad port %q, expected integer\", port)\n\t\t}\n\t\tif host == \"\" {\n\t\t\treturn \"\", \"\", trace.BadParameter(\"missing host parameter\")\n\t\t}\n\t}\n\tip := net.ParseIP(host)\n\tif len(ip) != 0 {\n\t\tif ip.IsUnspecified() || ip.IsMulticast() {\n\t\t\treturn \"\", \"\", trace.BadParameter(\"unreachable advertise IP: %v\", advertiseIP)\n\t\t}\n\t}\n\treturn host, port, nil\n}", "func FromAddress(c *cli.Context) models.Address {\n\treturn models.Address{\n\t\tName: c.String(\"from-name\"),\n\t\tStreet: c.String(\"from-address\"),\n\t\tCity: c.String(\"from-city\"),\n\t\tState: c.String(\"from-state\"),\n\t\tZip: c.String(\"from-zip\"),\n\t\tCountry: c.String(\"from-country\"),\n\t}\n}", "func (s *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func parseEPRTtoAddr(line string) (string, string, error) {\n\taddr := strings.Split(line, \"|\")\n\n\tif len(addr) != 5 {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid data address\")\n\t}\n\n\tnetProtocol := addr[1]\n\tIP := addr[2]\n\n\t// check port is valid\n\tport := addr[3]\n\tif integerPort, err := strconv.Atoi(port); err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid data address\")\n\t} else if integerPort <= 0 || integerPort > 65535 {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid data address\")\n\t}\n\n\tswitch netProtocol {\n\tcase \"1\", \"2\":\n\t\t// use protocol 1 means IPv4. 2 means IPv6\n\t\t// net.ParseIP for validate IP\n\t\tif net.ParseIP(IP) == nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"invalid data address\")\n\t\t}\n\t\tbreak\n\tdefault:\n\t\t// wrong network protocol\n\t\treturn \"\", \"\", fmt.Errorf(\"unknown network protocol\")\n\t}\n\n\treturn IP, port, nil\n}", "func ParsePciAddress(pciAddress string) ([]string, error) {\n\tpciAddrRegx, err := regexp.Compile(PCI_ADDRESS_PATTERN)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to compile pci address pattern, %v\", err)\n\t}\n\tres := pciAddrRegx.FindStringSubmatch(pciAddress)\n\tif len(res) == 0 {\n\t\treturn nil, fmt.Errorf(\"failed to parse pci address %s\", pciAddress)\n\t}\n\treturn res[1:], nil\n}", "func (i *IATA) UnmarshalBinary(b []byte) error {\n\t// IATA must contain at least an IAID.\n\tif len(b) < 4 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\n\tiaid := [4]byte{}\n\tcopy(iaid[:], b[0:4])\n\ti.IAID = iaid\n\n\toptions, err := parseOptions(b[4:])\n\tif err != nil {\n\t\treturn err\n\t}\n\ti.Options = options\n\n\treturn nil\n}", "func marshallAbiAddress(value interface{}) (string, error) {\n\tabiType, err := abi.TypeOf(\"address\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tencoded, err := abiType.Encode(value)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdecoded, err := abiType.Decode(encoded)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tmarshalledValue, ok := decoded.([]byte)\n\tif !ok || len(marshalledValue) != len(types.ZeroAddress) {\n\t\terr = fmt.Errorf(\"Decoded value is not a 32 length byte slice\")\n\t}\n\tvar addressValue types.Address\n\tcopy(addressValue[:], marshalledValue)\n\treturn addressValue.String(), err\n}", "func (addr *Address) Unmarshal(buf []byte, rem int) ([]byte, int, error) {\n\tvar err error\n\tbuf, rem, err = surge.UnmarshalU8((*uint8)(&addr.Protocol), buf, rem)\n\tif err != nil {\n\t\treturn buf, rem, err\n\t}\n\tbuf, rem, err = surge.UnmarshalString(&addr.Value, buf, rem)\n\tif err != nil {\n\t\treturn buf, rem, err\n\t}\n\tbuf, rem, err = surge.UnmarshalU64(&addr.Nonce, buf, rem)\n\tif err != nil {\n\t\treturn buf, rem, err\n\t}\n\treturn addr.Signature.Unmarshal(buf, rem)\n}", "func WithAddress(address string) Option {\n\treturn addressOption(address)\n}", "func WithAddress(addr string) Option {\n\treturn addrOption{address: addr}\n}", "func FromBytes(q []byte) (*DHCPv4, error) {\n\tvar p DHCPv4\n\tbuf := uio.NewBigEndianBuffer(q)\n\n\tp.OpCode = OpcodeType(buf.Read8())\n\tp.HWType = iana.HWType(buf.Read8())\n\n\thwAddrLen := buf.Read8()\n\n\tp.HopCount = buf.Read8()\n\tbuf.ReadBytes(p.TransactionID[:])\n\tp.NumSeconds = buf.Read16()\n\tp.Flags = buf.Read16()\n\n\tp.ClientIPAddr = net.IP(buf.CopyN(net.IPv4len))\n\tp.YourIPAddr = net.IP(buf.CopyN(net.IPv4len))\n\tp.ServerIPAddr = net.IP(buf.CopyN(net.IPv4len))\n\tp.GatewayIPAddr = net.IP(buf.CopyN(net.IPv4len))\n\n\tif hwAddrLen > 16 {\n\t\thwAddrLen = 16\n\t}\n\t// Always read 16 bytes, but only use hwaddrlen of them.\n\tp.ClientHWAddr = make(net.HardwareAddr, 16)\n\tbuf.ReadBytes(p.ClientHWAddr)\n\tp.ClientHWAddr = p.ClientHWAddr[:hwAddrLen]\n\n\tvar sname [64]byte\n\tbuf.ReadBytes(sname[:])\n\tlength := strings.Index(string(sname[:]), \"\\x00\")\n\tif length == -1 {\n\t\tlength = 64\n\t}\n\tp.ServerHostName = string(sname[:length])\n\n\tvar file [128]byte\n\tbuf.ReadBytes(file[:])\n\tlength = strings.Index(string(file[:]), \"\\x00\")\n\tif length == -1 {\n\t\tlength = 128\n\t}\n\tp.BootFileName = string(file[:length])\n\n\tvar cookie [4]byte\n\tbuf.ReadBytes(cookie[:])\n\n\tif err := buf.Error(); err != nil {\n\t\treturn nil, err\n\t}\n\tif cookie != magicCookie {\n\t\treturn nil, fmt.Errorf(\"malformed DHCP packet: got magic cookie %v, want %v\", cookie[:], magicCookie[:])\n\t}\n\n\tp.Options = make(Options)\n\tif err := p.Options.fromBytesCheckEnd(buf.Data(), true); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &p, nil\n}", "func (t *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (b *Backend) ParseAddress(addr string) (err error) {\n\tif b.Addr, err = url.Parse(addr); err != nil {\n\t\treturn err\n\t}\n\n\tif b.Addr.Scheme == \"\" {\n\t\tb.Addr.Scheme = \"http\"\n\t}\n\n\thttps := b.Addr.Scheme == \"https\"\n\tb.Host = b.Addr.Host\n\n\tif b.Addr.Port() == \"\" {\n\t\tif https {\n\t\t\tb.Host += \":443\"\n\t\t} else {\n\t\t\tb.Host += \":80\"\n\t\t}\n\t}\n\n\treturn nil\n}", "func BytesToAddress(b []byte) Address {\n\tvar a Address\n\tif len(b) > AddressLength {\n\t\tb = b[len(b)-AddressLength:]\n\t}\n\tcopy(a[AddressLength-len(b):], b)\n\treturn a\n}", "func (a *Address) UnmarshalJSON(buf []byte) (err error) {\n\tstr := string(buf[1 : len(buf)-1])\n\t_, _, err = ParseAddrPort(str)\n\tif err == nil {\n\t\t*a = Address(str)\n\t}\n\treturn\n}", "func NewAddressFromHex(str string) (*Address, error) {\n\tif len(str) != 42 || str[:2] != \"0x\" {\n\t\treturn nil, errors.New(\"Address must be chars 40 hex strings prefixed with 0x\")\n\t}\n\tbytes, err := hex.DecodeString(str[2:])\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"parsing address as hexadecimal\")\n\t}\n\tvar a common.Address\n\tcopy(a[:], bytes)\n\treturn &Address{wallet.Address(a)}, nil\n}", "func ValidateAddress(address string) error {\n\tif !common.IsHexAddress(address) {\n\t\treturn sdkerrors.Wrapf(\n\t\t\tsdkerrors.ErrInvalidAddress, \"address '%s' is not a valid ethereum hex address\",\n\t\t\taddress,\n\t\t)\n\t}\n\treturn nil\n}", "func TestNewIAAddr(t *testing.T) {\n\tvar tests = []struct {\n\t\tdesc string\n\t\tip net.IP\n\t\tpreferred time.Duration\n\t\tvalid time.Duration\n\t\toptions dhcp6.Options\n\t\tiaaddr *IAAddr\n\t\terr error\n\t}{\n\t\t{\n\t\t\tdesc: \"all zero values\",\n\t\t\tiaaddr: &IAAddr{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"IPv4 address\",\n\t\t\tip: net.IP([]byte{192, 168, 1, 1}),\n\t\t\terr: ErrInvalidIP,\n\t\t},\n\t\t{\n\t\t\tdesc: \"preferred greater than valid lifetime\",\n\t\t\tip: net.IPv6loopback,\n\t\t\tpreferred: 2 * time.Second,\n\t\t\tvalid: 1 * time.Second,\n\t\t\terr: ErrInvalidLifetimes,\n\t\t},\n\t\t{\n\t\t\tdesc: \"IPv6 localhost, 1s preferred, 2s valid, no options\",\n\t\t\tip: net.IPv6loopback,\n\t\t\tpreferred: 1 * time.Second,\n\t\t\tvalid: 2 * time.Second,\n\t\t\tiaaddr: &IAAddr{\n\t\t\t\tIP: net.IPv6loopback,\n\t\t\t\tPreferredLifetime: 1 * time.Second,\n\t\t\t\tValidLifetime: 2 * time.Second,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"IPv6 localhost, 1s preferred, 2s valid, option client ID [0 1]\",\n\t\t\tip: net.IPv6loopback,\n\t\t\tpreferred: 1 * time.Second,\n\t\t\tvalid: 2 * time.Second,\n\t\t\toptions: dhcp6.Options{\n\t\t\t\tdhcp6.OptionClientID: [][]byte{{0, 1}},\n\t\t\t},\n\t\t\tiaaddr: &IAAddr{\n\t\t\t\tIP: net.IPv6loopback,\n\t\t\t\tPreferredLifetime: 1 * time.Second,\n\t\t\t\tValidLifetime: 2 * time.Second,\n\t\t\t\tOptions: dhcp6.Options{\n\t\t\t\t\tdhcp6.OptionClientID: [][]byte{{0, 1}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, tt := range tests {\n\t\tiaaddr, err := NewIAAddr(tt.ip, tt.preferred, tt.valid, tt.options)\n\t\tif err != nil {\n\t\t\tif want, got := tt.err, err; want != got {\n\t\t\t\tt.Fatalf(\"[%02d] test %q, unexpected error for NewIAAddr: %v != %v\",\n\t\t\t\t\ti, tt.desc, want, got)\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\twant, err := tt.iaaddr.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tgot, err := iaaddr.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif !bytes.Equal(want, got) {\n\t\t\tt.Fatalf(\"[%02d] test %q, unexpected IAAddr bytes:\\n- want: %v\\n- got: %v\",\n\t\t\t\ti, tt.desc, want, got)\n\t\t}\n\t}\n}", "func decodeAddress(address string, cfg *chaincfg.Params) (btcutil.Address, error) {\n\tdecodedAddress, err := btcutil.DecodeAddress(address, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn decodedAddress, nil\n}", "func (_AccessIndexor *AccessIndexorFilterer) ParseDbgAddress(log types.Log) (*AccessIndexorDbgAddress, error) {\n\tevent := new(AccessIndexorDbgAddress)\n\tif err := _AccessIndexor.contract.UnpackLog(event, \"dbgAddress\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}", "func ExpandAddress(input []byte, options NormalizeOptions, n []uint) **byte {\n\tcinput, _ := (*C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&input)).Data)), cgoAllocsUnknown\n\tcoptions, _ := options.PassValue()\n\tcn, _ := (*C.size_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&n)).Data)), cgoAllocsUnknown\n\t__ret := C.expand_address(cinput, coptions, cn)\n\t__v := *(***byte)(unsafe.Pointer(&__ret))\n\treturn __v\n}", "func IotxAddressToAddress(iotxRawAddr string) (Address, error) {\n\treturn V1.IotxAddressToAddress(iotxRawAddr)\n}", "func AddressDecode(dec *WasmDecoder) ScAddress {\n\taddr := ScAddress{}\n\tcopy(addr.id[:], dec.FixedBytes(ScAddressLength))\n\treturn addr\n}", "func BytesToAddress(b []byte) (Address, error) {\n\tif len(b) > AddressLength {\n\t\treturn Address{}, AddressOverflowError\n\t}\n\tvar a Address\n\ta.SetBytes(b)\n\treturn a, nil\n}", "func (g *Getter) decodeA(buf []byte, res string) (int, error) {\n\t/* Parse as an IP address */\n\tip := net.ParseIP(res)\n\tif nil == ip {\n\t\treturn 0, fmt.Errorf(\"invalid IP address %q\", res)\n\t}\n\t/* Parse with the appropriate length */\n\tvar plen, start int\n\tswitch g.Type {\n\tcase TypeA:\n\t\tip = ip.To4()\n\t\tplen = 4\n\t\tstart = 1\n\tcase TypeAAAA:\n\t\tip = ip.To16()\n\t\tplen = 16\n\t\tstart = 8\n\t}\n\t/* If we didn't get an address of the right size, someone goofed */\n\tif nil == ip {\n\t\treturn 0, fmt.Errorf(\"unable to parse IP address %s\", res)\n\t}\n\t/* Make sure we have enough buffer */\n\tif plen > len(buf) {\n\t\treturn 0, fmt.Errorf(\n\t\t\t\"buffer too small for record of type %s\",\n\t\t\tg.Type,\n\t\t)\n\t}\n\t/* Extract the payload */\n\treturn copy(buf, ip[start:]), nil\n}", "func (m *Message) AIP() (*AIP, error) {\n\tps, err := m.Parse(\"AIP\")\n\tpst, ok := ps.(*AIP)\n\tif ok {\n\t\treturn pst, err\n\t}\n\treturn nil, err\n}", "func (a *Address) UnmarshalJSON(input []byte) error {\n\treturn hexutil.UnmarshalFixedJSON(addressT, input, a[:])\n}", "func (a *Address) UnmarshalJSON(input []byte) error {\n\treturn hexutil.UnmarshalFixedJSON(addressT, input, a[:])\n}", "func WithAddress(address string) Option {\n\treturn func(o *Options) {\n\t\to.Address = address\n\t}\n}", "func parseDialingAddress(ctx *context.T, vaddress string) (network string, address string, tag string, p flow.Protocol, err error) {\n\tparts := strings.SplitN(vaddress, \"/\", 3)\n\tif len(parts) != 3 {\n\t\treturn \"\", \"\", \"\", nil, ErrorfInvalidAddress(ctx, \"invalid vine address %v, address must be of the form 'network/address/tag'\", vaddress)\n\t}\n\tp, _ = flow.RegisteredProtocol(parts[0])\n\tif p == nil {\n\t\treturn \"\", \"\", \"\", nil, ErrorfNoRegisteredProtocol(ctx, \"no registered protocol: %v\", parts[0])\n\t}\n\treturn parts[0], parts[1], parts[2], p, nil\n}", "func DecodeString(addr string) (Address, error) {\n\t// Remove any leading slashes.\n\tif strings.HasPrefix(addr, \"/\") {\n\t\taddr = addr[1:]\n\t}\n\n\taddrParts := strings.Split(addr, \"/\")\n\tif len(addrParts) != 4 {\n\t\treturn Address{}, fmt.Errorf(\"invalid format %v\", addr)\n\t}\n\tvar protocol Protocol\n\tswitch addrParts[0] {\n\tcase \"tcp\":\n\t\tprotocol = TCP\n\tcase \"udp\":\n\t\tprotocol = UDP\n\tcase \"ws\":\n\t\tprotocol = WebSocket\n\tdefault:\n\t\treturn Address{}, fmt.Errorf(\"invalid protocol %v\", addrParts[0])\n\t}\n\tvalue := addrParts[1]\n\tnonce, err := strconv.ParseUint(addrParts[2], 10, 64)\n\tif err != nil {\n\t\treturn Address{}, err\n\t}\n\tvar sig id.Signature\n\tsigBytes, err := base64.RawURLEncoding.DecodeString(addrParts[3])\n\tif err != nil {\n\t\treturn Address{}, err\n\t}\n\tif len(sigBytes) != 65 {\n\t\treturn Address{}, fmt.Errorf(\"invalid signature %v\", addrParts[3])\n\t}\n\tcopy(sig[:], sigBytes)\n\treturn Address{\n\t\tProtocol: protocol,\n\t\tValue: value,\n\t\tNonce: nonce,\n\t\tSignature: sig,\n\t}, nil\n}", "func ParseAddressSpec(addrSpec string) (string, string, error) {\n\trs := regexp.MustCompile(`^([^@]+)@([^@]+)$`).FindStringSubmatch(addrSpec)\n\tif len(rs) < 1 {\n\t\treturn \"\", \"\", errors.New(\"RFC 5322 Address Spec not found.\")\n\t}\n\treturn rs[1], rs[2], nil\n}", "func (s *Script) ParseContractAddr() (*types.AddressContract, error) {\n\t_, operand, _, err := s.getNthOp(22, 0) // 1, 22\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(operand) != ripemd160.Size {\n\t\treturn nil, ErrInvalidContractScript\n\t}\n\tif bytes.Equal(operand, types.ZeroAddressHash[:]) {\n\t\t// contract deploy\n\t\treturn nil, nil\n\t}\n\treturn types.NewContractAddressFromHash(operand)\n}", "func NewFromString(addr string) (*Address, error) {\n\tlegaddr, err := legacy.Decode(addr)\n\tif err == nil {\n\t\taddr, err := NewFromLegacy(legaddr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn addr, nil\n\t}\n\n\tcashaddr, err := cashaddress.Decode(addr, cashaddress.MainNet)\n\tif err == nil {\n\t\taddr, err := NewFromCashAddress(cashaddr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn addr, nil\n\t}\n\n\treturn nil, errors.New(\"unable to decode address\")\n}", "func (d *IPOrDomain) AsAddress() Address {\n\tif d == nil {\n\t\treturn nil\n\t}\n\tswitch addr := d.Address.(type) {\n\tcase *IPOrDomain_Ip:\n\t\treturn IPAddress(addr.Ip)\n\tcase *IPOrDomain_Domain:\n\t\treturn DomainAddress(addr.Domain)\n\t}\n\tpanic(\"Common|Net: Invalid address.\")\n}", "func (a *Lisp_address) lisp_make_address(iid int, addr []byte) {\n\ta.instance_id = iid\n\ta.address = addr\n\ta.mask_len = len(a.address) * 8\n\ta.mask_address = net.CIDRMask(a.mask_len, len(a.address) * 8)\n}", "func ParseCode(addr string) (string, error) {\n\tl := len(addr)\n\tif l < 50 {\n\t\treturn \"\", InvalidAccountAddrError{reason: \"length\"}\n\t}\n\ti := l - 50 // start index of hex\n\treturn strings.ToUpper(addr[0:i]), nil\n}", "func (_Contract *ContractFilterer) ParseAddressChanged(log types.Log) (*ContractAddressChanged, error) {\n\tevent := new(ContractAddressChanged)\n\tif err := _Contract.contract.UnpackLog(event, \"AddressChanged\", log); err != nil {\n\t\treturn nil, err\n\t}\n\treturn event, nil\n}" ]
[ "0.6095162", "0.5969518", "0.5851808", "0.575989", "0.57291037", "0.56328076", "0.56151664", "0.5525519", "0.546415", "0.5449659", "0.5433965", "0.54182434", "0.5393001", "0.53877", "0.535847", "0.53314054", "0.5328453", "0.5295815", "0.5283535", "0.52241075", "0.51893", "0.51830244", "0.51726466", "0.5170505", "0.5155107", "0.5150874", "0.51272833", "0.51049274", "0.50938684", "0.5079866", "0.50529313", "0.505189", "0.5051323", "0.50284284", "0.5025574", "0.49976954", "0.49944714", "0.49927184", "0.49858388", "0.4976967", "0.49740314", "0.4968268", "0.49471465", "0.4945239", "0.49434063", "0.4928218", "0.492503", "0.49212694", "0.4903165", "0.48896053", "0.4887786", "0.4883186", "0.48828033", "0.48822474", "0.48806676", "0.48785502", "0.4867127", "0.48624322", "0.48339543", "0.48292747", "0.4809095", "0.4808597", "0.47989464", "0.4790509", "0.47892252", "0.47777545", "0.4775372", "0.47663507", "0.4762729", "0.4757166", "0.4754483", "0.47541744", "0.47530755", "0.47454432", "0.47446048", "0.4743204", "0.4734672", "0.47220144", "0.47192022", "0.47183502", "0.47052982", "0.46878326", "0.46707126", "0.46699095", "0.46563306", "0.46554697", "0.46543172", "0.46540877", "0.46532091", "0.46532091", "0.46447438", "0.463768", "0.46339583", "0.46304432", "0.46286643", "0.46239027", "0.46127176", "0.46125937", "0.46086967", "0.459781" ]
0.80320567
0
CreateVersionCommand creates a cmdline 'subcommand' to display version information. The format of the information printed is: / (; ; ...) The version and tags are set at build time using something like: go build ldflags \ "X github.com/grailbio/base/cmdutil.version=$version \ X github.com/grailbio/base/cmdutil.tags=$tags"
CreateVersionCommand создает cmdline 'подкоманду' для отображения информации о версии. Формат информации, которая выводится, следующий: / (; ; ...) Версия и метки устанавливаются во время сборки с помощью чего-то вроде: go build ldflags \ "X github.com/grailbio/base/cmdutil.version=$version \ X github.com/grailbio/base/cmdutil.tags=$tags"
func CreateVersionCommand(name, prefix string) *cmdline.Command { return &cmdline.Command{ Runner: RunnerFunc(func(_ *cmdline.Env, _ []string) error { printVersion(prefix) return nil }), Name: name, Short: "Display version information", } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewVersionCommand(streams genericclioptions.IOStreams) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the version information for kubectl trace\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tfmt.Fprintln(streams.Out, version.String())\n\t\t\treturn nil\n\t\t},\n\t}\n\treturn cmd\n}", "func NewVersionCommand(settings *CmdSetting) *cobra.Command {\n\tversionCmd := &VersionCmd{settings: settings}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the version of kubectl-recreate\",\n\t\tSilenceUsage: true,\n\t\tRun: versionCmd.run,\n\t}\n\n\treturn cmd\n}", "func NewVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints out build version information\",\n\t\tLong: \"Prints out build version information\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(`Version: %v\nGitRevision: %v\nGolangVersion: %v\n`,\n\t\t\t\tversion.VelaVersion,\n\t\t\t\tversion.GitRevision,\n\t\t\t\truntime.Version())\n\t\t},\n\t\tAnnotations: map[string]string{\n\t\t\ttypes.TagCommandType: types.TypePlugin,\n\t\t},\n\t}\n}", "func newVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints version information\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\treturn versionTemplate.Execute(os.Stdout, build.GetInfo())\n\t\t},\n\t}\n}", "func CreateInfoCommand(name, prefix string, info ...func(*context.T, *cmdline.Env, []string) error) *cmdline.Command {\n\treturn &cmdline.Command{\n\t\tRunner: v23cmd.RunnerFunc(func(ctx *context.T, env *cmdline.Env, args []string) error {\n\t\t\tprintVersion(prefix)\n\t\t\tfor _, ifn := range info {\n\t\t\t\tif err := ifn(ctx, env, args); 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\tName: name,\n\t\tShort: \"Display version information\",\n\t}\n}", "func NewCmdVersion(rootCmd *cobra.Command) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Shows openebs kubectl plugin's version\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tk, _ := client.NewK8sClient(\"\")\n\t\t\tcomponentVersionMap, err := k.GetVersionMapOfComponents()\n\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"Client Version: \" + getValidVersion(rootCmd.Version))\n\t\t\t\tfmt.Fprintf(os.Stderr, \"\\nError getting Components Version...\")\n\t\t\t\tcheckForLatestVersion(rootCmd.Version)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar rows []metav1.TableRow = []metav1.TableRow{\n\t\t\t\t{\n\t\t\t\t\tCells: []interface{}{\"Client\", getValidVersion(rootCmd.Version)},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tCells: []interface{}{\"OpenEBS CStor\", getValidVersion(componentVersionMap[util.CstorCasType])},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tCells: []interface{}{\"OpenEBS Jiva\", getValidVersion(componentVersionMap[util.JivaCasType])},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tCells: []interface{}{\"OpenEBS LVM LocalPV\", getValidVersion(componentVersionMap[util.LVMCasType])},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tCells: []interface{}{\"OpenEBS ZFS LocalPV\", getValidVersion(componentVersionMap[util.ZFSCasType])},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tutil.TablePrinter(util.VersionColumnDefinition, rows, printers.PrintOptions{Wide: true})\n\t\t\tcheckForLatestVersion(rootCmd.Version)\n\t\t},\n\t}\n\tcmd.SetUsageTemplate(versionCmdHelp)\n\treturn cmd\n}", "func NewVersionCommand(isvrCli command.Cli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Display versions of the CLI and Server\",\n\t\tArgs: cli.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn runVersion(isvrCli)\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewVersionCommand(version string, buildDate string, out io.Writer) *cobra.Command {\n\tversionCmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"display the current version\",\n\t\tLong: \"display the current version\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Fprintf(out, \"Primes Worker:\\n\")\n\t\t\tfmt.Fprintf(out, \" Version: %s\\n\", version)\n\t\t\tfmt.Fprintf(out, \" Built: %s\\n\", buildDate)\n\t\t\tfmt.Fprintf(out, \" Go Version: %s\\n\", runtime.Version())\n\t\t},\n\t}\n\n\treturn versionCmd\n}", "func NewVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the kperf version\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcmd.Printf(\"Version: %s\\n\", Version)\n\t\t\tcmd.Printf(\"Build Date: %s\\n\", BuildDate)\n\t\t\tcmd.Printf(\"Git Revision: %s\\n\", GitRevision)\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func NewCmdVersion(w io.Writer) *cobra.Command {\n\tvar short bool\n\n\tversionCmd := cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the kustomize version\",\n\t\tExample: `kustomize version`,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif short {\n\t\t\t\tfmt.Fprintln(w, provenance.GetProvenance().Short())\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(w, provenance.GetProvenance().Full())\n\t\t\t}\n\t\t},\n\t}\n\n\tversionCmd.Flags().BoolVar(&short, \"short\", false, \"short form\")\n\treturn &versionCmd\n}", "func newVersion() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"show build version\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tfmt.Println(version)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tArgs: cobra.NoArgs,\n\t\tShort: \"Print the stanza version\",\n\t\tRun: func(_ *cobra.Command, _ []string) {\n\t\t\tfmt.Println(version.GetVersion(), runtime.GOOS, runtime.GOARCH)\n\t\t},\n\t}\n}", "func versionCmd(c *cli.Context) error {\n\tif len(c.Args()) > 0 {\n\t\treturn errors.New(\"'buildah version' does not accept arguments\")\n\t}\n\n\t//converting unix time from string to int64\n\tbuildTime, err := strconv.ParseInt(buildInfo, 10, 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(\"Version: \", buildah.Version)\n\tfmt.Println(\"Go Version: \", runtime.Version())\n\tfmt.Println(\"Image Spec: \", ispecs.Version)\n\tfmt.Println(\"Runtime Spec: \", rspecs.Version)\n\tfmt.Println(\"CNI Spec: \", cniversion.Current())\n\tfmt.Println(\"libcni Version: \", cniVersion)\n\tfmt.Println(\"Git Commit: \", gitCommit)\n\n\t//Prints out the build time in readable format\n\tfmt.Println(\"Built: \", time.Unix(buildTime, 0).Format(time.ANSIC))\n\tfmt.Println(\"OS/Arch: \", runtime.GOOS+\"/\"+runtime.GOARCH)\n\n\treturn nil\n}", "func NewVersionCmd(cliName string) *cobra.Command {\n\tvar short bool\n\tversionCmd := cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: fmt.Sprintf(\"Print version information\"),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tversion := argocd.GetVersion()\n\t\t\tfmt.Printf(\"%s: %s\\n\", cliName, version)\n\t\t\tif short {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfmt.Printf(\" BuildDate: %s\\n\", version.BuildDate)\n\t\t\tfmt.Printf(\" GitCommit: %s\\n\", version.GitCommit)\n\t\t\tfmt.Printf(\" GitTreeState: %s\\n\", version.GitTreeState)\n\t\t\tif version.GitTag != \"\" {\n\t\t\t\tfmt.Printf(\" GitTag: %s\\n\", version.GitTag)\n\t\t\t}\n\t\t\tfmt.Printf(\" GoVersion: %s\\n\", version.GoVersion)\n\t\t\tfmt.Printf(\" Compiler: %s\\n\", version.Compiler)\n\t\t\tfmt.Printf(\" Platform: %s\\n\", version.Platform)\n\t\t},\n\t}\n\tversionCmd.Flags().BoolVar(&short, \"short\", false, \"print just the version number\")\n\treturn &versionCmd\n}", "func NewCmdVersion() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Show dmaas-operator version\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tshowVersion()\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Version for apisix-mesh-agent\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(version.String())\n\t\t},\n\t}\n\treturn cmd\n}", "func Version() cli.Command {\n\treturn cli.Command{\n\t\tName: \"version\",\n\t\tUsage: \"prints version information\",\n\t\tFlags: []cli.Flag{\n\t\t\tcli.BoolFlag{\n\t\t\t\tName: \"json\",\n\t\t\t\tUsage: \"specify this option to output data as JSON\",\n\t\t\t},\n\t\t},\n\t\tAction: func(c *cli.Context) error {\n\t\t\tisJSON := c.Bool(\"json\")\n\n\t\t\tinfo := versionInfo{\n\t\t\t\tCurator: curator.BuildRevision,\n\t\t\t\tJasper: curator.JasperChecksum,\n\t\t\t\tPoplarEvents: curator.PoplarEventsChecksum,\n\t\t\t\tPoplarRecorder: curator.PoplarRecorderChecksum,\n\t\t\t\tCedarMetrics: curator.CedarMetricsChecksum,\n\t\t\t}\n\t\t\tif isJSON {\n\t\t\t\tout, err := json.MarshalIndent(info, \"\", \" \")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"marshalling JSON\")\n\t\t\t\t}\n\t\t\t\tfmt.Println(string(out))\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tfmt.Println(info)\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func NewCmdVersion() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print Maya version information\",\n\t\tLong: `Print Maya version information for the current context\n\nExample:\nmaya version\n\t`,\n\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Version: %s\\n\", getVersion())\n\t\t\tfmt.Printf(\"Git commit: %s\", getGitCommit())\n\t\t\t//fmt.Printf(\"Git tree state: %s\\n\", GitTreeState)\n\t\t\tfmt.Printf(\"Go-Version: %s\\n\", runtime.Version())\n\t\t\tfmt.Printf(\"GOARCH: %s\\n\", runtime.GOARCH)\n\t\t\tfmt.Printf(\"GOOS: %s\\n\", runtime.GOOS)\n\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewVersionCmd() *cobra.Command {\n\tversionCmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the cli version\",\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tif version == \"\" {\n\t\t\t\tversion = \"latest\"\n\t\t\t}\n\n\t\t\tfmt.Fprint(os.Stdout, version)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn versionCmd\n}", "func NewCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"The version of matryoshka\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tfmt.Println(BuildCommit)\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func newVersionCommands(globalOpts *globalOptions) *cobra.Command {\n\toptions := &versionOptions{\n\t\tglobalOptions: globalOpts,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the CLI version information\",\n\t\tLong: versionDesc,\n\t\tExample: versionExample,\n\t\tArgs: cobra.ExactArgs(0),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn options.run()\n\t\t},\n\t}\n\n\toptions.addVersionFlags(cmd)\n\n\treturn cmd\n}", "func Version() *Command {\n\treturn &Command{\n\t\tCommand: &cobra.Command{\n\t\t\tUse: \"version\",\n\t\t\tShort: \"Show the current version\",\n\t\t\tLong: \"The `doctl version` command displays the version of the doctl software.\",\n\t\t\tGroupID: configureDoctlGroup,\n\t\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\t\tif doctl.Build != \"\" {\n\t\t\t\t\tdoctl.DoitVersion.Build = doctl.Build\n\t\t\t\t}\n\t\t\t\tif doctl.Major != \"\" {\n\t\t\t\t\ti, _ := strconv.Atoi(doctl.Major)\n\t\t\t\t\tdoctl.DoitVersion.Major = i\n\t\t\t\t}\n\t\t\t\tif doctl.Minor != \"\" {\n\t\t\t\t\ti, _ := strconv.Atoi(doctl.Minor)\n\t\t\t\t\tdoctl.DoitVersion.Minor = i\n\t\t\t\t}\n\t\t\t\tif doctl.Patch != \"\" {\n\t\t\t\t\ti, _ := strconv.Atoi(doctl.Patch)\n\t\t\t\t\tdoctl.DoitVersion.Patch = i\n\t\t\t\t}\n\t\t\t\tif doctl.Label != \"\" {\n\t\t\t\t\tdoctl.DoitVersion.Label = doctl.Label\n\t\t\t\t}\n\n\t\t\t\tvar output string\n\t\t\t\tif viper.GetString(\"output\") == \"json\" {\n\t\t\t\t\toutput = doctl.DoitVersion.CompleteJSON(&doctl.GithubLatestVersioner{})\n\t\t\t\t} else {\n\t\t\t\t\toutput = doctl.DoitVersion.Complete(&doctl.GithubLatestVersioner{})\n\t\t\t\t}\n\n\t\t\t\tfmt.Println(output)\n\t\t\t},\n\t\t},\n\t}\n}", "func CmdVersion(version string) *subcommands.Command {\n\treturn &subcommands.Command{\n\t\tUsageLine: \"version <options>\",\n\t\tShortDesc: \"prints version number\",\n\t\tLongDesc: \"Prints the tool version number.\",\n\t\tCommandRun: func() subcommands.CommandRun {\n\t\t\treturn &versionRun{version: version}\n\t\t},\n\t}\n}", "func versionCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the build version\",\n\t\tRun: func(*cobra.Command, []string) {\n\t\t\tversion.Write(os.Stdout)\n\t\t},\n\t}\n}", "func Command() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Display version number\",\n\t\tArgs: cobra.NoArgs,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Print(\"Elk 🦌\\n\")\n\t\t\tif len(version.version) > 0 {\n\t\t\t\tfmt.Printf(\" Version: \\t %s\\n\", version.version)\n\t\t\t}\n\n\t\t\tif len(version.commit) > 0 {\n\t\t\t\tfmt.Printf(\" Git Commit: \\t %s\\n\", version.commit)\n\t\t\t}\n\n\t\t\tif len(version.date) > 0 {\n\t\t\t\tfmt.Printf(\" Built: \\t %s\\n\", strings.Replace(version.date, \"_\", \" \", -1))\n\t\t\t}\n\n\t\t\tif (len(version.os) + len(version.arch)) > 0 {\n\t\t\t\tfmt.Printf(\" OS/Arch: \\t %s/%s\\n\", version.os, version.arch)\n\t\t\t}\n\n\t\t\tif len(version.goVersion) > 0 {\n\t\t\t\tfmt.Printf(\" Go Version: \\t %s\\n\", version.goVersion)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn cmd\n}", "func CommandVersion() {\n\tfmt.Printf(\n\t\t\"Version: %s\\nGit commit: %s\\nBuild date: %s\\n\",\n\t\tVERSION,\n\t\tGIT_COMMIT,\n\t\tBUILD_DATE,\n\t)\n}", "func (v *VersionCommand) Init(c *Cli) {\n\tv.cli = c\n\tv.cmd = &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print versions about Pouch CLI and Pouchd\",\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn v.runVersion()\n\t\t},\n\t\tExample: versionExample(),\n\t}\n\tv.addFlags()\n}", "func (p *plugin) cmdVersion(w irc.ResponseWriter, r *irc.Request, params cmd.ParamList) {\n\trev, _ := strconv.ParseInt(app.VersionRevision, 10, 64)\n\tstamp := time.Unix(rev, 0)\n\tutime := math.Abs(time.Since(lastRestart).Hours())\n\n\tvar upSince string\n\tif utime < 1 {\n\t\tupSince = util.Bold(\"<1\")\n\t} else {\n\t\tupSince = util.Bold(\"%.0f\", utime)\n\t}\n\n\tproto.PrivMsg(\n\t\tw, r.Target,\n\t\tTextVersionDisplay,\n\t\tr.SenderName,\n\t\tutil.Bold(app.Name),\n\t\tutil.Bold(\"%d.%d\", app.VersionMajor, app.VersionMinor),\n\t\tstamp.Format(TextDateFormat),\n\t\tstamp.Format(TextTimeFormat),\n\t\tupSince,\n\t)\n}", "func New(b BuildInfo) *Command {\n\tfs := flag.NewFlagSet(\"changelog\", flag.ExitOnError)\n\n\treturn &Command{\n\t\tfs: fs,\n\t\tb: b,\n\t\tfile: fs.String(fileOptName, dfltChangelogFile, \"changelog file name\"),\n\t\tdebug: fs.Bool(debugOptName, false, \"log debug information\"),\n\t\ttoStdOut: fs.Bool(stdOutOptName, false, \"output changelog to stdout instead to file\"),\n\t\thistory: fs.Bool(historyOptName, false, \"create history of old versions tags (output is always stdout)\"),\n\t\tignore: fs.Bool(ignoreOptName, false, \"ignore parsing errors of invalid (not conventional) commit messages\"),\n\t\tsinceTag: fs.String(sinceTagOptName, \"\", fmt.Sprintf(\"in combination with -%s: if a tag is specified, the changelog will be created from that tag on\", historyOptName)),\n\t\tinitConfig: fs.Bool(initDfltConfigOptName, false, fmt.Sprintf(\"initialize a default changelog configuration '%s'\", config.FileName)),\n\t\tnoPrompt: fs.Bool(noPromptOptName, false, \"do not prompt for next version\"),\n\t\tversion: fs.Bool(versionOptName, false, \"show program version information\"),\n\t\tnum: fs.Int(numOptName, 0, fmt.Sprintf(\"in combination with -%s: the number of tags to go back\", historyOptName)),\n\t}\n}", "func (r Describe) NewCommand(ctx context.Context, name string) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: name[strings.LastIndex(name, \".\")+1:] + \" [NAME[:VERSION]] [RESOURCE] [FILTER]\",\n\t\tShort: \"Describe registered releases with states information.\",\n\t\tLong: \"Describe registered releases with states information\",\n\t\tArgs: require.Args(r.validation),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tvar name string\n\t\t\tvar version semver.Version\n\t\t\tif len(args) > 0 {\n\t\t\t\tparts := strings.Split(args[0], \":\")\n\t\t\t\tparts = append(parts, \"\")\n\t\t\t\tname = parts[0]\n\n\t\t\t\tif parts[1] != \"\" {\n\t\t\t\t\tvar err error\n\t\t\t\t\tversion, err = semver.Parse(parts[1])\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar resource string\n\t\t\tif len(args) > 1 {\n\t\t\t\tresource = args[1]\n\t\t\t}\n\n\t\t\tvar filter string\n\t\t\tif len(args) > 2 {\n\t\t\t\tfilter = args[2]\n\t\t\t}\n\n\t\t\topts := describeOptions{\n\t\t\t\tName: name,\n\t\t\t\tVersion: version,\n\t\t\t\tResource: resource,\n\t\t\t\tFilter: filter,\n\t\t\t}\n\t\t\treturn r.run(ctx, cmd.OutOrStdout(), opts)\n\t\t},\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t}\n\n\tcmd.SetUsageTemplate(global.DefaultUsageTemplate)\n\tcmd.SetHelpCommand(&cobra.Command{Hidden: true})\n\n\tflags := cmd.Flags()\n\tflags.SortFlags = false\n\tflags.Bool(\"help\", false, \"Show help information.\")\n\treturn cmd\n}", "func (srv *Server) CmdVersion(stdin io.ReadCloser, stdout io.Writer, args ...string) error {\n\tfmt.Fprintf(stdout, \"Version:%s\\n\", VERSION)\n\treturn nil\n}", "func (v *VersionCommand) Init(c *Cli) {\n\tv.cli = c\n\n\tv.cmd = &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print version\",\n\t}\n}", "func CreateCmd() *cobra.Command {\n\tvar cmd = cobra.Command{\n\t\tUse: \"ch.viac\",\n\t\tShort: \"Import VIAC values from JSON files\",\n\t\tLong: `Open app.viac.ch, choose a portfolio, and select \"From start\" in the overview dash. In the Chrome dev tools, save the response from the \"performance\" XHR call, and pass the resulting file to this importer.`,\n\n\t\tArgs: cobra.ExactValidArgs(1),\n\n\t\tRunE: run,\n\t}\n\tcmd.Flags().StringP(\"from\", \"f\", \"0001-01-01\", \"YYYY-MM-DD - ignore entries before this date\")\n\tcmd.Flags().StringP(\"account\", \"a\", \"\", \"account name\")\n\treturn &cmd\n}", "func versionRun(cmd *cobra.Command, args []string) {\n\tprintKeyValue(\"Version: \", version)\n\tprintKeyValue(\"Commit: \", commit)\n\tprintKeyValue(\"Date: \", date)\n\tprintKeyValue(\"Author: \", author)\n\tprintKeyValue(\"Website: \", website)\n}", "func newBundleBuildCmd() *cobra.Command {\n\tbundleBuildCmd := &cobra.Command{\n\t\tUse: \"build\",\n\t\tShort: \"Build operator bundle image\",\n\t\tLong: `The \"opm alpha bundle build\" command will generate operator\nbundle metadata if needed and build bundle image with operator manifest\nand metadata for a specific version.\n\nFor example: The command will generate annotations.yaml metadata plus\nDockerfile for bundle image and then build a container image from\nprovided operator bundle manifests generated metadata\ne.g. \"quay.io/example/operator:v0.0.1\".\n\nAfter the build process is completed, a container image would be built\nlocally in docker and available to push to a container registry.\n\n$ opm alpha bundle build --directory /test/0.1.0/ --tag quay.io/example/operator:v0.1.0 \\\n\t--package test-operator --channels stable,beta --default stable --overwrite\n\nNote:\n* Bundle image is not runnable.\n* All manifests yaml must be in the same directory. `,\n\t\tRunE: buildFunc,\n\t\tArgs: cobra.NoArgs,\n\t}\n\n\tbundleBuildCmd.Flags().StringVarP(&buildDir, \"directory\", \"d\", \"\",\n\t\t\"The directory where bundle manifests and metadata for a specific version are located\")\n\tif err := bundleBuildCmd.MarkFlagRequired(\"directory\"); err != nil {\n\t\tlog.Fatalf(\"Failed to mark `directory` flag for `build` subcommand as required\")\n\t}\n\n\tbundleBuildCmd.Flags().StringVarP(&tag, \"tag\", \"t\", \"\",\n\t\t\"The image tag applied to the bundle image\")\n\tif err := bundleBuildCmd.MarkFlagRequired(\"tag\"); err != nil {\n\t\tlog.Fatalf(\"Failed to mark `tag` flag for `build` subcommand as required\")\n\t}\n\n\tbundleBuildCmd.Flags().StringVarP(&pkg, \"package\", \"p\", \"\",\n\t\t\"The name of the package that bundle image belongs to \"+\n\t\t\t\"(Required if `directory` is not pointing to a bundle in the nested bundle format)\")\n\n\tbundleBuildCmd.Flags().StringVarP(&channels, \"channels\", \"c\", \"\",\n\t\t\"The list of channels that bundle image belongs to\"+\n\t\t\t\"(Required if `directory` is not pointing to a bundle in the nested bundle format)\")\n\n\tbundleBuildCmd.Flags().StringVarP(&containerTool, \"image-builder\", \"b\", \"docker\",\n\t\t\"Tool used to manage container images. One of: [docker, podman, buildah]\")\n\n\tbundleBuildCmd.Flags().StringVarP(&defaultChannel, \"default\", \"e\", \"\",\n\t\t\"The default channel for the bundle image\")\n\n\tbundleBuildCmd.Flags().BoolVarP(&overwrite, \"overwrite\", \"o\", false,\n\t\t\"To overwrite annotations.yaml locally if existed. By default, overwrite is set to `false`.\")\n\n\tbundleBuildCmd.Flags().StringVarP(&outputDir, \"output-dir\", \"u\", \"\",\n\t\t\"Optional output directory for operator manifests\")\n\n\treturn bundleBuildCmd\n}", "func GetVersionCmd(version string, commit string) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: VersionCmdName,\n\t\tShort: VersionCmdShort,\n\t\tRun: func(*cobra.Command, []string) {\n\t\t\tif commit != \"\" {\n\t\t\t\tfmt.Println(fmt.Sprintf(\"%s (%s)\", version, commit))\n\t\t\t} else {\n\t\t\t\tfmt.Println(version)\n\t\t\t}\n\t\t},\n\t}\n}", "func NewCreateCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CreateCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog: log.GetInstance(),\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a new virtual cluster\",\n\t\tLong: `\n#######################################################\n################### vcluster create ###################\n#######################################################\nCreates a new virtual cluster\n\nExample:\nvcluster create test --namespace test\n#######################################################\n\t`,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\t// Check for newer version\n\t\t\tupgrade.PrintNewerVersionWarning()\n\n\t\t\treturn cmd.Run(cobraCmd, args)\n\t\t},\n\t}\n\n\tcobraCmd.Flags().StringVar(&cmd.ChartVersion, \"chart-version\", upgrade.GetVersion(), \"The virtual cluster chart version to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ChartName, \"chart-name\", \"vcluster\", \"The virtual cluster chart name to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ChartRepo, \"chart-repo\", \"https://charts.loft.sh\", \"The virtual cluster chart repo to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ReleaseValues, \"release-values\", \"\", \"Path where to load the virtual cluster helm release values from\")\n\tcobraCmd.Flags().StringVar(&cmd.K3SImage, \"k3s-image\", \"\", \"If specified, use this k3s image version\")\n\tcobraCmd.Flags().StringSliceVarP(&cmd.ExtraValues, \"extra-values\", \"f\", []string{}, \"Path where to load extra helm values from\")\n\tcobraCmd.Flags().BoolVar(&cmd.CreateNamespace, \"create-namespace\", true, \"If true the namespace will be created if it does not exist\")\n\tcobraCmd.Flags().BoolVar(&cmd.DisableIngressSync, \"disable-ingress-sync\", false, \"If true the virtual cluster will not sync any ingresses\")\n\tcobraCmd.Flags().BoolVar(&cmd.CreateClusterRole, \"create-cluster-role\", false, \"If true a cluster role will be created to access nodes, storageclasses and priorityclasses\")\n\tcobraCmd.Flags().BoolVar(&cmd.Expose, \"expose\", false, \"If true will create a load balancer service to expose the vcluster endpoint\")\n\tcobraCmd.Flags().BoolVar(&cmd.Connect, \"connect\", false, \"If true will run vcluster connect directly after the vcluster was created\")\n\treturn cobraCmd\n}", "func mkzversion(dir, file string) {\n\tout := fmt.Sprintf(\n\t\t\"// auto generated by go tool dist\\n\"+\n\t\t\t\"\\n\"+\n\t\t\t\"package runtime\\n\"+\n\t\t\t\"\\n\"+\n\t\t\t\"const defaultGoroot = `%s`\\n\"+\n\t\t\t\"const theVersion = `%s`\\n\"+\n\t\t\t\"const goexperiment = `%s`\\n\"+\n\t\t\t\"const stackGuardMultiplier = %d\\n\"+\n\t\t\t\"var buildVersion = theVersion\\n\", goroot_final, findgoversion(), os.Getenv(\"GOEXPERIMENT\"), stackGuardMultiplier())\n\n\twritefile(out, file, writeSkipSame)\n}", "func versionFlag(cmd *cobra.Command) {\n\tversion, err := cmd.Flags().GetBool(\"version\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\tif version {\n\t\tfmt.Printf(\"\\nversion: %s\\n\\nbuild: %s\\n\\n\",\n\t\t\tbuildVersion, buildDate)\n\t\tos.Exit(0)\n\t}\n}", "func NewGetAppVersionCmd(out io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"app-version\",\n\t\tShort: \"Get Application version\",\n\t\tLong: `Get Devops Application Version List`,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tc7nclient.InitClient(&clientConfig, &clientPlatformConfig)\n\t\t\terror := c7nclient.Client.CheckIsLogin()\n\t\t\tif error != nil {\n\t\t\t\tfmt.Println(error)\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr, userInfo := c7nclient.Client.QuerySelf(cmd.OutOrStdout())\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr = c7nclient.Client.SetProject(cmd.OutOrStdout(), userInfo.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr, pro := c7nclient.Client.GetProject(cmd.OutOrStdout(), userInfo.ID, proCode)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc7nclient.Client.ListAppVersions(cmd.OutOrStdout(), &appCode, pro.ID)\n\t\t},\n\t}\n\n\tcmd.Flags().StringVarP(&appCode, \"appCode\", \"c\", \"\", \"app code\")\n\tcmd.MarkFlagRequired(\"appCode\")\n\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\topts := &options{}\n\n\tcmd := &cobra.Command{\n\t\tUse: Name,\n\t\tShort: \"Launch the \" + Name,\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tverflag.PrintAndExitIfRequested()\n\n\t\t\tif err := opts.complete(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlog, err := logger.NewZapLogger(opts.config.LogLevel, opts.config.LogFormat)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error instantiating zap logger: %w\", err)\n\t\t\t}\n\n\t\t\tlogf.SetLogger(log)\n\t\t\tklog.SetLogger(log)\n\n\t\t\tlog.Info(\"Starting \"+Name, \"version\", version.Get())\n\t\t\tcmd.Flags().VisitAll(func(flag *pflag.Flag) {\n\t\t\t\tlog.Info(fmt.Sprintf(\"FLAG: --%s=%s\", flag.Name, flag.Value)) //nolint:logcheck\n\t\t\t})\n\n\t\t\t// don't output usage on further errors raised during execution\n\t\t\tcmd.SilenceUsage = true\n\t\t\t// further errors will be logged properly, don't duplicate\n\t\t\tcmd.SilenceErrors = true\n\n\t\t\treturn run(cmd.Context(), log, opts.config)\n\t\t},\n\t}\n\n\tflags := cmd.Flags()\n\tverflag.AddFlags(flags)\n\topts.addFlags(flags)\n\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\topts := &options{}\n\n\tcmd := &cobra.Command{\n\t\tUse: Name,\n\t\tShort: \"Launch the \" + Name,\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tverflag.PrintAndExitIfRequested()\n\n\t\t\tif err := opts.complete(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlog, err := logger.NewZapLogger(opts.config.LogLevel, opts.config.LogFormat)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error instantiating zap logger: %w\", err)\n\t\t\t}\n\n\t\t\tlogf.SetLogger(log)\n\t\t\tklog.SetLogger(log)\n\n\t\t\tlog.Info(\"Starting \"+Name, \"version\", version.Get())\n\t\t\tcmd.Flags().VisitAll(func(flag *pflag.Flag) {\n\t\t\t\tlog.Info(fmt.Sprintf(\"FLAG: --%s=%s\", flag.Name, flag.Value)) //nolint:logcheck\n\t\t\t})\n\n\t\t\t// don't output usage on further errors raised during execution\n\t\t\tcmd.SilenceUsage = true\n\t\t\t// further errors will be logged properly, don't duplicate\n\t\t\tcmd.SilenceErrors = true\n\n\t\t\treturn run(cmd.Context(), log, opts.config)\n\t\t},\n\t}\n\n\tflags := cmd.Flags()\n\tverflag.AddFlags(flags)\n\topts.addFlags(flags)\n\n\treturn cmd\n}", "func New(version string, command *command.Cmd) CLI {\n\tapp := app.App{\n\t\tName: path.Base(os.Args[0]),\n\t\tDescription: command.Description,\n\t\tVersionString: version,\n\t\tHasSubCmds: false,\n\t}\n\treturn mkNew(app, command)\n}", "func CreateCommand(ca *common.CommonArgs) *cobra.Command {\n\tvar c command\n\tc = command{\n\t\tCommand: cobra.Command{\n\t\t\tUse: \"run\",\n\t\t\tShort: \"run observes the state of tugboat.lauches\",\n\t\t\tArgs: cobra.NoArgs,\n\t\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\treturn c.preexecute(cmd, args)\n\t\t\t},\n\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\treturn c.execute(cmd, args)\n\t\t\t},\n\t\t},\n\t\tCommonArgs: ca,\n\t\thttpFlagMgr: httpcliflags.New(),\n\t\tk8sFlagMgr: cliflags.New(),\n\t\tnotificationsFlagMgr: notificationscliflags.New(),\n\t}\n\n\tflags := c.Flags()\n\n\tc.httpFlagMgr.ConfigureHttpFlag(flags)\n\tc.k8sFlagMgr.ConfigureKubernetesConfig(flags)\n\tc.notificationsFlagMgr.ConfigureListenersFlag(flags)\n\n\treturn common.TraverseRunHooks(&c.Command)\n}", "func NewCommand() (cmd *cobra.Command) {\n\tcmd = &cobra.Command{Use: \"binctl\", Run: func(cmd *cobra.Command, args []string) {\n\t\t//fmt.Println(\"Operate pipeline\")\n\t\t//fmt.Println(\"init binctl\")\n\t}}\n\tcmd.AddCommand(cmdMemory())\n\tcmd.AddCommand(cmdPipeline())\n\tcmd.PersistentFlags().String(\"config\", \"./configs/binlogo.yaml\", \"config file default is ./configs/binlogo.yaml\")\n\terr := viper.BindPFlag(\"config\", cmd.PersistentFlags().Lookup(\"config\"))\n\t// configs.InitViperFromFile(viper.GetString(\"config\"))\n\tconfigs.Init(viper.GetString(\"config\"))\n\t//etcd2.DefaultETCD()\n\tblog.Env(configs.Env(viper.GetString(\"env\")))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn\n}", "func BuildVersionString() string {\n\tprogram := \"k8s-device-plugin\"\n\n\tversion := \"v\" + CurrentVersion.String()\n\tif CommitHash != \"\" {\n\t\tversion += \"-\" + strings.ToUpper(CommitHash)\n\t}\n\n\tosArch := runtime.GOOS + \"/\" + runtime.GOARCH\n\n\tdate := BuildDate\n\tif date == \"\" {\n\t\tdate = \"unknown\"\n\t}\n\n\treturn fmt.Sprintf(\"%s %s %s BuildDate: %s\", program, version, osArch, date)\n\n}", "func newCreateCmd() *cobra.Command {\n\tcreateCmd := cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: `Create a new verless object`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Help()\n\t\t},\n\t}\n\n\tcreateCmd.AddCommand(newCreateProjectCmd())\n\tcreateCmd.AddCommand(newCreateThemeCmd())\n\tcreateCmd.AddCommand(newCreateFile())\n\n\treturn &createCmd\n}", "func CreateCommand() *cobra.Command {\n\treturn base.CreateCommand(\"template\", \"Create vt template from xml\", New())\n}", "func init() {\n\tcmd.Root.AddCommand(version)\n}", "func NewCmd(octaviusDaemon daemon.Client, fileUtil file.File) *cobra.Command {\n\tvar metadataFilePath string\n\n\tcreateCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create new octavius job metadata\",\n\t\tLong: \"This command helps create new job metadata to your CP host with proper metadata.json file\",\n\t\tExample: fmt.Sprintf(\"octavius create --job-path <filepath>/metadata.json\"),\n\t\tArgs: cobra.MaximumNArgs(0),\n\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\n\t\t\tprinter.Println(\"Creating a new job.\", color.FgBlack)\n\t\t\tmetadataFileIoReader, err := fileUtil.GetIoReader(metadataFilePath)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"error in reading file\")\n\t\t\t\tprinter.Println(fmt.Sprintf(\"error in reading file %v\", err.Error()), color.FgRed)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tclient := &client.GrpcClient{}\n\t\t\tres, err := octaviusDaemon.Post(metadataFileIoReader, client)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"error in creating metadata\")\n\t\t\t\tprinter.Println(fmt.Sprintf(\"error in creating metadata, %v\", status.Convert(err).Message()), color.FgRed)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlog.Info(fmt.Sprintf(\"%s job created\", res.Name))\n\t\t\tprinter.Println(fmt.Sprintf(\"%s job created\", res.Name), color.FgGreen)\n\t\t},\n\t}\n\tcreateCmd.Flags().StringVarP(&metadataFilePath, \"job-path\", \"\", \"\", \"path to metadata.json(required)\")\n\terr := createCmd.MarkFlagRequired(\"job-path\")\n\tif err != nil {\n\t\tlog.Error(err, \"error while setting the flag required\")\n\t\tprinter.Println(\"error while setting the flag required\", color.FgRed)\n\t\treturn nil\n\t}\n\treturn createCmd\n}", "func NewCommand(\n\tname string,\n\tdescription string,\n\tversion string,\n\tnameConvertFunc spec.AttributeNameConverterFunc,\n\ttypeConvertFunc spec.AttributeTypeConverterFunc,\n\ttypeMappingName string,\n\tgeneratorFunc func([]spec.SpecificationSet, string) error,\n) *cobra.Command {\n\n\tcobra.OnInitialize(func() {\n\t\tviper.SetEnvPrefix(name)\n\t\tviper.AutomaticEnv()\n\t\tviper.SetEnvKeyReplacer(strings.NewReplacer(\"-\", \"_\"))\n\t})\n\n\tvar rootCmd = &cobra.Command{\n\t\tUse: name,\n\t\tShort: description,\n\t}\n\n\trootCmd.PersistentFlags().StringP(\"out\", \"o\", \"codegen\", \"Default output path.\")\n\n\tvar versionCmd = &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the version and exit.\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(version)\n\t\t},\n\t}\n\n\tvar cmdFolderGen = &cobra.Command{\n\t\tUse: \"folder\",\n\t\tShort: \"Generate the model using a local directory containing the specs.\",\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn viper.BindPFlags(cmd.Flags())\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tif len(viper.GetStringSlice(\"dir\")) == 0 {\n\t\t\t\treturn errors.New(\"--dir is required\")\n\t\t\t}\n\n\t\t\tvar specSets []spec.SpecificationSet\n\n\t\t\tfor _, dir := range viper.GetStringSlice(\"dir\") {\n\t\t\t\tset, err := spec.LoadSpecificationSet(\n\t\t\t\t\tdir,\n\t\t\t\t\tnameConvertFunc,\n\t\t\t\t\ttypeConvertFunc,\n\t\t\t\t\ttypeMappingName,\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tspecSets = append(specSets, set)\n\t\t\t}\n\n\t\t\treturn generatorFunc(specSets, viper.GetString(\"out\"))\n\t\t},\n\t}\n\tcmdFolderGen.Flags().StringSliceP(\"dir\", \"d\", nil, \"Path of the specifications folder.\")\n\n\tvar githubGen = &cobra.Command{\n\t\tUse: \"github\",\n\t\tShort: \"Generate the model using a remote github repository.\",\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn viper.BindPFlags(cmd.Flags())\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tspecSet, err := spec.LoadSpecificationSetFromGithub(\n\t\t\t\tviper.GetString(\"token\"),\n\t\t\t\tviper.GetString(\"repo\"),\n\t\t\t\tviper.GetString(\"ref\"),\n\t\t\t\tviper.GetString(\"path\"),\n\t\t\t\tnameConvertFunc,\n\t\t\t\ttypeConvertFunc,\n\t\t\t\ttypeMappingName,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn generatorFunc([]spec.SpecificationSet{specSet}, viper.GetString(\"out\"))\n\t\t},\n\t}\n\tgithubGen.Flags().StringP(\"repo\", \"r\", \"\", \"Endpoint for the github api.\")\n\tgithubGen.Flags().StringP(\"path\", \"p\", \"\", \"Internal path to a directory in the repo if not in the root.\")\n\tgithubGen.Flags().StringP(\"ref\", \"R\", \"master\", \"Branch or tag to use.\")\n\tgithubGen.Flags().StringP(\"token\", \"t\", \"\", \"The api token to use.\")\n\n\trootCmd.AddCommand(\n\t\tversionCmd,\n\t\tcmdFolderGen,\n\t\tgithubGen,\n\t)\n\n\treturn rootCmd\n}", "func TestVersionCommand(t *testing.T) {\n\tt.Run(\"Tests if prints current version\", func(t *testing.T) {\n\t\tout, err := test.CaptureCommandOutput(versionCmd, nil)\n\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, fmt.Sprintf(\"%s\\n\", getVersion()), out)\n\t})\n}", "func Command() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Shows current version of kyverno.\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tfmt.Printf(\"Version: %s\\n\", version.Version())\n\t\t\tfmt.Printf(\"Time: %s\\n\", version.Time())\n\t\t\tfmt.Printf(\"Git commit ID: %s\\n\", version.Hash())\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func runVersion(cmd *cmd.Cmd, args []string) error {\n\tif len(args) != 0 {\n\t\treturn errVersionArgs\n\t}\n\n\tfmt.Printf(\"Gorot %s\\n\", gorot.Version)\n\n\treturn nil\n}", "func NewCmd(name, fullName string) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: name,\n\t\tShort: \"Print the version information\",\n\t\tLong: \"Print the version information\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"kam version %s\\n\", Version)\n\t\t},\n\t}\n}", "func buildVersion(short bool) string {\n\tvar b bytes.Buffer\n\tb.WriteString(\"MicroService-UserPowerManager v\" + MajorVersion + \".\" + MinorVersion)\n\t// versionStr := fmt.Sprintf(\"MicroService-UserPowerManager v%s.%s\",\n\t// \tMajorVersion, MinorVersion)\n\tif !IsRelease {\n\t\tb.WriteString(\" pre-release.\\n\")\n\t\tif !short {\n\t\t\tb.WriteString(PrereleaseBlurb + \"\\n\")\n\t\t}\n\t} else {\n\t\tb.WriteString(\" release.\\n\")\n\t}\n\tif short {\n\t\treturn b.String()\n\t}\n\tb.WriteString(Copyright + \"\\n\")\n\tb.WriteString(fmt.Sprintf(`Git Commit: %v\nGit Revision: %v\nGolang Build Version: %v\nBuild User: %v@%v\nBuild Status: %v\nBuild Time: %v\n`,\n\t\tbuildGitCommit,\n\t\tbuildGitRevision,\n\t\tbuildGolangVersion,\n\t\tbuildUser,\n\t\tbuildHost,\n\t\tbuildStatus,\n\t\tbuildTime))\n\tb.WriteString(GitHub + \"\\n\")\n\tb.WriteString(Issues + \"\\n\")\n\treturn b.String()\n}", "func versionRunner(cmd *cobra.Command, args []string) {\n\tfmt.Println(\"Passgen : Password generator for general purpose - v2\")\n}", "func newCommand(name, argsSpec, description string, init func(*flag.FlagSet), f func(*flag.FlagSet) error) command {\n\tfs := flag.NewFlagSet(name, flag.ExitOnError)\n\tinit(fs)\n\tif fs.Usage == nil {\n\t\tfs.Usage = func() {\n\t\t\tfmt.Fprintln(os.Stderr, \"#\", description)\n\t\t\tfmt.Fprintln(os.Stderr, name, argsSpec)\n\t\t\tfs.PrintDefaults()\n\t\t}\n\t}\n\treturn command{fs, f}\n}", "func Command() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Show the sensuctl version information\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tversion.Println(\"sensuctl\")\n\t\t},\n\t\tAnnotations: map[string]string{\n\t\t\thooks.ConfigurationRequirement: hooks.ConfigurationNotRequired,\n\t\t},\n\t}\n}", "func main() {\n\tlog.Printf(\"Build var 'version' is: %s\", version)\n\tlog.Printf(\"Build var 'time' is: %s\", buildDate)\n\tcmd.Execute()\n}", "func (r *ConfigAuditReportReconciler) buildCommand(workloadInfo string) string {\n\tworkloadInfos := strings.Split(workloadInfo, \"|\")\n\tworkloadType := workloadInfos[0]\n\tworkloadName := workloadInfos[1]\n\n\treturn \"starboard -n \" + r.NamespaceWatched + \" get report \" + workloadType + \"/\" + workloadName + \" > \" + buildReportName(workloadType, workloadName)\n}", "func NewCommand(in io.Reader, out io.Writer, err io.Writer) *cobra.Command {\n\toptions := icrbuild.NewBuildOptions(in, out, err)\n\tcmd := &cobra.Command{\n\t\tUse: \"icrbuild [DIRECTORY]\",\n\t\tShort: \"Build a Docker image in IBM Cloud Container Registry using builder contract\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tLong: `\n `,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := options.Run(cmd, args)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t},\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := setUpLogs(err); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcmd.SilenceUsage = true\n\t\t\tlogrus.Infof(\"icrbuild %+v\", version.Get())\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Version = fmt.Sprintf(\"%+v\", version.Get())\n\tcmd.SetVersionTemplate(\"{{printf .Version}}\\n\")\n\n\t//\t[--no-cache] [--pull] [--quiet | -q] [--build-arg KEY=VALUE ...] [--file FILE | -f FILE] --tag TAG DIRECTORY\n\tcmd.PersistentFlags().BoolVar(&options.Flags.NoCache, \"no-cache\", false, \"Optional: If specified, cached image layers from previous builds are not used in this build.\")\n\tcmd.PersistentFlags().BoolVar(&options.Flags.Pull, \"pull\", false, \"Optional: If specified, the base images are pulled even if an image with a matching tag already exists on the build host.\")\n\tcmd.PersistentFlags().BoolVarP(&options.Flags.Quiet, \"quiet\", \"q\", false, \"Optional: If specified, the build output is suppressed unless an error occurs.\")\n\tcmd.PersistentFlags().StringArrayVar(&options.Flags.BuildArgs, \"build-arg\", nil, \"Optional: Specify an additional build argument in the format 'KEY=VALUE'. The value of each build argument is available as an environment variable when you specify an ARG line that matches the key in your Dockerfile.\")\n\tcmd.PersistentFlags().StringVarP(&options.Flags.File, \"file\", \"f\", \"\", \"Optional: Specify the location of the Dockerfile relative to the build context. If not specified, the default is 'PATH/Dockerfile', where PATH is the root of the build context.\")\n\tcmd.PersistentFlags().StringVarP(&options.Flags.Tag, \"tag\", \"t\", \"\", \"The full name for the image that you want to build, which includes the registry URL and namespace.\")\n\tcmd.MarkFlagRequired(\"tag\")\n\n\treturn cmd\n}", "func CreateCommand(s string) Command {\n\tfmt.Println(\"Creating command\")\n\n\treturn &ConsoleOutput{\n\t\tmessage: s,\n\t}\n}", "func Command(app *kingpin.Application) {\n\tcmd := new(cmdVersion)\n\tapp.Command(\"version\", fmt.Sprintf(\"Prints %s version\", app.Name)).Action(cmd.run)\n}", "func createCommand() cli.Command {\n\treturn cli.Command{\n\t\tName: \"create\",\n\t\tBefore: survey.RequireGlobalFlagsFunc(requiredFlags...),\n\t\tAction: create(),\n\t}\n}", "func CreateConsensusAuthCoinInfoCmd(cli *client.CommandLineClient) error {\n\tbc, err := client.NewLazyBaseClientFromCommandLineClient(cli)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcreateAuthCoinCmd(cli, NewPluginConsensusClient(bc), cli.ConsensusCmd)\n\treturn nil\n}", "func CreateParamsCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"zk\",\n\t\tShort: \"zk knowledge related parameters\",\n\t}\n\tcmd.AddCommand(mixCreateZkKeyCmd())\n\tcmd.AddCommand(mixReadZkKeyCmd())\n\n\treturn cmd\n}", "func createCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a Windows instance on the same provider as the existing OpenShift Cluster.\",\n\t\tLong: \"creates a Windows instance under the same virtual network (AWS-VCP, Azure-Vnet, \" +\n\t\t\t\"and etc.) used by a given OpenShift cluster running on the selected provider. \" +\n\t\t\t\"The created instance would be ready to join the OpenShift Cluster as a worker node.\",\n\t\tPreRunE: func(cmd *cobra.Command, _ []string) error {\n\t\t\treturn validateCreateFlags(cmd)\n\t\t},\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\tcloud, err := cloudprovider.CloudProviderFactory(rootInfo.kubeconfigPath, rootInfo.credentialPath,\n\t\t\t\trootInfo.credentialAccountID, rootInfo.resourceTrackerDir)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating cloud provider clients, %v\", err)\n\t\t\t}\n\t\t\terr = cloud.CreateWindowsVM(createFlagInfo.imageID, createFlagInfo.instanceType, createFlagInfo.sshKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating Windows Instance, %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.imageID, \"image-id\", \"\",\n\t\t\"ami ID of a base image for the instance (i.e.\"+\n\t\t\t\": ami-06a4e829b8bbad61e for Microsoft Windows Server 2019 Base image on AWS). (required)\")\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.instanceType, \"instance-type\", \"\",\n\t\t\"name of a type of instance (i.e.: m4.large for AWS, etc). (required)\")\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.sshKey, \"ssh-key\", \"\",\n\t\t\"name of existing ssh key on cloud provider for accessing the instance after it is created. (required)\")\n\treturn cmd\n}", "func NewCmdURLCreate(name, fullName string) *cobra.Command {\n\to := NewURLCreateOptions()\n\turlCreateCmd := &cobra.Command{\n\t\tUse: name + \" [url name]\",\n\t\tShort: urlCreateShortDesc,\n\t\tLong: urlCreateLongDesc,\n\t\tExample: fmt.Sprintf(urlCreateExample, fullName),\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tgenericclioptions.GenericRun(o, cmd, args)\n\t\t},\n\t}\n\turlCreateCmd.Flags().IntVarP(&o.urlPort, \"port\", \"\", -1, \"Port number for the url of the component, required in case of components which expose more than one service port\")\n\t// if experimental mode is enabled, add more flags to support ingress creation or docker application based on devfile\n\to.isExperimental = experimental.IsExperimentalModeEnabled()\n\tif o.isExperimental {\n\t\to.isDocker = pushtarget.IsPushTargetDocker()\n\t\tif o.isDocker {\n\t\t\turlCreateCmd.Flags().IntVarP(&o.exposedPort, \"exposed-port\", \"\", -1, \"External port to the application container\")\n\t\t\turlCreateCmd.Flags().BoolVarP(&o.forceFlag, \"force\", \"f\", false, \"Don't ask for confirmation, assign an exposed port directly\")\n\t\t\turlCreateCmd.Example = fmt.Sprintf(urlCreateExampleDocker, fullName)\n\t\t} else {\n\t\t\turlCreateCmd.Flags().StringVar(&o.tlsSecret, \"tls-secret\", \"\", \"TLS secret name for the url of the component if the user bring their own TLS secret\")\n\t\t\turlCreateCmd.Flags().StringVarP(&o.host, \"host\", \"\", \"\", \"Cluster IP for this URL\")\n\t\t\turlCreateCmd.Flags().BoolVarP(&o.secureURL, \"secure\", \"\", false, \"Create a secure HTTPS URL\")\n\t\t\turlCreateCmd.Flags().BoolVar(&o.wantIngress, \"ingress\", false, \"Create an Ingress instead of Route on OpenShift clusters\")\n\t\t\turlCreateCmd.Example = fmt.Sprintf(urlCreateExampleExperimental, fullName)\n\t\t}\n\t} else {\n\t\turlCreateCmd.Flags().BoolVarP(&o.secureURL, \"secure\", \"\", false, \"Create a secure HTTPS URL\")\n\t\turlCreateCmd.Example = fmt.Sprintf(urlCreateExample, fullName)\n\t}\n\tgenericclioptions.AddNowFlag(urlCreateCmd, &o.now)\n\to.AddContextFlag(urlCreateCmd)\n\tcompletion.RegisterCommandFlagHandler(urlCreateCmd, \"context\", completion.FileCompletionHandler)\n\n\treturn urlCreateCmd\n}", "func initVersionInfo() {\n\tversion.Version = pmmVersion.Version\n\tversion.Revision = pmmVersion.FullCommit\n\tversion.Branch = pmmVersion.Branch\n\n\tif buildDate, err := strconv.ParseInt(pmmVersion.Timestamp, 10, 64); err != nil {\n\t\tversion.BuildDate = time.Unix(0, 0).Format(versionDataFormat)\n\t} else {\n\t\tversion.BuildDate = time.Unix(buildDate, 0).Format(versionDataFormat)\n\t}\n\n\tif pmmVersion.PMMVersion != \"\" {\n\t\tversion.Version += \"-pmm-\" + pmmVersion.PMMVersion\n\t\tkingpin.Version(pmmVersion.FullInfo())\n\t} else {\n\t\tkingpin.Version(version.Print(program))\n\t}\n\n\tkingpin.HelpFlag.Short('h')\n\tkingpin.CommandLine.Help = fmt.Sprintf(\"%s exports various MongoDB metrics in Prometheus format.\\n\", pmmVersion.ShortInfo())\n}", "func (opts *Options) CreateCommand() string {\n\tparts := []string{\"openssl pkcs12 -export\"}\n\treturn opts.Stringify(parts)\n}", "func buildInfo(c *cli.Context) error {\n\trepo := c.Args().First()\n\towner, name, err := parseRepo(repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnumber, err := strconv.Atoi(c.Args().Get(1))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient, err := newClient(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbuild, err := client.Build(owner, name, number)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttmpl, err := template.New(\"_\").Parse(c.String(\"format\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn tmpl.Execute(os.Stdout, build)\n}", "func NewCommand(out io.Writer, fs fs.FileSystem, rf *resmap.Factory, ptf transformer.Factory) *cobra.Command {\n\tops := NewCommandOptions()\n\n\tcmd := &cobra.Command{\n\t\tUse: \"build [path]\",\n\t\tShort: \"Print current configuration per contents of \" + constants.KustomizationFileName,\n\t\tExample: examples,\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\terr := ops.Validate(args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn ops.Run(out, fs, rf, ptf)\n\t\t},\n\t}\n\n\tops.SetFlags(cmd.Flags())\n\n\treturn cmd\n}", "func NewCommand(version string) *cobra.Command {\n\trootCommand := &cobra.Command{\n\t\tUse: name,\n\t\tVersion: version,\n\t}\n\trootCommand.SetOut(logrus.New().Out)\n\n\tfor _, sourceProvider := range source.GetProviderList() {\n\t\tsourceCmd := &cobra.Command{\n\t\t\tUse: sourceProvider.Name(),\n\t\t\tShort: fmt.Sprintf(`Fetch data from source \"%s\"`, sourceProvider.Name()),\n\t\t}\n\t\tif sourceProvider.Deprecated() {\n\t\t\tsourceCmd.Deprecated = fmt.Sprintf(`source \"%s\" is deprecated`, sourceProvider.Name())\n\t\t}\n\t\tfor _, registryProvider := range registry.GetProviderList() {\n\t\t\tregistryCmd := &cobra.Command{\n\t\t\t\tUse: registryProvider.Name(),\n\t\t\t\tShort: fmt.Sprintf(`Save data in registry \"%s\"`, registryProvider.Name()),\n\t\t\t}\n\t\t\tif registryProvider.Deprecated() {\n\t\t\t\tregistryCmd.Deprecated = fmt.Sprintf(`registry \"%s\" is deprecated`, registryProvider.Name())\n\t\t\t}\n\t\t\tonceCommand := &cobra.Command{\n\t\t\t\tUse: `once`,\n\t\t\t\tShort: `Run main process only once: sync and return result`,\n\t\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\t\tmanager, cleanup, err := newManager(cmd.Flags(), sourceProvider.Factory(), registryProvider.Factory())\n\t\t\t\t\tif cleanup != nil {\n\t\t\t\t\t\tcleanup()\n\t\t\t\t\t}\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn errors.Wrap(err, `failed to bootstrap manager`)\n\t\t\t\t\t}\n\t\t\t\t\treturn manager.Run(cmd.Context())\n\t\t\t\t},\n\t\t\t}\n\t\t\twatchCommand := &cobra.Command{\n\t\t\t\tUse: `watch`,\n\t\t\t\tShort: `Run main process as daemon: sync repeatedly with constant interval`,\n\t\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\t\tsc, cleanup, err := newScheduler(cmd.Flags(), sourceProvider.Factory(), registryProvider.Factory())\n\t\t\t\t\tif cleanup != nil {\n\t\t\t\t\t\tcleanup()\n\t\t\t\t\t}\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn errors.Wrap(err, `failed to bootstrap scheduler`)\n\t\t\t\t\t}\n\t\t\t\t\tsc.Run(cmd.Context())\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t}\n\t\t\twatchCommand.Flags().Duration(`scheduler.interval`, time.Minute, `Interval between manager runs (1s, 1m, 5m, 1h and others)`)\n\t\t\tregistryCmd.PersistentFlags().Bool(`manager.continue-on-error`, false, `Omit errors during process manager`)\n\t\t\tregistryCmd.PersistentFlags().Bool(`manager.exit-on-error`, false, `Stop manager process on first error and by pass it to command line`)\n\t\t\t_ = registryCmd.PersistentFlags().MarkDeprecated(`manager.continue-on-error`, `Flag \"manager.continue-on-error\" is deprecated, use \"manager.exit-on-error\" instead`)\n\t\t\t_ = registryCmd.PersistentFlags().MarkHidden(`manager.continue-on-error`)\n\t\t\tregistryCmd.PersistentFlags().AddFlagSet(registryProvider.Flags())\n\t\t\tregistryCmd.AddCommand(onceCommand)\n\t\t\tregistryCmd.AddCommand(watchCommand)\n\t\t\tsourceCmd.AddCommand(registryCmd)\n\t\t}\n\t\tsourceCmd.PersistentFlags().AddFlagSet(sourceProvider.Flags())\n\t\trootCommand.AddCommand(sourceCmd)\n\t}\n\trootCommand.PersistentFlags().String(`logger.level`, logrus.InfoLevel.String(), `Log level`)\n\treturn rootCommand\n}", "func New(buildRevision, buildTime string) *cobra.Command {\n\trootCmd := &cobra.Command{\n\t\tUse: \"iris-cli\",\n\t\tShort: \"Command Line Interface for Iris\",\n\t\tLong: `Iris CLI is a tool for Iris Web Framework.\nIt can be used to install starter kits and project structures \nComplete documentation is available at https://github.com/kataras/iris-cli`,\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t\tTraverseChildren: true,\n\t\tSuggestionsMinimumDistance: 1,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t},\n\t}\n\n\thelpTemplate := HelpTemplate{\n\t\tBuildRevision: buildRevision,\n\t\tBuildTime: buildTime,\n\t\tShowGoRuntimeVersion: true,\n\t}\n\trootCmd.SetHelpTemplate(helpTemplate.String())\n\n\t// Commands.\n\trootCmd.AddCommand(newCommand())\n\trootCmd.AddCommand(runCommand())\n\trootCmd.AddCommand(addCommand())\n\n\treturn rootCmd\n}", "func createCommand(ctx context.Context, cmdline []string, env env) commander {\n\tlogrus.Debugf(\"command: %v (env: %s)\", cmdline, env)\n\tcmd := exec.CommandContext(ctx, cmdline[0], cmdline[1:]...)\n\tcmd.Env = env.AsPairs()\n\treturn cmd\n}", "func NewRevisionListCommand(p *commands.KnParams) *cobra.Command {\n\trevisionListFlags := flags.NewListPrintFlags(RevisionListHandlers)\n\n\trevisionListCommand := &cobra.Command{\n\t\tUse: \"list\",\n\t\tShort: \"List revisions\",\n\t\tAliases: []string{\"ls\"},\n\t\tLong: \"List revisions for a given service.\",\n\t\tExample: `\n # List all revisions\n kn revision list\n\n # List revisions for a service 'svc1' in namespace 'myapp'\n kn revision list -s svc1 -n myapp\n\n # List all revisions in JSON output format\n kn revision list -o json\n\n # List revision 'web'\n kn revision list web`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tnamespace, err := p.GetNamespace(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tclient, err := p.NewServingClient(namespace)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Create list filters\n\t\t\tvar params []clientservingv1.ListConfig\n\t\t\tparams, err = appendServiceFilter(params, client, cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparams, err = appendRevisionNameFilter(params, args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Query for list with filters\n\t\t\trevisionList, err := client.ListRevisions(cmd.Context(), params...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Stop if nothing found\n\t\t\tif !revisionListFlags.GenericPrintFlags.OutputFlagSpecified() && len(revisionList.Items) == 0 {\n\t\t\t\tfmt.Fprintf(cmd.OutOrStdout(), \"No revisions found.\\n\")\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// Add namespace column if no namespace is given (i.e. \"--all-namespaces\" option is given)\n\t\t\tif namespace == \"\" {\n\t\t\t\trevisionListFlags.EnsureWithNamespace()\n\t\t\t}\n\n\t\t\t// Only add temporary annotations if human readable output is requested\n\t\t\tif !revisionListFlags.GenericPrintFlags.OutputFlagSpecified() {\n\t\t\t\terr = enrichRevisionAnnotationsWithServiceData(cmd.Context(), p.NewServingClient, revisionList)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Sort revisions by namespace, service, generation (in this order)\n\t\t\tsortRevisions(revisionList)\n\n\t\t\t// Print out infos via printer framework\n\t\t\treturn revisionListFlags.Print(revisionList, cmd.OutOrStdout())\n\t\t},\n\t}\n\tcommands.AddNamespaceFlags(revisionListCommand.Flags(), true)\n\trevisionListFlags.AddFlags(revisionListCommand)\n\trevisionListCommand.Flags().StringVarP(&serviceNameFilter, \"service\", \"s\", \"\", \"Service name\")\n\n\treturn revisionListCommand\n}", "func versionString() string {\n\tvar version string\n\tif SHA != \"\" {\n\t\tversion = fmt.Sprintf(\"%s (%s)\", Version, SHA)\n\t} else {\n\t\tversion = fmt.Sprintf(\"%s-dev\", Version) // no SHA. '0.x.y-dev' indicates it is run from source without build script.\n\t}\n\tif BuildTime != \"\" {\n\t\ti, err := strconv.ParseInt(BuildTime, 10, 64)\n\t\tif err == nil {\n\t\t\ttm := time.Unix(i, 0)\n\t\t\tversion += fmt.Sprintf(\" built %s\", tm.Format(time.RFC822))\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"dnscontrol %s\", version)\n}", "func createCommand(t *runner.Task, actionFunc func(*cli.Context) error) *cli.Command {\n\tcommand := &cli.Command{\n\t\tName: t.Name,\n\t\tUsage: strings.TrimSpace(t.Usage),\n\t\tDescription: strings.TrimSpace(t.Description),\n\t\tAction: actionFunc,\n\t}\n\n\tfor _, arg := range t.Args {\n\t\tcommand.ArgsUsage += fmt.Sprintf(\"<%s> \", arg.Name)\n\t}\n\n\tcommand.CustomHelpTemplate = createCommandHelp(t)\n\n\treturn command\n}", "func (c *Command) VersionCommand() *version.Command {\n\treturn c.versionCommand\n}", "func NewWithSubCmds(\n\tdescription string,\n\tversion string,\n\tcommand1 *command.Cmd,\n\tcommandsN ...*command.Cmd,\n) CLI {\n\tapp := app.App{\n\t\tName: path.Base(os.Args[0]),\n\t\tDescription: description,\n\t\tVersionString: version,\n\t\tHasSubCmds: true,\n\t}\n\treturn mkNew(app, append([]*command.Cmd{command1}, commandsN...)...)\n}", "func BuildCmdArgs(cmd *cobra.Command, msg string) string {\n\tvar ans string = \"mottainai-cli \"\n\n\tif cmd == nil {\n\t\tpanic(\"Invalid command\")\n\t}\n\n\tif cmd.Flag(\"master\").Changed {\n\t\tans += \"--master \" + v.GetString(\"master\") + \" \"\n\t}\n\tif v.GetString(\"profile\") != \"\" {\n\t\tans += \"--profile \" + v.GetString(\"profile\") + \" \"\n\t}\n\n\tans += msg\n\n\treturn ans\n}", "func runReleaseCmd(cmd *cobra.Command, args []string) {\n\tconfigFile, _ := cmd.Flags().GetString(\"config\")\n\tconfig := &config.Config{}\n\terr := config.Load(configFile)\n\tif err != nil {\n\t\tfmt.Printf(\"could not load config file: %v\\n\", err)\n\t\tos.Exit(1)\n\t\treturn\n\t}\n\n\tspinner, err := initSpinner(fmt.Sprintf(\"Releasing v%s of %s\", args[0], config.Repository))\n\tif err != nil {\n\t\tfmt.Println(\"could not init spinner\")\n\t\tos.Exit(1)\n\t\treturn\n\t}\n\tspinner.Start()\n\n\tnewRelease, err := github.NewRelease(config, args, spinner)\n\tif err != nil {\n\t\tspinner.StopFailMessage(fmt.Sprintf(\"%v\", err))\n\t\tspinner.StopFail()\n\t\tos.Exit(1)\n\t\treturn\n\t}\n\n\tcl, err := changelog.HandleChangelog(newRelease.ProjectName, newRelease.Version, newRelease.Date, spinner)\n\tif err != nil {\n\t\tspinner.StopFailMessage(fmt.Sprintf(\"%v\", err))\n\t\tspinner.StopFail()\n\t\tos.Exit(1)\n\t\treturn\n\t}\n\n\tnewRelease.Changelog = cl\n\n\tvar binaryPath string\n\tskipBinary, _ := cmd.Flags().GetBool(\"skipBinary\")\n\tif !skipBinary {\n\t\t// set project build path so we have a predictable location\n\t\tbinaryPath = fmt.Sprintf(binaryPathFmt, newRelease.ProjectName, newRelease.Version)\n\t\trunBuildCmd(cmd, []string{newRelease.Version, binaryPath})\n\t}\n\n\ttokenFile, _ := cmd.Flags().GetString(\"tokenFile\")\n\terr = newRelease.CreateGithubRelease(tokenFile, binaryPath, spinner)\n\tif err != nil {\n\t\tspinner.StopFailMessage(fmt.Sprintf(\"%v\", err))\n\t\tspinner.StopFail()\n\t\tos.Exit(1)\n\t\treturn\n\t}\n\n\tspinner.Suffix(\" Finished release\")\n\tspinner.Stop()\n}", "func NewCmdTag(f cmdutil.Factory) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"tag\",\n\t\tAliases: []string{\"tags\"},\n\t\tShort: \"List tags on Clockify\",\n\t\tExample: heredoc.Docf(`\n\t\t\t$ %[1]s\n\t\t\t+--------------------------+------------------+\n\t\t\t| ID | NAME |\n\t\t\t+--------------------------+------------------+\n\t\t\t| 62194867edaba27d0a45b464 | Code Review |\n\t\t\t| 6219485e8cb9606d934ebb5f | Meeting |\n\t\t\t| 621948708cb9606d934ebba7 | Pair Programming |\n\t\t\t| 6143b768195e5c503960a775 | Special Tag |\n\t\t\t+--------------------------+------------------+\n\n\t\t\t$ %[1]s --name code -q\n\t\t\t62194867edaba27d0a45b464\n\n\t\t\t$ %[1]s --format \"{{.Name}}\" -archived\n\t\t\tArchived Tag\n\t\t`, \"clockify-cli tag\"),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tformat, _ := cmd.Flags().GetString(\"format\")\n\t\t\tquiet, _ := cmd.Flags().GetBool(\"quiet\")\n\t\t\tif err := cmdutil.XorFlag(map[string]bool{\n\t\t\t\t\"format\": format != \"\",\n\t\t\t\t\"quiet\": quiet,\n\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tarchived, _ := cmd.Flags().GetBool(\"archived\")\n\t\t\tname, _ := cmd.Flags().GetString(\"name\")\n\n\t\t\ttags, err := getTags(f, name, archived)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tout := cmd.OutOrStdout()\n\t\t\tif format != \"\" {\n\t\t\t\treturn output.TagPrintWithTemplate(format)(tags, out)\n\t\t\t}\n\n\t\t\tif quiet {\n\t\t\t\treturn output.TagPrintQuietly(tags, out)\n\t\t\t}\n\n\t\t\treturn output.TagPrint(tags, os.Stdout)\n\t\t},\n\t}\n\n\tcmd.Flags().StringP(\"name\", \"n\", \"\",\n\t\t\"will be used to filter the tag by name\")\n\tcmd.Flags().StringP(\"format\", \"f\", \"\",\n\t\t\"golang text/template format to be applied on each Tag\")\n\tcmd.Flags().BoolP(\"quiet\", \"q\", false, \"only display ids\")\n\tcmd.Flags().BoolP(\"archived\", \"\", false, \"only display archived tags\")\n\n\treturn cmd\n}", "func version() {\n fmt.Printf(\"v%s\\ncommit=%s\\n\", versionNumber, commitId)\n}", "func NewCreateCommand(c2ClientFactory cli.APIClientFactory) cli.Command {\n\tcreateCmd := &createCommand{\n\t\tc2ClientFactory: c2ClientFactory,\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Creates a new client\",\n\t\tLong: fmt.Sprintf(\"Creates a new client, require an unique name, and a file containing either a password or a %d bytes key\", e4crypto.KeyLen),\n\t\tRunE: createCmd.run,\n\t}\n\n\tcobraCmd.Flags().SortFlags = false\n\tcobraCmd.Flags().StringVar(&createCmd.flags.Name, \"name\", \"\", \"The client name\")\n\tcobraCmd.Flags().StringVar(&createCmd.flags.KeyPath, \"key\", \"\", fmt.Sprintf(\"Filepath to a %d bytes key\", e4crypto.KeyLen))\n\tcobraCmd.Flags().StringVar(&createCmd.flags.PasswordPath, \"password\", \"\", \"Filepath to a plaintext password file\")\n\n\tcreateCmd.cobraCmd = cobraCmd\n\n\treturn createCmd\n}", "func Register(root *cobra.Command) {\n\troot.AddCommand(\n\t\t&cobra.Command{\n\t\t\tUse: \"version\",\n\t\t\tShort: \"Print the version of OpenFlag\",\n\t\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\t\tcmd.Println(version.String())\n\t\t\t},\n\t\t},\n\t)\n}", "func newManifestCmd(rootParams *rootParameters) *cobra.Command {\n\tmanifestParams := manifestParameters{rootParameters: rootParams}\n\tcmd := &cobra.Command{\n\t\tUse: \"manifest\",\n\t\tShort: \"Manage manifests inside a repository\",\n\t\tLong: newManifestCmdLongMessage,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcmd.Help()\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tlistManifestCmd := newManifestListCmd(&manifestParams)\n\tdeleteManifestCmd := newManifestDeleteCmd(&manifestParams)\n\n\tcmd.AddCommand(\n\t\tlistManifestCmd,\n\t\tdeleteManifestCmd,\n\t)\n\tcmd.PersistentFlags().StringVar(&manifestParams.repoName, \"repository\", \"\", \"The repository name\")\n\t// Since the repository will be needed in either subcommand it is marked as a required flag\n\tcmd.MarkPersistentFlagRequired(\"repository\")\n\n\treturn cmd\n}", "func NewVersionInfo() VersionInfo {\n\tver := VersionInfo{\n\t\tVersion: \"dev\",\n\t\tBuildDate: BuildDate,\n\t\tGitCommit: GitCommit,\n\t\tGitState: \"\",\n\t}\n\tif Version != \"\" {\n\t\tver.Version = Version\n\t\tver.GitState = \"clean\"\n\t}\n\tif GitState != \"\" {\n\t\tver.GitState = GitState\n\t}\n\treturn ver\n}", "func Main() *cobra.Command {\n\tcreateCmd := preview.NewCmdPreviewLegacy()\n\n\tcmd := &cobra.Command{\n\t\tUse: rootcmd.TopLevelCommand,\n\t\tShort: \"Preview commands\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif len(args) <= 1 {\n\t\t\t\tlog.Logger().Info(\"aliasing this to the create command\")\n\t\t\t\terr := createCmd.ParseFlags(args)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Logger().Errorf(err.Error())\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tcreateCmd.Run(cmd, args)\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr := cmd.Help()\n\t\t\tif err != nil {\n\t\t\t\tlog.Logger().Errorf(err.Error())\n\t\t\t}\n\t\t},\n\t\tDisableFlagParsing: true,\n\t}\n\tcmd.AddCommand(createCmd)\n\tcmd.AddCommand(cobras.SplitCommand(version.NewCmdVersion()))\n\treturn cmd\n}", "func SetVersion(version string) {\n\trootCmd.Cmd.Version = version\n}", "func NewGenerateCmd() (*cobra.Command, error) {\n\tgenerateCmd := &cobra.Command{\n\t\tUse: \"generate\",\n\t\tShort: \"Generate a Lockfile to track image digests\",\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn bindPFlags(cmd, []string{\n\t\t\t\t\"base-dir\",\n\t\t\t\t\"dockerfiles\",\n\t\t\t\t\"composefiles\",\n\t\t\t\t\"kubernetesfiles\",\n\t\t\t\t\"lockfile-name\",\n\t\t\t\t\"dockerfile-globs\",\n\t\t\t\t\"composefile-globs\",\n\t\t\t\t\"kubernetesfile-globs\",\n\t\t\t\t\"dockerfile-recursive\",\n\t\t\t\t\"composefile-recursive\",\n\t\t\t\t\"kubernetesfile-recursive\",\n\t\t\t\t\"exclude-all-dockerfiles\",\n\t\t\t\t\"exclude-all-composefiles\",\n\t\t\t\t\"exclude-all-kubernetesfiles\",\n\t\t\t\t\"ignore-missing-digests\",\n\t\t\t\t\"update-existing-digests\",\n\t\t\t})\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tflags, err := parseFlags()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tgenerator, err := SetupGenerator(flags)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tvar lockfileByt bytes.Buffer\n\n\t\t\terr = generator.GenerateLockfile(&lockfileByt)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlockfileContents := lockfileByt.Bytes()\n\n\t\t\tif len(lockfileContents) == 0 {\n\t\t\t\treturn errors.New(\"no images found\")\n\t\t\t}\n\n\t\t\twriter, err := os.Create(\n\t\t\t\tflags.FlagsWithSharedValues.LockfileName,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer writer.Close()\n\n\t\t\t_, err = writer.Write(lockfileContents)\n\t\t\tif err == nil {\n\t\t\t\tfmt.Println(\"successfully generated lockfile!\")\n\t\t\t}\n\n\t\t\treturn err\n\t\t},\n\t}\n\tgenerateCmd.Flags().String(\n\t\t\"base-dir\", \".\", \"Top level directory to collect files from\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfiles\", []string{}, \"Paths to Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"composefiles\", []string{}, \"Paths to docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"kubernetesfiles\", []string{}, \"Paths to kubernetes files\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"lockfile-name\", \"docker-lock.json\",\n\t\t\"Lockfile name to be output in the current working directory\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfile-globs\", []string{}, \"Glob pattern to select Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"composefile-globs\", []string{},\n\t\t\"Glob pattern to select docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"kubernetesfile-globs\", []string{},\n\t\t\"Glob pattern to select kubernetes files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-recursive\", false, \"Recursively collect Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"composefile-recursive\", false,\n\t\t\"Recursively collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"kubernetesfile-recursive\", false,\n\t\t\"Recursively collect kubernetes files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"exclude-all-dockerfiles\", false,\n\t\t\"Do not collect Dockerfiles unless referenced by docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"exclude-all-composefiles\", false,\n\t\t\"Do not collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"exclude-all-kubernetesfiles\", false,\n\t\t\"Do not collect kubernetes files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"ignore-missing-digests\", false,\n\t\t\"Do not fail if unable to find digests\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"update-existing-digests\", false,\n\t\t\"Query registries for new digests even if they are hardcoded in files\",\n\t)\n\n\treturn generateCmd, nil\n}", "func main() {\n\terr := cmd.Execute(version)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}", "func NewGenerateCmd(client *registry.HTTPClient) *cobra.Command {\n\tgenerateCmd := &cobra.Command{\n\t\tUse: \"generate\",\n\t\tShort: \"Generate a Lockfile to track image digests\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := validateGenerateCmdFlags(cmd); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tenvPath, err := cmd.Flags().GetString(\"env-file\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tenvPath = filepath.ToSlash(envPath)\n\t\t\t_ = godotenv.Load(envPath)\n\t\t\twm, err := getDefaultWrapperManager(cmd, client)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tgenerator, err := generate.NewGenerator(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlFile, err := os.Create(generator.LockfileName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer lFile.Close()\n\t\t\tif err := generator.GenerateLockfile(wm, lFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tgenerateCmd.Flags().String(\n\t\t\"base-dir\", \".\", \"Top level directory to collect files from\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfiles\", []string{}, \"Path to Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"compose-files\", []string{}, \"Path to docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfile-globs\", []string{}, \"Glob pattern to select Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"compose-file-globs\", []string{},\n\t\t\"Glob pattern to select docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-recursive\", false, \"Recursively collect Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"compose-file-recursive\", false,\n\t\t\"Recursively collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"lockfile-name\", \"docker-lock.json\",\n\t\t\"Lockfile name to be output in the current working directory\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"config-file\", getDefaultConfigPath(),\n\t\t\"Path to config file for auth credentials\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"env-file\", \".env\", \"Path to .env file\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-env-build-args\", false,\n\t\t\"Use environment vars as build args for Dockerfiles\",\n\t)\n\treturn generateCmd\n}", "func TestGetVersion(t *testing.T) {\n\ttests := []struct {\n\t\tversion string\n\t\tcommit string\n\t\tdate string\n\t\texpect string\n\t\tshortOutput bool\n\t}{\n\t\t{\n\t\t\t\"a\",\n\t\t\t\"b\",\n\t\t\t\"c\",\n\t\t\t\"waver version: a from commit b built on c\",\n\t\t\tfalse,\n\t\t}, {\n\t\t\t\"v0.12.4\",\n\t\t\t\"5b1a61f9b58e3778986c99b1282840ce64329614\",\n\t\t\t\"Thu May 21 16:48:18 PDT 2020\",\n\t\t\t\"waver version: v0.12.4 from commit 5b1a61f9b58e3778986c99b1282840ce64329614 built on Thu May 21 16:48:18 PDT 2020\",\n\t\t\tfalse,\n\t\t}, {\n\t\t\t\"v0.12.4-rc5\",\n\t\t\t\"5b1a61f9b58\",\n\t\t\t\"1590105848\",\n\t\t\t\"waver version: v0.12.4-rc5 from commit 5b1a61f9b58 built on 1590105848\",\n\t\t\tfalse,\n\t\t}, {\n\t\t\t\"v0.12.4-rc5\",\n\t\t\t\"5b1a61f9b58\",\n\t\t\t\"1590105848\",\n\t\t\t\"5b1a61f9b58\",\n\t\t\ttrue,\n\t\t},\n\t}\n\n\t// save the current global variables so they can be set back after testing\n\toldVal := version\n\toldCommit := commit\n\toldDate := date\n\n\tfor _, test := range tests {\n\t\t// run through each test, should not be run in parallel.\n\t\tversion = test.version\n\t\tcommit = test.commit\n\t\tdate = test.date\n\n\t\t// build the new Cobra command and configure stdout and args\n\t\tv := Get(test.shortOutput)\n\n\t\t// assert output string matches expectations\n\t\tassert.Equal(t, test.expect, v)\n\t}\n\n\t// put the original build values back after tests have run\n\tversion = oldVal\n\tcommit = oldCommit\n\tdate = oldDate\n}", "func NewRootCmd(sl service.CommandServicer) (*cobra.Command, error) {\n\trootCmd := &cobra.Command{\n\t\tUse: \"versions\",\n\t\tShort: \"a group of actions for working with versions\",\n\t\tTraverseChildren: true,\n\t}\n\n\tcmdFuncs := []func(locator service.CommandServicer) (*cobra.Command, error){\n\t\tnewListCommand,\n\t\tnewShowCommand,\n\t\tnewPutCommand,\n\t}\n\n\tfor _, f := range cmdFuncs {\n\t\tcmd, err := f(sl)\n\t\tif err != nil {\n\t\t\treturn rootCmd, err\n\t\t}\n\t\trootCmd.AddCommand(cmd)\n\t}\n\n\treturn rootCmd, nil\n}", "func NewReleasesCommand() *cobra.Command {\n\n\tcmd := createListCommand(cmdListReleases, \"releases\", \"\")\n\tcmd.Flags().StringVar(&releaseParams.Name, \"name\", \"\", \"Filter releases by name\")\n\tcmd.Flags().StringVar(&releaseParams.Version, \"version\", \"\", \"Filter releases by version\")\n\tcmd.Flags().StringVar(&releaseParams.StackID, \"stack-id\", \"\", \"Filter releases by stack_id\")\n\tcmd.Flags().StringVar(&releaseParams.StackVersionID, \"stack-version-id\", \"\", \"Filter releases by stack_version_id\")\n\tcmd.Flags().StringVar(&releaseParams.ProjectID, \"project-id\", \"\", \"Filter releases by project_id\")\n\tcmd.Flags().StringVar(&releaseParams.LocImageID, \"loc-image-id\", \"\", \"Filter releases by loc_image_id\")\n\tcmd.Flags().StringVar(&releaseParams.BuildStatus, \"build-status\", \"\", \"Filter releases by build_status\")\n\n\t// Get\n\tgetCmd := createGetCommand(cmdGetReleases, \"release\", \"\")\n\tcmd.AddCommand(getCmd)\n\n\t// Create\n\tcreateCmd := NewReleasesCreateCommand()\n\tcmd.AddCommand(createCmd)\n\n\t// Delete\n\tdeleteCmd := createDeleteCommand(cmdDeleteReleases, \"release\", \"\")\n\tcmd.AddCommand(deleteCmd)\n\n\treturn cmd\n}", "func (v *VersionCommand) runVersion() error {\n\tapiClient := v.cli.Client()\n\n\tresult, err := apiClient.SystemVersion()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get system version: %v\", err)\n\t}\n\n\tv.cli.Print(result)\n\treturn nil\n}", "func init() {\n\tif debug {\n\t\tlog.SetLogLevel(log.Debug)\n\t}\n\tversion = fmt.Sprintf(\"%d.%d.%d\", major, minor, patch)\n\tclean := (gitstatus == \"0\")\n\t// The docker build will pass the git tag to the build, if it is clean\n\t// from a tag it will look like v0.7.0\n\tif tag != \"v\"+version || !clean {\n\t\tlog.Debugf(\"tag is %v, clean is %v marking as pre release\", tag, clean)\n\t\tversion += \"-pre\"\n\t}\n\tif !clean {\n\t\tbuildInfo += \"-dirty\"\n\t\tlog.Debugf(\"gitstatus is %q, marking buildinfo as dirty: %v\", gitstatus, buildInfo)\n\t}\n\tlongVersion = version + \" \" + buildInfo + \" \" + runtime.Version()\n}", "func buildVersion() string {\n\t// noinspection GoBoolExpressions\n\tif SCMCommit == \"\" || strings.Contains(Version, SCMCommit) {\n\t\treturn Version\n\t}\n\n\treturn fmt.Sprintf(\"%s+%s\", Version, SCMCommit)\n}" ]
[ "0.71332157", "0.6940008", "0.6910998", "0.6894133", "0.68905944", "0.6856503", "0.67919654", "0.67875063", "0.6761101", "0.6744674", "0.66154164", "0.6593916", "0.653667", "0.64331496", "0.6401623", "0.63777304", "0.6329797", "0.62582576", "0.6193203", "0.6113864", "0.6092855", "0.59663206", "0.58960485", "0.5848917", "0.583985", "0.5765297", "0.57528675", "0.571256", "0.5682368", "0.56793183", "0.56514955", "0.55515134", "0.5544611", "0.55423385", "0.5541758", "0.5509743", "0.55058855", "0.5487282", "0.54833966", "0.5463856", "0.5456597", "0.5456597", "0.5423289", "0.53277594", "0.53257585", "0.53070104", "0.5294044", "0.52892625", "0.5283943", "0.5281723", "0.52814996", "0.52787757", "0.5268177", "0.52629447", "0.5260455", "0.5248865", "0.5240608", "0.5223065", "0.5222705", "0.52204645", "0.5207539", "0.5207434", "0.5205473", "0.5202338", "0.5193438", "0.51841563", "0.5177343", "0.51771617", "0.51628184", "0.5160952", "0.5152307", "0.51466954", "0.5136106", "0.5125301", "0.5125043", "0.51238525", "0.51218474", "0.5091385", "0.5090144", "0.50359577", "0.5035929", "0.5035049", "0.5025761", "0.50244707", "0.501923", "0.501782", "0.5015524", "0.5010595", "0.49983603", "0.49944606", "0.49899435", "0.49870923", "0.49865875", "0.49818984", "0.49800482", "0.49685007", "0.4957207", "0.495485", "0.49383876", "0.49357256" ]
0.7849763
0
CreateInfoCommand creates a command akin to that created by CreatedVersionCommand but also includes the output of running each of the supplied info closures.
CreateInfoCommand создает команду, похожую на ту, которая создается с помощью CreatedVersionCommand, но также включает результат выполнения каждого из предоставленных закрытых выражений info.
func CreateInfoCommand(name, prefix string, info ...func(*context.T, *cmdline.Env, []string) error) *cmdline.Command { return &cmdline.Command{ Runner: v23cmd.RunnerFunc(func(ctx *context.T, env *cmdline.Env, args []string) error { printVersion(prefix) for _, ifn := range info { if err := ifn(ctx, env, args); err != nil { return err } } return nil }), Name: name, Short: "Display version information", } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewInfoCommand(agentCli *AgentCli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"info\",\n\t\tShort: \"Displays system-wide information.\",\n\t\tArgs: cli.NoArgs,\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn agentCli.Initialize()\n\t\t},\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := runInfo(agentCli)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Errorln(err)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn cmd\n}", "func CreateConsensusAuthCoinInfoCmd(cli *client.CommandLineClient) error {\n\tbc, err := client.NewLazyBaseClientFromCommandLineClient(cli)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcreateAuthCoinCmd(cli, NewPluginConsensusClient(bc), cli.ConsensusCmd)\n\treturn nil\n}", "func CreateVersionCommand(name, prefix string) *cmdline.Command {\n\treturn &cmdline.Command{\n\t\tRunner: RunnerFunc(func(_ *cmdline.Env, _ []string) error {\n\t\t\tprintVersion(prefix)\n\t\t\treturn nil\n\t\t}),\n\t\tName: name,\n\t\tShort: \"Display version information\",\n\t}\n}", "func NewInfoCmd() *cobra.Command {\n\t// infoCmd represents the \"info\" command\n\tinfoCmd := &cobra.Command{\n\t\tUse: \"info [FLAGS]\",\n\t\tShort: \"Show isula-build system information\",\n\t\tRunE: infoCommand,\n\t\tArgs: util.NoArgs,\n\t\tExample: infoExample,\n\t}\n\n\tinfoCmd.PersistentFlags().BoolVarP(&infoOpts.humanReadable, \"human-readable\", \"H\", false,\n\t\t\"Print memory info in human readable format, use powers of 1000\")\n\tinfoCmd.PersistentFlags().BoolVarP(&infoOpts.verbose, \"verbose\", \"V\", false,\n\t\t\"Print runtime memory info\")\n\n\treturn infoCmd\n}", "func NewAdminInfoCommand(ioStreams cmdutil.IOStreams) *cobra.Command {\n\ti := &infoCmd{out: ioStreams.Out}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"info\",\n\t\tShort: \"Show vela client and cluster chartPath\",\n\t\tLong: \"Show vela client and cluster chartPath\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn i.run(ioStreams)\n\t\t},\n\t\tAnnotations: map[string]string{\n\t\t\ttypes.TagCommandType: types.TypeSystem,\n\t\t},\n\t}\n\treturn cmd\n}", "func InfoToCreateCmd(info os.FileInfo) string {\n\tmode := info.Mode()\n\tif mode >= 01000 { //symbolic linkg\n\t\tmode = DefaultFileMode\n\t}\n\tlocationType := \"C\"\n\tsize := info.Size()\n\tif info.IsDir() {\n\t\tlocationType = \"D\"\n\t\tsize = 0\n\t}\n\tfileMode := string(fmt.Sprintf(\"%v%04o\", locationType, mode.Perm())[:5])\n\treturn fmt.Sprintf(\"%v %d %s\\n\", fileMode, size, info.Name())\n}", "func createCommand() cli.Command {\n\treturn cli.Command{\n\t\tName: \"create\",\n\t\tBefore: survey.RequireGlobalFlagsFunc(requiredFlags...),\n\t\tAction: create(),\n\t}\n}", "func CreateExploreAuthCoinInfoCmd(cli *client.CommandLineClient) error {\n\tbc, err := client.NewLazyBaseClientFromCommandLineClient(cli)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcreateAuthCoinCmd(cli, NewPluginExplorerClient(bc), cli.ExploreCmd)\n\treturn nil\n}", "func (opts *Options) CreateCommand() string {\n\tparts := []string{\"openssl pkcs12 -export\"}\n\treturn opts.Stringify(parts)\n}", "func newVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints version information\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\treturn versionTemplate.Execute(os.Stdout, build.GetInfo())\n\t\t},\n\t}\n}", "func newCreateCmd() *cobra.Command {\n\tcreateCmd := cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: `Create a new verless object`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Help()\n\t\t},\n\t}\n\n\tcreateCmd.AddCommand(newCreateProjectCmd())\n\tcreateCmd.AddCommand(newCreateThemeCmd())\n\tcreateCmd.AddCommand(newCreateFile())\n\n\treturn &createCmd\n}", "func CreateCmd() *cobra.Command {\n\tvar cmd = cobra.Command{\n\t\tUse: \"ch.viac\",\n\t\tShort: \"Import VIAC values from JSON files\",\n\t\tLong: `Open app.viac.ch, choose a portfolio, and select \"From start\" in the overview dash. In the Chrome dev tools, save the response from the \"performance\" XHR call, and pass the resulting file to this importer.`,\n\n\t\tArgs: cobra.ExactValidArgs(1),\n\n\t\tRunE: run,\n\t}\n\tcmd.Flags().StringP(\"from\", \"f\", \"0001-01-01\", \"YYYY-MM-DD - ignore entries before this date\")\n\tcmd.Flags().StringP(\"account\", \"a\", \"\", \"account name\")\n\treturn &cmd\n}", "func createCommand(t *runner.Task, actionFunc func(*cli.Context) error) *cli.Command {\n\tcommand := &cli.Command{\n\t\tName: t.Name,\n\t\tUsage: strings.TrimSpace(t.Usage),\n\t\tDescription: strings.TrimSpace(t.Description),\n\t\tAction: actionFunc,\n\t}\n\n\tfor _, arg := range t.Args {\n\t\tcommand.ArgsUsage += fmt.Sprintf(\"<%s> \", arg.Name)\n\t}\n\n\tcommand.CustomHelpTemplate = createCommandHelp(t)\n\n\treturn command\n}", "func NewCommandsInfoCmd(args ...interface{}) *redis.CommandsInfoCmd {\n\treturn redis.NewCommandsInfoCmd(args...)\n}", "func CreateCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"create server\",\n\t\tRun: runCreateCommand,\n\t}\n\tcmd.Flags().AddFlagSet(createParam.getFlagSet())\n\treturn cmd\n}", "func CreateCommand() *cobra.Command {\n\treturn base.CreateCommand(\"template\", \"Create vt template from xml\", New())\n}", "func (c *Command) New() *cobra.Command {\n\tnewCommand := &cobra.Command{\n\t\tUse: \"annactl\",\n\t\tShort: \"Manage the API of the anna project. For more information see https://github.com/the-anna-project/annactl.\",\n\t\tLong: \"Manage the API of the anna project. For more information see https://github.com/the-anna-project/annactl.\",\n\t\tRun: c.Execute,\n\t}\n\n\tnewCommand.AddCommand(c.endpointCommand.New())\n\tnewCommand.AddCommand(c.versionCommand.New())\n\n\treturn newCommand\n}", "func CreateCommand(ca *common.CommonArgs) *cobra.Command {\n\tvar c command\n\tc = command{\n\t\tCommand: cobra.Command{\n\t\t\tUse: \"run\",\n\t\t\tShort: \"run observes the state of tugboat.lauches\",\n\t\t\tArgs: cobra.NoArgs,\n\t\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\treturn c.preexecute(cmd, args)\n\t\t\t},\n\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\treturn c.execute(cmd, args)\n\t\t\t},\n\t\t},\n\t\tCommonArgs: ca,\n\t\thttpFlagMgr: httpcliflags.New(),\n\t\tk8sFlagMgr: cliflags.New(),\n\t\tnotificationsFlagMgr: notificationscliflags.New(),\n\t}\n\n\tflags := c.Flags()\n\n\tc.httpFlagMgr.ConfigureHttpFlag(flags)\n\tc.k8sFlagMgr.ConfigureKubernetesConfig(flags)\n\tc.notificationsFlagMgr.ConfigureListenersFlag(flags)\n\n\treturn common.TraverseRunHooks(&c.Command)\n}", "func CreateCommand(s string) Command {\n\tfmt.Println(\"Creating command\")\n\n\treturn &ConsoleOutput{\n\t\tmessage: s,\n\t}\n}", "func (c *cmdCreate) OptionInfo() *cli.OptionInfo {\n\treturn c.option\n}", "func NewFunctionCreateCommand(c cli.Interface) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"create FUNCTION IMAGE\",\n\t\tShort: \"Create function\",\n\t\tPreRunE: cli.ExactArgs(2),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\topts := &createFunctionOpts{}\n\t\t\topts.name = args[0]\n\t\t\topts.image = args[1]\n\t\t\treturn createFunction(c, opts)\n\t\t},\n\t}\n}", "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Version for apisix-mesh-agent\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(version.String())\n\t\t},\n\t}\n\treturn cmd\n}", "func NewCreateCommand(c2ClientFactory cli.APIClientFactory) cli.Command {\n\tcreateCmd := &createCommand{\n\t\tc2ClientFactory: c2ClientFactory,\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Creates a new client\",\n\t\tLong: fmt.Sprintf(\"Creates a new client, require an unique name, and a file containing either a password or a %d bytes key\", e4crypto.KeyLen),\n\t\tRunE: createCmd.run,\n\t}\n\n\tcobraCmd.Flags().SortFlags = false\n\tcobraCmd.Flags().StringVar(&createCmd.flags.Name, \"name\", \"\", \"The client name\")\n\tcobraCmd.Flags().StringVar(&createCmd.flags.KeyPath, \"key\", \"\", fmt.Sprintf(\"Filepath to a %d bytes key\", e4crypto.KeyLen))\n\tcobraCmd.Flags().StringVar(&createCmd.flags.PasswordPath, \"password\", \"\", \"Filepath to a plaintext password file\")\n\n\tcreateCmd.cobraCmd = cobraCmd\n\n\treturn createCmd\n}", "func InfoNew(opts ...func(*Info)) *Info {\n\tinf := &Info{\n\t\tVersion: version,\n\t\tUUID: createV4UUID(),\n\t}\n\tfor _, f := range opts {\n\t\tf(inf)\n\t}\n\treturn inf\n}", "func newCreateCmd(pather command.Pather) *cobra.Command {\n\tnow := time.Now().UTC()\n\tvar flags struct {\n\t\tcsr bool\n\t\tprofile string\n\t\tcommonName string\n\t\tnotBefore flag.Time\n\t\tnotAfter flag.Time\n\t\tca string\n\t\tcaKey string\n\t\texistingKey string\n\t\tcurve string\n\t\tbundle bool\n\t\tforce bool\n\t}\n\tflags.notBefore = flag.Time{\n\t\tTime: now,\n\t\tCurrent: now,\n\t}\n\tflags.notAfter = flag.Time{\n\t\tCurrent: now,\n\t\tDefault: \"depends on profile\",\n\t}\n\n\tvar cmd = &cobra.Command{\n\t\tUse: \"create [flags] <subject-template> <cert-file> <key-file>\",\n\t\tShort: \"Create a certificate or certificate signing request\",\n\t\tExample: fmt.Sprintf(` %[1]s create --profile cp-root subject.tmpl cp-root.crt cp-root.key\n %[1]s create --ca cp-ca.crt --ca-key cp-ca.key subject.tmpl chain.pem cp-as.key\n %[1]s create --csr subject.tmpl chain.csr cp-as.key`,\n\t\t\tpather.CommandPath(),\n\t\t),\n\t\tLong: `'create' generates a certificate or a certificate signing request (CSR).\n\nThe command takes the following positional arguments:\n- <subject-template> is the template for the certificate subject distinguished name.\n- <crt-file> is the file path where the certificate or certificate requests is\n written to. The parent directory must exist and must be writable.\n- <key-file> is the file path where the fresh private key is written to. The\n parent directory must exist and must be writable.\n\nBy default, the command creates a SCION control-plane PKI AS certificate. Another\ncertificate type can be selected by providing the --profile flag. If a certificate\nchain is desired, specify the --bundle flag.\n\nA fresh key is created in the provided <key-file>, unless the --key flag is set.\nIf the --key flag is set, an existing private key is used and the <key-file> is\nignored.\n\nThe --ca and --ca-key flags are required if a AS certificate or CA certificate\nis being created. Otherwise, they are not allowed.\n\nThe --not-before and --not-after flags can either be a timestamp or a relative\ntime offset from the current time.\n\nA timestamp can be provided in two different formats: unix timestamp and\nRFC 3339 timestamp. For example, 2021-06-24T12:01:02Z represents 1 minute and 2\nseconds after the 12th hour of June 26th, 2021 in UTC.\n\nThe relative time offset can be formated as a time duration string with the\nfollowing units: y, w, d, h, m, s. Negative offsets are also allowed. For\nexample, -1h indicates the time of tool invocation minus one hour. Note that\n--not-after is relative to the current time if a relative time offset is used,\nand not to --not-before.\n\nThe <subject-template> is the template for the distinguished name of the\nrequested certificate and must either be a x.509 certificate or a JSON file.\nThe common name can be overridden by supplying the --common-name flag.\n\nIf it is a x.509 certificate, the subject of the template is used as the subject\nof the created certificate or certificate chain request.\n\nA valid example for a JSON formatted template:\n` + subjectHelp,\n\t\tArgs: cobra.RangeArgs(2, 3),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) == 2 && flags.existingKey == \"\" {\n\t\t\t\treturn serrors.New(\"positional key file is required\")\n\t\t\t}\n\t\t\tct, err := parseCertType(flags.profile)\n\t\t\tif err != nil {\n\t\t\t\treturn serrors.WrapStr(\"parsing profile\", err)\n\t\t\t}\n\t\t\tsubject, err := createSubject(args[0], flags.commonName)\n\t\t\tif err != nil {\n\t\t\t\treturn serrors.WrapStr(\"creating subject\", err)\n\t\t\t}\n\n\t\t\t// Only check that the flags are set appropriately here.\n\t\t\t// Do the actual parsing after the usage help message is silenced.\n\t\t\tvar loadCA bool\n\t\t\tisSelfSigned := (ct == cppki.Root || ct == cppki.Regular || ct == cppki.Sensitive)\n\t\t\twithCA := (flags.ca != \"\" || flags.caKey != \"\")\n\t\t\tswitch {\n\t\t\tcase flags.csr && withCA:\n\t\t\t\treturn serrors.New(\"CA information set for CSR\")\n\t\t\tcase !flags.csr && isSelfSigned && withCA:\n\t\t\t\treturn serrors.New(\"CA information set for self-signed certificate\")\n\t\t\tdefault:\n\t\t\t\tloadCA = !isSelfSigned && !flags.csr\n\t\t\t}\n\n\t\t\tcmd.SilenceUsage = true\n\n\t\t\tvar privKey key.PrivateKey\n\t\t\tvar encodedKey []byte\n\t\t\tif flags.existingKey != \"\" {\n\t\t\t\tif privKey, err = key.LoadPrivateKey(flags.existingKey); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"loading existing private key\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif privKey, err = key.GeneratePrivateKey(flags.curve); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"creating fresh private key\", err)\n\t\t\t\t}\n\t\t\t\tif encodedKey, err = key.EncodePEMPrivateKey(privKey); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"encoding fresh private key\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar caCertRaw []byte\n\t\t\tvar caCert *x509.Certificate\n\t\t\tvar caKey key.PrivateKey\n\t\t\tif loadCA {\n\t\t\t\tif caCertRaw, err = os.ReadFile(flags.ca); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"read CA certificate\", err)\n\t\t\t\t}\n\t\t\t\tif caCert, err = parseCertificate(caCertRaw); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"parsing CA certificate\", err)\n\t\t\t\t}\n\t\t\t\tif caKey, err = key.LoadPrivateKey(flags.caKey); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"loading CA private key\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif isSelfSigned {\n\t\t\t\tcaKey = privKey\n\t\t\t}\n\n\t\t\tif flags.csr {\n\t\t\t\tcsr, err := CreateCSR(ct, subject, privKey)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"creating CSR\", err)\n\t\t\t\t}\n\t\t\t\tencodedCSR := pem.EncodeToMemory(&pem.Block{\n\t\t\t\t\tType: \"CERTIFICATE REQUEST\",\n\t\t\t\t\tBytes: csr,\n\t\t\t\t})\n\t\t\t\tif encodedCSR == nil {\n\t\t\t\t\tpanic(\"failed to encode CSR\")\n\t\t\t\t}\n\t\t\t\tcsrFile := args[1]\n\t\t\t\terr = file.WriteFile(csrFile, encodedCSR, 0644, file.WithForce(flags.force))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"writing CSR\", err)\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"CSR successfully written to %q\\n\", csrFile)\n\t\t\t} else {\n\t\t\t\tcert, err := CreateCertificate(CertParams{\n\t\t\t\t\tType: ct,\n\t\t\t\t\tSubject: subject,\n\t\t\t\t\tPubKey: privKey.Public(),\n\t\t\t\t\tNotBefore: flags.notBefore.Time,\n\t\t\t\t\tNotAfter: notAfterFromFlags(ct, flags.notBefore, flags.notAfter),\n\t\t\t\t\tCAKey: caKey,\n\t\t\t\t\tCACert: caCert,\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"creating certificate\", err)\n\t\t\t\t}\n\t\t\t\tencodedCert := pem.EncodeToMemory(&pem.Block{\n\t\t\t\t\tType: \"CERTIFICATE\",\n\t\t\t\t\tBytes: cert,\n\t\t\t\t})\n\t\t\t\tif encodedCert == nil {\n\t\t\t\t\tpanic(\"failed to encode CSR\")\n\t\t\t\t}\n\t\t\t\tif flags.bundle {\n\t\t\t\t\tfmt.Println(\"Bundling certificate as certificate chain\")\n\t\t\t\t\tencodedCert = append(encodedCert, caCertRaw...)\n\t\t\t\t}\n\t\t\t\tcertFile := args[1]\n\t\t\t\terr = file.WriteFile(certFile, encodedCert, 0644, file.WithForce(flags.force))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"writing certificate\", err)\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"Certificate successfully written to %q\\n\", certFile)\n\t\t\t}\n\n\t\t\tif encodedKey != nil {\n\t\t\t\tkeyFile := args[2]\n\t\t\t\tif err := file.CheckDirExists(filepath.Dir(keyFile)); err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"checking that directory of private key exists\", err)\n\t\t\t\t}\n\t\t\t\terr := file.WriteFile(keyFile, encodedKey, 0600, file.WithForce(flags.force))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn serrors.WrapStr(\"writing private key\", err)\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"Private key successfully written to %q\\n\", keyFile)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Flags().BoolVar(&flags.csr, \"csr\", false,\n\t\t\"Generate a certificate signign request instead of a certificate\",\n\t)\n\tcmd.Flags().StringVar(&flags.profile, \"profile\", \"cp-as\",\n\t\t\"The type of certificate to generate (cp-as|cp-ca|cp-root|sensitive-voting|regular-voting)\",\n\t)\n\tcmd.Flags().Var(&flags.notBefore, \"not-before\",\n\t\t`The NotBefore time of the certificate. Can either be a timestamp or an offset.\n\nIf the value is a timestamp, it is expected to either be an RFC 3339 formatted\ntimestamp or a unix timestamp. If the value is a duration, it is used as the\noffset from the current time.`,\n\t)\n\tcmd.Flags().Var(&flags.notAfter, \"not-after\",\n\t\t`The NotAfter time of the certificate. Can either be a timestamp or an offset.\n\nIf the value is a timestamp, it is expected to either be an RFC 3339 formatted\ntimestamp or a unix timestamp. If the value is a duration, it is used as the\noffset from the current time.`,\n\t)\n\tcmd.Flags().StringVar(&flags.commonName, \"common-name\", \"\",\n\t\t\"The common name that replaces the common name in the subject template\",\n\t)\n\tcmd.Flags().StringVar(&flags.ca, \"ca\", \"\",\n\t\t\"The path to the issuer certificate\",\n\t)\n\tcmd.Flags().StringVar(&flags.caKey, \"ca-key\", \"\",\n\t\t\"The path to the issuer private key used to sign the new certificate\",\n\t)\n\tcmd.Flags().StringVar(&flags.existingKey, \"key\", \"\",\n\t\t\"The path to the existing private key to use instead of creating a new one\",\n\t)\n\tcmd.Flags().StringVar(&flags.curve, \"curve\", \"P-256\",\n\t\t\"The elliptic curve to use (P-256|P-384|P-521)\",\n\t)\n\tcmd.Flags().BoolVar(&flags.bundle, \"bundle\", false,\n\t\t\"Bundle the certificate with the issuer certificate as a certificate chain\",\n\t)\n\tcmd.Flags().BoolVar(&flags.force, \"force\", false,\n\t\t\"Force overwritting existing files\",\n\t)\n\n\treturn cmd\n}", "func CreateCommand(cli *cli.SensuCli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse:\t\t\"create [NAME]\",\n\t\tShort:\t\t\"create new hooks\",\n\t\tSilenceUsage:\ttrue,\n\t\tPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tisInteractive, _ := cmd.Flags().GetBool(flags.Interactive)\n\t\t\tif !isInteractive {\n\t\t\t\t// Mark flags are required for bash-completions\n\t\t\t\t_ = cmd.MarkFlagRequired(\"command\")\n\t\t\t}\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) > 1 {\n\t\t\t\t_ = cmd.Help()\n\t\t\t\treturn errors.New(\"invalid argument(s) received\")\n\t\t\t}\n\n\t\t\tisInteractive, _ := cmd.Flags().GetBool(flags.Interactive)\n\t\t\topts := newHookOpts()\n\n\t\t\tif len(args) > 0 {\n\t\t\t\topts.Name = args[0]\n\t\t\t}\n\n\t\t\topts.Namespace = cli.Config.Namespace()\n\n\t\t\tif isInteractive {\n\t\t\t\tif err := opts.administerQuestionnaire(false); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\topts.withFlags(cmd.Flags())\n\t\t\t}\n\n\t\t\t// Apply given arguments to hook\n\t\t\thook := v2.HookConfig{}\n\t\t\topts.Copy(&hook)\n\n\t\t\tif err := hook.Validate(); err != nil {\n\t\t\t\tif !isInteractive {\n\t\t\t\t\tcmd.SilenceUsage = false\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t//\n\t\t\t// TODO:\n\t\t\t//\n\t\t\t// Current validation is a bit too laissez faire. For usability we should\n\t\t\t// determine whether there are assets / handlers / mutators associated w/\n\t\t\t// the hook and warn the user if they do not exist yet.\n\n\t\t\tif err := cli.Client.CreateHook(&hook); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfmt.Fprintln(cmd.OutOrStdout(), \"Created\")\n\t\t\treturn nil\n\t\t},\n\t}\n\n\t_ = cmd.Flags().StringP(\"command\", \"c\", \"\", \"the command the hook should run\")\n\t_ = cmd.Flags().StringP(\"timeout\", \"t\", timeoutDefault, \"timeout, in seconds, at which the hook has to run\")\n\t_ = cmd.Flags().BoolP(\"stdin\", \"s\", false, \"stdin enabled on hook\")\n\n\thelpers.AddInteractiveFlag(cmd.Flags())\n\treturn cmd\n}", "func newInfo(conn *Connection, commands ...string) (*info, error) {\n\tcommandStr := strings.Trim(strings.Join(commands, \"\\n\"), \" \")\n\tif strings.Trim(commandStr, \" \") != \"\" {\n\t\tcommandStr += \"\\n\"\n\t}\n\tnewInfo := &info{\n\t\tmsg: NewMessage(MSG_INFO, []byte(commandStr)),\n\t}\n\n\tif err := newInfo.sendCommand(conn); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newInfo, nil\n}", "func InfoCommand(cli *cli.SensuCli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"info\",\n\t\tShort: \"show tessen configuration\",\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) != 0 {\n\t\t\t\t_ = cmd.Help()\n\t\t\t\treturn errors.New(\"invalid argument(s) received\")\n\t\t\t}\n\n\t\t\tconfig := &corev2.TessenConfig{}\n\t\t\tif err := cli.Client.Get(config.URIPath(), config); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Determine the format to use to output the data\n\t\t\tflag := helpers.GetChangedStringValueViper(\"format\", cmd.Flags())\n\t\t\tformat := cli.Config.Format()\n\t\t\treturn helpers.PrintFormatted(flag, format, config, cmd.OutOrStdout(), printToList)\n\t\t},\n\t}\n\n\thelpers.AddFormatFlag(cmd.Flags())\n\n\treturn cmd\n}", "func NewCmd(octaviusDaemon daemon.Client, fileUtil file.File) *cobra.Command {\n\tvar metadataFilePath string\n\n\tcreateCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create new octavius job metadata\",\n\t\tLong: \"This command helps create new job metadata to your CP host with proper metadata.json file\",\n\t\tExample: fmt.Sprintf(\"octavius create --job-path <filepath>/metadata.json\"),\n\t\tArgs: cobra.MaximumNArgs(0),\n\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\n\t\t\tprinter.Println(\"Creating a new job.\", color.FgBlack)\n\t\t\tmetadataFileIoReader, err := fileUtil.GetIoReader(metadataFilePath)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"error in reading file\")\n\t\t\t\tprinter.Println(fmt.Sprintf(\"error in reading file %v\", err.Error()), color.FgRed)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tclient := &client.GrpcClient{}\n\t\t\tres, err := octaviusDaemon.Post(metadataFileIoReader, client)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"error in creating metadata\")\n\t\t\t\tprinter.Println(fmt.Sprintf(\"error in creating metadata, %v\", status.Convert(err).Message()), color.FgRed)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlog.Info(fmt.Sprintf(\"%s job created\", res.Name))\n\t\t\tprinter.Println(fmt.Sprintf(\"%s job created\", res.Name), color.FgGreen)\n\t\t},\n\t}\n\tcreateCmd.Flags().StringVarP(&metadataFilePath, \"job-path\", \"\", \"\", \"path to metadata.json(required)\")\n\terr := createCmd.MarkFlagRequired(\"job-path\")\n\tif err != nil {\n\t\tlog.Error(err, \"error while setting the flag required\")\n\t\tprinter.Println(\"error while setting the flag required\", color.FgRed)\n\t\treturn nil\n\t}\n\treturn createCmd\n}", "func createCommand(ctx context.Context, cmdline []string, env env) commander {\n\tlogrus.Debugf(\"command: %v (env: %s)\", cmdline, env)\n\tcmd := exec.CommandContext(ctx, cmdline[0], cmdline[1:]...)\n\tcmd.Env = env.AsPairs()\n\treturn cmd\n}", "func (r Describe) NewCommand(ctx context.Context, name string) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: name[strings.LastIndex(name, \".\")+1:] + \" [NAME[:VERSION]] [RESOURCE] [FILTER]\",\n\t\tShort: \"Describe registered releases with states information.\",\n\t\tLong: \"Describe registered releases with states information\",\n\t\tArgs: require.Args(r.validation),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tvar name string\n\t\t\tvar version semver.Version\n\t\t\tif len(args) > 0 {\n\t\t\t\tparts := strings.Split(args[0], \":\")\n\t\t\t\tparts = append(parts, \"\")\n\t\t\t\tname = parts[0]\n\n\t\t\t\tif parts[1] != \"\" {\n\t\t\t\t\tvar err error\n\t\t\t\t\tversion, err = semver.Parse(parts[1])\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar resource string\n\t\t\tif len(args) > 1 {\n\t\t\t\tresource = args[1]\n\t\t\t}\n\n\t\t\tvar filter string\n\t\t\tif len(args) > 2 {\n\t\t\t\tfilter = args[2]\n\t\t\t}\n\n\t\t\topts := describeOptions{\n\t\t\t\tName: name,\n\t\t\t\tVersion: version,\n\t\t\t\tResource: resource,\n\t\t\t\tFilter: filter,\n\t\t\t}\n\t\t\treturn r.run(ctx, cmd.OutOrStdout(), opts)\n\t\t},\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t}\n\n\tcmd.SetUsageTemplate(global.DefaultUsageTemplate)\n\tcmd.SetHelpCommand(&cobra.Command{Hidden: true})\n\n\tflags := cmd.Flags()\n\tflags.SortFlags = false\n\tflags.Bool(\"help\", false, \"Show help information.\")\n\treturn cmd\n}", "func createCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a Windows instance on the same provider as the existing OpenShift Cluster.\",\n\t\tLong: \"creates a Windows instance under the same virtual network (AWS-VCP, Azure-Vnet, \" +\n\t\t\t\"and etc.) used by a given OpenShift cluster running on the selected provider. \" +\n\t\t\t\"The created instance would be ready to join the OpenShift Cluster as a worker node.\",\n\t\tPreRunE: func(cmd *cobra.Command, _ []string) error {\n\t\t\treturn validateCreateFlags(cmd)\n\t\t},\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\tcloud, err := cloudprovider.CloudProviderFactory(rootInfo.kubeconfigPath, rootInfo.credentialPath,\n\t\t\t\trootInfo.credentialAccountID, rootInfo.resourceTrackerDir)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating cloud provider clients, %v\", err)\n\t\t\t}\n\t\t\terr = cloud.CreateWindowsVM(createFlagInfo.imageID, createFlagInfo.instanceType, createFlagInfo.sshKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating Windows Instance, %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.imageID, \"image-id\", \"\",\n\t\t\"ami ID of a base image for the instance (i.e.\"+\n\t\t\t\": ami-06a4e829b8bbad61e for Microsoft Windows Server 2019 Base image on AWS). (required)\")\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.instanceType, \"instance-type\", \"\",\n\t\t\"name of a type of instance (i.e.: m4.large for AWS, etc). (required)\")\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.sshKey, \"ssh-key\", \"\",\n\t\t\"name of existing ssh key on cloud provider for accessing the instance after it is created. (required)\")\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\topts := &options{}\n\n\tcmd := &cobra.Command{\n\t\tUse: Name,\n\t\tShort: \"Launch the \" + Name,\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tverflag.PrintAndExitIfRequested()\n\n\t\t\tif err := opts.complete(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlog, err := logger.NewZapLogger(opts.config.LogLevel, opts.config.LogFormat)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error instantiating zap logger: %w\", err)\n\t\t\t}\n\n\t\t\tlogf.SetLogger(log)\n\t\t\tklog.SetLogger(log)\n\n\t\t\tlog.Info(\"Starting \"+Name, \"version\", version.Get())\n\t\t\tcmd.Flags().VisitAll(func(flag *pflag.Flag) {\n\t\t\t\tlog.Info(fmt.Sprintf(\"FLAG: --%s=%s\", flag.Name, flag.Value)) //nolint:logcheck\n\t\t\t})\n\n\t\t\t// don't output usage on further errors raised during execution\n\t\t\tcmd.SilenceUsage = true\n\t\t\t// further errors will be logged properly, don't duplicate\n\t\t\tcmd.SilenceErrors = true\n\n\t\t\treturn run(cmd.Context(), log, opts.config)\n\t\t},\n\t}\n\n\tflags := cmd.Flags()\n\tverflag.AddFlags(flags)\n\topts.addFlags(flags)\n\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\topts := &options{}\n\n\tcmd := &cobra.Command{\n\t\tUse: Name,\n\t\tShort: \"Launch the \" + Name,\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tverflag.PrintAndExitIfRequested()\n\n\t\t\tif err := opts.complete(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlog, err := logger.NewZapLogger(opts.config.LogLevel, opts.config.LogFormat)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error instantiating zap logger: %w\", err)\n\t\t\t}\n\n\t\t\tlogf.SetLogger(log)\n\t\t\tklog.SetLogger(log)\n\n\t\t\tlog.Info(\"Starting \"+Name, \"version\", version.Get())\n\t\t\tcmd.Flags().VisitAll(func(flag *pflag.Flag) {\n\t\t\t\tlog.Info(fmt.Sprintf(\"FLAG: --%s=%s\", flag.Name, flag.Value)) //nolint:logcheck\n\t\t\t})\n\n\t\t\t// don't output usage on further errors raised during execution\n\t\t\tcmd.SilenceUsage = true\n\t\t\t// further errors will be logged properly, don't duplicate\n\t\t\tcmd.SilenceErrors = true\n\n\t\t\treturn run(cmd.Context(), log, opts.config)\n\t\t},\n\t}\n\n\tflags := cmd.Flags()\n\tverflag.AddFlags(flags)\n\topts.addFlags(flags)\n\n\treturn cmd\n}", "func newCreateIdentityCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command {\n\tnewOptions := func() *createIdentityOptions {\n\t\treturn &createIdentityOptions{\n\t\t\tedgeOptions: edgeOptions{\n\t\t\t\tCommonOptions: common.CommonOptions{Factory: f, Out: out, Err: errOut},\n\t\t\t},\n\t\t}\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"identity\",\n\t\tShort: \"creates a new identity managed by the Ziti Edge Controller\",\n\t\tLong: \"creates a new identity managed by the Ziti Edge Controller\",\n\t}\n\n\tcmd.AddCommand(newCreateIdentityOfTypeCmd(\"device\", newOptions()))\n\tcmd.AddCommand(newCreateIdentityOfTypeCmd(\"user\", newOptions()))\n\tcmd.AddCommand(newCreateIdentityOfTypeCmd(\"service\", newOptions()))\n\n\treturn cmd\n}", "func (h *Handler) CreateCommand(w http.ResponseWriter, r *http.Request) {\n\t// Decode request.\n\tvar cmd sigstat.Command\n\n\tif err := json.NewDecoder(r.Body).Decode(&cmd); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t//Create command\n\tid, errc := h.client.CommandService().CreateCommand(cmd)\n\n\t//Handle error from client\n\tif errc != nil {\n\t\tif err := json.NewEncoder(w).Encode(&createCommandResponse{Err: errc.Error()}); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\n\t//Handle json serialization\n\tif err := json.NewEncoder(w).Encode(&createCommandResponse{GroupID: id}); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "func buildInfo(c *cli.Context) error {\n\trepo := c.Args().First()\n\towner, name, err := parseRepo(repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnumber, err := strconv.Atoi(c.Args().Get(1))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient, err := newClient(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbuild, err := client.Build(owner, name, number)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttmpl, err := template.New(\"_\").Parse(c.String(\"format\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn tmpl.Execute(os.Stdout, build)\n}", "func NewInfo(createResponse string, modified *time.Time) (os.FileInfo, error) {\n\n\telements := strings.SplitN(createResponse, \" \", 3)\n\tif len(elements) != 3 {\n\t\treturn nil, fmt.Errorf(\"invalid download createResponse: %v\", createResponse)\n\t}\n\tisDir := strings.HasPrefix(elements[0], \"D\")\n\tmodeLiteral := string(elements[0][1:])\n\tmode, err := strconv.ParseInt(modeLiteral, 8, 64)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"invalid mode: %v\", modeLiteral)\n\t}\n\tsizeLiteral := elements[1]\n\tsize, err := strconv.ParseInt(sizeLiteral, 10, 64)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"invalid size: %v\", modeLiteral)\n\t}\n\tname := strings.Trim(elements[2], \"\\r\\n\")\n\tif modified == nil {\n\t\tnow := time.Now()\n\t\tmodified = &now\n\t}\n\treturn file.NewInfo(name, size, os.FileMode(mode), *modified, isDir), nil\n}", "func NewCreateCommand(c2aeClientFactory cli.APIClientFactory) Command {\n\tcreateCmd := &createCommand{\n\t\tc2aeClientFactory: c2aeClientFactory,\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a new rule\",\n\t\tRunE: createCmd.run,\n\t}\n\n\tcobraCmd.Flags().StringVar(&createCmd.flags.Description, \"description\", \"\", \"short description of the rule\")\n\tcobraCmd.Flags().StringVar(&createCmd.flags.Action, \"action\", \"\", \"action to be performed when the rule will trigger\")\n\n\tcobraCmd.MarkFlagCustom(\"action\", CompletionFuncNameAction)\n\n\tcobraCmd.MarkFlagRequired(\"description\")\n\tcobraCmd.MarkFlagRequired(\"action\")\n\n\tcreateCmd.cobraCmd = cobraCmd\n\n\treturn createCmd\n}", "func (p *DefaultParsedRedirect) CreateCommand(executable string) (cmd *exec.Cmd) {\n\tcmd = execCmdFn(executable, p.args...)\n\tcmd.Env = os.Environ()\n\tcmd.Stdout = p.shell.OutStream()\n\tcmd.Stderr = p.shell.ErrStream()\n\tcmd.Stdin = p.shell.InStream()\n\treturn\n}", "func NewInfo(task, source, schema, table string, ddls []string) Info {\n\treturn Info{\n\t\tTask: task,\n\t\tSource: source,\n\t\tSchema: schema,\n\t\tTable: table,\n\t\tDDLs: ddls,\n\t}\n}", "func NewCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"The version of matryoshka\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tfmt.Println(BuildCommit)\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func newCommand(name, argsSpec, description string, init func(*flag.FlagSet), f func(*flag.FlagSet) error) command {\n\tfs := flag.NewFlagSet(name, flag.ExitOnError)\n\tinit(fs)\n\tif fs.Usage == nil {\n\t\tfs.Usage = func() {\n\t\t\tfmt.Fprintln(os.Stderr, \"#\", description)\n\t\t\tfmt.Fprintln(os.Stderr, name, argsSpec)\n\t\t\tfs.PrintDefaults()\n\t\t}\n\t}\n\treturn command{fs, f}\n}", "func (o *FileInfoCreateParams) WithInfo(info *models.FileInfo) *FileInfoCreateParams {\n\to.SetInfo(info)\n\treturn o\n}", "func New(b BuildInfo) *Command {\n\tfs := flag.NewFlagSet(\"changelog\", flag.ExitOnError)\n\n\treturn &Command{\n\t\tfs: fs,\n\t\tb: b,\n\t\tfile: fs.String(fileOptName, dfltChangelogFile, \"changelog file name\"),\n\t\tdebug: fs.Bool(debugOptName, false, \"log debug information\"),\n\t\ttoStdOut: fs.Bool(stdOutOptName, false, \"output changelog to stdout instead to file\"),\n\t\thistory: fs.Bool(historyOptName, false, \"create history of old versions tags (output is always stdout)\"),\n\t\tignore: fs.Bool(ignoreOptName, false, \"ignore parsing errors of invalid (not conventional) commit messages\"),\n\t\tsinceTag: fs.String(sinceTagOptName, \"\", fmt.Sprintf(\"in combination with -%s: if a tag is specified, the changelog will be created from that tag on\", historyOptName)),\n\t\tinitConfig: fs.Bool(initDfltConfigOptName, false, fmt.Sprintf(\"initialize a default changelog configuration '%s'\", config.FileName)),\n\t\tnoPrompt: fs.Bool(noPromptOptName, false, \"do not prompt for next version\"),\n\t\tversion: fs.Bool(versionOptName, false, \"show program version information\"),\n\t\tnum: fs.Int(numOptName, 0, fmt.Sprintf(\"in combination with -%s: the number of tags to go back\", historyOptName)),\n\t}\n}", "func newCreateCmd(clientFn func() (*fic.ServiceClient, error), out io.Writer) *cobra.Command {\n\tvar (\n\t\tsrcRouterID string\n\t\tsrcGroupName string\n\t\tsrcPrimary string\n\t\tsrcSecondary string\n\t\tsrcRouteFilter string\n\t\tdestPrimary string\n\t\tdestSecondary string\n\t\tbandwidth string\n\t)\n\n\tr := regexp.MustCompile(`^[\\w&()-]{1,64}$`)\n\tvalidateSrc := func(splitSrc []string, isPrimary, hasSecondary bool) error {\n\t\t_, ipNet, err := net.ParseCIDR(splitSrc[0])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ipAddress must be CIDR whose subnet mask is 30, e.g. 10.0.0.1/30: received %s\", splitSrc[0])\n\t\t}\n\t\tsubNetMaskLength, _ := ipNet.Mask.Size()\n\t\tif subNetMaskLength != 30 {\n\t\t\treturn fmt.Errorf(\"subnet mask of ipAddress must be 30, e.g. 10.0.0.1/30: received %s\", splitSrc[0])\n\t\t}\n\n\t\tif !utils.StringInSlice(splitSrc[1], validPrepends) {\n\t\t\treturn fmt.Errorf(\"asPathPrepend.in must be one of %s: received %s\", validPrepends, splitSrc[1])\n\t\t}\n\n\t\tif !utils.StringInSlice(splitSrc[2], validPrepends) {\n\t\t\treturn fmt.Errorf(\"asPathPrepend.out must be one of %s: received %s\", validPrepends, splitSrc[2])\n\t\t}\n\n\t\tif isPrimary {\n\t\t\tmed, err := strconv.Atoi(splitSrc[3])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"med.out must be numeric value: received %s\", splitSrc[3])\n\t\t\t}\n\n\t\t\tif hasSecondary {\n\t\t\t\tif !utils.IntInSlice(med, validPrimaryPairedMEDs) {\n\t\t\t\t\treturn fmt.Errorf(\"med.out in paired connection must be one of %v: received %d\", validPrimaryPairedMEDs, med)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif !utils.IntInSlice(med, validPrimarySingleMEDs) {\n\t\t\t\t\treturn fmt.Errorf(\"med.out in single connection must be one of %v: received %d\", validPrimarySingleMEDs, med)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n\tvalidateDest := func(splitDest []string) error {\n\t\tvlan, err := strconv.Atoi(splitDest[1])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"vlan must be numeric value: received %s\", splitDest[1])\n\t\t}\n\t\tif vlan < 101 || vlan > 3300 {\n\t\t\treturn fmt.Errorf(\"vlan must be range of 101 to 3300: received %s\", splitDest[1])\n\t\t}\n\n\t\t_, ipNet, err := net.ParseCIDR(splitDest[2])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ipAddress must be CIDR whose subnet mask is 30, e.g. 10.0.0.2/30: received %s\", splitDest[2])\n\t\t}\n\t\tsubNetMaskLength, _ := ipNet.Mask.Size()\n\t\tif subNetMaskLength != 30 {\n\t\t\treturn fmt.Errorf(\"subnet mask of ipAddress must be 30, e.g. 10.0.0.2/30: received %s\", splitDest[2])\n\t\t}\n\n\t\tasn, err := strconv.Atoi(splitDest[3])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"asn must be numeric value: received %s\", splitDest[3])\n\t\t}\n\t\tif asn < 1 || asn > 65535 {\n\t\t\treturn fmt.Errorf(\"asn must be range of 1 to 65535: received %s\", splitDest[3])\n\t\t}\n\t\treturn nil\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create <name>\",\n\t\tShort: \"Create router to port connection\",\n\t\tExample: \"# In case of non paired-connection \\n\" +\n\t\t\t\"fic router-to-port-connections create YourConnectionName \" +\n\t\t\t\"--source-router F020123456789 \" +\n\t\t\t\"--source-group group_1 \" +\n\t\t\t\"--source-primary 10.0.0.1/30,4,4,10 \" +\n\t\t\t\"--source-route-filter fullRoute,fullRouteWithDefaultRoute \" +\n\t\t\t\"--destination-primary F010123456789,101,10.0.0.2/30,65000 \" +\n\t\t\t\"--bandwidth 10M \\n\\n\" +\n\t\t\t\"# In case of paired-connection \\n\" +\n\t\t\t\"fic router-to-port-connections create YourConnectionName \" +\n\t\t\t\"--source-router F020123456789 \" +\n\t\t\t\"--source-group group_1 \" +\n\t\t\t\"--source-primary 10.0.0.1/30,4,4,10 \" +\n\t\t\t\"--source-secondary 10.0.0.5/30,2,1 \" +\n\t\t\t\"--source-route-filter fullRoute,fullRouteWithDefaultRoute \" +\n\t\t\t\"--destination-primary F010123456789,101,10.0.0.2/30,65000 \" +\n\t\t\t\"--destination-secondary F019876543210,102,10.0.0.6/30,65000 \" +\n\t\t\t\"--bandwidth 10M\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tif !r.MatchString(args[0]) {\n\t\t\t\treturn fmt.Errorf(\"name of router to port connection must be composed of alpha-numeric \"+\n\t\t\t\t\t\"characters and & ( ) - _, and must have maximum length of 64 as well: received %s\", args[0])\n\t\t\t}\n\n\t\t\tif !utils.StringInSlice(srcGroupName, validGroupNames) {\n\t\t\t\treturn fmt.Errorf(\"source-group must be one of %s: received %s\", validGroupNames, srcGroupName)\n\t\t\t}\n\n\t\t\tsplitSrcPrimary := strings.Split(strings.TrimSpace(srcPrimary), \",\")\n\t\t\tsplitSrcSecondary := strings.Split(strings.TrimSpace(srcSecondary), \",\")\n\t\t\tsplitSrcRouteFilter := strings.Split(strings.TrimSpace(srcRouteFilter), \",\")\n\t\t\tsplitDestPrimary := strings.Split(strings.TrimSpace(destPrimary), \",\")\n\t\t\tsplitDestSecondary := strings.Split(strings.TrimSpace(destSecondary), \",\")\n\n\t\t\tif len(splitSrcPrimary) != 4 {\n\t\t\t\treturn fmt.Errorf(\"source-primary must have format like \"+\n\t\t\t\t\t\"<ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>,<med.out>: received %s\", srcPrimary)\n\t\t\t}\n\t\t\tif err := validateSrc(splitSrcPrimary, true, srcSecondary != \"\"); err != nil {\n\t\t\t\treturn fmt.Errorf(\"in source-primary, %w\", err)\n\t\t\t}\n\n\t\t\tif len(splitDestPrimary) != 4 {\n\t\t\t\treturn fmt.Errorf(\"destination-primary must have format like \"+\n\t\t\t\t\t\"<portId>,<vlan>,<ipAddress>,<asn>: received %s\", destPrimary)\n\t\t\t}\n\t\t\tif err := validateDest(splitDestPrimary); err != nil {\n\t\t\t\treturn fmt.Errorf(\"in destination-primary, %w\", err)\n\t\t\t}\n\n\t\t\tif srcSecondary != \"\" {\n\t\t\t\tif len(splitSrcSecondary) != 3 {\n\t\t\t\t\treturn fmt.Errorf(\"source-secondary must have format like \"+\n\t\t\t\t\t\t\"<ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>: received %s\", srcSecondary)\n\t\t\t\t}\n\t\t\t\tif err := validateSrc(splitSrcSecondary, false, true); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"in source-secondary, %w\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tredundant := false\n\t\t\tif destSecondary != \"\" {\n\t\t\t\tif len(splitDestSecondary) != 4 {\n\t\t\t\t\treturn fmt.Errorf(\"destination-secondary must have format like \"+\n\t\t\t\t\t\t\"<portId>,<vlan>,<ipAddress>,<asn>: received %s\", destSecondary)\n\t\t\t\t}\n\t\t\t\tif err := validateDest(splitDestSecondary); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"in destination-secondary, %w\", err)\n\t\t\t\t}\n\t\t\t\tredundant = true\n\t\t\t}\n\n\t\t\tif len(splitSrcRouteFilter) != 2 {\n\t\t\t\treturn fmt.Errorf(\"source-route-filter must have format like \"+\n\t\t\t\t\t\"<routeFilter.in>,<routeFilter.out>: received %s\", srcRouteFilter)\n\t\t\t}\n\t\t\tif !utils.StringInSlice(splitSrcRouteFilter[0], validRouteFilterIns) {\n\t\t\t\treturn fmt.Errorf(\"routeFilter.in must be one of %s: received %s\", validRouteFilterIns, splitSrcRouteFilter[0])\n\t\t\t}\n\t\t\tif !utils.StringInSlice(splitSrcRouteFilter[1], validRouteFilterOuts) {\n\t\t\t\treturn fmt.Errorf(\"routeFilter.out must be one of %s: received %s\", validRouteFilterOuts, splitSrcRouteFilter[1])\n\t\t\t}\n\n\t\t\tif !utils.StringInSlice(bandwidth, validBandwidths) {\n\t\t\t\treturn fmt.Errorf(\"bandwidth must be one of %s: received %s\", validBandwidths, bandwidth)\n\t\t\t}\n\n\t\t\tclient, err := clientFn()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"creating FIC client: %w\", err)\n\t\t\t}\n\n\t\t\tprependIn, prependOut := interface{}(convPrepend(splitSrcPrimary[1])), interface{}(convPrepend(splitSrcPrimary[2]))\n\t\t\tmed, _ := strconv.Atoi(splitSrcPrimary[3])\n\t\t\tvlan, _ := strconv.Atoi(splitDestPrimary[1])\n\n\t\t\tt := utils.NewTabby(out)\n\t\t\tt.AddHeader(\"id\", \"name\", \"redundant\", \"tenantId\", \"area\", \"operationStatus\", \"bandwidth\", \"operationId\")\n\n\t\t\tif !redundant {\n\t\t\t\topts := singleConn.CreateOpts{\n\t\t\t\t\tName: args[0],\n\t\t\t\t\tSource: singleConn.Source{\n\t\t\t\t\t\tRouterID: srcRouterID,\n\t\t\t\t\t\tGroupName: srcGroupName,\n\t\t\t\t\t\tRouteFilter: singleConn.RouteFilter{\n\t\t\t\t\t\t\tIn: splitSrcRouteFilter[0],\n\t\t\t\t\t\t\tOut: splitSrcRouteFilter[1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tPrimary: singleConn.SourceHAInfo{\n\t\t\t\t\t\t\tIPAddress: splitSrcPrimary[0],\n\t\t\t\t\t\t\tASPathPrepend: singleConn.ASPathPrepend{\n\t\t\t\t\t\t\t\tIn: &prependIn,\n\t\t\t\t\t\t\t\tOut: &prependOut,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tMED: &singleConn.MED{\n\t\t\t\t\t\t\t\tOut: med,\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\tDestination: singleConn.Destination{\n\t\t\t\t\t\tPrimary: singleConn.DestinationHAInfo{\n\t\t\t\t\t\t\tPortID: splitDestPrimary[0],\n\t\t\t\t\t\t\tVLAN: vlan,\n\t\t\t\t\t\t\tIPAddress: splitDestPrimary[2],\n\t\t\t\t\t\t\tASN: splitDestPrimary[3],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBandwidth: bandwidth,\n\t\t\t\t}\n\n\t\t\t\tc, err := singleConn.Create(client, opts).Extract()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"calling Create router to port connection API: %w\", err)\n\t\t\t\t}\n\n\t\t\t\tt.AddLine(c.ID, c.Name, c.Redundant, c.TenantID, c.Area, c.OperationID, c.OperationStatus, c.Bandwidth)\n\t\t\t\tt.Print()\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tsecondPrependIn, secondPrependOut := interface{}(convPrepend(splitSrcSecondary[1])), interface{}(convPrepend(splitSrcSecondary[2]))\n\t\t\tsecondVlan, _ := strconv.Atoi(splitDestSecondary[1])\n\n\t\t\topts := pairedConn.CreateOpts{\n\t\t\t\tName: args[0],\n\t\t\t\tSource: pairedConn.Source{\n\t\t\t\t\tRouterID: srcRouterID,\n\t\t\t\t\tGroupName: srcGroupName,\n\t\t\t\t\tRouteFilter: pairedConn.RouteFilter{\n\t\t\t\t\t\tIn: splitSrcRouteFilter[0],\n\t\t\t\t\t\tOut: splitSrcRouteFilter[1],\n\t\t\t\t\t},\n\t\t\t\t\tPrimary: pairedConn.SourceHAInfo{\n\t\t\t\t\t\tIPAddress: splitSrcPrimary[0],\n\t\t\t\t\t\tASPathPrepend: pairedConn.ASPathPrepend{\n\t\t\t\t\t\t\tIn: &prependIn,\n\t\t\t\t\t\t\tOut: &prependOut,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMED: &pairedConn.MED{\n\t\t\t\t\t\t\tOut: med,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSecondary: pairedConn.SourceHAInfo{\n\t\t\t\t\t\tIPAddress: splitSrcSecondary[0],\n\t\t\t\t\t\tASPathPrepend: pairedConn.ASPathPrepend{\n\t\t\t\t\t\t\tIn: &secondPrependIn,\n\t\t\t\t\t\t\tOut: &secondPrependOut,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tDestination: pairedConn.Destination{\n\t\t\t\t\tPrimary: pairedConn.DestinationHAInfo{\n\t\t\t\t\t\tPortID: splitDestPrimary[0],\n\t\t\t\t\t\tVLAN: vlan,\n\t\t\t\t\t\tIPAddress: splitDestPrimary[2],\n\t\t\t\t\t\tASN: splitDestPrimary[3],\n\t\t\t\t\t},\n\t\t\t\t\tSecondary: pairedConn.DestinationHAInfo{\n\t\t\t\t\t\tPortID: splitDestSecondary[0],\n\t\t\t\t\t\tVLAN: secondVlan,\n\t\t\t\t\t\tIPAddress: splitDestSecondary[2],\n\t\t\t\t\t\tASN: splitDestSecondary[3],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBandwidth: bandwidth,\n\t\t\t}\n\n\t\t\tc, err := pairedConn.Create(client, opts).Extract()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"calling Create router to port connection API: %w\", err)\n\t\t\t}\n\n\t\t\tt.AddLine(c.ID, c.Name, c.Redundant, c.TenantID, c.Area, c.OperationID, c.OperationStatus, c.Bandwidth)\n\t\t\tt.Print()\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Flags().StringVar(&srcRouterID, \"source-router\", \"\", \"(Required) Router ID belonging to source\")\n\tcmd.Flags().StringVar(&srcGroupName, \"source-group\", \"\", \"(Required) Group Name belonging to source\")\n\tcmd.Flags().StringVar(\n\t\t&srcPrimary,\n\t\t\"source-primary\",\n\t\t\"\",\n\t\t\"(Required) Source Primary Info specified in the format <ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>,<med.out>\")\n\tcmd.Flags().StringVar(\n\t\t&srcSecondary,\n\t\t\"source-secondary\",\n\t\t\"\",\n\t\t\"Source Secondary Info specified in the format <ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>\")\n\tcmd.Flags().StringVar(\n\t\t&srcRouteFilter,\n\t\t\"source-route-filter\",\n\t\t\"\",\n\t\t\"(Required) Set of BGP Filter Ingress and Egress specified in the format <routeFilter.in>,<routeFilter.out>\")\n\tcmd.Flags().StringVar(\n\t\t&destPrimary,\n\t\t\"destination-primary\",\n\t\t\"\",\n\t\t\"(Required) Destination Primary Info specified in the format <portId>,<vlan>,<ipAddress>,<asn>\")\n\tcmd.Flags().StringVar(\n\t\t&destSecondary,\n\t\t\"destination-secondary\",\n\t\t\"\",\n\t\t\"Destination Secondary Info specified in the format <portId>,<vlan>,<ipAddress>,<asn>\")\n\tcmd.Flags().StringVar(&bandwidth, \"bandwidth\", \"\", \"(Required) Bandwidth of router to port connection\")\n\n\tcmd.MarkFlagRequired(\"source-router\")\n\tcmd.MarkFlagRequired(\"source-group\")\n\tcmd.MarkFlagRequired(\"source-primary\")\n\tcmd.MarkFlagRequired(\"source-rout-filter\")\n\tcmd.MarkFlagRequired(\"destination-primary\")\n\tcmd.MarkFlagRequired(\"bandwidth\")\n\n\treturn cmd\n}", "func (v *vcsCmd) Create(dir, repo string) error {\n\tfor _, cmd := range v.createCmd {\n\t\tif err := v.run(\".\", cmd, \"dir\", dir, \"repo\", repo); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func NewCmdCreate(out io.Writer) *cobra.Command {\n\tcf := &run.CreateFlags{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create <image>\",\n\t\tShort: \"Create a new VM without starting it\",\n\t\tLong: dedent.Dedent(`\n\t\t\tCreate a new VM by combining the given image and kernel.\n\t\t\tVarious VM tunables can be set during creation by using\n\t\t\tthe flags for this command. The image and kernel are\n\t\t\tmatched by prefix based on their ID and name.\n\t\t\t\n\t\t\tIf the name flag (-n, --name) is not specified,\n\t\t\tthe VM is given a random name. Using the copy files\n\t\t\tflag (-f, --copy-files), additional files can be added to\n\t\t\tthe VM during creation with the syntax /host/path:/vm/path.\n\n\t\t\tExample usage:\n\t\t\t\t$ ignite create my-image my-kernel \\\n\t\t\t\t\t--name my-vm \\\n\t\t\t\t\t--cpus 2 \\\n\t\t\t\t\t--memory 2048 \\\n\t\t\t\t\t--size 6GB\n\t\t`),\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terrutils.Check(func() error {\n\t\t\t\tco, err := cf.NewCreateOptions(loader.NewResLoader(), args[0])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\treturn run.Create(co)\n\t\t\t}())\n\t\t},\n\t}\n\n\taddCreateFlags(cmd.Flags(), cf)\n\treturn cmd\n}", "func NewInfo(\n\tparams []string,\n\trequestingUser string,\n) Action {\n\tinfoParams := []string{\"\"}\n\tfor i := range params {\n\t\tinfoParams[i] = params[i]\n\t}\n\n\treturn &info{\n\t\tparams: infoParams,\n\t\trequestingUser: requestingUser,\n\t}\n}", "func NewCmdPreviewCreate() (*cobra.Command, *Options) {\n\to := &Options{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Creates a preview\",\n\t\tLong: cmdLong,\n\t\tExample: fmt.Sprintf(cmdExample, rootcmd.BinaryName),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := o.Run()\n\t\t\thelper.CheckErr(err)\n\t\t},\n\t}\n\tcmd.Flags().IntVarP(&o.Number, \"pr\", \"\", 0, \"the Pull Request number. If not specified we will use $BRANCH_NAME\")\n\n\to.Options.AddFlags(cmd)\n\treturn cmd, o\n}", "func CreateCommand(args []string) (Command, error) {\n\tif len(args) <= 1 {\n\t\treturn nil, errors.New(\"expected at least one argument\")\n\t}\n\tcommand := args[1]\n\tswitch command {\n\tcase \"start\":\n\t\treturn &StartCommand{args}, nil\n\tcase \"end\":\n\t\treturn &EndCommand{args}, nil\n\t}\n\n\treturn nil, errors.New(fmt.Sprintf(\"Unsupported Command: %s\", command))\n}", "func CreateCommand(cfg Config) (Command, error) {\n\terr := cfg.CheckAndSetDefaults()\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tcmd := command{\n\t\tConfig: cfg,\n\t}\n\n\tcmd.log = log.WithFields(log.Fields{\n\t\ttrace.Component: \"SCP\",\n\t\ttrace.ComponentFields: log.Fields{\n\t\t\t\"LocalAddr\": cfg.Flags.LocalAddr,\n\t\t\t\"RemoteAddr\": cfg.Flags.RemoteAddr,\n\t\t\t\"Target\": cfg.Flags.Target,\n\t\t\t\"User\": cfg.User,\n\t\t\t\"RunOnServer\": cfg.RunOnServer,\n\t\t\t\"RemoteLocation\": cfg.RemoteLocation,\n\t\t},\n\t})\n\n\treturn &cmd, nil\n}", "func InfoCommand(c *cli.Context, i storage.Impl) (n storage.Note, err error) {\n\tnName, err := NoteName(c)\n\tif err != nil {\n\t\treturn storage.Note{}, err\n\t}\n\n\tn, err = i.LoadNote(nName)\n\tif err != nil {\n\t\treturn storage.Note{}, err\n\t}\n\n\treturn n, nil\n}", "func New() *cobra.Command {\n\tcommand := cobra.Command{\n\t\tUse: \"%template%\",\n\t\tShort: \"%template%\",\n\t\tLong: \"%template%\",\n\n\t\tArgs: cobra.NoArgs,\n\n\t\tSilenceErrors: false,\n\t\tSilenceUsage: true,\n\t}\n\n\t/* configure instance */\n\tcommand.AddCommand(\n\t\tdemo.Panic(),\n\t\tdemo.Stderr(),\n\t\tdemo.Stdout(),\n\t)\n\n\treturn &command\n}", "func NewVersionCommand(streams genericclioptions.IOStreams) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the version information for kubectl trace\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tfmt.Fprintln(streams.Out, version.String())\n\t\t\treturn nil\n\t\t},\n\t}\n\treturn cmd\n}", "func NewVersionCommand(isvrCli command.Cli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Display versions of the CLI and Server\",\n\t\tArgs: cli.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn runVersion(isvrCli)\n\t\t},\n\t}\n\n\treturn cmd\n}", "func RunInfo(ctx CommandContext, args InfoArgs) error {\n\t// FIXME: fmt.Fprintf(ctx.Stdout, \"Servers: %s\\n\", \"quantity\")\n\t// FIXME: fmt.Fprintf(ctx.Stdout, \"Images: %s\\n\", \"quantity\")\n\tfmt.Fprintf(ctx.Stdout, \"Debug mode (client):\\t%v\\n\", ctx.Getenv(\"DEBUG\") != \"\")\n\n\tfmt.Fprintf(ctx.Stdout, \"Organization:\\t\\t%s\\n\", ctx.API.Organization)\n\t// FIXME: add partially-masked token\n\tfmt.Fprintf(ctx.Stdout, \"API Endpoint:\\t\\t%s\\n\", api.ComputeAPI)\n\tconfigPath, _ := config.GetConfigFilePath()\n\tfmt.Fprintf(ctx.Stdout, \"RC file:\\t\\t%s\\n\", configPath)\n\tfmt.Fprintf(ctx.Stdout, \"User:\\t\\t\\t%s\\n\", ctx.Getenv(\"USER\"))\n\tfmt.Fprintf(ctx.Stdout, \"CPUs:\\t\\t\\t%d\\n\", runtime.NumCPU())\n\thostname, _ := os.Hostname()\n\tfmt.Fprintf(ctx.Stdout, \"Hostname:\\t\\t%s\\n\", hostname)\n\tcliPath, _ := osext.Executable()\n\tfmt.Fprintf(ctx.Stdout, \"CLI Path:\\t\\t%s\\n\", cliPath)\n\n\tfmt.Fprintln(ctx.Stdout, \"\")\n\tfmt.Fprintf(ctx.Stdout, \"Cache:\\t\\t\\t%s\\n\", ctx.API.Cache.Path)\n\tfmt.Fprintf(ctx.Stdout, \" Servers:\\t\\t%d\\n\", ctx.API.Cache.GetNbServers())\n\tfmt.Fprintf(ctx.Stdout, \" Images:\\t\\t%d\\n\", ctx.API.Cache.GetNbImages())\n\tfmt.Fprintf(ctx.Stdout, \" Snapshots:\\t\\t%d\\n\", ctx.API.Cache.GetNbSnapshots())\n\tfmt.Fprintf(ctx.Stdout, \" Volumes:\\t\\t%d\\n\", ctx.API.Cache.GetNbVolumes())\n\tfmt.Fprintf(ctx.Stdout, \" Bootscripts:\\t\\t%d\\n\", ctx.API.Cache.GetNbBootscripts())\n\n\tuser, err := ctx.API.GetUser()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to get your SSH Keys\")\n\t}\n\n\tif len(user.SSHPublicKeys) == 0 {\n\t\tfmt.Fprintln(ctx.Stdout, \"You have no ssh keys\")\n\t} else {\n\t\tfmt.Fprintln(ctx.Stdout, \"\")\n\t\tfmt.Fprintln(ctx.Stdout, \"SSH Keys:\")\n\t\tfor id, key := range user.SSHPublicKeys {\n\t\t\tfmt.Fprintf(ctx.Stdout, \" [%d] %s\\n\", id, key.Fingerprint)\n\t\t}\n\t\tfmt.Fprintf(ctx.Stdout, \"\\n\")\n\t}\n\n\tdashboard, err := ctx.API.GetDashboard()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to get your dashboard\")\n\t}\n\tfmt.Fprintln(ctx.Stdout, \"Dashboard:\")\n\tfmt.Fprintf(ctx.Stdout, \" Volumes:\\t\\t%d\\n\", dashboard.VolumesCount)\n\tfmt.Fprintf(ctx.Stdout, \" Running servers:\\t%d\\n\", dashboard.RunningServersCount)\n\tfmt.Fprintf(ctx.Stdout, \" Images:\\t\\t%d\\n\", dashboard.ImagesCount)\n\tfmt.Fprintf(ctx.Stdout, \" Snapshots:\\t\\t%d\\n\", dashboard.SnapshotsCount)\n\tfmt.Fprintf(ctx.Stdout, \" Servers:\\t\\t%d\\n\", dashboard.ServersCount)\n\tfmt.Fprintf(ctx.Stdout, \" Ips:\\t\\t\\t%d\\n\", dashboard.IPsCount)\n\n\tfmt.Fprintf(ctx.Stdout, \"\\n\")\n\tpermissions, err := ctx.API.GetPermissions()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to get your permisssions\")\n\t}\n\tfmt.Fprintln(ctx.Stdout, \"Permissions:\")\n\tfor _, service := range permissions.Permissions {\n\t\tfor key, serviceName := range service {\n\t\t\tfmt.Fprintf(ctx.Stdout, \" %s\\n\", key)\n\t\t\tfor _, perm := range serviceName {\n\t\t\t\tfmt.Fprintf(ctx.Stdout, \" %s\\n\", perm)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(ctx.Stdout, \"\\n\")\n\tquotas, err := ctx.API.GetQuotas()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to get your quotas\")\n\t}\n\tfmt.Fprintln(ctx.Stdout, \"Quotas:\")\n\tfor key, value := range quotas.Quotas {\n\t\tfmt.Fprintf(ctx.Stdout, \" %-20s: %d\\n\", key, value)\n\t}\n\treturn nil\n}", "func CreateChannelCmd(cdc *wire.Codec) *cobra.Command {\n\tflagTo := \"to\"\n\tflagCoins := \"amount\"\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a new payment channel\",\n\t\tLong: \"Create a new unidirectional payment channel from a local address to a remote address, funded with some amount of coins. These coins are removed from the sender account and put into the channel.\",\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\t// Create a \"client context\" stuct populated with info from common flags\n\t\t\tctx := context.NewCoreContextFromViper().WithDecoder(authcmd.GetAccountDecoder(cdc))\n\t\t\t// TODO is this needed for channelID\n\t\t\t// ctx.PrintResponse = true\n\n\t\t\t// Get sender adress\n\t\t\tsender, err := ctx.GetFromAddress()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Get receiver address\n\t\t\ttoStr := viper.GetString(flagTo)\n\t\t\treceiver, err := sdk.AccAddressFromBech32(toStr)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Get channel funding amount\n\t\t\tcoinsString := viper.GetString(flagCoins)\n\t\t\tcoins, err := sdk.ParseCoins(coinsString)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Create the create channel msg to send\n\t\t\tmsg := paychan.MsgCreate{\n\t\t\t\tParticipants: [2]sdk.AccAddress{sender, receiver},\n\t\t\t\tCoins: coins,\n\t\t\t}\n\t\t\terr = msg.ValidateBasic()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Build and sign the transaction, then broadcast to the blockchain\n\t\t\terr = ctx.EnsureSignBuildBroadcast(ctx.FromAddressName, []sdk.Msg{msg}, cdc)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tcmd.Flags().String(flagTo, \"\", \"Recipient address of the payment channel.\")\n\tcmd.Flags().String(flagCoins, \"\", \"Amount of coins to fund the payment channel with.\")\n\treturn cmd\n}", "func NewVersionCommand(settings *CmdSetting) *cobra.Command {\n\tversionCmd := &VersionCmd{settings: settings}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the version of kubectl-recreate\",\n\t\tSilenceUsage: true,\n\t\tRun: versionCmd.run,\n\t}\n\n\treturn cmd\n}", "func Version() cli.Command {\n\treturn cli.Command{\n\t\tName: \"version\",\n\t\tUsage: \"prints version information\",\n\t\tFlags: []cli.Flag{\n\t\t\tcli.BoolFlag{\n\t\t\t\tName: \"json\",\n\t\t\t\tUsage: \"specify this option to output data as JSON\",\n\t\t\t},\n\t\t},\n\t\tAction: func(c *cli.Context) error {\n\t\t\tisJSON := c.Bool(\"json\")\n\n\t\t\tinfo := versionInfo{\n\t\t\t\tCurator: curator.BuildRevision,\n\t\t\t\tJasper: curator.JasperChecksum,\n\t\t\t\tPoplarEvents: curator.PoplarEventsChecksum,\n\t\t\t\tPoplarRecorder: curator.PoplarRecorderChecksum,\n\t\t\t\tCedarMetrics: curator.CedarMetricsChecksum,\n\t\t\t}\n\t\t\tif isJSON {\n\t\t\t\tout, err := json.MarshalIndent(info, \"\", \" \")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"marshalling JSON\")\n\t\t\t\t}\n\t\t\t\tfmt.Println(string(out))\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tfmt.Println(info)\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func (n *NetworkCreateCommand) Init(c *Cli) {\n\tn.cli = c\n\n\tn.cmd = &cobra.Command{\n\t\tUse: \"create [OPTIONS] [NAME]\",\n\t\tShort: \"Create a pouch network\",\n\t\tLong: networkCreateDescription,\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn n.runNetworkCreate(args)\n\t\t},\n\t\tExample: networkCreateExample(),\n\t}\n\n\tn.addFlags()\n}", "func CreateParamsCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"zk\",\n\t\tShort: \"zk knowledge related parameters\",\n\t}\n\tcmd.AddCommand(mixCreateZkKeyCmd())\n\tcmd.AddCommand(mixReadZkKeyCmd())\n\n\treturn cmd\n}", "func NewCommand(\n\tname string,\n\tdescription string,\n\tversion string,\n\tnameConvertFunc spec.AttributeNameConverterFunc,\n\ttypeConvertFunc spec.AttributeTypeConverterFunc,\n\ttypeMappingName string,\n\tgeneratorFunc func([]spec.SpecificationSet, string) error,\n) *cobra.Command {\n\n\tcobra.OnInitialize(func() {\n\t\tviper.SetEnvPrefix(name)\n\t\tviper.AutomaticEnv()\n\t\tviper.SetEnvKeyReplacer(strings.NewReplacer(\"-\", \"_\"))\n\t})\n\n\tvar rootCmd = &cobra.Command{\n\t\tUse: name,\n\t\tShort: description,\n\t}\n\n\trootCmd.PersistentFlags().StringP(\"out\", \"o\", \"codegen\", \"Default output path.\")\n\n\tvar versionCmd = &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the version and exit.\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(version)\n\t\t},\n\t}\n\n\tvar cmdFolderGen = &cobra.Command{\n\t\tUse: \"folder\",\n\t\tShort: \"Generate the model using a local directory containing the specs.\",\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn viper.BindPFlags(cmd.Flags())\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tif len(viper.GetStringSlice(\"dir\")) == 0 {\n\t\t\t\treturn errors.New(\"--dir is required\")\n\t\t\t}\n\n\t\t\tvar specSets []spec.SpecificationSet\n\n\t\t\tfor _, dir := range viper.GetStringSlice(\"dir\") {\n\t\t\t\tset, err := spec.LoadSpecificationSet(\n\t\t\t\t\tdir,\n\t\t\t\t\tnameConvertFunc,\n\t\t\t\t\ttypeConvertFunc,\n\t\t\t\t\ttypeMappingName,\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tspecSets = append(specSets, set)\n\t\t\t}\n\n\t\t\treturn generatorFunc(specSets, viper.GetString(\"out\"))\n\t\t},\n\t}\n\tcmdFolderGen.Flags().StringSliceP(\"dir\", \"d\", nil, \"Path of the specifications folder.\")\n\n\tvar githubGen = &cobra.Command{\n\t\tUse: \"github\",\n\t\tShort: \"Generate the model using a remote github repository.\",\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn viper.BindPFlags(cmd.Flags())\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tspecSet, err := spec.LoadSpecificationSetFromGithub(\n\t\t\t\tviper.GetString(\"token\"),\n\t\t\t\tviper.GetString(\"repo\"),\n\t\t\t\tviper.GetString(\"ref\"),\n\t\t\t\tviper.GetString(\"path\"),\n\t\t\t\tnameConvertFunc,\n\t\t\t\ttypeConvertFunc,\n\t\t\t\ttypeMappingName,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn generatorFunc([]spec.SpecificationSet{specSet}, viper.GetString(\"out\"))\n\t\t},\n\t}\n\tgithubGen.Flags().StringP(\"repo\", \"r\", \"\", \"Endpoint for the github api.\")\n\tgithubGen.Flags().StringP(\"path\", \"p\", \"\", \"Internal path to a directory in the repo if not in the root.\")\n\tgithubGen.Flags().StringP(\"ref\", \"R\", \"master\", \"Branch or tag to use.\")\n\tgithubGen.Flags().StringP(\"token\", \"t\", \"\", \"The api token to use.\")\n\n\trootCmd.AddCommand(\n\t\tversionCmd,\n\t\tcmdFolderGen,\n\t\tgithubGen,\n\t)\n\n\treturn rootCmd\n}", "func CreateCommand(srv *server.Server) (cmd command.LundeCommand, err error) {\n\tth := textHandler{srv}\n\tcmd = command.LundeCommand{\n\t\tHandleInteraction: th.handleInteraction,\n\t\tCommandData: api.CreateCommandData{\n\t\t\tName: \"text\",\n\t\t\tDescription: \"corrupt or convert a given message, or the last message in the channel\",\n\t\t\tOptions: []discord.CommandOption{\n\t\t\t\t&discord.StringOption{\n\t\t\t\t\tOptionName: \"algo\",\n\t\t\t\t\tDescription: \"what algorithm to convert/corrupt the text with\",\n\t\t\t\t\tRequired: true,\n\t\t\t\t\tChoices: []discord.StringChoice{\n\t\t\t\t\t\t{Name: \"spunge\", Value: \"spunge\"},\n\t\t\t\t\t\t{Name: \"zalgo\", Value: \"zalgo\"},\n\t\t\t\t\t\t{Name: \"chonk\", Value: \"chonk\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&discord.StringOption{\n\t\t\t\t\tOptionName: \"message\",\n\t\t\t\t\tDescription: \"optional message to convert/corrupt\",\n\t\t\t\t\tRequired: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\treturn\n}", "func (factory *ListWsFactory) CreateCommand() BaseCommand {\n\n\treturn BaseCommand{\n\t\tCommand: \"ls\",\n\t\tDescription: \"List all workspaces with fancy information.\",\n\t\tAliases: []string{},\n\t\tAction: func(c WSCommandContext) {\n\t\t\tfactory.listWsExec(&c)\n\t\t},\n\t\tFlags: []StringFlag{\n\t\t\tStringFlag{\n\t\t\t\t\"table\",\n\t\t\t\t\"formats the table using the `template`\",\n\t\t\t},\n\t\t},\n\t}\n}", "func (srv *Server) CmdInfo(stdin io.ReadCloser, stdout io.Writer, args ...string) error {\n\timages, _ := srv.runtime.graph.All()\n\tvar imgcount int\n\tif images == nil {\n\t\timgcount = 0\n\t} else {\n\t\timgcount = len(images)\n\t}\n\tcmd := rcli.Subcmd(stdout, \"info\", \"\", \"Display system-wide information.\")\n\tif err := cmd.Parse(args); err != nil {\n\t\treturn nil\n\t}\n\tif cmd.NArg() > 0 {\n\t\tcmd.Usage()\n\t\treturn nil\n\t}\n\tfmt.Fprintf(stdout, \"containers: %d\\nversion: %s\\nimages: %d\\n\",\n\t\tlen(srv.runtime.List()),\n\t\tVERSION,\n\t\timgcount)\n\n\tif !rcli.DEBUG_FLAG {\n\t\treturn nil\n\t}\n\tfmt.Fprintln(stdout, \"debug mode enabled\")\n\tfmt.Fprintf(stdout, \"fds: %d\\ngoroutines: %d\\n\", getTotalUsedFds(), runtime.NumGoroutine())\n\treturn nil\n}", "func New() *Info {\n\tthis := new(Info)\n\tthis.Prompt = \">>>\"\n\tthis.In = os.Stdin\n\tthis.Out = os.Stdout\n\tthis.Escape = '\\\\'\n\tthis.char = make([]byte, 1, 1)\n\treturn this\n}", "func (cc *ComplaintCreate) SetInfo(s string) *ComplaintCreate {\n\tcc.mutation.SetInfo(s)\n\treturn cc\n}", "func info(command interface{}) (*CommandInfo, error) {\n\ttypeof := reflect.TypeOf(command)\n\n\t// Going up the pointer chain to find the underlying struct\n\tfor typeof.Kind() == reflect.Ptr {\n\t\ttypeof = typeof.Elem()\n\t}\n\n\tfield, ok := typeof.FieldByName(\"_\")\n\tif !ok {\n\t\treturn nil, fmt.Errorf(`missing meta (\"_\") field in %#v`, command)\n\t}\n\n\tname, nameOk := field.Tag.Lookup(\"name\")\n\tdescription, _ := field.Tag.Lookup(\"description\")\n\n\tif !nameOk {\n\t\treturn nil, fmt.Errorf(`missing \"name\" key in the tag string of %#v`, command)\n\t}\n\n\tinfo := &CommandInfo{\n\t\tName: name,\n\t\tDescription: description,\n\t}\n\n\treturn info, nil\n}", "func (e *DefaultExecutor) runInfoCommand(args []string, isAuthChannel bool) string {\n\tif !isAuthChannel {\n\t\treturn \"\"\n\t}\n\tif len(args) > 1 && args[1] != string(infoList) {\n\t\treturn IncompleteCmdMsg\n\t}\n\n\tclusterName := e.cfg.Settings.ClusterName\n\tif len(args) > 3 && args[2] == ClusterFlag.String() && args[3] != clusterName {\n\t\treturn fmt.Sprintf(WrongClusterCmdMsg, args[3])\n\t}\n\n\tallowedVerbs := e.getSortedEnabledCommands(\"allowed verbs\", e.resMapping.AllowedKubectlVerbMap)\n\tallowedResources := e.getSortedEnabledCommands(\"allowed resources\", e.resMapping.AllowedKubectlResourceMap)\n\treturn fmt.Sprintf(\"%s%s\", allowedVerbs, allowedResources)\n}", "func NewCmdCreate(o *options.ArgoRolloutsOptions) *cobra.Command {\n\tcreateOptions := CreateOptions{\n\t\tArgoRolloutsOptions: *o,\n\t}\n\tvar cmd = &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a Rollout, Experiment, AnalysisTemplate, ClusterAnalysisTemplate, or AnalysisRun resource\",\n\t\tLong: \"This command creates a new Rollout, Experiment, AnalysisTemplate, ClusterAnalysisTemplate, or AnalysisRun resource from a file.\",\n\t\tExample: o.Example(createExample),\n\t\tSilenceUsage: true,\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tcreateOptions.DynamicClientset()\n\t\t\tif len(createOptions.Files) == 0 {\n\t\t\t\treturn o.UsageErr(c)\n\t\t\t}\n\t\t\tif len(createOptions.Files) > 1 && createOptions.Watch {\n\t\t\t\treturn errors.New(\"Cannot watch multiple resources\")\n\t\t\t}\n\n\t\t\tvar objs []runtime.Object\n\t\t\tfor _, f := range createOptions.Files {\n\t\t\t\tobj, err := createOptions.createResource(f)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tobjs = append(objs, obj)\n\t\t\t}\n\t\t\tif createOptions.Watch {\n\t\t\t\tswitch obj := objs[0].(type) {\n\t\t\t\tcase *v1alpha1.Rollout:\n\t\t\t\t\tgetCmd := get.NewCmdGetRollout(o)\n\t\t\t\t\tgetCmd.SetArgs([]string{obj.Name, \"--watch\"})\n\t\t\t\t\treturn getCmd.Execute()\n\t\t\t\tcase *v1alpha1.Experiment:\n\t\t\t\t\tgetCmd := get.NewCmdGetExperiment(o)\n\t\t\t\t\tgetCmd.SetArgs([]string{obj.Name, \"--watch\"})\n\t\t\t\t\treturn getCmd.Execute()\n\t\t\t\tdefault:\n\t\t\t\t\treturn errors.New(\"Can only watch resources of type Rollout or Experiment\")\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tcmd.AddCommand(NewCmdCreateAnalysisRun(o))\n\tcmd.Flags().StringArrayVarP(&createOptions.Files, \"filename\", \"f\", []string{}, \"Files to use to create the resource\")\n\tcmd.Flags().BoolVarP(&createOptions.Watch, \"watch\", \"w\", false, \"Watch live updates to the resource after creating\")\n\tcmd.Flags().BoolVar(&createOptions.NoColor, \"no-color\", false, \"Do not colorize output\")\n\treturn cmd\n}", "func NewCommand(version string) *cobra.Command {\n\trootCommand := &cobra.Command{\n\t\tUse: name,\n\t\tVersion: version,\n\t}\n\trootCommand.SetOut(logrus.New().Out)\n\n\tfor _, sourceProvider := range source.GetProviderList() {\n\t\tsourceCmd := &cobra.Command{\n\t\t\tUse: sourceProvider.Name(),\n\t\t\tShort: fmt.Sprintf(`Fetch data from source \"%s\"`, sourceProvider.Name()),\n\t\t}\n\t\tif sourceProvider.Deprecated() {\n\t\t\tsourceCmd.Deprecated = fmt.Sprintf(`source \"%s\" is deprecated`, sourceProvider.Name())\n\t\t}\n\t\tfor _, registryProvider := range registry.GetProviderList() {\n\t\t\tregistryCmd := &cobra.Command{\n\t\t\t\tUse: registryProvider.Name(),\n\t\t\t\tShort: fmt.Sprintf(`Save data in registry \"%s\"`, registryProvider.Name()),\n\t\t\t}\n\t\t\tif registryProvider.Deprecated() {\n\t\t\t\tregistryCmd.Deprecated = fmt.Sprintf(`registry \"%s\" is deprecated`, registryProvider.Name())\n\t\t\t}\n\t\t\tonceCommand := &cobra.Command{\n\t\t\t\tUse: `once`,\n\t\t\t\tShort: `Run main process only once: sync and return result`,\n\t\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\t\tmanager, cleanup, err := newManager(cmd.Flags(), sourceProvider.Factory(), registryProvider.Factory())\n\t\t\t\t\tif cleanup != nil {\n\t\t\t\t\t\tcleanup()\n\t\t\t\t\t}\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn errors.Wrap(err, `failed to bootstrap manager`)\n\t\t\t\t\t}\n\t\t\t\t\treturn manager.Run(cmd.Context())\n\t\t\t\t},\n\t\t\t}\n\t\t\twatchCommand := &cobra.Command{\n\t\t\t\tUse: `watch`,\n\t\t\t\tShort: `Run main process as daemon: sync repeatedly with constant interval`,\n\t\t\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t\t\tsc, cleanup, err := newScheduler(cmd.Flags(), sourceProvider.Factory(), registryProvider.Factory())\n\t\t\t\t\tif cleanup != nil {\n\t\t\t\t\t\tcleanup()\n\t\t\t\t\t}\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn errors.Wrap(err, `failed to bootstrap scheduler`)\n\t\t\t\t\t}\n\t\t\t\t\tsc.Run(cmd.Context())\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t}\n\t\t\twatchCommand.Flags().Duration(`scheduler.interval`, time.Minute, `Interval between manager runs (1s, 1m, 5m, 1h and others)`)\n\t\t\tregistryCmd.PersistentFlags().Bool(`manager.continue-on-error`, false, `Omit errors during process manager`)\n\t\t\tregistryCmd.PersistentFlags().Bool(`manager.exit-on-error`, false, `Stop manager process on first error and by pass it to command line`)\n\t\t\t_ = registryCmd.PersistentFlags().MarkDeprecated(`manager.continue-on-error`, `Flag \"manager.continue-on-error\" is deprecated, use \"manager.exit-on-error\" instead`)\n\t\t\t_ = registryCmd.PersistentFlags().MarkHidden(`manager.continue-on-error`)\n\t\t\tregistryCmd.PersistentFlags().AddFlagSet(registryProvider.Flags())\n\t\t\tregistryCmd.AddCommand(onceCommand)\n\t\t\tregistryCmd.AddCommand(watchCommand)\n\t\t\tsourceCmd.AddCommand(registryCmd)\n\t\t}\n\t\tsourceCmd.PersistentFlags().AddFlagSet(sourceProvider.Flags())\n\t\trootCommand.AddCommand(sourceCmd)\n\t}\n\trootCommand.PersistentFlags().String(`logger.level`, logrus.InfoLevel.String(), `Log level`)\n\treturn rootCommand\n}", "func (c *CoinInfoClient) Create() *CoinInfoCreate {\n\tmutation := newCoinInfoMutation(c.config, OpCreate)\n\treturn &CoinInfoCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "func NewCommand() (cmd *cobra.Command) {\n\tcmd = &cobra.Command{Use: \"binctl\", Run: func(cmd *cobra.Command, args []string) {\n\t\t//fmt.Println(\"Operate pipeline\")\n\t\t//fmt.Println(\"init binctl\")\n\t}}\n\tcmd.AddCommand(cmdMemory())\n\tcmd.AddCommand(cmdPipeline())\n\tcmd.PersistentFlags().String(\"config\", \"./configs/binlogo.yaml\", \"config file default is ./configs/binlogo.yaml\")\n\terr := viper.BindPFlag(\"config\", cmd.PersistentFlags().Lookup(\"config\"))\n\t// configs.InitViperFromFile(viper.GetString(\"config\"))\n\tconfigs.Init(viper.GetString(\"config\"))\n\t//etcd2.DefaultETCD()\n\tblog.Env(configs.Env(viper.GetString(\"env\")))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn\n}", "func (bot *DiscordBot) CreateCommand(ctx context.Context, command *discordgo.ApplicationCommand) error {\n\tbot.logger.Info(\"Create command\", \"command\", command)\n\n\t// TODO: store the output somewhere\n\t// _, err := session.ApplicationCommandCreate(session.State.User.ID, \"\", applicationCommand)\n\t// if err != nil {\n\t// \treturn fmt.Errorf(\"create command '%s': %w\", name, err)\n\t// }\n\n\treturn nil\n}", "func CreateCommand(id IDType, op CommandOp, key, value []byte) *Command {\n\tcmd := Command{ID: id, Op: op, Key: key, Value: value}\n\n\treturn &cmd\n}", "func NewPingCreateCommand(p *commands.KnParams) *cobra.Command {\n\tvar updateFlags pingUpdateFlags\n\tvar sinkFlags flags.SinkFlags\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create NAME --sink SINK\",\n\t\tShort: \"Create a ping source\",\n\t\tExample: `\n # Create a Ping source 'my-ping' which fires every two minutes and sends '{ value: \"hello\" }' to service 'mysvc' as a cloudevent\n kn source ping create my-ping --schedule \"*/2 * * * *\" --data '{ value: \"hello\" }' --sink ksvc:mysvc`,\n\n\t\tRunE: func(cmd *cobra.Command, args []string) (err error) {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn errors.New(\"requires the name of the Ping source to create as single argument\")\n\n\t\t\t}\n\t\t\tname := args[0]\n\n\t\t\tpingSourceClient, err := newPingSourceClient(p, cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tnamespace, err := p.GetNamespace(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdynamicClient, err := p.NewDynamicClient(namespace)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tdestination, err := sinkFlags.ResolveSink(cmd.Context(), dynamicClient, namespace)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tceOverridesMap, err := util.MapFromArrayAllowingSingles(updateFlags.ceOverrides, \"=\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tceOverridesToRemove := util.ParseMinusSuffix(ceOverridesMap)\n\n\t\t\tdata, dataBase64, err := getDataFields(&updateFlags)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot create PingSource %q in namespace \"+\n\t\t\t\t\t\"%q because: %s\", name, namespace, err)\n\t\t\t}\n\n\t\t\terr = pingSourceClient.CreatePingSource(cmd.Context(), clientsourcesv1beta2.NewPingSourceBuilder(name).\n\t\t\t\tSchedule(updateFlags.schedule).\n\t\t\t\tData(data).\n\t\t\t\tDataBase64(dataBase64).\n\t\t\t\tSink(*destination).\n\t\t\t\tCloudEventOverrides(ceOverridesMap, ceOverridesToRemove).\n\t\t\t\tBuild())\n\t\t\tif err == nil {\n\t\t\t\tfmt.Fprintf(cmd.OutOrStdout(), \"Ping source '%s' created in namespace '%s'.\\n\", args[0], pingSourceClient.Namespace())\n\t\t\t}\n\t\t\treturn err\n\t\t},\n\t}\n\tcommands.AddNamespaceFlags(cmd.Flags(), false)\n\tupdateFlags.addFlags(cmd)\n\tsinkFlags.Add(cmd)\n\tcmd.MarkFlagRequired(\"sink\")\n\n\treturn cmd\n}", "func newCertCreateCaCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create-ca\",\n\t\tShort: \"create a CA Certificate and Key\",\n\t\tPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tgApp.Config.SetLocalFlagsFromFile(cmd)\n\t\t},\n\t\tRunE: gApp.RunECertCreateCa,\n\t\tSilenceUsage: true,\n\t}\n\tgApp.InitCertCreateCaFlags(cmd)\n\treturn cmd\n}", "func NewVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints out build version information\",\n\t\tLong: \"Prints out build version information\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(`Version: %v\nGitRevision: %v\nGolangVersion: %v\n`,\n\t\t\t\tversion.VelaVersion,\n\t\t\t\tversion.GitRevision,\n\t\t\t\truntime.Version())\n\t\t},\n\t\tAnnotations: map[string]string{\n\t\t\ttypes.TagCommandType: types.TypePlugin,\n\t\t},\n\t}\n}", "func NewCommandNode(info token.FileInfo, name string, multiline bool) *CommandNode {\n\treturn &CommandNode{\n\t\tNodeType: NodeCommand,\n\t\tFileInfo: info,\n\n\t\tname: name,\n\t\tmulti: multiline,\n\t}\n}", "func handleNewCommand() {\n\tneoCliRoot := os.Getenv(\"GOPATH\") + \"/src/github.com/ivpusic/neo/cmd/neo\"\n\n\tif len(*templateName) == 0 {\n\t\tlogger.Info(\"Creating Neo project\")\n\t\trunCmd(neoCliRoot+\"/scripts/neo-template\", []string{*projectName})\n\n\t} else {\n\t\tswitch *templateName {\n\t\tcase \"angular\":\n\t\t\tlogger.Info(\"Creating Neo Angular project\")\n\t\t\trunCmd(neoCliRoot+\"/scripts/angular-template\", []string{*projectName})\n\t\tcase \"html\":\n\t\t\tlogger.Info(\"Creating Neo HTML project\")\n\t\t\trunCmd(neoCliRoot+\"/scripts/neo-html-template\", []string{*projectName})\n\t\tdefault:\n\t\t\tlogger.Errorf(\"Unkonown template %s!\", *projectName)\n\t\t}\n\t}\n}", "func NewVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the kperf version\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcmd.Printf(\"Version: %s\\n\", Version)\n\t\t\tcmd.Printf(\"Build Date: %s\\n\", BuildDate)\n\t\t\tcmd.Printf(\"Git Revision: %s\\n\", GitRevision)\n\t\t\treturn nil\n\t\t},\n\t}\n}", "func Main() *cobra.Command {\n\tcreateCmd := preview.NewCmdPreviewLegacy()\n\n\tcmd := &cobra.Command{\n\t\tUse: rootcmd.TopLevelCommand,\n\t\tShort: \"Preview commands\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif len(args) <= 1 {\n\t\t\t\tlog.Logger().Info(\"aliasing this to the create command\")\n\t\t\t\terr := createCmd.ParseFlags(args)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Logger().Errorf(err.Error())\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tcreateCmd.Run(cmd, args)\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr := cmd.Help()\n\t\t\tif err != nil {\n\t\t\t\tlog.Logger().Errorf(err.Error())\n\t\t\t}\n\t\t},\n\t\tDisableFlagParsing: true,\n\t}\n\tcmd.AddCommand(createCmd)\n\tcmd.AddCommand(cobras.SplitCommand(version.NewCmdVersion()))\n\treturn cmd\n}", "func newVersion() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"show build version\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tfmt.Println(version)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn cmd\n}", "func (c *Chip) createInfoWatcher() error {\n\tiw, err := newInfoWatcher(int(c.f.Fd()),\n\t\tfunc(lic LineInfoChangeEvent) {\n\t\t\tc.mu.Lock()\n\t\t\tich := c.ich[lic.Info.Offset]\n\t\t\tc.mu.Unlock() // handler called outside lock\n\t\t\tif ich != nil {\n\t\t\t\tich(lic)\n\t\t\t}\n\t\t},\n\t\tc.options.abi)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.iw = iw\n\tc.ich = map[int]InfoChangeHandler{}\n\treturn nil\n}", "func newActivateCmd(clientFn func() (*fic.ServiceClient, error), out io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"activate <id>\",\n\t\tShort: \"Activate port\",\n\t\tExample: \"fic ports activate F012000000168\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tclient, err := clientFn()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"creating FIC client: %w\", err)\n\t\t\t}\n\n\t\t\tport, err := ports.Activate(client, args[0]).Extract()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"calling Activate port API: %w\", err)\n\t\t\t}\n\n\t\t\tt := utils.NewTabby(out)\n\t\t\tt.AddHeader(\"id\", \"name\", \"operationStatus\", \"isActivated\", \"vlanRanges\", \"tenantID\", \"switchName\",\n\t\t\t\t\"portType\", \"location\", \"area\", \"operationID\")\n\t\t\tt.AddLine(port.ID, port.Name, port.OperationStatus, port.IsActivated, port.VLANRanges, port.TenantID, port.SwitchName,\n\t\t\t\tport.PortType, port.Location, port.Area, port.OperationID)\n\t\t\tt.Print()\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewVersionCommand() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tArgs: cobra.NoArgs,\n\t\tShort: \"Print the stanza version\",\n\t\tRun: func(_ *cobra.Command, _ []string) {\n\t\t\tfmt.Println(version.GetVersion(), runtime.GOOS, runtime.GOARCH)\n\t\t},\n\t}\n}", "func NewVersionCommand(version string, buildDate string, out io.Writer) *cobra.Command {\n\tversionCmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"display the current version\",\n\t\tLong: \"display the current version\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Fprintf(out, \"Primes Worker:\\n\")\n\t\t\tfmt.Fprintf(out, \" Version: %s\\n\", version)\n\t\t\tfmt.Fprintf(out, \" Built: %s\\n\", buildDate)\n\t\t\tfmt.Fprintf(out, \" Go Version: %s\\n\", runtime.Version())\n\t\t},\n\t}\n\n\treturn versionCmd\n}", "func NewCmdURLCreate(name, fullName string) *cobra.Command {\n\to := NewURLCreateOptions()\n\turlCreateCmd := &cobra.Command{\n\t\tUse: name + \" [url name]\",\n\t\tShort: urlCreateShortDesc,\n\t\tLong: urlCreateLongDesc,\n\t\tExample: fmt.Sprintf(urlCreateExample, fullName),\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tgenericclioptions.GenericRun(o, cmd, args)\n\t\t},\n\t}\n\turlCreateCmd.Flags().IntVarP(&o.urlPort, \"port\", \"\", -1, \"Port number for the url of the component, required in case of components which expose more than one service port\")\n\t// if experimental mode is enabled, add more flags to support ingress creation or docker application based on devfile\n\to.isExperimental = experimental.IsExperimentalModeEnabled()\n\tif o.isExperimental {\n\t\to.isDocker = pushtarget.IsPushTargetDocker()\n\t\tif o.isDocker {\n\t\t\turlCreateCmd.Flags().IntVarP(&o.exposedPort, \"exposed-port\", \"\", -1, \"External port to the application container\")\n\t\t\turlCreateCmd.Flags().BoolVarP(&o.forceFlag, \"force\", \"f\", false, \"Don't ask for confirmation, assign an exposed port directly\")\n\t\t\turlCreateCmd.Example = fmt.Sprintf(urlCreateExampleDocker, fullName)\n\t\t} else {\n\t\t\turlCreateCmd.Flags().StringVar(&o.tlsSecret, \"tls-secret\", \"\", \"TLS secret name for the url of the component if the user bring their own TLS secret\")\n\t\t\turlCreateCmd.Flags().StringVarP(&o.host, \"host\", \"\", \"\", \"Cluster IP for this URL\")\n\t\t\turlCreateCmd.Flags().BoolVarP(&o.secureURL, \"secure\", \"\", false, \"Create a secure HTTPS URL\")\n\t\t\turlCreateCmd.Flags().BoolVar(&o.wantIngress, \"ingress\", false, \"Create an Ingress instead of Route on OpenShift clusters\")\n\t\t\turlCreateCmd.Example = fmt.Sprintf(urlCreateExampleExperimental, fullName)\n\t\t}\n\t} else {\n\t\turlCreateCmd.Flags().BoolVarP(&o.secureURL, \"secure\", \"\", false, \"Create a secure HTTPS URL\")\n\t\turlCreateCmd.Example = fmt.Sprintf(urlCreateExample, fullName)\n\t}\n\tgenericclioptions.AddNowFlag(urlCreateCmd, &o.now)\n\to.AddContextFlag(urlCreateCmd)\n\tcompletion.RegisterCommandFlagHandler(urlCreateCmd, \"context\", completion.FileCompletionHandler)\n\n\treturn urlCreateCmd\n}", "func createCommandVM() {\n\tVmCommand = goja.New()\n\n\terr := VmCommand.Set(\"call\", Call)\n\tif err != nil {\n\t\t//TODO write to error log\n\t\tfmt.Println(err)\n\t}\n\terr = VmCommand.Set(\"printToLog\", PrintToLog)\n\tif err != nil {\n\t\tWriteErrorLog(err.Error(), \"\")\n\t}\n\terr = VmCommand.Set(\"callCompare\", CallCompare)\n\tif err != nil {\n\t\t//TODO write to error log\n\t\tfmt.Println(err)\n\t}\n\terr = VmCommand.Set(\"callContains\", CallContains)\n\tif err != nil {\n\t\t//TODO write to error log\n\t\tfmt.Println(err)\n\t}\n\terr = VmCommand.Set(\"printToConsole\", PrintToConsole)\n\tif err != nil {\n\t\t//TODO write to error log\n\t\tfmt.Println(err)\n\t}\n\terr = VmCommand.Set(\"shell\", Shell)\n\tif err != nil {\n\t\t//TODO write to error log\n\t\tfmt.Println(err)\n\t}\n}", "func New(cmd *cobra.Command, args []string) {\n\t// Create object for current working directory\n\tpwd, err := teflon.NewTeflonObject(\".\")\n\tif err != nil {\n\t\tlog.Fatalln(\"Couldn't create object for '.' :\", err)\n\t}\n\n\t// Create a show.\n\tif showFlag {\n\t\tnshws, err := pwd.CreateShow(args[0], newShowProtoFlag)\n\t\tif err != nil {\n\t\t\tlog.Fatalln(\"ABORT: Couldnt create show:\", err)\n\t\t}\n\t\tfor _, shw := range nshws {\n\t\t\tfmt.Println(shw.Path)\n\t\t}\n\t\treturn\n\t}\n\n\t// If nothing else commands otherwise new will create an ordinary file-system\n\t// object.\n\tnobjs, err := pwd.CreateObject(args[0], newFileFlag)\n\tif err != nil {\n\t\tlog.Fatalln(\"ABORT: Couldn't create objects:\", err)\n\t}\n\tclose(teflon.Events)\n\tfor _, obj := range nobjs {\n\t\tfmt.Println(obj.Path)\n\t}\n}", "func (task SchTask) Create(taskcreate TaskCreate) string {\n\tcmds := task.TaskMake(taskcreate, _Create.Command, true)\n\n\tif Debug {\n\t\treturn dbgMessage\n\t}\n\n\tcmd := exec.Command(task.bin, cmds...)\n\n\toutput, err := cmd.CombinedOutput()\n\tcatch(output, err)\n\n\treturn string(output)\n}", "func CommandCreate(appName string) error {\n\tif err := common.IsValidAppName(appName); err != nil {\n\t\treturn err\n\t}\n\n\treturn createApp(appName)\n}", "func (c *ProjectsTransferConfigsCreateCall) VersionInfo(versionInfo string) *ProjectsTransferConfigsCreateCall {\n\tc.urlParams_.Set(\"versionInfo\", versionInfo)\n\treturn c\n}", "func NewGenerateCmd(client *registry.HTTPClient) *cobra.Command {\n\tgenerateCmd := &cobra.Command{\n\t\tUse: \"generate\",\n\t\tShort: \"Generate a Lockfile to track image digests\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := validateGenerateCmdFlags(cmd); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tenvPath, err := cmd.Flags().GetString(\"env-file\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tenvPath = filepath.ToSlash(envPath)\n\t\t\t_ = godotenv.Load(envPath)\n\t\t\twm, err := getDefaultWrapperManager(cmd, client)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tgenerator, err := generate.NewGenerator(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlFile, err := os.Create(generator.LockfileName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer lFile.Close()\n\t\t\tif err := generator.GenerateLockfile(wm, lFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tgenerateCmd.Flags().String(\n\t\t\"base-dir\", \".\", \"Top level directory to collect files from\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfiles\", []string{}, \"Path to Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"compose-files\", []string{}, \"Path to docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfile-globs\", []string{}, \"Glob pattern to select Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"compose-file-globs\", []string{},\n\t\t\"Glob pattern to select docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-recursive\", false, \"Recursively collect Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"compose-file-recursive\", false,\n\t\t\"Recursively collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"lockfile-name\", \"docker-lock.json\",\n\t\t\"Lockfile name to be output in the current working directory\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"config-file\", getDefaultConfigPath(),\n\t\t\"Path to config file for auth credentials\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"env-file\", \".env\", \"Path to .env file\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-env-build-args\", false,\n\t\t\"Use environment vars as build args for Dockerfiles\",\n\t)\n\treturn generateCmd\n}", "func Create(instructionData reflect.Value, finished chan bool) int {\n\tfmt.Println(\"FIBER INFO: Creating File ...\")\n\n\tpath, err := variable.GetValue(instructionData, \"PathVarName\", \"PathIsVar\", \"Path\")\n\tif err != nil {\n\t\tfinished <- true\n\t\treturn -1\n\t}\n\n\tf, _ := os.Create(path.(string))\n\tf.Close()\n\tfinished <- true\n\treturn -1\n}", "func (p *MetadataServiceClient) CreateHostInfo(request *CreateHostInfoRequest) (err error) {\n if err = p.sendCreateHostInfo(request); err != nil { return }\n return p.recvCreateHostInfo()\n}", "func NewCreateCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CreateCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog: log.GetInstance(),\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a new virtual cluster\",\n\t\tLong: `\n#######################################################\n################### vcluster create ###################\n#######################################################\nCreates a new virtual cluster\n\nExample:\nvcluster create test --namespace test\n#######################################################\n\t`,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\t// Check for newer version\n\t\t\tupgrade.PrintNewerVersionWarning()\n\n\t\t\treturn cmd.Run(cobraCmd, args)\n\t\t},\n\t}\n\n\tcobraCmd.Flags().StringVar(&cmd.ChartVersion, \"chart-version\", upgrade.GetVersion(), \"The virtual cluster chart version to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ChartName, \"chart-name\", \"vcluster\", \"The virtual cluster chart name to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ChartRepo, \"chart-repo\", \"https://charts.loft.sh\", \"The virtual cluster chart repo to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ReleaseValues, \"release-values\", \"\", \"Path where to load the virtual cluster helm release values from\")\n\tcobraCmd.Flags().StringVar(&cmd.K3SImage, \"k3s-image\", \"\", \"If specified, use this k3s image version\")\n\tcobraCmd.Flags().StringSliceVarP(&cmd.ExtraValues, \"extra-values\", \"f\", []string{}, \"Path where to load extra helm values from\")\n\tcobraCmd.Flags().BoolVar(&cmd.CreateNamespace, \"create-namespace\", true, \"If true the namespace will be created if it does not exist\")\n\tcobraCmd.Flags().BoolVar(&cmd.DisableIngressSync, \"disable-ingress-sync\", false, \"If true the virtual cluster will not sync any ingresses\")\n\tcobraCmd.Flags().BoolVar(&cmd.CreateClusterRole, \"create-cluster-role\", false, \"If true a cluster role will be created to access nodes, storageclasses and priorityclasses\")\n\tcobraCmd.Flags().BoolVar(&cmd.Expose, \"expose\", false, \"If true will create a load balancer service to expose the vcluster endpoint\")\n\tcobraCmd.Flags().BoolVar(&cmd.Connect, \"connect\", false, \"If true will run vcluster connect directly after the vcluster was created\")\n\treturn cobraCmd\n}", "func NewCmdVersion(w io.Writer) *cobra.Command {\n\tvar short bool\n\n\tversionCmd := cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the kustomize version\",\n\t\tExample: `kustomize version`,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif short {\n\t\t\t\tfmt.Fprintln(w, provenance.GetProvenance().Short())\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(w, provenance.GetProvenance().Full())\n\t\t\t}\n\t\t},\n\t}\n\n\tversionCmd.Flags().BoolVar(&short, \"short\", false, \"short form\")\n\treturn &versionCmd\n}", "func newVersionCommands(globalOpts *globalOptions) *cobra.Command {\n\toptions := &versionOptions{\n\t\tglobalOptions: globalOpts,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the CLI version information\",\n\t\tLong: versionDesc,\n\t\tExample: versionExample,\n\t\tArgs: cobra.ExactArgs(0),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn options.run()\n\t\t},\n\t}\n\n\toptions.addVersionFlags(cmd)\n\n\treturn cmd\n}" ]
[ "0.67512655", "0.63318264", "0.6103407", "0.60789835", "0.5999456", "0.5973875", "0.5964833", "0.5921458", "0.5850257", "0.5830768", "0.58251804", "0.57971406", "0.57530457", "0.5738728", "0.57342035", "0.57266986", "0.5688524", "0.5670645", "0.5661567", "0.5643408", "0.5619693", "0.5607867", "0.55740327", "0.55710053", "0.55644447", "0.5555344", "0.55357057", "0.55351454", "0.55273294", "0.54993707", "0.5486091", "0.5482614", "0.54783547", "0.54783547", "0.546671", "0.54543495", "0.54367363", "0.5409888", "0.53711873", "0.53689283", "0.53492653", "0.5340139", "0.5326371", "0.5322513", "0.52787167", "0.5271996", "0.5268546", "0.5259433", "0.52512765", "0.5246953", "0.52451533", "0.52446485", "0.52279425", "0.522216", "0.5216249", "0.52149737", "0.52115345", "0.52049756", "0.5178693", "0.5170864", "0.51682323", "0.51653993", "0.51621383", "0.51546067", "0.5140187", "0.51177895", "0.5107838", "0.510107", "0.50945103", "0.5090444", "0.50705475", "0.5057607", "0.5051193", "0.5042463", "0.50420076", "0.5033997", "0.5031791", "0.5029592", "0.5022205", "0.5016729", "0.5014038", "0.5010517", "0.5008679", "0.5004366", "0.49982426", "0.4986812", "0.49864066", "0.49837685", "0.49782386", "0.49772057", "0.49724215", "0.49721596", "0.4948986", "0.49296787", "0.49295655", "0.49235618", "0.4921486", "0.49180457", "0.4917587", "0.49071962" ]
0.8077462
0
Prompt displays a CLI prompt to the user. It prints the specified message, and gives a list of options, with a preselected default (1 to not set any default). It reads the user input from the specified input stream (e.g. os.Stdin) and returns the selected option as a string.
Prompt отображает CLI-приглашение пользователю. Он выводит указанное сообщение и предоставляет список вариантов с предварительно выбранной по умолчанию опцией (1, чтобы не устанавливать никакой дефолт). Он считывает ввод пользователя из указанного потока ввода (например, os.Stdin) и возвращает выбранную опцию в виде строки.
func Prompt(stream io.Reader, message string, defaultIdx int, options ...string) (string, error) { if len(options) < 1 { return "", errors.New("no options specified") } validOptions := map[string]bool{} var buf bytes.Buffer buf.WriteString(message) buf.WriteString(" (") for i, o := range options { validOptions[strings.ToLower(o)] = true if i == defaultIdx { buf.WriteString(strings.Title(o)) } else { buf.WriteString(o) } if i < len(options)-1 { buf.WriteString("/") } } buf.WriteString(") ") reader := bufio.NewReader(stream) for { fmt.Print(buf.String()) selected, _ := reader.ReadString('\n') selected = strings.TrimSpace(selected) if selected == "" { return options[defaultIdx], nil } if valid, _ := validOptions[strings.ToLower(selected)]; valid { return selected, nil } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Prompt(prompt string) (s string, err error) {\n\tfmt.Printf(\"%s\", prompt)\n\tstdin := bufio.NewReader(os.Stdin)\n\tl, _, err := stdin.ReadLine()\n\treturn string(l), err\n}", "func InputPrompt(label string, required bool) string {\n\tinput := bufio.NewScanner(os.Stdin)\n\n\tfmt.Printf(\"%s : \\n\", label)\n\tfor input.Scan() {\n\n\t\tinputValue := input.Text()\n\t\tif !required || len(inputValue) > 0 {\n\t\t\treturn inputValue\n\t\t}\n\n\t\tfmt.Printf(\"%s : \\n\", label)\n\t}\n\n\treturn \"\"\n}", "func (console *Console) Prompt() (string, error) {\n\tfmt.Print(\">\")\n\n\trawInput, hasMore, err := console.reader.ReadLine()\n\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"issue reading from STDIN\")\n\t}\n\n\tinput := string(rawInput)\n\n\tif hasMore {\n\t\trawInput, hasMore, err = console.reader.ReadLine()\n\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"issue reading additional characters in buffer\")\n\t\t}\n\n\t\tinput += string(rawInput)\n\t}\n\n\treturn input, nil\n}", "func Prompt(msg string) (string, error) {\n\tif !IsInteractive() {\n\t\treturn \"\", fmt.Errorf(\"not an interactive session\")\n\t}\n\n\tpromptMux.Lock()\n\tdefer promptMux.Unlock()\n\n\tvar v string\n\tfmt.Fprintf(os.Stderr, \"%s: \", msg)\n\t_, err := fmt.Scanln(&v)\n\treturn v, err\n}", "func (c *Client) Ask(prompt string) string {\n\tfmt.Printf(\"%s \", prompt)\n\trd := bufio.NewReader(os.Stdin)\n\tline, err := rd.ReadString('\\n')\n\tif err == nil {\n\t\treturn strings.TrimSpace(line)\n\t}\n\treturn \"\"\n}", "func (q *Query) Prompt() {\n\tfmt.Printf(\"\\n%s [%s]: \", q.Question, q.DefaultValue)\n\tvar response string\n\tfmt.Scanln(&response)\n\tq.Answer = response\n\n}", "func prompt(promptText string) string {\n\tfmt.Fprint(cmdmain.Stdout, promptText)\n\tsc := bufio.NewScanner(cmdmain.Stdin)\n\tsc.Scan()\n\treturn strings.TrimSpace(sc.Text())\n}", "func Prompt(msg string, isPassword bool) (string, error) {\n\tvalidate := func(input string) error {\n\t\tif input == \"\" {\n\t\t\treturn errors.New(\"Value can't be empty\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tvar prompt promptui.Prompt\n\tif isPassword == true {\n\t\tprompt = promptui.Prompt{\n\t\t\tLabel: msg,\n\t\t\tValidate: validate,\n\t\t\tMask: '*',\n\t\t}\n\t} else {\n\t\tprompt = promptui.Prompt{\n\t\t\tLabel: msg,\n\t\t\tValidate: validate,\n\t\t}\n\t}\n\n\tresult, err := prompt.Run()\n\tHandleError(err)\n\n\treturn result, nil\n}", "func Ask(label, startString string) (string, error) {\n\tp := Prompt{\n\t\tBasicPrompt: BasicPrompt{\n\t\t\tLabel: label,\n\t\t\tDefault: startString,\n\t\t},\n\t}\n\treturn p.Run()\n}", "func (c *Config) promptChoice(prompt string, choices []string, args ...string) (string, error) {\n\tvar defaultValue *string\n\tswitch len(args) {\n\tcase 0:\n\t\t// Do nothing.\n\tcase 1:\n\t\tif !slices.Contains(choices, args[0]) {\n\t\t\treturn \"\", fmt.Errorf(\"%s: invalid default value\", args[0])\n\t\t}\n\t\tdefaultValue = &args[0]\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"want 2 or 3 arguments, got %d\", len(args)+2)\n\t}\n\tif c.interactiveTemplateFuncs.promptDefaults && defaultValue != nil {\n\t\treturn *defaultValue, nil\n\t}\n\treturn c.readChoice(prompt, choices, defaultValue)\n}", "func (p *Prompt) Ask(text string, opts *InputOptions) (string, error) {\n\tformat := p.fmtInputOptions(opts)\n\n\tresp, err := p.read(text, format)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tinput := strings.TrimSpace(resp)\n\n\t// show me what you're working with\n\tswitch input {\n\tcase \"\":\n\t\t// check the opts\n\t\tswitch opts {\n\t\tcase nil:\n\t\t\t// no options and no input means we return an error\n\t\t\treturn \"\", errors.New(\"no input or default value provided\")\n\t\tdefault:\n\t\t\t// check if there is a default to return\n\t\t\tif opts.Default != \"\" {\n\t\t\t\treturn opts.Default, nil\n\t\t\t}\n\n\t\t\tif opts.Validator != nil {\n\t\t\t\t// validate in provided input - even if empty\n\t\t\t\tif err := opts.Validator(input); err != nil {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tswitch opts {\n\t\tcase nil:\n\t\t\t// there are no options, so just return the input\n\t\t\treturn input, nil\n\t\tdefault:\n\t\t\tif opts.Validator != nil {\n\t\t\t\t// validate in provided input\n\t\t\t\tif err := opts.Validator(input); err != nil {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn input, nil\n}", "func PromptUserForInput(prompt string, terragruntOptions *options.TerragruntOptions) (string, error) {\n\t// We are writing directly to ErrWriter so the prompt is always visible\n\t// no matter what logLevel is configured. If `--non-interactive` is set, we log both prompt and\n\t// a message about assuming `yes` to Debug, so\n\tif terragruntOptions.NonInteractive {\n\t\tterragruntOptions.Logger.Debugf(prompt)\n\t\tterragruntOptions.Logger.Debugf(\"The non-interactive flag is set to true, so assuming 'yes' for all prompts\")\n\t\treturn \"yes\", nil\n\t}\n\tn, err := terragruntOptions.ErrWriter.Write([]byte(prompt))\n\tif err != nil {\n\t\tterragruntOptions.Logger.Error(err)\n\t\treturn \"\", errors.WithStackTrace(err)\n\t}\n\tif n != len(prompt) {\n\t\tterragruntOptions.Logger.Errorln(\"Failed to write data\")\n\t\treturn \"\", errors.WithStackTrace(err)\n\t}\n\n\treader := bufio.NewReader(os.Stdin)\n\n\ttext, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\treturn \"\", errors.WithStackTrace(err)\n\t}\n\n\treturn strings.TrimSpace(text), nil\n}", "func (ptr *terminalPrompter) PromptInput(prompt string) (string, error) {\n\tif ptr.supported {\n\t\tptr.rawMode.ApplyMode()\n\t\tdefer ptr.normalMode.ApplyMode()\n\t} else {\n\t\t// liner tries to be smart about printing the prompt\n\t\t// and doesn't print anything if input is redirected.\n\t\t// Un-smart it by printing the prompt always.\n\t\tfmt.Print(prompt)\n\t\tprompt = \"\"\n\t\tdefer fmt.Println()\n\t}\n\treturn ptr.State.Prompt(prompt)\n}", "func SetPrompt(prompt string) {\n\tcliPrompt = fmt.Sprintf(\"%s \", prompt)\n}", "func TermPrompt(prompt string, options []string, wait bool) int {\n\tscreenb := TempFini()\n\n\tidx := -1\n\t// same behavior as do { ... } while (wait && idx == -1)\n\tfor ok := true; ok; ok = wait && idx == -1 {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tfmt.Print(prompt)\n\t\tresp, _ := reader.ReadString('\\n')\n\t\tresp = strings.TrimSpace(resp)\n\n\t\tfor i, opt := range options {\n\t\t\tif resp == opt {\n\t\t\t\tidx = i\n\t\t\t}\n\t\t}\n\n\t\tif wait && idx == -1 {\n\t\t\tfmt.Println(\"\\nInvalid choice.\")\n\t\t}\n\t}\n\n\tTempStart(screenb)\n\n\treturn idx\n}", "func PromptMessage(message, value string) string {\n\tfor value == \"\" {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tfmt.Print(message + \": \")\n\t\tvalueRaw, err := reader.ReadString('\\n')\n\t\terrors.CheckError(err)\n\t\tvalue = strings.TrimSpace(valueRaw)\n\t}\n\treturn value\n}", "func TestGetInput(t *testing.T) {\n\tassert := asrt.New(t)\n\n\t// Try basic GetInput\n\tinput := \"InputIWantToSee\"\n\trestoreOutput := util.CaptureUserOut()\n\tscanner := bufio.NewScanner(strings.NewReader(input))\n\tutil.SetInputScanner(scanner)\n\tresult := util.GetInput(\"nodefault\")\n\tassert.EqualValues(input, result)\n\t_ = restoreOutput()\n\n\t// Try Prompt() with a default value which is overridden\n\tinput = \"InputIWantToSee\"\n\trestoreOutput = util.CaptureUserOut()\n\tscanner = bufio.NewScanner(strings.NewReader(input))\n\tutil.SetInputScanner(scanner)\n\tresult = util.Prompt(\"nodefault\", \"expected default\")\n\tassert.EqualValues(input, result)\n\t_ = restoreOutput()\n\n\t// Try Prompt() with a default value but don't provide a response\n\tinput = \"\"\n\trestoreOutput = util.CaptureUserOut()\n\tscanner = bufio.NewScanner(strings.NewReader(input))\n\tutil.SetInputScanner(scanner)\n\tresult = util.Prompt(\"nodefault\", \"expected default\")\n\tassert.EqualValues(\"expected default\", result)\n\t_ = restoreOutput()\n\tprintln() // Just lets goland find the PASS or FAIL\n}", "func Prompt(msg string) (string, error) {\n\tif !IsInteractive() {\n\t\treturn \"\", fmt.Errorf(\"not an interactive session\")\n\t}\n\n\tpromptMux.Lock()\n\tdefer promptMux.Unlock()\n\n\t// Even if Wash is running interactively, it will not have control of STDIN while another command\n\t// is running within the shell environment. If it doesn't have control and tries to read from it,\n\t// the read will fail. If we have control, read normally. If not, temporarily acquire control for\n\t// the current process group while we're prompting, then return it afterward so the triggering\n\t// command can continue.\n\tinFd := int(os.Stdin.Fd())\n\tinGrp, err := tcGetpgrp(inFd)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error getting process group controlling stdin: %v\", err)\n\t}\n\tcurGrp := unix.Getpgrp()\n\n\tvar v string\n\tif inGrp == curGrp {\n\t\t// We control stdin\n\t\tfmt.Fprintf(os.Stderr, \"%s: \", msg)\n\t\t_, err = fmt.Scanln(&v)\n\t} else {\n\t\t// Need to get control, prompt, then return control.\n\t\tif err := tcSetpgrp(inFd, curGrp); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"error getting control of stdin: %v\", err)\n\t\t}\n\t\tfmt.Fprintf(os.Stderr, \"%s: \", msg)\n\t\t_, err = fmt.Scanln(&v)\n\t\tif err := tcSetpgrp(inFd, inGrp); err != nil {\n\t\t\t// Panic if we can't return control. A messed up environment that they 'kill -9' is worse.\n\t\t\tpanic(err.Error())\n\t\t}\n\t}\n\t// Return the error set by Scanln.\n\treturn v, err\n}", "func prompt(v interface{}) (string, error) {\n\tval, ok := v.(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"expected string, got %T\", v)\n\t}\n\treturn fmt.Sprintf(\"%q\", val), nil\n}", "func (term *Terminal) simplePrompt(prefix string) (string, error) {\n\tif term.simpleReader == nil {\n\t\tterm.simpleReader = bufio.NewReader(term.In)\n\t}\n\n\t_, err := term.Out.Write([]byte(prefix))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tline, err := term.simpleReader.ReadString('\\n')\n\tline = strings.TrimRight(line, \"\\r\\n \")\n\tline = strings.TrimLeft(line, \" \")\n\n\treturn line, err\n}", "func GetFromStdin(params *GetFromStdinParams) *string {\n\tvar prompt survey.Prompt\n\tvar result *string\n\tcompiledRegex := DefaultValidationRegexPattern\n\tif params.ValidationRegexPattern != \"\" {\n\t\tcompiledRegex = regexp.MustCompile(params.ValidationRegexPattern)\n\t}\n\n\tif params.Options != nil {\n\t\tprompt = &survey.Select{\n\t\t\tMessage: params.Question,\n\t\t\tOptions: params.Options,\n\t\t\tDefault: params.DefaultValue,\n\t\t}\n\t} else if params.IsPassword {\n\t\tprompt = &survey.Password{\n\t\t\tMessage: params.Question,\n\t\t}\n\t} else {\n\t\tprompt = &survey.Input{\n\t\t\tMessage: params.Question,\n\t\t\tDefault: params.DefaultValue,\n\t\t}\n\t}\n\n\tquestion := []*survey.Question{\n\t\t{\n\t\t\tName: \"question\",\n\t\t\tPrompt: prompt,\n\t\t},\n\t}\n\n\tif params.Options != nil {\n\t\tquestion[0].Validate = func(val interface{}) error {\n\t\t\t// since we are validating an Input, the assertion will always succeed\n\t\t\tif str, ok := val.(string); !ok || compiledRegex.MatchString(str) == false {\n\t\t\t\treturn fmt.Errorf(\"Answer has to match pattern: %s\", compiledRegex.String())\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tfor result == nil {\n\t\t// Ask it\n\t\tanswers := struct {\n\t\t\tQuestion string\n\t\t}{}\n\t\terr := survey.Ask(question, &answers)\n\t\tif err != nil {\n\t\t\tif strings.HasPrefix(err.Error(), \"Answer has to match pattern\") {\n\t\t\t\tlog.Info(err.Error())\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Keyboard interrupt\n\t\t\tos.Exit(0)\n\t\t}\n\n\t\tresult = &answers.Question\n\t}\n\n\treturn result\n}", "func (f *Fs) Prompt(key, question string) string {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Print(\"string | \" + question)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimSpace(text)\n\ttext = strings.TrimRight(text, \"`\")\n\ttext = strings.TrimLeft(text, \"`\")\n\tif strings.Contains(text, \"?\") {\n\t\tnewtext := strings.Split(text, \"?\")\n\t\ttext = newtext[0]\n\t}\n\tf.Set(key, text)\n\treturn text\n}", "func (cli *CliPrompter) String(pr string, defaultValue string) string {\n\tval := \"\"\n\tprompt := &survey.Input{\n\t\tMessage: pr,\n\t\tDefault: defaultValue,\n\t}\n\t_ = survey.AskOne(prompt, &val)\n\treturn val\n}", "func (cli CLI) AskString(query string, defaultStr string) (string, error) {\n\n\tsigCh := make(chan os.Signal, 1)\n\tsignal.Notify(sigCh, os.Interrupt)\n\tdefer signal.Stop(sigCh)\n\n\tresult := make(chan string, 1)\n\tgo func() {\n\t\tfmt.Fprintf(cli.errStream, \"%s [default: %s] \", query, defaultStr)\n\n\t\t// TODO when string includes blank ...\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tline, err := reader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tDebugf(\"Failed to scan stdin: %s\", err.Error())\n\t\t}\n\t\tDebugf(\"Input: %q\", line)\n\n\t\t// Use Default value\n\t\tline = strings.TrimRight(line, \"\\n\")\n\t\tif line == \"\" {\n\t\t\tresult <- defaultStr\n\t\t}\n\n\t\tresult <- line\n\t}()\n\n\tselect {\n\tcase <-sigCh:\n\t\treturn \"\", fmt.Errorf(\"interrupted\")\n\tcase str := <-result:\n\t\treturn str, nil\n\t}\n}", "func PromptForInput(ctx context.Context, prompt string) (string, error) {\n\tvar input string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfmt.Println(prompt)\n\tscanner.Scan()\n\tinput = scanner.Text()\n\tif scanner.Err() != nil {\n\t\tlog.Error(ctx, \"Failed to read user input\", scanner.Err())\n\t\treturn \"\", scanner.Err()\n\t}\n\treturn input, nil\n}", "func RunPrompt(label string, items []string) (string, error) {\n\tprompt := promptui.Select{\n\t\tLabel: label,\n\t\tItems: items,\n\t}\n\n\t_, res, err := prompt.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn res, err\n}", "func (d *Dmenu) Popup(prompt string, options ...string) (selection string, err error) {\n\tprocessedArgs := []string{}\n\tfor _, arg := range d.arguments {\n\t\tvar parg string\n\t\tif strings.Contains(arg, \"%s\") {\n\t\t\tparg = fmt.Sprintf(arg, prompt)\n\t\t} else {\n\t\t\tparg = arg\n\t\t}\n\n\t\tprocessedArgs = append(processedArgs, parg)\n\t}\n\tcmd := exec.Command(d.command, processedArgs...)\n\n\tstdin, err := cmd.StdinPipe()\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error getting pipe: %s\", err)\n\t}\n\n\tgo func(stdin io.WriteCloser) {\n\t\tdefer stdin.Close()\n\t\tio.WriteString(stdin, strings.Join(options, \"\\n\"))\n\t}(stdin)\n\n\tbyteOut, err := cmd.Output()\n\n\tif err != nil {\n\t\tif exiterr, ok := err.(*exec.ExitError); ok {\n\t\t\tif status, ok := exiterr.Sys().(syscall.WaitStatus); ok {\n\t\t\t\tif status.ExitStatus() == 1 {\n\t\t\t\t\terr = &EmptySelectionError{}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn \"\", err\n\t}\n\n\t// Cast and trim\n\tselection = strings.TrimSpace(string(byteOut))\n\n\treturn\n}", "func NewPrompt() *Prompt {\n\treturn &Prompt{\n\t\tReader: os.Stdin,\n\t\tWriter: os.Stdout,\n\t\tOptions: DefaultOptions,\n\t}\n}", "func promptString(question string, details string) (answer string) {\n\tfmt.Print(colors.Blue(question) + \" (\" + details + \"): \")\n\tfmt.Scanln(&answer)\n\treturn\n}", "func Prompt(a interfaces.AssumeCredentialProcess, emoji string, prefix string, message string) {\n\ts := a.GetDestination()\n\tformatted := format(a, textColorPrompt, emoji, prefix, message)\n\tfmt.Fprint(s, formatted)\n}", "func (cp *ConfirmPrompt) Run() (string, error) {\n\tswitch cp.Default {\n\tcase \"Y\", \"N\", \"n\", \"y\":\n\tcase \"\":\n\t\tcp.Default = \"N\"\n\tdefault:\n\t\treturn \"\", ErrorIncorrect\n\t}\n\terr := cp.Init()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcp.confirmDefault = strings.ToUpper(cp.Default)\n\n\tcp.c.Stdin = ioutil.NopCloser(io.MultiReader(bytes.NewBuffer([]byte(cp.out)), os.Stdin))\n\n\tcp.rl, err = readline.NewEx(cp.c)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcp.punctuation = \"?\"\n\tanswers := \"y/N\"\n\tif strings.ToLower(cp.Default) == \"y\" {\n\t\tanswers = \"Y/n\"\n\t}\n\tif cp.ConfirmOpt != \"\" {\n\t\tanswers = answers + \"/\" + cp.ConfirmOpt\n\t}\n\tcp.suggestedAnswer = \" \" + faint(\"[\"+answers+\"]\")\n\t// cp.confirmDefault = strings.ToUpper(cp.Default)\n\t// cp.Default = \"\"\n\tcp.prompt = cp.LabelInitial(cp.Label) + cp.punctuation + cp.suggestedAnswer + \" \"\n\t// cp.out = cp.Default\n\t// cp.c.Stdin = ioutil.NopCloser(io.MultiReader(bytes.NewBuffer([]byte(cp.out)), os.Stdin))\n\n\tsetupConfirm(cp.c, cp.prompt, cp, cp.rl)\n\tcp.out, err = cp.rl.Readline()\n\tif cp.out == \"\" {\n\t\tcp.out = cp.confirmDefault\n\t}\n\tif err != nil {\n\t\tif err.Error() == \"Interrupt\" {\n\t\t\terr = ErrInterrupt\n\t\t}\n\t\tcp.rl.Write([]byte(\"\\n\"))\n\t\treturn \"\", err\n\t}\n\tcp.out = strings.ToUpper(cp.out)\n\tcp.state = cp.IconGood\n\tcp.out = cp.Formatter(cp.out)\n\tseparator := \" \"\n\tif cp.NoIcons {\n\t\tseparator = \"\"\n\t}\n\tcp.rl.Write([]byte(cp.Indent + cp.state + separator + cp.prompt + cp.InputResult(cp.out) + \"\\n\"))\n\treturn cp.out, err\n}", "func ReadString(prompt string) ([]byte, error) {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fprintf(os.Stderr, \"%v \", prompt)\n\tline, _ := reader.ReadString('\\n')\n\tline = strings.TrimRight(line, \" \\n\\r\")\n\treturn []byte(line), nil\n}", "func RunPrompt() error {\n\trl, err := readline.New(\"> \")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not run interactive: %v\", err)\n\t}\n\tdefer rl.Close()\n\n\tfor {\n\t\tline, err := rl.Readline()\n\t\tif err != nil {\n\t\t\tif errors.Is(err, io.EOF) {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"failed to read user input: %v\", err)\n\t\t\t}\n\t\t}\n\t\trun(line)\n\t}\n\treturn nil\n}", "func Prompt(prompt string, refresh func(int, int)) string {\n\treturn PromptWithCallback(prompt, refresh, nil)\n}", "func (p *Prompt) Run() (string, error) {\n\terr := p.Init()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tp.c.Stdin = ioutil.NopCloser(io.MultiReader(bytes.NewBuffer([]byte(p.Default)), os.Stdin))\n\n\tp.rl, err = readline.NewEx(p.c)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar (\n\t\tfirstListen = true\n\t\twroteErr = false\n\t\tcaughtup = true\n\t)\n\n\tif p.Default != \"\" {\n\t\tcaughtup = false\n\t}\n\n\tif p.Mask != 0 {\n\t\tp.c.EnableMask = true\n\t\tp.c.MaskRune = p.Mask\n\t}\n\n\tvar onelineReader = func(line []rune, pos int, key rune) ([]rune, int, bool) {\n\t\tif key == readline.CharEnter {\n\t\t\treturn nil, 0, false\n\t\t}\n\t\tif p.Mask != 0 && key == 42 {\n\t\t\tp.c.EnableMask = !p.c.EnableMask\n\t\t\tp.rl.Refresh()\n\t\t\treturn append(line[:pos-1], line[pos:]...), pos - 1, true\n\t\t}\n\n\t\tif firstListen {\n\t\t\tfirstListen = false\n\t\t\treturn nil, 0, false\n\t\t}\n\n\t\tif !caughtup && p.out != \"\" {\n\t\t\tif string(line) == p.out {\n\t\t\t\tcaughtup = true\n\t\t\t}\n\t\t\tif wroteErr {\n\t\t\t\treturn nil, 0, false\n\t\t\t}\n\t\t}\n\n\t\terr := p.validFn(string(line))\n\t\tif err != nil {\n\t\t\tif _, ok := err.(*ValidationError); ok {\n\t\t\t\tp.state = p.IconBad\n\t\t\t} else {\n\t\t\t\tp.rl.Close()\n\t\t\t\treturn nil, 0, false\n\t\t\t}\n\t\t} else {\n\t\t\tif string(line) == \"\" {\n\t\t\t\tp.state = p.IconInitial\n\t\t\t} else {\n\t\t\t\tp.state = p.IconGood\n\t\t\t}\n\t\t}\n\n\t\tp.rl.SetPrompt(p.Indent + p.state + \" \" + p.PromptInitial(p.prompt))\n\t\tp.rl.Refresh()\n\t\twroteErr = false\n\n\t\treturn nil, 0, false\n\t}\n\n\tp.c.SetListener(onelineReader)\n\n\tfor {\n\t\tp.out, err = p.rl.Readline()\n\n\t\tvar msg string\n\t\tvalid := true\n\t\toerr := p.validFn(p.out)\n\t\tif oerr != nil {\n\t\t\tif verr, ok := oerr.(*ValidationError); ok {\n\t\t\t\tmsg = verr.msg\n\t\t\t\tvalid = false\n\t\t\t\tp.state = p.IconBad\n\t\t\t} else {\n\t\t\t\tp.rl.Close()\n\t\t\t\treturn \"\", oerr\n\t\t\t}\n\t\t}\n\n\t\tif valid {\n\t\t\tp.state = p.IconGood\n\t\t\tbreak\n\t\t}\n\n\t\tif err != nil {\n\t\t\tswitch err {\n\t\t\tcase readline.ErrInterrupt:\n\t\t\t\terr = ErrInterrupt\n\t\t\tcase io.EOF:\n\t\t\t\terr = ErrEOF\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\tcaughtup = false\n\n\t\tp.c.Stdin = ioutil.NopCloser(io.MultiReader(bytes.NewBuffer([]byte(p.out)), os.Stdin))\n\t\tp.rl, _ = readline.NewEx(p.c)\n\n\t\tfirstListen = true\n\t\twroteErr = true\n\t\tp.rl.SetPrompt(\"\\n\" + red(\"Error: \") + msg + upLine(1) + \"\\r\" + p.Indent + p.state + \" \" + p.PromptInitial(p.prompt))\n\t\tp.rl.Refresh()\n\t}\n\n\t// if wroteErr {\n\t// \trl.Write([]byte(downLine(1) + clearLine + upLine(1) + \"\\r\"))\n\t// }\n\n\tif err != nil {\n\t\tif err.Error() == \"Interrupt\" {\n\t\t\terr = ErrInterrupt\n\t\t}\n\t\tp.rl.Write([]byte(\"\\n\"))\n\t\treturn \"\", err\n\t}\n\n\tp.out = p.Formatter(p.out)\n\n\techo := p.out\n\tif p.Mask != 0 {\n\t\techo = strings.Repeat(string(p.Mask), len([]rune(echo)))\n\t}\n\n\tp.rl.Write([]byte(p.Indent + p.state + \" \" + p.prompt + p.InputResult(echo) + \"\\n\"))\n\n\treturn p.out, err\n}", "func (v Repository) Prompt() string {\n\tif v.Path == \".\" {\n\t\treturn \"\"\n\t}\n\treturn v.Path + \"> \"\n}", "func (bp *BasicPrompt) Init() error {\n\tbp.c = &readline.Config{}\n\n\terr := bp.c.Init()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif bp.stdin != nil {\n\t\tbp.c.Stdin = ioutil.NopCloser(bp.stdin)\n\t}\n\n\tif bp.stdout != nil {\n\t\tbp.c.Stdout = bp.stdout\n\t}\n\n\tif bp.IsVimMode {\n\t\tbp.c.VimMode = true\n\t}\n\n\tif bp.Preamble != nil {\n\t\tfmt.Println(*bp.Preamble)\n\t}\n\n\tif bp.IconInitial == \"\" && !bp.NoIcons {\n\t\tbp.IconInitial = bold(IconInitial)\n\t}\n\tif bp.IconGood == \"\" && !bp.NoIcons {\n\t\tbp.IconGood = bold(IconGood)\n\t}\n\tif bp.IconQuest == \"\" && !bp.NoIcons {\n\t\tbp.IconQuest = bold(IconQuest)\n\t}\n\tif bp.IconWarn == \"\" && !bp.NoIcons {\n\t\tbp.IconWarn = bold(IconWarn)\n\t}\n\tif bp.IconBad == \"\" && !bp.NoIcons {\n\t\tbp.IconBad = bold(IconBad)\n\t}\n\tif bp.LabelInitial == nil {\n\t\tbp.LabelInitial = func(s string) string { return s }\n\t}\n\tif bp.LabelResult == nil {\n\t\tbp.LabelResult = func(s string) string { return s }\n\t}\n\tif bp.PromptInitial == nil {\n\t\tbp.PromptInitial = func(s string) string { return bold(s) }\n\t}\n\tif bp.PromptResult == nil {\n\t\tbp.PromptResult = func(s string) string { return s }\n\t}\n\tif bp.InputInitial == nil {\n\t\tbp.InputInitial = func(s string) string { return s }\n\t}\n\tif bp.InputResult == nil {\n\t\tbp.InputResult = func(s string) string { return faint(s) }\n\t}\n\tif bp.Formatter == nil {\n\t\tbp.Formatter = func(s string) string { return s }\n\t}\n\tbp.c.Painter = &defaultPainter{style: bp.InputInitial}\n\n\tbp.suggestedAnswer = \"\"\n\tbp.punctuation = \":\"\n\tbp.c.UniqueEditLine = true\n\n\tbp.state = bp.IconInitial\n\tbp.prompt = bp.LabelInitial(bp.Label) + bp.punctuation + bp.suggestedAnswer + \" \"\n\n\tbp.c.Prompt = bp.Indent + bp.state + \" \" + bp.PromptInitial(bp.prompt)\n\tbp.c.HistoryLimit = -1\n\n\tbp.c.InterruptPrompt = bp.InterruptPrompt\n\n\tbp.validFn = func(x string) error {\n\t\treturn nil\n\t}\n\n\tif bp.Validate != nil {\n\t\tbp.validFn = bp.Validate\n\t}\n\n\treturn nil\n}", "func (c *Confirm) Prompt(rl *readline.Instance) (interface{}, error) {\n\t// render the question template\n\tout, err := core.RunTemplate(\n\t\tConfirmQuestionTemplate,\n\t\tConfirmTemplateData{Confirm: *c},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// use the result of the template as the prompt for the readline instance\n\trl.SetPrompt(fmt.Sprintf(out))\n\n\t// start waiting for input\n\tanswer, err := c.getBool(rl)\n\t// if something went wrong\n\tif err != nil {\n\t\t// bubble up\n\t\treturn \"\", err\n\t}\n\n\t// convert the boolean into the appropriate string\n\treturn answer, nil\n}", "func SelectPrompt(items []string, label string) int {\n\n\tprompt := promptui.Select{Label: label, Items: items}\n\n\ti, _, e := prompt.Run()\n\n\tif e != nil {\n\t\treturn -1\n\t}\n\n\treturn i\n}", "func Prompt() string {\n\tfillMessage(&msg)\n\tgitMsg := msg.String()\n\tInfo(\"\\nCommit message is:\\n%s\\n\", gitMsg)\n\tvar err error\n\tcp := bb.ConfirmPrompt{\n\t\tBasicPrompt: bb.BasicPrompt{\n\t\t\tLabel: \"Is everything OK? Continue\",\n\t\t\tDefault: \"N\",\n\t\t\tNoIcons: true,\n\t\t},\n\t\tConfirmOpt: \"e\",\n\t}\n\tc, err := cp.Run()\n\tcheckConfirmStatus(c, err)\n\tif c == \"E\" {\n\t\tgitMsg, err = bb.Editor(\"\", gitMsg)\n\t\tcheckInterrupt(err)\n\t\tnumlines := len(strings.Split(gitMsg, \"\\n\")) + 2\n\t\tfor ; numlines > 0; numlines-- {\n\t\t\tfmt.Print(bb.ClearUpLine())\n\t\t}\n\t\tInfo(\"Commit message is:\\n%s\", gitMsg)\n\t\tcheckConfirmStatus(bb.Confirm(\"Is everything OK? Continue\", \"N\", true))\n\t\treturn gitMsg\n\t}\n\treturn gitMsg\n}", "func (cli *CliPrompter) ChooseWithDefault(pr string, defaultValue string, options []string) (string, error) {\n\tselected := \"\"\n\tprompt := &survey.Select{\n\t\tMessage: pr,\n\t\tOptions: options,\n\t\tDefault: defaultValue,\n\t}\n\t_ = survey.AskOne(prompt, &selected, survey.WithValidator(survey.Required))\n\n\t// return the selected element index\n\tfor i, option := range options {\n\t\tif selected == option {\n\t\t\treturn options[i], nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"bad input\")\n}", "func Prompt(question string) bool {\n\tfmt.Print(question)\n\tfmt.Print(\"? [y/N] \")\n\n\tvar answer string\n\t_, _ = fmt.Scanln(&answer)\n\n\tif answer == \"\" {\n\t\treturn false\n\t}\n\n\treturn answer[0] == 'Y' || answer[0] == 'y'\n}", "func AskForDefaultContext() string {\n\tfmt.Println(\"GoGit can operate out three different contexts: Organizational, Team and Personal. Which filters the resultsets of the various commands accordingly\")\n\tfmt.Println(\"This is overridable with the global flag --context team/org/Personal (or --c team/org/personal)\")\n\tcontext := getString(\"What default context would you like to use? (team,org,personal): \")\n\tif !stringInSlice(context, []string{\"org\", \"team\", \"personal\"}) {\n\t\tlog.Fatalln(\"input not in available options\")\n\t}\n\treturn context\n}", "func ConsolePromptAndAnswer(prompt string, replyLowercase bool, autoTrim ...bool) string {\n\tfmt.Print(prompt)\n\n\tanswer := \"\"\n\n\tif _, e := fmt.Scanln(&answer); e != nil {\n\t\tanswer = \"\"\n\t\tfmt.Println()\n\t} else {\n\t\tanswer = RightTrimLF(answer)\n\n\t\tif replyLowercase {\n\t\t\tanswer = strings.ToLower(answer)\n\t\t}\n\n\t\tif len(autoTrim) > 0 {\n\t\t\tif autoTrim[0] {\n\t\t\t\tanswer = Trim(answer)\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println()\n\t}\n\n\treturn answer\n}", "func (f *Factor) Prompt() string { return f.driver().prompt(f) }", "func PrintPrompt() {\n\n\tvar prompt String\n\n\tme := syscall.GetUser()\n\tpath = \"/user/\" + me\n\tprompt = String(\"[\" + String(me) + \" @ \" + currDirectory + \"]: \")\n\n\taltEthos.WriteStream(syscall.Stdout, &prompt)\n\n}", "func terminalPrompt(prompt string) (string, error) {\n\tfmt.Printf(\"%s: \", prompt)\n\tb, err := terminal.ReadPassword(1)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfmt.Println()\n\treturn string(b), nil\n}", "func (s *Selection) RunPrompt() (*Choice, error) {\n\ttmpl, err := s.initConfirmationTemplate()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"initializing confirmation template: %w\", err)\n\t}\n\n\tm := NewModel(s)\n\n\tp := tea.NewProgram(m, tea.WithOutput(s.Output), tea.WithInput(s.Input))\n\tif err := p.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"running prompt: %w\", err)\n\t}\n\n\tchoice, err := m.Choice()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading choice: %w\", err)\n\t}\n\n\tif s.ConfirmationTemplate == \"\" {\n\t\treturn choice, nil\n\t}\n\n\tbuffer := &bytes.Buffer{}\n\n\terr = tmpl.Execute(buffer, map[string]interface{}{\n\t\t\"FinalChoice\": choice,\n\t\t\"Prompt\": m.Prompt,\n\t\t\"AllChoices\": m.Choices,\n\t\t\"NAllChoices\": len(m.Choices),\n\t\t\"TerminalWidth\": m.width,\n\t})\n\tif err != nil {\n\t\treturn choice, fmt.Errorf(\"execute confirmation template: %w\", err)\n\t}\n\n\t_, err = fmt.Fprint(s.Output, promptkit.Wrap(buffer.String(), m.width))\n\n\treturn choice, err\n}", "func (t *GenericPrompt) PromptString() string {\n\treturn t.PromptStr\n}", "func ReadString(prompt string) string {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Print(prompt)\n\ttext, _ := reader.ReadString('\\n')\n\tcleanText := strings.TrimSpace(text)\n\tif cleanText == \"exit\" {\n\t\tlog.Fatal(\"exitting program...\")\n\t}\n\n\treturn cleanText\n}", "func ConsolePromptAndAnswerInt(prompt string, preventNegative ...bool) int {\n\tfmt.Print(prompt)\n\n\tanswer := \"\"\n\tresult := 0\n\n\tif _, e := fmt.Scanln(&answer); e != nil {\n\t\tfmt.Println()\n\t\treturn 0\n\t} else {\n\t\tanswer = RightTrimLF(answer)\n\t\tresult, _ = ParseInt32(answer)\n\n\t\tif result < 0 {\n\t\t\tif len(preventNegative) > 0 {\n\t\t\t\tif preventNegative[0] {\n\t\t\t\t\tresult = 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println()\n\t}\n\n\treturn result\n}", "func GetFromStdin(params *GetFromStdinParams) *string {\n\tparamutil.SetDefaults(params, defaultParams)\n\n\tvalidationRegexp, _ := regexp.Compile(params.ValidationRegexPattern)\n\tinput := \"\"\n\n\tfor {\n\t\tfmt.Print(params.Question)\n\n\t\tif len(params.DefaultValue) > 0 {\n\t\t\tfmt.Print(\"\\n\")\n\t\t\tlog.WriteColored(\"Press ENTER to use: \"+params.DefaultValue, ct.Green)\n\t\t}\n\t\tfmt.Print(\"\\n\")\n\n\t\tfor {\n\t\t\tfmt.Print(\"> \")\n\n\t\t\treader := bufio.NewReader(os.Stdin)\n\t\t\tnextLine := \"\"\n\n\t\t\tif params.IsPassword {\n\t\t\t\tinStreamFD := command.NewInStream(os.Stdin).FD()\n\t\t\t\toldState, err := term.SaveState(inStreamFD)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\n\t\t\t\tterm.DisableEcho(inStreamFD, oldState)\n\t\t\t\tnextLine, _ = reader.ReadString('\\n')\n\t\t\t\tterm.RestoreTerminal(inStreamFD, oldState)\n\t\t\t} else {\n\t\t\t\tnextLine, _ = reader.ReadString('\\n')\n\t\t\t}\n\n\t\t\tnextLine = strings.Trim(nextLine, \"\\r\\n \")\n\n\t\t\tif strings.Compare(params.InputTerminationString, \"\\n\") == 0 {\n\t\t\t\t// Assign the input value to input var\n\t\t\t\tinput = nextLine\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tinput += nextLine + \"\\n\"\n\n\t\t\tif strings.HasSuffix(input, params.InputTerminationString+\"\\n\") {\n\t\t\t\tinput = strings.TrimSuffix(input, params.InputTerminationString+\"\\n\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif len(input) == 0 && len(params.DefaultValue) > 0 {\n\t\t\tinput = params.DefaultValue\n\t\t}\n\t\tif validationRegexp.MatchString(input) {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Print(\"Input must match \" + params.ValidationRegexPattern + \"\\n\")\n\t\t\tinput = \"\"\n\t\t}\n\t}\n\tfmt.Println(\"\")\n\n\treturn &input\n}", "func GetString(promptMessage string) string {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Print(aurora.Bold(aurora.Cyan(promptMessage)))\n\tresponse, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tGeneralErr(err, \"Failed to parse input (ln 25 prompt.go)\")\n\t}\n\treturn strings.TrimRight(response, \"\\r\\n\")\n}", "func (term *Terminal) prompt(buf *Buffer, in io.Reader) (string, error) {\n\tinput, err := term.setup(buf, in)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tterm.History = append(term.History, \"\")\n\tterm.histIdx = len(term.History) - 1\n\tcurHistIdx := term.histIdx\n\n\tfor {\n\t\ttyp, char, err := term.read(input)\n\t\tif err != nil {\n\t\t\treturn buf.String(), err\n\t\t}\n\n\t\tswitch typ {\n\t\tcase evChar:\n\t\t\terr = buf.Insert(char)\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\n\t\t\tterm.History[curHistIdx] = buf.String()\n\t\tcase evSkip:\n\t\t\tcontinue\n\t\tcase evReturn:\n\t\t\terr = buf.EndLine()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\n\t\t\tline := buf.String()\n\t\t\tif line == \"\" {\n\t\t\t\tterm.histIdx = curHistIdx - 1\n\t\t\t\tterm.History = term.History[:curHistIdx]\n\t\t\t} else {\n\t\t\t\tterm.History[curHistIdx] = line\n\t\t\t}\n\n\t\t\treturn line, nil\n\t\tcase evEOF:\n\t\t\terr = buf.EndLine()\n\t\t\tif err == nil {\n\t\t\t\terr = ErrEOF\n\t\t\t}\n\n\t\t\treturn buf.String(), err\n\t\tcase evCtrlC:\n\t\t\terr = buf.EndLine()\n\t\t\tif err == nil {\n\t\t\t\terr = ErrCTRLC\n\t\t\t}\n\n\t\t\treturn buf.String(), err\n\t\tcase evBack:\n\t\t\terr = buf.DelLeft()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\n\t\t\tterm.History[curHistIdx] = buf.String()\n\t\tcase evClear:\n\t\t\terr = buf.ClsScreen()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\t\tcase evHome:\n\t\t\terr = buf.Start()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\t\tcase evEnd:\n\t\t\terr = buf.End()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\t\tcase evUp:\n\t\t\tidx := term.histIdx\n\t\t\tif term.histIdx > 0 {\n\t\t\t\tidx--\n\t\t\t}\n\n\t\t\terr = buf.Set([]rune(term.History[idx])...)\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\n\t\t\tterm.histIdx = idx\n\t\tcase evDown:\n\t\t\tidx := term.histIdx\n\t\t\tif term.histIdx < len(term.History)-1 {\n\t\t\t\tidx++\n\t\t\t}\n\n\t\t\terr = buf.Set([]rune(term.History[idx])...)\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\n\t\t\tterm.histIdx = idx\n\t\tcase evRight:\n\t\t\terr = buf.Right()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\t\tcase evLeft:\n\t\t\terr = buf.Left()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\t\tcase evDel:\n\t\t\terr = buf.Del()\n\t\t\tif err != nil {\n\t\t\t\treturn buf.String(), err\n\t\t\t}\n\n\t\t\tterm.History[curHistIdx] = buf.String()\n\t\t}\n\t}\n}", "func SelectorCli(label string, options ...string) (string, error) {\n\ts := promptui.Select{\n\t\tLabel: label,\n\t\tItems: options,\n\t}\n\n\t_, result, err := s.Run()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn result, nil\n}", "func (opts *InitEnvOpts) Ask() error {\n\tif opts.EnvName == \"\" {\n\t\tenvName, err := opts.prompt.Get(\n\t\t\t\"What is your environment's name?\",\n\t\t\t\"A unique identifier for an environment (e.g. dev, test, prod)\",\n\t\t\tvalidateEnvironmentName,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get environment name: %w\", err)\n\t\t}\n\t\topts.EnvName = envName\n\t}\n\treturn nil\n}", "func (t *Term) Prompt(prompt string) {\n\tt._prompt = prompt\n}", "func (p Prompt) Prompt(window_id string) (dbus.Variant, error) {\n\t// spec: Prompt(IN String window-id);\n\tempty := dbus.Variant{}\n\tconn, err := dbus.SessionBus()\n\tif err != nil {\n\t\treturn empty, err\n\t}\n\tcmp := make(chan *dbus.Signal, 5)\n\tconn.Signal(cmp)\n\tcall := p.Call(_PromptPrompt, 0, window_id)\n\tif call.Err != nil {\n\t\treturn empty, call.Err\n\t}\n\tfor {\n\t\tselect {\n\t\tcase sig := <-cmp:\n\t\t\tif sig.Name == _PromptCompleted {\n\t\t\t\tif sig.Body[0].(bool) {\n\t\t\t\t\treturn empty, PromptDismissed\n\t\t\t\t}\n\t\t\t\treturn sig.Body[1].(dbus.Variant), nil\n\t\t\t}\n\t\tcase <-time.After(time.Duration(time.Minute)):\n\t\t\terr := p.Dismiss()\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\treturn empty, Timeout\n\t\t}\n\t}\n}", "func Prompt(get chan int,\n\trecv chan int,\n\tout chan int) {\n\tfor {\n\t\tget <- 1\n\t\tout <- <-recv\n\t}\n}", "func PromptMessage(a ...interface{}) (n int, err error) {\n\treturn MessageWithType(MsgPrompt, a...)\n}", "func (cli CLI) AskNumber(max int, defaultNum int) (int, error) {\n\n\tsigCh := make(chan os.Signal, 1)\n\tsignal.Notify(sigCh, os.Interrupt)\n\tdefer signal.Stop(sigCh)\n\n\tresult := make(chan int, 1)\n\tgo func() {\n\t\tfor {\n\n\t\t\tfmt.Fprintf(cli.errStream, \"Your choice? [default: %d] \", defaultNum)\n\n\t\t\tvar line string\n\t\t\tif _, err := fmt.Fscanln(os.Stdin, &line); err != nil {\n\t\t\t\tDebugf(\"Failed to scan stdin: %s\", err.Error())\n\t\t\t}\n\n\t\t\tDebugf(\"Input: %q\", line)\n\n\t\t\t// Use Default value\n\t\t\tif line == \"\" {\n\t\t\t\tresult <- defaultNum\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Convert string to int\n\t\t\tn, err := strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintf(cli.errStream, \" is not a valid choice. Choose by number.\\n\\n\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Check input is in range\n\t\t\tif n < 1 || max < n {\n\t\t\t\tfmt.Fprintf(cli.errStream, \" is not a valid choice. Choose from 1 to %d\\n\\n\", max)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tresult <- n\n\t\t\tbreak\n\t\t}\n\t}()\n\n\tselect {\n\tcase <-sigCh:\n\t\treturn -1, fmt.Errorf(\"interrupted\")\n\tcase num := <-result:\n\t\treturn num, nil\n\t}\n}", "func prompNewPort() (string, error) {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Print(\"Please enter a new port: \")\n\treturn reader.ReadString('\\n')\n}", "func NewPrompt(opts PromptOptions) *Prompt {\n\treturn &Prompt{\n\t\tin: bufio.NewReader(opts.in),\n\t\tout: bufio.NewWriter(opts.out),\n\t}\n}", "func prompt() {\n\tfmt.Printf(\"> Press Enter to continue \")\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tbreak\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tpanic(err)\n\t}\n}", "func ConsolePromptAndAnswerBool(prompt string, defaultTrue ...bool) bool {\n\tfmt.Print(prompt)\n\n\tanswer := \"\"\n\tresult := false\n\tdefVal := false\n\n\tif len(defaultTrue) > 0 {\n\t\tif defaultTrue[0] {\n\t\t\tdefVal = true\n\t\t}\n\t}\n\n\tif _, e := fmt.Scanln(&answer); e != nil {\n\t\tfmt.Println()\n\t\treturn defVal\n\t} else {\n\t\tanswer = RightTrimLF(answer)\n\n\t\tif LenTrim(answer) > 0 {\n\t\t\tresult, _ = ParseBool(answer)\n\t\t} else {\n\t\t\tresult = defVal\n\t\t}\n\n\t\tfmt.Println()\n\t}\n\n\treturn result\n}", "func AskForInput() (string, error) {\n\tfmt.Println(\"\\nEnter a sequence of integers, divided by spaces.\")\n\tfmt.Print(\">> \")\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\n\tfmt.Println()\n\n\treturn scanner.Text(), scanner.Err()\n}", "func Readline(prompt string, interfaces ...interface{}) (string, error) {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Printf(prompt, interfaces...)\n\tinput, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tinput = strings.Trim(input, \"\\n\\r\")\n\treturn input, nil\n}", "func Ask(question string) string {\n\tfmt.Fprintln(Out, question)\n\n\treturn prompt()\n}", "func Menu(username string) {\r\n\r\n\tvar response string\r\n\tin := bufio.NewReader(os.Stdin)\r\n\r\n\tfor {\r\n\r\n\t\tfmt.Println()\r\n\t\tfmt.Println(\"\\t\\tWelcome to our Chat Service\", username+\"!\\n\")\r\n\t\tfmt.Println(\"Select one of the choices below!\")\r\n\t\tfmt.Println(\"1. Create a new channel\")\r\n\t\tfmt.Println(\"2. Join an existing channel\")\r\n\t\tfmt.Println(\"3. Start a direct message with another user\")\r\n\t\tfmt.Println(\"4. Quit\")\r\n\r\n\t\tfmt.Print(\"Select a number 1-4: \")\r\n\t\tresponse, _ = in.ReadString('\\n')\r\n\t\tresponse = strings.TrimSpace(response)\r\n\r\n\t\tswitch response {\r\n\r\n\t\tcase \"1\":\r\n\t\t\taddch.Begin()\r\n\t\tcase \"2\":\r\n\t\t\tjoinch.Begin(username)\r\n\t\tcase \"3\":\r\n\t\t\tdm.RunDM(username)\r\n\t\tcase \"4\":\r\n\t\t\tfmt.Println(\"Thank you\", username, \"for chatting with us!\")\r\n\t\t\tos.Exit(1)\r\n\t\tdefault:\r\n\t\t\tfmt.Println(\"Invalid response. Please try again.\")\r\n\t\t\tcontinue\r\n\t\t}\r\n\t}\r\n}", "func Input(prompt string) string {\n\ttext, err := InputWithError(prompt)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn text\n}", "func ReadString(prompt string) string {\n\tfmt.Printf(\"%s: \", prompt)\n\tr := bufio.NewReader(os.Stdin)\n\tstr, _ := r.ReadString('\\n')\n\treturn strings.TrimSpace(str)\n}", "func Prompt() {\n\tcurrDir := strings.Trim(commands.CurrentWD(), \"\\n\")\n\tfmt.Printf(\"%v $: \", currDir)\n}", "func Choose(pr string, options []string) int {\n\treturn defaultPrompter.Choose(pr, options)\n}", "func ReadLine(prompt string) (line string, err error) {\n\n\tfmt.Print(prompt)\n\n\tin := bufio.NewReader(os.Stdin)\n\n\tline, err = in.ReadString('\\n')\n\tif err != nil {\n\t\terr = ErrInterrupted\n\t} else if len(line) > 0 {\n\t\t// need to take the end of line back off\n\t\t// using scanner didn't register ctrl-c properly\n\t\tline = strings.TrimRight(line, \"\\n\\r\")\n\t}\n\treturn\n\n}", "func promptString(label string, validation func(i string) error) (input string, err error) {\n\tprompt := survey.Input{\n\t\tMessage: label,\n\t}\n\tvar res string\n\tif err := survey.AskOne(&prompt, &res); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn res, nil\n}", "func Ask(prompt string) (password string, err error) {\n\treturn FAsk(os.Stdout, prompt)\n}", "func ReadConsole(prompt string) (string, error) {\n\tif prompt != \"\" {\n\t\tfmt.Print(prompt + \": \")\n\t}\n\n\treader := bufio.NewReader(os.Stdin)\n\traw, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn RemoveTralingNewline(raw), nil\n}", "func PromptForSecret(msg string) (string, error) {\n\tfmt.Print(msg)\n\n\tvar resp string\n\tif _, err := ScanlnNoEcho(&resp); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Print new line after prompt since new line wasn't echoed\n\tfmt.Println()\n\n\treturn resp, nil\n}", "func InteractiveInput(prompt string) string {\n\tif prompt != \"\" {\n\t\tfmt.Printf(\"%s \", prompt)\n\t}\n\tinput, err := bufio.NewReader(os.Stdin).ReadString('\\n')\n\tCheck(err)\n\n\t// sanitize input\n\treturn SanitizeInput(input)\n}", "func AskSelection(question string, options []string) (int, bool) {\n\tfmt.Fprintln(Out, question)\n\tfor i, v := range options {\n\t\tfmt.Fprintf(Out, \" [%d] %s\\n\", i, v)\n\t}\n\n\tintAns, err := strconv.Atoi(prompt())\n\tif err != nil || intAns < 0 || intAns > len(options)-1 {\n\t\tfmt.Fprintf(Out, \"Invalid input. Can only be between 0-%d\\n\", len(options)-1)\n\t\treturn 0, false\n\t}\n\n\treturn intAns, true\n}", "func (p *Prompt) Select(text string, list []string, opts *SelectOptions) (string, int, error) {\n\tif len(list) == 0 {\n\t\treturn \"\", 0, errors.New(\"list must be greater than 0\")\n\t}\n\n\tformat := p.fmtSelectOptions(opts)\n\n\tvar selectedIndex int\n\tvar selectedText string\n\n\t// print the list before the prompt to\n\t// provide clear options\n\tfor i, l := range list {\n\t\tf := \" %d - %s\\n\"\n\t\tif i == len(list)-1 {\n\t\t\tf = \" %d - %s\\n\"\n\t\t}\n\n\t\t_, err := p.Writer.Write([]byte(fmt.Sprintf(f, i+1, l)))\n\t\tif err != nil {\n\t\t\treturn \"\", 0, err\n\t\t}\n\t}\n\n\tresp, err := p.read(text, format)\n\tif err != nil {\n\t\treturn \"\", 0, err\n\t}\n\n\tif resp == \"\" && opts.Default != 0 {\n\t\t// minus 1 to account for zero index\n\t\tresp = strconv.Itoa(opts.Default - 1)\n\t} else {\n\t\t// convert resp to string\n\t\te, err := strconv.Atoi(resp)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, err\n\t\t}\n\n\t\t// make sure its a valid option before we minus one\n\t\tif len(list) < e {\n\t\t\treturn \"\", 0, errors.New(\"invalid option provided\")\n\t\t}\n\n\t\t// minus one\n\t\tresp = strconv.Itoa(e - 1)\n\t}\n\n\tselectedIndex, err = strconv.Atoi(resp)\n\tif err != nil {\n\t\treturn \"\", 0, err\n\t}\n\n\tselectedText = list[selectedIndex]\n\n\treturn selectedText, selectedIndex, nil\n}", "func (c *Config) readChoice(prompt string, choices []string, defaultValue *string) (string, error) {\n\tswitch {\n\tcase c.noTTY:\n\t\tfullPrompt := prompt + \" (\" + strings.Join(choices, \"/\")\n\t\tif defaultValue != nil {\n\t\t\tfullPrompt += \", default \" + *defaultValue\n\t\t}\n\t\tfullPrompt += \")? \"\n\t\tabbreviations := chezmoi.UniqueAbbreviations(choices)\n\t\tfor {\n\t\t\tvalue, err := c.readLineRaw(fullPrompt)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tif value == \"\" && defaultValue != nil {\n\t\t\t\treturn *defaultValue, nil\n\t\t\t}\n\t\t\tif value, ok := abbreviations[value]; ok {\n\t\t\t\treturn value, nil\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tinitModel := chezmoibubbles.NewChoiceInputModel(prompt, choices, defaultValue)\n\t\tfinalModel, err := runCancelableModel(initModel)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn finalModel.Value(), nil\n\t}\n}", "func promptType(question string, details string) (t string) {\n\tfor {\n\t\tt = promptString(question, details)\n\t\tt = strings.TrimSpace(t)\n\t\tswitch t {\n\t\tcase dep.TypeBzr, dep.TypeGit, dep.TypeHg, dep.TypeGitClone:\n\t\t\treturn\n\t\tdefault:\n\t\t\tutil.Print(colors.Red(\"Invalid Type, try again...\"))\n\t\t}\n\t}\n}", "func PrintPrompt(g *gocui.Gui) {\n\tpromptString := \"[w,a,s,d,e,?] >>\"\n\n\tg.Update(func(g *gocui.Gui) error {\n\t\tv, err := g.View(Prompt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Clear()\n\t\tv.MoveCursor(0, 0, true)\n\n\t\tif consecutiveError == 0 {\n\t\t\tfmt.Fprintf(v, color.Green(color.Regular, promptString))\n\t\t} else {\n\t\t\tfmt.Fprintf(v, color.Red(color.Regular, promptString))\n\t\t}\n\t\treturn nil\n\t})\n}", "func (pin *Pinentry) Get(prompt string) (string, error) {\n\tcmd := exec.Command(pin.path)\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tbufferReader := bufio.NewReader(stdout)\n\tlineBytes, _, err := bufferReader.ReadLine()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tline := string(lineBytes)\n\tif !strings.HasPrefix(line, \"OK\") {\n\t\treturn \"\", fmt.Errorf(\"failed to initialize pinentry, got response: %v\", line)\n\t}\n\n\tterminal := os.Getenv(\"TERM\")\n\tif len(terminal) > 0 {\n\t\tif ok := setOption(stdin, bufferReader, fmt.Sprintf(\"OPTION ttytype=%s\\n\", terminal)); !ok {\n\t\t\treturn \"\", fmt.Errorf(\"failed to set ttytype\")\n\t\t}\n\t}\n\n\tif ok := setOption(stdin, bufferReader, fmt.Sprintf(\"OPTION ttyname=%v\\n\", tty)); !ok {\n\t\treturn \"\", fmt.Errorf(\"failed to set ttyname\")\n\t}\n\n\tif ok := setOption(stdin, bufferReader, \"SETPROMPT PIN:\\n\"); !ok {\n\t\treturn \"\", fmt.Errorf(\"failed to set prompt\")\n\t}\n\tif ok := setOption(stdin, bufferReader, \"SETTITLE smimesign\\n\"); !ok {\n\t\treturn \"\", fmt.Errorf(\"failed to set title\")\n\t}\n\tif ok := setOption(stdin, bufferReader, fmt.Sprintf(\"SETDESC %s\\n\", prompt)); !ok {\n\t\treturn \"\", fmt.Errorf(\"failed to set description\")\n\t}\n\n\t_, err = fmt.Fprint(stdin, \"GETPIN\\n\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tlineBytes, _, err = bufferReader.ReadLine()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tline = string(lineBytes)\n\n\t_, err = fmt.Fprint(stdin, \"BYE\\n\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err = cmd.Wait(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif !strings.HasPrefix(line, \"D \") {\n\t\treturn \"\", fmt.Errorf(line)\n\t}\n\n\treturn strings.TrimPrefix(line, \"D \"), nil\n}", "func (p *Prompt) GetInput(msg string) (string, error) {\n\tfmt.Fprintln(p.out, msg)\n\tfmt.Fprint(p.out, \"-> \")\n\tp.out.Flush()\n\ttext, err := p.in.ReadString('\\n')\n\treturn strings.TrimSpace(text), err\n}", "func String(pr string, defaultValue string) string {\n\treturn defaultPrompter.String(pr, defaultValue)\n}", "func (module *Crawler) Prompt(what string) {\n}", "func (t Terminal) Read(prompt string) (string, error) {\n\tif prompt != \"\" {\n\t\tfmt.Fprintf(t.Output, \"%s \", prompt)\n\t}\n\n\treader := bufio.NewReader(t.Input)\n\n\ttext, readErr := reader.ReadString('\\n')\n\tif readErr != nil {\n\t\treturn \"\", readErr\n\t}\n\n\ttext = strings.TrimSpace(text)\n\n\treturn text, nil\n}", "func (s Style) PromptString(str string) string {\n\treturn fmt.Sprintf(\"%s%s%s\", s.PromptEscape(), str, Reset.PromptEscape())\n}", "func (l *Linenoise) Read(prompt, init string) (string, error) {\n\tif !isatty.IsTerminal(uintptr(syscall.Stdin)) {\n\t\t// Not a tty, read from a file or pipe.\n\t\treturn l.readBasic()\n\t} else if unsupportedTerm() {\n\t\t// Not a terminal we know about, so basic line reading.\n\t\tfmt.Printf(prompt)\n\t\ts, err := l.readBasic()\n\t\tif err == ErrQuit {\n\t\t\tfmt.Printf(\"\\n\")\n\t\t}\n\t\treturn s, err\n\t} else {\n\t\t// A command line on stdin, our raison d'etre.\n\t\treturn l.readRaw(prompt, init)\n\t}\n}", "func (s *promptString) promptString() error {\n\tprompt := promptui.Prompt{\n\t\tLabel: s.label,\n\t\tDefault: s.defaultValue,\n\t}\n\n\tswitch s.validation {\n\tcase \"email\":\n\t\tprompt.Validate = validateEmailInput\n\tcase \"no-spaces-and-no-uppercase\":\n\t\tprompt.Validate = validateWhiteSpacesAndUpperCase\n\tcase \"url\":\n\t\tprompt.Validate = validateURL\n\tdefault:\n\t\tprompt.Validate = validateEmptyInput\n\t}\n\n\tresult, err := prompt.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.value = result\n\treturn nil\n}", "func Prompt(s string) rune {\n\tacceptedRunes := \"\"\n\n\t// show parentheticals in bold\n\tline := make([]segment, 0)\n\tpos := 0\n\tfor pos < len(s) {\n\t\topen := strings.IndexRune(s[pos:], '(')\n\t\tif open == -1 {\n\t\t\tline = append(line, segment{text: s[pos:]})\n\t\t\tbreak\n\t\t} else {\n\t\t\tclose := strings.IndexRune(s[pos+open:], ')')\n\t\t\tif close == -1 {\n\t\t\t\tline = append(line, segment{text: s[pos:]})\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tline = append(line, segment{text: s[pos : pos+open]})\n\t\t\t\tline = append(line, segment{\n\t\t\t\t\ttext: s[pos+open : pos+open+close+1],\n\t\t\t\t\tfg: colorDefault | bold,\n\t\t\t\t})\n\t\t\t\tacceptedRunes += s[pos+open+1 : pos+open+close]\n\t\t\t\tpos += open + close + 1\n\t\t\t}\n\t\t}\n\t}\n\n\t// add space before cursor\n\tline = append(line, segment{text: \" \"})\n\n\t// wait for and return a valid rune\n\twrite <- line\n\tchange <- modePrompt\n\tfor {\n\t\tch := <-prompt\n\t\tif strings.ContainsRune(acceptedRunes, ch) {\n\t\t\trewrite <- append(line, segment{text: string(ch)})\n\t\t\tchange <- modeWorking\n\t\t\treturn ch\n\t\t}\n\t}\n}", "func Prompt(question string, validators ...ValidatorFunction) (out interface{}) {\n\tfor {\n\t\tfmt.Printf(\"[?] %s: \", question)\n\n\t\tinput, err := getInput()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tvar validatorError error\n\t\tfor _, validator := range validators {\n\t\t\tout, err = validator(input)\n\t\t\tif err != nil {\n\t\t\t\tvalidatorError = err\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif validatorError == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tfmt.Printf(\"[!] Error: %s\\n\", validatorError.Error())\n\t}\n\treturn\n}", "func (p *Player) prompt() {\n\t// TODO: standard/custom prompts\n\tp.writer.Write([]byte(\">\"))\n}", "func (dbg *Debug) GetPrompt(name string) string {\n\thi := dbg.GetCurrentHart()\n\tstate := []rune{'h', 'r'}[util.BoolToInt(hi.State == rv.Running)]\n\treturn fmt.Sprintf(\"%s.%d%c> \", name, hi.ID, state)\n}", "func (c *MetaConfig) GetInput(prompt string, compFunc func(s string) bool, comps ...string) string {\n\tc.WriteString(prompt + \"\\n\")\n\tc.Scan()\n\n\tif compFunc != nil {\n\t\tif !compFunc(c.Text()) {\n\t\t\treturn c.GetInput(prompt, compFunc)\n\t\t}\n\t\treturn c.Text()\n\t}\n\n\tif !StringComp(c.Text(), comps...) {\n\t\treturn c.GetInput(prompt, nil, comps...)\n\t}\n\treturn c.Text()\n}", "func askInput(message string, response interface{}) error {\n\treturn survey.AskOne(&survey.Input{Message: message}, response, survey.MinLength(1))\n}", "func promptForUserInput() (data.CollectionMetadata, data.UserPreferences, error) {\n\t// TODO try to get the user name and email from the git config first before asking for it\n\treader := bufio.NewReader(os.Stdin)\n\tmeta := data.CollectionMetadata{}\n\tu := data.UserPreferences{}\n\n\tusername, err := user.Current()\n\tif err != nil {\n\t\tfmt.Print(\"Could not determine current user\")\n\t\tos.Exit(1)\n\t}\n\n\thost, hostErr := os.Hostname()\n\tif hostErr != nil {\n\t\tfmt.Print(\"Could not determine hostname\")\n\t\tos.Exit(1)\n\t}\n\n\tuid, uuidErr := uuid.NewV4()\n\tif uuidErr != nil {\n\t\tfmt.Print(\"Could not generate project identifier\")\n\t\tos.Exit(1)\n\t}\n\n\t// default values\n\tmeta.Collection = \"Bibliography\"\n\tmeta.Description = \"Project bibliography.\"\n\tmeta.Id = uid.String()\n\tmeta.Owner = username.Username + \"@\" + host\n\tmeta.Created = time.Now().UTC().Format(time.RFC3339)\n\tmeta.Modified = time.Now().UTC().Format(time.RFC3339)\n\n\t// override defaults with user specified values\n\tfmt.Print(ansi.Color(\" Project or collection name: (Bibliography) \", \"blue\"))\n\tname, _ := reader.ReadString('\\n')\n\n\tfmt.Print(ansi.Color(\" Description: (Project bibliography.) \", \"blue\"))\n\tdesc, _ := reader.ReadString('\\n')\n\n\tfmt.Print(ansi.Color(\" Owner: (\" + username.Username + \") \", \"blue\"))\n\towner, _ := reader.ReadString('\\n')\n\n\tmeta.Collection = name\n\tmeta.Description = desc\n\tmeta.Owner = owner\n\n\tfmt.Print(ansi.Color(\" Email: (\" + username.Username + \"@\" + host + \") \", \"blue\"))\n\temail, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\treturn meta, u, err\n\t}\n\n\tu.Fullname = strings.Trim(owner, \"\\n\")\n\tu.Email = strings.Trim(email, \"\\n\")\n\n\treturn meta, u, nil\n}", "func AskForDefaultTeam(username string, token string, org string) int {\n\tteams := ListOrgTeams(username, token, org)\n\tfmt.Printf(\"%v\", teams)\n\tfmt.Println(\"Which team would you want as default? (this option can be overridden in individual calls)\")\n\tPrintTable([]string{\"TeamId\", \"TeamName\"}, pivotTeamList(teams))\n\tteam := getInt(\"Team ID (number): \")\n\tif !intInSlice(team, teamSliceToIntSlice(teams)) {\n\t\tlog.Fatalln(\"input not in available options\")\n\t}\n\treturn team\n}" ]
[ "0.67208904", "0.6344035", "0.6259892", "0.62460095", "0.6184595", "0.6145198", "0.6137686", "0.6094732", "0.6065367", "0.604232", "0.59828156", "0.59640247", "0.59612864", "0.5935014", "0.5933619", "0.59018624", "0.5896817", "0.5866267", "0.58331585", "0.5828249", "0.5823301", "0.57945883", "0.5781319", "0.5756633", "0.5751212", "0.56929696", "0.5665811", "0.56319827", "0.561608", "0.56113863", "0.56079197", "0.5603894", "0.55998755", "0.5576329", "0.55387545", "0.5535049", "0.55326176", "0.552957", "0.5525754", "0.55094594", "0.55051553", "0.54715806", "0.5447509", "0.5447493", "0.54320943", "0.54299206", "0.5415318", "0.53773135", "0.53546536", "0.5352462", "0.5341235", "0.5339432", "0.5327807", "0.5325835", "0.5322486", "0.5311241", "0.53081006", "0.52956784", "0.5273037", "0.52675575", "0.52651644", "0.5255904", "0.5246802", "0.5233655", "0.5226799", "0.522128", "0.5217098", "0.52168673", "0.5203005", "0.518544", "0.5181289", "0.517813", "0.517774", "0.51735544", "0.5154727", "0.51516294", "0.5143121", "0.5132666", "0.51165414", "0.51124185", "0.5102107", "0.5080684", "0.50705326", "0.5054862", "0.50491893", "0.504891", "0.5047254", "0.50419444", "0.5041258", "0.5029441", "0.50220644", "0.502137", "0.501031", "0.49983272", "0.4992761", "0.49767196", "0.49762955", "0.4971655", "0.4969285", "0.49628133" ]
0.76892096
0
NewCmd returns a cobra.Command for archiving images operations.
NewCmd возвращает cobra.Command для операций архивирования образов.
func NewCmd() *cobra.Command { cmd := &cobra.Command{ Use: "archive-images", Short: "Export Capact Docker images to a tar archive", Long: "Subcommand for various manifest generation operations", } cmd.AddCommand(NewFromHelmCharts()) return cmd }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCmdCreate(out io.Writer) *cobra.Command {\n\tcf := &run.CreateFlags{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create <image>\",\n\t\tShort: \"Create a new VM without starting it\",\n\t\tLong: dedent.Dedent(`\n\t\t\tCreate a new VM by combining the given image and kernel.\n\t\t\tVarious VM tunables can be set during creation by using\n\t\t\tthe flags for this command. The image and kernel are\n\t\t\tmatched by prefix based on their ID and name.\n\t\t\t\n\t\t\tIf the name flag (-n, --name) is not specified,\n\t\t\tthe VM is given a random name. Using the copy files\n\t\t\tflag (-f, --copy-files), additional files can be added to\n\t\t\tthe VM during creation with the syntax /host/path:/vm/path.\n\n\t\t\tExample usage:\n\t\t\t\t$ ignite create my-image my-kernel \\\n\t\t\t\t\t--name my-vm \\\n\t\t\t\t\t--cpus 2 \\\n\t\t\t\t\t--memory 2048 \\\n\t\t\t\t\t--size 6GB\n\t\t`),\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terrutils.Check(func() error {\n\t\t\t\tco, err := cf.NewCreateOptions(loader.NewResLoader(), args[0])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\treturn run.Create(co)\n\t\t\t}())\n\t\t},\n\t}\n\n\taddCreateFlags(cmd.Flags(), cf)\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"add\",\n\t\tShort: \"Adds the image to the scanning service\",\n\t\tLong: \"Adds the image to the scanning service\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) < 1 {\n\t\t\t\treturn fmt.Errorf(\"Insufficient arguments, retry with the image name as argument\")\n\t\t\t} else if len(args) > 1 {\n\t\t\t\treturn fmt.Errorf(\"Too many arguments, retry with the image name as the only argument\")\n\t\t\t}\n\t\t\tctx := context.Background()\n\t\t\tctx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\t\t\tdefer cancel()\n\n\t\t\terr := anchore.ScanImage(ctx, args[0])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\treturn cmd\n}", "func newManifestCmd(rootParams *rootParameters) *cobra.Command {\n\tmanifestParams := manifestParameters{rootParameters: rootParams}\n\tcmd := &cobra.Command{\n\t\tUse: \"manifest\",\n\t\tShort: \"Manage manifests inside a repository\",\n\t\tLong: newManifestCmdLongMessage,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcmd.Help()\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tlistManifestCmd := newManifestListCmd(&manifestParams)\n\tdeleteManifestCmd := newManifestDeleteCmd(&manifestParams)\n\n\tcmd.AddCommand(\n\t\tlistManifestCmd,\n\t\tdeleteManifestCmd,\n\t)\n\tcmd.PersistentFlags().StringVar(&manifestParams.repoName, \"repository\", \"\", \"The repository name\")\n\t// Since the repository will be needed in either subcommand it is marked as a required flag\n\tcmd.MarkPersistentFlagRequired(\"repository\")\n\n\treturn cmd\n}", "func NewCmd(o *Options) *cobra.Command {\n\n\tc := command{\n\t\tCommand: cli.Command{Options: o.Options},\n\t\topts: o,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"module <MODULE_IMAGE>\",\n\t\tShort: \"Unpacks an OCI container image module bundled as an from the contents of the given path\",\n\t\tLong: `Use this command to unpack a Kyma module.\n\n### Detailed description\n\nKyma modules are individual components that can be deployed into a Kyma runtime. Modules are built and distributed as OCI container images. \nWith this command, you can unpack the contents of an image so that they can be deployed into a cluster or inspected by developers.\n`,\n\n\t\tRunE: func(_ *cobra.Command, args []string) error { return c.Run(args) },\n\t\tAliases: []string{\"mod\"},\n\t}\n\n\treturn cmd\n}", "func NewImageCommand(rootSettings *environment.AirshipCTLSettings) *cobra.Command {\n\timageRootCmd := &cobra.Command{\n\t\tUse: \"image\",\n\t\tShort: \"Manage ISO image creation\",\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tlog.Init(rootSettings.Debug, cmd.OutOrStderr())\n\n\t\t\t// Load or Initialize airship Config\n\t\t\trootSettings.InitConfig()\n\t\t},\n\t}\n\n\timageBuildCmd := NewImageBuildCommand(rootSettings)\n\timageRootCmd.AddCommand(imageBuildCmd)\n\n\treturn imageRootCmd\n}", "func NewCmd(name, fullName string) *cobra.Command {\n\n\taddCmd := newCmdAdd(addRecommendedCommandName, odoutil.GetFullName(fullName, addRecommendedCommandName))\n\n\tvar cmd = &cobra.Command{\n\t\tUse: name,\n\t\tShort: \"Manage services in an environment\",\n\t\tLong: \"Manage services in a GitOps environment where service source repositories are synchronized\",\n\t\tExample: fmt.Sprintf(\"%s\\n%s\\n\\n See sub-commands individually for more examples\",\n\t\t\tfullName, addRecommendedCommandName),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t},\n\t}\n\n\tcmd.Flags().AddFlagSet(addCmd.Flags())\n\tcmd.AddCommand(addCmd)\n\n\tcmd.Annotations = map[string]string{\"command\": \"main\"}\n\tcmd.SetUsageTemplate(odoutil.CmdUsageTemplate)\n\treturn cmd\n}", "func NewManifestCmd() *cobra.Command {\n\tmanifestCmd := &cobra.Command{\n\t\tUse: \"manifest\",\n\t\tShort: \"Manipulate manifest lists\",\n\t}\n\tmanifestCmd.AddCommand(\n\t\tNewManifestCreateCmd(),\n\t\tNewManifestAnnotateCmd(),\n\t\tNewManifestInspectCmd(),\n\t)\n\n\treturn manifestCmd\n}", "func newCreateCmd() *cobra.Command {\n\tcreateCmd := cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: `Create a new verless object`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Help()\n\t\t},\n\t}\n\n\tcreateCmd.AddCommand(newCreateProjectCmd())\n\tcreateCmd.AddCommand(newCreateThemeCmd())\n\tcreateCmd.AddCommand(newCreateFile())\n\n\treturn &createCmd\n}", "func NewCmd(f cmdutil.Factory, clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, cmFlags *genericclioptionscm.CMFlags, streams genericclioptions.IOStreams) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"get\",\n\t\tShort: \"get a resource\",\n\t}\n\n\tcmd.AddCommand(clusters.NewCmd(cmFlags, streams))\n\tcmd.AddCommand(credentials.NewCmd(cmFlags, streams))\n\tcmd.AddCommand(machinepools.NewCmd(cmFlags, streams))\n\tcmd.AddCommand(clusteradmgettoken.NewCmd(clusteradmFlags, streams))\n\tcmd.AddCommand(clusterpoolhosts.NewCmd(f, cmFlags, streams))\n\tcmd.AddCommand(clusterclaim.NewCmd(f, cmFlags, streams))\n\tcmd.AddCommand(clusterpools.NewCmd(f, cmFlags, streams))\n\tcmd.AddCommand(config.NewCmd(clusteradmFlags, cmFlags, streams))\n\tcmd.AddCommand(policies.NewCmd(f, cmFlags, streams))\n\n\treturn cmd\n}", "func NewCommand(c *cli.Context) (Command, error) {\n\tconst errtag = \"NewCommand():\"\n\tvar err error\n\n\tvar cmd Command\n\tb := c.GlobalString(\"businesscard\")\n\n\tif b == \"\" {\n\t\targs := c.Args()\n\t\tcmd.repo = args[0]\n\t\tcmd.name, err = getName(cmd.repo)\n\t\tif err != nil {\n\t\t\treturn cmd, errors.Wrap(err, errtag)\n\t\t}\n\t\tcmd.args = args[1:]\n\t} else {\n\t\tcmd.name = b\n\t\tcmd.repo = \"github.com/\" + b + \"/\" + b\n\t}\n\n\treturn cmd, nil\n}", "func NewGenerateCmd(client *registry.HTTPClient) *cobra.Command {\n\tgenerateCmd := &cobra.Command{\n\t\tUse: \"generate\",\n\t\tShort: \"Generate a Lockfile to track image digests\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := validateGenerateCmdFlags(cmd); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tenvPath, err := cmd.Flags().GetString(\"env-file\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tenvPath = filepath.ToSlash(envPath)\n\t\t\t_ = godotenv.Load(envPath)\n\t\t\twm, err := getDefaultWrapperManager(cmd, client)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tgenerator, err := generate.NewGenerator(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlFile, err := os.Create(generator.LockfileName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer lFile.Close()\n\t\t\tif err := generator.GenerateLockfile(wm, lFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tgenerateCmd.Flags().String(\n\t\t\"base-dir\", \".\", \"Top level directory to collect files from\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfiles\", []string{}, \"Path to Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"compose-files\", []string{}, \"Path to docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfile-globs\", []string{}, \"Glob pattern to select Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"compose-file-globs\", []string{},\n\t\t\"Glob pattern to select docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-recursive\", false, \"Recursively collect Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"compose-file-recursive\", false,\n\t\t\"Recursively collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"lockfile-name\", \"docker-lock.json\",\n\t\t\"Lockfile name to be output in the current working directory\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"config-file\", getDefaultConfigPath(),\n\t\t\"Path to config file for auth credentials\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"env-file\", \".env\", \"Path to .env file\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-env-build-args\", false,\n\t\t\"Use environment vars as build args for Dockerfiles\",\n\t)\n\treturn generateCmd\n}", "func NewCmd(name, fullName string) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: name,\n\t\tShort: \"Print the version information\",\n\t\tLong: \"Print the version information\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"kam version %s\\n\", Version)\n\t\t},\n\t}\n}", "func NewCmd(use string) Builder {\n\treturn &builder{\n\t\tcmd: cobra.Command{\n\t\t\tUse: use,\n\t\t},\n\t}\n}", "func NewCmd(db *bolt.DB) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"card\",\n\t\tShort: \"Card operations\",\n\t\tExample: example,\n\t}\n\n\tcmd.AddCommand(cadd.NewCmd(db, os.Stdin), ccopy.NewCmd(db), cedit.NewCmd(db), cls.NewCmd(db), crm.NewCmd(db, os.Stdin))\n\n\treturn cmd\n}", "func newDestroyCmd() *cobra.Command {\n\tdc := &destroyCmd{}\n\n\tdestroyCmd := &cobra.Command{\n\t\tUse: \"destroy [-f SORUCE]\",\n\t\tShort: \"Destroy tau managed infrastructure\",\n\t\tLong: destroyLong,\n\t\tExample: destroyExample,\n\t\tDisableFlagsInUseLine: true,\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tArgs: cobra.MaximumNArgs(0),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := dc.meta.init(args); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn dc.run(args)\n\t\t},\n\t}\n\n\tf := destroyCmd.Flags()\n\tf.BoolVar(&dc.autoApprove, \"auto-approve\", false, \"auto approve destruction\")\n\n\tdc.addMetaFlags(destroyCmd)\n\n\treturn destroyCmd\n}", "func New(dir, name string, args ...string) Command {\n\tc := Command{}\n\n\tc.cmd = exec.Command(name, args...)\n\tc.cmd.Dir = dir\n\n\treturn c\n}", "func New(cmd string) *Cmd {\n\tvar args []string\n\tcmds, err := shellquote.Split(cmd)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tname := cmds[0]\n\tfor _, arg := range cmds[1:] {\n\t\targs = append(args, arg)\n\t}\n\treturn &Cmd{Name: name, Args: args}\n}", "func NewCmd(args ...interface{}) *redis.Cmd {\n\treturn redis.NewCmd(args...)\n}", "func newResourcesCmd() *cobra.Command {\n\tversionCmd := &cobra.Command{\n\t\tUse: \"resources\",\n\t\tShort: \"List Kubernetes API Resources\",\n\t\tExample: resourceExample,\n\t\tRunE: ResourcesCmd,\n\t}\n\n\treturn versionCmd\n}", "func NewCmd(octaviusDaemon daemon.Client, fileUtil file.File) *cobra.Command {\n\tvar metadataFilePath string\n\n\tcreateCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create new octavius job metadata\",\n\t\tLong: \"This command helps create new job metadata to your CP host with proper metadata.json file\",\n\t\tExample: fmt.Sprintf(\"octavius create --job-path <filepath>/metadata.json\"),\n\t\tArgs: cobra.MaximumNArgs(0),\n\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\n\t\t\tprinter.Println(\"Creating a new job.\", color.FgBlack)\n\t\t\tmetadataFileIoReader, err := fileUtil.GetIoReader(metadataFilePath)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"error in reading file\")\n\t\t\t\tprinter.Println(fmt.Sprintf(\"error in reading file %v\", err.Error()), color.FgRed)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tclient := &client.GrpcClient{}\n\t\t\tres, err := octaviusDaemon.Post(metadataFileIoReader, client)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"error in creating metadata\")\n\t\t\t\tprinter.Println(fmt.Sprintf(\"error in creating metadata, %v\", status.Convert(err).Message()), color.FgRed)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlog.Info(fmt.Sprintf(\"%s job created\", res.Name))\n\t\t\tprinter.Println(fmt.Sprintf(\"%s job created\", res.Name), color.FgGreen)\n\t\t},\n\t}\n\tcreateCmd.Flags().StringVarP(&metadataFilePath, \"job-path\", \"\", \"\", \"path to metadata.json(required)\")\n\terr := createCmd.MarkFlagRequired(\"job-path\")\n\tif err != nil {\n\t\tlog.Error(err, \"error while setting the flag required\")\n\t\tprinter.Println(\"error while setting the flag required\", color.FgRed)\n\t\treturn nil\n\t}\n\treturn createCmd\n}", "func New(name string, pattern string, command string, args ...string) *Cmd {\n\treturn &Cmd{\n\t\tName: name,\n\t\tCommand: command,\n\t\tArgs: args,\n\t\tPattern: pattern,\n\t}\n}", "func NewGenerateCmd() (*cobra.Command, error) {\n\tgenerateCmd := &cobra.Command{\n\t\tUse: \"generate\",\n\t\tShort: \"Generate a Lockfile to track image digests\",\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn bindPFlags(cmd, []string{\n\t\t\t\t\"base-dir\",\n\t\t\t\t\"dockerfiles\",\n\t\t\t\t\"composefiles\",\n\t\t\t\t\"kubernetesfiles\",\n\t\t\t\t\"lockfile-name\",\n\t\t\t\t\"dockerfile-globs\",\n\t\t\t\t\"composefile-globs\",\n\t\t\t\t\"kubernetesfile-globs\",\n\t\t\t\t\"dockerfile-recursive\",\n\t\t\t\t\"composefile-recursive\",\n\t\t\t\t\"kubernetesfile-recursive\",\n\t\t\t\t\"exclude-all-dockerfiles\",\n\t\t\t\t\"exclude-all-composefiles\",\n\t\t\t\t\"exclude-all-kubernetesfiles\",\n\t\t\t\t\"ignore-missing-digests\",\n\t\t\t\t\"update-existing-digests\",\n\t\t\t})\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tflags, err := parseFlags()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tgenerator, err := SetupGenerator(flags)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tvar lockfileByt bytes.Buffer\n\n\t\t\terr = generator.GenerateLockfile(&lockfileByt)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlockfileContents := lockfileByt.Bytes()\n\n\t\t\tif len(lockfileContents) == 0 {\n\t\t\t\treturn errors.New(\"no images found\")\n\t\t\t}\n\n\t\t\twriter, err := os.Create(\n\t\t\t\tflags.FlagsWithSharedValues.LockfileName,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer writer.Close()\n\n\t\t\t_, err = writer.Write(lockfileContents)\n\t\t\tif err == nil {\n\t\t\t\tfmt.Println(\"successfully generated lockfile!\")\n\t\t\t}\n\n\t\t\treturn err\n\t\t},\n\t}\n\tgenerateCmd.Flags().String(\n\t\t\"base-dir\", \".\", \"Top level directory to collect files from\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfiles\", []string{}, \"Paths to Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"composefiles\", []string{}, \"Paths to docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"kubernetesfiles\", []string{}, \"Paths to kubernetes files\",\n\t)\n\tgenerateCmd.Flags().String(\n\t\t\"lockfile-name\", \"docker-lock.json\",\n\t\t\"Lockfile name to be output in the current working directory\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"dockerfile-globs\", []string{}, \"Glob pattern to select Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"composefile-globs\", []string{},\n\t\t\"Glob pattern to select docker-compose files\",\n\t)\n\tgenerateCmd.Flags().StringSlice(\n\t\t\"kubernetesfile-globs\", []string{},\n\t\t\"Glob pattern to select kubernetes files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"dockerfile-recursive\", false, \"Recursively collect Dockerfiles\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"composefile-recursive\", false,\n\t\t\"Recursively collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"kubernetesfile-recursive\", false,\n\t\t\"Recursively collect kubernetes files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"exclude-all-dockerfiles\", false,\n\t\t\"Do not collect Dockerfiles unless referenced by docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"exclude-all-composefiles\", false,\n\t\t\"Do not collect docker-compose files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"exclude-all-kubernetesfiles\", false,\n\t\t\"Do not collect kubernetes files\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"ignore-missing-digests\", false,\n\t\t\"Do not fail if unable to find digests\",\n\t)\n\tgenerateCmd.Flags().Bool(\n\t\t\"update-existing-digests\", false,\n\t\t\"Query registries for new digests even if they are hardcoded in files\",\n\t)\n\n\treturn generateCmd, nil\n}", "func NewCmdImage(f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {\n\tcmd := set.NewCmdImage(f, streams)\n\tcmd.Long = setImageLong\n\tcmd.Example = setImageExample\n\tcmd.Flags().String(\"source\", \"docker\", \"The image source type; valid types are 'imagestreamtag', 'istag', 'imagestreamimage', 'isimage', and 'docker'\")\n\tset.ImageResolver = resolveImageFactory(f, cmd)\n\n\treturn cmd\n}", "func (c *Command) New() *cobra.Command {\n\tnewCommand := &cobra.Command{\n\t\tUse: \"annactl\",\n\t\tShort: \"Manage the API of the anna project. For more information see https://github.com/the-anna-project/annactl.\",\n\t\tLong: \"Manage the API of the anna project. For more information see https://github.com/the-anna-project/annactl.\",\n\t\tRun: c.Execute,\n\t}\n\n\tnewCommand.AddCommand(c.endpointCommand.New())\n\tnewCommand.AddCommand(c.versionCommand.New())\n\n\treturn newCommand\n}", "func NewCmd(o *Options) *cobra.Command {\n\n\tcmd := command{\n\t\tCommand: cli.Command{Options: o.Options},\n\t\topts: o,\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"deploy\",\n\t\tShort: \"Deploys Kyma on a running Kubernetes cluster.\",\n\t\tLong: \"Use this command to deploy, upgrade, or adapt Kyma on a running Kubernetes cluster.\",\n\t\tRunE: func(cc *cobra.Command, _ []string) error { return cmd.RunWithTimeout(cc.Context()) },\n\t\tAliases: []string{\"d\"},\n\t}\n\n\tcobraCmd.Flags().StringArrayVarP(&o.Components, \"component\", \"\", []string{}, `Provide one or more components to deploy, for example:\n\t- With short-hand notation: \"--component name@namespace\"\n\t- With verbose JSON structure \"--component '{\"name\": \"componentName\",\"namespace\": \"componentNamespace\",\"url\": \"componentUrl\",\"version\": \"1.2.3\"}'`)\n\tcobraCmd.Flags().StringVarP(&o.ComponentsFile, \"components-file\", \"c\", \"\", `Path to the components file (default \"$HOME/.kyma/sources/installation/resources/components.yaml\" or \".kyma-sources/installation/resources/components.yaml\")`)\n\tcobraCmd.Flags().StringVarP(&o.WorkspacePath, \"workspace\", \"w\", \"\", `Path to download Kyma sources (default \"$HOME/.kyma/sources\" or \".kyma-sources\")`)\n\tcobraCmd.Flags().StringVarP(&o.Source, \"source\", \"s\", config.DefaultKyma2Version, `Installation source:\n\t- Deploy a specific release, for example: \"kyma deploy --source=2.0.0\"\n\t- Deploy a specific branch of the Kyma repository on kyma-project.org: \"kyma deploy --source=<my-branch-name>\"\n\t- Deploy a commit (8 characters or more), for example: \"kyma deploy --source=34edf09a\"\n\t- Deploy a pull request, for example \"kyma deploy --source=PR-9486\"\n\t- Deploy the local sources: \"kyma deploy --source=local\"`)\n\tcobraCmd.Flags().StringVarP(&o.Domain, \"domain\", \"d\", \"\", \"Custom domain used for installation.\")\n\tcobraCmd.Flags().BoolVar(&o.DryRun, \"dry-run\", false, \"Alpha feature: Renders the Kubernetes manifests without actually applying them. The generated resources are not sufficient to apply Kyma to a cluster, because components having custom installation routines (such as Istio) are not included.\")\n\tcobraCmd.Flags().StringVarP(&o.Profile, \"profile\", \"p\", \"\",\n\t\tfmt.Sprintf(\"Kyma deployment profile. If not specified, Kyma uses its default configuration. The supported profiles are: %s, %s.\", profileEvaluation, profileProduction))\n\tcobraCmd.Flags().StringVarP(&o.TLSCrtFile, \"tls-crt\", \"\", \"\", \"TLS certificate file for the domain used for installation.\")\n\tcobraCmd.Flags().StringVarP(&o.TLSKeyFile, \"tls-key\", \"\", \"\", \"TLS key file for the domain used for installation.\")\n\tcobraCmd.Flags().IntVarP(&o.WorkerPoolSize, \"concurrency\", \"\", 4, \"Set maximum number of workers to run simultaneously to deploy Kyma.\")\n\tcobraCmd.Flags().StringSliceVarP(&o.Values, \"value\", \"\", []string{}, \"Set configuration values. Can specify one or more values, also as a comma-separated list (e.g. --value component.a='1' --value component.b='2' or --value component.a='1',component.b='2').\")\n\tcobraCmd.Flags().StringSliceVarP(&o.ValueFiles, \"values-file\", \"f\", []string{}, \"Path(s) to one or more JSON or YAML files with configuration values.\")\n\tcobraCmd.Flags().DurationVarP(&o.Timeout, \"timeout\", \"t\", 20*time.Minute, \"Maximum time for the deployment.\")\n\n\treturn cobraCmd\n}", "func NewCmd(cxt *command.Context) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"touch\",\n\t\tShort: \"Make the service catalog attempt to re-provision an instance\",\n\t\tExample: \"svcat touch instance wordpress-mysql-instance\",\n\t}\n\tcmd.AddCommand(newTouchInstanceCmd(cxt))\n\treturn cmd\n}", "func newCreateIdentityCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command {\n\tnewOptions := func() *createIdentityOptions {\n\t\treturn &createIdentityOptions{\n\t\t\tedgeOptions: edgeOptions{\n\t\t\t\tCommonOptions: common.CommonOptions{Factory: f, Out: out, Err: errOut},\n\t\t\t},\n\t\t}\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"identity\",\n\t\tShort: \"creates a new identity managed by the Ziti Edge Controller\",\n\t\tLong: \"creates a new identity managed by the Ziti Edge Controller\",\n\t}\n\n\tcmd.AddCommand(newCreateIdentityOfTypeCmd(\"device\", newOptions()))\n\tcmd.AddCommand(newCreateIdentityOfTypeCmd(\"user\", newOptions()))\n\tcmd.AddCommand(newCreateIdentityOfTypeCmd(\"service\", newOptions()))\n\n\treturn cmd\n}", "func NewCommand(out io.Writer, fs fs.FileSystem, rf *resmap.Factory, ptf transformer.Factory) *cobra.Command {\n\tops := NewCommandOptions()\n\n\tcmd := &cobra.Command{\n\t\tUse: \"build [path]\",\n\t\tShort: \"Print current configuration per contents of \" + constants.KustomizationFileName,\n\t\tExample: examples,\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\terr := ops.Validate(args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn ops.Run(out, fs, rf, ptf)\n\t\t},\n\t}\n\n\tops.SetFlags(cmd.Flags())\n\n\treturn cmd\n}", "func New() *cobra.Command {\n\tzoneCmd.Flags().StringVarP(&br, \"bedroom\", \"b\", \"\", \"bedroom enabled (on/off)\")\n\tzoneCmd.Flags().StringVarP(&st, \"study\", \"s\", \"\", \"study enabled (on/off)\")\n\n\treturn zoneCmd\n}", "func NewCommand() (cmd *cobra.Command) {\n\tcmd = &cobra.Command{Use: \"binctl\", Run: func(cmd *cobra.Command, args []string) {\n\t\t//fmt.Println(\"Operate pipeline\")\n\t\t//fmt.Println(\"init binctl\")\n\t}}\n\tcmd.AddCommand(cmdMemory())\n\tcmd.AddCommand(cmdPipeline())\n\tcmd.PersistentFlags().String(\"config\", \"./configs/binlogo.yaml\", \"config file default is ./configs/binlogo.yaml\")\n\terr := viper.BindPFlag(\"config\", cmd.PersistentFlags().Lookup(\"config\"))\n\t// configs.InitViperFromFile(viper.GetString(\"config\"))\n\tconfigs.Init(viper.GetString(\"config\"))\n\t//etcd2.DefaultETCD()\n\tblog.Env(configs.Env(viper.GetString(\"env\")))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn\n}", "func NewCmd(o *Options) *cobra.Command {\n\tc := command{\n\t\tCommand: cli.Command{Options: o.Options},\n\t\topts: o,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"new-lambda\",\n\t\tShort: \"New local Lambda Function\",\n\t\tLong: `Creates a new local lambda function setup to start development`,\n\t\tRunE: func(_ *cobra.Command, args []string) error { return c.Run(args) },\n\t}\n\n\tcmd.Args = cobra.ExactArgs(1)\n\n\tcmd.Flags().StringVarP(&o.Namespace, \"namespace\", \"n\", \"default\", \"Namespace to bind\")\n\tcmd.Flags().BoolVar(&o.Expose, \"expose\", false, \"Create the namespace if not existing\")\n\tcmd.Flags().StringVar(&o.ClusterDomain, \"cluster-domain\", \"\", \"Cluster Domain of your cluster\")\n\n\treturn cmd\n}", "func newExportCfgsCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"export\",\n\t\tShort: \"Export the configurations of sources and tasks\",\n\t\tRunE: exportCfgsFunc,\n\t}\n\tcmd.Flags().StringP(\"dir\", \"d\", \"\", \"specify the configs directory, default is `./configs`\")\n\t_ = cmd.Flags().MarkHidden(\"dir\")\n\treturn cmd\n}", "func NewCmdFlatten(options *[]crane.Option) *cobra.Command {\n\tvar newRef string\n\n\tflattenCmd := &cobra.Command{\n\t\tUse: \"flatten\",\n\t\tShort: \"Flatten an image's layers into a single layer\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\t// Pull image and get config.\n\t\t\tref := args[0]\n\n\t\t\t// If the new ref isn't provided, write over the original image.\n\t\t\t// If that ref was provided by digest (e.g., output from\n\t\t\t// another crane command), then strip that and push the\n\t\t\t// mutated image by digest instead.\n\t\t\tif newRef == \"\" {\n\t\t\t\tnewRef = ref\n\t\t\t}\n\n\t\t\t// Stupid hack to support insecure flag.\n\t\t\tnameOpt := []name.Option{}\n\t\t\tif ok, err := cmd.Parent().PersistentFlags().GetBool(\"insecure\"); err != nil {\n\t\t\t\tlog.Fatalf(\"flag problems: %v\", err)\n\t\t\t} else if ok {\n\t\t\t\tnameOpt = append(nameOpt, name.Insecure)\n\t\t\t}\n\t\t\tr, err := name.ParseReference(newRef, nameOpt...)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"parsing %s: %v\", newRef, err)\n\t\t\t}\n\n\t\t\tdesc, err := crane.Head(ref, *options...)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"checking %s: %v\", ref, err)\n\t\t\t}\n\t\t\tif !cmd.Parent().PersistentFlags().Changed(\"platform\") && desc.MediaType.IsIndex() {\n\t\t\t\tlog.Fatalf(\"flattening an index is not yet supported\")\n\t\t\t}\n\n\t\t\told, err := crane.Pull(ref, *options...)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"pulling %s: %v\", ref, err)\n\t\t\t}\n\n\t\t\tm, err := old.Manifest()\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"reading manifest: %v\", err)\n\t\t\t}\n\n\t\t\tcf, err := old.ConfigFile()\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"getting config: %v\", err)\n\t\t\t}\n\t\t\tcf = cf.DeepCopy()\n\n\t\t\toldHistory, err := json.Marshal(cf.History)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"marshal history\")\n\t\t\t}\n\n\t\t\t// Clear layer-specific config file information.\n\t\t\tcf.RootFS.DiffIDs = []v1.Hash{}\n\t\t\tcf.History = []v1.History{}\n\n\t\t\timg, err := mutate.ConfigFile(empty.Image, cf)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"mutating config: %v\", err)\n\t\t\t}\n\n\t\t\t// TODO: Make compression configurable?\n\t\t\tlayer := stream.NewLayer(mutate.Extract(old), stream.WithCompressionLevel(gzip.BestCompression))\n\n\t\t\timg, err = mutate.Append(img, mutate.Addendum{\n\t\t\t\tLayer: layer,\n\t\t\t\tHistory: v1.History{\n\t\t\t\t\tCreatedBy: fmt.Sprintf(\"%s flatten %s\", cmd.Parent().Use, desc.Digest),\n\t\t\t\t\tComment: string(oldHistory),\n\t\t\t\t},\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"appending layers: %v\", err)\n\t\t\t}\n\n\t\t\t// Retain any annotations from the original image.\n\t\t\tif len(m.Annotations) != 0 {\n\t\t\t\timg = mutate.Annotations(img, m.Annotations).(v1.Image)\n\t\t\t}\n\n\t\t\tif _, ok := r.(name.Digest); ok {\n\t\t\t\t// If we're pushing by digest, we need to upload the layer first.\n\t\t\t\tif err := crane.Upload(layer, r.Context().String(), *options...); err != nil {\n\t\t\t\t\tlog.Fatalf(\"uploading layer: %v\", err)\n\t\t\t\t}\n\t\t\t\tdigest, err := img.Digest()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"digesting new image: %v\", err)\n\t\t\t\t}\n\t\t\t\tnewRef = r.Context().Digest(digest.String()).String()\n\t\t\t}\n\t\t\tif err := crane.Push(img, newRef, *options...); err != nil {\n\t\t\t\tlog.Fatalf(\"pushing %s: %v\", newRef, err)\n\t\t\t}\n\t\t\tdigest, err := img.Digest()\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"digesting new image: %v\", err)\n\t\t\t}\n\t\t\tfmt.Println(r.Context().Digest(digest.String()))\n\t\t},\n\t}\n\tflattenCmd.Flags().StringVarP(&newRef, \"tag\", \"t\", \"\", \"New tag to apply to flattened image. If not provided, push by digest to the original image repository.\")\n\treturn flattenCmd\n}", "func New(settings *environment.Settings) *cobra.Command {\n\treturn newCmd(settings, httpclient.New())\n}", "func NewCmd(cfg *CmdCfg) (Cmd, error) {\n\terr := validator.Validate(cfg)\n\tif err != nil {\n\t\treturn Cmd{}, errors.Wrap(err, \"error validating config\")\n\t}\n\tif cfg.Time.IsZero() {\n\t\tcfg.Time = time.Now().UTC()\n\t}\n\n\tid, err := uuid.NewRandom()\n\tif err != nil {\n\t\treturn Cmd{}, errors.Wrap(err, \"error generating event-id\")\n\t}\n\n\tvar dataBytes []byte\n\tswitch v := cfg.Data.(type) {\n\tcase []byte:\n\t\tdataBytes = v\n\tdefault:\n\t\tdataBytes, err = json.Marshal(cfg.Data)\n\t\tif err != nil {\n\t\t\treturn Cmd{}, errors.Wrap(err, \"error json-marshalling data\")\n\t\t}\n\t}\n\n\treturn Cmd{\n\t\tid: id.String(),\n\t\tcorrelationKey: cfg.CorrelationKey,\n\n\t\ttime: cfg.Time,\n\t\taction: cfg.Action,\n\t\tdata: dataBytes,\n\t}, nil\n}", "func newCmd(cmd string, arg ...string) *exec.Cmd {\n\tc := exec.Command(cmd, arg...)\n\tc.Stdout = os.Stdout\n\tc.Stderr = os.Stderr\n\treturn c\n}", "func NewCmd(o *cli.Options) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"get\",\n\t\tShort: \"Gets Kyma-related resources.\",\n\t\tLong: \"Use this command to get Kyma-related resources.\",\n\t}\n\n\tcmd.AddCommand(schema.NewCmd(schema.NewOptions(o, os.Stdout, refMap)))\n\treturn cmd\n}", "func GetImagesCommand() cli.Command {\n\tcommand := cli.Command{\n\t\tName: \"image\",\n\t\tUsage: \"options for image\",\n\t\tSubcommands: []cli.Command{\n\t\t\t{\n\t\t\t\tName: \"create\",\n\t\t\t\tUsage: \"Create a new image\",\n\t\t\t\tArgsUsage: \"<image-filename>\",\n\t\t\t\tDescription: \"Upload a new image to Photon Controller.\\n\" +\n\t\t\t\t\t\" If the image replication is EAGER, it will be distributed to all allowed datastores on all ESXi hosts\\n\" +\n\t\t\t\t\t\" If the image replication is ON_DEMAND, it will be distributed to all image datastores\\n\" +\n\t\t\t\t\t\" An image can have project scope or infrastructure scope. Only system administrators can create\\n\" +\n\t\t\t\t\t\" infrastructure images.\\n\\n\" +\n\t\t\t\t\t\" Example:\\n\" +\n\t\t\t\t\t\" create image:\\n\" +\n\t\t\t\t\t\" photon image create kubernetes-1.6.ova -n kube-demo -i EAGER\",\n\t\t\t\tFlags: []cli.Flag{\n\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\tName: \"name, n\",\n\t\t\t\t\t\tUsage: \"Image name\",\n\t\t\t\t\t},\n\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\tName: \"image_replication, i\",\n\t\t\t\t\t\tUsage: \"Image replication type (EAGER or ON_DEMAND)\",\n\t\t\t\t\t},\n\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\tName: \"scope, s\",\n\t\t\t\t\t\tUsage: \"Image scope (infrastructure/infra or project; default to project)\",\n\t\t\t\t\t},\n\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\tName: \"project, p\",\n\t\t\t\t\t\tUsage: \"Project ID, required for image with project scope.\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\terr := createImage(c, os.Stdout)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"delete\",\n\t\t\t\tUsage: \"Delete an image\",\n\t\t\t\tArgsUsage: \"<image-id>\",\n\t\t\t\tDescription: \"Delete an image. All copies will be deleted.\\n\" +\n\t\t\t\t\t\" Please note that if the image is in use by one or more VMs, it will not be deleted until\\n\" +\n\t\t\t\t\t\" all VMs that use it are deleted\",\n\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\terr := deleteImage(c)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"list\",\n\t\t\t\tUsage: \"List images\",\n\t\t\t\tArgsUsage: \" \",\n\t\t\t\tFlags: []cli.Flag{\n\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\tName: \"name, n\",\n\t\t\t\t\t\tUsage: \"Image name\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\terr := listImages(c, os.Stdout)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"show\",\n\t\t\t\tUsage: \"Show an image given it's ID\",\n\t\t\t\tArgsUsage: \"<image-id>\",\n\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\terr := showImage(c, os.Stdout)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"tasks\",\n\t\t\t\tUsage: \"Show image tasks\",\n\t\t\t\tArgsUsage: \"<image-id>\",\n\t\t\t\tFlags: []cli.Flag{\n\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\tName: \"state, s\",\n\t\t\t\t\t\tUsage: \"Filter by task state\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\terr := getImageTasks(c)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"iam\",\n\t\t\t\tUsage: \"options for identity and access management\",\n\t\t\t\tSubcommands: []cli.Command{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"show\",\n\t\t\t\t\t\tUsage: \"Show the IAM policy associated with an image\",\n\t\t\t\t\t\tArgsUsage: \"<image-id>\",\n\t\t\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\t\t\terr := getImageIam(c)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\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\t{\n\t\t\t\t\t\tName: \"add\",\n\t\t\t\t\t\tUsage: \"Grant a role to a user or group on an image\",\n\t\t\t\t\t\tArgsUsage: \"<image-id>\",\n\t\t\t\t\t\tDescription: \"Grant a role to a user or group on an image. \\n\\n\" +\n\t\t\t\t\t\t\t\" Example: \\n\" +\n\t\t\t\t\t\t\t\" photon image iam add <image-id> -p user1@photon.local -r contributor\\n\" +\n\t\t\t\t\t\t\t\" photon image iam add <image-id> -p photon.local\\\\group1 -r viewer\",\n\t\t\t\t\t\tFlags: []cli.Flag{\n\t\t\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\t\t\tName: \"principal, p\",\n\t\t\t\t\t\t\t\tUsage: \"User or group\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\t\t\tName: \"role, r\",\n\t\t\t\t\t\t\t\tUsage: \"'owner', 'contributor' and 'viewer'\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\t\t\terr := modifyImageIamPolicy(c, os.Stdout, \"ADD\")\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\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\t{\n\t\t\t\t\t\tName: \"remove\",\n\t\t\t\t\t\tUsage: \"Remove a role from a user or group on an image\",\n\t\t\t\t\t\tArgsUsage: \"<image-id>\",\n\t\t\t\t\t\tDescription: \"Remove a role from a user or group on an image. \\n\\n\" +\n\t\t\t\t\t\t\t\" Example: \\n\" +\n\t\t\t\t\t\t\t\" photon image iam remove <image-id> -p user1@photon.local -r contributor \\n\" +\n\t\t\t\t\t\t\t\" photon image iam remove <image-id> -p photon.local\\\\group1 -r viewer\",\n\t\t\t\t\t\tFlags: []cli.Flag{\n\t\t\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\t\t\tName: \"principal, p\",\n\t\t\t\t\t\t\t\tUsage: \"User or group\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcli.StringFlag{\n\t\t\t\t\t\t\t\tName: \"role, r\",\n\t\t\t\t\t\t\t\tUsage: \"'owner', 'contributor' and 'viewer'. Or use '*' to remove all existing roles.\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAction: func(c *cli.Context) {\n\t\t\t\t\t\t\terr := modifyImageIamPolicy(c, os.Stdout, \"REMOVE\")\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tlog.Fatal(\"Error: \", err)\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\treturn command\n}", "func (c *CLI) NewCmd(command string, args ...string) icmd.Cmd {\n\treturn icmd.Cmd{\n\t\tCommand: append([]string{command}, args...),\n\t\tEnv: append(c.BaseEnvironment(), c.env...),\n\t}\n}", "func NewCommand() *cobra.Command {\n\tkp := &KubebuilderProject{}\n\n\treturn framework.TemplateCommand{\n\t\tAPI: kp,\n\n\t\tMergeResources: true, // apply additional inputs as patches\n\n\t\t// these are run before the templates\n\t\tPreProcessFilters: []kio.Filter{\n\t\t\t// run controller-gen libraries to generate configuration from code\n\t\t\tControllerGenFilter{KubebuilderProject: kp},\n\t\t\t// inject generated certificates\n\t\t\tCertFilter{KubebuilderProject: kp},\n\t\t},\n\n\t\t// generate resources\n\t\tTemplatesFn: framework.TemplatesFromDir(pkger.Dir(\"/config-gen/templates/resources\")),\n\n\t\t// patch resources\n\t\tPatchTemplatesFn: framework.PatchTemplatesFromDir(\n\t\t\tCRDPatchTemplate(kp),\n\t\t\tCertManagerPatchTemplate(kp),\n\t\t\tControllerManagerPatchTemplate(kp),\n\t\t),\n\n\t\t// perform final modifications\n\t\tPostProcessFilters: []kio.Filter{\n\t\t\t// sort the resources\n\t\t\tComponentFilter{KubebuilderProject: kp},\n\t\t\tSortFilter{KubebuilderProject: kp},\n\t\t},\n\t}.GetCommand()\n}", "func newKubectlCmd() *cobra.Command {\n\tresult := &cobra.Command{\n\t\tUse: \"kubectl\",\n\t\tShort: \"kubectl controls the Kubernetes cluster manager\",\n\t\tHidden: true,\n\t}\n\n\tgenericFlags := genericclioptions.NewConfigFlags(true)\n\tgenericFlags.AddFlags(result.PersistentFlags())\n\tmatchVersionFlags := cmdutil.NewMatchVersionFlags(genericFlags)\n\tmatchVersionFlags.AddFlags(result.PersistentFlags())\n\n\tf := cmdutil.NewFactory(matchVersionFlags)\n\tioStreams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}\n\tcmdApply := apply.NewCmdApply(\"kubectl\", f, ioStreams)\n\n\t// TODO(nick): It might make more sense to implement replace and delete with client-go.\n\tcmdReplace := replace.NewCmdReplace(f, ioStreams)\n\tcmdDelete := delete.NewCmdDelete(f, ioStreams)\n\n\tresult.AddCommand(cmdApply)\n\tresult.AddCommand(cmdReplace)\n\tresult.AddCommand(cmdDelete)\n\treturn result\n}", "func (c DefaultCommander) NewCmd(command string, stderr io.Writer, stdin io.Reader) *exec.Cmd {\n\tcmd := exec.Command(\"sh\", \"-c\", command)\n\tif stderr != nil {\n\t\tcmd.Stderr = stderr\n\t}\n\tif stdin != nil {\n\t\tcmd.Stdin = stdin\n\t}\n\treturn cmd\n}", "func newManifestDeleteCmd(manifestParams *manifestParameters) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"delete\",\n\t\tShort: \"Delete manifest from a repository\",\n\t\tLong: newManifestDeleteCmdLongMessage,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tregistryName, err := manifestParams.GetRegistryName()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tloginURL := api.LoginURL(registryName)\n\t\t\tacrClient, err := api.GetAcrCLIClientWithAuth(loginURL, manifestParams.username, manifestParams.password, manifestParams.configs)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tctx := context.Background()\n\t\t\terr = deleteManifests(ctx, acrClient, loginURL, manifestParams.repoName, args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewManifestAnnotateCmd() *cobra.Command {\n\tannotateCmd := &cobra.Command{\n\t\tUse: \"annotate [FLAGS] MANIFEST_LIST MANIFEST\",\n\t\tShort: \"Annotate a local manifest list\",\n\t\tExample: manifestAnnotateExample,\n\t\tRunE: manifestAnnotateCommand,\n\t}\n\n\tannotateCmd.PersistentFlags().StringVar(&annotateOpts.imageArch, \"arch\", \"\", \"Set architecture\")\n\tannotateCmd.PersistentFlags().StringVar(&annotateOpts.imageOS, \"os\", \"\", \"Set operating system\")\n\tannotateCmd.PersistentFlags().StringSliceVar(&annotateOpts.imageOSFeature, \"os-features\", []string{}, \"Set operating system feature\")\n\tannotateCmd.PersistentFlags().StringVar(&annotateOpts.imageVariant, \"variant\", \"\", \"Set architecture variant\")\n\n\treturn annotateCmd\n}", "func NewCreateCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"create SUBCOMMAND\",\n\t\tShort: \"Create objects\",\n\t\tLong: `Create objects like users, etc.`,\n\t}\n}", "func NewCmd(command string, args ...string) *Cmd {\n\treturn &Cmd{\n\t\tcommand: command,\n\t\targs: args,\n\t}\n}", "func New(c string, args ...string) *Cmd {\n\tcmd := &Cmd{\n\t\tCmd: exec.Command(c, args...),\n\t}\n\tcmd.Run = func() error {\n\t\treturn cmd.Cmd.Run()\n\t}\n\treturn cmd\n}", "func NewRootCmd(use string, dockerCli command.Cli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tShort: \"Docker Application Packages\",\n\t\tLong: `Build and deploy Docker Application Packages.`,\n\t\tUse: use,\n\t}\n\taddCommands(cmd, dockerCli)\n\treturn cmd\n}", "func NewCommandImageList() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"list\",\n\t\tArgs: cobra.NoArgs,\n\t\tShort: \"Display Docker image on registry\",\n\t\tLong: `Display Docker image list on private registry`,\n\t\tRun: imgListMain,\n\t}\n\n\t//set local flag\n\tutils.AddImageFlag(cmd)\n\n\t//add subcommand\n\treturn cmd\n}", "func createCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a Windows instance on the same provider as the existing OpenShift Cluster.\",\n\t\tLong: \"creates a Windows instance under the same virtual network (AWS-VCP, Azure-Vnet, \" +\n\t\t\t\"and etc.) used by a given OpenShift cluster running on the selected provider. \" +\n\t\t\t\"The created instance would be ready to join the OpenShift Cluster as a worker node.\",\n\t\tPreRunE: func(cmd *cobra.Command, _ []string) error {\n\t\t\treturn validateCreateFlags(cmd)\n\t\t},\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\tcloud, err := cloudprovider.CloudProviderFactory(rootInfo.kubeconfigPath, rootInfo.credentialPath,\n\t\t\t\trootInfo.credentialAccountID, rootInfo.resourceTrackerDir)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating cloud provider clients, %v\", err)\n\t\t\t}\n\t\t\terr = cloud.CreateWindowsVM(createFlagInfo.imageID, createFlagInfo.instanceType, createFlagInfo.sshKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating Windows Instance, %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.imageID, \"image-id\", \"\",\n\t\t\"ami ID of a base image for the instance (i.e.\"+\n\t\t\t\": ami-06a4e829b8bbad61e for Microsoft Windows Server 2019 Base image on AWS). (required)\")\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.instanceType, \"instance-type\", \"\",\n\t\t\"name of a type of instance (i.e.: m4.large for AWS, etc). (required)\")\n\tcmd.PersistentFlags().StringVar(&createFlagInfo.sshKey, \"ssh-key\", \"\",\n\t\t\"name of existing ssh key on cloud provider for accessing the instance after it is created. (required)\")\n\treturn cmd\n}", "func New() subcommands.Command {\n\treturn &mergeCommand{\n\t\tInfo: cmdutil.NewInfo(\"merge\", \"merge kzip files\", \"--output path kzip-file*\"),\n\t\tencoding: flags.EncodingFlag{Encoding: kzip.DefaultEncoding()},\n\t}\n}", "func newCreateCmd(clientFn func() (*fic.ServiceClient, error), out io.Writer) *cobra.Command {\n\tvar (\n\t\tsrcRouterID string\n\t\tsrcGroupName string\n\t\tsrcPrimary string\n\t\tsrcSecondary string\n\t\tsrcRouteFilter string\n\t\tdestPrimary string\n\t\tdestSecondary string\n\t\tbandwidth string\n\t)\n\n\tr := regexp.MustCompile(`^[\\w&()-]{1,64}$`)\n\tvalidateSrc := func(splitSrc []string, isPrimary, hasSecondary bool) error {\n\t\t_, ipNet, err := net.ParseCIDR(splitSrc[0])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ipAddress must be CIDR whose subnet mask is 30, e.g. 10.0.0.1/30: received %s\", splitSrc[0])\n\t\t}\n\t\tsubNetMaskLength, _ := ipNet.Mask.Size()\n\t\tif subNetMaskLength != 30 {\n\t\t\treturn fmt.Errorf(\"subnet mask of ipAddress must be 30, e.g. 10.0.0.1/30: received %s\", splitSrc[0])\n\t\t}\n\n\t\tif !utils.StringInSlice(splitSrc[1], validPrepends) {\n\t\t\treturn fmt.Errorf(\"asPathPrepend.in must be one of %s: received %s\", validPrepends, splitSrc[1])\n\t\t}\n\n\t\tif !utils.StringInSlice(splitSrc[2], validPrepends) {\n\t\t\treturn fmt.Errorf(\"asPathPrepend.out must be one of %s: received %s\", validPrepends, splitSrc[2])\n\t\t}\n\n\t\tif isPrimary {\n\t\t\tmed, err := strconv.Atoi(splitSrc[3])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"med.out must be numeric value: received %s\", splitSrc[3])\n\t\t\t}\n\n\t\t\tif hasSecondary {\n\t\t\t\tif !utils.IntInSlice(med, validPrimaryPairedMEDs) {\n\t\t\t\t\treturn fmt.Errorf(\"med.out in paired connection must be one of %v: received %d\", validPrimaryPairedMEDs, med)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif !utils.IntInSlice(med, validPrimarySingleMEDs) {\n\t\t\t\t\treturn fmt.Errorf(\"med.out in single connection must be one of %v: received %d\", validPrimarySingleMEDs, med)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n\tvalidateDest := func(splitDest []string) error {\n\t\tvlan, err := strconv.Atoi(splitDest[1])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"vlan must be numeric value: received %s\", splitDest[1])\n\t\t}\n\t\tif vlan < 101 || vlan > 3300 {\n\t\t\treturn fmt.Errorf(\"vlan must be range of 101 to 3300: received %s\", splitDest[1])\n\t\t}\n\n\t\t_, ipNet, err := net.ParseCIDR(splitDest[2])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ipAddress must be CIDR whose subnet mask is 30, e.g. 10.0.0.2/30: received %s\", splitDest[2])\n\t\t}\n\t\tsubNetMaskLength, _ := ipNet.Mask.Size()\n\t\tif subNetMaskLength != 30 {\n\t\t\treturn fmt.Errorf(\"subnet mask of ipAddress must be 30, e.g. 10.0.0.2/30: received %s\", splitDest[2])\n\t\t}\n\n\t\tasn, err := strconv.Atoi(splitDest[3])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"asn must be numeric value: received %s\", splitDest[3])\n\t\t}\n\t\tif asn < 1 || asn > 65535 {\n\t\t\treturn fmt.Errorf(\"asn must be range of 1 to 65535: received %s\", splitDest[3])\n\t\t}\n\t\treturn nil\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create <name>\",\n\t\tShort: \"Create router to port connection\",\n\t\tExample: \"# In case of non paired-connection \\n\" +\n\t\t\t\"fic router-to-port-connections create YourConnectionName \" +\n\t\t\t\"--source-router F020123456789 \" +\n\t\t\t\"--source-group group_1 \" +\n\t\t\t\"--source-primary 10.0.0.1/30,4,4,10 \" +\n\t\t\t\"--source-route-filter fullRoute,fullRouteWithDefaultRoute \" +\n\t\t\t\"--destination-primary F010123456789,101,10.0.0.2/30,65000 \" +\n\t\t\t\"--bandwidth 10M \\n\\n\" +\n\t\t\t\"# In case of paired-connection \\n\" +\n\t\t\t\"fic router-to-port-connections create YourConnectionName \" +\n\t\t\t\"--source-router F020123456789 \" +\n\t\t\t\"--source-group group_1 \" +\n\t\t\t\"--source-primary 10.0.0.1/30,4,4,10 \" +\n\t\t\t\"--source-secondary 10.0.0.5/30,2,1 \" +\n\t\t\t\"--source-route-filter fullRoute,fullRouteWithDefaultRoute \" +\n\t\t\t\"--destination-primary F010123456789,101,10.0.0.2/30,65000 \" +\n\t\t\t\"--destination-secondary F019876543210,102,10.0.0.6/30,65000 \" +\n\t\t\t\"--bandwidth 10M\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tif !r.MatchString(args[0]) {\n\t\t\t\treturn fmt.Errorf(\"name of router to port connection must be composed of alpha-numeric \"+\n\t\t\t\t\t\"characters and & ( ) - _, and must have maximum length of 64 as well: received %s\", args[0])\n\t\t\t}\n\n\t\t\tif !utils.StringInSlice(srcGroupName, validGroupNames) {\n\t\t\t\treturn fmt.Errorf(\"source-group must be one of %s: received %s\", validGroupNames, srcGroupName)\n\t\t\t}\n\n\t\t\tsplitSrcPrimary := strings.Split(strings.TrimSpace(srcPrimary), \",\")\n\t\t\tsplitSrcSecondary := strings.Split(strings.TrimSpace(srcSecondary), \",\")\n\t\t\tsplitSrcRouteFilter := strings.Split(strings.TrimSpace(srcRouteFilter), \",\")\n\t\t\tsplitDestPrimary := strings.Split(strings.TrimSpace(destPrimary), \",\")\n\t\t\tsplitDestSecondary := strings.Split(strings.TrimSpace(destSecondary), \",\")\n\n\t\t\tif len(splitSrcPrimary) != 4 {\n\t\t\t\treturn fmt.Errorf(\"source-primary must have format like \"+\n\t\t\t\t\t\"<ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>,<med.out>: received %s\", srcPrimary)\n\t\t\t}\n\t\t\tif err := validateSrc(splitSrcPrimary, true, srcSecondary != \"\"); err != nil {\n\t\t\t\treturn fmt.Errorf(\"in source-primary, %w\", err)\n\t\t\t}\n\n\t\t\tif len(splitDestPrimary) != 4 {\n\t\t\t\treturn fmt.Errorf(\"destination-primary must have format like \"+\n\t\t\t\t\t\"<portId>,<vlan>,<ipAddress>,<asn>: received %s\", destPrimary)\n\t\t\t}\n\t\t\tif err := validateDest(splitDestPrimary); err != nil {\n\t\t\t\treturn fmt.Errorf(\"in destination-primary, %w\", err)\n\t\t\t}\n\n\t\t\tif srcSecondary != \"\" {\n\t\t\t\tif len(splitSrcSecondary) != 3 {\n\t\t\t\t\treturn fmt.Errorf(\"source-secondary must have format like \"+\n\t\t\t\t\t\t\"<ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>: received %s\", srcSecondary)\n\t\t\t\t}\n\t\t\t\tif err := validateSrc(splitSrcSecondary, false, true); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"in source-secondary, %w\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tredundant := false\n\t\t\tif destSecondary != \"\" {\n\t\t\t\tif len(splitDestSecondary) != 4 {\n\t\t\t\t\treturn fmt.Errorf(\"destination-secondary must have format like \"+\n\t\t\t\t\t\t\"<portId>,<vlan>,<ipAddress>,<asn>: received %s\", destSecondary)\n\t\t\t\t}\n\t\t\t\tif err := validateDest(splitDestSecondary); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"in destination-secondary, %w\", err)\n\t\t\t\t}\n\t\t\t\tredundant = true\n\t\t\t}\n\n\t\t\tif len(splitSrcRouteFilter) != 2 {\n\t\t\t\treturn fmt.Errorf(\"source-route-filter must have format like \"+\n\t\t\t\t\t\"<routeFilter.in>,<routeFilter.out>: received %s\", srcRouteFilter)\n\t\t\t}\n\t\t\tif !utils.StringInSlice(splitSrcRouteFilter[0], validRouteFilterIns) {\n\t\t\t\treturn fmt.Errorf(\"routeFilter.in must be one of %s: received %s\", validRouteFilterIns, splitSrcRouteFilter[0])\n\t\t\t}\n\t\t\tif !utils.StringInSlice(splitSrcRouteFilter[1], validRouteFilterOuts) {\n\t\t\t\treturn fmt.Errorf(\"routeFilter.out must be one of %s: received %s\", validRouteFilterOuts, splitSrcRouteFilter[1])\n\t\t\t}\n\n\t\t\tif !utils.StringInSlice(bandwidth, validBandwidths) {\n\t\t\t\treturn fmt.Errorf(\"bandwidth must be one of %s: received %s\", validBandwidths, bandwidth)\n\t\t\t}\n\n\t\t\tclient, err := clientFn()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"creating FIC client: %w\", err)\n\t\t\t}\n\n\t\t\tprependIn, prependOut := interface{}(convPrepend(splitSrcPrimary[1])), interface{}(convPrepend(splitSrcPrimary[2]))\n\t\t\tmed, _ := strconv.Atoi(splitSrcPrimary[3])\n\t\t\tvlan, _ := strconv.Atoi(splitDestPrimary[1])\n\n\t\t\tt := utils.NewTabby(out)\n\t\t\tt.AddHeader(\"id\", \"name\", \"redundant\", \"tenantId\", \"area\", \"operationStatus\", \"bandwidth\", \"operationId\")\n\n\t\t\tif !redundant {\n\t\t\t\topts := singleConn.CreateOpts{\n\t\t\t\t\tName: args[0],\n\t\t\t\t\tSource: singleConn.Source{\n\t\t\t\t\t\tRouterID: srcRouterID,\n\t\t\t\t\t\tGroupName: srcGroupName,\n\t\t\t\t\t\tRouteFilter: singleConn.RouteFilter{\n\t\t\t\t\t\t\tIn: splitSrcRouteFilter[0],\n\t\t\t\t\t\t\tOut: splitSrcRouteFilter[1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tPrimary: singleConn.SourceHAInfo{\n\t\t\t\t\t\t\tIPAddress: splitSrcPrimary[0],\n\t\t\t\t\t\t\tASPathPrepend: singleConn.ASPathPrepend{\n\t\t\t\t\t\t\t\tIn: &prependIn,\n\t\t\t\t\t\t\t\tOut: &prependOut,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tMED: &singleConn.MED{\n\t\t\t\t\t\t\t\tOut: med,\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\tDestination: singleConn.Destination{\n\t\t\t\t\t\tPrimary: singleConn.DestinationHAInfo{\n\t\t\t\t\t\t\tPortID: splitDestPrimary[0],\n\t\t\t\t\t\t\tVLAN: vlan,\n\t\t\t\t\t\t\tIPAddress: splitDestPrimary[2],\n\t\t\t\t\t\t\tASN: splitDestPrimary[3],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBandwidth: bandwidth,\n\t\t\t\t}\n\n\t\t\t\tc, err := singleConn.Create(client, opts).Extract()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"calling Create router to port connection API: %w\", err)\n\t\t\t\t}\n\n\t\t\t\tt.AddLine(c.ID, c.Name, c.Redundant, c.TenantID, c.Area, c.OperationID, c.OperationStatus, c.Bandwidth)\n\t\t\t\tt.Print()\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tsecondPrependIn, secondPrependOut := interface{}(convPrepend(splitSrcSecondary[1])), interface{}(convPrepend(splitSrcSecondary[2]))\n\t\t\tsecondVlan, _ := strconv.Atoi(splitDestSecondary[1])\n\n\t\t\topts := pairedConn.CreateOpts{\n\t\t\t\tName: args[0],\n\t\t\t\tSource: pairedConn.Source{\n\t\t\t\t\tRouterID: srcRouterID,\n\t\t\t\t\tGroupName: srcGroupName,\n\t\t\t\t\tRouteFilter: pairedConn.RouteFilter{\n\t\t\t\t\t\tIn: splitSrcRouteFilter[0],\n\t\t\t\t\t\tOut: splitSrcRouteFilter[1],\n\t\t\t\t\t},\n\t\t\t\t\tPrimary: pairedConn.SourceHAInfo{\n\t\t\t\t\t\tIPAddress: splitSrcPrimary[0],\n\t\t\t\t\t\tASPathPrepend: pairedConn.ASPathPrepend{\n\t\t\t\t\t\t\tIn: &prependIn,\n\t\t\t\t\t\t\tOut: &prependOut,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMED: &pairedConn.MED{\n\t\t\t\t\t\t\tOut: med,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSecondary: pairedConn.SourceHAInfo{\n\t\t\t\t\t\tIPAddress: splitSrcSecondary[0],\n\t\t\t\t\t\tASPathPrepend: pairedConn.ASPathPrepend{\n\t\t\t\t\t\t\tIn: &secondPrependIn,\n\t\t\t\t\t\t\tOut: &secondPrependOut,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tDestination: pairedConn.Destination{\n\t\t\t\t\tPrimary: pairedConn.DestinationHAInfo{\n\t\t\t\t\t\tPortID: splitDestPrimary[0],\n\t\t\t\t\t\tVLAN: vlan,\n\t\t\t\t\t\tIPAddress: splitDestPrimary[2],\n\t\t\t\t\t\tASN: splitDestPrimary[3],\n\t\t\t\t\t},\n\t\t\t\t\tSecondary: pairedConn.DestinationHAInfo{\n\t\t\t\t\t\tPortID: splitDestSecondary[0],\n\t\t\t\t\t\tVLAN: secondVlan,\n\t\t\t\t\t\tIPAddress: splitDestSecondary[2],\n\t\t\t\t\t\tASN: splitDestSecondary[3],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBandwidth: bandwidth,\n\t\t\t}\n\n\t\t\tc, err := pairedConn.Create(client, opts).Extract()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"calling Create router to port connection API: %w\", err)\n\t\t\t}\n\n\t\t\tt.AddLine(c.ID, c.Name, c.Redundant, c.TenantID, c.Area, c.OperationID, c.OperationStatus, c.Bandwidth)\n\t\t\tt.Print()\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Flags().StringVar(&srcRouterID, \"source-router\", \"\", \"(Required) Router ID belonging to source\")\n\tcmd.Flags().StringVar(&srcGroupName, \"source-group\", \"\", \"(Required) Group Name belonging to source\")\n\tcmd.Flags().StringVar(\n\t\t&srcPrimary,\n\t\t\"source-primary\",\n\t\t\"\",\n\t\t\"(Required) Source Primary Info specified in the format <ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>,<med.out>\")\n\tcmd.Flags().StringVar(\n\t\t&srcSecondary,\n\t\t\"source-secondary\",\n\t\t\"\",\n\t\t\"Source Secondary Info specified in the format <ipAddress>,<asPathPrepend.in>,<asPathPrepend.out>\")\n\tcmd.Flags().StringVar(\n\t\t&srcRouteFilter,\n\t\t\"source-route-filter\",\n\t\t\"\",\n\t\t\"(Required) Set of BGP Filter Ingress and Egress specified in the format <routeFilter.in>,<routeFilter.out>\")\n\tcmd.Flags().StringVar(\n\t\t&destPrimary,\n\t\t\"destination-primary\",\n\t\t\"\",\n\t\t\"(Required) Destination Primary Info specified in the format <portId>,<vlan>,<ipAddress>,<asn>\")\n\tcmd.Flags().StringVar(\n\t\t&destSecondary,\n\t\t\"destination-secondary\",\n\t\t\"\",\n\t\t\"Destination Secondary Info specified in the format <portId>,<vlan>,<ipAddress>,<asn>\")\n\tcmd.Flags().StringVar(&bandwidth, \"bandwidth\", \"\", \"(Required) Bandwidth of router to port connection\")\n\n\tcmd.MarkFlagRequired(\"source-router\")\n\tcmd.MarkFlagRequired(\"source-group\")\n\tcmd.MarkFlagRequired(\"source-primary\")\n\tcmd.MarkFlagRequired(\"source-rout-filter\")\n\tcmd.MarkFlagRequired(\"destination-primary\")\n\tcmd.MarkFlagRequired(\"bandwidth\")\n\n\treturn cmd\n}", "func NewCmd(db *bolt.DB) *cobra.Command {\n\topts := editOptions{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"edit <name>\",\n\t\tShort: \"Edit an entry\",\n\t\tLong: `Edit an entry. \n\t\t\nIf the name is edited, Kure will remove the entry with the old name and create one with the new name.`,\n\t\tExample: example,\n\t\tArgs: cmdutil.MustExist(db, cmdutil.Entry),\n\t\tPreRunE: auth.Login(db),\n\t\tRunE: runEdit(db, &opts),\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\t// Reset variables (session)\n\t\t\topts = editOptions{}\n\t\t},\n\t}\n\n\tcmd.Flags().BoolVarP(&opts.interactive, \"it\", \"i\", false, \"use the text editor\")\n\n\treturn cmd\n}", "func NewCreateCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &CreateCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tlog: log.GetInstance(),\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"create\",\n\t\tShort: \"Create a new virtual cluster\",\n\t\tLong: `\n#######################################################\n################### vcluster create ###################\n#######################################################\nCreates a new virtual cluster\n\nExample:\nvcluster create test --namespace test\n#######################################################\n\t`,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\t// Check for newer version\n\t\t\tupgrade.PrintNewerVersionWarning()\n\n\t\t\treturn cmd.Run(cobraCmd, args)\n\t\t},\n\t}\n\n\tcobraCmd.Flags().StringVar(&cmd.ChartVersion, \"chart-version\", upgrade.GetVersion(), \"The virtual cluster chart version to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ChartName, \"chart-name\", \"vcluster\", \"The virtual cluster chart name to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ChartRepo, \"chart-repo\", \"https://charts.loft.sh\", \"The virtual cluster chart repo to use\")\n\tcobraCmd.Flags().StringVar(&cmd.ReleaseValues, \"release-values\", \"\", \"Path where to load the virtual cluster helm release values from\")\n\tcobraCmd.Flags().StringVar(&cmd.K3SImage, \"k3s-image\", \"\", \"If specified, use this k3s image version\")\n\tcobraCmd.Flags().StringSliceVarP(&cmd.ExtraValues, \"extra-values\", \"f\", []string{}, \"Path where to load extra helm values from\")\n\tcobraCmd.Flags().BoolVar(&cmd.CreateNamespace, \"create-namespace\", true, \"If true the namespace will be created if it does not exist\")\n\tcobraCmd.Flags().BoolVar(&cmd.DisableIngressSync, \"disable-ingress-sync\", false, \"If true the virtual cluster will not sync any ingresses\")\n\tcobraCmd.Flags().BoolVar(&cmd.CreateClusterRole, \"create-cluster-role\", false, \"If true a cluster role will be created to access nodes, storageclasses and priorityclasses\")\n\tcobraCmd.Flags().BoolVar(&cmd.Expose, \"expose\", false, \"If true will create a load balancer service to expose the vcluster endpoint\")\n\tcobraCmd.Flags().BoolVar(&cmd.Connect, \"connect\", false, \"If true will run vcluster connect directly after the vcluster was created\")\n\treturn cobraCmd\n}", "func NewBackupCmd(out io.Writer) *cobra.Command {\n\tb := &backupCmd{out: out}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"backup\",\n\t\tShort: \"backup cassandra cluster to S3\",\n\t\tLong: ``,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif _, err := cain.Backup(b.namespace, b.selector, b.container, b.keyspace, b.dst, b.parallel); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t},\n\t}\n\tf := cmd.Flags()\n\n\tf.StringVarP(&b.namespace, \"namespace\", \"n\", \"\", \"namespace to find cassandra cluster\")\n\tf.StringVarP(&b.selector, \"selector\", \"l\", \"\", \"selector to filter on\")\n\tf.StringVarP(&b.container, \"container\", \"c\", \"cassandra\", \"container name to act on\")\n\tf.StringVarP(&b.keyspace, \"keyspace\", \"k\", \"\", \"keyspace to act on\")\n\tf.StringVar(&b.dst, \"dst\", \"\", \"destination to backup to. Example: s3://bucket/cassandra\")\n\tf.IntVarP(&b.parallel, \"parallel\", \"p\", 1, \"number of files to copy in parallel. set this flag to 0 for full parallelism\")\n\n\treturn cmd\n}", "func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, cmFlags *genericclioptionscm.CMFlags, streams genericclioptions.IOStreams) *cobra.Command {\n\tcmd := clusteradminit.NewCmd(clusteradmFlags, streams)\n\tcmd.Short = \"init feature or hub\"\n\n\treturn cmd\n}", "func NewDeleteCmd(globalFlags *flags.GlobalFlags) *cobra.Command {\n\tdescription := `\n#######################################################\n##################### loft delete #####################\n#######################################################\n\t`\n\tif upgrade.IsPlugin == \"true\" {\n\t\tdescription = `\n#######################################################\n##################### loft delete #####################\n#######################################################\n\t`\n\t}\n\tc := &cobra.Command{\n\t\tUse: \"delete\",\n\t\tShort: \"Deletes loft resources\",\n\t\tLong: description,\n\t\tArgs: cobra.NoArgs,\n\t}\n\n\tc.AddCommand(NewSpaceCmd(globalFlags))\n\tc.AddCommand(NewVirtualClusterCmd(globalFlags))\n\treturn c\n}", "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create-repo\",\n\t\tShort: \"ecr-utils create-repo commands\",\n\n\t\tRun: createFunc,\n\t}\n\tcmd.PersistentFlags().BoolVarP(&enablePrompt, \"enable-prompt\", \"e\", true, \"'true' to enable prompt mode\")\n\tcmd.PersistentFlags().StringVar(&logLevel, \"log-level\", \"info\", \"Log level (debug, info, warn, error, dpanic, panic, fatal)\")\n\tcmd.PersistentFlags().StringVar(&partition, \"partition\", \"aws\", \"AWS partition\")\n\tcmd.PersistentFlags().StringVar(&repoAccountID, \"repo-account-id\", \"\", \"AWS repository account ID\")\n\tcmd.PersistentFlags().StringVar(&repoName, \"repo-name\", \"\", \"AWS ECR repository name\")\n\tcmd.PersistentFlags().StringSliceVar(&regions, \"regions\", nil, \"AWS regions to create repository; if empty create for all available regions\")\n\tcmd.PersistentFlags().BoolVar(&imgScanOnPush, \"image-scan-on-push\", false, \"true to scan images on push\")\n\tcmd.PersistentFlags().StringVar(&imgTagMutability, \"image-tag-mutability\", ecr.ImageTagMutabilityMutable, \"MUTABLE to allow tag overwrites\")\n\tcmd.PersistentFlags().StringVar(&policyFilePath, \"policy-file-path\", \"\", \"AWS ECR policy JSON file path\")\n\tcmd.PersistentFlags().BoolVar(&setPolicyForce, \"set-policy-force\", false, \"true to force-write ECR repository policy\")\n\treturn cmd\n}", "func NewManifestCreateCmd() *cobra.Command {\n\tcreateCmd := &cobra.Command{\n\t\tUse: \"create MANIFEST_LIST MANIFEST [MANIFEST...] \",\n\t\tShort: \"Create a local manifest list\",\n\t\tExample: manifestCreateExample,\n\t\tRunE: manifestCreateCommand,\n\t\tDisableFlagsInUseLine: true,\n\t}\n\n\treturn createCmd\n}", "func CreateCmd() *cobra.Command {\n\tvar cmd = cobra.Command{\n\t\tUse: \"ch.viac\",\n\t\tShort: \"Import VIAC values from JSON files\",\n\t\tLong: `Open app.viac.ch, choose a portfolio, and select \"From start\" in the overview dash. In the Chrome dev tools, save the response from the \"performance\" XHR call, and pass the resulting file to this importer.`,\n\n\t\tArgs: cobra.ExactValidArgs(1),\n\n\t\tRunE: run,\n\t}\n\tcmd.Flags().StringP(\"from\", \"f\", \"0001-01-01\", \"YYYY-MM-DD - ignore entries before this date\")\n\tcmd.Flags().StringP(\"account\", \"a\", \"\", \"account name\")\n\treturn &cmd\n}", "func New(cfg *Config) (*Cmd, error) {\n\t_, err := signatureAndHashAlgorithmByKeyType(cfg.Key.Type)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"key type %v is not supported\", cfg.Key.Type)\n\t}\n\n\tkh, err := cfg.KMS.Get(cfg.Key.ID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"kms get kh: %w\", err)\n\t}\n\n\tpubBytes, err := cfg.KMS.ExportPubKeyBytes(cfg.Key.ID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"export pub key bytes: %w\", err)\n\t}\n\n\tsetOfIssuers := map[string]struct{}{}\n\tfor _, issuer := range cfg.Issuers {\n\t\tsetOfIssuers[issuer] = struct{}{}\n\t}\n\n\tcfg.Key.kh = kh\n\n\treturn &Cmd{\n\t\tclient: cfg.Trillian,\n\t\tvdr: cfg.VDR,\n\t\tVCLogID: sha256.Sum256(pubBytes),\n\t\tlogID: cfg.LogID,\n\t\tkms: cfg.KMS,\n\t\tkey: cfg.Key,\n\t\tcrypto: cfg.Crypto,\n\t\tissuers: setOfIssuers,\n\t}, nil\n}", "func New(buildRevision, buildTime string) *cobra.Command {\n\trootCmd := &cobra.Command{\n\t\tUse: \"iris-cli\",\n\t\tShort: \"Command Line Interface for Iris\",\n\t\tLong: `Iris CLI is a tool for Iris Web Framework.\nIt can be used to install starter kits and project structures \nComplete documentation is available at https://github.com/kataras/iris-cli`,\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t\tTraverseChildren: true,\n\t\tSuggestionsMinimumDistance: 1,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t},\n\t}\n\n\thelpTemplate := HelpTemplate{\n\t\tBuildRevision: buildRevision,\n\t\tBuildTime: buildTime,\n\t\tShowGoRuntimeVersion: true,\n\t}\n\trootCmd.SetHelpTemplate(helpTemplate.String())\n\n\t// Commands.\n\trootCmd.AddCommand(newCommand())\n\trootCmd.AddCommand(runCommand())\n\trootCmd.AddCommand(addCommand())\n\n\treturn rootCmd\n}", "func NewCommand(ctx context.Context, cmd string, args ...string) *Command {\n\tif ctx == nil {\n\t\tpanic(\"plugin.newCommand called with a nil context\")\n\t}\n\tcmdObj := &Command{\n\t\tc: exec.Command(cmd, args...),\n\t\tctx: ctx,\n\t\tpgid: -1,\n\t\twaitDoneCh: make(chan struct{}),\n\t}\n\tcmdObj.c.SysProcAttr = &syscall.SysProcAttr{\n\t\tSetpgid: true,\n\t}\n\treturn cmdObj\n}", "func NewRootCmd(use string, dockerCli command.Cli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tShort: \"Docker Application\",\n\t\tLong: `A tool to build and manage Docker Applications.`,\n\t\tUse: use,\n\t\tAnnotations: map[string]string{\"experimentalCLI\": \"true\"},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif showVersion {\n\t\t\t\tfmt.Fprintln(os.Stdout, internal.FullVersion()) //nolint:errcheck\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tif len(args) != 0 {\n\t\t\t\treturn fmt.Errorf(\"%q is not a docker app command\\nSee 'docker app --help'\", args[0])\n\t\t\t}\n\t\t\tcmd.HelpFunc()(cmd, args)\n\t\t\treturn nil\n\t\t},\n\t}\n\taddCommands(cmd, dockerCli)\n\n\tcmd.Flags().BoolVar(&showVersion, \"version\", false, \"Print version information\")\n\treturn cmd\n}", "func NewDeploymentCmd(cli *client.Cli) *cobra.Command {\n\n\tvar DeploymentCmd = &cobra.Command{\n\t\tUse: \"deployment COMMAND\",\n\t\tShort: \"Manage deployments\",\n\t}\n\n\tDeploymentCmd.AddCommand(newGetCommand(cli))\n\tDeploymentCmd.AddCommand(newCreateCommand(cli))\n\tDeploymentCmd.AddCommand(newPromoteCommand(cli))\n\n\treturn DeploymentCmd\n}", "func NewCmd(o *Options) *cobra.Command {\n\tc := newGkeCmd(o)\n\n\tcmd := &cobra.Command{\n\t\tUse: \"gke\",\n\t\tShort: \"Provisions a Google Kubernetes Engine (GKE) cluster on Google Cloud Platform (GCP).\",\n\t\tLong: `Use this command to provision a GKE cluster on GCP for Kyma installation. Use the flags to specify cluster details.\nNOTE: To access the provisioned cluster, make sure you get authenticated by Google Cloud SDK. To do so,run ` + \"`gcloud auth application-default login`\" + ` and log in with your Google Cloud credentials.`,\n\n\t\tRunE: func(_ *cobra.Command, _ []string) error { return c.Run() },\n\t}\n\n\tcmd.Flags().StringVarP(&o.Name, \"name\", \"n\", \"\", \"Name of the GKE cluster to provision. (required)\")\n\tcmd.Flags().StringVarP(&o.Project, \"project\", \"p\", \"\", \"Name of the GCP Project where you provision the GKE cluster. (required)\")\n\tcmd.Flags().StringVarP(&o.CredentialsFile, \"credentials\", \"c\", \"\", \"Path to the GCP service account key file. (required)\")\n\tcmd.Flags().StringVarP(&o.KubernetesVersion, \"kube-version\", \"k\", \"1.19\", \"Kubernetes version of the cluster.\")\n\tcmd.Flags().StringVarP(&o.Location, \"location\", \"l\", \"europe-west3-a\", \"Region (e.g. europe-west3) or zone (e.g. europe-west3-a) of the cluster.\")\n\tcmd.Flags().StringVarP(&o.MachineType, \"type\", \"t\", \"n1-standard-4\", \"Machine type used for the cluster.\")\n\tcmd.Flags().IntVar(&o.DiskSizeGB, \"disk-size\", 50, \"Disk size (in GB) of the cluster.\")\n\tcmd.Flags().IntVar(&o.NodeCount, \"nodes\", 3, \"Number of cluster nodes.\")\n\t// Temporary disabled flag. To be enabled when hydroform supports TF modules\n\t//cmd.Flags().StringSliceVarP(&o.Extra, \"extra\", \"e\", nil, \"Provide one or more arguments of the form NAME=VALUE to add extra configurations.\")\n\tcmd.Flags().UintVar(&o.Attempts, \"attempts\", 3, \"Maximum number of attempts to provision the cluster.\")\n\n\treturn cmd\n}", "func NewCmdIP(out io.Writer) *cobra.Command {\n\topts := &ipOpts{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"ip\",\n\t\tShort: \"retrieve the IP address of the cluster\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) != 0 {\n\t\t\t\treturn fmt.Errorf(\"Unexpected args: %v\", args)\n\t\t\t}\n\t\t\tplanner := &install.FilePlanner{File: opts.planFilename}\n\n\t\t\tip, err := doIP(out, planner, opts)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error getting cluster IP: %v\", err)\n\t\t\t}\n\n\t\t\tfmt.Fprintln(out, ip)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\t// PersistentFlags\n\tcmd.PersistentFlags().StringVarP(&opts.planFilename, \"plan-file\", \"f\", \"kismatic-cluster.yaml\", \"path to the installation plan file\")\n\n\treturn cmd\n}", "func New(appName string) (*ffcli.Command, *Config) {\n\tcfg := Config{\n\t\tAppName: appName,\n\t}\n\n\tfs := flag.NewFlagSet(appName, flag.ExitOnError)\n\tcfg.RegisterFlags(fs)\n\n\treturn &ffcli.Command{\n\t\tShortUsage: appName + \" [flags] <subcommand> [flags] [<arg>...]\",\n\t\tFlagSet: fs,\n\t\tExec: cfg.Exec,\n\t}, &cfg\n}", "func newImportCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"import [moniker] [keyfile]\",\n\t\tShort: \"import a private key to import a new keyfile\",\n\t\tLong: `\nImport keys to [moniker] from private key file [keyfile].\n`,\n\t\tArgs: cobra.ExactArgs(2),\n\t\tRunE: importKey,\n\t}\n\n\treturn cmd\n}", "func NewCommand(runtime *cli.Runtime, config *print.Config) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tArgs: cobra.ExactArgs(1),\n\t\tUse: \"xml [PATH]\",\n\t\tShort: \"Generate XML of inputs and outputs\",\n\t\tAnnotations: cli.Annotations(\"xml\"),\n\t\tPreRunE: runtime.PreRunEFunc,\n\t\tRunE: runtime.RunEFunc,\n\t}\n\treturn cmd\n}", "func NewCmdVersion() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Show dmaas-operator version\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tshowVersion()\n\t\t},\n\t}\n\n\treturn cmd\n}", "func NewCmdVolumeExporter() *cobra.Command {\n\t// create an instance of VolumeExporterOptions to initialize with default\n\t// values for the flags.\n\toptions := VolumeExporterOptions{}\n\toptions.ControllerAddress = \"http://localhost:9501\"\n\toptions.ListenAddress = \":9500\"\n\toptions.MetricsPath = \"/metrics\"\n\tcmd := &cobra.Command{\n\t\tUse: \"monitor\",\n\t\tShort: \"Collect metrics from OpenEBS volumes\",\n\t\tLong: ` monitor command is used to start monitoring openebs volumes. It\n start collecting metrics from the jiva controller at the endpoint\n \"/v1/stats\" and push it to Prometheus Server`,\n\t\tExample: ` maya-agent monitor -a=http://localhost:8001 -c=:9500 -m=/metrics`,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tutil.CheckErr(Run(cmd, &options), util.Fatal)\n\t\t},\n\t}\n\n\tAddControllerAddressFlag(cmd, &options.ControllerAddress)\n\tAddListenAddressFlag(cmd, &options.ListenAddress)\n\tAddMetricsPathFlag(cmd, &options.MetricsPath)\n\n\treturn cmd\n}", "func newDeleteCommand(cmd *cliCommand) cli.Command {\n\treturn cli.Command{\n\t\tName: \"delete\",\n\t\tAliases: []string{\"rm\"},\n\t\tUsage: \"Delete a file from the bucket\",\n\t\tFlags: []cli.Flag{\n\t\t\tcli.StringFlag{\n\t\t\t\tName: \"b, bucket\",\n\t\t\t\tUsage: \"the name of the s3 bucket containing the encrypted files\",\n\t\t\t\tEnvVar: \"AWS_S3_BUCKET\",\n\t\t\t},\n\t\t},\n\t\tAction: func(cx *cli.Context) error {\n\t\t\treturn handleCommand(cx, []string{\"l:bucket:s\"}, cmd, deleteFile)\n\t\t},\n\t}\n}", "func newCommand(devfileObj parser.DevfileObj, devfileCmd v1alpha2.Command) (command, error) {\n\tvar cmd command\n\n\tcommandType, err := common.GetCommandType(devfileCmd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch commandType {\n\n\tcase v1alpha2.ApplyCommandType:\n\t\tcmd = newApplyCommand(devfileObj, devfileCmd)\n\n\tcase v1alpha2.CompositeCommandType:\n\t\tif util.SafeGetBool(devfileCmd.Composite.Parallel) {\n\t\t\tcmd = newParallelCompositeCommand(devfileObj, devfileCmd)\n\t\t}\n\t\tcmd = newCompositeCommand(devfileObj, devfileCmd)\n\n\tcase v1alpha2.ExecCommandType:\n\t\tcmd = newExecCommand(devfileObj, devfileCmd)\n\t}\n\n\tif err = cmd.CheckValidity(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn cmd, nil\n}", "func New() *cobra.Command {\n\tsetCmd.Flags().StringVarP(&mode, \"mode\", \"m\", \"\", \"mode options are heat, cool, auto, fan\")\n\tsetCmd.Flags().StringVarP(&fan, \"fan\", \"f\", \"\", \"fan speed options are 1, 2 or 3\")\n\tsetCmd.Flags().StringVarP(&power, \"power\", \"p\", \"\", \"power options are on or off\")\n\tsetCmd.Flags().StringVarP(&temp, \"temp\", \"t\", \"\", \"temp options are up to you\")\n\tsetCmd.Flags().StringVarP(&br, \"bedroom\", \"b\", \"\", \"bedroom enabled (on/off)\")\n\tsetCmd.Flags().StringVarP(&st, \"study\", \"s\", \"\", \"study enabled (on/off)\")\n\n\treturn setCmd\n}", "func newBundleBuildCmd() *cobra.Command {\n\tbundleBuildCmd := &cobra.Command{\n\t\tUse: \"build\",\n\t\tShort: \"Build operator bundle image\",\n\t\tLong: `The \"opm alpha bundle build\" command will generate operator\nbundle metadata if needed and build bundle image with operator manifest\nand metadata for a specific version.\n\nFor example: The command will generate annotations.yaml metadata plus\nDockerfile for bundle image and then build a container image from\nprovided operator bundle manifests generated metadata\ne.g. \"quay.io/example/operator:v0.0.1\".\n\nAfter the build process is completed, a container image would be built\nlocally in docker and available to push to a container registry.\n\n$ opm alpha bundle build --directory /test/0.1.0/ --tag quay.io/example/operator:v0.1.0 \\\n\t--package test-operator --channels stable,beta --default stable --overwrite\n\nNote:\n* Bundle image is not runnable.\n* All manifests yaml must be in the same directory. `,\n\t\tRunE: buildFunc,\n\t\tArgs: cobra.NoArgs,\n\t}\n\n\tbundleBuildCmd.Flags().StringVarP(&buildDir, \"directory\", \"d\", \"\",\n\t\t\"The directory where bundle manifests and metadata for a specific version are located\")\n\tif err := bundleBuildCmd.MarkFlagRequired(\"directory\"); err != nil {\n\t\tlog.Fatalf(\"Failed to mark `directory` flag for `build` subcommand as required\")\n\t}\n\n\tbundleBuildCmd.Flags().StringVarP(&tag, \"tag\", \"t\", \"\",\n\t\t\"The image tag applied to the bundle image\")\n\tif err := bundleBuildCmd.MarkFlagRequired(\"tag\"); err != nil {\n\t\tlog.Fatalf(\"Failed to mark `tag` flag for `build` subcommand as required\")\n\t}\n\n\tbundleBuildCmd.Flags().StringVarP(&pkg, \"package\", \"p\", \"\",\n\t\t\"The name of the package that bundle image belongs to \"+\n\t\t\t\"(Required if `directory` is not pointing to a bundle in the nested bundle format)\")\n\n\tbundleBuildCmd.Flags().StringVarP(&channels, \"channels\", \"c\", \"\",\n\t\t\"The list of channels that bundle image belongs to\"+\n\t\t\t\"(Required if `directory` is not pointing to a bundle in the nested bundle format)\")\n\n\tbundleBuildCmd.Flags().StringVarP(&containerTool, \"image-builder\", \"b\", \"docker\",\n\t\t\"Tool used to manage container images. One of: [docker, podman, buildah]\")\n\n\tbundleBuildCmd.Flags().StringVarP(&defaultChannel, \"default\", \"e\", \"\",\n\t\t\"The default channel for the bundle image\")\n\n\tbundleBuildCmd.Flags().BoolVarP(&overwrite, \"overwrite\", \"o\", false,\n\t\t\"To overwrite annotations.yaml locally if existed. By default, overwrite is set to `false`.\")\n\n\tbundleBuildCmd.Flags().StringVarP(&outputDir, \"output-dir\", \"u\", \"\",\n\t\t\"Optional output directory for operator manifests\")\n\n\treturn bundleBuildCmd\n}", "func NewCommand(name, usage, description string, exec func(args ...string) ([]byte, error)) Command {\n\treturn &cmd{\n\t\tname: name,\n\t\tusage: usage,\n\t\tdescription: description,\n\t\texec: exec,\n\t}\n}", "func NewCommand(in io.Reader, out io.Writer, err io.Writer) *cobra.Command {\n\toptions := icrbuild.NewBuildOptions(in, out, err)\n\tcmd := &cobra.Command{\n\t\tUse: \"icrbuild [DIRECTORY]\",\n\t\tShort: \"Build a Docker image in IBM Cloud Container Registry using builder contract\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tLong: `\n `,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := options.Run(cmd, args)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t},\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := setUpLogs(err); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcmd.SilenceUsage = true\n\t\t\tlogrus.Infof(\"icrbuild %+v\", version.Get())\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Version = fmt.Sprintf(\"%+v\", version.Get())\n\tcmd.SetVersionTemplate(\"{{printf .Version}}\\n\")\n\n\t//\t[--no-cache] [--pull] [--quiet | -q] [--build-arg KEY=VALUE ...] [--file FILE | -f FILE] --tag TAG DIRECTORY\n\tcmd.PersistentFlags().BoolVar(&options.Flags.NoCache, \"no-cache\", false, \"Optional: If specified, cached image layers from previous builds are not used in this build.\")\n\tcmd.PersistentFlags().BoolVar(&options.Flags.Pull, \"pull\", false, \"Optional: If specified, the base images are pulled even if an image with a matching tag already exists on the build host.\")\n\tcmd.PersistentFlags().BoolVarP(&options.Flags.Quiet, \"quiet\", \"q\", false, \"Optional: If specified, the build output is suppressed unless an error occurs.\")\n\tcmd.PersistentFlags().StringArrayVar(&options.Flags.BuildArgs, \"build-arg\", nil, \"Optional: Specify an additional build argument in the format 'KEY=VALUE'. The value of each build argument is available as an environment variable when you specify an ARG line that matches the key in your Dockerfile.\")\n\tcmd.PersistentFlags().StringVarP(&options.Flags.File, \"file\", \"f\", \"\", \"Optional: Specify the location of the Dockerfile relative to the build context. If not specified, the default is 'PATH/Dockerfile', where PATH is the root of the build context.\")\n\tcmd.PersistentFlags().StringVarP(&options.Flags.Tag, \"tag\", \"t\", \"\", \"The full name for the image that you want to build, which includes the registry URL and namespace.\")\n\tcmd.MarkFlagRequired(\"tag\")\n\n\treturn cmd\n}", "func NewBackupCmd() *cobra.Command {\n\tbackupCmd := &cobra.Command{\n\t\tUse: \"backup <server names...>\",\n\t\tShort: fmt.Sprintf(\"Back up server and world files to ~/%s\", files.BackupDirName),\n\t\tLong: `\nSave the current world and server configuration to a zip file in the backup directory.\nIf two backups are taken in the same minute, the second will overwrite the first.\nBackups are saved to a default directory under the user's home directory.\nThe backed up world is usually a few seconds behind the world state at the time of backup.\nUse the trim and skip-trim-file-removal-check flags with linux cron or windows task scheduler to automate backups.`,\n\t\tExample: `craft backup myserver\ncraft backup myserver -l\n\nLinux cron (hourly):\n0 * * * * ~/craft_backups/backup.sh\n\t\n\t#!/usr/bin/env bash\n\t~/go/bin/craft backup myserver myotherserver \\ # path to craft executable and one or more servers\n\t--skip-trim-file-removal-check --trim 3 \\ # skip cmdline prompts and delete all except 3 newest files\n\t--log ~/craft_backups/backup.log --log-level info # log to file with log level info\n`,\n\t\tArgs: cobra.MinimumNArgs(1),\n\t\tRun: backupCommand,\n\t}\n\n\tbackupCmd.Flags().IntP(\"trim\", \"t\", 0,\n\t\t\"Delete the oldest backup files, leaving the given count of newest files in place.\")\n\n\tbackupCmd.Flags().BoolP(\"list\", \"l\", false,\n\t\t\"List backup files and take no other action.\")\n\n\tbackupCmd.Flags().Bool(\"skip-trim-file-removal-check\", false,\n\t\t\"Don't prompt the user before removing files. Useful for automating backups.\")\n\n\treturn backupCmd\n}", "func (r Describe) NewCommand(ctx context.Context, name string) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: name[strings.LastIndex(name, \".\")+1:] + \" [NAME[:VERSION]] [RESOURCE] [FILTER]\",\n\t\tShort: \"Describe registered releases with states information.\",\n\t\tLong: \"Describe registered releases with states information\",\n\t\tArgs: require.Args(r.validation),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tvar name string\n\t\t\tvar version semver.Version\n\t\t\tif len(args) > 0 {\n\t\t\t\tparts := strings.Split(args[0], \":\")\n\t\t\t\tparts = append(parts, \"\")\n\t\t\t\tname = parts[0]\n\n\t\t\t\tif parts[1] != \"\" {\n\t\t\t\t\tvar err error\n\t\t\t\t\tversion, err = semver.Parse(parts[1])\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar resource string\n\t\t\tif len(args) > 1 {\n\t\t\t\tresource = args[1]\n\t\t\t}\n\n\t\t\tvar filter string\n\t\t\tif len(args) > 2 {\n\t\t\t\tfilter = args[2]\n\t\t\t}\n\n\t\t\topts := describeOptions{\n\t\t\t\tName: name,\n\t\t\t\tVersion: version,\n\t\t\t\tResource: resource,\n\t\t\t\tFilter: filter,\n\t\t\t}\n\t\t\treturn r.run(ctx, cmd.OutOrStdout(), opts)\n\t\t},\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t}\n\n\tcmd.SetUsageTemplate(global.DefaultUsageTemplate)\n\tcmd.SetHelpCommand(&cobra.Command{Hidden: true})\n\n\tflags := cmd.Flags()\n\tflags.SortFlags = false\n\tflags.Bool(\"help\", false, \"Show help information.\")\n\treturn cmd\n}", "func New(c *Cfg) Cmd {\n\tif c.New != nil {\n\t\treturn c.New()\n\t}\n\treturn (*nilCmd)(c)\n}", "func NewCmdShow() *cobra.Command {\n\tvar showCmd = &cobra.Command{\n\t\tUse: \"show\",\n\t\tShort: \"Show dosanco resources\",\n\t}\n\tshowCmd.AddCommand(\n\t\tNewCmdShowNetwork(),\n\t\tNewCmdShowIPAM(),\n\t\tNewCmdShowVlan(),\n\t\tNewCmdShowHost(),\n\t\tNewCmdShowHostGroup(),\n\t\tNewCmdShowDataCenter(),\n\t\tNewCmdShowDataCenterFloor(),\n\t\tNewCmdShowDataCenterHall(),\n\t\tNewCmdShowRackRow(),\n\t\tNewCmdShowRack(),\n\t\tNewCmdShowUPS(),\n\t\tNewCmdShowRowPDU(),\n\t\tNewCmdShowRackPDU(),\n\t)\n\n\treturn showCmd\n}", "func NewArtifactCmd(ctx context.Context, opt *commonoptions.Common) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"artifact\",\n\t\tDisableFlagsInUseLine: true,\n\t\tShort: \"Interact with Falco artifacts\",\n\t\tLong: \"Interact with Falco artifacts\",\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tvar indexes []config.Index\n\t\t\tvar indexCache *cache.Cache\n\t\t\tvar err error\n\n\t\t\topt.Initialize()\n\t\t\tif err = config.Load(opt.ConfigFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// add indexes if needed\n\t\t\t// Set up basic authentication\n\t\t\tif indexes, err = config.Indexes(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Create the index cache.\n\t\t\tif indexCache, err = cache.NewFromConfig(ctx, config.IndexesFile, config.IndexesDir, indexes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// Save the index cache for later use by the sub commands.\n\t\t\topt.Initialize(commonoptions.WithIndexCache(indexCache))\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.AddCommand(search.NewArtifactSearchCmd(ctx, opt))\n\tcmd.AddCommand(install.NewArtifactInstallCmd(ctx, opt))\n\tcmd.AddCommand(list.NewArtifactListCmd(ctx, opt))\n\tcmd.AddCommand(info.NewArtifactInfoCmd(ctx, opt))\n\tcmd.AddCommand(follow.NewArtifactFollowCmd(ctx, opt))\n\n\treturn cmd\n}", "func newGenerateCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"generate\",\n\t\tShort: \"bulk generate key pairs\",\n\t\tLong: `\nThe generate sub command is intended only for test nets. It generates a \nnumber of key pairs and places them in the current monet keystore. The \naccounts are names <prefix><suffix> where prefix is set by --prefix (default\n\"Account\") and suffix is a number between --min-suffix and --max-suffix \ninclusive. The defaults are 1 and 5.\n`,\n\t\tArgs: cobra.ArbitraryArgs,\n\t\tRunE: generateKey,\n\t}\n\n\tcmd.Flags().StringVar(&prefix, \"prefix\", prefix, \"prefix for account monikers\")\n\tcmd.Flags().IntVar(&minSuffix, \"min-suffix\", minSuffix, \"minimum suffix for account monikers\")\n\tcmd.Flags().IntVar(&maxSuffix, \"max-suffix\", maxSuffix, \"maximum suffix for account monikers\")\n\n\tviper.BindPFlags(cmd.Flags())\n\n\treturn cmd\n}", "func NewCommand() *cobra.Command {\n\tcmdName := path.Base(os.Args[0])\n\tif cmdName == \"main\" {\n\t\twd, err := os.Getwd()\n\t\tif err != nil {\n\t\t\tlogger.Fatal(err)\n\t\t}\n\n\t\tcmdName = path.Base(wd)\n\t}\n\n\treturn &cobra.Command{\n\t\tUse: cmdName,\n\t\tShort: \"An opinionated productive web framework that helps scaling business easier.\",\n\t\tVersion: support.VERSION,\n\t}\n}", "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tArgs: cobra.NoArgs,\n\t\tUse: \"get\",\n\t\tShort: \"get shows info about specific object\",\n\t\tLong: \"get shows info about specific objects\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Help()\n\t\t},\n\t}\n\t// add subcommands\n\tcmd.AddCommand(pods.NewCommand())\n\treturn cmd\n}", "func NewDownloadCmd(targetReader TargetReader) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"download tf + (infra|internal-dns|external-dns|ingress|backup)\\n gardenctl download logs vpn\\n \",\n\t\tShort: \"Download terraform configuration/state for local execution for the targeted shoot or log files, e.g. \\\"gardenctl download logs vpn\\\" to download vpn logs\",\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) != 2 || !(args[1] == \"infra\" || args[1] == \"internal-dns\" || args[1] == \"external-dns\" || args[1] == \"ingress\" || args[1] == \"backup\" || args[1] == \"vpn\") {\n\t\t\t\treturn errors.New(\"Command must be in the format:\\n download tf + (infra|internal-dns|external-dns|ingress|backup)\\n download logs vpn\")\n\t\t\t}\n\t\t\tswitch args[0] {\n\t\t\tcase \"tf\":\n\t\t\t\tpath := downloadTerraformFiles(args[1], targetReader)\n\t\t\t\tfmt.Println(\"Downloaded to \" + path)\n\t\t\tcase \"logs\":\n\t\t\t\tdownloadLogs(args[1], targetReader)\n\t\t\tdefault:\n\t\t\t\tfmt.Println(\"Command must be in the format:\\n download tf + (infra|internal-dns|external-dns|ingress|backup)\\n download logs vpn\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tValidArgs: []string{\"tf\"},\n\t}\n}", "func NewCommand(client interfaces.Client, config interfaces.ConfigProvider) *cobra.Command {\n\tcommand := &cobra.Command{\n\t\tUse: \"apply\",\n\t\tShort: \"Make changes to existing resources\",\n\t}\n\n\tcommand.AddCommand(\n\t\tnewLicence(os.Stdout, client, config),\n\t)\n\n\treturn command\n}", "func NewCommand(ctx api.Context) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"cluster\",\n\t\tShort: \"Manage your DC/OS clusters\",\n\t}\n\tcmd.AddCommand(\n\t\tnewCmdClusterAttach(ctx),\n\t\tnewCmdClusterLink(ctx),\n\t\tnewCmdClusterList(ctx),\n\t\tnewCmdClusterRemove(ctx),\n\t\tnewCmdClusterRename(ctx),\n\t\tnewCmdClusterSetup(ctx),\n\t\tnewCmdClusterUnlink(ctx),\n\t)\n\treturn cmd\n}", "func NewCmdImport(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"import COMMAND\",\n\t\tShort: \"Commands that import applications\",\n\t\tLong: importLong,\n\t\tRun: cmdutil.DefaultSubCommandRun(errout),\n\t}\n\n\tname := fmt.Sprintf(\"%s import\", fullName)\n\n\tcmd.AddCommand(NewCmdAppJSON(name, f, in, out, errout))\n\treturn cmd\n}", "func NewCmdImport(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"import COMMAND\",\n\t\tShort: \"Commands that import applications\",\n\t\tLong: importLong,\n\t\tRun: cmdutil.DefaultSubCommandRun(errout),\n\t}\n\n\tname := fmt.Sprintf(\"%s import\", fullName)\n\n\tcmd.AddCommand(NewCmdAppJSON(name, f, in, out, errout))\n\treturn cmd\n}", "func NewCmd(db *bolt.DB, r io.Reader) *cobra.Command {\n\tvar opts addOptions\n\n\tcmd := &cobra.Command{\n\t\tUse: \"add <name>\",\n\t\tShort: \"Add a two-factor authentication code\",\n\t\tLong: `Add a two-factor authentication code. The name must be one already used by an entry.\n\nServices tipically show an hyperlinked \"Enter manually\", \"Enter this text code\" or similar messages, copy the hexadecimal code given and submit it when requested by Kure. After this, your entry will have a synchronized token with the service.`,\n\t\tExample: example,\n\t\tArgs: cmdutil.MustExist(db, cmdutil.Entry), // There must exist an entry with the same name\n\t\tPreRunE: auth.Login(db),\n\t\tRunE: opts.runAdd(db, r),\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\topts = addOptions{}\n\t\t},\n\t}\n\n\tcmd.Flags().IntVarP(&opts.digits, \"digits\", \"d\", 6, \"TOTP length {6|7|8}\")\n\n\treturn cmd\n}", "func NewPurgeCmd(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *RawConfig) *cobra.Command {\n\tcmd := &RunPipelineCmd{\n\t\tGlobalFlags: globalFlags,\n\t\tPipeline: \"purge\",\n\t\tSkipPushLocalKubernetes: true,\n\t}\n\n\tvar pipeline *latest.Pipeline\n\tif rawConfig != nil && rawConfig.Config != nil && rawConfig.Config.Pipelines != nil {\n\t\tpipeline = rawConfig.Config.Pipelines[\"purge\"]\n\t}\n\tpurgeCmd := &cobra.Command{\n\t\tUse: \"purge\",\n\t\tShort: \"Deletes deployed resources\",\n\t\tLong: `\n#######################################################\n################### devspace purge ####################\n#######################################################\nDeletes the deployed kubernetes resources:\n\ndevspace purge\n#######################################################`,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\treturn cmd.Run(cobraCmd, args, f, \"purgeCommand\")\n\t\t},\n\t}\n\tcmd.AddPipelineFlags(f, purgeCmd, pipeline)\n\treturn purgeCmd\n}", "func newPlanCmd() *cobra.Command {\n\tpc := &planCmd{}\n\n\tplanCmd := &cobra.Command{\n\t\tUse: \"plan [-f SORUCE]\",\n\t\tShort: \"Generate and show an execution plan\",\n\t\tLong: planLong,\n\t\tExample: planExample,\n\t\tDisableFlagsInUseLine: true,\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tArgs: cobra.MaximumNArgs(0),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := pc.meta.init(args); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn pc.run(args)\n\t\t},\n\t}\n\n\tf := planCmd.Flags()\n\tf.BoolVar(&pc.destroy, \"destroy\", false, \"create plan to destroy resources\")\n\n\tpc.addMetaFlags(planCmd)\n\n\treturn planCmd\n}", "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Version for apisix-mesh-agent\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(version.String())\n\t\t},\n\t}\n\treturn cmd\n}", "func NewAttachCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command {\n\tcmd := &AttachCmd{GlobalFlags: globalFlags}\n\n\tattachCmd := &cobra.Command{\n\t\tUse: \"attach\",\n\t\tShort: \"Attaches to a container\",\n\t\tLong: `\n#######################################################\n################# devspace attach #####################\n#######################################################\nAttaches to a running container\n\ndevspace attach\ndevspace attach --pick # Select pod to enter\ndevspace attach -c my-container\ndevspace attach -n my-namespace\n#######################################################`,\n\t\tRunE: func(cobraCmd *cobra.Command, args []string) error {\n\t\t\tplugin.SetPluginCommand(cobraCmd, args)\n\t\t\treturn cmd.Run(f, cobraCmd, args)\n\t\t},\n\t}\n\n\tattachCmd.Flags().StringVarP(&cmd.Container, \"container\", \"c\", \"\", \"Container name within pod where to execute command\")\n\tattachCmd.Flags().StringVar(&cmd.Pod, \"pod\", \"\", \"Pod to open a shell to\")\n\tattachCmd.Flags().StringVar(&cmd.ImageSelector, \"image-selector\", \"\", \"The image to search a pod for (e.g. nginx, nginx:latest, image(app), nginx:tag(app))\")\n\tattachCmd.Flags().StringVar(&cmd.Image, \"image\", \"\", \"Image is the config name of an image to select in the devspace config (e.g. 'default'), it is NOT a docker image like myuser/myimage\")\n\tattachCmd.Flags().StringVarP(&cmd.LabelSelector, \"label-selector\", \"l\", \"\", \"Comma separated key=value selector list (e.g. release=test)\")\n\n\tattachCmd.Flags().BoolVar(&cmd.Pick, \"pick\", true, \"Select a pod\")\n\n\treturn attachCmd\n}", "func NewPurgeCmd() *cobra.Command {\n\tcmd := &PurgeCmd{}\n\n\tpurgeCmd := &cobra.Command{\n\t\tUse: \"purge\",\n\t\tShort: \"Delete deployed resources\",\n\t\tLong: `\n#######################################################\n################### devspace purge ####################\n#######################################################\nDeletes the deployed kuberenetes resources:\n\ndevspace purge\ndevspace purge -d my-deployment\n#######################################################`,\n\t\tArgs: cobra.NoArgs,\n\t\tRun: cmd.Run,\n\t}\n\n\tpurgeCmd.Flags().StringVarP(&cmd.Deployments, \"deployments\", \"d\", \"\", \"The deployment to delete (You can specify multiple deployments comma-separated, e.g. devspace-default,devspace-database etc.)\")\n\n\treturn purgeCmd\n}", "func NewPluginCommand(cmd *cobra.Command, dockerCli *client.DockerCli) {\n}", "func NewCmdNewApplication(f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {\n\to := NewAppOptions(streams)\n\n\tcmd := &cobra.Command{\n\t\tUse: \"new-app (IMAGE | IMAGESTREAM | TEMPLATE | PATH | URL ...)\",\n\t\tShort: \"Create a new application\",\n\t\tLong: newAppLong,\n\t\tExample: newAppExample,\n\t\tSuggestFor: []string{\"app\", \"application\"},\n\t\tRun: func(c *cobra.Command, args []string) {\n\t\t\tkcmdutil.CheckErr(o.Complete(f, c, args))\n\t\t\tkcmdutil.CheckErr(o.RunNewApp())\n\t\t},\n\t}\n\n\to.PrintFlags.AddFlags(cmd)\n\n\tcmd.Flags().BoolVar(&o.Config.AsTestDeployment, \"as-test\", o.Config.AsTestDeployment, \"If true create this application as a test deployment, which validates that the deployment succeeds and then scales down.\")\n\tcmd.Flags().BoolVar(&o.Config.DeploymentConfig, \"as-deployment-config\", o.Config.DeploymentConfig, \"If true create this application as a deployment config, which allows for hooks and custom strategies.\")\n\tcmd.Flags().StringSliceVar(&o.Config.SourceRepositories, \"code\", o.Config.SourceRepositories, \"Source code to use to build this application.\")\n\tcmd.Flags().StringVar(&o.Config.ContextDir, \"context-dir\", o.Config.ContextDir, \"Context directory to be used for the build.\")\n\tcmd.Flags().StringSliceVarP(&o.Config.ImageStreams, \"image-stream\", \"i\", o.Config.ImageStreams, \"Name of an existing image stream to use to deploy an app.\")\n\tcmd.Flags().StringSliceVar(&o.Config.DockerImages, \"image\", o.Config.DockerImages, \"Name of a container image to include in the app. Note: not specifying a registry or repository means defaults in place for client image pulls are employed.\")\n\tcmd.Flags().StringSliceVar(&o.Config.DockerImages, \"docker-image\", o.Config.DockerImages, \"\")\n\tcmd.Flags().MarkDeprecated(\"docker-image\", \"Deprecated flag use --image\")\n\tcmd.Flags().StringSliceVar(&o.Config.Templates, \"template\", o.Config.Templates, \"Name of a stored template to use in the app.\")\n\tcmd.Flags().StringSliceVarP(&o.Config.TemplateFiles, \"file\", \"f\", o.Config.TemplateFiles, \"Path to a template file to use for the app.\")\n\tcmd.MarkFlagFilename(\"file\", \"yaml\", \"yml\", \"json\")\n\tcmd.Flags().StringArrayVarP(&o.Config.TemplateParameters, \"param\", \"p\", o.Config.TemplateParameters, \"Specify a key-value pair (e.g., -p FOO=BAR) to set/override a parameter value in the template.\")\n\tcmd.Flags().StringArrayVar(&o.Config.TemplateParameterFiles, \"param-file\", o.Config.TemplateParameterFiles, \"File containing parameter values to set/override in the template.\")\n\tcmd.MarkFlagFilename(\"param-file\")\n\tcmd.Flags().StringSliceVar(&o.Config.Groups, \"group\", o.Config.Groups, \"Indicate components that should be grouped together as <comp1>+<comp2>.\")\n\tcmd.Flags().StringArrayVarP(&o.Config.Environment, \"env\", \"e\", o.Config.Environment, \"Specify a key-value pair for an environment variable to set into each container.\")\n\tcmd.Flags().StringArrayVar(&o.Config.EnvironmentFiles, \"env-file\", o.Config.EnvironmentFiles, \"File containing key-value pairs of environment variables to set into each container.\")\n\tcmd.MarkFlagFilename(\"env-file\")\n\tcmd.Flags().StringArrayVar(&o.Config.BuildEnvironment, \"build-env\", o.Config.BuildEnvironment, \"Specify a key-value pair for an environment variable to set into each build image.\")\n\tcmd.Flags().StringArrayVar(&o.Config.BuildEnvironmentFiles, \"build-env-file\", o.Config.BuildEnvironmentFiles, \"File containing key-value pairs of environment variables to set into each build image.\")\n\tcmd.MarkFlagFilename(\"build-env-file\")\n\tcmd.Flags().StringVar(&o.Config.Name, \"name\", o.Config.Name, \"Set name to use for generated application artifacts\")\n\tcmd.Flags().Var(&o.Config.Strategy, \"strategy\", \"Specify the build strategy to use if you don't want to detect (docker|pipeline|source). NOTICE: the pipeline strategy is deprecated; consider using Jenkinsfiles directly on Jenkins or OpenShift Pipelines.\")\n\tcmd.Flags().StringP(\"labels\", \"l\", \"\", \"Label to set in all resources for this application.\")\n\tcmd.Flags().BoolVar(&o.Config.IgnoreUnknownParameters, \"ignore-unknown-parameters\", o.Config.IgnoreUnknownParameters, \"If true, will not stop processing if a provided parameter does not exist in the template.\")\n\tcmd.Flags().BoolVar(&o.Config.InsecureRegistry, \"insecure-registry\", o.Config.InsecureRegistry, \"If true, indicates that the referenced container images are on insecure registries and should bypass certificate checking\")\n\tcmd.Flags().BoolVarP(&o.Config.AsList, \"list\", \"L\", o.Config.AsList, \"List all local templates and image streams that can be used to create.\")\n\tcmd.Flags().BoolVarP(&o.Config.AsSearch, \"search\", \"S\", o.Config.AsSearch, \"Search all templates, image streams, and container images that match the arguments provided. Note: the container images search is run on the OpenShift cluster via the ImageStreamImport API.\")\n\tcmd.Flags().BoolVar(&o.Config.AllowMissingImages, \"allow-missing-images\", o.Config.AllowMissingImages, \"If true, indicates that referenced container images that cannot be found locally or in a registry should still be used.\")\n\tcmd.Flags().BoolVar(&o.Config.AllowMissingImageStreamTags, \"allow-missing-imagestream-tags\", o.Config.AllowMissingImageStreamTags, \"If true, indicates that image stream tags that don't exist should still be used.\")\n\tcmd.Flags().BoolVar(&o.Config.AllowSecretUse, \"grant-install-rights\", o.Config.AllowSecretUse, \"If true, a component that requires access to your account may use your token to install software into your project. Only grant images you trust the right to run with your token.\")\n\tcmd.Flags().StringVar(&o.Config.SourceSecret, \"source-secret\", o.Config.SourceSecret, \"The name of an existing secret that should be used for cloning a private git repository.\")\n\tcmd.Flags().BoolVar(&o.Config.SkipGeneration, \"no-install\", o.Config.SkipGeneration, \"Do not attempt to run images that describe themselves as being installable\")\n\tcmd.Flags().BoolVar(&o.Config.BinaryBuild, \"binary\", o.Config.BinaryBuild, \"Instead of expecting a source URL, set the build to expect binary contents. Will disable triggers.\")\n\tcmd.Flags().StringVar(&o.Config.ImportMode, \"import-mode\", o.Config.ImportMode, \"Imports the full manifest list of a tag when set to 'PreserveOriginal'. Defaults to 'Legacy'.\")\n\n\to.Action.BindForOutput(cmd.Flags(), \"output\", \"template\")\n\tcmd.Flags().String(\"output-version\", \"\", \"The preferred API versions of the output objects\")\n\n\treturn cmd\n}", "func NewExportCommand(ctx context.Context) *cobra.Command {\n\topts := &ExportOptions{}\n\tcmd := &cobra.Command{\n\t\tUse: \"export COMPONENT_ARCHIVE_PATH [-o output-dir/file] [-f {fs|tar|tgz}]\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tShort: \"Exports a component archive as defined by CTF\",\n\t\tLong: `\nExport command exports a component archive as defined by CTF (CNUDIE Transport Format).\nIf the given component-archive path points to a directory, the archive is expected to be a extracted component-archive on the filesystem.\nThen it is exported as tar or optionally as compressed tar.\n\nIf the given path points to a file, the archive is read as tar or compressed tar (tar.gz) and exported as filesystem to the given location.\n`,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tif err := opts.Complete(args); err != nil {\n\t\t\t\tfmt.Println(err.Error())\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\tif err := opts.Run(ctx, osfs.New()); err != nil {\n\t\t\t\tfmt.Println(err.Error())\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\tfmt.Printf(\"Successfully exported component archive to %s\\n\", opts.OutputPath)\n\t\t},\n\t}\n\topts.AddFlags(cmd.Flags())\n\treturn cmd\n}" ]
[ "0.6740657", "0.6685995", "0.6685378", "0.6652252", "0.66018087", "0.65894043", "0.65083665", "0.6456303", "0.64481395", "0.6446897", "0.64370805", "0.6433159", "0.64153534", "0.63907087", "0.63795507", "0.63594395", "0.633699", "0.63093776", "0.63058627", "0.62995654", "0.6299279", "0.6288317", "0.6273053", "0.626239", "0.6259076", "0.6253954", "0.6247525", "0.6196881", "0.61835283", "0.6171813", "0.61584836", "0.6154289", "0.6152844", "0.61473495", "0.614666", "0.61372656", "0.6136717", "0.61362624", "0.6122823", "0.60950327", "0.60929066", "0.6086676", "0.6081865", "0.6078874", "0.606882", "0.60686404", "0.6064136", "0.6063726", "0.6059593", "0.60480255", "0.60180414", "0.60133547", "0.6010556", "0.6006248", "0.600207", "0.5994043", "0.5988063", "0.59780115", "0.59749186", "0.5972182", "0.59711623", "0.5969938", "0.59574556", "0.59527105", "0.595202", "0.5936809", "0.5934779", "0.59332734", "0.5931099", "0.5927303", "0.5923372", "0.59222424", "0.59197956", "0.5918537", "0.5913424", "0.5910269", "0.5906335", "0.59057814", "0.58949083", "0.5887379", "0.58838826", "0.58828133", "0.58732176", "0.58669114", "0.5865073", "0.5864096", "0.58637995", "0.5858671", "0.5857639", "0.5857543", "0.5857543", "0.58547086", "0.5850926", "0.58447224", "0.5832732", "0.5818604", "0.5816997", "0.58122915", "0.5811757", "0.5807872" ]
0.8364528
0
NewCloudAwsVirtualMachineAllOf instantiates a new CloudAwsVirtualMachineAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed
NewCloudAwsVirtualMachineAllOf создает новый объект CloudAwsVirtualMachineAllOf. Этот конструктор присваивает значения по умолчанию свойствам, которые определены, и убеждается, что свойства, требуемые API, установлены, но набор аргументов изменится при изменении набора требуемых свойств
func NewCloudAwsVirtualMachineAllOf(classId string, objectType string) *CloudAwsVirtualMachineAllOf { this := CloudAwsVirtualMachineAllOf{} this.ClassId = classId this.ObjectType = objectType return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCloudAwsVirtualMachineAllOfWithDefaults() *CloudAwsVirtualMachineAllOf {\n\tthis := CloudAwsVirtualMachineAllOf{}\n\tvar classId string = \"cloud.AwsVirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"cloud.AwsVirtualMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationVmwareVirtualMachineAllOfWithDefaults() *VirtualizationVmwareVirtualMachineAllOf {\n\tthis := VirtualizationVmwareVirtualMachineAllOf{}\n\tvar classId string = \"virtualization.VmwareVirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"virtualization.VmwareVirtualMachine\"\n\tthis.ObjectType = objectType\n\tvar guestState string = \"Unknown\"\n\tthis.GuestState = &guestState\n\treturn &this\n}", "func NewCloudInstanceTypeAllOf(classId string, objectType string) *CloudInstanceTypeAllOf {\n\tthis := CloudInstanceTypeAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewHyperflexVirtualMachineAllOf(classId string, objectType string) *HyperflexVirtualMachineAllOf {\n\tthis := HyperflexVirtualMachineAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewHyperflexVirtualMachineAllOfWithDefaults() *HyperflexVirtualMachineAllOf {\n\tthis := HyperflexVirtualMachineAllOf{}\n\tvar classId string = \"hyperflex.VirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"hyperflex.VirtualMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationVmwareVirtualMachineAllOf(classId string, objectType string) *VirtualizationVmwareVirtualMachineAllOf {\n\tthis := VirtualizationVmwareVirtualMachineAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar guestState string = \"Unknown\"\n\tthis.GuestState = &guestState\n\treturn &this\n}", "func NewCloudInstanceTypeAllOfWithDefaults() *CloudInstanceTypeAllOf {\n\tthis := CloudInstanceTypeAllOf{}\n\tvar classId string = \"cloud.InstanceType\"\n\tthis.ClassId = classId\n\tvar objectType string = \"cloud.InstanceType\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamServiceProviderAllOf(classId string, objectType string) *IamServiceProviderAllOf {\n\tthis := IamServiceProviderAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamServiceProviderAllOfWithDefaults() *IamServiceProviderAllOf {\n\tthis := IamServiceProviderAllOf{}\n\tvar classId string = \"iam.ServiceProvider\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.ServiceProvider\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationIweClusterAllOfWithDefaults() *VirtualizationIweClusterAllOf {\n\tthis := VirtualizationIweClusterAllOf{}\n\tvar classId string = \"virtualization.IweCluster\"\n\tthis.ClassId = classId\n\tvar objectType string = \"virtualization.IweCluster\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationIweClusterAllOf(classId string, objectType string) *VirtualizationIweClusterAllOf {\n\tthis := VirtualizationIweClusterAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewComputeBladeIdentityAllOfWithDefaults() *ComputeBladeIdentityAllOf {\n\tthis := ComputeBladeIdentityAllOf{}\n\tvar classId string = \"compute.BladeIdentity\"\n\tthis.ClassId = classId\n\tvar objectType string = \"compute.BladeIdentity\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewMacpoolPoolMemberAllOfWithDefaults() *MacpoolPoolMemberAllOf {\n\tthis := MacpoolPoolMemberAllOf{}\n\tvar classId string = \"macpool.PoolMember\"\n\tthis.ClassId = classId\n\tvar objectType string = \"macpool.PoolMember\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func newVirtualMachineScaleSetVMsClient(subscriptionID string, baseURI string, authorizer autorest.Authorizer) compute.VirtualMachineScaleSetVMsClient {\n\tc := compute.NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI, subscriptionID)\n\tc.Authorizer = authorizer\n\tc.RetryAttempts = 1\n\t_ = c.AddToUserAgent(azure.UserAgent()) // intentionally ignore error as it doesn't matter\n\treturn c\n}", "func NewInventoryBaseAllOf(classId string, objectType string) *InventoryBaseAllOf {\n\tthis := InventoryBaseAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationBaseHostPciDeviceAllOfWithDefaults() *VirtualizationBaseHostPciDeviceAllOf {\n\tthis := VirtualizationBaseHostPciDeviceAllOf{}\n\tvar classId string = \"virtualization.VmwareHostGpu\"\n\tthis.ClassId = classId\n\tvar objectType string = \"virtualization.VmwareHostGpu\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewInventoryBaseAllOfWithDefaults() *InventoryBaseAllOf {\n\tthis := InventoryBaseAllOf{}\n\treturn &this\n}", "func NewHyperflexVmSnapshotInfoAllOfWithDefaults() *HyperflexVmSnapshotInfoAllOf {\n\tthis := HyperflexVmSnapshotInfoAllOf{}\n\tvar classId string = \"hyperflex.VmSnapshotInfo\"\n\tthis.ClassId = classId\n\tvar objectType string = \"hyperflex.VmSnapshotInfo\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewNiatelemetryEqptcapacityPolUsage5minAllOfWithDefaults() *NiatelemetryEqptcapacityPolUsage5minAllOf {\n\tthis := NiatelemetryEqptcapacityPolUsage5minAllOf{}\n\tvar classId string = \"niatelemetry.EqptcapacityPolUsage5min\"\n\tthis.ClassId = classId\n\tvar objectType string = \"niatelemetry.EqptcapacityPolUsage5min\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewInfraBasePciConfigurationAllOf(classId string, objectType string) *InfraBasePciConfigurationAllOf {\n\tthis := InfraBasePciConfigurationAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageVdMemberEpAllOf(classId string, objectType string) *StorageVdMemberEpAllOf {\n\tthis := StorageVdMemberEpAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewMacpoolLeaseAllOfWithDefaults() *MacpoolLeaseAllOf {\n\tthis := MacpoolLeaseAllOf{}\n\tvar classId string = \"macpool.Lease\"\n\tthis.ClassId = classId\n\tvar objectType string = \"macpool.Lease\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewMacpoolPoolMemberAllOf(classId string, objectType string) *MacpoolPoolMemberAllOf {\n\tthis := MacpoolPoolMemberAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewMacpoolLeaseAllOf(classId string, objectType string) *MacpoolLeaseAllOf {\n\tthis := MacpoolLeaseAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageVdMemberEpAllOfWithDefaults() *StorageVdMemberEpAllOf {\n\tthis := StorageVdMemberEpAllOf{}\n\tvar classId string = \"storage.VdMemberEp\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.VdMemberEp\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamLdapBasePropertiesAllOf(classId string, objectType string) *IamLdapBasePropertiesAllOf {\n\tthis := IamLdapBasePropertiesAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar bindMethod string = \"LoginCredentials\"\n\tthis.BindMethod = &bindMethod\n\tvar nestedGroupSearchDepth int64 = 128\n\tthis.NestedGroupSearchDepth = &nestedGroupSearchDepth\n\tvar timeout int64 = 0\n\tthis.Timeout = &timeout\n\treturn &this\n}", "func NewVirtualizationBaseHostPciDeviceAllOf(classId string, objectType string) *VirtualizationBaseHostPciDeviceAllOf {\n\tthis := VirtualizationBaseHostPciDeviceAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamLdapConfigParamsAllOf(classId string, objectType string) *IamLdapConfigParamsAllOf {\n\tthis := IamLdapConfigParamsAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewComputeBladeIdentityAllOf(classId string, objectType string) *ComputeBladeIdentityAllOf {\n\tthis := ComputeBladeIdentityAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageNetAppCloudTargetAllOfWithDefaults() *StorageNetAppCloudTargetAllOf {\n\tthis := StorageNetAppCloudTargetAllOf{}\n\tvar classId string = \"storage.NetAppCloudTarget\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.NetAppCloudTarget\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamLdapProviderAllOf(classId string, objectType string) *IamLdapProviderAllOf {\n\tthis := IamLdapProviderAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar port int64 = 389\n\tthis.Port = &port\n\treturn &this\n}", "func NewAll(matchers []Matcher) All {\n\treturn All(matchers)\n}", "func NewStorageSpaceAllOfWithDefaults() *StorageSpaceAllOf {\n\tthis := StorageSpaceAllOf{}\n\tvar classId string = \"storage.Space\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.Space\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewUcsdBackupInfoAllOfWithDefaults() *UcsdBackupInfoAllOf {\n\tthis := UcsdBackupInfoAllOf{}\n\tvar classId string = \"ucsd.BackupInfo\"\n\tthis.ClassId = classId\n\tvar objectType string = \"ucsd.BackupInfo\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewEquipmentIdentityAllOfWithDefaults() *EquipmentIdentityAllOf {\n\tthis := EquipmentIdentityAllOf{}\n\tvar adminAction string = \"None\"\n\tthis.AdminAction = &adminAction\n\treturn &this\n}", "func NewStorageSpaceAllOf(classId string, objectType string) *StorageSpaceAllOf {\n\tthis := StorageSpaceAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewOsInstallAllOf(classId string, objectType string) *OsInstallAllOf {\n\tthis := OsInstallAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewHyperflexVmSnapshotInfoAllOf(classId string, objectType string) *HyperflexVmSnapshotInfoAllOf {\n\tthis := HyperflexVmSnapshotInfoAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageNetAppCloudTargetAllOf(classId string, objectType string) *StorageNetAppCloudTargetAllOf {\n\tthis := StorageNetAppCloudTargetAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func New(base mb.BaseMetricSet) (mb.MetricSet, error) {\n\n\tconfig := struct {\n\t\tKeys []string `config:\"keys\"`\n\t}{\n\t\tKeys: []string{},\n\t}\n\n\tif err := base.Module().UnpackConfig(&config); err != nil {\n\t\treturn nil, err\n\t}\n\n\tlogp.Warn(\"EXPERIMENTAL: The consulkv kv metricset is experimental %v\", config)\n\n\treturn &MetricSet{\n\t\tBaseMetricSet: base,\n\t\tkeys: config.Keys,\n\t}, nil\n}", "func NewQuotaSummaryAllOf(allowed int32, availabilityZoneType string, byoc bool, reserved int32, resourceName string, resourceType string) *QuotaSummaryAllOf {\n\tthis := QuotaSummaryAllOf{}\n\tthis.Allowed = allowed\n\tthis.AvailabilityZoneType = availabilityZoneType\n\tthis.Byoc = byoc\n\tthis.Reserved = reserved\n\tthis.ResourceName = resourceName\n\tthis.ResourceType = resourceType\n\treturn &this\n}", "func NewPcloudCloudinstancesVolumesGetallParams() *PcloudCloudinstancesVolumesGetallParams {\n\treturn &PcloudCloudinstancesVolumesGetallParams{\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "func NewWorkflowCliCommandAllOf(classId string, objectType string) *WorkflowCliCommandAllOf {\n\tthis := WorkflowCliCommandAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar type_ string = \"NonInteractive\"\n\tthis.Type = &type_\n\treturn &this\n}", "func NewIamLdapBasePropertiesAllOfWithDefaults() *IamLdapBasePropertiesAllOf {\n\tthis := IamLdapBasePropertiesAllOf{}\n\tvar classId string = \"iam.LdapBaseProperties\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.LdapBaseProperties\"\n\tthis.ObjectType = objectType\n\tvar bindMethod string = \"LoginCredentials\"\n\tthis.BindMethod = &bindMethod\n\tvar nestedGroupSearchDepth int64 = 128\n\tthis.NestedGroupSearchDepth = &nestedGroupSearchDepth\n\tvar timeout int64 = 0\n\tthis.Timeout = &timeout\n\treturn &this\n}", "func NewEquipmentIdentityAllOf(classId string, objectType string) *EquipmentIdentityAllOf {\n\tthis := EquipmentIdentityAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar adminAction string = \"None\"\n\tthis.AdminAction = &adminAction\n\treturn &this\n}", "func New() (*BFVM, error) {\n\treturn WithSpecs(8, 3000)\n}", "func NewSoftwarerepositoryLocalMachineAllOfWithDefaults() *SoftwarerepositoryLocalMachineAllOf {\n\tthis := SoftwarerepositoryLocalMachineAllOf{}\n\tvar classId string = \"softwarerepository.LocalMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"softwarerepository.LocalMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (x *fastReflection_Params) New() protoreflect.Message {\n\treturn new(fastReflection_Params)\n}", "func newClient(auth azure.Authorizer) *azureClient {\n\treturn &azureClient{\n\t\tscalesetvms: newVirtualMachineScaleSetVMsClient(auth.SubscriptionID(), auth.BaseURI(), auth.Authorizer()),\n\t}\n}", "func NewOsInstallAllOfWithDefaults() *OsInstallAllOf {\n\tthis := OsInstallAllOf{}\n\tvar classId string = \"os.Install\"\n\tthis.ClassId = classId\n\tvar objectType string = \"os.Install\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func newCollectOptions() *common.CollectOptions {\n\topts := &common.CollectOptions{}\n\n\topts.Config = common.EdgecoreConfigPath\n\topts.OutputPath = \".\"\n\topts.Detail = false\n\treturn opts\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetallParams {\n\to.SetContext(ctx)\n\treturn o\n}", "func NewUcsdBackupInfoAllOf(classId string, objectType string) *UcsdBackupInfoAllOf {\n\tthis := UcsdBackupInfoAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) 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.Affinity != nil {\n\n\t\t// query param affinity\n\t\tvar qrAffinity string\n\n\t\tif o.Affinity != nil {\n\t\t\tqrAffinity = *o.Affinity\n\t\t}\n\t\tqAffinity := qrAffinity\n\t\tif qAffinity != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"affinity\", qAffinity); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Auxiliary != nil {\n\n\t\t// query param auxiliary\n\t\tvar qrAuxiliary bool\n\n\t\tif o.Auxiliary != nil {\n\t\t\tqrAuxiliary = *o.Auxiliary\n\t\t}\n\t\tqAuxiliary := swag.FormatBool(qrAuxiliary)\n\t\tif qAuxiliary != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"auxiliary\", qAuxiliary); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// path param cloud_instance_id\n\tif err := r.SetPathParam(\"cloud_instance_id\", o.CloudInstanceID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.ReplicationEnabled != nil {\n\n\t\t// query param replicationEnabled\n\t\tvar qrReplicationEnabled bool\n\n\t\tif o.ReplicationEnabled != nil {\n\t\t\tqrReplicationEnabled = *o.ReplicationEnabled\n\t\t}\n\t\tqReplicationEnabled := swag.FormatBool(qrReplicationEnabled)\n\t\tif qReplicationEnabled != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"replicationEnabled\", qReplicationEnabled); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "func NewIamLdapProviderAllOfWithDefaults() *IamLdapProviderAllOf {\n\tthis := IamLdapProviderAllOf{}\n\tvar classId string = \"iam.LdapProvider\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.LdapProvider\"\n\tthis.ObjectType = objectType\n\tvar port int64 = 389\n\tthis.Port = &port\n\treturn &this\n}", "func NewMemoryArrayAllOfWithDefaults() *MemoryArrayAllOf {\n\tthis := MemoryArrayAllOf{}\n\tvar classId string = \"memory.Array\"\n\tthis.ClassId = classId\n\tvar objectType string = \"memory.Array\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewPcloudCloudinstancesVolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetallParams {\n\treturn &PcloudCloudinstancesVolumesGetallParams{\n\t\tHTTPClient: client,\n\t}\n}", "func NewMetricsAllOf() *MetricsAllOf {\n\tthis := MetricsAllOf{}\n\treturn &this\n}", "func NewPcloudCloudinstancesVolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetallParams {\n\treturn &PcloudCloudinstancesVolumesGetallParams{\n\t\ttimeout: timeout,\n\t}\n}", "func NewVirtualMachine(ctx *pulumi.Context,\n\tname string, args *VirtualMachineArgs, opts ...pulumi.ResourceOption) (*VirtualMachine, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.LabName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'LabName'\")\n\t}\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\tif args.AllowClaim == nil {\n\t\targs.AllowClaim = pulumi.BoolPtr(false)\n\t}\n\tif args.DisallowPublicIpAddress == nil {\n\t\targs.DisallowPublicIpAddress = pulumi.BoolPtr(false)\n\t}\n\tif args.OwnerObjectId == nil {\n\t\targs.OwnerObjectId = pulumi.StringPtr(\"dynamicValue\")\n\t}\n\tif args.StorageType == nil {\n\t\targs.StorageType = pulumi.StringPtr(\"labStorageType\")\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab/v20180915:VirtualMachine\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:devtestlab:VirtualMachine\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab:VirtualMachine\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:devtestlab/v20150521preview:VirtualMachine\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab/v20150521preview:VirtualMachine\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:devtestlab/v20160515:VirtualMachine\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab/v20160515:VirtualMachine\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource VirtualMachine\n\terr := ctx.RegisterResource(\"azure-native:devtestlab/v20180915:VirtualMachine\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewStoragePhysicalDiskAllOfWithDefaults() *StoragePhysicalDiskAllOf {\n\tthis := StoragePhysicalDiskAllOf{}\n\tvar classId string = \"storage.PhysicalDisk\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.PhysicalDisk\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewPipelineSshKeyPairAllOfWithDefaults() *PipelineSshKeyPairAllOf {\n\tthis := PipelineSshKeyPairAllOf{}\n\treturn &this\n}", "func NewWorkflowCliCommandAllOfWithDefaults() *WorkflowCliCommandAllOf {\n\tthis := WorkflowCliCommandAllOf{}\n\tvar classId string = \"workflow.CliCommand\"\n\tthis.ClassId = classId\n\tvar objectType string = \"workflow.CliCommand\"\n\tthis.ObjectType = objectType\n\tvar type_ string = \"NonInteractive\"\n\tthis.Type = &type_\n\treturn &this\n}", "func newPVCs(cr *influxdatav1alpha1.Influxdb) *corev1.PersistentVolumeClaim {\n\tls := labelsForInfluxdb(cr.Name)\n\n\treturn &corev1.PersistentVolumeClaim{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"v1\",\n\t\t\tKind: \"PersistentVolumeClaim\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Spec.Pod.PersistentVolumeClaim.Name,\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: ls,\n\t\t},\n\t\tSpec: cr.Spec.Pod.PersistentVolumeClaim.Spec,\n\t}\n}", "func NewStoragePhysicalDiskAllOf(classId string, objectType string) *StoragePhysicalDiskAllOf {\n\tthis := StoragePhysicalDiskAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewAllTimezonesBadRequest() *AllTimezonesBadRequest {\n return &AllTimezonesBadRequest{\n }\n}", "func NewConnectorTypeAllOfWithDefaults() *ConnectorTypeAllOf {\n\tthis := ConnectorTypeAllOf{}\n\n\n\n\n\n\n\n\n\treturn &this\n}", "func NewHyperflexMapClusterIdToProtectionInfoAllOfWithDefaults() *HyperflexMapClusterIdToProtectionInfoAllOf {\n\tthis := HyperflexMapClusterIdToProtectionInfoAllOf{}\n\tvar classId string = \"hyperflex.MapClusterIdToProtectionInfo\"\n\tthis.ClassId = classId\n\tvar objectType string = \"hyperflex.MapClusterIdToProtectionInfo\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageHitachiPortAllOfWithDefaults() *StorageHitachiPortAllOf {\n\tthis := StorageHitachiPortAllOf{}\n\tvar classId string = \"storage.HitachiPort\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.HitachiPort\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewMetricsAllOfWithDefaults() *MetricsAllOf {\n\tthis := MetricsAllOf{}\n\treturn &this\n}", "func NewMemoryArrayAllOf(classId string, objectType string) *MemoryArrayAllOf {\n\tthis := MemoryArrayAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewWorkflowServiceItemDefinitionAllOfWithDefaults() *WorkflowServiceItemDefinitionAllOf {\n\tthis := WorkflowServiceItemDefinitionAllOf{}\n\tvar classId string = \"workflow.ServiceItemDefinition\"\n\tthis.ClassId = classId\n\tvar objectType string = \"workflow.ServiceItemDefinition\"\n\tthis.ObjectType = objectType\n\tvar allowMultipleServiceItemInstances bool = true\n\tthis.AllowMultipleServiceItemInstances = &allowMultipleServiceItemInstances\n\tvar deleteInstanceOnDecommission bool = false\n\tthis.DeleteInstanceOnDecommission = &deleteInstanceOnDecommission\n\tvar publishStatus string = \"NotPublished\"\n\tthis.PublishStatus = &publishStatus\n\tvar supportStatus string = \"Supported\"\n\tthis.SupportStatus = &supportStatus\n\tvar version int64 = 1\n\tthis.Version = &version\n\treturn &this\n}", "func New(tagName ...string) *VM {\n\tif len(tagName) == 0 {\n\t\ttagName = append(tagName, \"\")\n\t}\n\treturn &VM{\n\t\ttagName: tagName[0],\n\t\tstructJar: make(map[int32]*structVM, 256),\n\t}\n}", "func NewStackpathRpcLocalizedMessageAllOfWithDefaults() *StackpathRpcLocalizedMessageAllOf {\n\tthis := StackpathRpcLocalizedMessageAllOf{}\n\treturn &this\n}", "func NewCloud(cfg CloudConfig, metricsRegisterer prometheus.Registerer) (Cloud, error) {\n\tmetadataSess := session.Must(session.NewSession(aws.NewConfig()))\n\tmetadata := services.NewEC2Metadata(metadataSess)\n\tif len(cfg.Region) == 0 {\n\t\tregion, err := metadata.Region()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to introspect region from EC2Metadata, specify --aws-region instead if EC2Metadata is unavailable\")\n\t\t}\n\t\tcfg.Region = region\n\t}\n\n\tif len(cfg.VpcID) == 0 {\n\t\tvpcId, err := metadata.VpcID()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to introspect vpcID from EC2Metadata, specify --aws-vpc-id instead if EC2Metadata is unavailable\")\n\t\t}\n\t\tcfg.VpcID = vpcId\n\t}\n\n\tawsCFG := aws.NewConfig().WithRegion(cfg.Region).WithSTSRegionalEndpoint(endpoints.RegionalSTSEndpoint).WithMaxRetries(cfg.MaxRetries)\n\tsess := session.Must(session.NewSession(awsCFG))\n\tinjectUserAgent(&sess.Handlers)\n\n\tif cfg.ThrottleConfig != nil {\n\t\tthrottler := throttle.NewThrottler(cfg.ThrottleConfig)\n\t\tthrottler.InjectHandlers(&sess.Handlers)\n\t}\n\tif metricsRegisterer != nil {\n\t\tmetricsCollector, err := metrics.NewCollector(metricsRegisterer)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to initialize sdk metrics collector\")\n\t\t}\n\t\tmetricsCollector.InjectHandlers(&sess.Handlers)\n\t}\n\n\treturn &defaultCloud{\n\t\tcfg: cfg,\n\t\tec2: services.NewEC2(sess),\n\t\telbv2: services.NewELBV2(sess),\n\t\tacm: services.NewACM(sess),\n\t\twafv2: services.NewWAFv2(sess),\n\t\twafRegional: services.NewWAFRegional(sess, cfg.Region),\n\t\tshield: services.NewShield(sess),\n\t\trgt: services.NewRGT(sess),\n\t}, nil\n}", "func NewNiatelemetryEqptcapacityPolUsage5minAllOf(classId string, objectType string) *NiatelemetryEqptcapacityPolUsage5minAllOf {\n\tthis := NiatelemetryEqptcapacityPolUsage5minAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewInfraBasePciConfigurationAllOfWithDefaults() *InfraBasePciConfigurationAllOf {\n\tthis := InfraBasePciConfigurationAllOf{}\n\treturn &this\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) WithDefaults() *PcloudCloudinstancesVolumesGetallParams {\n\to.SetDefaults()\n\treturn o\n}", "func NewConnectorTypeAllOfWithDefaults() *ConnectorTypeAllOf {\n\tthis := ConnectorTypeAllOf{}\n\treturn &this\n}", "func initializeVM(jobName string, args []types.JobArgs) *otto.Otto {\n\tcontext := &types.JobInstanceContext{\n\t\tJobName: jobName,\n\t}\n\tvm := NewVMWithPlugins(context)\n\t// Setting job arguments in VM\n\tfor _, arg := range args {\n\t\tvm.Set(arg.Name, arg.Value)\n\t}\n\treturn vm\n}", "func New(opts ...Option) *Vox {\n\tv := &Vox{\n\t\tcb: nil,\n\t\tholdTime: time.Millisecond * 500,\n\t\tthreshold: 0.1,\n\t\tlastActivation: time.Time{},\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(v)\n\t}\n\n\treturn v\n}", "func NewConnectorXmlApiMessageAllOfWithDefaults() *ConnectorXmlApiMessageAllOf {\n\tthis := ConnectorXmlApiMessageAllOf{}\n\tvar classId string = \"connector.XmlApiMessage\"\n\tthis.ClassId = classId\n\tvar objectType string = \"connector.XmlApiMessage\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamLdapConfigParamsAllOfWithDefaults() *IamLdapConfigParamsAllOf {\n\tthis := IamLdapConfigParamsAllOf{}\n\tvar classId string = \"iam.LdapConfigParams\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.LdapConfigParams\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (x *fastReflection_AddressBytesToStringRequest) New() protoreflect.Message {\n\treturn new(fastReflection_AddressBytesToStringRequest)\n}", "func NewTimedZoneRangeAllOf() *TimedZoneRangeAllOf {\n\tthis := TimedZoneRangeAllOf{}\n\treturn &this\n}", "func newVMClient(s storage.Storage) VMClient {\n\treturn &vmClient{\n\t\tstorage: s,\n\t\tfilterer: filterer.NewFilterer(s),\n\t}\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetallParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "func create_virtual_machine(){\n parameters := make([]string, 0)\n parameters = append(parameters, \"apply\")\n parameters = append(parameters, \"--auto-approve\")\n\n execute_command(\"terraform\", parameters)\n}", "func NewOpenapiProcessFileAllOfWithDefaults() *OpenapiProcessFileAllOf {\n\tthis := OpenapiProcessFileAllOf{}\n\tvar classId string = \"openapi.ProcessFile\"\n\tthis.ClassId = classId\n\tvar objectType string = \"openapi.ProcessFile\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func New(base mb.BaseMetricSet) (mb.MetricSet, error) {\n\tcfgwarn.Beta(\"The vsphere host metricset is beta\")\n\n\tconfig := struct {\n\t\tUsername string `config:\"username\"`\n\t\tPassword string `config:\"password\"`\n\t\tInsecure bool `config:\"insecure\"`\n\t}{}\n\n\tif err := base.Module().UnpackConfig(&config); err != nil {\n\t\treturn nil, err\n\t}\n\n\tu, err := url.Parse(base.HostData().URI)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tu.User = url.UserPassword(config.Username, config.Password)\n\n\treturn &MetricSet{\n\t\tBaseMetricSet: base,\n\t\tHostURL: u,\n\t\tInsecure: config.Insecure,\n\t}, nil\n}", "func (bv *BaseVSphere) Initialize() error {\n\tbv.ctx, bv.cancel = context.WithCancel(context.Background())\n\n\t// Connect and login to the VMWare vSphere API endpoint\n\tc, err := govmomi.NewClient(bv.ctx, bv.url, bv.Insecure)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbv.client = c\n\tbv.finder = find.NewFinder(bv.client.Client, true)\n\n\treturn nil\n}", "func NewPolicyPaginationAllOf(data []PolicyExtended, ) *PolicyPaginationAllOf {\n\tthis := PolicyPaginationAllOf{}\n\tthis.Data = data\n\treturn &this\n}", "func NewTimedZoneRangeAllOfWithDefaults() *TimedZoneRangeAllOf {\n\tthis := TimedZoneRangeAllOf{}\n\treturn &this\n}", "func NewApplianceSetupInfoAllOfWithDefaults() *ApplianceSetupInfoAllOf {\n\tthis := ApplianceSetupInfoAllOf{}\n\tvar classId string = \"appliance.SetupInfo\"\n\tthis.ClassId = classId\n\tvar objectType string = \"appliance.SetupInfo\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewWorkflowServiceItemDefinitionAllOf(classId string, objectType string) *WorkflowServiceItemDefinitionAllOf {\n\tthis := WorkflowServiceItemDefinitionAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar allowMultipleServiceItemInstances bool = true\n\tthis.AllowMultipleServiceItemInstances = &allowMultipleServiceItemInstances\n\tvar deleteInstanceOnDecommission bool = false\n\tthis.DeleteInstanceOnDecommission = &deleteInstanceOnDecommission\n\tvar publishStatus string = \"NotPublished\"\n\tthis.PublishStatus = &publishStatus\n\tvar supportStatus string = \"Supported\"\n\tthis.SupportStatus = &supportStatus\n\tvar version int64 = 1\n\tthis.Version = &version\n\treturn &this\n}", "func (x *fastReflection_AddressStringToBytesRequest) New() protoreflect.Message {\n\treturn new(fastReflection_AddressStringToBytesRequest)\n}", "func NewStorageHitachiPortAllOf(classId string, objectType string) *StorageHitachiPortAllOf {\n\tthis := StorageHitachiPortAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewFindAllOptions(flavor Flavor) *FindAllOptions {\n\treturn &FindAllOptions{\n\t\tFields: []string{\"*\"},\n\t\tFlavor: flavor,\n\t\tFilters: make(map[string]interface{}),\n\t}\n}", "func (f *IBMPIInstanceClient) GetAll(powerinstanceid string, timeout time.Duration) (*models.PVMInstances, error) {\n\n\tparams := p_cloud_p_vm_instances.NewPcloudPvminstancesGetallParamsWithTimeout(getTimeOut).WithCloudInstanceID(powerinstanceid)\n\tresp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid))\n\tif err != nil || resp.Payload == nil {\n\t\treturn nil, fmt.Errorf(\"Failed to Get all PVM Instances of Power Instance %s :%s\", powerinstanceid, err)\n\t}\n\treturn resp.Payload, nil\n}" ]
[ "0.75913084", "0.64905167", "0.6456979", "0.6426578", "0.641052", "0.63549984", "0.62398493", "0.6167122", "0.6133941", "0.5522241", "0.549942", "0.5448296", "0.53074896", "0.52958477", "0.5290606", "0.52563024", "0.5180518", "0.51742876", "0.5128644", "0.5117864", "0.510673", "0.509425", "0.50827104", "0.5076811", "0.5055654", "0.4999507", "0.49977916", "0.49851614", "0.49808365", "0.497334", "0.4969254", "0.4964504", "0.49568272", "0.4949294", "0.49192187", "0.49114922", "0.49066794", "0.48761246", "0.48758373", "0.48697183", "0.48644373", "0.48500043", "0.4844401", "0.48366416", "0.48180902", "0.48135138", "0.4806336", "0.47935474", "0.47856465", "0.47789946", "0.4776731", "0.47644722", "0.47406453", "0.47388723", "0.47191614", "0.47128844", "0.46997088", "0.46726763", "0.46635237", "0.4649437", "0.46413547", "0.46350002", "0.4634414", "0.46321708", "0.46268862", "0.46252784", "0.46150917", "0.45935443", "0.45932484", "0.4590036", "0.45877603", "0.45702833", "0.45648926", "0.45648235", "0.45623836", "0.4548893", "0.45479327", "0.45476413", "0.45401722", "0.4533012", "0.45314932", "0.45196238", "0.45121816", "0.45051017", "0.45043662", "0.45016152", "0.44907615", "0.44826293", "0.44817963", "0.44754088", "0.44730136", "0.4463281", "0.44554797", "0.44510648", "0.44425306", "0.44379646", "0.44353864", "0.44312787", "0.44310156", "0.44306105" ]
0.79741985
0
NewCloudAwsVirtualMachineAllOfWithDefaults instantiates a new CloudAwsVirtualMachineAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set
NewCloudAwsVirtualMachineAllOfWithDefaults создает новый объект CloudAwsVirtualMachineAllOf. Этот конструктор присваивает только значения по умолчанию свойствам, для которых они определены, но не гарантирует, что свойства, требуемые API, будут заданы.
func NewCloudAwsVirtualMachineAllOfWithDefaults() *CloudAwsVirtualMachineAllOf { this := CloudAwsVirtualMachineAllOf{} var classId string = "cloud.AwsVirtualMachine" this.ClassId = classId var objectType string = "cloud.AwsVirtualMachine" this.ObjectType = objectType return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewHyperflexVirtualMachineAllOfWithDefaults() *HyperflexVirtualMachineAllOf {\n\tthis := HyperflexVirtualMachineAllOf{}\n\tvar classId string = \"hyperflex.VirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"hyperflex.VirtualMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationVmwareVirtualMachineAllOfWithDefaults() *VirtualizationVmwareVirtualMachineAllOf {\n\tthis := VirtualizationVmwareVirtualMachineAllOf{}\n\tvar classId string = \"virtualization.VmwareVirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"virtualization.VmwareVirtualMachine\"\n\tthis.ObjectType = objectType\n\tvar guestState string = \"Unknown\"\n\tthis.GuestState = &guestState\n\treturn &this\n}", "func NewCloudInstanceTypeAllOfWithDefaults() *CloudInstanceTypeAllOf {\n\tthis := CloudInstanceTypeAllOf{}\n\tvar classId string = \"cloud.InstanceType\"\n\tthis.ClassId = classId\n\tvar objectType string = \"cloud.InstanceType\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewCloudAwsVirtualMachineAllOf(classId string, objectType string) *CloudAwsVirtualMachineAllOf {\n\tthis := CloudAwsVirtualMachineAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewIamServiceProviderAllOfWithDefaults() *IamServiceProviderAllOf {\n\tthis := IamServiceProviderAllOf{}\n\tvar classId string = \"iam.ServiceProvider\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.ServiceProvider\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationIweClusterAllOfWithDefaults() *VirtualizationIweClusterAllOf {\n\tthis := VirtualizationIweClusterAllOf{}\n\tvar classId string = \"virtualization.IweCluster\"\n\tthis.ClassId = classId\n\tvar objectType string = \"virtualization.IweCluster\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewComputeBladeIdentityAllOfWithDefaults() *ComputeBladeIdentityAllOf {\n\tthis := ComputeBladeIdentityAllOf{}\n\tvar classId string = \"compute.BladeIdentity\"\n\tthis.ClassId = classId\n\tvar objectType string = \"compute.BladeIdentity\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewHyperflexVmSnapshotInfoAllOfWithDefaults() *HyperflexVmSnapshotInfoAllOf {\n\tthis := HyperflexVmSnapshotInfoAllOf{}\n\tvar classId string = \"hyperflex.VmSnapshotInfo\"\n\tthis.ClassId = classId\n\tvar objectType string = \"hyperflex.VmSnapshotInfo\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationBaseHostPciDeviceAllOfWithDefaults() *VirtualizationBaseHostPciDeviceAllOf {\n\tthis := VirtualizationBaseHostPciDeviceAllOf{}\n\tvar classId string = \"virtualization.VmwareHostGpu\"\n\tthis.ClassId = classId\n\tvar objectType string = \"virtualization.VmwareHostGpu\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *CapacityPoolGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewInventoryBaseAllOfWithDefaults() *InventoryBaseAllOf {\n\tthis := InventoryBaseAllOf{}\n\treturn &this\n}", "func (o *PcloudNetworksGetallParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewHyperflexVirtualMachineAllOf(classId string, objectType string) *HyperflexVirtualMachineAllOf {\n\tthis := HyperflexVirtualMachineAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewVirtualizationVmwareVirtualMachineAllOf(classId string, objectType string) *VirtualizationVmwareVirtualMachineAllOf {\n\tthis := VirtualizationVmwareVirtualMachineAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\tvar guestState string = \"Unknown\"\n\tthis.GuestState = &guestState\n\treturn &this\n}", "func NewMacpoolPoolMemberAllOfWithDefaults() *MacpoolPoolMemberAllOf {\n\tthis := MacpoolPoolMemberAllOf{}\n\tvar classId string = \"macpool.PoolMember\"\n\tthis.ClassId = classId\n\tvar objectType string = \"macpool.PoolMember\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewUcsdBackupInfoAllOfWithDefaults() *UcsdBackupInfoAllOf {\n\tthis := UcsdBackupInfoAllOf{}\n\tvar classId string = \"ucsd.BackupInfo\"\n\tthis.ClassId = classId\n\tvar objectType string = \"ucsd.BackupInfo\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewMacpoolLeaseAllOfWithDefaults() *MacpoolLeaseAllOf {\n\tthis := MacpoolLeaseAllOf{}\n\tvar classId string = \"macpool.Lease\"\n\tthis.ClassId = classId\n\tvar objectType string = \"macpool.Lease\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageNetAppCloudTargetAllOfWithDefaults() *StorageNetAppCloudTargetAllOf {\n\tthis := StorageNetAppCloudTargetAllOf{}\n\tvar classId string = \"storage.NetAppCloudTarget\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.NetAppCloudTarget\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *PcloudCloudinstancesVolumesGetallParams) WithDefaults() *PcloudCloudinstancesVolumesGetallParams {\n\to.SetDefaults()\n\treturn o\n}", "func NewVmWithDefaults() *Vm {\n\tthis := Vm{}\n\treturn &this\n}", "func (o *GetOutagesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *GetGCParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *GetBlockGeneratorResultParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *ServiceBrokerOpenstacksHostsGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *QuerySensorUpdateKernelsDistinctParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewStorageSpaceAllOfWithDefaults() *StorageSpaceAllOf {\n\tthis := StorageSpaceAllOf{}\n\tvar classId string = \"storage.Space\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.Space\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (c *TestClusterGKE) Default() {\n\tif c.Name != \"\" { // avoid loging internal annonymous objects\n\t\tlog.Info(\"applying defaults\", \"name\", c.Name, \"namespace\", c.Namespace)\n\t}\n\n\tif c.Spec.Project == nil {\n\t\tc.Spec.Project = new(string)\n\t\t*c.Spec.Project = \"cilium-ci\"\n\t}\n\n\tif c.Spec.ConfigTemplate == nil {\n\t\tc.Spec.ConfigTemplate = new(string)\n\t\t*c.Spec.ConfigTemplate = \"basic\"\n\t}\n\n\tif c.Spec.Location == nil {\n\t\tc.Spec.Location = new(string)\n\t\t*c.Spec.Location = \"europe-west2-b\"\n\t}\n\n\tif c.Spec.Region == nil {\n\t\tc.Spec.Region = new(string)\n\t\t*c.Spec.Region = \"europe-west2\"\n\t}\n\n\tif c.Spec.JobSpec != nil {\n\t\tif c.Spec.JobSpec.Runner == nil {\n\t\t\tc.Spec.JobSpec.Runner = &TestClusterGKEJobRunnerSpec{}\n\t\t}\n\n\t\tif c.Spec.JobSpec.Runner.Image == nil {\n\t\t\tc.Spec.JobSpec.Runner.Image = new(string)\n\t\t\t*c.Spec.JobSpec.Runner.Image = \"quay.io/isovalent/gke-test-cluster-gcloud:803ff83d3786eb38ef05c95768060b0c7ae0fc4d\"\n\t\t}\n\n\t\tif c.Spec.JobSpec.Runner.InitImage == nil {\n\t\t\tc.Spec.JobSpec.Runner.InitImage = new(string)\n\t\t\t*c.Spec.JobSpec.Runner.InitImage = \"quay.io/isovalent/gke-test-cluster-initutil:854733411778d633350adfa1ae66bf11ba658a3f\"\n\t\t}\n\t}\n\n\tif c.Spec.MachineType == nil {\n\t\tc.Spec.MachineType = new(string)\n\t\t*c.Spec.MachineType = \"n1-standard-4\"\n\t}\n\n\tif c.Spec.Nodes == nil {\n\t\tc.Spec.Nodes = new(int)\n\t\t*c.Spec.Nodes = 2\n\t}\n}", "func NewStorageVdMemberEpAllOfWithDefaults() *StorageVdMemberEpAllOf {\n\tthis := StorageVdMemberEpAllOf{}\n\tvar classId string = \"storage.VdMemberEp\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.VdMemberEp\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewIamLdapBasePropertiesAllOfWithDefaults() *IamLdapBasePropertiesAllOf {\n\tthis := IamLdapBasePropertiesAllOf{}\n\tvar classId string = \"iam.LdapBaseProperties\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.LdapBaseProperties\"\n\tthis.ObjectType = objectType\n\tvar bindMethod string = \"LoginCredentials\"\n\tthis.BindMethod = &bindMethod\n\tvar nestedGroupSearchDepth int64 = 128\n\tthis.NestedGroupSearchDepth = &nestedGroupSearchDepth\n\tvar timeout int64 = 0\n\tthis.Timeout = &timeout\n\treturn &this\n}", "func NewStoragePhysicalDiskAllOfWithDefaults() *StoragePhysicalDiskAllOf {\n\tthis := StoragePhysicalDiskAllOf{}\n\tvar classId string = \"storage.PhysicalDisk\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.PhysicalDisk\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewSoftwarerepositoryLocalMachineAllOfWithDefaults() *SoftwarerepositoryLocalMachineAllOf {\n\tthis := SoftwarerepositoryLocalMachineAllOf{}\n\tvar classId string = \"softwarerepository.LocalMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"softwarerepository.LocalMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStorageHitachiPortAllOfWithDefaults() *StorageHitachiPortAllOf {\n\tthis := StorageHitachiPortAllOf{}\n\tvar classId string = \"storage.HitachiPort\"\n\tthis.ClassId = classId\n\tvar objectType string = \"storage.HitachiPort\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewEquipmentIdentityAllOfWithDefaults() *EquipmentIdentityAllOf {\n\tthis := EquipmentIdentityAllOf{}\n\tvar adminAction string = \"None\"\n\tthis.AdminAction = &adminAction\n\treturn &this\n}", "func (o *ListMachineDeploymentNodesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewMetricsAllOfWithDefaults() *MetricsAllOf {\n\tthis := MetricsAllOf{}\n\treturn &this\n}", "func setPropertiesDefaults(vm *api.APIModel) {\n\tif len(vm.Properties.VMProfile.Name) == 0 {\n\t\tlog.Warnf(\"Missing VM Name. Setting to %s\", vm.VMConfigurator.DefaultVMName())\n\t\tvm.Properties.VMProfile.Name = vm.VMConfigurator.DefaultVMName()\n\t}\n\t// set network defaults\n\tif vm.Properties.VnetProfile == nil {\n\t\tvm.Properties.VnetProfile = &api.VnetProfile{}\n\t}\n\tif !vm.Properties.VnetProfile.IsCustomVNET() {\n\t\tif len(vm.Properties.VnetProfile.VnetAddress) == 0 {\n\t\t\tvm.Properties.VnetProfile.VnetAddress = api.DefaultVnet\n\t\t}\n\t\tif len(vm.Properties.VnetProfile.SubnetAddress) == 0 {\n\t\t\tvm.Properties.VnetProfile.SubnetAddress = api.DefaultSubnet\n\t\t}\n\t}\n\tif len(vm.Properties.VMProfile.OSDiskType) == 0 {\n\t\tvm.Properties.VMProfile.OSDiskType = vm.VMConfigurator.DefaultOsDiskType()\n\t}\n\tif(vm.Properties.VMProfile.SecurityProfile == nil) {\n\t\tvm.Properties.VMProfile.SecurityProfile = &api.SecurityProfile{ \"true\",\"true\"}\n\t}\telse {\n\t\t\tif len(vm.Properties.VMProfile.SecurityProfile.SecureBoot) == 0 {\n\t\t\t\tvm.Properties.VMProfile.SecurityProfile.SecureBoot = \"true\"\n\t\t\t}\t\n\t\t\tif len(vm.Properties.VMProfile.SecurityProfile.VTPM) == 0 {\n\t\t\t\tvm.Properties.VMProfile.SecurityProfile.VTPM = \"true\"\n\t\t\t}\n\t\t\tif (vm.Properties.VMProfile.SecurityProfile.SecureBoot == \"none\") {\n\t\t\t\tvm.Properties.VMProfile.SecurityProfile = nil\n\t\t\t} \n\t}\n}", "func getDefaults(resourceType voyager.ResourceType, location voyager.ClusterLocation) map[string]interface{} {\n\tswitch resourceType {\n\tcase voyager.ResourceType(\"DynamoDB\"):\n\t\treturn map[string]interface{}{\n\t\t\t\"BackupPeriod\": \"1 hours\",\n\t\t}\n\tcase voyager.ResourceType(\"KubeCompute\"):\n\t\tvar minReplicas int32\n\t\tswitch location.EnvType {\n\t\tcase voyager.EnvTypeProduction, voyager.EnvTypeStaging:\n\t\t\tminReplicas = defaultKubeComputeMinReplicasProd\n\t\tdefault:\n\t\t\tminReplicas = defaultKubeComputeMinReplicas\n\t\t}\n\t\treturn map[string]interface{}{\n\t\t\t\"Scaling\": map[string]interface{}{\n\t\t\t\t\"MinReplicas\": minReplicas,\n\t\t\t\t\"MaxReplicas\": defaultKubeComputeMaxReplicas,\n\t\t\t\t\"Metrics\": []map[string]interface{}{\n\t\t\t\t\t{\n\t\t\t\t\t\t\"Type\": \"Resource\",\n\t\t\t\t\t\t\"Resource\": map[string]interface{}{\n\t\t\t\t\t\t\t\"Name\": \"cpu\",\n\t\t\t\t\t\t\t\"TargetAverageUtilization\": defaultKubeComputeResourceMetricTargetUtilization,\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\t\"Container\": map[string]interface{}{\n\t\t\t\t\"ImagePullPolicy\": defaultKubeComputeImagePullPolicy,\n\t\t\t\t\"LivenessProbe\": map[string]interface{}{\n\t\t\t\t\t\"TimeoutSeconds\": defaultKubeComputeProbeTimeoutSeconds,\n\t\t\t\t\t\"PeriodSeconds\": defaultKubeComputeProbePeriodSeconds,\n\t\t\t\t\t\"SuccessThreshold\": defaultKubeComputeProbeSuccessThreshold,\n\t\t\t\t\t\"FailureThreshold\": defaultKubeComputeProbeFailureThreshold,\n\t\t\t\t\t\"HTTPGet\": map[string]interface{}{\n\t\t\t\t\t\t\"Path\": defaultKubeComputeHTTPGetPath,\n\t\t\t\t\t\t\"Scheme\": defaultKubeComputeHTTPGetScheme,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"ReadinessProbe\": map[string]interface{}{\n\t\t\t\t\t\"TimeoutSeconds\": defaultKubeComputeProbeTimeoutSeconds,\n\t\t\t\t\t\"PeriodSeconds\": defaultKubeComputeProbePeriodSeconds,\n\t\t\t\t\t\"SuccessThreshold\": defaultKubeComputeProbeSuccessThreshold,\n\t\t\t\t\t\"FailureThreshold\": defaultKubeComputeProbeFailureThreshold,\n\t\t\t\t\t\"HTTPGet\": map[string]interface{}{\n\t\t\t\t\t\t\"Path\": defaultKubeComputeHTTPGetPath,\n\t\t\t\t\t\t\"Scheme\": defaultKubeComputeHTTPGetScheme,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"Resources\": map[string]interface{}{\n\t\t\t\t\t\"Requests\": map[string]interface{}{\n\t\t\t\t\t\t\"cpu\": defaultKubeComputeResourceRequestCPU,\n\t\t\t\t\t\t\"memory\": defaultKubeComputeResourceRequestMemory,\n\t\t\t\t\t},\n\t\t\t\t\t\"Limits\": map[string]interface{}{\n\t\t\t\t\t\t\"cpu\": defaultKubeComputeResourceLimitCPU,\n\t\t\t\t\t\t\"memory\": defaultKubeComputeResourceLimitMemory,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"Port\": map[string]interface{}{\n\t\t\t\t\"Protocol\": defaultKubeComputeProtocol,\n\t\t\t},\n\t\t}\n\tcase voyager.ResourceType(\"KubeIngress\"):\n\t\treturn map[string]interface{}{\n\t\t\t\"timeoutSeconds\": 60,\n\t\t}\n\tdefault:\n\t\treturn map[string]interface{}{}\n\t}\n\n}", "func (o *GetBackupLocationsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewMemoryArrayAllOfWithDefaults() *MemoryArrayAllOf {\n\tthis := MemoryArrayAllOf{}\n\tvar classId string = \"memory.Array\"\n\tthis.ClassId = classId\n\tvar objectType string = \"memory.Array\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *GetGPUArchitectureParams) SetDefaults() {\n\tvar (\n\t\tallowUnstableDefault = bool(false)\n\t)\n\n\tval := GetGPUArchitectureParams{\n\t\tAllowUnstable: &allowUnstableDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func NewPipelineSshKeyPairAllOfWithDefaults() *PipelineSshKeyPairAllOf {\n\tthis := PipelineSshKeyPairAllOf{}\n\treturn &this\n}", "func NewDefault() *Config {\n\tname := fmt.Sprintf(\"ec2-%s-%s\", getTS()[:10], randutil.String(12))\n\tif v := os.Getenv(AWS_K8S_TESTER_EC2_PREFIX + \"NAME\"); v != \"\" {\n\t\tname = v\n\t}\n\treturn &Config{\n\t\tmu: new(sync.RWMutex),\n\n\t\tUp: false,\n\t\tDeletedResources: make(map[string]string),\n\n\t\tName: name,\n\t\tPartition: endpoints.AwsPartitionID,\n\t\tRegion: endpoints.UsWest2RegionID,\n\n\t\t// to be auto-generated\n\t\tConfigPath: \"\",\n\t\tRemoteAccessCommandsOutputPath: \"\",\n\n\t\tLogColor: true,\n\t\tLogColorOverride: \"\",\n\n\t\tLogLevel: logutil.DefaultLogLevel,\n\t\t// default, stderr, stdout, or file name\n\t\t// log file named with cluster name will be added automatically\n\t\tLogOutputs: []string{\"stderr\"},\n\n\t\tOnFailureDelete: true,\n\t\tOnFailureDeleteWaitSeconds: 120,\n\n\t\tS3: getDefaultS3(),\n\t\tRole: getDefaultRole(),\n\t\tVPC: getDefaultVPC(),\n\t\tRemoteAccessKeyCreate: true,\n\t\tRemoteAccessPrivateKeyPath: filepath.Join(os.TempDir(), randutil.String(10)+\".insecure.key\"),\n\n\t\tASGsFetchLogs: true,\n\t\tASGs: map[string]ASG{\n\t\t\tname + \"-asg\": {\n\t\t\t\tName: name + \"-asg\",\n\t\t\t\tSSM: &SSM{\n\t\t\t\t\tDocumentCreate: false,\n\t\t\t\t\tDocumentName: \"\",\n\t\t\t\t\tDocumentCommands: \"\",\n\t\t\t\t\tDocumentExecutionTimeoutSeconds: 3600,\n\t\t\t\t},\n\t\t\t\tRemoteAccessUserName: \"ec2-user\", // for AL2\n\t\t\t\tAMIType: AMITypeAL2X8664,\n\t\t\t\tImageID: \"\",\n\t\t\t\tImageIDSSMParameter: \"/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2\",\n\t\t\t\tInstanceType: DefaultNodeInstanceTypeCPU,\n\t\t\t\tVolumeSize: DefaultNodeVolumeSize,\n\t\t\t\tASGMinSize: 1,\n\t\t\t\tASGMaxSize: 1,\n\t\t\t\tASGDesiredCapacity: 1,\n\t\t\t},\n\t\t},\n\t}\n}", "func NewOsInstallAllOfWithDefaults() *OsInstallAllOf {\n\tthis := OsInstallAllOf{}\n\tvar classId string = \"os.Install\"\n\tthis.ClassId = classId\n\tvar objectType string = \"os.Install\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewNiatelemetryEqptcapacityPolUsage5minAllOfWithDefaults() *NiatelemetryEqptcapacityPolUsage5minAllOf {\n\tthis := NiatelemetryEqptcapacityPolUsage5minAllOf{}\n\tvar classId string = \"niatelemetry.EqptcapacityPolUsage5min\"\n\tthis.ClassId = classId\n\tvar objectType string = \"niatelemetry.EqptcapacityPolUsage5min\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewCloudInstanceTypeAllOf(classId string, objectType string) *CloudInstanceTypeAllOf {\n\tthis := CloudInstanceTypeAllOf{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *GetCurrentGenerationParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *ServiceInstanceGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewDefault() *instance {\n\treturn New(\n\t\t[]factory.Contract{\n\t\t\texampleMetadataFactory.New(),\n\t\t\tiotaMetadataFactory.New(),\n\t\t\tipfsMetadataFactory.New(),\n\t\t},\n\t)\n}", "func (o *ApplicationComponentSnapshotCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := ApplicationComponentSnapshotCollectionGetParams{\n\t\tReturnRecords: &returnRecordsDefault,\n\t\tReturnTimeout: &returnTimeoutDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func (o *TestEndpointParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *StorageServiceOwnershipGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *BulkStartCPUGeneratorsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *CreateIscsiLunSnapshotParams) SetDefaults() {\n\tvar (\n\t\tcontentLanguageDefault = string(\"en-US\")\n\t)\n\n\tval := CreateIscsiLunSnapshotParams{\n\t\tContentLanguage: &contentLanguageDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func (o *SetUniverseBackupFlagParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *BucketsCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := BucketsCollectionGetParams{\n\t\tReturnRecords: &returnRecordsDefault,\n\t\tReturnTimeout: &returnTimeoutDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func NewTimedZoneRangeAllOfWithDefaults() *TimedZoneRangeAllOf {\n\tthis := TimedZoneRangeAllOf{}\n\treturn &this\n}", "func (o *MetroclusterInterconnectGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (bc *BouncerCreate) defaults() {\n\tif _, ok := bc.mutation.CreatedAt(); !ok {\n\t\tv := bouncer.DefaultCreatedAt()\n\t\tbc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := bc.mutation.UpdatedAt(); !ok {\n\t\tv := bouncer.DefaultUpdatedAt()\n\t\tbc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := bc.mutation.IPAddress(); !ok {\n\t\tv := bouncer.DefaultIPAddress\n\t\tbc.mutation.SetIPAddress(v)\n\t}\n\tif _, ok := bc.mutation.Until(); !ok {\n\t\tv := bouncer.DefaultUntil()\n\t\tbc.mutation.SetUntil(v)\n\t}\n\tif _, ok := bc.mutation.LastPull(); !ok {\n\t\tv := bouncer.DefaultLastPull()\n\t\tbc.mutation.SetLastPull(v)\n\t}\n\tif _, ok := bc.mutation.AuthType(); !ok {\n\t\tv := bouncer.DefaultAuthType\n\t\tbc.mutation.SetAuthType(v)\n\t}\n}", "func (o *AddOrUpdateNodePoolConfigItemParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *EstimateCoinSellAllParams) SetDefaults() {\n\tvar (\n\t\tgasPriceDefault = uint64(1)\n\n\t\tswapFromDefault = string(\"optimal\")\n\t)\n\n\tval := EstimateCoinSellAllParams{\n\t\tGasPrice: &gasPriceDefault,\n\t\tSwapFrom: &swapFromDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func NewJsonWireguardInterfaceAllOfWithDefaults() *JsonWireguardInterfaceAllOf {\n\tthis := JsonWireguardInterfaceAllOf{}\n\treturn &this\n}", "func (o *GetRackTopoesParams) SetDefaults() {\n\tvar (\n\t\tcontentLanguageDefault = string(\"en-US\")\n\t)\n\n\tval := GetRackTopoesParams{\n\t\tContentLanguage: &contentLanguageDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func (o *VectorThumbnailParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewInfraBasePciConfigurationAllOfWithDefaults() *InfraBasePciConfigurationAllOf {\n\tthis := InfraBasePciConfigurationAllOf{}\n\treturn &this\n}", "func (o *PetCreateParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *GetPropertyDescriptorParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewProdutoVMWithDefaults() *ProdutoVM {\n\tthis := ProdutoVM{}\n\treturn &this\n}", "func (o *PcloudSapGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *ListSSHKeysParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *RegenerateDeployKeyParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *BaseEdgeLBPoolSpec) setDefaults() {\n\t// Set defaults for for pure dklb functionality.\n\tif o.CloudProviderConfiguration == nil {\n\t\to.CloudProviderConfiguration = pointers.NewString(\"\")\n\t}\n\tif o.CPUs == nil {\n\t\to.CPUs = &DefaultEdgeLBPoolCpus\n\t}\n\tif o.Memory == nil {\n\t\to.Memory = &DefaultEdgeLBPoolMemory\n\t}\n\tif o.Name == nil {\n\t\to.Name = pointers.NewString(newRandomEdgeLBPoolName(\"\"))\n\t}\n\tif o.Role == nil {\n\t\to.Role = pointers.NewString(DefaultEdgeLBPoolRole)\n\t}\n\tif o.Network == nil && *o.Role == constants.EdgeLBRolePublic {\n\t\to.Network = pointers.NewString(constants.EdgeLBHostNetwork)\n\t}\n\tif o.Network == nil && *o.Role != constants.EdgeLBRolePublic {\n\t\to.Network = pointers.NewString(constants.DefaultDCOSVirtualNetworkName)\n\t}\n\tif o.Size == nil {\n\t\to.Size = pointers.NewInt32(int32(DefaultEdgeLBPoolSize))\n\t}\n\tif o.Strategies == nil {\n\t\to.Strategies = &EdgeLBPoolManagementStrategies{\n\t\t\tCreation: &DefaultEdgeLBPoolCreationStrategy,\n\t\t}\n\t}\n\t// Check whether cloud-provider configuration is being specified, and override the defaults where necessary.\n\tif *o.CloudProviderConfiguration != \"\" {\n\t\t// If the target EdgeLB pool's name doesn't start with the prefix used for cloud-provider pools, we generate a new name using that prefix.\n\t\tif !strings.HasPrefix(*o.Name, constants.EdgeLBCloudProviderPoolNamePrefix) {\n\t\t\to.Name = pointers.NewString(newRandomEdgeLBPoolName(constants.EdgeLBCloudProviderPoolNamePrefix))\n\t\t}\n\t\t// If the target EdgeLB pool's network is not the host network, we override it.\n\t\tif *o.Network != constants.EdgeLBHostNetwork {\n\t\t\to.Network = pointers.NewString(constants.EdgeLBHostNetwork)\n\t\t}\n\t}\n}", "func defaultOptions() interface{} {\n\to := &options{}\n\n\ttype param struct {\n\t\tdefval string\n\t\tparsefn func(string) error\n\t}\n\n\tparams := map[string]param{\n\t\t\"JAEGER_COLLECTOR\": {\n\t\t\tdefaultJaegerCollector,\n\t\t\tfunc(v string) error { o.JaegerCollector = v; return nil },\n\t\t},\n\t\t\"JAEGER_AGENT\": {\n\t\t\tdefaultJaegerAgent,\n\t\t\tfunc(v string) error { o.JaegerAgent = v; return nil },\n\t\t},\n\t\t\"HTTP_ENDPOINT\": {\n\t\t\tdefaultHTTPEndpoint,\n\t\t\tfunc(v string) error { o.HTTPEndpoint = v; return nil },\n\t\t},\n\t\t\"PROMETHEUS_EXPORT\": {\n\t\t\tdefaultPrometheusExport,\n\t\t\tfunc(v string) error {\n\t\t\t\tenabled, err := utils.ParseEnabled(v)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\to.PrometheusExport = enabled\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t\"SAMPLING_FREQUENCY\": {\n\t\t\tdefaultSampling,\n\t\t\tfunc(v string) error { return o.Sampling.Parse(v) },\n\t\t},\n\t\t\"REPORT_PERIOD\": {\n\t\t\tdefaultReportPeriod,\n\t\t\tfunc(v string) error {\n\t\t\t\td, err := time.ParseDuration(v)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\to.ReportPeriod = d\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t}\n\n\tfor envvar, p := range params {\n\t\tparseEnv(envvar, p.defval, p.parsefn)\n\t}\n\n\treturn o\n}", "func NewIamLdapProviderAllOfWithDefaults() *IamLdapProviderAllOf {\n\tthis := IamLdapProviderAllOf{}\n\tvar classId string = \"iam.LdapProvider\"\n\tthis.ClassId = classId\n\tvar objectType string = \"iam.LdapProvider\"\n\tthis.ObjectType = objectType\n\tvar port int64 = 389\n\tthis.Port = &port\n\treturn &this\n}", "func (o *ConfigurationBackupGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewDefaultOptions() Options {\n\treturn Options{\n\t\tFilesInCollection: 10,\n\t\tGasPrice: \"\",\n\t\tMaxPathnameLength: 64,\n\t\tPostageAmount: 1,\n\t\tPostageDepth: 16,\n\t\tPostageLabel: \"test-label\",\n\t\tPostageWait: 5 * time.Second,\n\t\tSeed: 0,\n\t}\n}", "func (o *PcloudIkepoliciesPutParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewDeviceMetricsAllOfWithDefaults() *DeviceMetricsAllOf {\n\tthis := DeviceMetricsAllOf{}\n\treturn &this\n}", "func (o *BatchUpsertCatalogObjectsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o *PostHostStorageSectorsDeleteMerklerootParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewConnectorTypeAllOfWithDefaults() *ConnectorTypeAllOf {\n\tthis := ConnectorTypeAllOf{}\n\n\n\n\n\n\n\n\n\treturn &this\n}", "func NewPrinterDefaults()(*PrinterDefaults) {\n m := &PrinterDefaults{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "func (o *GetBundleByKeyParams) SetDefaults() {\n\tvar (\n\t\tauditDefault = string(\"NONE\")\n\n\t\tincludedDeletedDefault = bool(false)\n\t)\n\n\tval := GetBundleByKeyParams{\n\t\tAudit: &auditDefault,\n\t\tIncludedDeleted: &includedDeletedDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func (o *PcloudV1CloudinstancesCosimagesPostParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewFcNeighborAllOfWithDefaults() *FcNeighborAllOf {\n\tthis := FcNeighborAllOf{}\n\tvar classId string = \"fc.Neighbor\"\n\tthis.ClassId = classId\n\tvar objectType string = \"fc.Neighbor\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func NewStackpathRpcLocalizedMessageAllOfWithDefaults() *StackpathRpcLocalizedMessageAllOf {\n\tthis := StackpathRpcLocalizedMessageAllOf{}\n\treturn &this\n}", "func NewConnectorXmlApiMessageAllOfWithDefaults() *ConnectorXmlApiMessageAllOf {\n\tthis := ConnectorXmlApiMessageAllOf{}\n\tvar classId string = \"connector.XmlApiMessage\"\n\tthis.ClassId = classId\n\tvar objectType string = \"connector.XmlApiMessage\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func (o *GetIngredientVersionRevisionParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (cc *ConstructionCreate) defaults() {\n\tif _, ok := cc.mutation.RawProduction(); !ok {\n\t\tv := construction.DefaultRawProduction\n\t\tcc.mutation.SetRawProduction(v)\n\t}\n\tif _, ok := cc.mutation.Production(); !ok {\n\t\tv := construction.DefaultProduction\n\t\tcc.mutation.SetProduction(v)\n\t}\n\tif _, ok := cc.mutation.GetType(); !ok {\n\t\tv := construction.DefaultType\n\t\tcc.mutation.SetType(v)\n\t}\n\tif _, ok := cc.mutation.Level(); !ok {\n\t\tv := construction.DefaultLevel\n\t\tcc.mutation.SetLevel(v)\n\t}\n\tif _, ok := cc.mutation.Modifier(); !ok {\n\t\tv := construction.DefaultModifier\n\t\tcc.mutation.SetModifier(v)\n\t}\n\tif _, ok := cc.mutation.LastUpdated(); !ok {\n\t\tv := construction.DefaultLastUpdated()\n\t\tcc.mutation.SetLastUpdated(v)\n\t}\n\tif _, ok := cc.mutation.NeedRefresh(); !ok {\n\t\tv := construction.DefaultNeedRefresh\n\t\tcc.mutation.SetNeedRefresh(v)\n\t}\n}", "func DefaultParams() *Params {\n\tp := Params{\n\t\tKeyLength: 512,\n\t\tInternalSaltLength: 256,\n\t\tExternalSaltLength: 256,\n\t\tArgon2Memory: 64 * 1024,\n\t\tArgon2Iterations: 3,\n\t\tArgon2Parallelism: 4}\n\treturn &p\n}", "func NewVulnUpdateNotificationPayloadAllOfWithDefaults() *VulnUpdateNotificationPayloadAllOf {\n\tthis := VulnUpdateNotificationPayloadAllOf{}\n\treturn &this\n}", "func (pc *PetCreate) defaults() {\n\tif _, ok := pc.mutation.Age(); !ok {\n\t\tv := pet.DefaultAge\n\t\tpc.mutation.SetAge(v)\n\t}\n\tif _, ok := pc.mutation.Trained(); !ok {\n\t\tv := pet.DefaultTrained\n\t\tpc.mutation.SetTrained(v)\n\t}\n}", "func setDefaultValues() {\n\tviper.SetDefault(constant.RESOURCE_FILES_MANDATORY, util.ResourceFiles_Mandatory)\n\tviper.SetDefault(constant.RESOURCE_FILES_OPTIONAL, util.ResourceFiles_Optional)\n\tviper.SetDefault(constant.RESOURCE_FILES_SKIP, util.ResourceFiles_Skip)\n\tviper.SetDefault(constant.PLATFORM_VERSIONS, util.PlatformVersions)\n}", "func (o *GetKeyBlockByHeightParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (vc *VehicleCreate) defaults() error {\n\tif _, ok := vc.mutation.CreatedAt(); !ok {\n\t\tif vehicle.DefaultCreatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized vehicle.DefaultCreatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := vehicle.DefaultCreatedAt()\n\t\tvc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := vc.mutation.UpdatedAt(); !ok {\n\t\tif vehicle.DefaultUpdatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized vehicle.DefaultUpdatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := vehicle.DefaultUpdatedAt()\n\t\tvc.mutation.SetUpdatedAt(v)\n\t}\n\treturn nil\n}", "func NewConnectorTypeAllOfWithDefaults() *ConnectorTypeAllOf {\n\tthis := ConnectorTypeAllOf{}\n\treturn &this\n}", "func NewGetMessagesAllOfWithDefaults() *GetMessagesAllOf {\n\tthis := GetMessagesAllOf{}\n\treturn &this\n}", "func (mi *MinIOInstance) EnsureDefaults() *MinIOInstance {\n\tif mi.Spec.Replicas == 0 {\n\t\tmi.Spec.Replicas = constants.DefaultReplicas\n\t}\n\n\tif mi.Spec.PodManagementPolicy == \"\" || (mi.Spec.PodManagementPolicy != appsv1.OrderedReadyPodManagement &&\n\t\tmi.Spec.PodManagementPolicy != appsv1.ParallelPodManagement) {\n\t\tmi.Spec.PodManagementPolicy = constants.DefaultPodManagementPolicy\n\t}\n\n\tif mi.Spec.Image == \"\" {\n\t\tmi.Spec.Image = constants.DefaultMinIOImage\n\t}\n\n\tif mi.Spec.Mountpath == \"\" {\n\t\tmi.Spec.Mountpath = constants.MinIOVolumeMountPath\n\t} else {\n\t\t// Ensure there is no trailing `/`\n\t\tmi.Spec.Mountpath = path.Clean(mi.Spec.Mountpath)\n\t}\n\n\tif mi.Spec.Subpath == \"\" {\n\t\tmi.Spec.Subpath = constants.MinIOVolumeSubPath\n\t} else {\n\t\t// Ensure there is no `/` in beginning\n\t\tmi.Spec.Subpath = path.Clean(mi.Spec.Subpath)\n\t}\n\n\tif mi.RequiresAutoCertSetup() == true {\n\t\tif mi.Spec.CertConfig != nil {\n\t\t\tif mi.Spec.CertConfig.CommonName == \"\" {\n\t\t\t\tmi.Spec.CertConfig.CommonName = mi.GetWildCardName()\n\t\t\t}\n\t\t\tif mi.Spec.CertConfig.DNSNames == nil {\n\t\t\t\tmi.Spec.CertConfig.DNSNames = mi.GetHosts()\n\t\t\t}\n\t\t\tif mi.Spec.CertConfig.OrganizationName == nil {\n\t\t\t\tmi.Spec.CertConfig.OrganizationName = constants.DefaultOrgName\n\t\t\t}\n\t\t} else {\n\t\t\tmi.Spec.CertConfig = &CertificateConfig{\n\t\t\t\tCommonName: mi.GetWildCardName(),\n\t\t\t\tDNSNames: mi.GetHosts(),\n\t\t\t\tOrganizationName: constants.DefaultOrgName,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn mi\n}", "func NewDefaults() map[string]interface{} {\n\tdefaults := make(map[string]interface{})\n\n\tdefaults[authPostgresURI] = \"postgresql://postgres:postgres@localhost:5432/test?sslmode=disable\"\n\tdefaults[authMigrationVersion] = 0\n\n\tdefaults[gatewayAddr] = \":10000\"\n\tdefaults[gatewayEndpoint] = \"/graphql\"\n\tdefaults[gatewayServePlayground] = true\n\tdefaults[gatewayPlaygroundEndpoint] = \"/playground\"\n\tdefaults[gatewayEnableIntrospection] = true\n\n\tdefaults[seedUserLogin] = \"root\"\n\tdefaults[seedUserPassword] = \"root\"\n\tdefaults[seedRoleTitle] = \"ROOT\"\n\tdefaults[seedRoleSuper] = true\n\n\tdefaults[sessionAccessTokenTTL] = 1000000\n\tdefaults[sessionRefreshTokenTTl] = 5000000\n\n\treturn defaults\n}", "func newDefaultConfig() *Config {\n\treturn &Config{\n\t\tcpuidConfig{\n\t\t\tAttributeBlacklist: []string{\n\t\t\t\t\"BMI1\",\n\t\t\t\t\"BMI2\",\n\t\t\t\t\"CLMUL\",\n\t\t\t\t\"CMOV\",\n\t\t\t\t\"CX16\",\n\t\t\t\t\"ERMS\",\n\t\t\t\t\"F16C\",\n\t\t\t\t\"HTT\",\n\t\t\t\t\"LZCNT\",\n\t\t\t\t\"MMX\",\n\t\t\t\t\"MMXEXT\",\n\t\t\t\t\"NX\",\n\t\t\t\t\"POPCNT\",\n\t\t\t\t\"RDRAND\",\n\t\t\t\t\"RDSEED\",\n\t\t\t\t\"RDTSCP\",\n\t\t\t\t\"SGX\",\n\t\t\t\t\"SGXLC\",\n\t\t\t\t\"SSE\",\n\t\t\t\t\"SSE2\",\n\t\t\t\t\"SSE3\",\n\t\t\t\t\"SSE4\",\n\t\t\t\t\"SSE42\",\n\t\t\t\t\"SSSE3\",\n\t\t\t\t\"TDX_GUEST\",\n\t\t\t},\n\t\t\tAttributeWhitelist: []string{},\n\t\t},\n\t}\n}" ]
[ "0.7302019", "0.7197099", "0.6901963", "0.68930364", "0.66952777", "0.6453485", "0.61395067", "0.610039", "0.6019124", "0.59342843", "0.58286214", "0.5814285", "0.5803453", "0.57177156", "0.5695191", "0.5685849", "0.56805533", "0.55701065", "0.5556591", "0.5554377", "0.554983", "0.55348796", "0.5529891", "0.55236274", "0.54951304", "0.54890466", "0.5485708", "0.54798937", "0.547037", "0.5465841", "0.5458894", "0.54418397", "0.5434383", "0.54328316", "0.5425084", "0.5423401", "0.5416874", "0.54041237", "0.53937995", "0.53872496", "0.5375797", "0.5363447", "0.53608626", "0.53507286", "0.53411865", "0.5326626", "0.5317816", "0.53177965", "0.53141475", "0.5311757", "0.5304698", "0.5297976", "0.52914065", "0.52822065", "0.52666634", "0.5264707", "0.5258281", "0.5238145", "0.5215435", "0.5215152", "0.52118737", "0.52103496", "0.52056456", "0.5190452", "0.51862794", "0.5185352", "0.5182437", "0.5180276", "0.51716185", "0.5170789", "0.51697195", "0.51661026", "0.51615006", "0.5154931", "0.5146658", "0.51458174", "0.5141235", "0.5140623", "0.5137002", "0.51335716", "0.5124626", "0.51209307", "0.5113873", "0.5102435", "0.50961214", "0.50884444", "0.5087373", "0.5071881", "0.5071763", "0.50664806", "0.5065079", "0.50626856", "0.506101", "0.5059364", "0.5058327", "0.50546014", "0.50517994", "0.5040439", "0.5038305", "0.50263375" ]
0.8176324
0
GetAwsBillingUnit returns the AwsBillingUnit field value if set, zero value otherwise.
GetAwsBillingUnit возвращает значение поля AwsBillingUnit, если оно задано, иначе возвращает нулевое значение.
func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnit() CloudAwsBillingUnitRelationship { if o == nil || o.AwsBillingUnit == nil { var ret CloudAwsBillingUnitRelationship return ret } return *o.AwsBillingUnit }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) SetAwsBillingUnit(v CloudAwsBillingUnitRelationship) {\n\to.AwsBillingUnit = &v\n}", "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnitOk() (*CloudAwsBillingUnitRelationship, bool) {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AwsBillingUnit, true\n}", "func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool {\n\tif o != nil && o.AwsBillingUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (c *bytemarkClient) GetBillingEndpoint() string {\n\treturn c.urls.Billing\n}", "func (m NoSides) GetBookingUnit() (v enum.BookingUnit, err quickfix.MessageRejectError) {\n\tvar f field.BookingUnitField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "func (o *DataExportQuery) GetUnit() string {\n\tif o == nil || o.Unit == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Unit\n}", "func (o *GetRecipeInformation200ResponseExtendedIngredientsInner) GetUnit() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Unit\n}", "func (o *Organization) GetBillingEmail() string {\n\tif o == nil || o.BillingEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.BillingEmail\n}", "func (o ElastigroupScalingUpPolicyOutput) Unit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ElastigroupScalingUpPolicy) *string { return v.Unit }).(pulumi.StringPtrOutput)\n}", "func GetEstimatedBilling(sess *session.Session, startTime, endTime time.Time) (latest float64, average float64) {\n\tsvc := cloudwatch.New(sess)\n\n\t// fmt.Println(\"Start time: \", startTime)\n\t// fmt.Println(\"End time: \", endTime)\n\n\tparams := &cloudwatch.GetMetricStatisticsInput{\n\t\tNamespace: aws.String(\"AWS/Billing\"),\n\t\tStartTime: aws.Time(startTime),\n\t\tEndTime: aws.Time(endTime),\n\t\tMetricName: aws.String(\"EstimatedCharges\"),\n\t\tPeriod: aws.Int64(86400),\n\t\tStatistics: []*string{\n\t\t\taws.String(\"Maximum\"),\n\t\t},\n\t\tDimensions: []*cloudwatch.Dimension{\n\t\t\t{\n\t\t\t\tName: aws.String(\"Currency\"),\n\t\t\t\tValue: aws.String(\"USD\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tresp, err := svc.GetMetricStatistics(params)\n\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn 0, 0\n\t}\n\n\tjsonBody, _ := json.Marshal(resp)\n\n\tvar result result\n\tjson.Unmarshal(jsonBody, &result)\n\tsort.Sort(result.Datapoints)\n\n\t// fmt.Println(\"Billing Datapoints:\", result.Datapoints)\n\n\tif len(result.Datapoints) > 0 {\n\t\tlatest = result.Datapoints[0].Maximum\n\t\tlength := len(result.Datapoints)\n\t\taverage = result.Datapoints[0].Maximum / float64(length)\n\t}\n\treturn\n}", "func (m *MarketplacePlan) GetUnitName() string {\n\tif m == nil || m.UnitName == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UnitName\n}", "func (_options *ImportAccountToEnterpriseOptions) SetBillingUnitID(billingUnitID string) *ImportAccountToEnterpriseOptions {\n\t_options.BillingUnitID = core.StringPtr(billingUnitID)\n\treturn _options\n}", "func getAwsRegion() (region string) {\n\tregion, _ = getAwsRegionE()\n\treturn\n}", "func (o ClusterNodeGroupSubscriptionConfigOutput) PaymentDurationUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeGroupSubscriptionConfig) string { return v.PaymentDurationUnit }).(pulumi.StringOutput)\n}", "func (o ClusterSubscriptionConfigOutput) PaymentDurationUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterSubscriptionConfig) string { return v.PaymentDurationUnit }).(pulumi.StringOutput)\n}", "func (m *MarketplacePurchase) GetUnitCount() int {\n\tif m == nil || m.UnitCount == nil {\n\t\treturn 0\n\t}\n\treturn *m.UnitCount\n}", "func (o *EnvironmentUsageDto) GetSyntheticBillingUsage() []SyntheticBillingUsageDto {\n\tif o == nil || o.SyntheticBillingUsage == nil {\n\t\tvar ret []SyntheticBillingUsageDto\n\t\treturn ret\n\t}\n\treturn *o.SyntheticBillingUsage\n}", "func (o *GetRecipeInformation200ResponseExtendedIngredientsInner) SetUnit(v string) {\n\to.Unit = v\n}", "func (o MrScalarCoreScalingUpPolicyOutput) Unit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarCoreScalingUpPolicy) string { return v.Unit }).(pulumi.StringOutput)\n}", "func (o *AdminInfo) GetBusinessUnit() BusinessUnit {\n\tif o == nil || o.BusinessUnit == nil {\n\t\tvar ret BusinessUnit\n\t\treturn ret\n\t}\n\treturn *o.BusinessUnit\n}", "func getAWSRegion(s3Bucket string, config *aws.Config, settings map[string]string) (string, error) {\n\tif region, ok := settings[RegionSetting]; ok {\n\t\treturn region, nil\n\t}\n\tif config.Endpoint == nil ||\n\t\t*config.Endpoint == \"\" ||\n\t\tstrings.HasSuffix(*config.Endpoint, \".amazonaws.com\") {\n\t\tregion, err := findBucketRegion(s3Bucket, config)\n\t\treturn region, errors.Wrapf(err, \"%s is not set and s3:GetBucketLocation failed\", RegionSetting)\n\t} else {\n\t\t// For S3 compatible services like Minio, Ceph etc. use `us-east-1` as region\n\t\t// ref: https://github.com/minio/cookbook/blob/master/docs/aws-sdk-for-go-with-minio.md\n\t\treturn \"us-east-1\", nil\n\t}\n}", "func (o MrScalarTaskScalingUpPolicyOutput) Unit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarTaskScalingUpPolicy) string { return v.Unit }).(pulumi.StringOutput)\n}", "func (o *ReservationModel) GetUnit() EmbeddedUnitModel {\n\tif o == nil || o.Unit == nil {\n\t\tvar ret EmbeddedUnitModel\n\t\treturn ret\n\t}\n\treturn *o.Unit\n}", "func (o *EnvironmentUsageDto) GetSyntheticBillingUsageOk() (*[]SyntheticBillingUsageDto, bool) {\n\tif o == nil || o.SyntheticBillingUsage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SyntheticBillingUsage, true\n}", "func GetUnit(muID int) *ExprUnit {\n\tunitsLock.RLock()\n\tdefer unitsLock.RUnlock()\n\treturn units[muID]\n}", "func (o ClusterNodeGroupSubscriptionConfigPtrOutput) PaymentDurationUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterNodeGroupSubscriptionConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.PaymentDurationUnit\n\t}).(pulumi.StringPtrOutput)\n}", "func (o ElastigroupScalingDownPolicyOutput) Unit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ElastigroupScalingDownPolicy) *string { return v.Unit }).(pulumi.StringPtrOutput)\n}", "func (o *InlineResponse20075Stats) GetBilling() InlineResponse20075StatsBilling {\n\tif o == nil || o.Billing == nil {\n\t\tvar ret InlineResponse20075StatsBilling\n\t\treturn ret\n\t}\n\treturn *o.Billing\n}", "func (o *GetMetricsParams) SetBillingRegions(billingRegions *string) {\n\to.BillingRegions = billingRegions\n}", "func (o *InlineResponse20075Stats) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (r *PrivateVirtualInterface) AwsDevice() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"awsDevice\"])\n}", "func (o *Ga4ghChemotherapy) GetDoseUnit() string {\n\tif o == nil || o.DoseUnit == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.DoseUnit\n}", "func (o ClusterSubscriptionConfigPtrOutput) PaymentDurationUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterSubscriptionConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.PaymentDurationUnit\n\t}).(pulumi.StringPtrOutput)\n}", "func (o MrScalarTaskScalingDownPolicyOutput) Unit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarTaskScalingDownPolicy) string { return v.Unit }).(pulumi.StringOutput)\n}", "func (o LookupOrganizationResultOutput) BillingType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupOrganizationResult) string { return v.BillingType }).(pulumi.StringOutput)\n}", "func (o MrScalarCoreScalingDownPolicyOutput) Unit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MrScalarCoreScalingDownPolicy) string { return v.Unit }).(pulumi.StringOutput)\n}", "func (o *GetMetricsParams) WithBillingRegions(billingRegions *string) *GetMetricsParams {\n\to.SetBillingRegions(billingRegions)\n\treturn o\n}", "func (o ElastigroupScalingTargetPolicyOutput) Unit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ElastigroupScalingTargetPolicy) *string { return v.Unit }).(pulumi.StringPtrOutput)\n}", "func (o *InlineResponse20075Stats) GetBillingOk() (*InlineResponse20075StatsBilling, bool) {\n\tif o == nil || o.Billing == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Billing, true\n}", "func (o *ViewProjectActivePages) GetBilling() bool {\n\tif o == nil || o.Billing == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.Billing\n}", "func (c *Client) GetBillingID() string {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn c.billingID\n}", "func (o VoiceConnectorOutput) AwsRegion() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *VoiceConnector) pulumi.StringPtrOutput { return v.AwsRegion }).(pulumi.StringPtrOutput)\n}", "func (u *Unit) GetUnitStatus(w http.ResponseWriter) error {\n\tconn, err := sd.NewSystemdConnection()\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to get systemd bus connection: %v\", err)\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\tunits, err := conn.ListUnitsByNames([]string{u.Unit})\n\tif err != nil {\n\t\tlog.Errorf(\"Failed get unit '%s' status: %v\", u.Unit, err)\n\t\treturn err\n\t}\n\n\tstatus := UnitStatus{\n\t\tStatus: units[0].ActiveState,\n\t\tUnit: u.Unit,\n\t}\n\n\tjson.NewEncoder(w).Encode(status)\n\n\treturn nil\n}", "func (o *AdminInfo) GetBusinessUnitOk() (*BusinessUnit, bool) {\n\tif o == nil || o.BusinessUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BusinessUnit, true\n}", "func (s *HistoricalMetric) SetUnit(v string) *HistoricalMetric {\n\ts.Unit = &v\n\treturn s\n}", "func getAwsAccount(r *http.Request, a routes.Arguments) (int, interface{}) {\n\tu := a[users.AuthenticatedUser].(users.User)\n\ttx := a[db.Transaction].(*sql.Tx)\n\tl := jsonlog.LoggerFromContextOrDefault(r.Context())\n\tawsAccounts, err := GetAwsAccountsFromUser(u, tx)\n\tif err == nil {\n\t\treturn 200, awsAccounts\n\t} else {\n\t\tl.Error(\"Failed to get user's AWS accounts.\", err.Error())\n\t\treturn 500, errors.New(\"Failed to retrieve AWS accounts.\")\n\t}\n}", "func (o *DataExportQuery) SetUnit(v string) {\n\to.Unit = &v\n}", "func (s OrganizationalUnit) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (r Virtual_Guest) GetCurrentBillingTotal() (resp datatypes.Float64, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Virtual_Guest\", \"getCurrentBillingTotal\", nil, &r.Options, &resp)\n\treturn\n}", "func (o *AUMEvoluation) GetBalance() float64 {\n\tif o == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\n\treturn o.Balance\n}", "func (cnst boltzmannUnits) Unit() *unit.Unit {\n\treturn unit.New(float64(cnst), unit.Dimensions{\n\t\tunit.MassDim: 1,\n\t\tunit.LengthDim: 2,\n\t\tunit.TimeDim: -2,\n\t\tunit.TemperatureDim: -1,\n\t})\n}", "func (o *ReservationModel) GetUnitGroup() EmbeddedUnitGroupModel {\n\tif o == nil {\n\t\tvar ret EmbeddedUnitGroupModel\n\t\treturn ret\n\t}\n\n\treturn o.UnitGroup\n}", "func (r Virtual_Storage_Repository) GetBillingItem() (resp datatypes.Billing_Item, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Virtual_Storage_Repository\", \"getBillingItem\", nil, &r.Options, &resp)\n\treturn\n}", "func (a *BackoffTimerValue) GetUnitTimerValue() (unitTimerValue uint8) {}", "func (o TopicRuleCloudwatchMetricOutput) MetricUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v TopicRuleCloudwatchMetric) string { return v.MetricUnit }).(pulumi.StringOutput)\n}", "func (o *ReservationModel) HasUnit() bool {\n\tif o != nil && o.Unit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (s *CurrentMetric) SetUnit(v string) *CurrentMetric {\n\ts.Unit = &v\n\treturn s\n}", "func (r Virtual_ReservedCapacityGroup_Instance) GetBillingItem() (resp datatypes.Billing_Item, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Virtual_ReservedCapacityGroup_Instance\", \"getBillingItem\", nil, &r.Options, &resp)\n\treturn\n}", "func (m NoSides) SetBookingUnit(v enum.BookingUnit) {\n\tm.Set(field.NewBookingUnit(v))\n}", "func (o *ReservationModel) GetUnitOk() (*EmbeddedUnitModel, bool) {\n\tif o == nil || o.Unit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Unit, true\n}", "func (s *Spend) SetUnit(v string) *Spend {\n\ts.Unit = &v\n\treturn s\n}", "func (o *TransactionSplit) GetBunqPaymentId() string {\n\tif o == nil || o.BunqPaymentId.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.BunqPaymentId.Get()\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) GetBillingAccountId() string {\n\tif o == nil || o.BillingAccountId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.BillingAccountId\n}", "func (o *ViewProjectActivePages) GetBillingOk() (*bool, bool) {\n\tif o == nil || o.Billing == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Billing, true\n}", "func (o StorageCapacityUnitOutput) PeriodUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *StorageCapacityUnit) pulumi.StringOutput { return v.PeriodUnit }).(pulumi.StringOutput)\n}", "func (o *DataExportQuery) GetUnitReference() int32 {\n\tif o == nil || o.UnitReference == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.UnitReference\n}", "func (o *InlineResponse20075Stats) SetBilling(v InlineResponse20075StatsBilling) {\n\to.Billing = &v\n}", "func (o *DataExportQuery) GetUnitOk() (*string, bool) {\n\tif o == nil || o.Unit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Unit, true\n}", "func (tuo *TimingUpdateOne) SetUnit(s string) *TimingUpdateOne {\n\ttuo.mutation.SetUnit(s)\n\treturn tuo\n}", "func (tu *TimingUpdate) SetUnit(s string) *TimingUpdate {\n\ttu.mutation.SetUnit(s)\n\treturn tu\n}", "func (m *BillingstatusMutation) ResetBillingstatuss() {\n\tm.billingstatuss = nil\n\tm.removedbillingstatuss = nil\n}", "func (o *EnvironmentUsageDto) HasSyntheticBillingUsage() bool {\n\tif o != nil && o.SyntheticBillingUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func initAwsClient() aws.Client {\n\treturn aws.NewClient(\"elastisys-billing-data\")\n}", "func (o *ReservationModel) SetUnit(v EmbeddedUnitModel) {\n\to.Unit = &v\n}", "func getAwsRegionE() (region string, err error) {\n\n\tif os.Getenv(\"AWS_DEFAULT_REGION\") != \"\" {\n\t\tregion = os.Getenv(\"AWS_DEFAULT_REGION\")\n\t} else {\n\t\t// Grab it from this EC2 instace\n\t\tregion, err = ec2metadata.New(session.New()).Region()\n\t}\n\treturn\n}", "func NewAwsDetails() AwsDetails {\n\tdetails := AwsDetails{\n\t\tRegion: os.Getenv(`REGION`),\n\t\tTokenParameter: os.Getenv(`TOKEN_PARAMETER`),\n\t\tTimeParameter: os.Getenv(`TIMESTAMP_PARAMETER`),\n\t}\n\tif details.Region == \"\" {\n\t\tdetails.Region = `us-east-1`\n\t}\n\tif details.TokenParameter == \"\" {\n\t\tdetails.TokenParameter = \"slack\"\n\t}\n\tif details.TimeParameter == \"\" {\n\t\tdetails.TimeParameter = \"slack-timestamp\"\n\t}\n\treturn details\n}", "func (bill Amount) ToUnitString(unit_name string) string {\n\tunit_name = strings.ToLower(unit_name)\n\tsetunit := -1\n\tif unit_name == \"mei\" {\n\t\tsetunit = 248\n\t}\n\tif unit_name == \"zhu\" {\n\t\tsetunit = 240\n\t}\n\tif unit_name == \"shuo\" {\n\t\tsetunit = 232\n\t}\n\tif unit_name == \"ai\" {\n\t\tsetunit = 224\n\t}\n\tif unit_name == \"miao\" {\n\t\tsetunit = 216\n\t}\n\tif setunit == -1 {\n\t\t// fin string\n\t\treturn bill.ToFinString()\n\t}\n\tbigunit := bill.ToUnitBigFloat(setunit)\n\tmeistr := bigunit.Text('f', 9)\n\tspx := strings.Split(meistr, \".\")\n\tif len(spx) == 2 {\n\t\tif len(spx[1]) == 9 {\n\t\t\tspx[1] = strings.TrimRight(spx[1], spx[1][8:])\n\t\t\tmeistr = strings.Join(spx, \".\")\n\t\t}\n\t}\n\treturn strings.TrimRight(strings.TrimRight(meistr, \"0\"), \".\")\n\n}", "func (s AWSTestSuite) TestGetAWS() {\n\ts.Equal(\"ID\", env.GetAWSAccessKeyID())\n\ts.Equal(\"test.example.com\", env.GetAWSBucket())\n\ts.Equal(\"/backup/database\", env.GetAWSPath())\n\ts.Equal(\"secret\", env.GetAWSSecretAccessKey())\n\ts.Equal(\"us-east-1\", env.GetAWSRegion())\n}", "func (o *SubDescriptionDto) GetUnitTag() string {\n\tif o == nil || IsNil(o.UnitTag) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.UnitTag\n}", "func (o *Tier) GetBillingPeriodType() string {\n\tif o == nil || o.BillingPeriodType == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.BillingPeriodType\n}", "func (o TopicRuleErrorActionCloudwatchMetricOutput) MetricUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v TopicRuleErrorActionCloudwatchMetric) string { return v.MetricUnit }).(pulumi.StringOutput)\n}", "func (r Virtual_Guest) GetBillingItem() (resp datatypes.Billing_Item_Virtual_Guest, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Virtual_Guest\", \"getBillingItem\", nil, &r.Options, &resp)\n\treturn\n}", "func (r ApiGetMetricsForBitlinkByCountriesRequest) Unit(unit TimeUnit) ApiGetMetricsForBitlinkByCountriesRequest {\n\tr.unit = &unit\n\treturn r\n}", "func (m *BillMutation) ClearBillingstatus() {\n\tm.cleared_Billingstatus = true\n}", "func (u *RepoSourceUnit) SourceUnit() (SourceUnit, error) {\n\t// TODO(sqs): return all info; actually json-unmarshal u.Data\n\treturn SourceUnit{\n\t\tName: u.Unit,\n\t\tType: u.UnitType,\n\t}, nil\n}", "func (c *defaultGcsClient) BucketUsageInBytes(ctxIn context.Context, project string, bucket string) (totalSize float64, err error) {\n\tctx, span := trace.StartSpan(ctxIn, \"(*defaultGcsClient).BucketUsageInBytes\")\n\tdefer span.End()\n\n\tstartTime := time.Now().UTC().Add(time.Minute * -11) // storage/total_bytes metric is written every 5 minutes\n\tendTime := time.Now().UTC()\n\treq := &monitoringpb.ListTimeSeriesRequest{\n\t\tName: \"projects/\" + project,\n\t\tFilter: fmt.Sprintf(`metric.type=\"storage.googleapis.com/storage/total_bytes\" resource.type=\"gcs_bucket\" resource.label.bucket_name=\"%s\"`, bucket),\n\t\tInterval: &monitoringpb.TimeInterval{\n\t\t\tStartTime: &timestamp.Timestamp{\n\t\t\t\tSeconds: startTime.Unix(),\n\t\t\t},\n\t\t\tEndTime: &timestamp.Timestamp{\n\t\t\t\tSeconds: endTime.Unix(),\n\t\t\t},\n\t\t},\n\t\tView: monitoringpb.ListTimeSeriesRequest_FULL,\n\t}\n\tit := c.metricClient.ListTimeSeries(ctx, req)\n\tstorageClassCounted := make(map[string]bool)\n\tfor {\n\t\tresp, err := it.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn totalSize, errors.Wrap(err, \"ListTimeSeries failed\")\n\t\t}\n\t\tfor key, value := range resp.GetMetric().GetLabels() {\n\t\t\tif key == \"storage_class\" && !storageClassCounted[value] {\n\t\t\t\tfor _, point := range resp.GetPoints() {\n\t\t\t\t\tstorageClassCounted[value] = true\n\t\t\t\t\ttotalSize += point.Value.GetDoubleValue()\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn totalSize, nil\n}", "func (d *Drug) QueryUnit() *UnitQuery {\n\treturn (&DrugClient{config: d.config}).QueryUnit(d)\n}", "func (o AccountActiveDirectoryOutput) OrganizationalUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AccountActiveDirectory) *string { return v.OrganizationalUnit }).(pulumi.StringPtrOutput)\n}", "func GetStorageCapacityUnit(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *StorageCapacityUnitState, opts ...pulumi.ResourceOption) (*StorageCapacityUnit, error) {\n\tvar resource StorageCapacityUnit\n\terr := ctx.ReadResource(\"alicloud:ecs/storageCapacityUnit:StorageCapacityUnit\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (o ElastigroupMultipleMetricsMetricOutput) Unit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ElastigroupMultipleMetricsMetric) *string { return v.Unit }).(pulumi.StringPtrOutput)\n}", "func (o ClusterNodeGroupSubscriptionConfigPtrOutput) AutoRenewDurationUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterNodeGroupSubscriptionConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AutoRenewDurationUnit\n\t}).(pulumi.StringPtrOutput)\n}", "func (m *MarketplacePlanAccount) GetOrganizationBillingEmail() string {\n\tif m == nil || m.OrganizationBillingEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.OrganizationBillingEmail\n}", "func (o *ViewProjectActivePages) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EmbeddedUnitModel) GetUnitGroupId() string {\n\tif o == nil || o.UnitGroupId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.UnitGroupId\n}", "func GetUUIDOrganizationalUnit(subject string) string {\n\torgUnits := GetAllOrganizationalUnits(subject)\n\tfor _, orgUnit := range orgUnits {\n\t\tif _, err := uuid.Parse(orgUnit); err == nil {\n\t\t\treturn orgUnit\n\t\t}\n\t}\n\treturn \"\"\n}", "func (cfg Config) Unit() unit.Unit {\n\treturn cfg.unit\n}", "func (o ClusterSubscriptionConfigOutput) AutoRenewDurationUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ClusterSubscriptionConfig) *string { return v.AutoRenewDurationUnit }).(pulumi.StringPtrOutput)\n}", "func (j *JournalTailer) GetUnitName() string {\n\treturn j.unitName\n}", "func (m NoSides) HasBookingUnit() bool {\n\treturn m.Has(tag.BookingUnit)\n}", "func (unit HbarUnit) String() string {\n\treturn string(unit)\n}" ]
[ "0.725526", "0.7068037", "0.7028947", "0.49662375", "0.48930317", "0.48750502", "0.4870752", "0.48601797", "0.48181683", "0.4816353", "0.48036554", "0.47831035", "0.477327", "0.47651938", "0.47399577", "0.47384724", "0.469714", "0.46945193", "0.46901307", "0.46820793", "0.4670104", "0.46642816", "0.46151817", "0.460103", "0.46003008", "0.45795998", "0.4572491", "0.45554963", "0.45543545", "0.45531616", "0.45364627", "0.45140964", "0.4507418", "0.45021307", "0.44884226", "0.4486535", "0.44827753", "0.44752717", "0.44614232", "0.4459552", "0.44496602", "0.4444751", "0.44434172", "0.4430213", "0.44081882", "0.44008964", "0.43917933", "0.43870276", "0.43824223", "0.43803746", "0.4369998", "0.43458256", "0.43180922", "0.43113175", "0.43057767", "0.43056202", "0.42951822", "0.4286542", "0.42846742", "0.42541838", "0.42493334", "0.42391858", "0.42324218", "0.42290962", "0.42220563", "0.42158777", "0.42082033", "0.42005008", "0.41812953", "0.4177801", "0.41747844", "0.4170242", "0.4156931", "0.41498187", "0.4146968", "0.41420278", "0.41395167", "0.41387397", "0.41325712", "0.41322625", "0.4131197", "0.4121267", "0.41165608", "0.41164017", "0.41135854", "0.41069007", "0.4105978", "0.41026714", "0.40922713", "0.40890154", "0.40784505", "0.40699598", "0.40654132", "0.40575722", "0.4049137", "0.40428495", "0.40427518", "0.4041411", "0.4031479", "0.402802" ]
0.7786322
0
GetAwsBillingUnitOk returns a tuple with the AwsBillingUnit field value if set, nil otherwise and a boolean to check if the value has been set.
GetAwsBillingUnitOk возвращает кортеж с значением поля AwsBillingUnit, если оно было задано, и nil в противном случае, а также булевое значение для проверки, было ли значение задано.
func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnitOk() (*CloudAwsBillingUnitRelationship, bool) { if o == nil || o.AwsBillingUnit == nil { return nil, false } return o.AwsBillingUnit, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool {\n\tif o != nil && o.AwsBillingUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DataExportQuery) GetUnitOk() (*string, bool) {\n\tif o == nil || o.Unit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Unit, true\n}", "func (o *ReservationModel) GetUnitOk() (*EmbeddedUnitModel, bool) {\n\tif o == nil || o.Unit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Unit, true\n}", "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnit() CloudAwsBillingUnitRelationship {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\tvar ret CloudAwsBillingUnitRelationship\n\t\treturn ret\n\t}\n\treturn *o.AwsBillingUnit\n}", "func (o *AdminInfo) GetBusinessUnitOk() (*BusinessUnit, bool) {\n\tif o == nil || o.BusinessUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BusinessUnit, true\n}", "func (o *ViewProjectActivePages) GetBillingOk() (*bool, bool) {\n\tif o == nil || o.Billing == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Billing, true\n}", "func (o *GetRecipeInformation200ResponseExtendedIngredientsInner) GetUnitOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Unit, true\n}", "func (o *InlineResponse20075Stats) GetBillingOk() (*InlineResponse20075StatsBilling, bool) {\n\tif o == nil || o.Billing == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Billing, true\n}", "func (o *EnvironmentUsageDto) GetSyntheticBillingUsageOk() (*[]SyntheticBillingUsageDto, bool) {\n\tif o == nil || o.SyntheticBillingUsage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SyntheticBillingUsage, true\n}", "func (o *Ga4ghChemotherapy) GetDoseUnitOk() (string, bool) {\n\tif o == nil || o.DoseUnit == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.DoseUnit, true\n}", "func (o *CloudAwsVirtualMachineAllOf) SetAwsBillingUnit(v CloudAwsBillingUnitRelationship) {\n\to.AwsBillingUnit = &v\n}", "func (o *ReservationModel) GetUnitGroupOk() (*EmbeddedUnitGroupModel, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.UnitGroup, true\n}", "func (o *DataExportQuery) GetUnitReferenceOk() (*int32, bool) {\n\tif o == nil || o.UnitReference == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UnitReference, true\n}", "func (o *SubDescriptionDto) GetUnitTagOk() (*string, bool) {\n\tif o == nil || IsNil(o.UnitTag) {\n\t\treturn nil, false\n\t}\n\treturn o.UnitTag, true\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) GetBillingAccountIdOk() (*string, bool) {\n\tif o == nil || o.BillingAccountId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BillingAccountId, true\n}", "func (o *TransactionSplit) GetBunqPaymentIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BunqPaymentId.Get(), o.BunqPaymentId.IsSet()\n}", "func (o *AUMEvoluation) GetBalanceOk() (*float64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Balance, true\n}", "func (o *EmbeddedUnitModel) GetUnitGroupIdOk() (*string, bool) {\n\tif o == nil || o.UnitGroupId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UnitGroupId, true\n}", "func (o *StorageEnclosure) GetComputeRackUnitOk() (*ComputeRackUnitRelationship, bool) {\n\tif o == nil || o.ComputeRackUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ComputeRackUnit, true\n}", "func (o *ReservationModel) HasUnit() bool {\n\tif o != nil && o.Unit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CatalogEntry) GetUnitPriceOk() (*float32, bool) {\n\tif o == nil || o.UnitPrice == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UnitPrice, true\n}", "func (o *ReconciliationTarget) GetUsageOk() (*float32, bool) {\n\tif o == nil || o.Usage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Usage, true\n}", "func (o *StorageSasExpander) GetComputeRackUnitOk() (*ComputeRackUnitRelationship, bool) {\n\tif o == nil || o.ComputeRackUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ComputeRackUnit, true\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "func (o *ViewProjectBudget) GetRepeatUnitOk() (*string, bool) {\n\tif o == nil || o.RepeatUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RepeatUnit, true\n}", "func (o *EquipmentFanModule) GetComputeRackUnitOk() (*ComputeRackUnitRelationship, bool) {\n\tif o == nil || o.ComputeRackUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ComputeRackUnit, true\n}", "func (o *Tier) GetBillingPeriodTypeOk() (*string, bool) {\n\tif o == nil || o.BillingPeriodType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BillingPeriodType, true\n}", "func (o *MemoryArrayAllOf) GetComputeRackUnitOk() (*ComputeRackUnitRelationship, bool) {\n\tif o == nil || o.ComputeRackUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ComputeRackUnit, true\n}", "func (o *EquipmentFanModule) GetSkuOk() (*string, bool) {\n\tif o == nil || o.Sku == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Sku, true\n}", "func (o *InlineResponse20075Stats) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EquipmentLocatorLed) GetComputeRackUnitOk() (*ComputeRackUnitRelationship, bool) {\n\tif o == nil || o.ComputeRackUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ComputeRackUnit, true\n}", "func (o *EquipmentBaseSensor) GetUnitsOk() (*string, bool) {\n\tif o == nil || o.Units == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Units, true\n}", "func (o *Transaction) GetMerchantNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MerchantName.Get(), o.MerchantName.IsSet()\n}", "func (o *RackUnitPersonality) GetComputeRackUnitOk() (*ComputeRackUnitRelationship, bool) {\n\tif o == nil || o.ComputeRackUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ComputeRackUnit, true\n}", "func (o *TransferOriginatorDiligence) GetDebitUsageConfigurationOk() (*TransferDebitUsageConfiguration, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.DebitUsageConfiguration.Get(), o.DebitUsageConfiguration.IsSet()\n}", "func (o *DataExportQuery) HasUnit() bool {\n\tif o != nil && o.Unit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DataExportQuery) GetUnitsOk() (*int32, bool) {\n\tif o == nil || o.Units == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Units, true\n}", "func (o *EquipmentIoCardBase) GetSkuOk() (*string, bool) {\n\tif o == nil || o.Sku == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Sku, true\n}", "func (o *BlockDeviceMappingVmUpdate) GetBsuOk() (BsuToUpdateVm, bool) {\n\tif o == nil || o.Bsu == nil {\n\t\tvar ret BsuToUpdateVm\n\t\treturn ret, false\n\t}\n\treturn *o.Bsu, true\n}", "func (o *BaseReportTransaction) GetMerchantNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MerchantName.Get(), o.MerchantName.IsSet()\n}", "func (o *X509CertificateSummaryTypeIssuedTo) GetOrganizationalUnitOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.OrganizationalUnit, true\n}", "func (m NoSides) HasBookingUnit() bool {\n\treturn m.Has(tag.BookingUnit)\n}", "func (o *V0037Node) GetBurstbufferNetworkAddressOk() (*string, bool) {\n\tif o == nil || o.BurstbufferNetworkAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BurstbufferNetworkAddress, true\n}", "func (o *InlineResponse20075StatsBilling) GetCompletedOk() (*string, bool) {\n\tif o == nil || o.Completed == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Completed, true\n}", "func (o *PaymentStatusUpdateWebhook) GetTransactionIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TransactionId.Get(), o.TransactionId.IsSet()\n}", "func (u *Unit) GetUnitStatus(w http.ResponseWriter) error {\n\tconn, err := sd.NewSystemdConnection()\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to get systemd bus connection: %v\", err)\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\tunits, err := conn.ListUnitsByNames([]string{u.Unit})\n\tif err != nil {\n\t\tlog.Errorf(\"Failed get unit '%s' status: %v\", u.Unit, err)\n\t\treturn err\n\t}\n\n\tstatus := UnitStatus{\n\t\tStatus: units[0].ActiveState,\n\t\tUnit: u.Unit,\n\t}\n\n\tjson.NewEncoder(w).Encode(status)\n\n\treturn nil\n}", "func (o *EnvironmentUsageDto) GetInternalUseOk() (*bool, bool) {\n\tif o == nil || o.InternalUse == nil {\n\t\treturn nil, false\n\t}\n\treturn o.InternalUse, true\n}", "func (o *TransferOriginatorDiligence) GetCreditUsageConfigurationOk() (*TransferCreditUsageConfiguration, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreditUsageConfiguration.Get(), o.CreditUsageConfiguration.IsSet()\n}", "func (o *BackupUnitProperties) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Name, true\n}", "func (o *CapabilitySiocModuleManufacturingDef) GetSkuOk() (*string, bool) {\n\tif o == nil || o.Sku == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Sku, true\n}", "func (o *TransactionSplit) GetBillNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BillName.Get(), o.BillName.IsSet()\n}", "func (o *SmartstackBackend) GetCheckDurationOk() (*int32, bool) {\n\tif o == nil || o.CheckDuration == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CheckDuration, true\n}", "func (o *Transaction) GetAccountOwnerOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AccountOwner.Get(), o.AccountOwner.IsSet()\n}", "func (o *TransactionSplit) GetBudgetIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BudgetId.Get(), o.BudgetId.IsSet()\n}", "func (o *StorageHyperFlexStorageContainer) GetInUseOk() (*bool, bool) {\n\tif o == nil || o.InUse == nil {\n\t\treturn nil, false\n\t}\n\treturn o.InUse, true\n}", "func (m *MarketplacePlan) GetUnitName() string {\n\tif m == nil || m.UnitName == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UnitName\n}", "func (o *SubDescriptionDto) HasUnitTag() bool {\n\tif o != nil && !IsNil(o.UnitTag) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransactionSplit) GetBudgetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BudgetName.Get(), o.BudgetName.IsSet()\n}", "func (o *CartaoProduto) GetUsrOk() (*int64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Usr.Get(), o.Usr.IsSet()\n}", "func (o *CreditBankStatementUploadBankAccountPeriod) GetEndingBalanceOk() (*float32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.EndingBalance.Get(), o.EndingBalance.IsSet()\n}", "func (o *AutocompleteIngredientSearch200ResponseInner) GetPossibleUnitsOk() ([]string, bool) {\n\tif o == nil || o.PossibleUnits == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PossibleUnits, true\n}", "func (o *EnvironmentUsageDto) HasSyntheticBillingUsage() bool {\n\tif o != nil && o.SyntheticBillingUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *UcsdBackupInfoAllOf) GetIsPurgedOk() (*bool, bool) {\n\tif o == nil || o.IsPurged == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IsPurged, true\n}", "func (o *User) GetUsageLocationOk() (string, bool) {\n\tif o == nil || o.UsageLocation == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.UsageLocation, true\n}", "func (o *EnvironmentUsageDto) GetTrialOk() (*bool, bool) {\n\tif o == nil || o.Trial == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Trial, true\n}", "func (o *HyperflexSnapshotStatus) GetUsedSpaceOk() (*int64, bool) {\n\tif o == nil || o.UsedSpace == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UsedSpace, true\n}", "func (o *ReceiptResponse) GetGasBudgetOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.GasBudget, true\n}", "func (o *EmbeddedUnitModel) HasUnitGroupId() bool {\n\tif o != nil && o.UnitGroupId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *AllocationList) GetBalanceOk() (*float64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Balance, true\n}", "func (o *V0037JobProperties) GetBurstBufferOk() (*string, bool) {\n\tif o == nil || o.BurstBuffer == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BurstBuffer, true\n}", "func (o *SubTransactionParams) GetPurposeOk() (*string, bool) {\n\tif o == nil || o.Purpose == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Purpose, true\n}", "func (o *EnvironmentUsageDto) GetEnvironmentUuidOk() (*string, bool) {\n\tif o == nil || o.EnvironmentUuid == nil {\n\t\treturn nil, false\n\t}\n\treturn o.EnvironmentUuid, true\n}", "func (o *GetRecipeInformation200ResponseExtendedIngredientsInner) GetUnit() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Unit\n}", "func (o *WafDdosSettings) GetBurstThresholdOk() (*string, bool) {\n\tif o == nil || o.BurstThreshold == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BurstThreshold, true\n}", "func (o *StorageBaseCapacity) GetCapacityUtilizationOk() (*float32, bool) {\n\tif o == nil || o.CapacityUtilization == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CapacityUtilization, true\n}", "func (o *CompanyPayoutDestinationResponse) GetBankOk() (*string, bool) {\n\tif o == nil || IsNil(o.Bank) {\n\t\treturn nil, false\n\t}\n\treturn o.Bank, true\n}", "func (o *PaymentInitiationPaymentGetResponse) GetTransactionIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TransactionId.Get(), o.TransactionId.IsSet()\n}", "func (o *LocalDatabaseProvider) GetUserLockoutDurationMinutesOk() (*int32, bool) {\n\tif o == nil || o.UserLockoutDurationMinutes == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserLockoutDurationMinutes, true\n}", "func (o *EditBankConnectionParams) GetBankingUserIdOk() (*string, bool) {\n\tif o == nil || o.BankingUserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BankingUserId, true\n}", "func (o *InlineResponse20075StatsBilling) GetActiveOk() (*string, bool) {\n\tif o == nil || o.Active == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Active, true\n}", "func (m NoSides) GetBookingUnit() (v enum.BookingUnit, err quickfix.MessageRejectError) {\n\tvar f field.BookingUnitField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "func (o *MemoryArrayAllOf) GetUnitsOk() ([]MemoryUnitRelationship, bool) {\n\tif o == nil || o.Units == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Units, true\n}", "func (o *CreditBankStatementUploadBankAccountPeriod) GetStartingBalanceOk() (*float32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.StartingBalance.Get(), o.StartingBalance.IsSet()\n}", "func (o *HoldingsOverride) GetCurrencyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Currency, true\n}", "func (o *BaseReportTransaction) GetAccountOwnerOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AccountOwner.Get(), o.AccountOwner.IsSet()\n}", "func (o *DataExportQuery) HasUnitReference() bool {\n\tif o != nil && o.UnitReference != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CreditBankIncomeTransaction) GetTransactionIdOk() (*string, bool) {\n\tif o == nil || o.TransactionId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TransactionId, true\n}", "func (o *TransactionSplit) GetBillIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BillId.Get(), o.BillId.IsSet()\n}", "func (o *Commitstatus) GetUuidOk() (*string, bool) {\n\tif o == nil || o.Uuid == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Uuid, true\n}", "func (o *RequestSepaMoneyTransferParams) GetPurposeOk() (*string, bool) {\n\tif o == nil || o.Purpose == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Purpose, true\n}", "func (vec Vector2) IsUnit() bool {\n\treturn vec.Len() == 1\n}", "func (o *ClientConfiguration) GetAvailableBankGroupsOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.AvailableBankGroups, true\n}", "func (o *AdminInfo) HasBusinessUnit() bool {\n\tif o != nil && o.BusinessUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewTimelogTotals) GetMinutesBilledOk() (*int32, bool) {\n\tif o == nil || o.MinutesBilled == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MinutesBilled, true\n}", "func (o *UserSessionQueryTileConfiguration) GetHasAxisBucketingOk() (*bool, bool) {\n\tif o == nil || o.HasAxisBucketing == nil {\n\t\treturn nil, false\n\t}\n\treturn o.HasAxisBucketing, true\n}", "func (o *ViewProjectActivePages) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (a Aggregator) UnitHasStatus(us fleet.UnitStatus, statuses ...Status) (bool, error) {\n\tif len(statuses) == 0 {\n\t\treturn false, maskAny(invalidArgumentError)\n\t}\n\n\tfor _, ms := range us.Machine {\n\t\taggregated, err := a.AggregateStatus(us.Current, us.Desired, ms.SystemdActive, ms.SystemdSub)\n\t\tif err != nil {\n\t\t\treturn false, maskAny(err)\n\t\t}\n\n\t\tfor _, status := range statuses {\n\t\t\tif aggregated == status {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false, nil\n}", "func (o *Giveaway) GetUsedOk() (bool, bool) {\n\tif o == nil || o.Used == nil {\n\t\tvar ret bool\n\t\treturn ret, false\n\t}\n\treturn *o.Used, true\n}", "func (a *BackoffTimerValue) GetUnitTimerValue() (unitTimerValue uint8) {}", "func (o *GetRecipeInformation200ResponseExtendedIngredientsInner) SetUnit(v string) {\n\to.Unit = v\n}" ]
[ "0.7104922", "0.64157313", "0.6327983", "0.6289558", "0.62768763", "0.6262793", "0.6195215", "0.5979507", "0.5921889", "0.58292925", "0.58207434", "0.57992446", "0.5798347", "0.575605", "0.549987", "0.5464085", "0.5420285", "0.5416889", "0.540678", "0.5394582", "0.5384341", "0.5373202", "0.5328076", "0.53234035", "0.53135514", "0.5308302", "0.5265758", "0.52482516", "0.5226334", "0.52233875", "0.52047443", "0.51981866", "0.5174146", "0.51621735", "0.5153511", "0.51334876", "0.5120399", "0.50870574", "0.5058414", "0.5028175", "0.5021029", "0.5020381", "0.5013603", "0.5002237", "0.49805894", "0.49798638", "0.49718747", "0.4965672", "0.49565256", "0.49522302", "0.49517557", "0.49389783", "0.49353185", "0.4923705", "0.49208444", "0.49052873", "0.49001053", "0.4898053", "0.48942244", "0.4875473", "0.48619604", "0.48529875", "0.48514178", "0.48498037", "0.4845771", "0.48412916", "0.48242968", "0.48240125", "0.48224023", "0.48181757", "0.48096472", "0.47986463", "0.4796708", "0.47956446", "0.47870663", "0.47860318", "0.47798133", "0.4778801", "0.47759303", "0.47755384", "0.47752312", "0.47734687", "0.47609025", "0.47519735", "0.4749669", "0.47261876", "0.4721108", "0.4716365", "0.4710755", "0.47099835", "0.47056693", "0.4701216", "0.4690821", "0.46862406", "0.4685599", "0.46827686", "0.4680688", "0.46763676", "0.467553", "0.46746662" ]
0.81112826
0
HasAwsBillingUnit returns a boolean if a field has been set.
HasAwsBillingUnit возвращает логическое значение, если поле было задано.
func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool { if o != nil && o.AwsBillingUnit != nil { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *InlineResponse20075Stats) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewProjectActivePages) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EnvironmentUsageDto) HasSyntheticBillingUsage() bool {\n\tif o != nil && o.SyntheticBillingUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnitOk() (*CloudAwsBillingUnitRelationship, bool) {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AwsBillingUnit, true\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) HasBillingAccountId() bool {\n\tif o != nil && o.BillingAccountId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m NoSides) HasBookingUnit() bool {\n\treturn m.Has(tag.BookingUnit)\n}", "func (o *ReservationModel) HasUnit() bool {\n\tif o != nil && o.Unit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnit() CloudAwsBillingUnitRelationship {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\tvar ret CloudAwsBillingUnitRelationship\n\t\treturn ret\n\t}\n\treturn *o.AwsBillingUnit\n}", "func (o *Tier) HasBillingPeriodType() bool {\n\tif o != nil && o.BillingPeriodType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *AdminInfo) HasBusinessUnit() bool {\n\tif o != nil && o.BusinessUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransactionSplit) HasBunqPaymentId() bool {\n\tif o != nil && o.BunqPaymentId.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EquipmentIoCardBase) HasSku() bool {\n\tif o != nil && o.Sku != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *PartnerCustomerCreateRequest) HasBillingContact() bool {\n\tif o != nil && o.BillingContact != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EquipmentFanModule) HasSku() bool {\n\tif o != nil && o.Sku != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CloudAwsVirtualMachineAllOf) SetAwsBillingUnit(v CloudAwsBillingUnitRelationship) {\n\to.AwsBillingUnit = &v\n}", "func (o *TransferOriginatorDiligence) HasDebitUsageConfiguration() bool {\n\tif o != nil && o.DebitUsageConfiguration.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *Transaction) HasMerchantName() bool {\n\tif o != nil && o.MerchantName.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DataExportQuery) HasUnit() bool {\n\tif o != nil && o.Unit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (si *ServiceInformation) HasAWSInfo() bool {\n\tif si.RequiredArn == nil {\n\t\treturn false\n\t}\n\treturn len(si.RequiredArn) > 0\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) HasCostExportTableName() bool {\n\tif o != nil && o.CostExportTableName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *Ga4ghChemotherapy) HasDoseUnit() bool {\n\tif o != nil && o.DoseUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CapabilitySiocModuleManufacturingDef) HasSku() bool {\n\tif o != nil && o.Sku != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *StorageEnclosure) HasComputeRackUnit() bool {\n\tif o != nil && o.ComputeRackUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *BalanceResponse) HasGateway() bool {\n\tif o != nil && !IsNil(o.Gateway) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m *MockMappedResource) HasAws() bool {\n\tret := m.ctrl.Call(m, \"HasAws\")\n\tret0, _ := ret[0].(bool)\n\treturn ret0\n}", "func (m NoAllocs) HasAllocQty() bool {\n\treturn m.Has(tag.AllocQty)\n}", "func (mr *MockMappedResourceMockRecorder) HasAws() *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"HasAws\", reflect.TypeOf((*MockMappedResource)(nil).HasAws))\n}", "func (o *StorageSasExpander) HasComputeRackUnit() bool {\n\tif o != nil && o.ComputeRackUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *UcsdBackupInfoAllOf) HasIsPurged() bool {\n\tif o != nil && o.IsPurged != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransferOriginatorDiligence) HasCreditUsageConfiguration() bool {\n\tif o != nil && o.CreditUsageConfiguration.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *AvailableBudget) HasSpentInBudgets() bool {\n\tif o != nil && o.SpentInBudgets != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *BaseReportTransaction) HasMerchantName() bool {\n\tif o != nil && o.MerchantName.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EmbeddedUnitModel) HasUnitGroupId() bool {\n\tif o != nil && o.UnitGroupId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *InlineResponse20075StatsBilling) HasActive() bool {\n\tif o != nil && o.Active != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ReservationModel) HasPaymentAccount() bool {\n\tif o != nil && o.PaymentAccount != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *InlineResponse20075StatsBilling) HasCompleted() bool {\n\tif o != nil && o.Completed != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *UserSessionQueryTileConfiguration) HasHasAxisBucketing() bool {\n\tif o != nil && o.HasAxisBucketing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EditBankConnectionParams) HasBankingUserId() bool {\n\tif o != nil && o.BankingUserId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) HasPricingExportTableName() bool {\n\tif o != nil && o.PricingExportTableName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *NetworkingProjectNetworkCreate) HasGateway() bool {\n\tif o != nil && o.Gateway != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *Invoice) HasBuyer() bool {\n\tif o != nil && o.Buyer != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewProjectActivePages) GetBilling() bool {\n\tif o == nil || o.Billing == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.Billing\n}", "func (o *CatalogEntry) HasUnitPrice() bool {\n\tif o != nil && o.UnitPrice != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *Invoice) HasSeller() bool {\n\tif o != nil && o.Seller != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DeliveryS3Authentication) HasSecretKey() bool {\n\tif o != nil && o.SecretKey != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *LoyaltyBalances) HasSubledgerBalances() bool {\n\tif o != nil && o.SubledgerBalances != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *PaymentStatusUpdateWebhook) HasTransactionId() bool {\n\tif o != nil && o.TransactionId.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewProjectActivePages) GetBillingOk() (*bool, bool) {\n\tif o == nil || o.Billing == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Billing, true\n}", "func (o *DataExportQuery) HasUnitReference() bool {\n\tif o != nil && o.UnitReference != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *InstitutionsSearchAccountFilter) HasInvestment() bool {\n\tif o != nil && o.Investment != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *W2) HasFederalIncomeTaxWithheld() bool {\n\tif o != nil && o.FederalIncomeTaxWithheld.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *V0037Node) HasBurstbufferNetworkAddress() bool {\n\tif o != nil && o.BurstbufferNetworkAddress != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *NetworkElementSummaryAllOf) HasInbandIpGateway() bool {\n\tif o != nil && o.InbandIpGateway != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *BlockDeviceMappingVmUpdate) HasBsu() bool {\n\tif o != nil && o.Bsu != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *V0037JobProperties) HasGpus() bool {\n\tif o != nil && o.Gpus != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *NetworkElementSummaryAllOf) HasOutOfBandIpv4Gateway() bool {\n\tif o != nil && o.OutOfBandIpv4Gateway != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CheckoutResponse) HasPaymentsLimitCount() bool {\n\tif o != nil && o.PaymentsLimitCount.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *Wireless) HasVendor() bool {\n\tif o != nil && o.Vendor != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SessionPropertiesQuota) HasConsumedThisYear() bool {\n\tif o != nil && o.ConsumedThisYear != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *HoldingsOverride) HasCostBasis() bool {\n\tif o != nil && o.CostBasis != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *User) HasLicenseDetails() bool {\n\tif o != nil && o.LicenseDetails != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *LoyaltyBalances) HasBalance() bool {\n\tif o != nil && o.Balance != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *RequestSepaMoneyTransferParams) HasBankingPin() bool {\n\tif o != nil && o.BankingPin != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *InlineObject753) HasDatePurchased() bool {\n\tif o != nil && o.DatePurchased != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *VnicEthAdapterPolicyInventory) HasCompletionQueueSettings() bool {\n\tif o != nil && o.CompletionQueueSettings.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CompanyPayoutDestinationResponse) HasBank() bool {\n\tif o != nil && !IsNil(o.Bank) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *NetworkLicenseFile) HasVendor() bool {\n\tif o != nil && o.Vendor != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *PayPeriodDetails) HasGrossEarnings() bool {\n\tif o != nil && o.GrossEarnings.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CreateRouteRequest) HasGatewayId() bool {\n\tif o != nil && o.GatewayId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EquipmentFanModule) HasComputeRackUnit() bool {\n\tif o != nil && o.ComputeRackUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *WafDdosSettings) HasBurstThreshold() bool {\n\tif o != nil && o.BurstThreshold != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EditBankConnectionParams) HasBankingPin() bool {\n\tif o != nil && o.BankingPin != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransactionSplit) HasBudgetId() bool {\n\tif o != nil && o.BudgetId.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *AssetWorkloadOptimizerGoogleCloudPlatformBillingOptions) HasCostExportDataSetName() bool {\n\tif o != nil && o.CostExportDataSetName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewTimelogTotals) HasMinutesBilled() bool {\n\tif o != nil && o.MinutesBilled != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *InlineObject753) HasCost() bool {\n\tif o != nil && o.Cost != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *PiggyBankEvent) HasTransactionGroupId() bool {\n\tif o != nil && o.TransactionGroupId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *MemoryArrayAllOf) HasComputeRackUnit() bool {\n\tif o != nil && o.ComputeRackUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EditBankConnectionParams) HasBankingCustomerId() bool {\n\tif o != nil && o.BankingCustomerId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *PaymentInitiationPaymentGetResponse) HasTransactionId() bool {\n\tif o != nil && o.TransactionId.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransactionSplit) HasBudgetName() bool {\n\tif o != nil && o.BudgetName.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SubDescriptionDto) HasUnitTag() bool {\n\tif o != nil && !IsNil(o.UnitTag) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *W2) HasSocialSecurityTaxWithheld() bool {\n\tif o != nil && o.SocialSecurityTaxWithheld.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *VnicEthAdapterPolicyInventory) HasTxQueueSettings() bool {\n\tif o != nil && o.TxQueueSettings.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SmartstackBackend) HasCheckDuration() bool {\n\tif o != nil && o.CheckDuration != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransactionSplit) HasBillName() bool {\n\tif o != nil && o.BillName.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DeferredResultVoid) HasSetOrExpired() bool {\n\tif o != nil && o.SetOrExpired != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *TransactionSplit) HasBillId() bool {\n\tif o != nil && o.BillId.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewTimelogTotals) HasMinutesNonBilled() bool {\n\tif o != nil && o.MinutesNonBilled != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (d UserData) HasBanks() bool {\n\treturn d.ModelData.Has(models.NewFieldName(\"Banks\", \"banks_ids\"))\n}", "func (creds AwsCredentials) IsGov() bool {\n\treturn strings.Contains(creds.Region, \"-gov-\")\n}", "func IsHasField(st interface{}, fieldName string) bool {\n\treturn HasField(st, fieldName)\n}", "func (o *CartaoProduto) HasUsr() bool {\n\tif o != nil && o.Usr.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DisplayInfo) HasRegion() bool {\n\tif o != nil && o.Region != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CreditBankIncomeItem) HasBankIncomeSources() bool {\n\tif o != nil && o.BankIncomeSources != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EnvironmentUsageDto) HasTrial() bool {\n\tif o != nil && o.Trial != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (d UserData) HasIndustry() bool {\n\treturn d.ModelData.Has(models.NewFieldName(\"Industry\", \"industry_id\"))\n}", "func (o *MacpoolLeaseAllOf) HasPoolMember() bool {\n\tif o != nil && o.PoolMember != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *RackUnitPersonality) HasComputeRackUnit() bool {\n\tif o != nil && o.ComputeRackUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *NetworkElementSummaryAllOf) HasOutOfBandIpGateway() bool {\n\tif o != nil && o.OutOfBandIpGateway != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}" ]
[ "0.700311", "0.6667693", "0.65554816", "0.64047885", "0.62540424", "0.5994485", "0.5865692", "0.5797638", "0.57723415", "0.56910723", "0.56457406", "0.5550224", "0.55298436", "0.55039054", "0.55026925", "0.54983115", "0.549359", "0.54661155", "0.54456234", "0.53839856", "0.536572", "0.53602386", "0.53551555", "0.53445905", "0.533943", "0.53341556", "0.53334373", "0.5307457", "0.5282144", "0.5241433", "0.5237928", "0.5233075", "0.52311265", "0.5230919", "0.51686054", "0.51615894", "0.5159531", "0.5153285", "0.5151707", "0.5142784", "0.51141375", "0.5099033", "0.50956964", "0.5094293", "0.5083512", "0.50821745", "0.50785625", "0.5069865", "0.50695705", "0.50575155", "0.50426334", "0.5042117", "0.50330377", "0.5031108", "0.501422", "0.5010588", "0.5005353", "0.5000548", "0.49966633", "0.49943334", "0.4993811", "0.49837536", "0.49815363", "0.4980494", "0.49785548", "0.49784204", "0.49572134", "0.49559945", "0.49491426", "0.49477884", "0.4941589", "0.49415216", "0.49347687", "0.49344397", "0.49316937", "0.49294528", "0.4924429", "0.49177712", "0.49169058", "0.4908566", "0.49082628", "0.49051005", "0.4892426", "0.48906067", "0.48902977", "0.48869726", "0.4876846", "0.48697388", "0.48631775", "0.4860686", "0.4857412", "0.48564634", "0.48502782", "0.4849163", "0.48419368", "0.48381874", "0.48357502", "0.48339614", "0.48324448", "0.48245093" ]
0.8600866
0
SetAwsBillingUnit gets a reference to the given CloudAwsBillingUnitRelationship and assigns it to the AwsBillingUnit field.
SetAwsBillingUnit получает ссылку на заданный CloudAwsBillingUnitRelationship и присваивает его полю AwsBillingUnit.
func (o *CloudAwsVirtualMachineAllOf) SetAwsBillingUnit(v CloudAwsBillingUnitRelationship) { o.AwsBillingUnit = &v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnit() CloudAwsBillingUnitRelationship {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\tvar ret CloudAwsBillingUnitRelationship\n\t\treturn ret\n\t}\n\treturn *o.AwsBillingUnit\n}", "func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool {\n\tif o != nil && o.AwsBillingUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnitOk() (*CloudAwsBillingUnitRelationship, bool) {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AwsBillingUnit, true\n}", "func (o *GetMetricsParams) SetBillingRegions(billingRegions *string) {\n\to.BillingRegions = billingRegions\n}", "func (m NoSides) SetBookingUnit(v enum.BookingUnit) {\n\tm.Set(field.NewBookingUnit(v))\n}", "func (_options *ImportAccountToEnterpriseOptions) SetBillingUnitID(billingUnitID string) *ImportAccountToEnterpriseOptions {\n\t_options.BillingUnitID = core.StringPtr(billingUnitID)\n\treturn _options\n}", "func (o *GetRecipeInformation200ResponseExtendedIngredientsInner) SetUnit(v string) {\n\to.Unit = v\n}", "func (o *DataExportQuery) SetUnitReference(v int32) {\n\to.UnitReference = &v\n}", "func (o *ReservationModel) SetUnit(v EmbeddedUnitModel) {\n\to.Unit = &v\n}", "func (tu *TimingUpdate) SetUnit(s string) *TimingUpdate {\n\ttu.mutation.SetUnit(s)\n\treturn tu\n}", "func (r ApiGetOrganizationShortenCountsRequest) UnitReference(unitReference string) ApiGetOrganizationShortenCountsRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (tuo *TimingUpdateOne) SetUnit(s string) *TimingUpdateOne {\n\ttuo.mutation.SetUnit(s)\n\treturn tuo\n}", "func (o *StockKeepingUnitContent) SetSku(exec boil.Executor, insert bool, related *StockKeepingUnit) error {\n\tvar err error\n\tif insert {\n\t\tif err = related.Insert(exec, boil.Infer()); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to insert into foreign table\")\n\t\t}\n\t}\n\n\tupdateQuery := fmt.Sprintf(\n\t\t\"UPDATE \\\"stock_keeping_unit_content\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, []string{\"sku_id\"}),\n\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 2, stockKeepingUnitContentPrimaryKeyColumns),\n\t)\n\tvalues := []interface{}{related.ID, o.ID}\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, updateQuery)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\tif _, err = exec.Exec(updateQuery, values...); err != nil {\n\t\treturn errors.Wrap(err, \"failed to update local table\")\n\t}\n\n\to.SkuID = related.ID\n\tif o.R == nil {\n\t\to.R = &stockKeepingUnitContentR{\n\t\t\tSku: related,\n\t\t}\n\t} else {\n\t\to.R.Sku = related\n\t}\n\n\tif related.R == nil {\n\t\trelated.R = &stockKeepingUnitR{\n\t\t\tSkuStockKeepingUnitContents: StockKeepingUnitContentSlice{o},\n\t\t}\n\t} else {\n\t\trelated.R.SkuStockKeepingUnitContents = append(related.R.SkuStockKeepingUnitContents, o)\n\t}\n\n\treturn nil\n}", "func (q *OperationQueue) SetBalance(owner string, balance uint64) {\n\tq.cache.SetBalance(owner, balance)\n}", "func (o *InlineResponse20075Stats) SetBilling(v InlineResponse20075StatsBilling) {\n\to.Billing = &v\n}", "func (o *ViewProjectActivePages) SetBilling(v bool) {\n\to.Billing = &v\n}", "func (o *AdminInfo) SetBusinessUnit(v BusinessUnit) {\n\to.BusinessUnit = &v\n}", "func (o *DataExportQuery) SetUnit(v string) {\n\to.Unit = &v\n}", "func (c *Client) SetBillingID(id string) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.billingID = id\n}", "func (r ApiGetMetricsForBitlinkByCountriesRequest) UnitReference(unitReference string) ApiGetMetricsForBitlinkByCountriesRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (s *HistoricalMetric) SetUnit(v string) *HistoricalMetric {\n\ts.Unit = &v\n\treturn s\n}", "func (r ApiGetMetricsForBitlinkByCitiesRequest) UnitReference(unitReference string) ApiGetMetricsForBitlinkByCitiesRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (m *OrgUnitMemberMutation) ResetBelongToOrgUnit() {\n\tm.belongToOrgUnit = nil\n\tm.clearedbelongToOrgUnit = false\n}", "func (s *Spend) SetUnit(v string) *Spend {\n\ts.Unit = &v\n\treturn s\n}", "func (c *clustermgrClient) ReleaseVolumeUnit(ctx context.Context, vuid proto.Vuid, diskID proto.DiskID) (err error) {\n\tc.rwLock.Lock()\n\tdefer c.rwLock.Unlock()\n\n\tspan := trace.SpanFromContextSafe(ctx)\n\n\tspan.Debugf(\"release volume unit: args vuid[%d], disk_id[%d]\", vuid, diskID)\n\terr = c.client.ReleaseVolumeUnit(ctx, &cmapi.ReleaseVolumeUnitArgs{Vuid: vuid, DiskID: diskID})\n\tspan.Debugf(\"release volume unit ret: err[%+v]\", err)\n\n\treturn\n}", "func (s *CurrentMetric) SetUnit(v string) *CurrentMetric {\n\ts.Unit = &v\n\treturn s\n}", "func SetFlagUnit(name string, unit units.Unit) {\n\tsetFlagUnit(name, unit)\n}", "func (s dbBilling) setUserBillingCustomerID(ctx context.Context, userID int32, billingCustomerID *string) error {\n\tquery := sqlf.Sprintf(\"UPDATE users SET billing_customer_id=%s WHERE id=%d AND deleted_at IS NULL\", billingCustomerID, userID)\n\tres, err := s.db.ExecContext(ctx, query.Query(sqlf.PostgresBindVar), query.Args()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnrows, err := res.RowsAffected()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif nrows == 0 {\n\t\treturn database.NewUserNotFoundError(userID)\n\t}\n\treturn nil\n}", "func (r ApiGetClicksSummaryForBitlinkRequest) UnitReference(unitReference string) ApiGetClicksSummaryForBitlinkRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (ms MetricDescriptor) SetUnit(v string) {\n\t(*ms.orig).Unit = v\n}", "func (r ApiGetSortedBitlinksRequest) UnitReference(unitReference string) ApiGetSortedBitlinksRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (s *PolicySummary) SetAwsManaged(v bool) *PolicySummary {\n\ts.AwsManaged = &v\n\treturn s\n}", "func (r ApiGetClicksForBitlinkRequest) UnitReference(unitReference string) ApiGetClicksForBitlinkRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (r ApiGetMetricsForBitlinkByReferringDomainsRequest) UnitReference(unitReference string) ApiGetMetricsForBitlinkByReferringDomainsRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (o *GetMetricsParams) WithBillingRegions(billingRegions *string) *GetMetricsParams {\n\to.SetBillingRegions(billingRegions)\n\treturn o\n}", "func (r ApiGetMetricsForBitlinkByDevicesRequest) UnitReference(unitReference string) ApiGetMetricsForBitlinkByDevicesRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (s *ReportDefinition) SetBillingViewArn(v string) *ReportDefinition {\n\ts.BillingViewArn = &v\n\treturn s\n}", "func (u *Unit) SetUnitProperty(w http.ResponseWriter) error {\n\tconn, err := sd.NewSystemdConnection()\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to get systemd bus connection: %v\", err)\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\tswitch u.Property {\n\tcase \"CPUShares\":\n\t\tn, err := strconv.ParseInt(u.Value, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Failed to parse CPUShares: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tp := sd.Property{\n\t\t\tName: \"CPUShares\",\n\t\t\tValue: dbus.MakeVariant(uint64(n)),\n\t\t}\n\t\terr = conn.SetUnitProperties(u.Unit, true, p)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Failed to set CPUShares %s: %v\", u.Value, err)\n\t\t\treturn err\n\t\t}\n\t\tbreak\n\t}\n\n\treturn nil\n}", "func WithUnit(u unit.Unit) Option {\n\treturn optionFunc(func(cfg Config) Config {\n\t\tcfg.unit = u\n\t\treturn cfg\n\t})\n}", "func SetSizeGB(target SizeMB, sizeGB int) {\n\ttarget.SetSizeMB(size.GiBToMiB(sizeGB))\n}", "func (a *BackoffTimerValue) SetUnitTimerValue(unitTimerValue uint8) {}", "func (m *OrgUnitMemberMutation) ClearBelongToOrgUnit() {\n\tm.clearedbelongToOrgUnit = true\n}", "func (s *Shader) SetUniformBlock(name string, value interface{}, size int) {\n\t// check if the uniform buffer object already exists\n\tubo, ok := s.uniformBOs[name]\n\tif !ok {\n\t\t// if not, generate one\n\t\tgl.GenBuffers(1, &ubo)\n\t\ts.uniformBOs[name] = ubo\n\t}\n\n\tgl.BindBuffer(gl.UNIFORM_BUFFER, ubo)\n\n\t// set the new data\n\tgl.BufferData(gl.UNIFORM_BUFFER, size, nil, gl.DYNAMIC_DRAW)\n\tgl.BindBufferBase(gl.UNIFORM_BUFFER, s.getUniformBlockLocation(name), ubo)\n}", "func (m *AgedAccountsPayable) SetBalanceDue(value *float64)() {\n err := m.GetBackingStore().Set(\"balanceDue\", value)\n if err != nil {\n panic(err)\n }\n}", "func (oupq *OrgUnitPositionQuery) WithBelongToOrgUnit(opts ...func(*OrgUnitQuery)) *OrgUnitPositionQuery {\n\tquery := &OrgUnitQuery{config: oupq.config}\n\tfor _, opt := range opts {\n\t\topt(query)\n\t}\n\toupq.withBelongToOrgUnit = query\n\treturn oupq\n}", "func (s *Scale) SetUnit(v string) *Scale {\n\ts.Unit = &v\n\treturn s\n}", "func (cg *CGroup) SetBlkioWeight(limit int64) error {\n\tversion := cgControllers[\"blkio\"]\n\tswitch version {\n\tcase Unavailable:\n\t\treturn ErrControllerMissing\n\tcase V1:\n\t\treturn cg.rw.Set(version, \"blkio\", \"blkio.weight\", fmt.Sprintf(\"%d\", limit))\n\tcase V2:\n\t\treturn cg.rw.Set(version, \"io\", \"io.weight\", fmt.Sprintf(\"%d\", limit))\n\t}\n\n\treturn ErrUnknownVersion\n}", "func (o VoiceConnectorOutput) AwsRegion() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *VoiceConnector) pulumi.StringPtrOutput { return v.AwsRegion }).(pulumi.StringPtrOutput)\n}", "func (_BaseLibrary *BaseLibraryTransactor) SetAddressKMS(opts *bind.TransactOpts, address_KMS common.Address) (*types.Transaction, error) {\n\treturn _BaseLibrary.contract.Transact(opts, \"setAddressKMS\", address_KMS)\n}", "func (_Container *ContainerTransactor) SetAddressKMS(opts *bind.TransactOpts, address_KMS common.Address) (*types.Transaction, error) {\n\treturn _Container.contract.Transact(opts, \"setAddressKMS\", address_KMS)\n}", "func (m *PaymentchannelMutation) SetBank(s string) {\n\tm._Bank = &s\n}", "func (r ApiGetMetricsForBitlinkByReferrersRequest) UnitReference(unitReference string) ApiGetMetricsForBitlinkByReferrersRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (oumu *OrgUnitMemberUpdate) SetBelongToOrgUnit(o *OrgUnit) *OrgUnitMemberUpdate {\n\treturn oumu.SetBelongToOrgUnitID(o.ID)\n}", "func (o *Ga4ghChemotherapy) SetDoseUnit(v string) {\n\to.DoseUnit = &v\n}", "func (r ApiGetMetricsForBitlinkByReferrersByDomainsRequest) UnitReference(unitReference string) ApiGetMetricsForBitlinkByReferrersByDomainsRequest {\n\tr.unitReference = &unitReference\n\treturn r\n}", "func (o ClusterNodeGroupSubscriptionConfigOutput) PaymentDurationUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeGroupSubscriptionConfig) string { return v.PaymentDurationUnit }).(pulumi.StringOutput)\n}", "func (o *TransactionSplit) SetBunqPaymentId(v string) {\n\to.BunqPaymentId.Set(&v)\n}", "func (oumuo *OrgUnitMemberUpdateOne) SetBelongToOrgUnit(o *OrgUnit) *OrgUnitMemberUpdateOne {\n\treturn oumuo.SetBelongToOrgUnitID(o.ID)\n}", "func (s *Accessor) SetBillingToken(v string) *Accessor {\n\ts.BillingToken = &v\n\treturn s\n}", "func (s *CreateOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *CreateOrganizationalUnitOutput {\n\ts.OrganizationalUnit = v\n\treturn s\n}", "func (o ClusterNodeGroupSubscriptionConfigPtrOutput) PaymentDurationUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterNodeGroupSubscriptionConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.PaymentDurationUnit\n\t}).(pulumi.StringPtrOutput)\n}", "func (o *GetReceiptsParams) SetOrganizationalUnit(organizationalUnit *string) {\n\to.OrganizationalUnit = organizationalUnit\n}", "func (o *ReservationModel) SetUnitGroup(v EmbeddedUnitGroupModel) {\n\to.UnitGroup = v\n}", "func NewRackUnitPersonality(classId string, objectType string) *RackUnitPersonality {\n\tthis := RackUnitPersonality{}\n\tthis.ClassId = classId\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func withOrgUnitMember(node *OrgUnitMember) orgunitmemberOption {\n\treturn func(m *OrgUnitMemberMutation) {\n\t\tm.oldValue = func(context.Context) (*OrgUnitMember, error) {\n\t\t\treturn node, nil\n\t\t}\n\t\tm.id = &node.ID\n\t}\n}", "func (_IndividuallyCappedCrowdsaleImpl *IndividuallyCappedCrowdsaleImplTransactor) SetGroupCap(opts *bind.TransactOpts, _beneficiaries []common.Address, _cap *big.Int) (*types.Transaction, error) {\n\treturn _IndividuallyCappedCrowdsaleImpl.contract.Transact(opts, \"setGroupCap\", _beneficiaries, _cap)\n}", "func (oumu *OrgUnitMemberUpdate) ClearBelongToOrgUnit() *OrgUnitMemberUpdate {\n\toumu.mutation.ClearBelongToOrgUnit()\n\treturn oumu\n}", "func (b *ClusterBuilder) BillingModel(value BillingModel) *ClusterBuilder {\n\tb.billingModel = value\n\tb.bitmap_ |= 1024\n\treturn b\n}", "func (p *PerformanceDataPoint) SetUnit(unit string) *PerformanceDataPoint {\n\tp.Unit = unit\n\treturn p\n}", "func (v *Txn) Setb(json []byte) (resp *api.Assigned, err error) {\n\treturn v.Mutate(&api.Mutation{\n\t\tSetJson: json,\n\t})\n}", "func (b *AddonInstallationBuilder) Billing(value *AddonInstallationBillingBuilder) *AddonInstallationBuilder {\n\tb.billing = value\n\tif value != nil {\n\t\tb.bitmap_ |= 32\n\t} else {\n\t\tb.bitmap_ &^= 32\n\t}\n\treturn b\n}", "func (s *TtlDuration) SetUnit(v string) *TtlDuration {\n\ts.Unit = &v\n\treturn s\n}", "func (_BaseContentSpace *BaseContentSpaceTransactor) SetAddressKMS(opts *bind.TransactOpts, address_KMS common.Address) (*types.Transaction, error) {\n\treturn _BaseContentSpace.contract.Transact(opts, \"setAddressKMS\", address_KMS)\n}", "func (k Keeper) SetOwnerGateway(ctx sdk.Context, owner sdk.AccAddress, moniker string) {\n\tstore := ctx.KVStore(k.storeKey)\n\tbz := k.cdc.MustMarshalBinaryLengthPrefixed(moniker)\n\n\t// set KeyOwnerGateway\n\tstore.Set(KeyOwnerGateway(owner, moniker), bz)\n}", "func (o *TransactionSplit) UnsetBunqPaymentId() {\n\to.BunqPaymentId.Unset()\n}", "func (s *DescribeOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *DescribeOrganizationalUnitOutput {\n\ts.OrganizationalUnit = v\n\treturn s\n}", "func NewAdministrativeUnitsAdministrativeUnitItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdministrativeUnitsAdministrativeUnitItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewAdministrativeUnitsAdministrativeUnitItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "func (as AccountStorage) SetReward(ctx sdk.Context, accKey types.AccountKey, reward *Reward) sdk.Error {\n\tstore := ctx.KVStore(as.key)\n\trewardByte, err := as.cdc.MarshalJSON(*reward)\n\tif err != nil {\n\t\treturn ErrFailedToMarshalReward(err)\n\t}\n\tstore.Set(getRewardKey(accKey), rewardByte)\n\treturn nil\n}", "func (a *Meta_UsState) Set(fieldName string, value interface{}) {\n\tif a.AdditionalProperties == nil {\n\t\ta.AdditionalProperties = make(map[string]interface{})\n\t}\n\ta.AdditionalProperties[fieldName] = value\n}", "func (s *UpdateOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *UpdateOrganizationalUnitOutput {\n\ts.OrganizationalUnit = v\n\treturn s\n}", "func (o ClusterSubscriptionConfigOutput) PaymentDurationUnit() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterSubscriptionConfig) string { return v.PaymentDurationUnit }).(pulumi.StringOutput)\n}", "func (m *OrgUnitMemberMutation) ResetOrgUnitID() {\n\tm.belongToOrgUnit = nil\n}", "func (b *EducationSchoolRequestBuilder) AdministrativeUnit() *AdministrativeUnitRequestBuilder {\n\tbb := &AdministrativeUnitRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}\n\tbb.baseURL += \"/administrativeUnit\"\n\treturn bb\n}", "func (o *UpdateOrganizationBillingAddressParams) WithAddressResource(addressResource *api_models.OrganizationAddress) *UpdateOrganizationBillingAddressParams {\n\to.SetAddressResource(addressResource)\n\treturn o\n}", "func (bm *BoxMüller) SetMu(x float64) {\n\tbm.mu = x\n}", "func (o ClusterSubscriptionConfigPtrOutput) PaymentDurationUnit() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterSubscriptionConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.PaymentDurationUnit\n\t}).(pulumi.StringPtrOutput)\n}", "func BindTextureUnit(unit uint32, texture uint32) {\n\tC.glowBindTextureUnit(gpBindTextureUnit, (C.GLuint)(unit), (C.GLuint)(texture))\n}", "func BindTextureUnit(unit uint32, texture uint32) {\n\tC.glowBindTextureUnit(gpBindTextureUnit, (C.GLuint)(unit), (C.GLuint)(texture))\n}", "func (a *Account) UpdateBillingEmail(tx *storage.Connection, newName string) error {\n\tif newName == \"\" {\n\t\treturn errors.New(\"Error: invalid E-Mail\")\n\t}\n\ta.BillingEmail = newName\n\treturn tx.UpdateOnly(a, \"billing_email\", \"updated_at\")\n}", "func (_BaseContent *BaseContentTransactor) SetAddressKMS(opts *bind.TransactOpts, address_KMS common.Address) (*types.Transaction, error) {\n\treturn _BaseContent.contract.Transact(opts, \"setAddressKMS\", address_KMS)\n}", "func (m *OrgUnitPositionMutation) ResetBelongToOrgUnit() {\n\tm.belongToOrgUnit = nil\n\tm.clearedbelongToOrgUnit = false\n}", "func (r ApiGetOrganizationShortenCountsRequest) Unit(unit TimeUnit) ApiGetOrganizationShortenCountsRequest {\n\tr.unit = &unit\n\treturn r\n}", "func (_BaseAccessWallet *BaseAccessWalletTransactor) SetAddressKMS(opts *bind.TransactOpts, address_KMS common.Address) (*types.Transaction, error) {\n\treturn _BaseAccessWallet.contract.Transact(opts, \"setAddressKMS\", address_KMS)\n}", "func setupAWS(ctx context.Context, bucket string) (*blob.Bucket, error) {\n\tc := &aws.Config{\n\t\t// Either hard-code the region or use AWS_REGION.\n\t\tRegion: aws.String(\"us-east-2\"),\n\t\t// credentials.NewEnvCredentials assumes two environment variables are\n\t\t// present:\n\t\t// 1. AWS_ACCESS_KEY_ID, and\n\t\t// 2. AWS_SECRET_ACCESS_KEY.\n\t\tCredentials: credentials.NewEnvCredentials(),\n\t}\n\ts := session.Must(session.NewSession(c))\n\treturn s3blob.OpenBucket(ctx, s, bucket)\n}", "func (oumuo *OrgUnitMemberUpdateOne) ClearBelongToOrgUnit() *OrgUnitMemberUpdateOne {\n\toumuo.mutation.ClearBelongToOrgUnit()\n\treturn oumuo\n}", "func (s *CreateAccessorOutput) SetBillingToken(v string) *CreateAccessorOutput {\n\ts.BillingToken = &v\n\treturn s\n}", "func (m *BillMutation) SetBillingstatusID(id int) {\n\tm._Billingstatus = &id\n}", "func (oumu *OrgUnitMemberUpdate) SetOrgUnitID(i int) *OrgUnitMemberUpdate {\n\toumu.mutation.SetOrgUnitID(i)\n\treturn oumu\n}", "func (m *BillingstatusMutation) ResetBillingstatuss() {\n\tm.billingstatuss = nil\n\tm.removedbillingstatuss = nil\n}", "func BindTextureUnit(unit uint32, texture uint32) {\n\tsyscall.Syscall(gpBindTextureUnit, 2, uintptr(unit), uintptr(texture), 0)\n}" ]
[ "0.6953648", "0.5890108", "0.57229763", "0.5057883", "0.48786855", "0.48318487", "0.47494823", "0.47168577", "0.46298307", "0.46166262", "0.45543838", "0.4532828", "0.4531902", "0.4530853", "0.44759083", "0.4474687", "0.44626573", "0.4447421", "0.44248983", "0.44183716", "0.4407508", "0.4384946", "0.43818235", "0.43790397", "0.43613538", "0.4343453", "0.4331093", "0.4310349", "0.42799702", "0.42797375", "0.42439806", "0.42394936", "0.4218486", "0.42090067", "0.42010665", "0.41877803", "0.41627532", "0.41479465", "0.41459846", "0.4145235", "0.40984085", "0.40902218", "0.40852532", "0.40647507", "0.40594658", "0.4056777", "0.40524405", "0.4045724", "0.40338916", "0.40051526", "0.4000332", "0.3997584", "0.39898276", "0.3984598", "0.3983511", "0.3982435", "0.39798298", "0.3971634", "0.39714155", "0.3959445", "0.3942339", "0.3940743", "0.3934728", "0.39253026", "0.39189908", "0.3914674", "0.39102527", "0.39088345", "0.39082733", "0.39059433", "0.3905882", "0.39051142", "0.38958502", "0.3894132", "0.38928348", "0.3891208", "0.38902175", "0.38809562", "0.38741627", "0.38718295", "0.38687152", "0.3863432", "0.38592374", "0.38511282", "0.38440967", "0.38437113", "0.38375425", "0.38375425", "0.38334352", "0.38325784", "0.38241678", "0.38189408", "0.38119188", "0.3797927", "0.3794813", "0.37935713", "0.37907767", "0.37894598", "0.37671995", "0.37654355" ]
0.78634876
0
GetKeyPair returns the KeyPair field value if set, zero value otherwise.
GetKeyPair возвращает значение поля KeyPair, если оно задано, в противном случае возвращает нулевое значение.
func (o *CloudAwsVirtualMachineAllOf) GetKeyPair() CloudAwsKeyPairRelationship { if o == nil || o.KeyPair == nil { var ret CloudAwsKeyPairRelationship return ret } return *o.KeyPair }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.feclt.GetKeyPair(id)\n}", "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.osclt.GetKeyPair(id)\n}", "func (o *CloudAwsVirtualMachineAllOf) GetKeyPairOk() (*CloudAwsKeyPairRelationship, bool) {\n\tif o == nil || o.KeyPair == nil {\n\t\treturn nil, false\n\t}\n\treturn o.KeyPair, true\n}", "func GetKeyPair(version *avatar.Version) (avatar.KeyPair, error) {\n\t// zero out the Revision field since it is irrelevant to client keys:\n\tv := avatar.Version{version.Major, version.Minor, version.Patch, 0}\n\n\tif pair, ok := keys[v]; ok {\n\t\treturn pair, nil\n\t}\n\n\treturn *emptyPair, errors.New(\"unsupported version\")\n}", "func (o InstanceOutput) KeyPair() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.KeyPair }).(pulumi.StringPtrOutput)\n}", "func KeyPair() (publicKey, privateKey []byte, err error) {\n\treturn defaultPH.KeyPair()\n}", "func (e *Cryptopia) GetPair(key string) *pair.Pair {\n\treturn nil\n}", "func (p *ph) KeyPair() (publicKey, privateKey []byte, err error) {\n\tsecretKey, err := randomBytes(p._SKLEN)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpublicKey, err = p.PubKey(secretKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn publicKey, secretKey, nil\n}", "func (vdb *VspDatabase) KeyPair() (ed25519.PrivateKey, ed25519.PublicKey, error) {\n\tvar seed []byte\n\terr := vdb.db.View(func(tx *bolt.Tx) error {\n\t\tvspBkt := tx.Bucket(vspBktK)\n\n\t\ts := vspBkt.Get(privateKeyK)\n\n\t\t// Byte slices returned from Bolt are only valid during a transaction.\n\t\t// Need to make a copy.\n\t\tseed = make([]byte, len(s))\n\t\tcopy(seed, s)\n\n\t\tif seed == nil {\n\t\t\t// should not happen\n\t\t\treturn fmt.Errorf(\"no private key found\")\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tsignKey := ed25519.NewKeyFromSeed(seed)\n\n\t// Derive pubKey from signKey\n\tpubKey, ok := signKey.Public().(ed25519.PublicKey)\n\tif !ok {\n\t\treturn nil, nil, fmt.Errorf(\"failed to cast signing key: %T\", pubKey)\n\t}\n\n\treturn signKey, pubKey, err\n}", "func (c *Client) Get(key string) (*model.KeyPair, error) {\n\n\t// Create a pointer to a keypair\n\tvar keypair *model.KeyPair\n\n\t// Call the Get function and\n\terr := c.connection.Call(\"RPC.Get\", key, &keypair)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn keypair, nil\n}", "func (p *Provider) GetKeyPair() (_ tls.Certificate, err error) {\n\tif p.key == nil {\n\t\treturn tls.Certificate{}, ErrKeyRequired\n\t}\n\n\tvar block []byte\n\tvar certs bytes.Buffer\n\tfor i, asn1Data := range p.chain.Certificate {\n\t\tvar crt *x509.Certificate\n\t\tif crt, err = x509.ParseCertificate(asn1Data); err != nil {\n\t\t\treturn tls.Certificate{}, fmt.Errorf(\"could not parse certificate %d: %s\", i, err)\n\t\t}\n\n\t\tif block, err = PEMEncodeCertificate(crt); err != nil {\n\t\t\treturn tls.Certificate{}, fmt.Errorf(\"could not encode certificate %d: %s\", i, err)\n\t\t}\n\n\t\tcerts.Write(block)\n\t}\n\n\tvar key []byte\n\tif key, err = PEMEncodePrivateKey(p.key); err != nil {\n\t\treturn tls.Certificate{}, err\n\t}\n\n\treturn tls.X509KeyPair(certs.Bytes(), key)\n}", "func KeyPair() (*[PUBLICKEYBYTES]byte, *[SECRETKEYBYTES]byte) {\n\tpublicKey := [PUBLICKEYBYTES]byte{}\n\tprivateKey := [SECRETKEYBYTES]byte{}\n\tpublicKeyPtr := (*C.uchar)(unsafe.Pointer(&publicKey))\n\tprivateKeyPtr := (*C.uchar)(unsafe.Pointer(&privateKey))\n\tC.crypto_vrf_keypair(publicKeyPtr, privateKeyPtr)\n\treturn &publicKey, &privateKey\n}", "func GetKeyPair(file string) (string, string, error) {\n\t// read keys from file\n\t_, err := os.Stat(file)\n\tif err == nil {\n\t\tpriv, err := ioutil.ReadFile(file)\n\t\tif err != nil {\n\t\t\tlumber.Debug(\"Failed to read file - %s\", err)\n\t\t\tgoto genKeys\n\t\t}\n\t\tpub, err := ioutil.ReadFile(file + \".pub\")\n\t\tif err != nil {\n\t\t\tlumber.Debug(\"Failed to read pub file - %s\", err)\n\t\t\tgoto genKeys\n\t\t}\n\t\treturn string(pub), string(priv), nil\n\t}\n\n\t// generate keys and save to file\ngenKeys:\n\tpub, priv, err := GenKeyPair()\n\terr = ioutil.WriteFile(file, []byte(priv), 0600)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"Failed to write file - %s\", err)\n\t}\n\terr = ioutil.WriteFile(file+\".pub\", []byte(pub), 0644)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"Failed to write pub file - %s\", err)\n\t}\n\n\treturn pub, priv, nil\n}", "func NewKeyPair() (*keyPair, error) {\n\tprivKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprivKey.Precompute()\n\n\tpubKey := &privKey.PublicKey\n\treturn &keyPair{Private: privKey, Public: pubKey}, nil\n}", "func GetKeyPair(file string) (string, string, error) {\n\t// read keys from file\n\t_, err := os.Stat(file)\n\tif err == nil {\n\t\tpriv, err := ioutil.ReadFile(file)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Failed to read file - %s\", err)\n\t\t\tgoto genKeys\n\t\t}\n\t\tpub, err := ioutil.ReadFile(file + \".pub\")\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Failed to read pub file - %s\", err)\n\t\t\tgoto genKeys\n\t\t}\n\t\treturn string(pub), string(priv), nil\n\t}\n\n\t// generate keys and save to file\ngenKeys:\n\tpub, priv, err := GenKeyPair()\n\terr = ioutil.WriteFile(file, []byte(priv), 0600)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"Failed to write file - %s\", err)\n\t}\n\terr = ioutil.WriteFile(file+\".pub\", []byte(pub), 0644)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"Failed to write pub file - %s\", err)\n\t}\n\n\treturn pub, priv, nil\n}", "func (o OceanOutput) KeyPair() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Ocean) pulumi.StringPtrOutput { return v.KeyPair }).(pulumi.StringPtrOutput)\n}", "func (_m *TranslationKeyStore) GetPoisonKeyPair() (*keys.Keypair, error) {\n\tret := _m.Called()\n\n\tvar r0 *keys.Keypair\n\tif rf, ok := ret.Get(0).(func() *keys.Keypair); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*keys.Keypair)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "func (c *CertInfo) KeyPair() tls.Certificate {\n\treturn c.keypair\n}", "func (w *Whisper) NewKeyPair() (string, error) {\n\tkey, err := crypto.GenerateKey()\n\tif err != nil || !validatePrivateKey(key) {\n\t\tkey, err = crypto.GenerateKey() // retry once\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif !validatePrivateKey(key) {\n\t\treturn \"\", fmt.Errorf(\"failed to generate valid key\")\n\t}\n\n\tid, err := GenerateRandomID()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to generate ID: %s\", err)\n\t}\n\n\tw.keyMu.Lock()\n\tdefer w.keyMu.Unlock()\n\n\tif w.privateKeys[id] != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to generate unique ID\")\n\t}\n\tw.privateKeys[id] = key\n\treturn id, nil\n}", "func (hd *HDWallet) KeyPair() (ed25519.PrivateKey, ed25519.PublicKey) {\n\n\tpath, err := bip32path.ParsePath(fmt.Sprintf(pathString, hd.index))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcurve := eddsa.Ed25519()\n\tkey, err := slip10.DeriveKeyFromPath(hd.seed, curve, path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpubKey, privKey := key.Key.(eddsa.Seed).Ed25519Key()\n\n\treturn ed25519.PrivateKey(privKey), ed25519.PublicKey(pubKey)\n}", "func (o *CloudAwsVirtualMachineAllOf) HasKeyPair() bool {\n\tif o != nil && o.KeyPair != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func NewKeyPair(rootKey RootKeyable, chainKey ChainKeyable) *KeyPair {\n\tkeyPair := KeyPair{\n\t\tRootKey: rootKey,\n\t\tChainKey: chainKey,\n\t}\n\n\treturn &keyPair\n}", "func (a *Client) GetKeypair(params *GetKeypairParams, authInfo runtime.ClientAuthInfoWriter) (*GetKeypairOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetKeypairParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getKeypair\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/keypair\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &GetKeypairReader{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.(*GetKeypairOK), nil\n\n}", "func (p PrivateKey) calculateKeyPair() ([]byte, *edwards25519.Scalar, error) {\n\tvar pA edwards25519.Point\n\tvar sa edwards25519.Scalar\n\n\tk, err := (&edwards25519.Scalar{}).SetBytesWithClamping(p)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpub := pA.ScalarBaseMult(k).Bytes()\n\tsignBit := (pub[31] & 0x80) >> 7\n\n\tif signBit == 1 {\n\t\tsa.Negate(k)\n\t\t// Set sig bit to 0\n\t\tpub[31] &= 0x7F\n\t} else {\n\t\tsa.Set(k)\n\t}\n\n\treturn pub, &sa, nil\n}", "func GenerateKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error) {\n\tprivKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn privKey, &privKey.PublicKey, nil\n}", "func GetAccountKeyPairFor(name string) (string, string) {\n\n\tar := AccountsRepository()\n\tpk1, ok := ar.publicKey[name]\n\tvar puk, prk string\n\tif ok {\n\t\tpuk = pk1\n\t} else {\n\t\tpuk = \"\"\n\t}\n\tpk2, ok := ar.privateKey[name]\n\tif ok {\n\t\tprk = pk2\n\t} else {\n\t\tprk = \"\"\n\t}\n\treturn puk, prk\n}", "func (k *KeyPair) GetID() (peer.ID, error) {\n\treturn peer.IDFromPublicKey(k.GetPublicKey())\n}", "func GenerateKeyPair() *rsa.PrivateKey {\n\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Error in generating key-value pair, error is\", err)\n\t}\n\treturn privateKey\n}", "func NewKeyPair() (ecdsa.PrivateKey, []byte) {\n\tellipticCurve := EllipticCurve()\n\n\tprivateKey, err := ecdsa.GenerateKey(ellipticCurve, rand.Reader)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tX := privateKey.PublicKey.X.Bytes()\n\tY := privateKey.PublicKey.Y.Bytes()\n\t//fmt.Println(len(X), X)\n\t//fmt.Println(len(Y), Y)\n\tpublicKey := append(\n\t\tX, // 32 bytes (P256)\n\t\tY..., // 32 bytes (P256)\n\t) // 64 bytes => 64 * 8 bits = 512 bits (perchè usiamo P256 o secp256k)\n\treturn *privateKey, publicKey\n}", "func (o *CloudAwsVirtualMachineAllOf) SetKeyPair(v CloudAwsKeyPairRelationship) {\n\to.KeyPair = &v\n}", "func NewKeyPair(suite suites.Suite, random cipher.Stream) (kyber.Scalar, kyber.Point) {\n\tx := suite.G2().Scalar().Pick(random)\n\tX := suite.G2().Point().Mul(x, nil)\n\treturn x, X\n}", "func (w *Whisper) HasKeyPair(id string) bool {\n\tw.keyMu.RLock()\n\tdefer w.keyMu.RUnlock()\n\treturn w.privateKeys[id] != nil\n}", "func GenerateKeyPair() ([]byte, []byte) {\n\tconst seckeyLen = 32\n\tvar seckey []byte\n\tvar pubkey []byte\n\nnew_seckey:\n\tseckey = RandByte(seckeyLen)\n\tif secp.SeckeyIsValid(seckey) != 1 {\n\t\tgoto new_seckey // regen\n\t}\n\n\tpubkey = pubkeyFromSeckey(seckey)\n\tif pubkey == nil {\n\t\tlog.Panic(\"IMPOSSIBLE: pubkey invalid from valid seckey\")\n\t\tgoto new_seckey\n\t}\n\tif ret := secp.PubkeyIsValid(pubkey); ret != 1 {\n\t\tlog.Panicf(\"ERROR: Pubkey invalid, ret=%d\", ret)\n\t\tgoto new_seckey\n\t}\n\n\treturn pubkey, seckey\n}", "func generateKeyPair() (publicKey, privateKey *[32]byte, err error) {\n\treturn box.GenerateKey(rand.Reader)\n}", "func GenerateKeyPair() (pubkey, privkey []byte) {\n\tkey, err := ecdsa.GenerateKey(secp256k1.S256(), rand.Reader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tpubkey = elliptic.Marshal(secp256k1.S256(), key.X, key.Y)\n\tprivkey = make([]byte, 32)\n\tblob := key.D.Bytes()\n\tcopy(privkey[32-len(blob):], blob)\n\treturn\n}", "func GetSSHKeyPair(secrets interface {\n\tGet(organizationID uint, secretID string) (*secret.SecretItemResponse, error)\n}, organizationID uint, sshSecretID string,\n) (ssh.KeyPair, error) {\n\tsir, err := secrets.Get(organizationID, sshSecretID)\n\tif err != nil {\n\t\treturn ssh.KeyPair{}, err\n\t}\n\treturn sshadapter.KeyPairFromSecret(sir), nil\n}", "func (o *PipelineSshKeyPairAllOf) GetPrivateKeyOk() (*string, bool) {\n\tif o == nil || o.PrivateKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PrivateKey, true\n}", "func (o *PipelineSshKeyPairAllOf) GetPrivateKey() string {\n\tif o == nil || o.PrivateKey == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PrivateKey\n}", "func GenerateKeyPair() (*ecdsa.PrivateKey, error ) {\n\tkey, err := ecdsa.GenerateKey(btcec.S256(), rand.Reader)\n\tif err != nil { return nil, err } \n\treturn key, nil\n}", "func (n *nauth) GenerateKeyPair(passphrase string) ([]byte, []byte, error) {\n\tpriv, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tprivDer := x509.MarshalPKCS1PrivateKey(priv)\n\tprivBlock := pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tHeaders: nil,\n\t\tBytes: privDer,\n\t}\n\tprivPem := pem.EncodeToMemory(&privBlock)\n\n\tpub, err := ssh.NewPublicKey(&priv.PublicKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpubBytes := ssh.MarshalAuthorizedKey(pub)\n\treturn privPem, pubBytes, nil\n}", "func (m *_KeyValuePair) GetKey() QualifiedName {\n\treturn m.Key\n}", "func NewKeyPair(pub crypto.PublicKey, privArmor string) KeyPair {\n\treturn KeyPair{\n\t\tPublicKey: pub,\n\t\tPrivKeyArmor: privArmor,\n\t}\n}", "func (s *SkyСoinService) GenerateKeyPair() *KeysResponse {\n\tseed := getRand()\n\trand.Read(seed)\n\tpub, sec := cipher.GenerateDeterministicKeyPair(seed)\n\treturn &KeysResponse{\n\t\tPrivate: sec.Hex(),\n\t\tPublic: pub.Hex(),\n\t}\n}", "func (p *Pair) Get(key string) (value interface{}, found bool) {\n\tif p == nil {\n\t\treturn\n\t}\n\n\tif p.key == key {\n\t\treturn p.value, true\n\t}\n\n\tif p.prev == nil {\n\t\treturn\n\t}\n\n\treturn p.prev.Get(key)\n}", "func GetPlaybackKeyPair(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *PlaybackKeyPairState, opts ...pulumi.ResourceOption) (*PlaybackKeyPair, error) {\n\tvar resource PlaybackKeyPair\n\terr := ctx.ReadResource(\"aws:ivs/playbackKeyPair:PlaybackKeyPair\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func GenerateKeyPair(group *schnorr.Group) (*SecKey, *PubKey) {\n\ts1 := common.GetRandomInt(group.Q)\n\ts2 := common.GetRandomInt(group.Q)\n\th1 := group.Exp(group.G, s1)\n\th2 := group.Exp(group.G, s2)\n\n\treturn NewSecKey(s1, s2), NewPubKey(h1, h2)\n}", "func TestingKeyPair() *CertInfo {\n\tkeypair, err := tls.X509KeyPair(testCertPEMBlock, testKeyPEMBlock)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"invalid X509 keypair material: %v\", err))\n\t}\n\n\tcert := &CertInfo{\n\t\tkeypair: keypair,\n\t}\n\n\treturn cert\n}", "func (n *nauth) GetNewKeyPairFromPool() ([]byte, []byte, error) {\n\tselect {\n\tcase key := <-n.generatedKeysC:\n\t\treturn key.privPem, key.pubBytes, nil\n\tdefault:\n\t\treturn n.GenerateKeyPair(\"\")\n\t}\n}", "func (s stack) InspectKeyPair(ctx context.Context, id string) (*abstract.KeyPair, fail.Error) {\n\treturn nil, fail.NotImplementedError(\"InspectKeyPair() not implemented yet\") // FIXME: Technical debt\n}", "func (k *KeyPair) GetPrivateKey() p2pCrypto.PrivKey {\n\treturn k.privKey\n}", "func (client *Client) DeleteKeyPair(id string) error {\n\treturn client.feclt.DeleteKeyPair(id)\n}", "func (s *State) PendingKeyExchangeIdentityKeyPair() *identity.KeyPair {\n\treturn s.pendingKeyExchange.localIdentityKeyPair\n}", "func (d Dispatcher) KeyPair() (string, error) {\n\tpriv, pub := crypt.GenKeys()\n\ttemp := make(map[string]string)\n\ttemp[\"priv\"] = priv\n\ttemp[\"pub\"] = pub\n\tkeysBytes, err := helpers.Serialize(temp)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(keysBytes), nil\n}", "func (b *Base) GenerateKeyPair(req *GenerateKeyPairReq) (*GenerateKeyPairResp, error) {\n\treturn nil, ErrFunctionNotSupported\n}", "func GenerateKeypair() (privkey, pubkey []byte, err error) {\n\tpair, err := noise.DH25519.GenerateKeypair(rand.Reader)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// pair.Public is already filled in; assert here that PubkeyFromPrivkey\n\t// agrees with it.\n\tderivedPubkey := PubkeyFromPrivkey(pair.Private)\n\tif !bytes.Equal(derivedPubkey, pair.Public) {\n\t\tpanic(fmt.Sprintf(\"expected pubkey %x, got %x\", derivedPubkey, pair.Public))\n\t}\n\n\treturn pair.Private, pair.Public, nil\n}", "func (ls KvPairs) Get(key string) (Bytex, bool) {\n\n\tkvp_mu.RLock()\n\tdefer kvp_mu.RUnlock()\n\n\tfor _, prev := range ls {\n\n\t\tif prev.Key == key {\n\t\t\treturn Bytex(prev.Value), true\n\t\t}\n\t}\n\n\treturn Bytex(\"\"), false\n}", "func (s stack) DeleteKeyPair(ctx context.Context, id string) fail.Error {\n\treturn fail.NotImplementedError(\"DeleteKeyPair() not implemented yet\") // FIXME: Technical debt\n}", "func (client *Client) ListKeyPairs() ([]model.KeyPair, error) {\n\treturn client.feclt.ListKeyPairs()\n}", "func Keypair(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, err error) {\n\tpublic, private, err := ed25519.GenerateKey(rand)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn PublicKey(public), PrivateKey(private), nil\n}", "func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) {\n\tif len(seed) != 0 && len(seed) != seedSize {\n\t\treturn nil, nil, errors.New(\"invalid size of seed\")\n\t}\n\n\tokm, err := generateOKM(seed, h)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tprivKeyFr := frFromOKM(okm)\n\n\tprivKey := &PrivateKey{privKeyFr}\n\tpubKey := privKey.PublicKey()\n\n\treturn pubKey, privKey, nil\n}", "func (_m *Keychain) GetStoredKeyPairInLibP2PFormat() (crypto.PrivKey, crypto.PubKey, error) {\n\tret := _m.Called()\n\n\tvar r0 crypto.PrivKey\n\tif rf, ok := ret.Get(0).(func() crypto.PrivKey); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(crypto.PrivKey)\n\t\t}\n\t}\n\n\tvar r1 crypto.PubKey\n\tif rf, ok := ret.Get(1).(func() crypto.PubKey); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tif ret.Get(1) != nil {\n\t\t\tr1 = ret.Get(1).(crypto.PubKey)\n\t\t}\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func() error); ok {\n\t\tr2 = rf()\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "func (m *KeyValue) GetKey()(*string) {\n return m.key\n}", "func (client *Client) DeleteKeyPair(id string) error {\n\treturn client.osclt.DeleteKeyPair(id)\n}", "func (c *Curve25519) GenerateKeyPair() (KeyPair, error) {\n\n\tvar priv [32]byte\n\n\t// fill private key\n\t_, err := c.randSource.Read(priv[:])\n\tif err != nil {\n\t\treturn KeyPair{}, err\n\t}\n\n\tpriv[0] &= 248\n\tpriv[31] &= 127\n\tpriv[31] |= 64\n\n\tvar pubKey [32]byte\n\tcurve25519.ScalarBaseMult(&pubKey, &priv)\n\n\treturn KeyPair{\n\t\tPrivateKey: priv,\n\t\tPublicKey: pubKey,\n\t}, nil\n\n}", "func GenerateKeyPair(rand io.Reader) (*PublicKey, *PrivateKey, error) {\n\tvar seed [KeySeedSize]byte\n\tif rand == nil {\n\t\trand = cryptoRand.Reader\n\t}\n\t_, err := io.ReadFull(rand, seed[:])\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpk, sk := NewKeyFromSeed(seed[:])\n\treturn pk, sk, nil\n}", "func (k *KeyPair) GetPublicKey() p2pCrypto.PubKey {\n\treturn k.pubKey\n}", "func (s *V3Backend) Get(ctx context.Context, key string) (args.Pair, error) {\n\tresp, err := s.Client.Get(ctx, key)\n\tif err != nil {\n\t\treturn args.Pair{}, err\n\t}\n\tif len(resp.Kvs) == 0 {\n\t\treturn args.Pair{}, errors.New(fmt.Sprintf(\"'%s' not found\", key))\n\t}\n\treturn args.Pair{Key: string(resp.Kvs[0].Key), Value: resp.Kvs[0].Value}, nil\n}", "func (p *KeyPair) String() string {\n\treturn helper.BytesToHex(p.PrivateKey)\n}", "func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) {\n\tif len(seed) != 0 && len(seed) != seedSize {\n\t\treturn nil, nil, errors.New(\"invalid size of seed\")\n\t}\n\n\tokm, err := generateOKM(seed, h)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tprivKeyFr, err := frFromOKM(okm)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"convert OKM to FR: %w\", err)\n\t}\n\n\tprivKey := &PrivateKey{PrivKey: g2pubs.NewSecretKeyFromFR(privKeyFr)}\n\tpubKey := privKey.PublicKey()\n\n\treturn pubKey, privKey, nil\n}", "func GenLamportKeyPair() *Keypair {\n\tkp := Keypair{\n\t\tpublic: [256]*key{},\n\t\tprivate: [256]*key{},\n\t}\n\n\tpub, priv := genKeyPair()\n\tcopy(kp.public[:], pub)\n\tcopy(kp.private[:], priv)\n\treturn &kp\n}", "func ExtractKeyPairs(page pagination.Page) ([]os.KeyPair, error) {\n\treturn os.ExtractKeyPairs(page)\n}", "func GenKeyPair() (string, string, error) {\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tprivateKeyPEM := &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(privateKey)}\n\tvar private bytes.Buffer\n\tif err := pem.Encode(&private, privateKeyPEM); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\t// generate public key\n\tpub, err := ssh.NewPublicKey(&privateKey.PublicKey)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tpublic := ssh.MarshalAuthorizedKey(pub)\n\treturn string(public), private.String(), nil\n}", "func GenKeyPair() (string, string, error) {\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tprivateKeyPEM := &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(privateKey)}\n\tvar private bytes.Buffer\n\tif err := pem.Encode(&private, privateKeyPEM); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\t// generate public key\n\tpub, err := ssh.NewPublicKey(&privateKey.PublicKey)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tpublic := ssh.MarshalAuthorizedKey(pub)\n\treturn string(public), private.String(), nil\n}", "func (_IUniswapV2Factory *IUniswapV2FactoryCallerSession) GetPair(tokenA common.Address, tokenB common.Address) (common.Address, error) {\r\n\treturn _IUniswapV2Factory.Contract.GetPair(&_IUniswapV2Factory.CallOpts, tokenA, tokenB)\r\n}", "func NewPair(p *big.Int, g int64) (*big.Int, *big.Int) {\n\tprivateKey := PrivateKey(p)\n\tpublicKey := PublicKey(privateKey, p, g)\n\treturn privateKey, publicKey\n}", "func (_IUniswapV2Factory *IUniswapV2FactorySession) GetPair(tokenA common.Address, tokenB common.Address) (common.Address, error) {\r\n\treturn _IUniswapV2Factory.Contract.GetPair(&_IUniswapV2Factory.CallOpts, tokenA, tokenB)\r\n}", "func (client *Client) CreateKeyPair(name string) (*model.KeyPair, error) {\n\treturn client.feclt.CreateKeyPair(name)\n}", "func GetKeyPairController(req *server.Request) {\n\treq.Response.Header().Set(\"Content-Type\", \"application/json\")\n\n\tretData := &common.APISSHPair{\n\t\tPrivate: req.APIKey.SSHPrivate,\n\t\tPublic: req.APIKey.SSHPublic,\n\t}\n\n\tenc := json.NewEncoder(req.Response)\n\terr := enc.Encode(retData)\n\tif err != nil {\n\t\treq.App.Log.Error(err.Error())\n\t\thttp.Error(req.Response, err.Error(), 500)\n\t}\n}", "func GetPSK(t *testing.T) *PresharedKey {\n\tt.Helper()\n\n\tk, _ := GeneratePSK()\n\treturn &k\n}", "func (sas serviceAccounts) ForKeyPair(\n\tkeyID, keySecret string,\n) (*models.ServiceAccount, error) {\n\tsa := []*models.ServiceAccount{}\n\tif _, err := sas.storage.PG.DB.Query(\n\t\t&sa, `SELECT id, name, key_id, key_secret, email, base_role_id\n\t\tFROM service_accounts WHERE key_id = ? AND key_secret = ?`,\n\t\tkeyID, keySecret,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tif len(sa) == 0 {\n\t\treturn nil, errors.NewEntityNotFoundError(models.ServiceAccount{}, keyID)\n\t}\n\treturn sa[0], nil\n}", "func (s stack) ListKeyPairs(context.Context) ([]*abstract.KeyPair, fail.Error) {\n\treturn nil, fail.NotImplementedError(\"ListKeyPairs() not implemented yet\") // FIXME: Technical debt\n}", "func (f *fileStore) LoadKeyPair(targetScheme *crypto.Scheme) (*Pair, error) {\n\tp := new(Pair)\n\tif targetScheme != nil {\n\t\tp.Public = new(Identity)\n\t\tp.Public.Scheme = targetScheme\n\t}\n\tif err := Load(f.privateKeyFile, p); err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, Load(f.publicKeyFile, p.Public)\n}", "func newKeyPair() (ecdsa.PrivateKey, []byte) {\n\tcurve := elliptic.P256()\n\n\tpriKey, err := ecdsa.GenerateKey(curve, rand.Reader)\n\tif err != nil {\n\t\tlog.Panicln(err)\n\t}\n\tpubKey := append(priKey.PublicKey.X.Bytes(), priKey.PublicKey.Y.Bytes()...)\n\n\treturn *priKey, pubKey\n}", "func NewKeyPair(config CreateKeyPairConfig) (KeyPair, error) {\n\tif config.Type == Default {\n\t\tconfig.Type = Ecdsa\n\t}\n\n\tswitch config.Type {\n\tcase Ecdsa:\n\t\treturn newEcdsaKeyPair(config)\n\tcase Rsa:\n\t\treturn newRsaKeyPair(config)\n\t}\n\n\treturn KeyPair{}, fmt.Errorf(\"Unable to generate new key pair, type %s is not supported\",\n\t\tconfig.Type.String())\n}", "func NewKeypair() (*Keypair, error) {\n\tpub, priv, err := GenerateKeypair()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Keypair{\n\t\tpriv: *priv,\n\t\tpub: *pub,\n\t}, nil\n}", "func (client *Client) ListKeyPairs() ([]model.KeyPair, error) {\n\treturn client.osclt.ListKeyPairs()\n}", "func (w *Whisper) DeleteKeyPair(key string) bool {\n\tw.keyMu.Lock()\n\tdefer w.keyMu.Unlock()\n\n\tif w.privateKeys[key] != nil {\n\t\tdelete(w.privateKeys, key)\n\t\treturn true\n\t}\n\treturn false\n}", "func GetOrCreateSSHKeyPair(secrets interface {\n\tGet(organizationID uint, secretID string) (*secret.SecretItemResponse, error)\n\tStore(organizationID uint, request *secret.CreateSecretRequest) (string, error)\n}, cluster interface {\n\tGetID() uint\n\tGetName() string\n\tGetOrganizationID() uint\n\tGetSSHSecretID() string\n\tGetUID() string\n},\n) (ssh.KeyPair, string, error) {\n\tsshSecretID := cluster.GetSSHSecretID()\n\tif sshSecretID == \"\" {\n\t\treturn CreateSSHKeyPair(secrets, cluster.GetOrganizationID(), cluster.GetID(), cluster.GetName(), cluster.GetUID())\n\t}\n\tsshKeyPair, err := GetSSHKeyPair(secrets, cluster.GetOrganizationID(), sshSecretID)\n\treturn sshKeyPair, sshSecretID, err\n}", "func (c VpnCredential) GetKey() string {\n\treturn c.Key\n}", "func (o ClusterNodeAttributeOutput) KeyPairName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeAttribute) string { return v.KeyPairName }).(pulumi.StringOutput)\n}", "func CreateKeyPair() (pubKey PublicKey, secKey SecretKey, err error) {\n\terrorCode := C.crypto_sign_keypair((*C.uchar)(&pubKey[0]), (*C.uchar)(&secKey[0]))\n\tif errorCode != 0 {\n\t\terr = errors.New(\"call to crypto_sign_keypair failed\")\n\t}\n\treturn\n}", "func (o EcsLaunchTemplateOutput) KeyPairName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EcsLaunchTemplate) pulumi.StringPtrOutput { return v.KeyPairName }).(pulumi.StringPtrOutput)\n}", "func ParseKeyPair(r io.Reader) (*KeyPair, error) {\n\tvar s ssbSecret\n\tif err := json.NewDecoder(r).Decode(&s); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.Parse: JSON decoding failed\")\n\t}\n\n\tpublic, err := base64.StdEncoding.DecodeString(strings.TrimSuffix(s.Public, \".ed25519\"))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.Parse: base64 decode of public part failed\")\n\t}\n\n\tprivate, err := base64.StdEncoding.DecodeString(strings.TrimSuffix(s.Private, \".ed25519\"))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.Parse: base64 decode of private part failed\")\n\t}\n\n\tvar kp secrethandshake.EdKeyPair\n\tcopy(kp.Public[:], public)\n\tcopy(kp.Secret[:], private)\n\n\tssbkp := KeyPair{\n\t\tId: s.ID,\n\t\tPair: kp,\n\t}\n\treturn &ssbkp, nil\n}", "func (c *Client) GetPairs() error {\n\tu := url.URL{Scheme: \"https\", Host: \"api.kraken.com\", Path: \"/0/public/AssetPairs\"}\n\tres, err := http.Get(u.String())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer res.Body.Close()\n\tbody, err := ioutil.ReadAll(res.Body)\n\n\tvar pairsResponse assetPairResponse\n\terr = json.Unmarshal(body, &pairsResponse)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar pairs []string\n\tfor key := range pairsResponse.Result {\n\t\tif pairsResponse.Result[key].Pair != \"\" {\n\t\t\tpairs = append(pairs, pairsResponse.Result[key].Pair)\n\t\t}\n\t}\n\t// c.Pairs = pairs\n\tc.Pairs = []string{\"XBT/USD\", \"XBT/CAD\", \"ETH/USD\", \"ETH/CAD\", \"XRP/USD\", \"XRP/CAD\"}\n\treturn nil\n}", "func (_SushiV2Factory *SushiV2FactorySession) GetPair(arg0 common.Address, arg1 common.Address) (common.Address, error) {\n\treturn _SushiV2Factory.Contract.GetPair(&_SushiV2Factory.CallOpts, arg0, arg1)\n}", "func (v *PublicParamsManager) NewCertifierKeyPair() ([]byte, []byte, error) {\n\tpanic(\"NewCertifierKeyPair cannot be called from fabtoken\")\n}", "func newKeyPair() (ecdsa.PrivateKey, []byte) {\n\t// ECC generate private key\n\tcurve := elliptic.P256()\n\tprivate, err := ecdsa.GenerateKey(curve, rand.Reader)\n\tlog.Println(\"--------\", private)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\t// private key generate public key\n\tpubKey := append(private.PublicKey.X.Bytes(), private.PublicKey.Y.Bytes()...)\n\treturn *private, pubKey\n}", "func (_SushiV2Factory *SushiV2FactoryCallerSession) GetPair(arg0 common.Address, arg1 common.Address) (common.Address, error) {\n\treturn _SushiV2Factory.Contract.GetPair(&_SushiV2Factory.CallOpts, arg0, arg1)\n}", "func (client *Client) CreateKeyPair(name string) (*model.KeyPair, error) {\n\treturn client.osclt.CreateKeyPair(name)\n}", "func (v *KeyValue_SetValueV2_Args) GetKey() (o Key) {\n\tif v != nil {\n\t\to = v.Key\n\t}\n\treturn\n}" ]
[ "0.75120753", "0.74316525", "0.69698906", "0.6735079", "0.6679419", "0.6659267", "0.65252054", "0.64874285", "0.6468373", "0.6437245", "0.64149314", "0.6394708", "0.6146873", "0.6131079", "0.6117827", "0.6115615", "0.6075201", "0.6060732", "0.6035501", "0.60176426", "0.5968178", "0.5963591", "0.5956374", "0.59187925", "0.5917879", "0.5892177", "0.588309", "0.584286", "0.58399665", "0.58362967", "0.5806008", "0.57891846", "0.5785592", "0.5737444", "0.57369685", "0.5731865", "0.5717478", "0.5700896", "0.5687232", "0.5657224", "0.5655431", "0.56439024", "0.5639298", "0.56346345", "0.5599277", "0.5598984", "0.55978656", "0.5583471", "0.5566603", "0.55652434", "0.55280906", "0.5526194", "0.55215466", "0.55214286", "0.5485658", "0.54500866", "0.5440168", "0.5424167", "0.5423986", "0.54118603", "0.54107696", "0.53993636", "0.53985447", "0.5335319", "0.5330439", "0.53151315", "0.5313456", "0.53094184", "0.5295806", "0.5288973", "0.5287903", "0.5284205", "0.5284205", "0.5280539", "0.5278352", "0.5274471", "0.5267402", "0.526477", "0.524333", "0.52345693", "0.5223243", "0.52121705", "0.5211647", "0.5208432", "0.52078867", "0.5206991", "0.519506", "0.5183685", "0.51818186", "0.5174588", "0.51682097", "0.516259", "0.51595795", "0.51571935", "0.5154079", "0.51493835", "0.5146495", "0.51446784", "0.51409435", "0.5138559" ]
0.75254697
0
GetKeyPairOk returns a tuple with the KeyPair field value if set, nil otherwise and a boolean to check if the value has been set.
GetKeyPairOk возвращает кортеж с значением поля KeyPair, если оно задано, и nil в противном случае, а также булевое значение для проверки, было ли значение задано.
func (o *CloudAwsVirtualMachineAllOf) GetKeyPairOk() (*CloudAwsKeyPairRelationship, bool) { if o == nil || o.KeyPair == nil { return nil, false } return o.KeyPair, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *PipelineSshKeyPairAllOf) GetPrivateKeyOk() (*string, bool) {\n\tif o == nil || o.PrivateKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PrivateKey, true\n}", "func (o *CloudAwsVirtualMachineAllOf) HasKeyPair() bool {\n\tif o != nil && o.KeyPair != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (w *Whisper) HasKeyPair(id string) bool {\n\tw.keyMu.RLock()\n\tdefer w.keyMu.RUnlock()\n\treturn w.privateKeys[id] != nil\n}", "func (o *TppCredentialsParams) GetTppApiKeyOk() (*string, bool) {\n\tif o == nil || o.TppApiKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TppApiKey, true\n}", "func (o *PipelineSshKeyPairAllOf) GetPublicKeyOk() (*string, bool) {\n\tif o == nil || o.PublicKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PublicKey, true\n}", "func (o *TppCertificateParams) GetPrivateKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.PrivateKey, true\n}", "func isValidKeyPair(param []string) bool {\n\treturn len(param) == 2\n}", "func (o *CloudAwsVirtualMachineAllOf) GetKeyPair() CloudAwsKeyPairRelationship {\n\tif o == nil || o.KeyPair == nil {\n\t\tvar ret CloudAwsKeyPairRelationship\n\t\treturn ret\n\t}\n\treturn *o.KeyPair\n}", "func (o *DeployKey) GetKeyOk() (*string, bool) {\n\tif o == nil || o.Key == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Key, true\n}", "func (o *FiltersVmGroup) GetTagKeysOk() (*[]string, bool) {\n\tif o == nil || o.TagKeys == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TagKeys, true\n}", "func (o *ApiKey) GetKeyOk() (*string, bool) {\n\tif o == nil || o.Key == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Key, true\n}", "func (o *LabelProperties) GetKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Key, true\n}", "func (o *FiltersSecurityGroup) GetTagKeysOk() (*[]string, bool) {\n\tif o == nil || o.TagKeys == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TagKeys, true\n}", "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.feclt.GetKeyPair(id)\n}", "func (o *FiltersNet) GetTagKeysOk() ([]string, bool) {\n\tif o == nil || o.TagKeys == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.TagKeys, true\n}", "func NewGetKeyPairsOK() *GetKeyPairsOK {\n\treturn &GetKeyPairsOK{}\n}", "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.osclt.GetKeyPair(id)\n}", "func (o *DnsViewparamDataData) GetViewparamKeyOk() (*string, bool) {\n\tif o == nil || o.ViewparamKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ViewparamKey, true\n}", "func (k *KeyPair) IsValid() bool {\n\treturn k.Cert != nil && k.Key != nil\n}", "func (o *ChartDataPoint) GetKeyOk() (*string, bool) {\n\tif o == nil || o.Key == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Key, true\n}", "func (o *FiltersNatService) GetTagKeysOk() ([]string, bool) {\n\tif o == nil || o.TagKeys == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.TagKeys, true\n}", "func (o *TppCertificateParams) GetPassphraseOk() (*string, bool) {\n\tif o == nil || o.Passphrase == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Passphrase, true\n}", "func (o *CustomHostMetadataKey) GetKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Key, true\n}", "func (o *FiltersVirtualGateway) GetTagKeysOk() ([]string, bool) {\n\tif o == nil || o.TagKeys == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.TagKeys, true\n}", "func (o *VulnUpdateNotification) GetRecordStateKeyOk() (*string, bool) {\n\tif o == nil || o.RecordStateKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RecordStateKey, true\n}", "func (o *Commitstatus) GetKeyOk() (*string, bool) {\n\tif o == nil || o.Key == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Key, true\n}", "func (o *SearchTagItem) GetKeyOk() (*string, bool) {\n\tif o == nil || o.Key == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Key, true\n}", "func (o *TppCertificateParams) GetPublicKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.PublicKey, true\n}", "func (e JsonToMetadata_KeyValuePairValidationError) Key() bool { return e.key }", "func (o *ModelsAzureCredentials) GetAccountKeyOk() (*string, bool) {\n\tif o == nil || o.AccountKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AccountKey, true\n}", "func (o *PagerDutyServiceKey) GetServiceKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ServiceKey, true\n}", "func (_m *TranslationKeyStore) GetPoisonKeyPair() (*keys.Keypair, error) {\n\tret := _m.Called()\n\n\tvar r0 *keys.Keypair\n\tif rf, ok := ret.Get(0).(func() *keys.Keypair); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*keys.Keypair)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "func (v *OrderedValues) GetOk(key []byte) ([]byte, bool) {\n\tfor _, j := range *v {\n\t\tif len(j) > 0 && bytes.Equal(j[0], key) {\n\t\t\tif len(j) > 1 {\n\t\t\t\treturn j[1], true\n\t\t\t}\n\t\t\treturn nil, true\n\t\t}\n\t}\n\treturn nil, false\n}", "func (o *ResourceDefinitionFilter) GetKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Key, true\n}", "func (o *LongProperty) GetKeyOk() (*string, bool) {\n\tif o == nil || o.Key == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Key, true\n}", "func (e *Cryptopia) GetPair(key string) *pair.Pair {\n\treturn nil\n}", "func (o *NotificationConfig) GetProjectKeyOk() (*string, bool) {\n\tif o == nil || o.ProjectKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ProjectKey, true\n}", "func (o *NotificationConfig) GetApplicationKeyOk() (*string, bool) {\n\tif o == nil || o.ApplicationKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ApplicationKey, true\n}", "func (o InstanceOutput) KeyPair() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.KeyPair }).(pulumi.StringPtrOutput)\n}", "func (o *NormalizedProjectRevisionHook) GetConfigKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ConfigKey, true\n}", "func (o *ProjectApiKey) GetValueOk() (*string, bool) {\n\tif o == nil || o.Value == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Value, true\n}", "func (p *Pair) IsValid() bool {\n\treturn p.KeyIsValid() && p.ValueIsValid()\n}", "func (o *StorageRemoteKeySetting) GetIsPasswordSetOk() (*bool, bool) {\n\tif o == nil || o.IsPasswordSet == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IsPasswordSet, true\n}", "func (o *EnvironmentVariablePair1) GetValueOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Value, true\n}", "func (o *HyperflexMapClusterIdToProtectionInfoAllOf) GetProtectionInfoOk() (*HyperflexProtectionInfo, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ProtectionInfo.Get(), o.ProtectionInfo.IsSet()\n}", "func (o *ModelsAWSDetails) GetSecretKeyOk() (*string, bool) {\n\tif o == nil || o.SecretKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecretKey, true\n}", "func (o *DKSharesInfo) GetPublicKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.PublicKey, true\n}", "func (o *V0037JobProperties) GetWckeyOk() (*string, bool) {\n\tif o == nil || o.Wckey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Wckey, true\n}", "func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error {\n\treturn c.WaitUntilKeyPairExistsWithContext(aws.BackgroundContext(), input)\n}", "func KeyPair() (*[PUBLICKEYBYTES]byte, *[SECRETKEYBYTES]byte) {\n\tpublicKey := [PUBLICKEYBYTES]byte{}\n\tprivateKey := [SECRETKEYBYTES]byte{}\n\tpublicKeyPtr := (*C.uchar)(unsafe.Pointer(&publicKey))\n\tprivateKeyPtr := (*C.uchar)(unsafe.Pointer(&privateKey))\n\tC.crypto_vrf_keypair(publicKeyPtr, privateKeyPtr)\n\treturn &publicKey, &privateKey\n}", "func (w *Whisper) DeleteKeyPair(key string) bool {\n\tw.keyMu.Lock()\n\tdefer w.keyMu.Unlock()\n\n\tif w.privateKeys[key] != nil {\n\t\tdelete(w.privateKeys, key)\n\t\treturn true\n\t}\n\treturn false\n}", "func (o *ConfluentAccountCreateRequestAttributes) GetApiKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ApiKey, true\n}", "func KeyPair() (publicKey, privateKey []byte, err error) {\n\treturn defaultPH.KeyPair()\n}", "func (o *MicrosoftGraphWorkbookSortField) GetKeyOk() (int32, bool) {\n\tif o == nil || o.Key == nil {\n\t\tvar ret int32\n\t\treturn ret, false\n\t}\n\treturn *o.Key, true\n}", "func (o *AmazonAccountAccessKeys) GetAccessKeyOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.AccessKey, true\n}", "func (o *DeliveryS3Authentication) GetSecretKeyOk() (*string, bool) {\n\tif o == nil || o.SecretKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecretKey, true\n}", "func (tv *TV) DisplayPairingKey() bool {\n\tcommandBody := `<!--?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?--><auth><type>AuthKeyReq</type></auth>`\n\n\ttype Result struct {\n\t\tXMLName xml.Name `xml:\"envelope\"`\n\t\tSuccess string `xml:\"ROAPErrorDetail\"`\n\t}\n\n\tv := Result{}\n\n\tresp, xmlerror := tv.SendXML(commandBody, \"/auth\")\n\n\tif xmlerror != nil {\n\t\treturn false\n\t}\n\n\tbody, readerr := ioutil.ReadAll(resp.Body)\n\tif readerr == nil {\n\t\txml.Unmarshal(body, &v)\n\t}\n\n\treturn resp.StatusCode == 200 && v.Success == \"OK\"\n}", "func verifyKeyPair(chain *security.ChainOfTrust) error {\n\treturn walkChain(chain, func(c *security.ChainOfTrust) error {\n\t\t_, err := tls.LoadX509KeyPair(c.Filename, c.KeyFilename)\n\t\treturn err\n\t})\n}", "func (o *StorageRemoteKeySetting) GetPasswordOk() (*string, bool) {\n\tif o == nil || o.Password == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Password, true\n}", "func GetKeyPair(version *avatar.Version) (avatar.KeyPair, error) {\n\t// zero out the Revision field since it is irrelevant to client keys:\n\tv := avatar.Version{version.Major, version.Minor, version.Patch, 0}\n\n\tif pair, ok := keys[v]; ok {\n\t\treturn pair, nil\n\t}\n\n\treturn *emptyPair, errors.New(\"unsupported version\")\n}", "func (e ClusterPairTargetValidationError) Key() bool { return e.key }", "func TestingKeyPair() *CertInfo {\n\tkeypair, err := tls.X509KeyPair(testCertPEMBlock, testKeyPEMBlock)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"invalid X509 keypair material: %v\", err))\n\t}\n\n\tcert := &CertInfo{\n\t\tkeypair: keypair,\n\t}\n\n\treturn cert\n}", "func (p *Provider) GetKeyPair() (_ tls.Certificate, err error) {\n\tif p.key == nil {\n\t\treturn tls.Certificate{}, ErrKeyRequired\n\t}\n\n\tvar block []byte\n\tvar certs bytes.Buffer\n\tfor i, asn1Data := range p.chain.Certificate {\n\t\tvar crt *x509.Certificate\n\t\tif crt, err = x509.ParseCertificate(asn1Data); err != nil {\n\t\t\treturn tls.Certificate{}, fmt.Errorf(\"could not parse certificate %d: %s\", i, err)\n\t\t}\n\n\t\tif block, err = PEMEncodeCertificate(crt); err != nil {\n\t\t\treturn tls.Certificate{}, fmt.Errorf(\"could not encode certificate %d: %s\", i, err)\n\t\t}\n\n\t\tcerts.Write(block)\n\t}\n\n\tvar key []byte\n\tif key, err = PEMEncodePrivateKey(p.key); err != nil {\n\t\treturn tls.Certificate{}, err\n\t}\n\n\treturn tls.X509KeyPair(certs.Bytes(), key)\n}", "func (o *LaunchpadClicks) GetKeywordOk() (*string, bool) {\n\tif o == nil || o.Keyword == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Keyword, true\n}", "func (o *NotificationConfig) GetApiKeyOk() (*string, bool) {\n\tif o == nil || o.ApiKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ApiKey, true\n}", "func (s stack) InspectKeyPair(ctx context.Context, id string) (*abstract.KeyPair, fail.Error) {\n\treturn nil, fail.NotImplementedError(\"InspectKeyPair() not implemented yet\") // FIXME: Technical debt\n}", "func (o *ModelsAWSDetails) GetAccessKeyOk() (*string, bool) {\n\tif o == nil || o.AccessKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AccessKey, true\n}", "func (p *ph) KeyPair() (publicKey, privateKey []byte, err error) {\n\tsecretKey, err := randomBytes(p._SKLEN)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpublicKey, err = p.PubKey(secretKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn publicKey, secretKey, nil\n}", "func (o OceanOutput) KeyPair() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Ocean) pulumi.StringPtrOutput { return v.KeyPair }).(pulumi.StringPtrOutput)\n}", "func (o *PairAnyValueAnyValue) GetFirstOk() (*interface{}, bool) {\n\tif o == nil || o.First == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.First, true\n}", "func (k *KeyPair) isAbleToSign() bool {\n\treturn k.privKey != nil\n}", "func (ls KvPairs) Get(key string) (Bytex, bool) {\n\n\tkvp_mu.RLock()\n\tdefer kvp_mu.RUnlock()\n\n\tfor _, prev := range ls {\n\n\t\tif prev.Key == key {\n\t\t\treturn Bytex(prev.Value), true\n\t\t}\n\t}\n\n\treturn Bytex(\"\"), false\n}", "func (o *GetCredentialsResponseCredential) GetAccessKeyOk() (*string, bool) {\n\tif o == nil || o.AccessKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AccessKey, true\n}", "func (o *DeviceClient) GetRsaPublickeyOk() (*string, bool) {\n\tif o == nil || o.RsaPublickey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RsaPublickey, true\n}", "func (o *Service) GetCredentialsOk() (map[string]map[string]bool, bool) {\n\tif o == nil || o.Credentials == nil {\n\t\tvar ret map[string]map[string]bool\n\t\treturn ret, false\n\t}\n\treturn *o.Credentials, true\n}", "func (o *BasicBot) GetApiKeyOk() (*interface{}, bool) {\n\tif o == nil || o.ApiKey == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ApiKey, true\n}", "func NewKeyPair(rootKey RootKeyable, chainKey ChainKeyable) *KeyPair {\n\tkeyPair := KeyPair{\n\t\tRootKey: rootKey,\n\t\tChainKey: chainKey,\n\t}\n\n\treturn &keyPair\n}", "func (o *NotificationConfig) GetRoutingKeyOk() (*string, bool) {\n\tif o == nil || o.RoutingKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RoutingKey, true\n}", "func (o *TppCredentialsParams) GetTppNameOk() (*string, bool) {\n\tif o == nil || o.TppName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TppName, true\n}", "func (o *PairAnyValueAnyValue) GetSecondOk() (*interface{}, bool) {\n\tif o == nil || o.Second == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Second, true\n}", "func (o *ProcessorSignalDecisionReportRequest) GetSecretOk() (*string, bool) {\n\tif o == nil || o.Secret == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Secret, true\n}", "func (o *UcsdBackupInfoAllOf) GetEncryptionKeyOk() (*string, bool) {\n\tif o == nil || o.EncryptionKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.EncryptionKey, true\n}", "func (o *StorageHitachiVolumeMigrationPair) GetLocalCloneCopypairIdOk() (*string, bool) {\n\tif o == nil || o.LocalCloneCopypairId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.LocalCloneCopypairId, true\n}", "func (_m *Keychain) GetStoredKeyPairInLibP2PFormat() (crypto.PrivKey, crypto.PubKey, error) {\n\tret := _m.Called()\n\n\tvar r0 crypto.PrivKey\n\tif rf, ok := ret.Get(0).(func() crypto.PrivKey); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(crypto.PrivKey)\n\t\t}\n\t}\n\n\tvar r1 crypto.PubKey\n\tif rf, ok := ret.Get(1).(func() crypto.PubKey); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tif ret.Get(1) != nil {\n\t\t\tr1 = ret.Get(1).(crypto.PubKey)\n\t\t}\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func() error); ok {\n\t\tr2 = rf()\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "func (o *ReplicaMapping) GetEncryptionKeyOk() (*string, bool) {\n\tif o == nil || o.EncryptionKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.EncryptionKey, true\n}", "func (o *SamlConfigurationProperties) GetSpPrivateKeyAliasOk() (*SamlConfigurationPropertyItemsString, bool) {\n\tif o == nil || o.SpPrivateKeyAlias == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SpPrivateKeyAlias, true\n}", "func (o *EnvironmentVariablePair1) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *TppCredentialsParams) GetLabelOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Label, true\n}", "func (o *PipelineSshKeyPairAllOf) HasPrivateKey() bool {\n\tif o != nil && o.PrivateKey != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *Wireless) GetBssidOk() (string, bool) {\n\tif o == nil || o.Bssid == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Bssid, true\n}", "func (o *VulnUpdateNotification) GetRecordStateValOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RecordStateVal.Get(), o.RecordStateVal.IsSet()\n}", "func (o *PaymentInitiationPaymentGetResponse) GetWalletIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.WalletId.Get(), o.WalletId.IsSet()\n}", "func GenerateKeyPair() ([]byte, []byte) {\n\tconst seckeyLen = 32\n\tvar seckey []byte\n\tvar pubkey []byte\n\nnew_seckey:\n\tseckey = RandByte(seckeyLen)\n\tif secp.SeckeyIsValid(seckey) != 1 {\n\t\tgoto new_seckey // regen\n\t}\n\n\tpubkey = pubkeyFromSeckey(seckey)\n\tif pubkey == nil {\n\t\tlog.Panic(\"IMPOSSIBLE: pubkey invalid from valid seckey\")\n\t\tgoto new_seckey\n\t}\n\tif ret := secp.PubkeyIsValid(pubkey); ret != 1 {\n\t\tlog.Panicf(\"ERROR: Pubkey invalid, ret=%d\", ret)\n\t\tgoto new_seckey\n\t}\n\n\treturn pubkey, seckey\n}", "func (o *InlineObject4) GetParamOk() (string, bool) {\n\tif o == nil || o.Param == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Param, true\n}", "func (o *AccessKey) GetStateOk() (*string, bool) {\n\tif o == nil || o.State == nil {\n\t\treturn nil, false\n\t}\n\treturn o.State, true\n}", "func (o *CreateInstance) GetParametersOk() (*CreateInstanceParameters, bool) {\n\tif o == nil || IsNil(o.Parameters) {\n\t\treturn nil, false\n\t}\n\treturn o.Parameters, true\n}", "func GenerateKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error) {\n\tprivKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn privKey, &privKey.PublicKey, nil\n}", "func (o *CloudAwsVirtualMachineAllOf) SetKeyPair(v CloudAwsKeyPairRelationship) {\n\to.KeyPair = &v\n}", "func (b ButtonState) PairCheckSelf() (selfPair bool, maybeDouble bool) {\n\tif b.HasAll(ButtonsSLSR_L) || b.HasAll(ButtonsSLSR_R) {\n\t\treturn true, false\n\t}\n\tif b.HasAll(ButtonsLR) || b.HasAll(ButtonsZLZR) {\n\t\treturn true, false\n\t}\n\tif b.HasAny(ButtonsLZL) || b.HasAny(ButtonsRZR) {\n\t\treturn false, true\n\t}\n\treturn false, false\n}", "func hasValidKeyPairs(pairs [][]string) bool {\n\tfor _, pair := range pairs {\n\t\tif !isValidKeyPair(pair) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}" ]
[ "0.7061945", "0.6845642", "0.67340356", "0.64795125", "0.6298071", "0.6288251", "0.6209228", "0.6136143", "0.6126581", "0.61210567", "0.6116035", "0.6100783", "0.6099167", "0.606505", "0.60561866", "0.60348153", "0.6034516", "0.60280585", "0.600494", "0.597722", "0.597281", "0.59683317", "0.5929154", "0.5917671", "0.588171", "0.58744943", "0.5849665", "0.5827286", "0.5789789", "0.5772183", "0.57578224", "0.5754807", "0.5726463", "0.5713218", "0.56973153", "0.566501", "0.5619404", "0.56114507", "0.5597132", "0.5592221", "0.55915004", "0.5589768", "0.5587607", "0.55815804", "0.5575298", "0.55595493", "0.55458343", "0.554487", "0.5522411", "0.55164075", "0.5494257", "0.5480558", "0.54577327", "0.54492134", "0.5443091", "0.54277563", "0.5421291", "0.54057914", "0.54045016", "0.5393935", "0.5390876", "0.53895855", "0.5373736", "0.53675514", "0.53543496", "0.53403014", "0.53289485", "0.5326197", "0.53109944", "0.52817875", "0.52759737", "0.52710724", "0.5270948", "0.52628475", "0.52546483", "0.5251042", "0.5243632", "0.52413857", "0.5240351", "0.5238261", "0.5231451", "0.5228805", "0.5225603", "0.5219171", "0.52183384", "0.5212428", "0.5209057", "0.52070546", "0.5205377", "0.51899856", "0.51848686", "0.51843315", "0.5180205", "0.517699", "0.5176728", "0.51590526", "0.51402915", "0.5135329", "0.51148593", "0.5114522" ]
0.8113723
0
SetKeyPair gets a reference to the given CloudAwsKeyPairRelationship and assigns it to the KeyPair field.
SetKeyPair получает ссылку на заданный CloudAwsKeyPairRelationship и присваивает его полю KeyPair.
func (o *CloudAwsVirtualMachineAllOf) SetKeyPair(v CloudAwsKeyPairRelationship) { o.KeyPair = &v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) GetKeyPair() CloudAwsKeyPairRelationship {\n\tif o == nil || o.KeyPair == nil {\n\t\tvar ret CloudAwsKeyPairRelationship\n\t\treturn ret\n\t}\n\treturn *o.KeyPair\n}", "func (s stack) DeleteKeyPair(ctx context.Context, id string) fail.Error {\n\treturn fail.NotImplementedError(\"DeleteKeyPair() not implemented yet\") // FIXME: Technical debt\n}", "func (client *Client) CreateKeyPair(name string) (*model.KeyPair, error) {\n\treturn client.feclt.CreateKeyPair(name)\n}", "func (client *Client) CreateKeyPair(name string) (*model.KeyPair, error) {\n\treturn client.osclt.CreateKeyPair(name)\n}", "func (s stack) InspectKeyPair(ctx context.Context, id string) (*abstract.KeyPair, fail.Error) {\n\treturn nil, fail.NotImplementedError(\"InspectKeyPair() not implemented yet\") // FIXME: Technical debt\n}", "func (client *Client) DeleteKeyPair(id string) error {\n\treturn client.feclt.DeleteKeyPair(id)\n}", "func (c *Curve25519) GenerateKeyPair() (KeyPair, error) {\n\n\tvar priv [32]byte\n\n\t// fill private key\n\t_, err := c.randSource.Read(priv[:])\n\tif err != nil {\n\t\treturn KeyPair{}, err\n\t}\n\n\tpriv[0] &= 248\n\tpriv[31] &= 127\n\tpriv[31] |= 64\n\n\tvar pubKey [32]byte\n\tcurve25519.ScalarBaseMult(&pubKey, &priv)\n\n\treturn KeyPair{\n\t\tPrivateKey: priv,\n\t\tPublicKey: pubKey,\n\t}, nil\n\n}", "func CreateKeyPair(conn *ec2.EC2) (KeyPair, error) {\n\tname := generateKeyPairName()\n\tvar kp KeyPair\n\tkp.KeyName = name\n\n\tparams := &ec2.CreateKeyPairInput{\n\t\tKeyName: aws.String(name),\n\t}\n\n\tresp, err := conn.CreateKeyPair(params)\n\tif err != nil {\n\t\treturn kp, err\n\t}\n\n\tkp.Fingerprint = *resp.KeyFingerprint\n\tkp.PrivateKeyPEM = *resp.KeyMaterial\n\tkp.Created = true\n\n\treturn kp, nil\n}", "func (client *Client) DeleteKeyPair(id string) error {\n\treturn client.osclt.DeleteKeyPair(id)\n}", "func GenerateKeyPair() (*ecdsa.PrivateKey, error ) {\n\tkey, err := ecdsa.GenerateKey(btcec.S256(), rand.Reader)\n\tif err != nil { return nil, err } \n\treturn key, nil\n}", "func (w *Whisper) AddKeyPair(key *ecdsa.PrivateKey) (string, error) {\n\tid, err := GenerateRandomID()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to generate ID: %s\", err)\n\t}\n\n\tw.keyMu.Lock()\n\tw.privateKeys[id] = key\n\tw.keyMu.Unlock()\n\n\treturn id, nil\n}", "func (b *Base) GenerateKeyPair(req *GenerateKeyPairReq) (*GenerateKeyPairResp, error) {\n\treturn nil, ErrFunctionNotSupported\n}", "func NewKeyPair(pub crypto.PublicKey, privArmor string) KeyPair {\n\treturn KeyPair{\n\t\tPublicKey: pub,\n\t\tPrivKeyArmor: privArmor,\n\t}\n}", "func (n *nauth) GenerateKeyPair(passphrase string) ([]byte, []byte, error) {\n\tpriv, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tprivDer := x509.MarshalPKCS1PrivateKey(priv)\n\tprivBlock := pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tHeaders: nil,\n\t\tBytes: privDer,\n\t}\n\tprivPem := pem.EncodeToMemory(&privBlock)\n\n\tpub, err := ssh.NewPublicKey(&priv.PublicKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpubBytes := ssh.MarshalAuthorizedKey(pub)\n\treturn privPem, pubBytes, nil\n}", "func GenerateKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error) {\n\tprivKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn privKey, &privKey.PublicKey, nil\n}", "func (f *fileStore) SaveKeyPair(p *Pair) error {\n\tif err := Save(f.privateKeyFile, p, true); err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"Saved the key : %s at %s\\n\", p.Public.Addr, f.publicKeyFile) //nolint\n\treturn Save(f.publicKeyFile, p.Public, false)\n}", "func DeleteKeyPair(conn *ec2.EC2, kp KeyPair) (KeyPair, error) {\n\tparams := &ec2.DeleteKeyPairInput{\n\t\tKeyName: aws.String(kp.KeyName),\n\t}\n\n\t_, err := conn.DeleteKeyPair(params)\n\tif err != nil {\n\t\treturn kp, err\n\t}\n\n\tkp.Created = false\n\treturn kp, nil\n}", "func (o InstanceOutput) KeyPair() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.KeyPair }).(pulumi.StringPtrOutput)\n}", "func (a *Client) SaveKeypair(params *SaveKeypairParams, authInfo runtime.ClientAuthInfoWriter) (*SaveKeypairNoContent, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewSaveKeypairParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"saveKeypair\",\n\t\tMethod: \"PUT\",\n\t\tPathPattern: \"/keypair\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &SaveKeypairReader{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, errs.Wrap(err, \"Could not save client-side encrypted keypair to platform.\")\n\t}\n\treturn result.(*SaveKeypairNoContent), nil\n\n}", "func GenerateKeyPair(group *schnorr.Group) (*SecKey, *PubKey) {\n\ts1 := common.GetRandomInt(group.Q)\n\ts2 := common.GetRandomInt(group.Q)\n\th1 := group.Exp(group.G, s1)\n\th2 := group.Exp(group.G, s2)\n\n\treturn NewSecKey(s1, s2), NewPubKey(h1, h2)\n}", "func (as AccountStorage) SetRelationship(ctx sdk.Context, me types.AccountKey, other types.AccountKey, relationship *Relationship) sdk.Error {\n\tstore := ctx.KVStore(as.key)\n\trelationshipByte, err := as.cdc.MarshalJSON(*relationship)\n\tif err != nil {\n\t\treturn ErrFailedToMarshalRelationship(err)\n\t}\n\tstore.Set(getRelationshipKey(me, other), relationshipByte)\n\treturn nil\n}", "func (s stack) CreateKeyPair(ctx context.Context, name string) (_ *abstract.KeyPair, ferr fail.Error) {\n\tif valid.IsNil(s) {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\tif name == \"\" {\n\t\treturn nil, fail.InvalidParameterError(\"name\", \"cannot be empty string\")\n\t}\n\n\treturn abstract.NewKeyPair(name)\n}", "func GenerateKeyPair() (pubkey, privkey []byte) {\n\tkey, err := ecdsa.GenerateKey(secp256k1.S256(), rand.Reader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tpubkey = elliptic.Marshal(secp256k1.S256(), key.X, key.Y)\n\tprivkey = make([]byte, 32)\n\tblob := key.D.Bytes()\n\tcopy(privkey[32-len(blob):], blob)\n\treturn\n}", "func ParseKeyPair(r io.Reader) (*KeyPair, error) {\n\tvar s ssbSecret\n\tif err := json.NewDecoder(r).Decode(&s); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.Parse: JSON decoding failed\")\n\t}\n\n\tpublic, err := base64.StdEncoding.DecodeString(strings.TrimSuffix(s.Public, \".ed25519\"))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.Parse: base64 decode of public part failed\")\n\t}\n\n\tprivate, err := base64.StdEncoding.DecodeString(strings.TrimSuffix(s.Private, \".ed25519\"))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.Parse: base64 decode of private part failed\")\n\t}\n\n\tvar kp secrethandshake.EdKeyPair\n\tcopy(kp.Public[:], public)\n\tcopy(kp.Secret[:], private)\n\n\tssbkp := KeyPair{\n\t\tId: s.ID,\n\t\tPair: kp,\n\t}\n\treturn &ssbkp, nil\n}", "func (z *Float64) SetPair(a, b float64) *Float64 {\n\tz.l = a\n\tz.r = b\n\treturn z\n}", "func NewPlaybackKeyPair(ctx *pulumi.Context,\n\tname string, args *PlaybackKeyPairArgs, opts ...pulumi.ResourceOption) (*PlaybackKeyPair, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.PublicKey == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'PublicKey'\")\n\t}\n\tvar resource PlaybackKeyPair\n\terr := ctx.RegisterResource(\"aws:ivs/playbackKeyPair:PlaybackKeyPair\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewKeyPair(rootKey RootKeyable, chainKey ChainKeyable) *KeyPair {\n\tkeyPair := KeyPair{\n\t\tRootKey: rootKey,\n\t\tChainKey: chainKey,\n\t}\n\n\treturn &keyPair\n}", "func NewKeyPair() (*keyPair, error) {\n\tprivKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprivKey.Precompute()\n\n\tpubKey := &privKey.PublicKey\n\treturn &keyPair{Private: privKey, Public: pubKey}, nil\n}", "func GenerateKeyPair(rand io.Reader) (*PublicKey, *PrivateKey, error) {\n\tvar seed [KeySeedSize]byte\n\tif rand == nil {\n\t\trand = cryptoRand.Reader\n\t}\n\t_, err := io.ReadFull(rand, seed[:])\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpk, sk := NewKeyFromSeed(seed[:])\n\treturn pk, sk, nil\n}", "func (s *SkyСoinService) GenerateKeyPair() *KeysResponse {\n\tseed := getRand()\n\trand.Read(seed)\n\tpub, sec := cipher.GenerateDeterministicKeyPair(seed)\n\treturn &KeysResponse{\n\t\tPrivate: sec.Hex(),\n\t\tPublic: pub.Hex(),\n\t}\n}", "func (f *fileStore) LoadKeyPair(targetScheme *crypto.Scheme) (*Pair, error) {\n\tp := new(Pair)\n\tif targetScheme != nil {\n\t\tp.Public = new(Identity)\n\t\tp.Public.Scheme = targetScheme\n\t}\n\tif err := Load(f.privateKeyFile, p); err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, Load(f.publicKeyFile, p.Public)\n}", "func GenerateKeyPair() *rsa.PrivateKey {\n\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, 2048)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Error in generating key-value pair, error is\", err)\n\t}\n\treturn privateKey\n}", "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.feclt.GetKeyPair(id)\n}", "func Keypair(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, err error) {\n\tpublic, private, err := ed25519.GenerateKey(rand)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn PublicKey(public), PrivateKey(private), nil\n}", "func (c *Conn) SetPrivateKey(privateKey wgcfg.PrivateKey) error {\n\tc.derpMu.Lock()\n\tdefer c.derpMu.Unlock()\n\n\toldKey, newKey := c.privateKey, key.Private(privateKey)\n\tif newKey == oldKey {\n\t\treturn nil\n\t}\n\tc.privateKey = newKey\n\tif oldKey.IsZero() {\n\t\t// Initial configuration on start.\n\t\treturn nil\n\t}\n\n\t// Key changed. Close any DERP connections.\n\tc.closeAllDerpLocked()\n\n\treturn nil\n}", "func (in *SSHKeyPair) DeepCopy() *SSHKeyPair {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SSHKeyPair)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "func KeyPair() (*[PUBLICKEYBYTES]byte, *[SECRETKEYBYTES]byte) {\n\tpublicKey := [PUBLICKEYBYTES]byte{}\n\tprivateKey := [SECRETKEYBYTES]byte{}\n\tpublicKeyPtr := (*C.uchar)(unsafe.Pointer(&publicKey))\n\tprivateKeyPtr := (*C.uchar)(unsafe.Pointer(&privateKey))\n\tC.crypto_vrf_keypair(publicKeyPtr, privateKeyPtr)\n\treturn &publicKey, &privateKey\n}", "func NewKeyPair() (ecdsa.PrivateKey, []byte) {\n\tellipticCurve := EllipticCurve()\n\n\tprivateKey, err := ecdsa.GenerateKey(ellipticCurve, rand.Reader)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tX := privateKey.PublicKey.X.Bytes()\n\tY := privateKey.PublicKey.Y.Bytes()\n\t//fmt.Println(len(X), X)\n\t//fmt.Println(len(Y), Y)\n\tpublicKey := append(\n\t\tX, // 32 bytes (P256)\n\t\tY..., // 32 bytes (P256)\n\t) // 64 bytes => 64 * 8 bits = 512 bits (perchè usiamo P256 o secp256k)\n\treturn *privateKey, publicKey\n}", "func GenerateKeyPair() ([]byte, []byte) {\n\tconst seckeyLen = 32\n\tvar seckey []byte\n\tvar pubkey []byte\n\nnew_seckey:\n\tseckey = RandByte(seckeyLen)\n\tif secp.SeckeyIsValid(seckey) != 1 {\n\t\tgoto new_seckey // regen\n\t}\n\n\tpubkey = pubkeyFromSeckey(seckey)\n\tif pubkey == nil {\n\t\tlog.Panic(\"IMPOSSIBLE: pubkey invalid from valid seckey\")\n\t\tgoto new_seckey\n\t}\n\tif ret := secp.PubkeyIsValid(pubkey); ret != 1 {\n\t\tlog.Panicf(\"ERROR: Pubkey invalid, ret=%d\", ret)\n\t\tgoto new_seckey\n\t}\n\n\treturn pubkey, seckey\n}", "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.osclt.GetKeyPair(id)\n}", "func DeriveKeyPair(scheme Scheme, uri string) (kp KeyPair, err error) {\n\tphrase, path, pwd, err := splitURI(uri)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif b, ok := DecodeHex(phrase); ok {\n\t\tkp, err = scheme.FromSeed(b)\n\t} else {\n\t\tkp, err = scheme.FromPhrase(phrase, pwd)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdjs, err := deriveJunctions(derivePath(path))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn scheme.Derive(kp, djs)\n}", "func generateKeyPair() (publicKey, privateKey *[32]byte, err error) {\n\treturn box.GenerateKey(rand.Reader)\n}", "func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) {\n\tif len(seed) != 0 && len(seed) != seedSize {\n\t\treturn nil, nil, errors.New(\"invalid size of seed\")\n\t}\n\n\tokm, err := generateOKM(seed, h)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tprivKeyFr := frFromOKM(okm)\n\n\tprivKey := &PrivateKey{privKeyFr}\n\tpubKey := privKey.PublicKey()\n\n\treturn pubKey, privKey, nil\n}", "func (w *Whisper) DeleteKeyPair(key string) bool {\n\tw.keyMu.Lock()\n\tdefer w.keyMu.Unlock()\n\n\tif w.privateKeys[key] != nil {\n\t\tdelete(w.privateKeys, key)\n\t\treturn true\n\t}\n\treturn false\n}", "func (s Seed) deriveKeyPair(index uint64) (keypair [64]byte) {\n\tbuf := make([]byte, len(s.siadSeed)+8)\n\tn := copy(buf, s.siadSeed[:])\n\tbinary.LittleEndian.PutUint64(buf[n:], index)\n\tseed := blake2b.Sum256(buf)\n\tcopy(keypair[:], ed25519.NewKeyFromSeed(seed[:]))\n\treturn\n}", "func deleteKeyPair(cf *Cloudformation, keyPair string, err error) {\n\tif err != nil {\n\t\tfmt.Printf(\"Key pair deleted %s because stack failed with err: \\n %s \\n\", keyPair, err)\n\t\tos.Exit(1)\n\t}\n\t_, keyErr := cf.ec2Res.deleteKeyPair(keyPair)\n\tif keyErr != nil {\n\t\tfmt.Printf(\"Delete key pair err: %s \\n\", keyErr)\n\t}\n}", "func NewKeyPair(config CreateKeyPairConfig) (KeyPair, error) {\n\tif config.Type == Default {\n\t\tconfig.Type = Ecdsa\n\t}\n\n\tswitch config.Type {\n\tcase Ecdsa:\n\t\treturn newEcdsaKeyPair(config)\n\tcase Rsa:\n\t\treturn newRsaKeyPair(config)\n\t}\n\n\treturn KeyPair{}, fmt.Errorf(\"Unable to generate new key pair, type %s is not supported\",\n\t\tconfig.Type.String())\n}", "func NewKeyPair(suite suites.Suite, random cipher.Stream) (kyber.Scalar, kyber.Point) {\n\tx := suite.G2().Scalar().Pick(random)\n\tX := suite.G2().Point().Mul(x, nil)\n\treturn x, X\n}", "func (w *Whisper) NewKeyPair() (string, error) {\n\tkey, err := crypto.GenerateKey()\n\tif err != nil || !validatePrivateKey(key) {\n\t\tkey, err = crypto.GenerateKey() // retry once\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif !validatePrivateKey(key) {\n\t\treturn \"\", fmt.Errorf(\"failed to generate valid key\")\n\t}\n\n\tid, err := GenerateRandomID()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to generate ID: %s\", err)\n\t}\n\n\tw.keyMu.Lock()\n\tdefer w.keyMu.Unlock()\n\n\tif w.privateKeys[id] != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to generate unique ID\")\n\t}\n\tw.privateKeys[id] = key\n\treturn id, nil\n}", "func (client *NginxClient) ModifyKeyValPair(zone string, key string, val string) error {\n\treturn client.modifyKeyValPair(zone, key, val, httpContext)\n}", "func setTargetCertKeyPairSecret(s *corev1.Secret, validity time.Duration, signer *crypto.CA, certCreator certificateRotation) error {\n\tif s.Annotations == nil {\n\t\ts.Annotations = map[string]string{}\n\t}\n\tif s.Data == nil {\n\t\ts.Data = map[string][]byte{}\n\t}\n\n\t// our annotation is based on our cert validity, so we want to make sure that we don't specify something past our signer\n\ttargetValidity := validity\n\tremainingSignerValidity := time.Until(signer.Config.Certs[0].NotAfter)\n\tif remainingSignerValidity < validity {\n\t\ttargetValidity = remainingSignerValidity\n\t}\n\n\tcertKeyPair, err := certCreator.NewCertificate(signer, targetValidity)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.Data[corev1.TLSCertKey], s.Data[corev1.TLSPrivateKeyKey], err = certKeyPair.GetPEMBytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\tcertCreator.SetAnnotations(certKeyPair, s.Annotations)\n\n\treturn nil\n}", "func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) {\n\tif len(seed) != 0 && len(seed) != seedSize {\n\t\treturn nil, nil, errors.New(\"invalid size of seed\")\n\t}\n\n\tokm, err := generateOKM(seed, h)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tprivKeyFr, err := frFromOKM(okm)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"convert OKM to FR: %w\", err)\n\t}\n\n\tprivKey := &PrivateKey{PrivKey: g2pubs.NewSecretKeyFromFR(privKeyFr)}\n\tpubKey := privKey.PublicKey()\n\n\treturn pubKey, privKey, nil\n}", "func (sc *SessionContext) SetRequestPair(w http.ResponseWriter, r *http.Request) {\n\tsc.request = r\n\tsc.response = w\n}", "func (vdb *VspDatabase) KeyPair() (ed25519.PrivateKey, ed25519.PublicKey, error) {\n\tvar seed []byte\n\terr := vdb.db.View(func(tx *bolt.Tx) error {\n\t\tvspBkt := tx.Bucket(vspBktK)\n\n\t\ts := vspBkt.Get(privateKeyK)\n\n\t\t// Byte slices returned from Bolt are only valid during a transaction.\n\t\t// Need to make a copy.\n\t\tseed = make([]byte, len(s))\n\t\tcopy(seed, s)\n\n\t\tif seed == nil {\n\t\t\t// should not happen\n\t\t\treturn fmt.Errorf(\"no private key found\")\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tsignKey := ed25519.NewKeyFromSeed(seed)\n\n\t// Derive pubKey from signKey\n\tpubKey, ok := signKey.Public().(ed25519.PublicKey)\n\tif !ok {\n\t\treturn nil, nil, fmt.Errorf(\"failed to cast signing key: %T\", pubKey)\n\t}\n\n\treturn signKey, pubKey, err\n}", "func (r *Person) SetRelationship(field string, rel interface{}) error {\n\tswitch field {\n\tcase \"Pets\":\n\t\trecords, ok := rel.([]kallax.Record)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"kallax: relationship field %s needs a collection of records, not %T\", field, rel)\n\t\t}\n\n\t\tr.Pets = make([]*Pet, len(records))\n\t\tfor i, record := range records {\n\t\t\trel, ok := record.(*Pet)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"kallax: element of type %T cannot be added to relationship %s\", record, field)\n\t\t\t}\n\t\t\tr.Pets[i] = rel\n\t\t}\n\t\treturn nil\n\n\t}\n\treturn fmt.Errorf(\"kallax: model Person has no relationship %s\", field)\n}", "func (lib *PKCS11Lib) GenerateECDSAKeyPair(c elliptic.Curve) (*PKCS11PrivateKeyECDSA, error) {\n\treturn lib.GenerateECDSAKeyPairOnSlot(lib.Slot.id, nil, nil, c)\n}", "func LoadKeyPair(fname string) (*KeyPair, error) {\n\tf, err := os.Open(fname)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"ssb.LoadKeyPair: could not open key file %s\", fname)\n\t}\n\tdefer f.Close()\n\n\treturn ParseKeyPair(nocomment.NewReader(f))\n}", "func CreateKeyPair() (pubKey PublicKey, secKey SecretKey, err error) {\n\terrorCode := C.crypto_sign_keypair((*C.uchar)(&pubKey[0]), (*C.uchar)(&secKey[0]))\n\tif errorCode != 0 {\n\t\terr = errors.New(\"call to crypto_sign_keypair failed\")\n\t}\n\treturn\n}", "func (sas serviceAccounts) ForKeyPair(\n\tkeyID, keySecret string,\n) (*models.ServiceAccount, error) {\n\tsa := []*models.ServiceAccount{}\n\tif _, err := sas.storage.PG.DB.Query(\n\t\t&sa, `SELECT id, name, key_id, key_secret, email, base_role_id\n\t\tFROM service_accounts WHERE key_id = ? AND key_secret = ?`,\n\t\tkeyID, keySecret,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tif len(sa) == 0 {\n\t\treturn nil, errors.NewEntityNotFoundError(models.ServiceAccount{}, keyID)\n\t}\n\treturn sa[0], nil\n}", "func (k Keeper) SetRecord(ctx sdk.Context, key types.RecordCompositeKey, record types.Record) {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.RecordKeyPrefix)\n\tb := k.cdc.MustMarshal(&record)\n\tstore.Set(compkey.MustEncode(&key), b)\n}", "func GenerateSigningKeyPair(publicFileName, privateFileName, curveType string) (err error) {\n\tvar publicKey, privateKey []byte\n\tswitch strings.ToLower(curveType) {\n\tcase CurveSecp256K1:\n\t\tpublicKey, privateKey, err = secp256k1.GenerateSigningKeyPair()\n\tcase CurveEd25519:\n\t\tpublicKey, privateKey, err = ed25519.GenerateSigningKeyPair()\n\tdefault:\n\t\tpublicKey, privateKey, err = ed25519.GenerateSigningKeyPair()\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = utils.WriteKeyToPemFile(privateFileName, utils.PrivateKey, privateKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = utils.WriteKeyToPemFile(publicFileName, utils.PublicKey, publicKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (p *ph) KeyPair() (publicKey, privateKey []byte, err error) {\n\tsecretKey, err := randomBytes(p._SKLEN)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpublicKey, err = p.PubKey(secretKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn publicKey, secretKey, nil\n}", "func GenerateKeypair() (*Keypair, error) {\n\tvar publicKey [32]byte\n\tvar privateKey [32]byte\n\t_, err := rand.Read(privateKey[:])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcurve25519.ScalarBaseMult(&publicKey, &privateKey)\n\treturn &Keypair{publicKey, privateKey}, nil\n}", "func (o *CloudAwsVirtualMachineAllOf) GetKeyPairOk() (*CloudAwsKeyPairRelationship, bool) {\n\tif o == nil || o.KeyPair == nil {\n\t\treturn nil, false\n\t}\n\treturn o.KeyPair, true\n}", "func GenerateCurve25519KeyPair() (*Curve25519KeyPair, error) {\n\treturn generateCurve25519KeyPairFromRandom(rand.Reader)\n}", "func SetPrvKey(prvkeyHex string) *bind.TransactOpts {\n\tkeyBytes := common.FromHex(prvkeyHex)\n\tkey := crypto.ToECDSAUnsafe(keyBytes)\n\treturn bind.NewKeyedTransactor(key)\n}", "func KeyPair() (publicKey, privateKey []byte, err error) {\n\treturn defaultPH.KeyPair()\n}", "func (v *PublicParamsManager) NewCertifierKeyPair() ([]byte, []byte, error) {\n\tpanic(\"NewCertifierKeyPair cannot be called from fabtoken\")\n}", "func (p PrivateKey) calculateKeyPair() ([]byte, *edwards25519.Scalar, error) {\n\tvar pA edwards25519.Point\n\tvar sa edwards25519.Scalar\n\n\tk, err := (&edwards25519.Scalar{}).SetBytesWithClamping(p)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpub := pA.ScalarBaseMult(k).Bytes()\n\tsignBit := (pub[31] & 0x80) >> 7\n\n\tif signBit == 1 {\n\t\tsa.Negate(k)\n\t\t// Set sig bit to 0\n\t\tpub[31] &= 0x7F\n\t} else {\n\t\tsa.Set(k)\n\t}\n\n\treturn pub, &sa, nil\n}", "func (c *FilesBuilder) AddKeyPair(ctx context.Context, name string,\n\tf func(context.Context, *cke.Node) (cert, key []byte, err error)) error {\n\tvar mu sync.Mutex\n\tcertMap := make(map[string][]byte)\n\tkeyMap := make(map[string][]byte)\n\n\tenv := well.NewEnvironment(ctx)\n\tfor _, n := range c.nodes {\n\t\tn := n\n\t\tenv.Go(func(ctx context.Context) error {\n\t\t\tcertData, keyData, err := f(ctx, n)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmu.Lock()\n\t\t\tcertMap[n.Address] = certData\n\t\t\tkeyMap[n.Address] = keyData\n\t\t\tmu.Unlock()\n\t\t\treturn nil\n\t\t})\n\t}\n\tenv.Stop()\n\terr := env.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.files = append(c.files, fileData{name + \".crt\", certMap})\n\tc.files = append(c.files, fileData{name + \".key\", keyMap})\n\treturn nil\n}", "func TestingKeyPair() *CertInfo {\n\tkeypair, err := tls.X509KeyPair(testCertPEMBlock, testKeyPEMBlock)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"invalid X509 keypair material: %v\", err))\n\t}\n\n\tcert := &CertInfo{\n\t\tkeypair: keypair,\n\t}\n\n\treturn cert\n}", "func (o OceanOutput) KeyPair() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Ocean) pulumi.StringPtrOutput { return v.KeyPair }).(pulumi.StringPtrOutput)\n}", "func SaveEncodedKeypair(cfg Configurable, secretsClient *secretsapi.Client, encKeypair *EncodedKeypair) error {\n\tparams := keys.NewSaveKeypairParams().WithKeypair(&secretsModels.KeypairChange{\n\t\tEncryptedPrivateKey: &encKeypair.EncodedPrivateKey,\n\t\tPublicKey: &encKeypair.EncodedPublicKey,\n\t})\n\n\tif _, err := secretsClient.Keys.SaveKeypair(params, authentication.LegacyGet().ClientAuth()); err != nil {\n\t\treturn locale.WrapError(err, \"keypair_err_save\")\n\t}\n\n\t// save the keypair locally to avoid authenticating the keypair every time it's used\n\treturn SaveWithDefaults(cfg, encKeypair.Keypair)\n}", "func (o *CloudAwsVirtualMachineAllOf) HasKeyPair() bool {\n\tif o != nil && o.KeyPair != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (_Contract *ContractTransactor) SetPubkey(opts *bind.TransactOpts, node [32]byte, x [32]byte, y [32]byte) (*types.Transaction, error) {\n\treturn _Contract.contract.Transact(opts, \"setPubkey\", node, x, y)\n}", "func (symmetricKey *SymmetricKey) SetKey(key []byte) error {\n\tsymmetricKey.mutex.Lock()\n\tsymmetricKey.SymmetricKey = key\n\tsymmetricKey.mutex.Unlock()\n\treturn nil\n}", "func EncodeKeypair(keypair Keypair, passphrase string) (*EncodedKeypair, error) {\n\tvar encodedPrivateKey string\n\tvar err error\n\n\tif passphrase == \"\" {\n\t\tencodedPrivateKey = keypair.EncodePrivateKey()\n\t} else {\n\t\tencodedPrivateKey, err = keypair.EncryptAndEncodePrivateKey(passphrase)\n\t\tif err != nil {\n\t\t\treturn nil, errs.Wrap(err, \"Could not encrypt encoded private key\")\n\t\t}\n\t}\n\n\tencodedPublicKey, err := keypair.EncodePublicKey()\n\tif err != nil {\n\t\treturn nil, errs.Wrap(err, \"Could not encode public key\")\n\t}\n\n\treturn &EncodedKeypair{\n\t\tKeypair: keypair,\n\t\tEncodedPrivateKey: encodedPrivateKey,\n\t\tEncodedPublicKey: encodedPublicKey,\n\t}, nil\n}", "func (session *Session) GenerateRSAKeyPair(tokenLabel string, tokenPersistent bool, expDate time.Time, bits int) (pkcs11.ObjectHandle, pkcs11.ObjectHandle, error) {\n\tif session == nil || session.Ctx == nil {\n\t\treturn 0, 0, fmt.Errorf(\"session not initialized\")\n\t}\n\ttoday := time.Now()\n\tpublicKeyTemplate := []*pkcs11.Attribute{\n\t\tpkcs11.NewAttribute(pkcs11.CKA_CLASS, pkcs11.CKO_PUBLIC_KEY),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_LABEL, session.Label),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_ID, []byte(tokenLabel)),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_KEY_TYPE, pkcs11.CKK_RSA),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_TOKEN, tokenPersistent),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_START_DATE, today),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_END_DATE, expDate),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_VERIFY, true),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_PUBLIC_EXPONENT, []byte{1, 0, 1}),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_MODULUS_BITS, bits),\n\t}\n\n\tprivateKeyTemplate := []*pkcs11.Attribute{\n\t\tpkcs11.NewAttribute(pkcs11.CKA_CLASS, pkcs11.CKO_PRIVATE_KEY),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_LABEL, session.Label),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_ID, []byte(tokenLabel)),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_KEY_TYPE, pkcs11.CKK_RSA),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_TOKEN, tokenPersistent),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_START_DATE, today),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_END_DATE, expDate),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_SIGN, true),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_SENSITIVE, true),\n\t}\n\n\tpubKey, privKey, err := session.Ctx.GenerateKeyPair(\n\t\tsession.Handle,\n\t\t[]*pkcs11.Mechanism{\n\t\t\tpkcs11.NewMechanism(pkcs11.CKM_RSA_PKCS_KEY_PAIR_GEN, nil),\n\t\t},\n\t\tpublicKeyTemplate,\n\t\tprivateKeyTemplate,\n\t)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\treturn pubKey, privKey, nil\n}", "func (x *Ed25519Credentials) SetPrivateKey(privatekey PrivateKey) error {\n\n\tif privatekey.Algorithm != AlgorithmEd25519 {\n\t\treturn fmt.Errorf(\"Algorithm mismatch %v vs %v\", privatekey.Algorithm, AlgorithmEd25519)\n\t}\n\n\tst, ok := privatekey.Private.(string)\n\tif !ok {\n\t\treturn ErrInvalidPrivateKeyType\n\t}\n\n\tif len(st) != base64.URLEncoding.EncodedLen(ed25519.PrivateKeySize) {\n\t\treturn fmt.Errorf(\"Key data incorrect length\")\n\t}\n\n\tbytes, err := base64.URLEncoding.DecodeString(st)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tx.Private = bytes\n\n\treturn nil\n\n}", "func (cli *BaseClient) SyncClonePair(ctx context.Context, clonePairID string) error {\n\tdata := map[string]interface{}{\n\t\t\"ID\": clonePairID,\n\t\t\"copyAction\": 0,\n\t}\n\n\tresp, err := cli.Put(ctx, \"/clonepair/synchronize\", data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcode := int64(resp.Error[\"code\"].(float64))\n\tif code != 0 {\n\t\treturn fmt.Errorf(\"Sync ClonePair %s error: %d\", clonePairID, code)\n\t}\n\n\treturn nil\n}", "func (s stack) ListKeyPairs(context.Context) ([]*abstract.KeyPair, fail.Error) {\n\treturn nil, fail.NotImplementedError(\"ListKeyPairs() not implemented yet\") // FIXME: Technical debt\n}", "func (c *Config) SetSSHKeyPermissions() error {\n\tprivateKey := c.GetSSHKeyPath()\n\tcmd := exec.Command(\"chmod\", \"0600\", privateKey)\n\tutil.PrintCommand(cmd)\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlog.Printf(\"Error while trying to change private ssh key permissions at %s: %s\\n\", privateKey, out)\n\t\treturn err\n\t}\n\tpublicKey := c.GetSSHKeyPath() + \".pub\"\n\tcmd = exec.Command(\"chmod\", \"0600\", publicKey)\n\tutil.PrintCommand(cmd)\n\tout, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tlog.Printf(\"Error while trying to change public ssh key permissions at %s: %s\\n\", publicKey, out)\n\t\treturn err\n\t}\n\treturn nil\n}", "func (db *SQLStore) SetRecord(rec *CertRecord) error {\n\tif err := db.conn.Ping(); err != nil {\n\t\treturn err\n\t}\n\t_, err := db.set.Exec(rec.KeyID, rec.Principals, rec.CreatedAt, rec.Expires, rec.Raw)\n\treturn err\n}", "func (s *MemStore) SetRole(k string, r common.Role) {\n\ts.did[k] = r\n}", "func (s *State) SenderRatchetKeyPair() *ecc.ECKeyPair {\n\treturn s.senderChain.senderRatchetKeyPair\n}", "func (lib *PKCS11Lib) GenerateRSAKeyPair(bits int, purpose KeyPurpose) (*PKCS11PrivateKeyRSA, error) {\n\treturn lib.GenerateRSAKeyPairOnSlot(lib.Slot.id, nil, nil, bits, purpose)\n}", "func GenLamportKeyPair() *Keypair {\n\tkp := Keypair{\n\t\tpublic: [256]*key{},\n\t\tprivate: [256]*key{},\n\t}\n\n\tpub, priv := genKeyPair()\n\tcopy(kp.public[:], pub)\n\tcopy(kp.private[:], priv)\n\treturn &kp\n}", "func ExampleMicroStellar_CreateKeyPair() {\n\tms := New(\"test\")\n\n\t// Generate a new random keypair.\n\tpair, err := ms.CreateKeyPair()\n\n\tif err != nil {\n\t\tlog.Fatalf(\"CreateKeyPair: %v\", err)\n\t}\n\n\t// Display address and key\n\tlog.Printf(\"Private seed: %s, Public address: %s\", pair.Seed, pair.Address)\n\n\tfmt.Printf(\"ok\")\n\t// Output: ok\n}", "func ExampleMicroStellar_CreateKeyPair() {\n\tms := New(\"test\")\n\n\t// Generate a new random keypair.\n\tpair, err := ms.CreateKeyPair()\n\n\tif err != nil {\n\t\tlog.Fatalf(\"CreateKeyPair: %v\", err)\n\t}\n\n\t// Display address and key\n\tlog.Printf(\"Private seed: %s, Public address: %s\", pair.Seed, pair.Address)\n\n\tfmt.Printf(\"ok\")\n\t// Output: ok\n}", "func (m *Application) SetKeyCredentials(value []KeyCredentialable)() {\n m.keyCredentials = value\n}", "func (_ResolverContract *ResolverContractTransactor) SetPubkey(opts *bind.TransactOpts, node [32]byte, x [32]byte, y [32]byte) (*types.Transaction, error) {\n\treturn _ResolverContract.contract.Transact(opts, \"setPubkey\", node, x, y)\n}", "func (c *CertInfo) KeyPair() tls.Certificate {\n\treturn c.keypair\n}", "func CreateKeyPairCommand() *cobra.Command {\n\n\tkeysCmd := &cobra.Command{\n\t\tUse: \"keypair\",\n\t\tShort: \"create the account with mnemonic, private key, public key and address\",\n\t\tLong: `create the account with mnemonic, private key, public key and address`,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\n\t\t\tnode, err := createNode()\n\t\t\tkp := []Keypair{}\n\t\t\tfor j := 0; j < node; j++ {\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Println(\"keypair creating\", err)\n\t\t\t\t}\n\t\t\t\t_ = strconv.Itoa(j)\n\t\t\t\tentropy, _ := bip39.NewEntropy(256)\n\t\t\t\tmnemonic, _ := bip39.NewMnemonic(entropy)\n\t\t\t\tseed := bip39.NewSeed(mnemonic, \"123456\")\n\t\t\t\tfirst := seed[:32]\n\t\t\t\tprivatekey := ed25519.NewKeyFromSeed(first)\n\t\t\t\tpublicKey := ed25519.PublicKey(privatekey)\n\t\t\t\tkeys := Keypair{Mnemonic: mnemonic, Privatekey: privatekey, Publickkey: publicKey}\n\t\t\t\tkp = append(kp, keys)\n\n\t\t\t}\n\n\t\t\tkpjson, _ := json.Marshal(kp)\n\t\t\toutputDocumet, err := makeOutputFilepath(DefaultHome)\n\t\t\terr = ioutil.WriteFile(outputDocumet, kpjson, 0644)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn keysCmd\n}", "func (mapper *Mapper) MapPair(key Key, goValue interface{}) {\n\tmapper.doMap(key, goValue)\n}", "func (o ClusterNodeAttributeOutput) KeyPairName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeAttribute) string { return v.KeyPairName }).(pulumi.StringOutput)\n}", "func GenerateKeypair() (privkey, pubkey []byte, err error) {\n\tpair, err := noise.DH25519.GenerateKeypair(rand.Reader)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// pair.Public is already filled in; assert here that PubkeyFromPrivkey\n\t// agrees with it.\n\tderivedPubkey := PubkeyFromPrivkey(pair.Private)\n\tif !bytes.Equal(derivedPubkey, pair.Public) {\n\t\tpanic(fmt.Sprintf(\"expected pubkey %x, got %x\", derivedPubkey, pair.Public))\n\t}\n\n\treturn pair.Private, pair.Public, nil\n}", "func useX509KeyPair(transport *http.Transport, certFile, keyFile string) error {\n\tconfig := transport.TLSClientConfig\n\tif config == nil {\n\t\tconfig = &tls.Config{}\n\t} else {\n\t\tconfig = config.Clone()\n\t}\n\tif _, err := SetX509KeyPairToTLSConfig(certFile, keyFile, config); err != nil {\n\t\treturn err\n\t}\n\n\ttransport.TLSClientConfig = config\n\treturn nil\n}", "func CreateKeyPair() (publicKeyBytes []byte, privateKeyBytes []byte, err error) {\n\tprivateKey, _ := rsa.GenerateKey(rand.Reader, 2048)\n\tpublicKey := privateKey.PublicKey\n\tpub, err := ssh.NewPublicKey(&publicKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpublicKeyBytes = ssh.MarshalAuthorizedKey(pub)\n\n\tpriBytes := x509.MarshalPKCS1PrivateKey(privateKey)\n\tprivateKeyBytes = pem.EncodeToMemory(\n\t\t&pem.Block{\n\t\t\tType: \"RSA PRIVATE KEY\",\n\t\t\tBytes: priBytes,\n\t\t},\n\t)\n\treturn publicKeyBytes, privateKeyBytes, nil\n}", "func (client *Client) ListKeyPairs() ([]model.KeyPair, error) {\n\treturn client.feclt.ListKeyPairs()\n}", "func (hd *HDWallet) KeyPair() (ed25519.PrivateKey, ed25519.PublicKey) {\n\n\tpath, err := bip32path.ParsePath(fmt.Sprintf(pathString, hd.index))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcurve := eddsa.Ed25519()\n\tkey, err := slip10.DeriveKeyFromPath(hd.seed, curve, path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpubKey, privKey := key.Key.(eddsa.Seed).Ed25519Key()\n\n\treturn ed25519.PrivateKey(privKey), ed25519.PublicKey(pubKey)\n}" ]
[ "0.59298825", "0.56376743", "0.5580803", "0.5503781", "0.54797757", "0.54481167", "0.54247004", "0.53521115", "0.5325494", "0.53130186", "0.5279733", "0.52649295", "0.52334094", "0.51875293", "0.51772195", "0.5161802", "0.5146233", "0.5131163", "0.51252997", "0.50984263", "0.5069016", "0.5060735", "0.50560135", "0.5039155", "0.50155175", "0.5006957", "0.4998593", "0.49863002", "0.4976758", "0.4943173", "0.49346572", "0.49220204", "0.4877274", "0.4852173", "0.48306838", "0.48283526", "0.47958854", "0.47835696", "0.47774887", "0.4759583", "0.47562242", "0.4727659", "0.47221303", "0.47213897", "0.47089428", "0.47065526", "0.46568668", "0.4640598", "0.46191448", "0.4615456", "0.46149254", "0.46123707", "0.45745867", "0.45733458", "0.45705616", "0.45697424", "0.45650625", "0.4555443", "0.4550897", "0.4545114", "0.45291018", "0.45245034", "0.45137626", "0.4509843", "0.45003125", "0.44922552", "0.44699025", "0.4453827", "0.4421227", "0.44143814", "0.44141248", "0.44076568", "0.44005337", "0.43962908", "0.43867475", "0.43866554", "0.4372503", "0.43663362", "0.43385023", "0.43353525", "0.43076736", "0.43003306", "0.42720374", "0.42712358", "0.42706347", "0.42685047", "0.42624104", "0.42618245", "0.42618245", "0.42544293", "0.42455664", "0.4229334", "0.42267102", "0.42220464", "0.4217683", "0.4215423", "0.42093673", "0.4202311", "0.41974175", "0.4189609" ]
0.78977525
0
GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise and a boolean to check if the value has been set. NOTE: If the value is an explicit nil, `nil, true` will be returned
GetSecurityGroupsOk возвращает кортеж с значением поля SecurityGroups, если оно было задано, и nil в противном случае, а также булевое значение для проверки, было ли значение задано. ЗАМЕЧАНИЕ: Если значение явно равно nil, будет возвращено `nil, true`
func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroupsOk() ([]CloudAwsSecurityGroupRelationship, bool) { if o == nil || o.SecurityGroups == nil { return nil, false } return o.SecurityGroups, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) GetSecurityGroupsOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroups, true\n}", "func (o *FiltersVmGroup) GetSecurityGroupIdsOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroupIds, true\n}", "func (o *FiltersSecurityGroup) GetSecurityGroupIdsOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroupIds, true\n}", "func (o *FiltersSecurityGroup) GetSecurityGroupNamesOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroupNames == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroupNames, true\n}", "func (o *CreateLoadBalancerRequest) GetSecurityGroups() []string {\n\tif o == nil || o.SecurityGroups == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroups\n}", "func (o *CloudAwsVirtualMachineAllOf) HasSecurityGroups() bool {\n\tif o != nil && o.SecurityGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CreateLoadBalancerRequest) HasSecurityGroups() bool {\n\tif o != nil && o.SecurityGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o InstanceOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "func (client *AwsClientWrapper) GetSecurityGroups(machine *clusterv1alpha1.Machine) ([]string, error) {\n\tinstance, err := getRunningInstance(machine, client.client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar groups []string\n\tfor _, groupIdentifier := range instance.SecurityGroups {\n\t\tif *groupIdentifier.GroupName != \"\" {\n\t\t\tgroups = append(groups, *groupIdentifier.GroupName)\n\t\t}\n\t}\n\treturn groups, nil\n}", "func (o *SecurityGroup) GetSecurityGroupIdOk() (*string, bool) {\n\tif o == nil || o.SecurityGroupId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroupId, true\n}", "func (o *FiltersSecurityGroup) GetOutboundRuleSecurityGroupIdsOk() (*[]string, bool) {\n\tif o == nil || o.OutboundRuleSecurityGroupIds == nil {\n\t\treturn nil, false\n\t}\n\treturn o.OutboundRuleSecurityGroupIds, true\n}", "func GetSecurityGroupInfo(sess *session.Session) (*ec2.DescribeSecurityGroupsOutput, error) {\n // snippet-start:[ec2.go.describe_security_groups.call]\n svc := ec2.New(sess)\n\n result, err := svc.DescribeSecurityGroups(nil)\n // snippet-end:[ec2.go.describe_security_groups.call]\n if err != nil {\n return nil, err\n }\n\n return result, nil\n}", "func (o *FiltersSecurityGroup) GetInboundRuleSecurityGroupIdsOk() (*[]string, bool) {\n\tif o == nil || o.InboundRuleSecurityGroupIds == nil {\n\t\treturn nil, false\n\t}\n\treturn o.InboundRuleSecurityGroupIds, true\n}", "func (o *FiltersSecurityGroup) GetOutboundRuleSecurityGroupNamesOk() (*[]string, bool) {\n\tif o == nil || o.OutboundRuleSecurityGroupNames == nil {\n\t\treturn nil, false\n\t}\n\treturn o.OutboundRuleSecurityGroupNames, true\n}", "func (o *GetSecurityGroupOK) IsSuccess() bool {\n\treturn true\n}", "func (o *FiltersSecurityGroup) GetInboundRuleSecurityGroupNamesOk() (*[]string, bool) {\n\tif o == nil || o.InboundRuleSecurityGroupNames == nil {\n\t\treturn nil, false\n\t}\n\treturn o.InboundRuleSecurityGroupNames, true\n}", "func (o *SecurityGroup) GetSecurityGroupNameOk() (*string, bool) {\n\tif o == nil || o.SecurityGroupName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroupName, true\n}", "func (o *FiltersVmGroup) HasSecurityGroupIds() bool {\n\tif o != nil && o.SecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (r *LaunchConfiguration) SecurityGroups() pulumi.ArrayOutput {\n\treturn (pulumi.ArrayOutput)(r.s.State[\"securityGroups\"])\n}", "func (o TopicRuleDestinationVpcConfigurationOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v TopicRuleDestinationVpcConfiguration) []string { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "func (a *Client) ListOpenstackSecurityGroups(params *ListOpenstackSecurityGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOpenstackSecurityGroupsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewListOpenstackSecurityGroupsParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"listOpenstackSecurityGroups\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/api/v1/providers/openstack/securitygroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &ListOpenstackSecurityGroupsReader{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.(*ListOpenstackSecurityGroupsOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*ListOpenstackSecurityGroupsDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "func (c *ClientWithResponses) ListSecurityGroupsWithResponse(ctx context.Context) (*ListSecurityGroupsResponse, error) {\n\trsp, err := c.ListSecurityGroups(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ParseListSecurityGroupsResponse(rsp)\n}", "func (instance *Host) ListSecurityGroups(ctx context.Context, state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\n\t// instance.RLock()\n\t// defer instance.RUnlock()\n\n\txerr := instance.Inspect(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Inspect(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tlist = FilterBondsByKind(hsgV1.ByID, state)\n\t\t\treturn nil\n\t\t})\n\t})\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\treturn list, nil\n}", "func (m *MockSecurityGroupServiceIface) ListSecurityGroups(p *ListSecurityGroupsParams) (*ListSecurityGroupsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListSecurityGroups\", p)\n\tret0, _ := ret[0].(*ListSecurityGroupsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (o *FiltersSecurityGroup) HasSecurityGroupIds() bool {\n\tif o != nil && o.SecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o TopicRuleDestinationVpcConfigurationPtrOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *TopicRuleDestinationVpcConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroups\n\t}).(pulumi.StringArrayOutput)\n}", "func (a *Client) ListOpenstackSecurityGroupsNoCredentials(params *ListOpenstackSecurityGroupsNoCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOpenstackSecurityGroupsNoCredentialsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewListOpenstackSecurityGroupsNoCredentialsParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"listOpenstackSecurityGroupsNoCredentials\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/api/v1/projects/{project_id}/dc/{dc}/clusters/{cluster_id}/providers/openstack/securitygroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &ListOpenstackSecurityGroupsNoCredentialsReader{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.(*ListOpenstackSecurityGroupsNoCredentialsOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*ListOpenstackSecurityGroupsNoCredentialsDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "func (o *FiltersSecurityGroup) HasSecurityGroupNames() bool {\n\tif o != nil && o.SecurityGroupNames != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (s *HostListener) ListSecurityGroups(ctx context.Context, in *protocol.SecurityGroupHostBindRequest) (_ *protocol.SecurityGroupBondsResponse, err error) {\n\tdefer fail.OnExitConvertToGRPCStatus(&err)\n\tdefer fail.OnExitWrapError(&err, \"cannot disable 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 ctx == nil {\n\t\treturn nil, fail.InvalidParameterError(\"ctx\", \"cannot be nil\")\n\t}\n\n\tif ok, err := govalidator.ValidateStruct(in); err == nil && !ok {\n\t\tlogrus.Warnf(\"Structure validation failure: %v\", in) // FIXME: Generate json tags in protobuf\n\t}\n\n\thostRef, hostRefLabel := 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(ctx, 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\ttracer := debug.NewTracer(job.Task(), tracing.ShouldTrace(\"listeners.host\"), \"(%s)\", hostRefLabel).WithStopwatch().Entering()\n\tdefer tracer.Exiting()\n\tdefer fail.OnExitLogError(&err, tracer.TraceMessage())\n\n\thostInstance, xerr := hostfactory.Load(job.Service(), hostRef)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tdefer hostInstance.Released()\n\n\tbonds, xerr := hostInstance.ListSecurityGroups(securitygroupstate.All)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tresp := converters.SecurityGroupBondsFromPropertyToProtocol(bonds, \"hosts\")\n\treturn resp, nil\n}", "func (a *Client) GetPlatformSecurityGroups(params *GetPlatformSecurityGroupsParams) (*GetPlatformSecurityGroupsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetPlatformSecurityGroupsParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getPlatformSecurityGroups\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/v1/platform_resources/security_groups\",\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: &GetPlatformSecurityGroupsReader{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\treturn result.(*GetPlatformSecurityGroupsOK), nil\n\n}", "func (o *GetSecurityGroupBadRequest) IsSuccess() bool {\n\treturn false\n}", "func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroups() []CloudAwsSecurityGroupRelationship {\n\tif o == nil {\n\t\tvar ret []CloudAwsSecurityGroupRelationship\n\t\treturn ret\n\t}\n\treturn o.SecurityGroups\n}", "func (o *SecurityGroup) HasSecurityGroupId() bool {\n\tif o != nil && o.SecurityGroupId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func SecurityGroups(groups ...string) RequestOptionFunc {\n\treturn func(body *RequestBody) error {\n\t\tbody.SecurityGroup = groups\n\t\treturn nil\n\t}\n}", "func checkSecurityGroupFlags() string {\n\tcheckResult := \"\"\n\tcheckResult += checkGroupId()\n\tcheckResult += checkProtocol()\n\tcheckResult += checkWay()\n\treturn checkResult\n}", "func (o *GetSecurityGroupNotFound) IsSuccess() bool {\n\treturn false\n}", "func (stg *securityTestGroup) getSecurityGroups(agent string) ([]security.NetworkSecurityPolicy, error) {\n\tvar sgplist []security.NetworkSecurityPolicy\n\tstatus, err := stg.authAgentClient.Req(\"GET\", \"https://\"+agent+\":\"+globals.AgentProxyPort+\"/api/sgs/\", nil, &sgplist)\n\tif err != nil || status != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Error getting SG Policies list: %v\", err)\n\t}\n\treturn sgplist, nil\n}", "func ParseListSecurityGroupsResponse(rsp *http.Response) (*ListSecurityGroupsResponse, 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 := &ListSecurityGroupsResponse{\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\tvar dest struct {\n\t\t\tSecurityGroups *[]SecurityGroup `json:\"security-groups,omitempty\"`\n\t\t}\n\t\tif err := json.Unmarshal(bodyBytes, &dest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponse.JSON200 = &dest\n\n\t}\n\n\treturn response, nil\n}", "func (s *SubnetListener) ListSecurityGroups(inctx context.Context, in *protocol.SecurityGroupSubnetBindRequest) (_ *protocol.SecurityGroupBondsResponse, err error) {\n\tdefer fail.OnExitConvertToGRPCStatus(inctx, &err)\n\tdefer fail.OnExitLogError(inctx, &err)\n\tdefer fail.OnExitWrapError(inctx, &err, \"cannot list Security Groups bound to Subnet\")\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\tnetworkRef, _ := srvutils.GetReference(in.GetNetwork())\n\tsubnetRef, _ := srvutils.GetReference(in.GetSubnet())\n\tif subnetRef == \"\" {\n\t\treturn nil, fail.InvalidRequestError(\"neither name nor id given as reference for Subnet\")\n\t}\n\n\tjob, xerr := PrepareJob(inctx, in.GetNetwork().GetTenantId(), fmt.Sprintf(\"network/%s/subnet/%s/securitygroups/list\", networkRef, subnetRef))\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\tdefer job.Close()\n\n\tstate := securitygroupstate.Enum(in.GetState())\n\n\thandler := handlers.NewSubnetHandler(job)\n\tbonds, xerr := handler.ListSecurityGroups(networkRef, subnetRef, state)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tresp := converters.SecurityGroupBondsFromPropertyToProtocol(bonds, \"subnets\")\n\treturn resp, nil\n}", "func (o *FiltersSecurityGroup) GetDescriptionsOk() (*[]string, bool) {\n\tif o == nil || o.Descriptions == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Descriptions, true\n}", "func (o *GetSecurityGroupInternalServerError) IsSuccess() bool {\n\treturn false\n}", "func (o *CreateLoadBalancerRequest) SetSecurityGroups(v []string) {\n\to.SecurityGroups = &v\n}", "func (o *VirtualMachineToAlternativeRestoreOptions) GetNetworkSecurityGroupIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.NetworkSecurityGroupId, true\n}", "func NewGetSecurityGroupOK() *GetSecurityGroupOK {\n\treturn &GetSecurityGroupOK{}\n}", "func (o *User) GetSchoolsOk() ([]string, bool) {\n\tif o == nil || o.Schools == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.Schools, true\n}", "func (o *FiltersSecurityGroup) GetNetIdsOk() (*[]string, bool) {\n\tif o == nil || o.NetIds == nil {\n\t\treturn nil, false\n\t}\n\treturn o.NetIds, true\n}", "func (o *SecurityGroup) HasSecurityGroupName() bool {\n\tif o != nil && o.SecurityGroupName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) GetSecurityGroupNames() []string {\n\tif o == nil || o.SecurityGroupNames == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroupNames\n}", "func (o *FiltersVmGroup) GetSecurityGroupIds() []string {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroupIds\n}", "func (o *SecurityGroup) GetTagsOk() (*[]ResourceTag, bool) {\n\tif o == nil || o.Tags == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Tags, true\n}", "func (m *Group) GetSecurityEnabled()(*bool) {\n return m.securityEnabled\n}", "func (m *MockClient) DescribeSecurityGroups(arg0 *ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DescribeSecurityGroups\", arg0)\n\tret0, _ := ret[0].(*ec2.DescribeSecurityGroupsOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (o *FeedSyncResult) GetGroupsOk() ([]GroupSyncResult, bool) {\n\tif o == nil || o.Groups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Groups, true\n}", "func (c *Client) BindSecurityGroups(args *BindSecurityGroupsArgs) error {\n\tjsonBytes, jsonErr := json.Marshal(args)\n\tif jsonErr != nil {\n\t\treturn jsonErr\n\t}\n\tbody, err := bce.NewBodyFromBytes(jsonBytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn BindSecurityGroups(c, body)\n}", "func (c *MockNetworkSecurityGroupsClient) List(ctx context.Context, resourceGroupName string) ([]network.SecurityGroup, error) {\n\tvar l []network.SecurityGroup\n\tfor _, nsg := range c.NSGs {\n\t\tl = append(l, nsg)\n\t}\n\treturn l, nil\n}", "func ExampleRDS_DescribeDBSecurityGroups_shared00() {\n\tsvc := rds.New(session.New())\n\tinput := &rds.DescribeDBSecurityGroupsInput{\n\t\tDBSecurityGroupName: aws.String(\"mydbsecuritygroup\"),\n\t}\n\n\tresult, err := svc.DescribeDBSecurityGroups(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase rds.ErrCodeDBSecurityGroupNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}", "func (c *Client) ListSecurityGroups(ctx context.Context, zone string) ([]*SecurityGroup, error) {\n\tlist := make([]*SecurityGroup, 0)\n\n\tresp, err := c.ListSecurityGroupsWithResponse(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.JSON200.SecurityGroups != nil {\n\t\tfor i := range *resp.JSON200.SecurityGroups {\n\t\t\tsecurityGroup := securityGroupFromAPI(&(*resp.JSON200.SecurityGroups)[i])\n\t\t\tsecurityGroup.c = c\n\t\t\tsecurityGroup.zone = zone\n\n\t\t\tlist = append(list, securityGroup)\n\t\t}\n\t}\n\n\treturn list, nil\n}", "func NewListSecurityGroupsRequest(server string) (*http.Request, error) {\n\tvar err error\n\n\tqueryUrl, err := url.Parse(server)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbasePath := fmt.Sprintf(\"/security-group\")\n\tif basePath[0] == '/' {\n\t\tbasePath = basePath[1:]\n\t}\n\n\tqueryUrl, err = queryUrl.Parse(basePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := http.NewRequest(\"GET\", queryUrl.String(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn req, nil\n}", "func (mr *MockSecurityGroupServiceIfaceMockRecorder) ListSecurityGroups(p interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListSecurityGroups\", reflect.TypeOf((*MockSecurityGroupServiceIface)(nil).ListSecurityGroups), p)\n}", "func (o *FiltersSecurityGroup) GetTagsOk() (*[]string, bool) {\n\tif o == nil || o.Tags == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Tags, true\n}", "func ExampleDeviceSecurityGroupsClient_Get() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armsecurity.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewDeviceSecurityGroupsClient().Get(ctx, \"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub\", \"samplesecuritygroup\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.DeviceSecurityGroup = armsecurity.DeviceSecurityGroup{\n\t// \tName: to.Ptr(\"samplesecuritygroup\"),\n\t// \tType: to.Ptr(\"Microsoft.Security/deviceSecurityGroups\"),\n\t// \tID: to.Ptr(\"/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup\"),\n\t// \tProperties: &armsecurity.DeviceSecurityGroupProperties{\n\t// \t\tAllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{\n\t// \t\t\t&armsecurity.ConnectionToIPNotAllowed{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when an outbound connection is created between your device and an ip that isn't allowed\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Outbound connection to an ip that isn't allowed\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"ConnectionToIpNotAllowed\"),\n\t// \t\t\t\tValueType: to.Ptr(armsecurity.ValueTypeIPCidr),\n\t// \t\t\t\tAllowlistValues: []*string{\n\t// \t\t\t\t},\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.LocalUserNotAllowed{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when a local user that isn't allowed logins to the device\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Login by a local user that isn't allowed\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"LocalUserNotAllowed\"),\n\t// \t\t\t\tValueType: to.Ptr(armsecurity.ValueTypeString),\n\t// \t\t\t\tAllowlistValues: []*string{\n\t// \t\t\t\t},\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.ProcessNotAllowed{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when a process that isn't allowed is executed\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Execution of a process that isn't allowed\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"ProcessNotAllowed\"),\n\t// \t\t\t\tValueType: to.Ptr(armsecurity.ValueTypeString),\n\t// \t\t\t\tAllowlistValues: []*string{\n\t// \t\t\t\t},\n\t// \t\t}},\n\t// \t\tDenylistRules: []*armsecurity.DenylistCustomAlertRule{\n\t// \t\t},\n\t// \t\tThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{\n\t// \t\t},\n\t// \t\tTimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{\n\t// \t\t\t&armsecurity.ActiveConnectionsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of active connections of a device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of active connections is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"ActiveConnectionsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.AmqpC2DMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of cloud to device messages (AMQP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"AmqpC2DMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.MqttC2DMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of cloud to device messages (MQTT protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"MqttC2DMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.HTTPC2DMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of cloud to device messages (HTTP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"HttpC2DMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of rejected cloud to device messages (AMQP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"AmqpC2DRejectedMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of rejected cloud to device messages (MQTT protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"MqttC2DRejectedMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of rejected cloud to device messages (HTTP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"HttpC2DRejectedMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.AmqpD2CMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device to cloud messages (AMQP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"AmqpD2CMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.MqttD2CMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device to cloud messages (MQTT protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"MqttD2CMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.HTTPD2CMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device to cloud messages (HTTP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"HttpD2CMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.DirectMethodInvokesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of direct method invokes in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of direct method invokes is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"DirectMethodInvokesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.FailedLocalLoginsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of failed local logins on the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of failed local logins is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"FailedLocalLoginsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.FileUploadsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of file uploads is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"FileUploadsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.QueuePurgesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device queue purges in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device queue purges is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"QueuePurgesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.TwinUpdatesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of twin updates is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"TwinUpdatesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.UnauthorizedOperationsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of unauthorized operations is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"UnauthorizedOperationsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t}},\n\t// \t},\n\t// }\n}", "func (o *FiltersSecurityGroup) GetSecurityGroupIds() []string {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroupIds\n}", "func (o *HoldingsOverride) GetSecurityOk() (*SecurityOverride, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Security, true\n}", "func (o *NetgroupsSettingsCollectionGetOK) IsSuccess() bool {\n\treturn true\n}", "func (*ListSecurityGroupsResponse) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_vpc_v1_security_group_service_proto_rawDescGZIP(), []int{2}\n}", "func (o *SecurityGroup) GetInboundRulesOk() (*[]SecurityGroupRule, bool) {\n\tif o == nil || o.InboundRules == nil {\n\t\treturn nil, false\n\t}\n\treturn o.InboundRules, true\n}", "func GetUserGroups(r *http.Request) map[string]bool {\n\tif r.Context().Value(GroupCtxKey) != nil {\n\t\treturn r.Context().Value(GroupCtxKey).(map[string]bool)\n\t}\n\n\treturn nil\n}", "func (o *EventAttributes) GetMonitorGroupsOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MonitorGroups.Get(), o.MonitorGroups.IsSet()\n}", "func (o *GetSecurityGroupConflict) IsSuccess() bool {\n\treturn false\n}", "func (o *PcloudVolumegroupsGetOK) IsSuccess() bool {\n\treturn true\n}", "func ExampleDeviceSecurityGroupsClient_Get() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclient, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := client.Get(ctx,\n\t\t\"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub\",\n\t\t\"samplesecuritygroup\",\n\t\tnil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// TODO: use response item\n\t_ = res\n}", "func (o ClusterOutput) SecurityGroupNames() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.SecurityGroupNames }).(pulumi.StringArrayOutput)\n}", "func (s *DefaultSpaceSettings) SetSecurityGroups(v []*string) *DefaultSpaceSettings {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (o *SamlConfigurationProperties) GetDefaultGroupsOk() (*SamlConfigurationPropertyItemsArray, bool) {\n\tif o == nil || o.DefaultGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.DefaultGroups, true\n}", "func (o *W2) GetSocialSecurityWagesOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SocialSecurityWages.Get(), o.SocialSecurityWages.IsSet()\n}", "func (o *W2) GetSocialSecurityTipsOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SocialSecurityTips.Get(), o.SocialSecurityTips.IsSet()\n}", "func (a *Client) ListOpenstackSecurityGroupsNoCredentialsV2(params *ListOpenstackSecurityGroupsNoCredentialsV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOpenstackSecurityGroupsNoCredentialsV2OK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewListOpenstackSecurityGroupsNoCredentialsV2Params()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"listOpenstackSecurityGroupsNoCredentialsV2\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/api/v2/projects/{project_id}/clusters/{cluster_id}/providers/openstack/securitygroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &ListOpenstackSecurityGroupsNoCredentialsV2Reader{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.(*ListOpenstackSecurityGroupsNoCredentialsV2OK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*ListOpenstackSecurityGroupsNoCredentialsV2Default)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "func (o *MicrosoftGraphEducationUser) GetSchoolsOk() ([]MicrosoftGraphEducationSchool, bool) {\n\tif o == nil || o.Schools == nil {\n\t\tvar ret []MicrosoftGraphEducationSchool\n\t\treturn ret, false\n\t}\n\treturn *o.Schools, true\n}", "func (c *MockNetworkSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, nsgName string) (*network.SecurityGroup, error) {\n\tasg, ok := c.NSGs[nsgName]\n\tif !ok {\n\t\treturn nil, nil\n\t}\n\treturn &asg, nil\n}", "func (o *ListServerGroupOK) IsSuccess() bool {\n\treturn true\n}", "func (o *MemoryPersistentMemoryConfiguration) GetSecurityStateOk() (*string, bool) {\n\tif o == nil || o.SecurityState == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityState, true\n}", "func (o *ListServerGroupBadRequest) IsSuccess() bool {\n\treturn false\n}", "func (c *Client) ListKubernetesSecurityGroups(ctx context.Context, vpcID, clusterName string) ([]string, error) {\n\tgroups, err := c.EC2.DescribeSecurityGroupsWithContext(ctx, &ec2.DescribeSecurityGroupsInput{\n\t\tFilters: []*ec2.Filter{\n\t\t\t{\n\t\t\t\tName: aws.String(\"vpc-id\"),\n\t\t\t\tValues: []*string{aws.String(vpcID)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: aws.String(\"tag-key\"),\n\t\t\t\tValues: []*string{aws.String(fmt.Sprintf(\"kubernetes.io/cluster/%s\", clusterName))},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: aws.String(\"tag-value\"),\n\t\t\t\tValues: []*string{aws.String(\"owned\")},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar results []string\n\tfor _, group := range groups.SecurityGroups {\n\t\tresults = append(results, *group.GroupId)\n\t}\n\n\treturn results, nil\n}", "func (o *SecurityGroup) GetSecurityGroupId() string {\n\tif o == nil || o.SecurityGroupId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroupId\n}", "func GetSecurityGroupConfig(s *ec2.SecurityGroup) []AWSResourceConfig {\n\tcf := SecurityGroupConfig{\n\t\tConfig: Config{\n\t\t\tName: s.GroupName,\n\t\t\tTags: s.Tags,\n\t\t},\n\t\tGroupName: s.GroupName,\n\t\tGroupDescription: s.GroupDescription,\n\t}\n\n\tingresses := make([]IngressEgress, 0)\n\tfor _, i := range s.SecurityGroupIngress {\n\t\tingress := IngressEgress{\n\t\t\tIPProtocol: i.IpProtocol,\n\t\t\tDescription: i.Description,\n\t\t\tCidrIP: []string{i.CidrIp},\n\t\t\tCidrIpv6: []string{i.CidrIpv6},\n\t\t\tFromPort: i.FromPort,\n\t\t\tToPort: i.ToPort,\n\t\t}\n\t\tingresses = append(ingresses, ingress)\n\t}\n\tcf.SecurityGroupIngress = ingresses\n\n\tegresses := make([]IngressEgress, 0)\n\tfor _, e := range s.SecurityGroupEgress {\n\t\tegress := IngressEgress{\n\t\t\tIPProtocol: e.IpProtocol,\n\t\t\tDescription: e.Description,\n\t\t\tCidrIP: []string{e.CidrIp},\n\t\t\tCidrIpv6: []string{e.CidrIpv6},\n\t\t\tFromPort: e.FromPort,\n\t\t\tToPort: e.ToPort,\n\t\t}\n\t\tegresses = append(egresses, egress)\n\t}\n\tcf.SecurityGroupEgress = egresses\n\n\treturn []AWSResourceConfig{{\n\t\tResource: cf,\n\t\tMetadata: s.AWSCloudFormationMetadata,\n\t}}\n}", "func (o *ControllersUpdateStorageOptionsTemplateRequest) GetSecureOk() (*bool, bool) {\n\tif o == nil || o.Secure == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Secure, true\n}", "func (o *UpdateUserGroupsBadRequest) IsSuccess() bool {\n\treturn false\n}", "func (o *FiltersSecurityGroup) GetTagValuesOk() (*[]string, bool) {\n\tif o == nil || o.TagValues == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TagValues, true\n}", "func (o *CloudAwsVirtualMachineAllOf) SetSecurityGroups(v []CloudAwsSecurityGroupRelationship) {\n\to.SecurityGroups = v\n}", "func (o *FiltersVmGroup) GetSubnetIdsOk() (*[]string, bool) {\n\tif o == nil || o.SubnetIds == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SubnetIds, true\n}", "func (*ListSecurityGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_vpc_v1_security_group_service_proto_rawDescGZIP(), []int{1}\n}", "func (o *UpdatesV3Request) GetSecurityOnlyOk() (*bool, bool) {\n\tif o == nil || o.SecurityOnly == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityOnly, true\n}", "func (o *UpdateUserGroupsOK) IsSuccess() bool {\n\treturn true\n}", "func Find(ec2Client aws.EC2API, nameTags []*string) ([]*SecurityGroup, error) {\n\tfilters := []*ec2.Filter{\n\t\t&ec2.Filter{\n\t\t\tName: to.Strp(\"tag-key\"),\n\t\t\tValues: []*string{to.Strp(\"Name\")},\n\t\t},\n\t\t&ec2.Filter{\n\t\t\tName: to.Strp(\"tag-value\"),\n\t\t\tValues: nameTags,\n\t\t},\n\t}\n\n\toutput, err := ec2Client.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{\n\t\tFilters: filters,\n\t\tMaxResults: to.Int64p(5), // Smallest allowed value returns\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsgs := newSGs(output.SecurityGroups)\n\tswitch len(sgs) {\n\tcase len(nameTags):\n\t\treturn sgs, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Number of Security Groups %v/%v\", len(sgs), len(nameTags))\n\t}\n}", "func (o EciScalingConfigurationOutput) SecurityGroupId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EciScalingConfiguration) pulumi.StringPtrOutput { return v.SecurityGroupId }).(pulumi.StringPtrOutput)\n}", "func (o *SecureScore) GetControlScoresOk() ([]AnyOfmicrosoftGraphControlScore, bool) {\n\tif o == nil || o.ControlScores == nil {\n\t\tvar ret []AnyOfmicrosoftGraphControlScore\n\t\treturn ret, false\n\t}\n\treturn *o.ControlScores, true\n}", "func (o *PcloudVolumegroupsGetBadRequest) IsSuccess() bool {\n\treturn false\n}", "func (s *DescribeMountTargetSecurityGroupsOutput) SetSecurityGroups(v []*string) *DescribeMountTargetSecurityGroupsOutput {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (o ClusterNodeAttributeOutput) SecurityGroupId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeAttribute) string { return v.SecurityGroupId }).(pulumi.StringOutput)\n}", "func (o *SecureScore) GetEnabledServicesOk() ([]string, bool) {\n\tif o == nil || o.EnabledServices == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.EnabledServices, true\n}" ]
[ "0.8232663", "0.7047844", "0.70013595", "0.68706304", "0.68588334", "0.651668", "0.647456", "0.61981946", "0.6160259", "0.6145392", "0.6071484", "0.6070678", "0.60376275", "0.60219413", "0.59867287", "0.59803146", "0.587398", "0.5838932", "0.58343804", "0.5832709", "0.58278936", "0.57407975", "0.57358885", "0.57230717", "0.56921643", "0.5672437", "0.56711924", "0.56328714", "0.5607093", "0.5593865", "0.5526562", "0.55233884", "0.54944384", "0.547686", "0.5474771", "0.54739624", "0.54727817", "0.54415756", "0.54344976", "0.5397777", "0.5396041", "0.5394092", "0.5392361", "0.53829724", "0.5379769", "0.5297968", "0.52928305", "0.52859765", "0.5283042", "0.52687114", "0.5265614", "0.5246522", "0.5232181", "0.52230805", "0.5220529", "0.52134144", "0.5200817", "0.5190173", "0.5136543", "0.5129705", "0.5114435", "0.5108879", "0.509051", "0.5055599", "0.50188494", "0.49938482", "0.49850792", "0.49773514", "0.49462038", "0.49450088", "0.49439675", "0.4940841", "0.49403003", "0.49385446", "0.49362168", "0.49311045", "0.49290013", "0.4915471", "0.4912682", "0.4907915", "0.49075228", "0.49048513", "0.48951787", "0.4877653", "0.48698", "0.4860959", "0.485105", "0.48497733", "0.48391291", "0.48328143", "0.4827123", "0.4826352", "0.48071873", "0.47998813", "0.47984928", "0.47954205", "0.47907853", "0.4785913", "0.47843423", "0.47816658" ]
0.77499956
1
HasSecurityGroups returns a boolean if a field has been set.
HasSecurityGroups возвращает логическое значение, если поле было задано.
func (o *CloudAwsVirtualMachineAllOf) HasSecurityGroups() bool { if o != nil && o.SecurityGroups != nil { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) HasSecurityGroups() bool {\n\tif o != nil && o.SecurityGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasSecurityGroupIds() bool {\n\tif o != nil && o.SecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersVmGroup) HasSecurityGroupIds() bool {\n\tif o != nil && o.SecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SecurityGroup) HasSecurityGroupId() bool {\n\tif o != nil && o.SecurityGroupId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasSecurityGroupNames() bool {\n\tif o != nil && o.SecurityGroupNames != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SecurityGroup) HasSecurityGroupName() bool {\n\tif o != nil && o.SecurityGroupName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasSecurityID() bool {\n\treturn m.Has(tag.SecurityID)\n}", "func (m SecurityListRequest) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "func (o *FiltersSecurityGroup) HasOutboundRuleSecurityGroupNames() bool {\n\tif o != nil && o.OutboundRuleSecurityGroupNames != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasInboundRuleSecurityGroupNames() bool {\n\tif o != nil && o.InboundRuleSecurityGroupNames != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasSecurityDesc() bool {\n\treturn m.Has(tag.SecurityDesc)\n}", "func (o *FiltersSecurityGroup) HasOutboundRuleSecurityGroupIds() bool {\n\tif o != nil && o.OutboundRuleSecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasInboundRuleSecurityGroupIds() bool {\n\tif o != nil && o.InboundRuleSecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (r Routes) HasSecurity() bool {\n\t_, ok := r[\"security\"]\n\treturn ok\n}", "func (o *UpdatesV3Request) HasSecurityOnly() bool {\n\tif o != nil && o.SecurityOnly != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasSecurityIDSource() bool {\n\treturn m.Has(tag.SecurityIDSource)\n}", "func (m SecurityListRequest) HasSecurityExchange() bool {\n\treturn m.Has(tag.SecurityExchange)\n}", "func (m OrderStatusRequest) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "func (o *FiltersSecurityGroup) HasDescriptions() bool {\n\tif o != nil && o.Descriptions != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m OrderStatusRequest) HasSecurityID() bool {\n\treturn m.Has(tag.SecurityID)\n}", "func (m OrderStatusRequest) HasSecurityDesc() bool {\n\treturn m.Has(tag.SecurityDesc)\n}", "func (m OrderStatusRequest) HasSecurityDesc() bool {\n\treturn m.Has(tag.SecurityDesc)\n}", "func (o *MemoryPersistentMemoryConfiguration) HasSecurityState() bool {\n\tif o != nil && o.SecurityState != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *User) HasSchools() bool {\n\tif o != nil && o.Schools != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SecurityGroup) HasInboundRules() bool {\n\tif o != nil && o.InboundRules != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasSecurityReqID() bool {\n\treturn m.Has(tag.SecurityReqID)\n}", "func (m SecurityListRequest) HasSecurityListRequestType() bool {\n\treturn m.Has(tag.SecurityListRequestType)\n}", "func (o *CreateLoadBalancerRequest) GetSecurityGroups() []string {\n\tif o == nil || o.SecurityGroups == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroups\n}", "func (m OrderStatusRequest) HasSecurityExchange() bool {\n\treturn m.Has(tag.SecurityExchange)\n}", "func (o *CreateLoadBalancerRequest) GetSecurityGroupsOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroups, true\n}", "func (o *ControllersUpdateStorageOptionsTemplateRequest) HasSecure() bool {\n\tif o != nil && o.Secure != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m CrossOrderCancelReplaceRequest) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "func (m CrossOrderCancelReplaceRequest) HasSecurityID() bool {\n\treturn m.Has(tag.SecurityID)\n}", "func (o *SecurityGroup) HasOutboundRules() bool {\n\tif o != nil && o.OutboundRules != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *MicrosoftGraphEducationUser) HasSchools() bool {\n\tif o != nil && o.Schools != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SecurityGroup) HasDescription() bool {\n\tif o != nil && o.Description != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *W2) HasSocialSecurityWages() bool {\n\tif o != nil && o.SocialSecurityWages.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasNetIds() bool {\n\tif o != nil && o.NetIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *CreateLoadBalancerRequest) SetSecurityGroups(v []string) {\n\to.SecurityGroups = &v\n}", "func (m SecurityListRequest) HasCreditRating() bool {\n\treturn m.Has(tag.CreditRating)\n}", "func (az *AzK8sConstraintTemplate) HasSecurityPolicies() (*bool, error) {\n\tc, err := az.getConstraints()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif c != nil && len(*c) > 0 {\n\t\treturn utils.BoolPtr(true), nil\n\t}\n\treturn utils.BoolPtr(false), nil\n}", "func (m MarketDataSnapshotFullRefresh) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "func (m CrossOrderCancelReplaceRequest) HasSecurityDesc() bool {\n\treturn m.Has(tag.SecurityDesc)\n}", "func (m CrossOrderCancelReplaceRequest) HasSecurityIDSource() bool {\n\treturn m.Has(tag.SecurityIDSource)\n}", "func (c *Config) IsSecurityEnabled() bool {\n\tval, ok := c.backend.Lookup(\"client.BCCSP.security.enabled\")\n\tif !ok {\n\t\treturn defEnabled\n\t}\n\treturn cast.ToBool(val)\n}", "func (m CrossOrderCancelReplaceRequest) HasSecurityExchange() bool {\n\treturn m.Has(tag.SecurityExchange)\n}", "func (o *SecurityGroup) HasTags() bool {\n\tif o != nil && o.Tags != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (instance *Host) EnableSecurityGroup(ctx context.Context, sg resources.SecurityGroup) (ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn fail.InvalidInstanceError()\n\t}\n\tif ctx == nil {\n\t\treturn fail.InvalidParameterError(\"ctx\", \"cannot be nil\")\n\t}\n\tif sg == nil {\n\t\treturn fail.InvalidParameterError(\"sg\", \"cannot be null value of 'SecurityGroup'\")\n\t}\n\n\thid, err := instance.GetID()\n\tif err != nil {\n\t\treturn fail.ConvertError(err)\n\t}\n\n\tsgName := sg.GetName()\n\n\t// instance.Lock()\n\t// defer instance.Unlock()\n\n\tsvc := instance.Service()\n\txerr := instance.Alter(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Inspect(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tvar asg *abstract.SecurityGroup\n\t\t\txerr := sg.Inspect(ctx, func(clonable data.Clonable, _ *serialize.JSONProperties) fail.Error {\n\t\t\t\tvar ok bool\n\t\t\t\tif asg, ok = clonable.(*abstract.SecurityGroup); !ok {\n\t\t\t\t\treturn fail.InconsistentError(\"'*abstract.SecurityGroup' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\tif xerr != nil {\n\t\t\t\treturn xerr\n\t\t\t}\n\n\t\t\t// First check if the security group is not already registered for the Host with the exact same state\n\t\t\tvar found bool\n\t\t\tfor k := range hsgV1.ByID {\n\t\t\t\tif k == asg.ID {\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\treturn fail.NotFoundError(\"security group '%s' is not bound to Host '%s'\", sgName, hid)\n\t\t\t}\n\n\t\t\t{\n\t\t\t\t// Bind the security group on provider side; if already bound (*fail.ErrDuplicate), considered as a success\n\t\t\t\txerr = svc.BindSecurityGroupToHost(ctx, asg, hid)\n\t\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\t\tif xerr != nil {\n\t\t\t\t\tswitch xerr.(type) {\n\t\t\t\t\tcase *fail.ErrDuplicate:\n\t\t\t\t\t\tdebug.IgnoreError2(ctx, xerr)\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn xerr\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// found and updated, update metadata\n\t\t\thsgV1.ByID[asg.ID].Disabled = false\n\t\t\treturn nil\n\t\t})\n\t})\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\n\treturn nil\n}", "func (o *W2) HasSocialSecurityTips() bool {\n\tif o != nil && o.SocialSecurityTips.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *User) HasOnPremisesSecurityIdentifier() bool {\n\tif o != nil && o.OnPremisesSecurityIdentifier != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m MarketDataSnapshotFullRefresh) HasSecurityDesc() bool {\n\treturn m.Has(tag.SecurityDesc)\n}", "func (m MarketDataSnapshotFullRefresh) HasSecurityID() bool {\n\treturn m.Has(tag.SecurityID)\n}", "func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroupsOk() ([]CloudAwsSecurityGroupRelationship, bool) {\n\tif o == nil || o.SecurityGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroups, true\n}", "func (m SecurityListRequest) HasRepoCollateralSecurityType() bool {\n\treturn m.Has(tag.RepoCollateralSecurityType)\n}", "func (o *FiltersSecurityGroup) HasInboundRuleToPortRanges() bool {\n\tif o != nil && o.InboundRuleToPortRanges != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (instance *Host) ListSecurityGroups(ctx context.Context, state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\n\t// instance.RLock()\n\t// defer instance.RUnlock()\n\n\txerr := instance.Inspect(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Inspect(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tlist = FilterBondsByKind(hsgV1.ByID, state)\n\t\t\treturn nil\n\t\t})\n\t})\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\treturn list, nil\n}", "func (o *SecurityGroup) HasNetId() bool {\n\tif o != nil && o.NetId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasInboundRuleProtocols() bool {\n\tif o != nil && o.InboundRuleProtocols != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasOutboundRuleFromPortRanges() bool {\n\tif o != nil && o.OutboundRuleFromPortRanges != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (d UserData) HasGroups() bool {\n\treturn d.ModelData.Has(models.NewFieldName(\"Groups\", \"group_ids\"))\n}", "func (m SecurityListRequest) HasCurrency() bool {\n\treturn m.Has(tag.Currency)\n}", "func (o *FiltersSecurityGroup) HasInboundRuleFromPortRanges() bool {\n\tif o != nil && o.InboundRuleFromPortRanges != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasEncodedSecurityDesc() bool {\n\treturn m.Has(tag.EncodedSecurityDesc)\n}", "func (h *HsaCoHeader) EnableSgprWorkGroupInfo() bool {\n\treturn extractBits(h.ComputePgmRsrc2, 10, 10) != 0\n}", "func (o *Invitation) HasRoles() bool {\n\tif o != nil && o.Roles != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasSubscriptionRequestType() bool {\n\treturn m.Has(tag.SubscriptionRequestType)\n}", "func (o *FiltersSecurityGroup) HasInboundRuleIpRanges() bool {\n\tif o != nil && o.InboundRuleIpRanges != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersVmGroup) HasSubnetIds() bool {\n\tif o != nil && o.SubnetIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasIssuer() bool {\n\treturn m.Has(tag.Issuer)\n}", "func (o *FiltersSecurityGroup) HasOutboundRuleIpRanges() bool {\n\tif o != nil && o.OutboundRuleIpRanges != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m MarketDataSnapshotFullRefresh) HasSecurityExchange() bool {\n\treturn m.Has(tag.SecurityExchange)\n}", "func (mr *MockClientMockRecorder) DescribeSecurityGroups(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DescribeSecurityGroups\", reflect.TypeOf((*MockClient)(nil).DescribeSecurityGroups), arg0)\n}", "func (o *StoragePhysicalDisk) HasSecured() bool {\n\tif o != nil && o.Secured != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *LogsPipelineProcessor) HasIsEnabled() bool {\n\tif o != nil && o.IsEnabled != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *User) HasSkills() bool {\n\tif o != nil && o.Skills != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *StorageHitachiPortAllOf) HasPortLunSecurity() bool {\n\tif o != nil && o.PortLunSecurity != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (mr *MockSecurityGroupServiceIfaceMockRecorder) ListSecurityGroups(p interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListSecurityGroups\", reflect.TypeOf((*MockSecurityGroupServiceIface)(nil).ListSecurityGroups), p)\n}", "func (o *CreateLoadBalancerRequest) HasSubnets() bool {\n\tif o != nil && o.Subnets != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasOutboundRuleToPortRanges() bool {\n\tif o != nil && o.OutboundRuleToPortRanges != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasOutboundRuleProtocols() bool {\n\tif o != nil && o.OutboundRuleProtocols != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersNatService) HasSubnetIds() bool {\n\tif o != nil && o.SubnetIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasTags() bool {\n\tif o != nil && o.Tags != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *StoragePhysicalDiskAllOf) HasSecured() bool {\n\tif o != nil && o.Secured != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ProcessGroupsEntity) HasProcessGroups() bool {\n\tif o != nil && o.ProcessGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *User) HasLicenseDetails() bool {\n\tif o != nil && o.LicenseDetails != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *MicrosoftGraphEducationUser) HasStudent() bool {\n\tif o != nil && o.Student != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *User) HasCalendarGroups() bool {\n\tif o != nil && o.CalendarGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SecureScore) HasEnabledServices() bool {\n\tif o != nil && o.EnabledServices != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SecureScore) HasControlScores() bool {\n\tif o != nil && o.ControlScores != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (m SecurityListRequest) HasInstrRegistry() bool {\n\treturn m.Has(tag.InstrRegistry)\n}", "func (o *SamlConfigurationProperties) HasAddGroupMemberships() bool {\n\tif o != nil && o.AddGroupMemberships != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (instance *Host) DisableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn fail.InvalidInstanceError()\n\t}\n\tif ctx == nil {\n\t\treturn fail.InvalidParameterError(\"ctx\", \"cannot be nil\")\n\t}\n\tif sgInstance == nil {\n\t\treturn fail.InvalidParameterError(\"sgInstance\", \"cannot be nil\")\n\t}\n\n\tsgName := sgInstance.GetName()\n\tsgID, err := sgInstance.GetID()\n\tif err != nil {\n\t\treturn fail.ConvertError(err)\n\t}\n\n\thid, err := instance.GetID()\n\tif err != nil {\n\t\treturn fail.ConvertError(err)\n\t}\n\n\tsvc := instance.Service()\n\txerr := instance.Alter(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Alter(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tvar asg *abstract.SecurityGroup\n\t\t\txerr := sgInstance.Inspect(ctx, func(clonable data.Clonable, _ *serialize.JSONProperties) fail.Error {\n\t\t\t\tvar ok bool\n\t\t\t\tif asg, ok = clonable.(*abstract.SecurityGroup); !ok {\n\t\t\t\t\treturn fail.InconsistentError(\"'*abstract.SecurityGroup' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\tif xerr != nil {\n\t\t\t\treturn xerr\n\t\t\t}\n\n\t\t\t// First check if the security group is not already registered for the Host with the exact same state\n\t\t\tvar found bool\n\t\t\tfor k := range hsgV1.ByID {\n\t\t\t\tif k == asg.ID {\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\treturn fail.NotFoundError(\"security group '%s' is not bound to Host '%s'\", sgName, sgID)\n\t\t\t}\n\n\t\t\t{\n\t\t\t\t// Bind the security group on provider side; if security group not binded, considered as a success\n\t\t\t\txerr = svc.UnbindSecurityGroupFromHost(ctx, asg, hid)\n\t\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\t\tif xerr != nil {\n\t\t\t\t\tswitch xerr.(type) {\n\t\t\t\t\tcase *fail.ErrNotFound:\n\t\t\t\t\t\tdebug.IgnoreError2(ctx, xerr)\n\t\t\t\t\t\t// continue\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn xerr\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// found, update properties\n\t\t\thsgV1.ByID[asg.ID].Disabled = true\n\t\t\treturn nil\n\t\t})\n\t})\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\n\treturn nil\n}", "func (o *CloudAwsVirtualMachineAllOf) SetSecurityGroups(v []CloudAwsSecurityGroupRelationship) {\n\to.SecurityGroups = v\n}", "func (g ScimGroup) HasRole(role string) bool {\n\tfor _, groupRole := range g.Roles {\n\t\tif groupRole.Value == role {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasAccountIds() bool {\n\tif o != nil && o.AccountIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (s *DefaultSpaceSettings) SetSecurityGroups(v []*string) *DefaultSpaceSettings {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (p *Plugin) HasGroupExpression(user *security.User, resourceTenant string, groupExpression grp.GroupExpression) bool {\n\n\t// no resource tenant is not ok, there can be no default on this layer\n\tif resourceTenant == \"\" {\n\t\treturn false\n\t}\n\n\t// what we have now is the slice of groups that the user has\n\t// (including \"on behalf\", with concrete cluster-tenant or wildcard \"all\")\n\t// \"on behalf\"-groups do not have cluster-tenant because it is already evaluated for the concrete tenant to act\n\n\tfor i := range user.Groups {\n\t\tgrpCtx, err := p.grpr.ParseGroupName(string(user.Groups[i]))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// check if group maches for any of the tenants\n\t\tif resourceTenant == grp.Any {\n\t\t\tif groupExpression.Matches(*grpCtx) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// resource belongs to own tenant\n\t\tif strings.EqualFold(user.Tenant, resourceTenant) && grpCtx.OnBehalfTenant == \"\" {\n\t\t\tif groupExpression.Matches(*grpCtx) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// resource belongs to other tenant, access \"on behalf\": if group is for resource-tenant or for \"all\" then check\n\t\tif strings.EqualFold(grpCtx.OnBehalfTenant, resourceTenant) || grpCtx.OnBehalfTenant == grp.All {\n\t\t\tif groupExpression.Matches(*grpCtx) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn false\n\n}", "func (o *Permissao) HasIsGroup() bool {\n\tif o != nil && o.IsGroup != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (s *UserSettings) SetSecurityGroups(v []*string) *UserSettings {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (o *MicrosoftGraphWindows10CompliancePolicy) HasSecureBootEnabled() bool {\n\tif o != nil && o.SecureBootEnabled != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}" ]
[ "0.82217926", "0.69316316", "0.6851042", "0.68082595", "0.6804337", "0.67036617", "0.6323814", "0.6295684", "0.62837297", "0.62552655", "0.6242088", "0.6223502", "0.6209826", "0.61676913", "0.60280645", "0.60165983", "0.59652287", "0.5922158", "0.59120315", "0.5886787", "0.5858628", "0.5858628", "0.58363765", "0.5802597", "0.57470936", "0.57233584", "0.5701294", "0.5699909", "0.5683837", "0.5680751", "0.5651708", "0.56459737", "0.56386405", "0.5631468", "0.5616259", "0.5590469", "0.55565226", "0.55484515", "0.55435914", "0.5529711", "0.5524957", "0.5490614", "0.546506", "0.5461899", "0.54285246", "0.5428319", "0.54136837", "0.540038", "0.5392171", "0.53860617", "0.53823674", "0.5373287", "0.53509295", "0.53464675", "0.5345086", "0.5329992", "0.5282324", "0.5278383", "0.5246391", "0.5237187", "0.5225626", "0.5225307", "0.5214904", "0.52139163", "0.52058995", "0.5183179", "0.5163269", "0.51412857", "0.5138791", "0.5134929", "0.5132135", "0.51240015", "0.5123354", "0.5121785", "0.5119304", "0.5118233", "0.5117804", "0.51168424", "0.510323", "0.5101433", "0.50930566", "0.5083343", "0.50715697", "0.5062244", "0.50552636", "0.50386995", "0.5037127", "0.5034565", "0.5031382", "0.5018991", "0.49983495", "0.49980694", "0.499676", "0.49924836", "0.4990264", "0.49839333", "0.498378", "0.49785975", "0.49777782", "0.4977107" ]
0.8029275
1
SetSecurityGroups gets a reference to the given []CloudAwsSecurityGroupRelationship and assigns it to the SecurityGroups field.
SetSecurityGroups получает ссылку на заданный []CloudAwsSecurityGroupRelationship и присваивает его полю SecurityGroups.
func (o *CloudAwsVirtualMachineAllOf) SetSecurityGroups(v []CloudAwsSecurityGroupRelationship) { o.SecurityGroups = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) SetSecurityGroups(v []string) {\n\to.SecurityGroups = &v\n}", "func (s *ModifyMountTargetSecurityGroupsInput) SetSecurityGroups(v []*string) *ModifyMountTargetSecurityGroupsInput {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *DescribeMountTargetSecurityGroupsOutput) SetSecurityGroups(v []*string) *DescribeMountTargetSecurityGroupsOutput {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *CreateMountTargetInput) SetSecurityGroups(v []*string) *CreateMountTargetInput {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *DefaultSpaceSettings) SetSecurityGroups(v []*string) *DefaultSpaceSettings {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *DescribeNotebookInstanceOutput) SetSecurityGroups(v []*string) *DescribeNotebookInstanceOutput {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *UserSettings) SetSecurityGroups(v []*string) *UserSettings {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *AwsVpcConfiguration) SetSecurityGroups(v []*string) *AwsVpcConfiguration {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *NASSecurityGroup) SetSecurityGroups(v []*SecurityGroup) *NASSecurityGroup {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (c *Client) AssociateSecurityGroups(request *AssociateSecurityGroupsRequest) (response *AssociateSecurityGroupsResponse, err error) {\n return c.AssociateSecurityGroupsWithContext(context.Background(), request)\n}", "func setSecurityGroups(c *cli.Context) error {\n\terr := checkArgCount(c, 2)\n\tif err != nil {\n\t\treturn err\n\t}\n\tid := c.Args().First()\n\titems := []string{}\n\tif c.Args()[1] != \"\" {\n\t\titems = regexp.MustCompile(`\\s*,\\s*`).Split(c.Args()[1], -1)\n\t}\n\tsecurityGroups := &photon.SecurityGroupsSpec{\n\t\tItems: items,\n\t}\n\n\tclient.Photonclient, err = client.GetClient(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttask, err := client.Photonclient.Tenants.SetSecurityGroups(id, securityGroups)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = waitOnTaskOperation(task.ID, c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroups() []CloudAwsSecurityGroupRelationship {\n\tif o == nil {\n\t\tvar ret []CloudAwsSecurityGroupRelationship\n\t\treturn ret\n\t}\n\treturn o.SecurityGroups\n}", "func (s *ResolverEndpoint) SetSecurityGroupIds(v []*string) *ResolverEndpoint {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *ResolverEndpoint) SetSecurityGroupIds(v []*string) *ResolverEndpoint {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (c *Client) BindSecurityGroups(args *BindSecurityGroupsArgs) error {\n\tjsonBytes, jsonErr := json.Marshal(args)\n\tif jsonErr != nil {\n\t\treturn jsonErr\n\t}\n\tbody, err := bce.NewBodyFromBytes(jsonBytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn BindSecurityGroups(c, body)\n}", "func (o *FiltersVmGroup) SetSecurityGroupIds(v []string) {\n\to.SecurityGroupIds = &v\n}", "func setDeploymentSecurityGroups(c *cli.Context) error {\n\tvar err error\n\tvar deploymentId string\n\tvar groups string\n\n\t// We have two cases:\n\t// Case 1: arguments are: id groups\n\t// Case 2: arguments are: groups\n\tif len(c.Args()) == 2 {\n\t\tdeploymentId = c.Args()[0]\n\t\tgroups = c.Args()[1]\n\t} else if len(c.Args()) == 1 {\n\t\tdeploymentId, err = getDefaultDeploymentId(c)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgroups = c.Args()[0]\n\t} else {\n\t\treturn fmt.Errorf(\"Usage: deployments set-security-groups [id] groups\")\n\t}\n\n\titems := regexp.MustCompile(`\\s*,\\s*`).Split(groups, -1)\n\tsecurityGroups := &photon.SecurityGroupsSpec{\n\t\tItems: items,\n\t}\n\n\tclient.Photonclient, err = client.GetClient(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttask, err := client.Photonclient.Deployments.SetSecurityGroups(deploymentId, securityGroups)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = waitOnTaskOperation(task.ID, c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = deploymentJsonHelper(c, deploymentId, client.Photonclient)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (s *DomainSettingsForUpdate) SetSecurityGroupIds(v []*string) *DomainSettingsForUpdate {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (o *FiltersSecurityGroup) SetSecurityGroupIds(v []string) {\n\to.SecurityGroupIds = &v\n}", "func (s *NeoVpcConfig) SetSecurityGroupIds(v []*string) *NeoVpcConfig {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *WorkforceVpcConfigResponse) SetSecurityGroupIds(v []*string) *WorkforceVpcConfigResponse {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *WorkforceVpcConfigRequest) SetSecurityGroupIds(v []*string) *WorkforceVpcConfigRequest {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *RecommendationJobVpcConfig) SetSecurityGroupIds(v []*string) *RecommendationJobVpcConfig {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *DomainSettings) SetSecurityGroupIds(v []*string) *DomainSettings {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *CreateResolverEndpointInput) SetSecurityGroupIds(v []*string) *CreateResolverEndpointInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *CreateResolverEndpointInput) SetSecurityGroupIds(v []*string) *CreateResolverEndpointInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func SecurityGroups(groups ...string) RequestOptionFunc {\n\treturn func(body *RequestBody) error {\n\t\tbody.SecurityGroup = groups\n\t\treturn nil\n\t}\n}", "func (s *UpdateNetworkSettingsInput) SetSecurityGroupIds(v []*string) *UpdateNetworkSettingsInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *VpcConfigResponse) SetSecurityGroupIds(v []*string) *VpcConfigResponse {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (o TopicRuleDestinationVpcConfigurationOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v TopicRuleDestinationVpcConfiguration) []string { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "func (s *NetworkSettings) SetSecurityGroupIds(v []*string) *NetworkSettings {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *CreateNetworkSettingsInput) SetSecurityGroupIds(v []*string) *CreateNetworkSettingsInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *CreateNotebookInstanceInput) SetSecurityGroupIds(v []*string) *CreateNotebookInstanceInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *VpcConfigRequest) SetSecurityGroupIds(v []*string) *VpcConfigRequest {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (instance *Host) setSecurityGroups(ctx context.Context, req abstract.HostRequest, defaultSubnet resources.Subnet) fail.Error {\n\tsvc := instance.Service()\n\tif req.Single {\n\t\thostID, err := instance.GetID()\n\t\tif err != nil {\n\t\t\treturn fail.ConvertError(err)\n\t\t}\n\t\tfor k := range req.SecurityGroupIDs {\n\t\t\tif k != \"\" {\n\t\t\t\tlogrus.WithContext(ctx).Infof(\"Binding security group with id %s to host %s\", k, hostID)\n\t\t\t\txerr := svc.BindSecurityGroupToHost(ctx, k, hostID)\n\t\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\t\tif xerr != nil {\n\t\t\t\t\treturn xerr\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\txerr := instance.Alter(ctx, func(clonable data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Alter(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) (finnerXErr fail.Error) {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\t// get default Subnet core data\n\t\t\tvar (\n\t\t\t\tdefaultAbstractSubnet *abstract.Subnet\n\t\t\t\tdefaultSubnetID string\n\t\t\t)\n\t\t\tinnerXErr := defaultSubnet.Inspect(ctx,\n\t\t\t\tfunc(clonable data.Clonable, _ *serialize.JSONProperties) fail.Error {\n\t\t\t\t\tvar ok bool\n\t\t\t\t\tdefaultAbstractSubnet, ok = clonable.(*abstract.Subnet)\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn fail.InconsistentError(\"'*abstract.Subnet' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t\t\t}\n\n\t\t\t\t\tdefaultSubnetID = defaultAbstractSubnet.ID\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t)\n\t\t\tif innerXErr != nil {\n\t\t\t\treturn innerXErr\n\t\t\t}\n\n\t\t\tvar gwsg, pubipsg, lansg resources.SecurityGroup\n\n\t\t\t// Apply Security Group for gateways in default Subnet\n\t\t\tif req.IsGateway && defaultAbstractSubnet.GWSecurityGroupID != \"\" {\n\t\t\t\tgwsg, innerXErr = LoadSecurityGroup(ctx, svc, defaultAbstractSubnet.GWSecurityGroupID)\n\t\t\t\tif innerXErr != nil {\n\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to query Subnet '%s' Security Group '%s'\", defaultSubnet.GetName(), defaultAbstractSubnet.GWSecurityGroupID)\n\t\t\t\t}\n\n\t\t\t\tinnerXErr = gwsg.BindToHost(ctx, instance, resources.SecurityGroupEnable, resources.MarkSecurityGroupAsSupplemental)\n\t\t\t\tif innerXErr != nil {\n\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to apply Subnet's GW Security Group for gateway '%s' on Host '%s'\", gwsg.GetName(), req.ResourceName)\n\t\t\t\t}\n\n\t\t\t\tdefer func() {\n\t\t\t\t\tif finnerXErr != nil && !req.KeepOnFailure {\n\t\t\t\t\t\tderr := gwsg.UnbindFromHost(cleanupContextFrom(ctx), instance)\n\t\t\t\t\t\tif derr != nil {\n\t\t\t\t\t\t\t_ = finnerXErr.AddConsequence(fail.Wrap(derr, \"cleaning up on %s, failed to unbind Security Group '%s' from Host '%s'\", ActionFromError(finnerXErr), gwsg.GetName(), req.ResourceName))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}()\n\n\t\t\t\tgwid, err := gwsg.GetID()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fail.ConvertError(err)\n\t\t\t\t}\n\n\t\t\t\titem := &propertiesv1.SecurityGroupBond{\n\t\t\t\t\tID: gwid,\n\t\t\t\t\tName: gwsg.GetName(),\n\t\t\t\t\tDisabled: false,\n\t\t\t\t\tFromSubnet: true,\n\t\t\t\t}\n\t\t\t\thsgV1.ByID[item.ID] = item\n\t\t\t\thsgV1.ByName[item.Name] = item.ID\n\t\t\t}\n\n\t\t\t// Apply Security Group for hosts with public IP in default Subnet\n\t\t\tif (req.IsGateway || req.PublicIP) && defaultAbstractSubnet.PublicIPSecurityGroupID != \"\" {\n\t\t\t\tpubipsg, innerXErr = LoadSecurityGroup(ctx, svc, defaultAbstractSubnet.PublicIPSecurityGroupID)\n\t\t\t\tif innerXErr != nil {\n\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to query Subnet '%s' Security Group with ID %s\", defaultSubnet.GetName(), defaultAbstractSubnet.PublicIPSecurityGroupID)\n\t\t\t\t}\n\n\t\t\t\tinnerXErr = pubipsg.BindToHost(ctx, instance, resources.SecurityGroupEnable, resources.MarkSecurityGroupAsSupplemental)\n\t\t\t\tif innerXErr != nil {\n\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to apply Subnet's Public Security Group for gateway '%s' on Host '%s'\", pubipsg.GetName(), req.ResourceName)\n\t\t\t\t}\n\n\t\t\t\tdefer func() {\n\t\t\t\t\tif finnerXErr != nil && !req.KeepOnFailure {\n\t\t\t\t\t\tderr := pubipsg.UnbindFromHost(cleanupContextFrom(ctx), instance)\n\t\t\t\t\t\tif derr != nil {\n\t\t\t\t\t\t\t_ = finnerXErr.AddConsequence(fail.Wrap(derr, \"cleaning up on %s, failed to unbind Security Group '%s' from Host '%s'\", ActionFromError(finnerXErr), pubipsg.GetName(), req.ResourceName))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}()\n\n\t\t\t\tpubID, err := pubipsg.GetID()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fail.ConvertError(err)\n\t\t\t\t}\n\n\t\t\t\titem := &propertiesv1.SecurityGroupBond{\n\t\t\t\t\tID: pubID,\n\t\t\t\t\tName: pubipsg.GetName(),\n\t\t\t\t\tDisabled: false,\n\t\t\t\t\tFromSubnet: true,\n\t\t\t\t}\n\t\t\t\thsgV1.ByID[item.ID] = item\n\t\t\t\thsgV1.ByName[item.Name] = item.ID\n\t\t\t}\n\n\t\t\t// Apply internal Security Group of each other subnets\n\t\t\tdefer func() {\n\t\t\t\tif finnerXErr != nil && !req.KeepOnFailure {\n\t\t\t\t\tvar (\n\t\t\t\t\t\tsg resources.SecurityGroup\n\t\t\t\t\t\tderr error\n\t\t\t\t\t\terrs []error\n\t\t\t\t\t)\n\t\t\t\t\tfor _, v := range req.Subnets {\n\t\t\t\t\t\tif v.ID == defaultSubnetID {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsubnetInstance, deeperXErr := LoadSubnet(cleanupContextFrom(ctx), svc, \"\", v.ID)\n\t\t\t\t\t\tif deeperXErr != nil {\n\t\t\t\t\t\t\t_ = innerXErr.AddConsequence(deeperXErr)\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsgName := sg.GetName()\n\t\t\t\t\t\tdeeperXErr = subnetInstance.Inspect(cleanupContextFrom(ctx), func(\n\t\t\t\t\t\t\tclonable data.Clonable, _ *serialize.JSONProperties,\n\t\t\t\t\t\t) fail.Error {\n\t\t\t\t\t\t\tabstractSubnet, ok := clonable.(*abstract.Subnet)\n\t\t\t\t\t\t\tif !ok {\n\t\t\t\t\t\t\t\treturn fail.InconsistentError(\"'*abstract.Subnet' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif abstractSubnet.InternalSecurityGroupID != \"\" {\n\t\t\t\t\t\t\t\tsg, derr = LoadSecurityGroup(cleanupContextFrom(ctx), svc, abstractSubnet.InternalSecurityGroupID)\n\t\t\t\t\t\t\t\tif derr != nil {\n\t\t\t\t\t\t\t\t\terrs = append(errs, derr)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tderr = sg.UnbindFromHost(cleanupContextFrom(ctx), instance)\n\t\t\t\t\t\t\t\t\tif derr != nil {\n\t\t\t\t\t\t\t\t\t\terrs = append(errs, derr)\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\treturn nil\n\t\t\t\t\t\t})\n\t\t\t\t\t\tif deeperXErr != nil {\n\t\t\t\t\t\t\t_ = finnerXErr.AddConsequence(fail.Wrap(deeperXErr, \"cleaning up on failure, failed to unbind Security Group '%s' from Host\", sgName))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif len(errs) > 0 {\n\t\t\t\t\t\t_ = finnerXErr.AddConsequence(fail.Wrap(fail.NewErrorList(errs), \"failed to unbind Subnets Security Group from Host '%s'\", sg.GetName(), req.ResourceName))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tfor _, v := range req.Subnets {\n\t\t\t\t// Do not try to bind defaultSubnet on gateway, because this code is running under a lock on defaultSubnet in this case, and this will lead to deadlock\n\t\t\t\t// (binding of gateway on defaultSubnet is done inside Subnet.Create() call)\n\t\t\t\tif req.IsGateway && v.ID == defaultSubnetID {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\totherSubnetInstance, innerXErr := LoadSubnet(ctx, svc, \"\", v.ID)\n\t\t\t\tinnerXErr = debug.InjectPlannedFail(innerXErr)\n\t\t\t\tif innerXErr != nil {\n\t\t\t\t\treturn innerXErr\n\t\t\t\t}\n\n\t\t\t\tvar otherAbstractSubnet *abstract.Subnet\n\t\t\t\tinnerXErr = otherSubnetInstance.Inspect(ctx, func(\n\t\t\t\t\tclonable data.Clonable, _ *serialize.JSONProperties,\n\t\t\t\t) fail.Error {\n\t\t\t\t\tvar ok bool\n\t\t\t\t\totherAbstractSubnet, ok = clonable.(*abstract.Subnet)\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn fail.InconsistentError(\"'*abstract.Subnet' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t\t\t}\n\t\t\t\t\t_ = otherAbstractSubnet\n\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\t\t\t\tif innerXErr != nil {\n\t\t\t\t\treturn innerXErr\n\t\t\t\t}\n\n\t\t\t\tsafe := false\n\n\t\t\t\t// Fix for Stein\n\t\t\t\t{\n\t\t\t\t\tst, xerr := svc.GetProviderName()\n\t\t\t\t\tif xerr != nil {\n\t\t\t\t\t\treturn xerr\n\t\t\t\t\t}\n\t\t\t\t\tif st != \"ovh\" {\n\t\t\t\t\t\tsafe = true\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif cfg, xerr := svc.GetConfigurationOptions(ctx); xerr == nil {\n\t\t\t\t\tif aval, ok := cfg.Get(\"Safe\"); ok {\n\t\t\t\t\t\tif val, ok := aval.(bool); ok {\n\t\t\t\t\t\t\tsafe = val\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif otherAbstractSubnet.InternalSecurityGroupID != \"\" {\n\t\t\t\t\tlansg, innerXErr = LoadSecurityGroup(ctx, svc, otherAbstractSubnet.InternalSecurityGroupID)\n\t\t\t\t\tif innerXErr != nil {\n\t\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to load Subnet '%s' internal Security Group %s\", otherAbstractSubnet.Name, otherAbstractSubnet.InternalSecurityGroupID)\n\t\t\t\t\t}\n\n\t\t\t\t\tif !safe {\n\t\t\t\t\t\tinnerXErr = svc.ChangeSecurityGroupSecurity(ctx, false, true, otherAbstractSubnet.Network, \"\")\n\t\t\t\t\t\tif innerXErr != nil {\n\t\t\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to change security group\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tinnerXErr = lansg.BindToHost(ctx, instance, resources.SecurityGroupEnable, resources.MarkSecurityGroupAsSupplemental)\n\t\t\t\t\tif innerXErr != nil {\n\t\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to apply Subnet '%s' internal Security Group '%s' to Host '%s'\", otherAbstractSubnet.Name, lansg.GetName(), req.ResourceName)\n\t\t\t\t\t}\n\n\t\t\t\t\tif !safe {\n\t\t\t\t\t\tinnerXErr = svc.ChangeSecurityGroupSecurity(ctx, true, false, otherAbstractSubnet.Network, \"\")\n\t\t\t\t\t\tif innerXErr != nil {\n\t\t\t\t\t\t\treturn fail.Wrap(innerXErr, \"failed to change security group\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlangID, err := lansg.GetID()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fail.ConvertError(err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// register security group in properties\n\t\t\t\t\titem := &propertiesv1.SecurityGroupBond{\n\t\t\t\t\t\tID: langID,\n\t\t\t\t\t\tName: lansg.GetName(),\n\t\t\t\t\t\tDisabled: false,\n\t\t\t\t\t\tFromSubnet: true,\n\t\t\t\t\t}\n\t\t\t\t\thsgV1.ByID[item.ID] = item\n\t\t\t\t\thsgV1.ByName[item.Name] = item.ID\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn nil\n\t\t})\n\t})\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\n\treturn nil\n}", "func (v *Vps) PopulateSecurityGroups(os *OpenStack) error {\n\tvar err error\n\n\t// Security Groups\n\tresult := servers.GetResult{}\n\turl := os.Compute.ServiceURL(\"servers\", v.ID, \"os-security-groups\")\n\t_, err = os.Compute.Get(url, &result.Body, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar resp struct {\n\t\tSecurityGroups []secgroups.SecurityGroup `mapstructure:\"security_groups\"`\n\t}\n\n\tif err = mapstructure.Decode(result.Body, &resp); err != nil {\n\t\treturn err\n\t}\n\tv.SecurityGroups = resp.SecurityGroups\n\n\treturn nil\n}", "func (s *VpcConfig) SetSecurityGroupIds(v []*string) *VpcConfig {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *UpdateWorkgroupInput) SetSecurityGroupIds(v []*string) *UpdateWorkgroupInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (s *Workgroup) SetSecurityGroupIds(v []*string) *Workgroup {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (o EnvironmentNetworkConfigurationOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v EnvironmentNetworkConfiguration) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "func (s *CreateWorkgroupInput) SetSecurityGroupIds(v []*string) *CreateWorkgroupInput {\n\ts.SecurityGroupIds = v\n\treturn s\n}", "func (c *Client) DisassociateSecurityGroups(request *DisassociateSecurityGroupsRequest) (response *DisassociateSecurityGroupsResponse, err error) {\n return c.DisassociateSecurityGroupsWithContext(context.Background(), request)\n}", "func (o InstanceOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "func (o *SecurityGroup) SetSecurityGroupId(v string) {\n\to.SecurityGroupId = &v\n}", "func (r *LaunchConfiguration) SecurityGroups() pulumi.ArrayOutput {\n\treturn (pulumi.ArrayOutput)(r.s.State[\"securityGroups\"])\n}", "func (s *EndpointAccess) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *EndpointAccess {\n\ts.VpcSecurityGroups = v\n\treturn s\n}", "func (o *CreateLoadBalancerRequest) GetSecurityGroups() []string {\n\tif o == nil || o.SecurityGroups == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroups\n}", "func (o TopicRuleDestinationVpcConfigurationPtrOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *TopicRuleDestinationVpcConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroups\n\t}).(pulumi.StringArrayOutput)\n}", "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}", "func (o ClusterOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "func (instance *Host) BindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup, enable resources.SecurityGroupActivation) (ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn fail.InvalidInstanceError()\n\t}\n\tif ctx == nil {\n\t\treturn fail.InvalidParameterCannotBeNilError(\"ctx\")\n\t}\n\tif sgInstance == nil {\n\t\treturn fail.InvalidParameterCannotBeNilError(\"sgInstance\")\n\t}\n\n\t// instance.Lock()\n\t// defer instance.Unlock()\n\n\txerr := instance.Alter(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Alter(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tsgID, err := sgInstance.GetID()\n\t\t\tif err != nil {\n\t\t\t\treturn fail.ConvertError(err)\n\t\t\t}\n\n\t\t\t// If the Security Group is already bound to the Host with the exact same state, considered as a success\n\t\t\titem, ok := hsgV1.ByID[sgID]\n\t\t\tif ok && item.Disabled == !bool(enable) {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tif !ok { // Not found, update bind metadata of Host\n\t\t\t\titem = &propertiesv1.SecurityGroupBond{\n\t\t\t\t\tID: sgID,\n\t\t\t\t\tName: sgInstance.GetName(),\n\t\t\t\t}\n\t\t\t\thsgV1.ByID[sgID] = item\n\t\t\t\thsgV1.ByName[item.Name] = item.ID\n\t\t\t}\n\t\t\titem.Disabled = bool(!enable)\n\n\t\t\t// If enabled, apply it\n\t\t\tsgInstanceImpl, ok := sgInstance.(*SecurityGroup)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"failed to cast sgInstance to '*SecurityGroup\")\n\t\t\t}\n\n\t\t\tinnerXErr := sgInstanceImpl.unsafeBindToHost(ctx, instance, enable, resources.MarkSecurityGroupAsSupplemental)\n\t\t\tif innerXErr != nil {\n\t\t\t\tswitch innerXErr.(type) {\n\t\t\t\tcase *fail.ErrDuplicate:\n\t\t\t\t\t// already bound, consider as a success\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\treturn innerXErr\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t})\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\n\treturn nil\n}", "func (o GetVpcEndpointsEndpointOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetVpcEndpointsEndpoint) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "func (c *Canary) DetachSecurityGroup(nis []*ec2.InstanceNetworkInterface, region schemas.RegionConfig, excludeSg string) error {\n\tclient, err := selectClientFromList(c.AWSClients, region.Region)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, ni := range nis {\n\t\tvar sgs []*string\n\t\tfor _, group := range ni.Groups {\n\t\t\tif *group.GroupId != excludeSg {\n\t\t\t\tsgs = append(sgs, group.GroupId)\n\t\t\t}\n\t\t}\n\t\tif len(sgs) > 0 {\n\t\t\terr = client.EC2Service.ModifyNetworkInterfaces(ni.NetworkInterfaceId, sgs)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tc.Logger.Debugf(\"Remove security group from eni: %s\", *ni.NetworkInterfaceId)\n\t\t}\n\t}\n\n\treturn nil\n}", "func (t *TokenGroupsT) SetGroupsSlice(s []SidAndAttributes) {\n\ts1 := []SidAndAttributes{}\n\thdr := (*reflect.SliceHeader)(unsafe.Pointer(&s1))\n\thdr.Data = uintptr(unsafe.Pointer(&t.Groups[0]))\n\thdr.Len = len(s)\n\thdr.Cap = len(s)\n\tcopy(s1, s)\n}", "func (o OceanOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Ocean) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "func (o *CloudAwsVirtualMachineAllOf) HasSecurityGroups() bool {\n\tif o != nil && o.SecurityGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (client *AwsClientWrapper) GetSecurityGroups(machine *clusterv1alpha1.Machine) ([]string, error) {\n\tinstance, err := getRunningInstance(machine, client.client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar groups []string\n\tfor _, groupIdentifier := range instance.SecurityGroups {\n\t\tif *groupIdentifier.GroupName != \"\" {\n\t\t\tgroups = append(groups, *groupIdentifier.GroupName)\n\t\t}\n\t}\n\treturn groups, nil\n}", "func (stg *securityTestGroup) getSecurityGroups(agent string) ([]security.NetworkSecurityPolicy, error) {\n\tvar sgplist []security.NetworkSecurityPolicy\n\tstatus, err := stg.authAgentClient.Req(\"GET\", \"https://\"+agent+\":\"+globals.AgentProxyPort+\"/api/sgs/\", nil, &sgplist)\n\tif err != nil || status != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Error getting SG Policies list: %v\", err)\n\t}\n\treturn sgplist, nil\n}", "func (c *Client) ListSecurityGroups(ctx context.Context, zone string) ([]*SecurityGroup, error) {\n\tlist := make([]*SecurityGroup, 0)\n\n\tresp, err := c.ListSecurityGroupsWithResponse(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.JSON200.SecurityGroups != nil {\n\t\tfor i := range *resp.JSON200.SecurityGroups {\n\t\t\tsecurityGroup := securityGroupFromAPI(&(*resp.JSON200.SecurityGroups)[i])\n\t\t\tsecurityGroup.c = c\n\t\t\tsecurityGroup.zone = zone\n\n\t\t\tlist = append(list, securityGroup)\n\t\t}\n\t}\n\n\treturn list, nil\n}", "func dataSourceSecurityGroupAttributes(d *schema.ResourceData, data map[string]interface{}) error {\n security_group_id := data[\"id\"].(string)\n log.Printf(\"[DEBUG] Retrieved twcc_security_group: %s\", security_group_id)\n\n d.SetId(security_group_id)\n d.Set(\"name\", data[\"name\"])\n security_group_rules := flattenSecurityGroupRulesInfo(data[\"security_group_rules\"].([]interface{}))\n d.Set(\"security_group_rules\", security_group_rules)\n\n return nil\n}", "func (m *Group) SetSecurityEnabled(value *bool)() {\n m.securityEnabled = value\n}", "func (swagger *MgwSwagger) SetSecurity(security []map[string][]string) {\n\tswagger.security = security\n}", "func (o *FiltersVmGroup) GetSecurityGroupIds() []string {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroupIds\n}", "func (a *AmazonConnectionsApiService) BrowseCloudSecurityGroups(ctx _context.Context, amazonConnectionId string) ApiBrowseCloudSecurityGroupsRequest {\n\treturn ApiBrowseCloudSecurityGroupsRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tamazonConnectionId: amazonConnectionId,\n\t}\n}", "func (o EcsLaunchTemplateOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *EcsLaunchTemplate) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "func (o *FiltersSecurityGroup) GetSecurityGroupIds() []string {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroupIds\n}", "func (o GetLoadBalancersBalancerOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetLoadBalancersBalancer) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "func (client *ClientImpl) SetAccessControlLists(ctx context.Context, args SetAccessControlListsArgs) error {\n\tif args.AccessControlLists == nil {\n\t\treturn &azuredevops.ArgumentNilError{ArgumentName: \"args.AccessControlLists\"}\n\t}\n\trouteValues := make(map[string]string)\n\tif args.SecurityNamespaceId == nil {\n\t\treturn &azuredevops.ArgumentNilError{ArgumentName: \"args.SecurityNamespaceId\"}\n\t}\n\trouteValues[\"securityNamespaceId\"] = (*args.SecurityNamespaceId).String()\n\n\tbody, marshalErr := json.Marshal(*args.AccessControlLists)\n\tif marshalErr != nil {\n\t\treturn marshalErr\n\t}\n\tlocationId, _ := uuid.Parse(\"18a2ad18-7571-46ae-bec7-0c7da1495885\")\n\t_, err := client.Client.Send(ctx, http.MethodPost, locationId, \"7.1-preview.1\", routeValues, nil, bytes.NewReader(body), \"application/json\", \"application/json\", nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (instance *Host) ListSecurityGroups(ctx context.Context, state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\n\t// instance.RLock()\n\t// defer instance.RUnlock()\n\n\txerr := instance.Inspect(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Inspect(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tlist = FilterBondsByKind(hsgV1.ByID, state)\n\t\t\treturn nil\n\t\t})\n\t})\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\treturn list, nil\n}", "func (db *DB) SetSecurity(ctx context.Context, security *Security) error {\n\tsec := &driver.Security{\n\t\tAdmins: driver.Members(security.Admins),\n\t\tMembers: driver.Members(security.Members),\n\t}\n\treturn db.driverDB.SetSecurity(ctx, sec)\n}", "func (m *MockClient) DescribeSecurityGroups(arg0 *ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DescribeSecurityGroups\", arg0)\n\tret0, _ := ret[0].(*ec2.DescribeSecurityGroupsOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (db *Database) SetSecurity(o SecurityObject) error {\n\theaders := map[string]string{\"Content-Type\": \"application/json\"}\n\tpayload, err := json.Marshal(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := db.conn.request(\"PUT\", queryURL(db.Name, \"_security\"), headers, bytes.NewReader(payload), db.auth, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar result map[string]bool\n\tif err := parseBody(resp, &result); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (o *SecurityGroup) SetSecurityGroupName(v string) {\n\to.SecurityGroupName = &v\n}", "func (o *VirtualMachineToAlternativeRestoreOptions) SetNetworkSecurityGroupId(v string) {\n\to.NetworkSecurityGroupId = v\n}", "func (m *ExternalConnection) SetGroups(value []ExternalGroupable)() {\n m.groups = value\n}", "func (r *LaunchConfiguration) VpcClassicLinkSecurityGroups() pulumi.ArrayOutput {\n\treturn (pulumi.ArrayOutput)(r.s.State[\"vpcClassicLinkSecurityGroups\"])\n}", "func ExampleDeviceSecurityGroupsClient_CreateOrUpdate() {\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 := armsecurity.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewDeviceSecurityGroupsClient().CreateOrUpdate(ctx, \"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub\", \"samplesecuritygroup\", armsecurity.DeviceSecurityGroup{\n\t\tProperties: &armsecurity.DeviceSecurityGroupProperties{\n\t\t\tTimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{\n\t\t\t\t&armsecurity.ActiveConnectionsNotInAllowedRange{\n\t\t\t\t\tIsEnabled: to.Ptr(true),\n\t\t\t\t\tRuleType: to.Ptr(\"ActiveConnectionsNotInAllowedRange\"),\n\t\t\t\t\tMaxThreshold: to.Ptr[int32](30),\n\t\t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t\t\t\t\tTimeWindowSize: to.Ptr(\"PT05M\"),\n\t\t\t\t}},\n\t\t},\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.DeviceSecurityGroup = armsecurity.DeviceSecurityGroup{\n\t// \tName: to.Ptr(\"samplesecuritygroup\"),\n\t// \tType: to.Ptr(\"Microsoft.Security/deviceSecurityGroups\"),\n\t// \tID: to.Ptr(\"/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup\"),\n\t// \tProperties: &armsecurity.DeviceSecurityGroupProperties{\n\t// \t\tAllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{\n\t// \t\t\t&armsecurity.ConnectionToIPNotAllowed{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when an outbound connection is created between your device and an ip that isn't allowed\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Outbound connection to an ip that isn't allowed\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"ConnectionToIpNotAllowed\"),\n\t// \t\t\t\tAllowlistValues: []*string{\n\t// \t\t\t\t},\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.LocalUserNotAllowed{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when a local user that isn't allowed logins to the device\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Login by a local user that isn't allowed\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"LocalUserNotAllowed\"),\n\t// \t\t\t\tAllowlistValues: []*string{\n\t// \t\t\t\t},\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.ProcessNotAllowed{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when a process that isn't allowed is executed\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Execution of a process that isn't allowed\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"ProcessNotAllowed\"),\n\t// \t\t\t\tAllowlistValues: []*string{\n\t// \t\t\t\t},\n\t// \t\t}},\n\t// \t\tDenylistRules: []*armsecurity.DenylistCustomAlertRule{\n\t// \t\t},\n\t// \t\tThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{\n\t// \t\t},\n\t// \t\tTimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{\n\t// \t\t\t&armsecurity.ActiveConnectionsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of active connections of a device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of active connections is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(true),\n\t// \t\t\t\tRuleType: to.Ptr(\"ActiveConnectionsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](30),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT05M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.AmqpC2DMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of cloud to device messages (AMQP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"AmqpC2DMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.MqttC2DMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of cloud to device messages (MQTT protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"MqttC2DMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.HTTPC2DMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of cloud to device messages (HTTP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"HttpC2DMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of rejected cloud to device messages (AMQP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"AmqpC2DRejectedMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of rejected cloud to device messages (MQTT protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"MqttC2DRejectedMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of rejected cloud to device messages (HTTP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"HttpC2DRejectedMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.AmqpD2CMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device to cloud messages (AMQP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"AmqpD2CMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.MqttD2CMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device to cloud messages (MQTT protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"MqttD2CMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.HTTPD2CMessagesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device to cloud messages (HTTP protocol) is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"HttpD2CMessagesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.DirectMethodInvokesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of direct method invokes in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of direct method invokes is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"DirectMethodInvokesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.FailedLocalLoginsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of failed local logins on the device in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of failed local logins is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"FailedLocalLoginsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.FileUploadsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of file uploads is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"FileUploadsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.QueuePurgesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of device queue purges in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of device queue purges is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"QueuePurgesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.TwinUpdatesNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of twin updates is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"TwinUpdatesNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t\t},\n\t// \t\t\t&armsecurity.UnauthorizedOperationsNotInAllowedRange{\n\t// \t\t\t\tDescription: to.Ptr(\"Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"Number of unauthorized operations is not in allowed range\"),\n\t// \t\t\t\tIsEnabled: to.Ptr(false),\n\t// \t\t\t\tRuleType: to.Ptr(\"UnauthorizedOperationsNotInAllowedRange\"),\n\t// \t\t\t\tMaxThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tMinThreshold: to.Ptr[int32](0),\n\t// \t\t\t\tTimeWindowSize: to.Ptr(\"PT15M\"),\n\t// \t\t}},\n\t// \t},\n\t// }\n}", "func (s *ServerLaunchConfiguration) SetSecurityGroup(v string) *ServerLaunchConfiguration {\n\ts.SecurityGroup = &v\n\treturn s\n}", "func (s *Service) CreateOrUpdateNetworkSecurityGroup(resourceGroupName string, networkSecurityGroupName string, location string) (*armada.SecurityGroupsCreateOrUpdateFuture, error) {\n\t//JEB if networkSecurityGroupName == \"\" {\n\t//JEB networkSecurityGroupName = SecurityGroupDefaultName\n\t//JEB }\n\t//JEB sshInbound := armada.SecurityRule{\n\t//JEB Name: to.StringPtr(\"ClusterAPISSH\"),\n\t//JEB SecurityRulePropertiesFormat: &armada.SecurityRulePropertiesFormat{\n\t//JEB Protocol: armada.SecurityRuleProtocolTCP,\n\t//JEB SourcePortRange: to.StringPtr(\"*\"),\n\t//JEB DestinationPortRange: to.StringPtr(\"22\"),\n\t//JEB SourceAddressPrefix: to.StringPtr(\"*\"),\n\t//JEB DestinationAddressPrefix: to.StringPtr(\"*\"),\n\t//JEB Priority: to.Int32Ptr(1000),\n\t//JEB Direction: armada.SecurityRuleDirectionInbound,\n\t//JEB Access: armada.SecurityRuleAccessAllow,\n\t//JEB },\n\t//JEB }\n\t//JEB\n\t//JEB kubernetesInbound := armada.SecurityRule{\n\t//JEB Name: to.StringPtr(\"KubernetesAPI\"),\n\t//JEB SecurityRulePropertiesFormat: &armada.SecurityRulePropertiesFormat{\n\t//JEB Protocol: armada.SecurityRuleProtocolTCP,\n\t//JEB SourcePortRange: to.StringPtr(\"*\"),\n\t//JEB DestinationPortRange: to.StringPtr(\"6443\"),\n\t//JEB SourceAddressPrefix: to.StringPtr(\"*\"),\n\t//JEB DestinationAddressPrefix: to.StringPtr(\"*\"),\n\t//JEB Priority: to.Int32Ptr(1001),\n\t//JEB Direction: armada.SecurityRuleDirectionInbound,\n\t//JEB Access: armada.SecurityRuleAccessAllow,\n\t//JEB },\n\t//JEB }\n\t//JEB\n\t//JEB securityGroupProperties := armada.SecurityGroupPropertiesFormat{\n\t//JEB SecurityRules: &[]armada.SecurityRule{sshInbound, kubernetesInbound},\n\t//JEB }\n\t//JEB securityGroup := armada.SecurityGroup{\n\t//JEB Location: to.StringPtr(location),\n\t//JEB SecurityGroupPropertiesFormat: &securityGroupProperties,\n\t//JEB }\n\t//JEB sgFuture, err := s.scope.AirshipClients.SecurityGroups.CreateOrUpdate(s.scope.Context, resourceGroupName, networkSecurityGroupName, securityGroup)\n\t//JEB if err != nil {\n\t//JEB return nil, err\n\t//JEB }\n\t//JEB return &sgFuture, nil\n\treturn &armada.SecurityGroupsCreateOrUpdateFuture{}, nil\n}", "func (m *Group) SetSecurityIdentifier(value *string)() {\n m.securityIdentifier = value\n}", "func (s UserSet) SetGroups(value m.GroupSet) {\n\ts.RecordCollection.Set(models.NewFieldName(\"Groups\", \"group_ids\"), value)\n}", "func (o *FiltersSecurityGroup) SetSecurityGroupNames(v []string) {\n\to.SecurityGroupNames = &v\n}", "func (instance *Host) EnableSecurityGroup(ctx context.Context, sg resources.SecurityGroup) (ferr fail.Error) {\n\tdefer fail.OnPanic(&ferr)\n\n\tif valid.IsNil(instance) {\n\t\treturn fail.InvalidInstanceError()\n\t}\n\tif ctx == nil {\n\t\treturn fail.InvalidParameterError(\"ctx\", \"cannot be nil\")\n\t}\n\tif sg == nil {\n\t\treturn fail.InvalidParameterError(\"sg\", \"cannot be null value of 'SecurityGroup'\")\n\t}\n\n\thid, err := instance.GetID()\n\tif err != nil {\n\t\treturn fail.ConvertError(err)\n\t}\n\n\tsgName := sg.GetName()\n\n\t// instance.Lock()\n\t// defer instance.Unlock()\n\n\tsvc := instance.Service()\n\txerr := instance.Alter(ctx, func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Inspect(hostproperty.SecurityGroupsV1, func(clonable data.Clonable) fail.Error {\n\t\t\thsgV1, ok := clonable.(*propertiesv1.HostSecurityGroups)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.HostSecurityGroups' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tvar asg *abstract.SecurityGroup\n\t\t\txerr := sg.Inspect(ctx, func(clonable data.Clonable, _ *serialize.JSONProperties) fail.Error {\n\t\t\t\tvar ok bool\n\t\t\t\tif asg, ok = clonable.(*abstract.SecurityGroup); !ok {\n\t\t\t\t\treturn fail.InconsistentError(\"'*abstract.SecurityGroup' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\tif xerr != nil {\n\t\t\t\treturn xerr\n\t\t\t}\n\n\t\t\t// First check if the security group is not already registered for the Host with the exact same state\n\t\t\tvar found bool\n\t\t\tfor k := range hsgV1.ByID {\n\t\t\t\tif k == asg.ID {\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\treturn fail.NotFoundError(\"security group '%s' is not bound to Host '%s'\", sgName, hid)\n\t\t\t}\n\n\t\t\t{\n\t\t\t\t// Bind the security group on provider side; if already bound (*fail.ErrDuplicate), considered as a success\n\t\t\t\txerr = svc.BindSecurityGroupToHost(ctx, asg, hid)\n\t\t\t\txerr = debug.InjectPlannedFail(xerr)\n\t\t\t\tif xerr != nil {\n\t\t\t\t\tswitch xerr.(type) {\n\t\t\t\t\tcase *fail.ErrDuplicate:\n\t\t\t\t\t\tdebug.IgnoreError2(ctx, xerr)\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn xerr\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// found and updated, update metadata\n\t\t\thsgV1.ByID[asg.ID].Disabled = false\n\t\t\treturn nil\n\t\t})\n\t})\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\n\treturn nil\n}", "func (in *AWSGroup) DeepEqual(other *AWSGroup) bool {\n\tif other == nil {\n\t\treturn false\n\t}\n\n\tif ((in.Labels != nil) && (other.Labels != nil)) || ((in.Labels == nil) != (other.Labels == nil)) {\n\t\tin, other := &in.Labels, &other.Labels\n\t\tif other == nil {\n\t\t\treturn false\n\t\t}\n\n\t\tif len(*in) != len(*other) {\n\t\t\treturn false\n\t\t} else {\n\t\t\tfor key, inValue := range *in {\n\t\t\t\tif otherValue, present := (*other)[key]; !present {\n\t\t\t\t\treturn false\n\t\t\t\t} else {\n\t\t\t\t\tif inValue != otherValue {\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\n\tif ((in.SecurityGroupsIds != nil) && (other.SecurityGroupsIds != nil)) || ((in.SecurityGroupsIds == nil) != (other.SecurityGroupsIds == nil)) {\n\t\tin, other := &in.SecurityGroupsIds, &other.SecurityGroupsIds\n\t\tif other == nil {\n\t\t\treturn false\n\t\t}\n\n\t\tif len(*in) != len(*other) {\n\t\t\treturn false\n\t\t} else {\n\t\t\tfor i, inElement := range *in {\n\t\t\t\tif inElement != (*other)[i] {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ((in.SecurityGroupsNames != nil) && (other.SecurityGroupsNames != nil)) || ((in.SecurityGroupsNames == nil) != (other.SecurityGroupsNames == nil)) {\n\t\tin, other := &in.SecurityGroupsNames, &other.SecurityGroupsNames\n\t\tif other == nil {\n\t\t\treturn false\n\t\t}\n\n\t\tif len(*in) != len(*other) {\n\t\t\treturn false\n\t\t} else {\n\t\t\tfor i, inElement := range *in {\n\t\t\t\tif inElement != (*other)[i] {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif in.Region != other.Region {\n\t\treturn false\n\t}\n\n\treturn true\n}", "func (r *ReconcileSecurityGroup) Reconcile(request reconcile.Request) (reconcile.Result, error) {\n\t// Fetch the SecurityGroup instance\n\tinstance := &openstackv1beta1.SecurityGroup{}\n\terr := r.Get(context.TODO(), request.NamespacedName, instance)\n\tif err != nil {\n\t\tif errors_.IsNotFound(err) {\n\t\t\tlog.Info(\"Debug: instance not found\", \"SecurityGroup\", instance.Name)\n\n\t\t\treturn reconcile.Result{}, nil\n\t\t}\n\t\t// Error reading the object - requeue the request.\n\t\treturn reconcile.Result{}, err\n\t}\n\n\tlog.Info(\"Info: Start reconcile\", \"sg\", instance.Name)\n\tif instance.ObjectMeta.DeletionTimestamp.IsZero() {\n\t\tlog.Info(\"Debug: deletion timestamp is zero\")\n\t\tif err := r.setFinalizer(instance); err != nil {\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t} else {\n\t\treturn r.runFinalizer(instance)\n\t}\n\n\ttenant, err := r.osClient.GetTenantByName(os.Getenv(\"OS_TENANT_NAME\"))\n\tif err != nil {\n\t\treturn reconcile.Result{}, err\n\t}\n\n\tvar sg *groups.SecGroup\n\n\t// Check if the SecurityGroup already exists\n\tsg, err = r.osClient.GetSecurityGroup(instance.Status.ID)\n\tif err != nil {\n\t\tswitch err.(type) {\n\t\tcase gophercloud.ErrDefault404:\n\t\t\trand.Seed(time.Now().Unix())\n\n\t\t\tlog.Info(\"Creating SG\", \"name\", instance.Spec.Name)\n\t\t\tname := fmt.Sprintf(\"%s-%s\", instance.Spec.Name, r.osClient.RandomString())\n\n\t\t\tsg, err = r.osClient.CreateSecurityGroup(name, \"\", tenant.ID)\n\t\t\tif err != nil {\n\t\t\t\tlog.Info(\"Error\", \"msg\", err.Error())\n\t\t\t}\n\t\t\tinstance.Status.ID = sg.ID\n\t\t\tinstance.Status.Name = sg.Name\n\t\t\tlog.Info(\"Success creating SG\", \"name\", instance.Spec.Name, \"id\", sg.ID)\n\t\tdefault:\n\t\t\tlog.Info(\"Debug: errorrrrrr\")\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t}\n\n\t// Resource側のルールがない場合、SGにルールを追加\n\tfor _, rule := range instance.Spec.Rules {\n\t\texists := false\n\t\tfor _, existsRule := range sg.Rules {\n\t\t\tif rule.RemoteIpPrefix == existsRule.RemoteIPPrefix && rule.PortRangeMax == existsRule.PortRangeMax && rule.PortRangeMin == existsRule.PortRangeMin {\n\t\t\t\texists = true\n\t\t\t}\n\t\t}\n\n\t\tif !exists {\n\t\t\tr.addRule(sg.ID, rule)\n\t\t\tif err != nil {\n\t\t\t\tlog.Info(\"Error\", \"addRule\", err.Error())\n\t\t\t\treturn reconcile.Result{}, err\n\t\t\t}\n\t\t}\n\t}\n\n\t// SGのルールがResource側にない場合、ルールを削除\n\tfor _, existRule := range sg.Rules {\n\t\tdelete := true\n\t\tfor _, rule := range instance.Spec.Rules {\n\t\t\tif existRule.RemoteIPPrefix == rule.RemoteIpPrefix && existRule.PortRangeMax == rule.PortRangeMax && existRule.PortRangeMin == rule.PortRangeMin {\n\t\t\t\tdelete = false\n\t\t\t}\n\t\t}\n\t\tif delete {\n\t\t\tlog.Info(\"Deleting SG Rule\", \"cidr\", existRule.RemoteIPPrefix, \"port\", fmt.Sprintf(\"%d-%d\", existRule.PortRangeMin, existRule.PortRangeMax))\n\t\t\terr = r.osClient.DeleteSecurityGroupRule(existRule.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn reconcile.Result{}, err\n\t\t\t}\n\t\t\tlog.Info(\"Success to delete SG Rule\", \"cidr\", existRule.RemoteIPPrefix, \"port\", fmt.Sprintf(\"%d-%d\", existRule.PortRangeMin, existRule.PortRangeMax))\n\t\t}\n\t}\n\n\tvar nodes v1.NodeList\n\tlistOpts := client.ListOptions{\n\t\tRaw: &metav1.ListOptions{LabelSelector: labelSelector(instance)},\n\t}\n\terr = r.List(context.Background(), &listOpts, &nodes)\n\tif err != nil {\n\t\tlog.Info(\"Error\", \"Failed to NodeList\", err.Error())\n\t\treturn reconcile.Result{}, err\n\t}\n\n\texistsNodeIDs := []string{}\n\tfor _, node := range nodes.Items {\n\t\texistsNodeIDs = append(existsNodeIDs, strings.ToLower(node.Status.NodeInfo.SystemUUID))\n\t}\n\n\tfor _, id := range instance.Status.Nodes {\n\t\tif !containsString(existsNodeIDs, id) {\n\t\t\tlog.Info(\"Info\", \"Dettach SG from Server\", strings.ToLower(id))\n\t\t\tr.osClient.DettachSG(strings.ToLower(id), sg.Name)\n\t\t\tinstance.Status.Nodes = removeString(instance.Status.Nodes, id)\n\t\t}\n\t}\n\n\tfor _, node := range nodes.Items {\n\t\tid := node.Status.NodeInfo.SystemUUID\n\t\thasSg, err := r.osClient.ServerHasSG(strings.ToLower(id), sg.Name)\n\t\tif err != nil {\n\t\t\tlog.Info(\"Error\", \"Failed to ServerHasSG\", err.Error())\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\n\t\tif !hasSg {\n\t\t\tlog.Info(\"Info\", \"Attach SG to Server\", strings.ToLower(id))\n\t\t\tif err = r.osClient.AttachSG(strings.ToLower(id), sg.Name); err != nil {\n\t\t\t\tlog.Info(\"Debug\", \"failed to attach sg\", err.Error())\n\t\t\t\treturn reconcile.Result{}, err\n\t\t\t}\n\t\t\tinstance.Status.Nodes = append(instance.Status.Nodes, strings.ToLower(id))\n\t\t}\n\t}\n\n\tif err := r.Status().Update(context.Background(), instance); err != nil {\n\t\tlog.Info(\"Debug\", \"failed to update sg\", err.Error())\n\t\treturn reconcile.Result{}, err\n\t}\n\n\tlog.Info(\"Info: Success reconcile\", \"sg\", instance.Name)\n\treturn reconcile.Result{RequeueAfter: 60 * time.Second}, nil\n}", "func (s *SubnetListener) ListSecurityGroups(inctx context.Context, in *protocol.SecurityGroupSubnetBindRequest) (_ *protocol.SecurityGroupBondsResponse, err error) {\n\tdefer fail.OnExitConvertToGRPCStatus(inctx, &err)\n\tdefer fail.OnExitLogError(inctx, &err)\n\tdefer fail.OnExitWrapError(inctx, &err, \"cannot list Security Groups bound to Subnet\")\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\tnetworkRef, _ := srvutils.GetReference(in.GetNetwork())\n\tsubnetRef, _ := srvutils.GetReference(in.GetSubnet())\n\tif subnetRef == \"\" {\n\t\treturn nil, fail.InvalidRequestError(\"neither name nor id given as reference for Subnet\")\n\t}\n\n\tjob, xerr := PrepareJob(inctx, in.GetNetwork().GetTenantId(), fmt.Sprintf(\"network/%s/subnet/%s/securitygroups/list\", networkRef, subnetRef))\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\tdefer job.Close()\n\n\tstate := securitygroupstate.Enum(in.GetState())\n\n\thandler := handlers.NewSubnetHandler(job)\n\tbonds, xerr := handler.ListSecurityGroups(networkRef, subnetRef, state)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tresp := converters.SecurityGroupBondsFromPropertyToProtocol(bonds, \"subnets\")\n\treturn resp, nil\n}", "func (_BaseAccessControlGroup *BaseAccessControlGroupTransactor) SetAccessGroupRights(opts *bind.TransactOpts, group common.Address, access_type uint8, access uint8) (*types.Transaction, error) {\n\treturn _BaseAccessControlGroup.contract.Transact(opts, \"setAccessGroupRights\", group, access_type, access)\n}", "func (mr *MockSecurityGroupServiceIfaceMockRecorder) ListSecurityGroups(p interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListSecurityGroups\", reflect.TypeOf((*MockSecurityGroupServiceIface)(nil).ListSecurityGroups), p)\n}", "func (o EciScalingConfigurationOutput) SecurityGroupId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EciScalingConfiguration) pulumi.StringPtrOutput { return v.SecurityGroupId }).(pulumi.StringPtrOutput)\n}", "func (mtr *Msmsintprp3Metrics) SetSecurity(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"Security\"))\n\treturn nil\n}", "func (mtr *Msmsintprp5Metrics) SetSecurity(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"Security\"))\n\treturn nil\n}", "func (_BaseAccessControlGroup *BaseAccessControlGroupTransactor) SetAccessRights(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _BaseAccessControlGroup.contract.Transact(opts, \"setAccessRights\")\n}", "func (m *MockSecurityGroupServiceIface) ListSecurityGroups(p *ListSecurityGroupsParams) (*ListSecurityGroupsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListSecurityGroups\", p)\n\tret0, _ := ret[0].(*ListSecurityGroupsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (mtr *Msmsintprp4Metrics) SetSecurity(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"Security\"))\n\treturn nil\n}", "func (m *User) SetSchools(value []string)() {\n m.schools = value\n}", "func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroupsOk() ([]CloudAwsSecurityGroupRelationship, bool) {\n\tif o == nil || o.SecurityGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroups, true\n}", "func (provider *ResourceProvider) SecurityGroup(id string) (*reachAWS.SecurityGroup, error) {\n\tinput := &ec2.DescribeSecurityGroupsInput{\n\t\tGroupIds: []*string{\n\t\t\taws.String(id),\n\t\t},\n\t}\n\tresult, err := provider.ec2.DescribeSecurityGroups(input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = ensureSingleResult(len(result.SecurityGroups), \"security group\", id); err != nil {\n\t\treturn nil, err\n\t}\n\n\tsecurityGroup := newSecurityGroupFromAPI(result.SecurityGroups[0])\n\treturn &securityGroup, nil\n}", "func (s *applicationSecurityGroupLister) ApplicationSecurityGroups(namespace string) ApplicationSecurityGroupNamespaceLister {\n\treturn applicationSecurityGroupNamespaceLister{indexer: s.indexer, namespace: namespace}\n}", "func (o *FiltersSecurityGroup) SetOutboundRuleSecurityGroupIds(v []string) {\n\to.OutboundRuleSecurityGroupIds = &v\n}", "func (mtr *Msmsintprp2Metrics) SetSecurity(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"Security\"))\n\treturn nil\n}" ]
[ "0.7153404", "0.70500696", "0.70451057", "0.69159067", "0.6855702", "0.6766927", "0.66547847", "0.6568775", "0.63600767", "0.61523193", "0.5877236", "0.5828111", "0.5696654", "0.5696654", "0.56905776", "0.56866765", "0.56348604", "0.5631561", "0.56126946", "0.5588025", "0.5559615", "0.5515045", "0.54936177", "0.5488267", "0.5458155", "0.5458155", "0.5454099", "0.54470545", "0.54399484", "0.5436244", "0.5397594", "0.5390862", "0.5385071", "0.53754646", "0.53747094", "0.53579515", "0.53535116", "0.5297217", "0.52418256", "0.5237798", "0.5187828", "0.5186428", "0.5179841", "0.517448", "0.5169926", "0.5161695", "0.5143444", "0.5056319", "0.50496304", "0.49520352", "0.490921", "0.48905897", "0.4821615", "0.48070645", "0.4744364", "0.47236216", "0.47232783", "0.47178277", "0.47041795", "0.46910548", "0.4678651", "0.46708453", "0.46627578", "0.46595436", "0.46501455", "0.46451193", "0.46433812", "0.4612558", "0.4602799", "0.46011275", "0.45947072", "0.45836726", "0.45741773", "0.45284802", "0.45231774", "0.45121548", "0.44870815", "0.44789192", "0.44778705", "0.44778433", "0.44749138", "0.44746435", "0.4471681", "0.44604328", "0.4449663", "0.4434497", "0.44310668", "0.44211626", "0.44142067", "0.44094518", "0.4404903", "0.43970335", "0.4397017", "0.43900272", "0.43791085", "0.43630636", "0.4361219", "0.43610245", "0.4358146", "0.4339889" ]
0.7528008
0
newConfig initialize a new server config, saves env parameters if found, otherwise use default parameters
newConfig инициализирует новый серверный конфиг, сохраняет параметры окружения, если они найдены, иначе использует параметры по умолчанию
func newConfig(envParams envParams) error { // Initialize server config. srvCfg := newServerConfigV14() // If env is set for a fresh start, save them to config file. if globalIsEnvCreds { srvCfg.SetCredential(envParams.creds) } if globalIsEnvBrowser { srvCfg.SetBrowser(envParams.browser) } // Create config path. if err := createConfigDir(); err != nil { return err } // hold the mutex lock before a new config is assigned. // Save the new config globally. // unlock the mutex. serverConfigMu.Lock() serverConfig = srvCfg serverConfigMu.Unlock() // Save config into file. return serverConfig.Save() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newConfig() (*rest.Config, error) {\n // try in cluster config first, it should fail quickly on lack of env vars\n cfg, err := inClusterConfig()\n if err != nil {\n cfg, err = clientcmd.BuildConfigFromFlags(\"\", clientcmd.RecommendedHomeFile)\n if err != nil {\n return nil, errors.Wrap(err, \"failed to get InClusterConfig and Config from kube_config\")\n }\n }\n return cfg, nil\n}", "func newServerConfig(fname, id, name, passWord, serverKey string) (err error) {\n\tconfig := Config{\n\t\tid,\n\t\tname,\n\t\t\"server\",\n\t\tpassWord,\n\t\tserverKey,\n\t\tDEFAULT_SERVER_URL,\n\t\tDEFAULT_PROCESS_USER,\n\t\tDEFAULT_PROCESS_LOCK,\n\t\tDEFAULT_PROCESS_LOG,\n\t\tDEFAULT_BASE_DIR,\n\t\tDEFAULT_DATA_DIR,\n\t\tDEFAULT_HTTP_LISTEN,\n\t\tfname,\n\t}\n\n\treturn SaveConfig(config)\n}", "func newConfig(appName string, pathToKeybase string, log Log, ignoreSnooze bool) (*config, error) {\n\tcfg := newDefaultConfig(appName, pathToKeybase, log, ignoreSnooze)\n\terr := cfg.load()\n\treturn &cfg, err\n}", "func newConfig() *Config {\n\treturn &Config{\n\t\tgeneral{\n\t\t\tVerbose: false,\n\t\t},\n\t\tserver{\n\t\t\tType: \"http\",\n\t\t\tHost: \"0.0.0.0\",\n\t\t},\n\t\tmongo{\n\t\t\tHost: \"0.0.0.0:27017\",\n\t\t\tDatabase: \"etlog\",\n\t\t\tCollection: \"logs\",\n\t\t},\n\t}\n}", "func New() *Config {\n\t// Keep only one instance of server config\n\tif serverConfig != nil {\n\t\treturn serverConfig\n\t}\n\n\t// Get the current environment\n\tenvironment := getEnv(\"_APP_ENV\", \"development\")\n\n\t// If not running on stating nor production, fallback to local configs\n\tif environment != \"staging\" && environment != \"production\" {\n\t\tserverConfig = &Config{\n\t\t\tEnvironment: \"development\",\n\t\t\tDelay: 5,\n\t\t\tMonitoringQuantity: 5,\n\t\t}\n\t\treturn serverConfig\n\t}\n\n\t// For prod and staging\n\tserverConfig = &Config{\n\t\tEnvironment: environment,\n\t}\n\n\treturn serverConfig\n}", "func newConfig() *Config {\n\n\tc := &Config{}\n\tvar logLevel, bServers, dServers string\n\n\tflag.StringVar(&c.ControlAddress, \"controlAddress\", \"localhost:4000\",\n\t\t\"Control process IP address, default localhost:4000\")\n\n\tflag.BoolVar(&c.Broadcast, \"broadcast\", true,\n\t\t\"Set to false to squash actual broadcast.\")\n\n\tflag.IntVar(&c.Bclients, \"bClients\", 1,\n\t\t\"The number of broadcast clients; Default 1\")\n\n\tflag.IntVar(&c.Dclients, \"dClients\", 1,\n\t\t\"The number of deliver clients; Default 1\")\n\n\tflag.IntVar(&c.Channels, \"channels\", 1,\n\t\t\"The number of channels; Default 1\")\n\n\tflag.StringVar(&bServers, \"bServers\", \"\",\n\t\t\"A comma-separated list of IP:PORT of broadcast servers to target; Required\")\n\n\tflag.StringVar(&dServers, \"dServers\", \"\",\n\t\t\"A comma-separated list of IP:PORT of deliver servers to target; Defaults to broadcast szervers\")\n\n\tflag.IntVar(&c.Transactions, \"transactions\", 1,\n\t\t\"The number of transactions broadcast to each client's servers; Default 1\")\n\n\tflag.IntVar(&c.Payload, \"payload\", TxHeaderSize,\n\t\t\"Payload size in bytes; Minimum/default is the performance header size (56 bytes)\")\n\n\tflag.IntVar(&c.Burst, \"burst\", 1,\n\t\t\"The number of transactions burst to each server during broadcast; Dafault 1\")\n\n\tflag.DurationVar(&c.Delay, \"delay\", 0,\n\t\t\"The delay between bursts, in the form required by time.ParseDuration(); Default is no delay\")\n\n\tflag.IntVar(&c.Window, \"window\", 100,\n\t\t\"The number of blocks allowed to be delivered without an ACK; Default 100\")\n\n\tflag.IntVar(&c.AckEvery, \"ackEvery\", 70,\n\t\t\"The deliver client will ACK every (this many) blocks; Default 70\")\n\n\tflag.DurationVar(&c.Timeout, \"timeout\", 30*time.Second,\n\t\t\"The initialization timeout, in the form required by time.ParseDuration(); Default 30s\")\n\n\tflag.BoolVar(&c.LatencyAll, \"latencyAll\", false,\n\t\t\"By default, only block latencies are reported. Set -latencyAll=true to report all transaction latencies\")\n\n\tflag.StringVar(&c.LatencyDir, \"latencyDir\", \"\",\n\t\t\"The directory to contain latency files; These files are only created if -latencyDir is specified\")\n\n\tflag.StringVar(&c.LatencyPrefix, \"latencyPrefix\", \"client\",\n\t\t\"Prefix for latency file names\")\n\n\tflag.StringVar(&logLevel, \"logLevel\", \"info\",\n\t\t\"The global logging level; Default 'info'\")\n\n\tflag.StringVar(&c.ControlLogging, \"controlLogging\", \"\",\n\t\t\"Override logging level for the 'control' process\")\n\n\tflag.StringVar(&c.BroadcastLogging, \"broadcastLogging\", \"\",\n\t\t\"Override logging level for the 'broadcast' processes\")\n\n\tflag.StringVar(&c.DeliverLogging, \"deliverLogging\", \"\",\n\t\t\"Override logging level for the 'deliver' processes\")\n\n\tflag.Parse()\n\n\tif c.ControlLogging == \"\" {\n\t\tc.ControlLogging = logLevel\n\t}\n\tif c.BroadcastLogging == \"\" {\n\t\tc.BroadcastLogging = logLevel\n\t}\n\tif c.DeliverLogging == \"\" {\n\t\tc.DeliverLogging = logLevel\n\t}\n\n\tinitLogging(c.ControlLogging)\n\n\trequireUint16(\"bclients\", c.Bclients)\n\trequireUint16(\"dclients\", c.Dclients)\n\trequireUint16(\"channels\", c.Channels)\n\trequireNonEmpty(\"bServers\", bServers)\n\tif dServers == \"\" {\n\t\tdServers = bServers\n\t}\n\trequireUint32(\"transactions\", c.Transactions)\n\trequirePosInt(\"payload\", c.Payload)\n\tif c.Payload < TxHeaderSize {\n\t\tlogger.Infof(\"Payload size will be set to the default (%d bytes)\\n\",\n\t\t\tTxHeaderSize)\n\t\tc.Payload = TxHeaderSize\n\t}\n\trequirePosInt(\"burst\", c.Burst)\n\trequirePosDuration(\"delay\", c.Delay)\n\trequirePosInt(\"window\", c.Window)\n\trequirePosInt(\"ackevery\", c.AckEvery)\n\trequireLE(\"ackevery\", \"window\", c.AckEvery, c.Window)\n\trequirePosDuration(\"timeout\", c.Timeout)\n\n\tc.Bservers = strings.Split(bServers, \",\")\n\tc.NumBservers = len(c.Bservers)\n\n\tc.Dservers = strings.Split(dServers, \",\")\n\tc.NumDservers = len(c.Dservers)\n\n\tlogger.Infof(\"Configuration\")\n\tlogger.Infof(\" Broadcast Servers: %d: %v\", c.NumBservers, c.Bservers)\n\tlogger.Infof(\" Broadcast Clients: %d\", c.Bclients)\n\tlogger.Infof(\" Deliver Servers : %d: %v\", c.NumDservers, c.Dservers)\n\tlogger.Infof(\" Deliver Clients : %d\", c.Dclients)\n\tlogger.Infof(\" Channels : %d\", c.Channels)\n\tlogger.Infof(\" Transactions : %d\", c.Transactions)\n\tlogger.Infof(\" Payload : %d\", c.Payload)\n\tlogger.Infof(\" Burst : %d\", c.Burst)\n\tlogger.Infof(\" Delay : %s\", c.Delay.String())\n\tlogger.Infof(\" Window : %d\", c.Window)\n\tlogger.Infof(\" AckEvery : %d\", c.AckEvery)\n\tlogger.Infof(\" Broadcast? : %v\", c.Broadcast)\n\n\tc.TotalBroadcastClients =\n\t\tuint64(c.NumBservers) * uint64(c.Channels) * uint64(c.Bclients)\n\tc.TxBroadcastPerClient = uint64(c.Transactions)\n\tc.BytesBroadcastPerClient = c.TxBroadcastPerClient * uint64(c.Payload)\n\tc.TotalTxBroadcast = uint64(c.TotalBroadcastClients) * c.TxBroadcastPerClient\n\tc.TotalBytesBroadcast = c.TotalTxBroadcast * uint64(c.Payload)\n\n\tc.TotalDeliverClients =\n\t\tuint64(c.NumDservers) * uint64(c.Channels) * uint64(c.Dclients)\n\tc.TxDeliveredPerClient =\n\t\tuint64(c.NumBservers) * uint64(c.Bclients) * uint64(c.Transactions)\n\tc.BytesDeliveredPerClient = c.TxDeliveredPerClient * uint64(c.Payload)\n\tc.TotalTxDelivered = c.TxDeliveredPerClient * c.TotalDeliverClients\n\tc.TotalBytesDelivered = c.TotalTxDelivered * uint64(c.Payload)\n\n\treturn c\n}", "func newConfig() *Config {\n\t// TODO: use config as default, allow setting some values per-job\n\t// and prevent config changes affecting already-running tasks\n\treturn &Config{\n\t\tPath: DefaultPath,\n\t\tDatastorePrefix: \"MP_\",\n\t\tDefaultQueue: \"\",\n\t\tShards: 8,\n\t\tOversampling: 32,\n\t\tLeaseDuration: time.Duration(30) * time.Second,\n\t\tLeaseTimeout: time.Duration(10)*time.Minute + time.Duration(30)*time.Second,\n\t\tTaskTimeout: time.Duration(10)*time.Minute - time.Duration(30)*time.Second,\n\t\tCursorTimeout: time.Duration(50) * time.Second,\n\t\tRetries: 31,\n\t\tLogVerbose: false,\n\t\tHost: \"\",\n\t}\n}", "func newConfig() *config {\n\treturn &config{\n\t\tAddr: \":80\",\n\t\tCacheSize: 1000,\n\t\tLogLevel: \"info\",\n\t\tRequestTimeout: 3000,\n\t\tTargetAddr: \"https://places.aviasales.ru\",\n\t}\n}", "func NewConfig(newServices []services.ServiceConfig, newGroups []services.ServiceGroupConfig) Config {\n\tlog.Printf(\"Creating new config with %d services and %d groups.\\n\", len(newServices), len(newGroups))\n\n\t// Find Env settings common to all services\n\tvar allEnvSlices [][]string\n\tfor _, s := range newServices {\n\t\tallEnvSlices = append(allEnvSlices, s.Env)\n\t}\n\tenv := stringSliceIntersect(allEnvSlices)\n\n\t// Remove common settings from services\n\tvar svcs []services.ServiceConfig\n\tfor _, s := range newServices {\n\t\ts.Env = stringSliceRemoveCommon(env, s.Env)\n\t\tsvcs = append(svcs, s)\n\t}\n\n\tcfg := Config{\n\t\tEnv: env,\n\t\tServices: svcs,\n\t\tGroups: []GroupDef{},\n\t}\n\n\tcfg.AddGroups(newGroups)\n\n\tlog.Printf(\"Config created: %v\", cfg)\n\n\treturn cfg\n}", "func newConfigServer() *ConfigServer {\n\treturn &ConfigServer{}\n}", "func newConfig() Config {\n\treturn Config{\n\t\tDefaultContainerConfig: newDefaultContainerConfig(),\n\t\tContainersConfig: map[string]ContainerConfig{},\n\t\tExclude: []string{},\n\t}\n}", "func loadConfig(envParams envParams) error {\n\tconfigFile := getConfigFile()\n\tif _, err := os.Stat(configFile); err != nil {\n\t\treturn err\n\t}\n\n\tsrvCfg := &serverConfigV14{}\n\n\tqc, err := quick.New(srvCfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = qc.Load(configFile); err != nil {\n\t\treturn err\n\t}\n\n\t// If env is set override the credentials from config file.\n\tif globalIsEnvCreds {\n\t\tsrvCfg.SetCredential(envParams.creds)\n\t}\n\n\tif globalIsEnvBrowser {\n\t\tsrvCfg.SetBrowser(envParams.browser)\n\t}\n\n\tif strings.ToLower(srvCfg.GetBrowser()) == \"off\" {\n\t\tglobalIsBrowserEnabled = false\n\t}\n\n\t// hold the mutex lock before a new config is assigned.\n\tserverConfigMu.Lock()\n\t// Save the loaded config globally.\n\tserverConfig = srvCfg\n\tserverConfigMu.Unlock()\n\n\tif serverConfig.Version != v14 {\n\t\treturn errors.New(\"Unsupported config version `\" + serverConfig.Version + \"`.\")\n\t}\n\n\treturn nil\n}", "func NewConfig(prefix string) *Config {\n\tc := &Config{Port: \"8000\", MaxRequestPerSec: 1}\n\tif err := envconfig.Process(prefix, c); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn c\n}", "func newConfig(old *Config, vars Vars) *Config {\n\tv := mergeVars(old.Vars, vars)\n\n\treturn &Config{\n\t\tAppID: old.AppID,\n\t\tVars: v,\n\t}\n}", "func newClientConfig(fname, id, name, serverKey, serverUrl string) (err error) {\n\tconfig := Config{\n\t\tid,\n\t\tname,\n\t\t\"client\",\n\t\t\"\",\n\t\tserverKey,\n\t\tserverUrl,\n\t\tDEFAULT_PROCESS_USER,\n\t\tDEFAULT_PROCESS_LOCK,\n\t\tDEFAULT_PROCESS_LOG,\n\t\tDEFAULT_BASE_DIR,\n\t\tDEFAULT_DATA_DIR,\n\t\tDEFAULT_HTTP_LISTEN,\n\t\tfname,\n\t}\n\n\treturn SaveConfig(config)\n}", "func DefaultServiceConfigFromEnv() Server {\n\tconfigOnce.Do(func() {\n\t\tconfig = Server{\n\t\t\tDatabase: Database{\n\t\t\t\tHost: util.GetEnv(\"PGHOST\", \"postgres\"),\n\t\t\t\tPort: util.GetEnvAsInt(\"PGPORT\", 5432),\n\t\t\t\tDatabase: util.GetEnv(\"PGDATABASE\", \"development\"),\n\t\t\t\tUsername: util.GetEnv(\"PGUSER\", \"dbuser\"),\n\t\t\t\tPassword: util.GetEnv(\"PGPASSWORD\", \"\"),\n\t\t\t\tAdditionalParams: map[string]string{\n\t\t\t\t\t\"sslmode\": util.GetEnv(\"PGSSLMODE\", \"disable\"),\n\t\t\t\t},\n\t\t\t\tMaxOpenConns: util.GetEnvAsInt(\"DB_MAX_OPEN_CONNS\", runtime.NumCPU()*2),\n\t\t\t\tMaxIdleConns: util.GetEnvAsInt(\"DB_MAX_IDLE_CONNS\", 1),\n\t\t\t\tConnMaxLifetime: time.Second * time.Duration(util.GetEnvAsInt(\"DB_CONN_MAX_LIFETIME_SEC\", 60)),\n\t\t\t},\n\t\t\tEcho: EchoServer{\n\t\t\t\tDebug: util.GetEnvAsBool(\"SERVER_ECHO_DEBUG\", false),\n\t\t\t\tListenAddress: util.GetEnv(\"SERVER_ECHO_LISTEN_ADDRESS\", \":8080\"),\n\t\t\t\tHideInternalServerErrorDetails: util.GetEnvAsBool(\"SERVER_ECHO_HIDE_INTERNAL_SERVER_ERROR_DETAILS\", true),\n\t\t\t\tBaseURL: util.GetEnv(\"SERVER_ECHO_BASE_URL\", \"http://localhost:8080\"),\n\t\t\t\tEnableCORSMiddleware: util.GetEnvAsBool(\"SERVER_ECHO_ENABLE_CORS_MIDDLEWARE\", true),\n\t\t\t\tEnableLoggerMiddleware: util.GetEnvAsBool(\"SERVER_ECHO_ENABLE_LOGGER_MIDDLEWARE\", true),\n\t\t\t\tEnableRecoverMiddleware: util.GetEnvAsBool(\"SERVER_ECHO_ENABLE_RECOVER_MIDDLEWARE\", true),\n\t\t\t\tEnableRequestIDMiddleware: util.GetEnvAsBool(\"SERVER_ECHO_ENABLE_REQUEST_ID_MIDDLEWARE\", true),\n\t\t\t\tEnableTrailingSlashMiddleware: util.GetEnvAsBool(\"SERVER_ECHO_ENABLE_TRAILING_SLASH_MIDDLEWARE\", true),\n\t\t\t},\n\t\t\tPaths: PathsServer{\n\t\t\t\t// Please ALWAYS work with ABSOLUTE (ABS) paths from ENV_VARS (however you may resolve a project-relative to absolute for the default value)\n\t\t\t\tAPIBaseDirAbs: util.GetEnv(\"SERVER_PATHS_API_BASE_DIR_ABS\", filepath.Join(util.GetProjectRootDir(), \"/api\")), // /app/api (swagger.yml)\n\t\t\t\tMntBaseDirAbs: util.GetEnv(\"SERVER_PATHS_MNT_BASE_DIR_ABS\", filepath.Join(util.GetProjectRootDir(), \"/assets/mnt\")), // /app/assets/mnt (user-generated content)\n\t\t\t},\n\t\t\tAuth: AuthServer{\n\t\t\t\tAccessTokenValidity: time.Second * time.Duration(util.GetEnvAsInt(\"SERVER_AUTH_ACCESS_TOKEN_VALIDITY\", 86400)),\n\t\t\t\tPasswordResetTokenValidity: time.Second * time.Duration(util.GetEnvAsInt(\"SERVER_AUTH_PASSWORD_RESET_TOKEN_VALIDITY\", 900)),\n\t\t\t\tDefaultUserScopes: util.GetEnvAsStringArr(\"SERVER_AUTH_DEFAULT_USER_SCOPES\", []string{\"app\"}),\n\t\t\t\tLastAuthenticatedAtThreshold: time.Second * time.Duration(util.GetEnvAsInt(\"SERVER_AUTH_LAST_AUTHENTICATED_AT_THRESHOLD\", 900)),\n\t\t\t},\n\t\t\tManagement: ManagementServer{\n\t\t\t\tSecret: util.GetMgmtSecret(\"SERVER_MANAGEMENT_SECRET\"),\n\t\t\t},\n\t\t\tMailer: Mailer{\n\t\t\t\tDefaultSender: util.GetEnv(\"SERVER_MAILER_DEFAULT_SENDER\", \"go-starter@example.com\"),\n\t\t\t\tSend: util.GetEnvAsBool(\"SERVER_MAILER_SEND\", true),\n\t\t\t\tWebTemplatesEmailBaseDirAbs: util.GetEnv(\"SERVER_MAILER_WEB_TEMPLATES_EMAIL_BASE_DIR_ABS\", filepath.Join(util.GetProjectRootDir(), \"/web/templates/email\")), // /app/web/templates/email\n\t\t\t\tTransporter: util.GetEnvEnum(\"SERVER_MAILER_TRANSPORTER\", MailerTransporterMock.String(), []string{MailerTransporterSMTP.String(), MailerTransporterMock.String()}),\n\t\t\t},\n\t\t\tSMTP: transport.SMTPMailTransportConfig{\n\t\t\t\tHost: util.GetEnv(\"SERVER_SMTP_HOST\", \"mailhog\"),\n\t\t\t\tPort: util.GetEnvAsInt(\"SERVER_SMTP_PORT\", 1025),\n\t\t\t\tUsername: util.GetEnv(\"SERVER_SMTP_USERNAME\", \"\"),\n\t\t\t\tPassword: util.GetEnv(\"SERVER_SMTP_PASSWORD\", \"\"),\n\t\t\t\tAuthType: transport.SMTPAuthTypeFromString(util.GetEnv(\"SERVER_SMTP_AUTH_TYPE\", transport.SMTPAuthTypeNone.String())),\n\t\t\t\tUseTLS: util.GetEnvAsBool(\"SERVER_SMTP_USE_TLS\", false),\n\t\t\t\tTLSConfig: nil,\n\t\t\t},\n\t\t\tFrontend: FrontendServer{\n\t\t\t\tBaseURL: util.GetEnv(\"SERVER_FRONTEND_BASE_URL\", \"http://localhost:3000\"),\n\t\t\t\tPasswordResetEndpoint: util.GetEnv(\"SERVER_FRONTEND_PASSWORD_RESET_ENDPOINT\", \"/set-new-password\"),\n\t\t\t},\n\t\t\tLogger: LoggerServer{\n\t\t\t\tLevel: util.LogLevelFromString(util.GetEnv(\"SERVER_LOGGER_LEVEL\", zerolog.DebugLevel.String())),\n\t\t\t\tRequestLevel: util.LogLevelFromString(util.GetEnv(\"SERVER_LOGGER_REQUEST_LEVEL\", zerolog.DebugLevel.String())),\n\t\t\t\tLogRequestBody: util.GetEnvAsBool(\"SERVER_LOGGER_LOG_REQUEST_BODY\", false),\n\t\t\t\tLogRequestHeader: util.GetEnvAsBool(\"SERVER_LOGGER_LOG_REQUEST_HEADER\", false),\n\t\t\t\tLogRequestQuery: util.GetEnvAsBool(\"SERVER_LOGGER_LOG_REQUEST_QUERY\", false),\n\t\t\t\tLogResponseBody: util.GetEnvAsBool(\"SERVER_LOGGER_LOG_RESPONSE_BODY\", false),\n\t\t\t\tLogResponseHeader: util.GetEnvAsBool(\"SERVER_LOGGER_LOG_RESPONSE_HEADER\", false),\n\t\t\t\tPrettyPrintConsole: util.GetEnvAsBool(\"SERVER_LOGGER_PRETTY_PRINT_CONSOLE\", false),\n\t\t\t},\n\t\t\tPush: PushService{\n\t\t\t\tUseFCMProvider: util.GetEnvAsBool(\"SERVER_PUSH_USE_FCM\", false),\n\t\t\t\tUseMockProvider: util.GetEnvAsBool(\"SERVER_PUSH_USE_MOCK\", true),\n\t\t\t},\n\t\t\tFCMConfig: provider.FCMConfig{\n\t\t\t\tGoogleApplicationCredentials: util.GetEnv(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"),\n\t\t\t\tProjectID: util.GetEnv(\"SERVER_FCM_PROJECT_ID\", \"no-fcm-project-id-set\"),\n\t\t\t\tValidateOnly: util.GetEnvAsBool(\"SERVER_FCM_VALIDATE_ONLY\", true),\n\t\t\t},\n\t\t}\n\n\t})\n\n\treturn config\n}", "func newConfig(serviceName string) config {\n\t// Use stdlib to parse. If it's an invalid value and doesn't parse, log it\n\t// and keep going. It should already be false on error but we force it to\n\t// be extra clear that it's failing closed.\n\tinsecure, err := strconv.ParseBool(os.Getenv(\"OTEL_EXPORTER_OTLP_INSECURE\"))\n\tif err != nil {\n\t\tinsecure = false\n\t\tlog.Println(\"Invalid boolean value in OTEL_EXPORTER_OTLP_INSECURE. Try true or false.\")\n\t}\n\n\treturn config{\n\t\tservicename: serviceName,\n\t\tendpoint: os.Getenv(\"OTEL_EXPORTER_OTLP_ENDPOINT\"),\n\t\tinsecure: insecure,\n\t}\n}", "func NewConfig() AppConfig {\n\tappConfig := AppConfig{\n\t\tPort: \"1337\",\n\t}\n\n\tif port, isSet := os.LookupEnv(\"PORT\"); isSet {\n\t\tappConfig.Port = port\n\t}\n\n\treturn appConfig\n}", "func DefaultEnvConfig() (*Config, error) {\n\tif !env.OnGCE() {\n\t\treturn nil, nil\n\t}\n\tauth := \"none\"\n\tuser, _ := metadata.InstanceAttributeValue(\"camlistore-username\")\n\tpass, _ := metadata.InstanceAttributeValue(\"camlistore-password\")\n\tconfBucket, err := metadata.InstanceAttributeValue(\"camlistore-config-dir\")\n\tif confBucket == \"\" || err != nil {\n\t\treturn nil, fmt.Errorf(\"VM instance metadata key 'camlistore-config-dir' not set: %v\", err)\n\t}\n\tblobBucket, err := metadata.InstanceAttributeValue(\"camlistore-blob-dir\")\n\tif blobBucket == \"\" || err != nil {\n\t\treturn nil, fmt.Errorf(\"VM instance metadata key 'camlistore-blob-dir' not set: %v\", err)\n\t}\n\tif user != \"\" && pass != \"\" {\n\t\tauth = \"userpass:\" + user + \":\" + pass\n\t}\n\n\tif v := osutil.SecretRingFile(); !strings.HasPrefix(v, \"/gcs/\") {\n\t\treturn nil, fmt.Errorf(\"Internal error: secret ring path on GCE should be at /gcs/, not %q\", v)\n\t}\n\tkeyID, secRing, err := getOrMakeKeyring()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thighConf := &serverconfig.Config{\n\t\tAuth: auth,\n\t\tHTTPS: true,\n\t\tIdentity: keyID,\n\t\tIdentitySecretRing: secRing,\n\t\tGoogleCloudStorage: \":\" + strings.TrimPrefix(blobBucket, \"gs://\"),\n\t\tPackRelated: true,\n\t\tShareHandler: true,\n\t}\n\n\texternalIP, _ := metadata.ExternalIP()\n\thostName, _ := metadata.InstanceAttributeValue(\"camlistore-hostname\")\n\t// If they specified a hostname (probably with pk-deploy), then:\n\t// if it looks like an FQDN, perkeepd is going to rely on Let's\n\t// Encrypt, else perkeepd is going to generate some self-signed for that\n\t// hostname.\n\t// Also, if the hostname is in camlistore.net, we want Perkeep to initialize\n\t// exactly as if the instance had no hostname, so that it registers its hostname/IP\n\t// with the camlistore.net DNS server (possibly needlessly, if the instance IP has\n\t// not changed) again.\n\tif hostName != \"\" && !strings.HasSuffix(hostName, CamliNetDomain) {\n\t\thighConf.BaseURL = fmt.Sprintf(\"https://%s\", hostName)\n\t\thighConf.Listen = \"0.0.0.0:443\"\n\t} else {\n\t\thighConf.CamliNetIP = externalIP\n\t}\n\n\t// Detect a linked Docker MySQL container. It must have alias \"mysqldb\".\n\tmysqlPort := os.Getenv(\"MYSQLDB_PORT\")\n\tif !strings.HasPrefix(mysqlPort, \"tcp://\") {\n\t\t// No MySQL\n\t\t// TODO: also detect Cloud SQL.\n\t\thighConf.KVFile = \"/index.kv\"\n\t\treturn genLowLevelConfig(highConf)\n\t}\n\thostPort := strings.TrimPrefix(mysqlPort, \"tcp://\")\n\thighConf.MySQL = \"root@\" + hostPort + \":\" // no password\n\tconfigVersion, err := metadata.InstanceAttributeValue(\"perkeep-config-version\")\n\tif configVersion == \"\" || err != nil {\n\t\t// the launcher is deploying a pre-\"perkeep-config-version\" Perkeep, which means\n\t\t// we want the old configuration, with DBNames\n\t\thighConf.DBUnique = useDBNamesConfig\n\t} else if configVersion != \"1\" {\n\t\treturn nil, fmt.Errorf(\"unexpected value for VM instance metadata key 'perkeep-config-version': %q\", configVersion)\n\t}\n\n\tconf, err := genLowLevelConfig(highConf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := conf.readFields(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn conf, nil\n}", "func newConfigV101() *configV1 {\n\tconf := new(configV1)\n\tconf.Version = mcCurrentConfigVersion\n\t// make sure to allocate map's otherwise Golang\n\t// exits silently without providing any errors\n\tconf.Hosts = make(map[string]*hostConfig)\n\tconf.Aliases = make(map[string]string)\n\n\tlocalHostConfig := new(hostConfig)\n\tlocalHostConfig.AccessKeyID = \"\"\n\tlocalHostConfig.SecretAccessKey = \"\"\n\n\ts3HostConf := new(hostConfig)\n\ts3HostConf.AccessKeyID = globalAccessKeyID\n\ts3HostConf.SecretAccessKey = globalSecretAccessKey\n\n\t// Your example host config\n\texampleHostConf := new(hostConfig)\n\texampleHostConf.AccessKeyID = globalAccessKeyID\n\texampleHostConf.SecretAccessKey = globalSecretAccessKey\n\n\tplayHostConfig := new(hostConfig)\n\tplayHostConfig.AccessKeyID = \"\"\n\tplayHostConfig.SecretAccessKey = \"\"\n\n\tdlHostConfig := new(hostConfig)\n\tdlHostConfig.AccessKeyID = \"\"\n\tdlHostConfig.SecretAccessKey = \"\"\n\n\tconf.Hosts[exampleHostURL] = exampleHostConf\n\tconf.Hosts[\"localhost:*\"] = localHostConfig\n\tconf.Hosts[\"127.0.0.1:*\"] = localHostConfig\n\tconf.Hosts[\"s3*.amazonaws.com\"] = s3HostConf\n\tconf.Hosts[\"play.minio.io:9000\"] = playHostConfig\n\tconf.Hosts[\"dl.minio.io:9000\"] = dlHostConfig\n\n\taliases := make(map[string]string)\n\taliases[\"s3\"] = \"https://s3.amazonaws.com\"\n\taliases[\"play\"] = \"https://play.minio.io:9000\"\n\taliases[\"dl\"] = \"https://dl.minio.io:9000\"\n\taliases[\"localhost\"] = \"http://localhost:9000\"\n\tconf.Aliases = aliases\n\n\treturn conf\n}", "func NewConfig() *Config {\n\treturn &Config{\n\t\tHosts: []string{\"localhost:10101\"},\n\t\tGenerate: true,\n\t\tVerify: \"update\",\n\t\tPrefix: \"imaginary-\",\n\t\tThreadCount: 0, // if unchanged, uses workloadspec.threadcount\n\t\t// if workloadspec.threadcount is also unset, defaults to 1\n\t}\n}", "func (s *Server) initConfig() (err error) {\n\t// Home directory is current working directory by default\n\tif s.HomeDir == \"\" {\n\t\ts.HomeDir, err = os.Getwd()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"Failed to get server's home directory\")\n\t\t}\n\t}\n\t// Make home directory absolute, if not already\n\tabsoluteHomeDir, err := filepath.Abs(s.HomeDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to make server's home directory path absolute: %s\", err)\n\t}\n\ts.HomeDir = absoluteHomeDir\n\t// Create config if not set\n\tif s.Config == nil {\n\t\ts.Config = new(ServerConfig)\n\t}\n\ts.CA.server = s\n\ts.CA.HomeDir = s.HomeDir\n\terr = s.initMultiCAConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\trevoke.SetCRLFetcher(s.fetchCRL)\n\t// Make file names absolute\n\ts.makeFileNamesAbsolute()\n\n\tcompModeStr := os.Getenv(\"FABRIC_CA_SERVER_COMPATIBILITY_MODE_V1_3\")\n\tif compModeStr == \"\" {\n\t\tcompModeStr = \"true\" // TODO: Change default to false once all clients have been updated to use the new authorization header\n\t}\n\n\ts.Config.CompMode1_3, err = strconv.ParseBool(compModeStr)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"Invalid value for boolean environment variable 'FABRIC_CA_SERVER_COMPATIBILITY_MODE_V1_3'\")\n\t}\n\n\treturn nil\n}", "func newConfig(initiator bool) noise.Config {\n\treturn noise.Config{\n\t\tCipherSuite: cipherSuite,\n\t\tPattern: noise.HandshakeNK,\n\t\tInitiator: initiator,\n\t\tPrologue: []byte(\"dnstt 2020-04-13\"),\n\t}\n}", "func (c *config) newConfig(redirect string) *oauth2.Config {\n\treturn &oauth2.Config{\n\t\tClientID: c.Client,\n\t\tClientSecret: c.Secret,\n\t\tEndpoint: oauth2.Endpoint{\n\t\t\tAuthURL: fmt.Sprintf(\"%s/site/oauth2/authorize\", c.URL),\n\t\t\tTokenURL: fmt.Sprintf(\"%s/site/oauth2/access_token\", c.URL),\n\t\t},\n\t\tRedirectURL: fmt.Sprintf(\"%s/authorize\", redirect),\n\t}\n}", "func NewConfig() *Config {\n\treturn &Config{\n\t\tPort: \"2000\",\n\t\tDomain: \".dev\",\n\t\tURLPattern: `.*\\.dev$`,\n\t\tServices: nil,\n\t}\n}", "func (env *Dsn) newMySQLConfig() (*mysql.Config, error) {\n\tvar err error\n\tdsn := mysql.NewConfig()\n\n\tdsn.User = env.User\n\tdsn.Passwd = env.Password\n\tdsn.Net = env.Net\n\tdsn.Addr = env.Addr\n\tdsn.DBName = env.Schema\n\tdsn.Params = make(map[string]string)\n\tfor k, v := range env.Params {\n\t\tdsn.Params[k] = v\n\t}\n\tdsn.Params[\"charset\"] = env.Charset\n\tdsn.Collation = env.Collation\n\tdsn.Loc, err = time.LoadLocation(env.Loc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdsn.MaxAllowedPacket = env.MaxAllowedPacket\n\tdsn.ServerPubKey = env.ServerPubKey\n\tdsn.TLSConfig = env.TLS\n\tif env.Timeout != \"\" {\n\t\tdsn.Timeout, err = time.ParseDuration(env.Timeout)\n\t\tLogIfError(err, \"timeout: '%s'\", env.Timeout)\n\t}\n\tif env.WriteTimeout != \"\" {\n\t\tdsn.WriteTimeout, err = time.ParseDuration(env.WriteTimeout)\n\t\tLogIfError(err, \"writeTimeout: '%s'\", env.WriteTimeout)\n\t}\n\tif env.ReadTimeout != \"\" {\n\t\tdsn.ReadTimeout, err = time.ParseDuration(env.ReadTimeout)\n\t\tLogIfError(err, \"readTimeout: '%s'\", env.ReadTimeout)\n\t}\n\tdsn.AllowNativePasswords = env.AllowNativePasswords\n\tdsn.AllowOldPasswords = env.AllowOldPasswords\n\treturn dsn, err\n}", "func initConfig() {\n\tcfg = config.NewConfig()\n\t// server info\n\tflag.StringVar(&cfg.ServerInfo.Ip, \"ip\", \"0.0.0.0\", \"ip address to listen\")\n\tflag.UintVar(&cfg.ServerInfo.ListenPort, \"listen_port\", 8888, \"listen port\")\n\tflag.UintVar(&cfg.ServerInfo.ManagePort, \"manage_port\", 9999, \"manage port\")\n\n\t// db info\n\tflag.StringVar(&cfg.DbInfo.DbIp, \"db_ip\", \"0.0.0.0\", \"db ip\")\n\tflag.UintVar(&cfg.DbInfo.DbPort, \"db_port\", 6033, \"db port\")\n\tflag.StringVar(&cfg.DbInfo.DbUser, \"db_user\", \"root\", \"db user\")\n\tflag.StringVar(&cfg.DbInfo.DbPassword, \"db_password\", \"root-root\", \"db password\")\n\tflag.StringVar(&cfg.DbInfo.DbName, \"db_name\", \"lottery\", \"db name\")\n\n\t// redis info\n\tflag.StringVar(&cfg.RedisInfo.RedisIp, \"redis_ip\", \"10.23.101.22\", \"redis ip\")\n\tflag.UintVar(&cfg.RedisInfo.RedisPort, \"redis_port\", 6379, \"redis port\")\n\tflag.StringVar(&cfg.RedisInfo.RedisUser, \"redis_user\", \"root\", \"redis user\")\n\tflag.StringVar(&cfg.RedisInfo.RedisPassword, \"redis_password\", \"root-root\", \"redis password\")\n\n\t// parse\n\tflag.Parse()\n}", "func newConfig() (*config, error) {\n\tec2Metadata := ec2metadata.New(session.Must(session.NewSession()))\n\tregion, err := ec2Metadata.Region()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get region from ec2 metadata\")\n\t}\n\n\tinstanceID, err := ec2Metadata.GetMetadata(\"instance-id\")\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get instance id from ec2 metadata\")\n\t}\n\n\tmac, err := ec2Metadata.GetMetadata(\"mac\")\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get mac from ec2 metadata\")\n\t}\n\n\tsecurityGroups, err := ec2Metadata.GetMetadata(\"security-groups\")\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get security groups from ec2 metadata\")\n\t}\n\n\tinterfaces, err := ec2Metadata.GetMetadata(\"network/interfaces/macs\")\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get interfaces from ec2 metadata\")\n\t}\n\n\tsubnet, err := ec2Metadata.GetMetadata(\"network/interfaces/macs/\" + mac + \"/subnet-id\")\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get subnet from ec2 metadata\")\n\t}\n\n\tvpc, err := ec2Metadata.GetMetadata(\"network/interfaces/macs/\" + mac + \"/vpc-id\")\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to get vpc from ec2 metadata\")\n\t}\n\n\treturn &config{region: region,\n\t\tsubnet: subnet,\n\t\tindex: int64(len(strings.Split(interfaces, \"\\n\"))),\n\t\tinstanceID: instanceID,\n\t\tsecurityGroups: strings.Split(securityGroups, \"\\n\"),\n\t\tvpc: vpc,\n\t}, nil\n}", "func New(config *interface{}) {\n\tv := reflect.ValueOf(*config)\n\tfieldCount := v.NumField()\n\n\tfor i := 0; i < fieldCount; i++ {\n\t\tswitch v.Field(i).Kind() {\n\t\tcase reflect.Int:\n\t\t\tval := reflect.ValueOf(getIntFromEnv(v.Field(i).Type().Name()))\n\t\t\tv.Field(i).Set(val)\n\t\tcase reflect.String:\n\t\t\tval := reflect.ValueOf(getStringFromEnv(v.Field(i).Type().Name()))\n\t\t\tv.Field(i).Set(val)\n\t\tcase reflect.Bool:\n\t\t\tval := reflect.ValueOf(getBoolFromEnv(v.Field(i).Type().Name()))\n\t\t\tv.Field(i).Set(val)\n\t\tdefault:\n\t\t\tlog.Fatalf(\"error building config -- %s is not of an acceptable type\", v.Field(i).Type().Name())\n\t\t}\n\t}\n}", "func NewConfig() *Config {\n\tvar c Config\n\tc.Port = os.Getenv(\"PORT\")\n\tif c.Port == \"\" {\n\t\tc.Port = \":8000\"\n\t}\n\tc.LogLevel = os.Getenv(\"LogLevel\")\n\tif c.LogLevel == \"\" {\n\t\tc.LogLevel = \"debug\"\n\t}\n\tc.DatabaseURL = os.Getenv(\"DATABASE_URL\")\n\tif c.DatabaseURL == \"\" {\n\t\tc.DatabaseURL = \"host=localhost user=postgres dbname=rest_api sslmode=disable password=4256\"\n\t}\n\tc.CookieKey = os.Getenv(\"CookieKey\")\n\tif c.DatabaseURL == \"\" {\n\t\tc.DatabaseURL = \"xWly5GVFkNc2suGAUfrEEm1gUyya0gJ8Zjebmj0OZklS7rNfAQAO03DMontDwSfqpjeHx6rZL5UZR9XXtB39yDLIGITcu6cQ92Zs\"\n\t}\n\treturn &c\n}", "func initConfig() {\n\t// if cfgFile != \"\" {\n\t// \t// Use config file from the flag.\n\t// \tviper.SetConfigFile(cfgFile)\n\t// } else {\n\t// \t// Find home directory.\n\t// \thome, err := homedir.Dir()\n\t// \tif err != nil {\n\t// \t\tfmt.Println(err)\n\t// \t\tos.Exit(1)\n\t// \t}\n\n\t// \t// Search config in home directory with name \".newApp\" (without extension).\n\t// \tviper.AddConfigPath(home)\n\t// \tviper.SetConfigName(\".newApp\")\n\t// }\n\n\t// viper.AutomaticEnv() // read in environment variables that match\n\n\t// // If a config file is found, read it in.\n\t// if err := viper.ReadInConfig(); err == nil {\n\t// \tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t// }\n}", "func initConfig() {\n\tif RootConfig.clusterID == \"\" {\n\t\tlog.Fatal(\"A cluster id must be provided.\")\n\t}\n\tif RootConfig.internal {\n\t\tRootConfig.config = insideCluster()\n\t} else {\n\t\tRootConfig.config = outsideCluster()\n\t}\n}", "func initConfig() {\n\tviper.SetDefault(\"metadata\", \"datamon-meta-data\")\n\tviper.SetDefault(\"blob\", \"datamon-blob-data\")\n\tviper.SetDefault(\"label\", \"datamon-label-data\")\n\tif os.Getenv(\"DATAMON_CONFIG\") != \"\" {\n\t\t// Use config file from the flag.\n\t\tviper.SetConfigFile(os.Getenv(\"DATAMON_CONFIG\"))\n\t} else {\n\t\tviper.AddConfigPath(\".\")\n\t\tviper.AddConfigPath(\"$HOME/.datamon\")\n\t\tviper.AddConfigPath(\"/etc/datamon\")\n\t\tviper.SetConfigName(\"datamon\")\n\t}\n\n\tviper.AutomaticEnv() // read in environment variables that match\n\t// If a config file is found, read it in.\n\tviper.ReadInConfig() // nolint:errcheck\n\t// `viper.ConfigFileUsed()` returns path to config file if error is nil\n\tvar err error\n\tconfig, err = newConfig()\n\tif err != nil {\n\t\tlogFatalln(err)\n\t}\n\tconfig.setRepoParams(&params)\n\tif config.Credential != \"\" {\n\t\t// Always pick the config file. There can be a duplicate bucket name in a different project, avoid wrong environment\n\t\t// variable from dev testing from screwing things up..\n\t\t_ = os.Setenv(\"GOOGLE_APPLICATION_CREDENTIALS\", config.Credential)\n\t}\n}", "func NewConfig() {\n\t appConfig = &AppConfig{}\n}", "func initConfig(cmd *cobra.Command) {\n\tviper.SetConfigName(\".skelly\") // name of config file (without extension)\n\tviper.AddConfigPath(\"$HOME\") // adding home directory as first search path\n\tviper.SetConfigType(\"json\")\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\tfmt.Println(\"got here\")\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t}\n\n\t// Make sure that go src var is set\n\tgopath = viper.GetString(\"gopath\")\n\tif len(gopath) <= 0 {\n\t\tgopath = joinPath(os.Getenv(\"GOPATH\"), \"src\")\n\t\tviper.Set(\"gopath\", gopath)\n\t}\n\n\tif cmd.Flags().Lookup(\"project-root\").Changed {\n\t\tviper.Set(\"project-root\", basePath)\n\t}\n\tif cmd.Flags().Lookup(\"author\").Changed {\n\t\tfmt.Println(\"adding author\")\n\t\tviper.Set(\"author\", author)\n\t}\n\tif cmd.Flags().Lookup(\"email\").Changed {\n\t\tviper.Set(\"email\", email)\n\t}\n\tfmt.Println(email)\n\tif cmd.Flags().Lookup(\"license\").Changed {\n\t\tviper.Set(\"license\", license)\n\t}\n}", "func NewConfig(base string) (config *Config) {\n\tconfig = &Config{}\n\tconfig.Base = base\n\tconfig.Entries = make(map[string]ConfigEntry)\n\treturn\n}", "func serverConfig() (http.ServerConfig, error) {\n\tconfig := http.ServerConfig{}\n\tvar err error\n\tconfig.Port, err = os.GetIntFromEnvVar(\"PORT\", 8080)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\tconfig.TLSEnabled, err = os.GetBoolFromEnvVar(\"TLS_ENABLED\", false)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\tif config.TLSEnabled {\n\t\tconfig.TLSCertPath, err = os.GetRequiredEnvVar(\"TLS_CERT_PATH\")\n\t\tif err != nil {\n\t\t\treturn config, err\n\t\t}\n\t\tconfig.TLSKeyPath, err = os.GetRequiredEnvVar(\"TLS_KEY_PATH\")\n\t\tif err != nil {\n\t\t\treturn config, err\n\t\t}\n\t}\n\treturn config, nil\n}", "func NewConfig(args []string) (*Config, error) {\n\tconfig := &Config{}\n\tif len(args) == 0 {\n\t\treturn config, errors.New(\"arguments cannot be empty\")\n\t}\n\n\t// load default config values\n\tconfig.FlagPort = defaultHTTPPort\n\tconfig.FlagGetRequestTimeout = defaultGETRequestTimeout\n\n\tflagSet := flag.NewFlagSet(dcosLog, flag.ContinueOnError)\n\tconfig.setFlags(flagSet)\n\n\t// override with user provided arguments\n\tif err := flagSet.Parse(args[1:]); err != nil {\n\t\treturn config, err\n\t}\n\n\t// read config file if exists.\n\tif err := readAndUpdateConfigFile(config); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// set debug level\n\tif config.FlagVerbose {\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t\tlogrus.Debug(\"Using debug level\")\n\t}\n\n\treturn config, validateConfigStruct(config)\n}", "func initConfig(secret map[string]string) *Config {\n\tc := Config{\n\t\tmember: viper.New(),\n\t\tsecretValues: secret,\n\t}\n\tc.member.SetEnvPrefix(MemberEnvPrefix)\n\tc.member.AutomaticEnv()\n\tc.member.SetEnvKeyReplacer(strings.NewReplacer(\".\", \"_\"))\n\tc.setConfigDefaults()\n\treturn &c\n}", "func NewConfig(configFile string) (*Config, error) {\n\n\tcfg := &Config{\n\t\tHost: \"0.0.0.0\",\n\t\tPort: 8080,\n\t\tAllowEmptyClientSecret: false,\n\t\tScopes: []string{\"openid\", \"profile\", \"email\", \"offline_access\"},\n\t\tUsernameClaim: \"nickname\",\n\t\tEmailClaim: \"\",\n\t\tServeTLS: false,\n\t\tCertFile: \"/etc/gangway/tls/tls.crt\",\n\t\tKeyFile: \"/etc/gangway/tls/tls.key\",\n\t\tClusterCAPath: \"/var/run/secrets/kubernetes.io/serviceaccount/ca.crt\",\n\t\tHTTPPath: \"\",\n\t}\n\n\tif configFile != \"\" {\n\t\tdata, err := ioutil.ReadFile(configFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = yaml.Unmarshal([]byte(data), cfg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\terr := envconfig.Process(\"gangway\", cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = cfg.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Check for trailing slash on HTTPPath and remove\n\tcfg.HTTPPath = strings.TrimRight(cfg.HTTPPath, \"/\")\n\n\treturn cfg, nil\n}", "func NewConfig() *Config {\n\treturn &Config{\n\t\tGatewayIP: env(\"SCALEIO_GATEWAY_IP\", \"127.0.0.1\"),\n\t\tUsername: env(\"SCALEIO_GATEWAY_USERNAME\", \"admin\"),\n\t\tPassword: env(\"SCALEIO_GATEWAY_PASSWORD\", \"admin\"),\n\t\tVersion: env(\"SCALEIO_GATEWAY_VERSION\", \"2.0\"),\n\t\tSdsList: env(\"SCALEIO_SDS_LIST\", \"\"),\n\t}\n}", "func (cfg *Config) FromEnv() error {\n\n\t//Init\n\tif cfg.VirtualCenter == nil {\n\t\tcfg.VirtualCenter = make(map[string]*VirtualCenterConfig)\n\t}\n\n\t//Globals\n\tif v := os.Getenv(\"VSPHERE_VCENTER\"); v != \"\" {\n\t\tcfg.Global.VCenterIP = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_VCENTER_PORT\"); v != \"\" {\n\t\tcfg.Global.VCenterPort = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_USER\"); v != \"\" {\n\t\tcfg.Global.User = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_PASSWORD\"); v != \"\" {\n\t\tcfg.Global.Password = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_DATACENTER\"); v != \"\" {\n\t\tcfg.Global.Datacenters = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_SECRET_NAME\"); v != \"\" {\n\t\tcfg.Global.SecretName = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_SECRET_NAMESPACE\"); v != \"\" {\n\t\tcfg.Global.SecretNamespace = v\n\t}\n\n\tif v := os.Getenv(\"VSPHERE_ROUNDTRIP_COUNT\"); v != \"\" {\n\t\ttmp, err := strconv.ParseUint(v, 10, 32)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"Failed to parse VSPHERE_ROUNDTRIP_COUNT: %s\", err)\n\t\t} else {\n\t\t\tcfg.Global.RoundTripperCount = uint(tmp)\n\t\t}\n\t}\n\n\tif v := os.Getenv(\"VSPHERE_INSECURE\"); v != \"\" {\n\t\tInsecureFlag, err := strconv.ParseBool(v)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"Failed to parse VSPHERE_INSECURE: %s\", err)\n\t\t} else {\n\t\t\tcfg.Global.InsecureFlag = InsecureFlag\n\t\t}\n\t}\n\n\tif v := os.Getenv(\"VSPHERE_API_DISABLE\"); v != \"\" {\n\t\tAPIDisable, err := strconv.ParseBool(v)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"Failed to parse VSPHERE_API_DISABLE: %s\", err)\n\t\t} else {\n\t\t\tcfg.Global.APIDisable = APIDisable\n\t\t}\n\t}\n\n\tif v := os.Getenv(\"VSPHERE_API_BINDING\"); v != \"\" {\n\t\tcfg.Global.APIBinding = v\n\t}\n\n\tif v := os.Getenv(\"VSPHERE_SECRETS_DIRECTORY\"); v != \"\" {\n\t\tcfg.Global.SecretsDirectory = v\n\t}\n\tif cfg.Global.SecretsDirectory == \"\" {\n\t\tcfg.Global.SecretsDirectory = DefaultSecretDirectory\n\t}\n\tif _, err := os.Stat(cfg.Global.SecretsDirectory); os.IsNotExist(err) {\n\t\tcfg.Global.SecretsDirectory = \"\" //Dir does not exist, set to empty string\n\t}\n\n\tif v := os.Getenv(\"VSPHERE_CAFILE\"); v != \"\" {\n\t\tcfg.Global.CAFile = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_THUMBPRINT\"); v != \"\" {\n\t\tcfg.Global.Thumbprint = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_LABEL_REGION\"); v != \"\" {\n\t\tcfg.Labels.Region = v\n\t}\n\tif v := os.Getenv(\"VSPHERE_LABEL_ZONE\"); v != \"\" {\n\t\tcfg.Labels.Zone = v\n\t}\n\n\t//Build VirtualCenter from ENVs\n\tfor _, e := range os.Environ() {\n\t\tpair := strings.Split(e, \"=\")\n\n\t\tif len(pair) != 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tkey := pair[0]\n\t\tvalue := pair[1]\n\n\t\tif strings.HasPrefix(key, \"VSPHERE_VCENTER_\") && len(value) > 0 {\n\t\t\tid := strings.TrimPrefix(key, \"VSPHERE_VCENTER_\")\n\t\t\tvcenter := value\n\n\t\t\t_, username, errUsername := getEnvKeyValue(\"VCENTER_\"+id+\"_USERNAME\", false)\n\t\t\tif errUsername != nil {\n\t\t\t\tusername = cfg.Global.User\n\t\t\t}\n\t\t\t_, password, errPassword := getEnvKeyValue(\"VCENTER_\"+id+\"_PASSWORD\", false)\n\t\t\tif errPassword != nil {\n\t\t\t\tpassword = cfg.Global.Password\n\t\t\t}\n\t\t\t_, server, errServer := getEnvKeyValue(\"VCENTER_\"+id+\"_SERVER\", false)\n\t\t\tif errServer != nil {\n\t\t\t\tserver = \"\"\n\t\t\t}\n\t\t\t_, port, errPort := getEnvKeyValue(\"VCENTER_\"+id+\"_PORT\", false)\n\t\t\tif errPort != nil {\n\t\t\t\tport = cfg.Global.VCenterPort\n\t\t\t}\n\t\t\tinsecureFlag := false\n\t\t\t_, insecureTmp, errInsecure := getEnvKeyValue(\"VCENTER_\"+id+\"_INSECURE\", false)\n\t\t\tif errInsecure != nil {\n\t\t\t\tinsecureFlagTmp, errTmp := strconv.ParseBool(insecureTmp)\n\t\t\t\tif errTmp == nil {\n\t\t\t\t\tinsecureFlag = insecureFlagTmp\n\t\t\t\t}\n\t\t\t}\n\t\t\t_, datacenters, errDatacenters := getEnvKeyValue(\"VCENTER_\"+id+\"_DATACENTERS\", false)\n\t\t\tif errDatacenters != nil {\n\t\t\t\tdatacenters = cfg.Global.Datacenters\n\t\t\t}\n\t\t\troundtrip := DefaultRoundTripperCount\n\t\t\t_, roundtripTmp, errRoundtrip := getEnvKeyValue(\"VCENTER_\"+id+\"_ROUNDTRIP\", false)\n\t\t\tif errRoundtrip != nil {\n\t\t\t\troundtripFlagTmp, errTmp := strconv.ParseUint(roundtripTmp, 10, 32)\n\t\t\t\tif errTmp == nil {\n\t\t\t\t\troundtrip = uint(roundtripFlagTmp)\n\t\t\t\t}\n\t\t\t}\n\t\t\t_, caFile, errCaFile := getEnvKeyValue(\"VCENTER_\"+id+\"_CAFILE\", false)\n\t\t\tif errCaFile != nil {\n\t\t\t\tcaFile = cfg.Global.CAFile\n\t\t\t}\n\t\t\t_, thumbprint, errThumbprint := getEnvKeyValue(\"VCENTER_\"+id+\"_THUMBPRINT\", false)\n\t\t\tif errThumbprint != nil {\n\t\t\t\tthumbprint = cfg.Global.Thumbprint\n\t\t\t}\n\n\t\t\t_, secretName, secretNameErr := getEnvKeyValue(\"VCENTER_\"+id+\"_SECRET_NAME\", false)\n\t\t\t_, secretNamespace, secretNamespaceErr := getEnvKeyValue(\"VCENTER_\"+id+\"_SECRET_NAMESPACE\", false)\n\n\t\t\tif secretNameErr != nil || secretNamespaceErr != nil {\n\t\t\t\tsecretName = \"\"\n\t\t\t\tsecretNamespace = \"\"\n\t\t\t}\n\t\t\tsecretRef := DefaultCredentialManager\n\t\t\tif secretName != \"\" && secretNamespace != \"\" {\n\t\t\t\tsecretRef = vcenter\n\t\t\t}\n\n\t\t\tiPFamilyPriority := []string{DefaultIPFamily}\n\t\t\t_, ipFamily, errIPFamily := getEnvKeyValue(\"VCENTER_\"+id+\"_IP_FAMILY\", false)\n\t\t\tif errIPFamily != nil {\n\t\t\t\tiPFamilyPriority = []string{ipFamily}\n\t\t\t}\n\n\t\t\t// If server is explicitly set, that means the vcenter value above is the TenantRef\n\t\t\tvcenterIP := vcenter\n\t\t\ttenantRef := vcenter\n\t\t\tif server != \"\" {\n\t\t\t\tvcenterIP = server\n\t\t\t\ttenantRef = vcenter\n\t\t\t}\n\n\t\t\tvar vcc *VirtualCenterConfig\n\t\t\tif cfg.VirtualCenter[tenantRef] != nil {\n\t\t\t\tvcc = cfg.VirtualCenter[tenantRef]\n\t\t\t} else {\n\t\t\t\tvcc = &VirtualCenterConfig{}\n\t\t\t\tcfg.VirtualCenter[tenantRef] = vcc\n\t\t\t}\n\n\t\t\tvcc.User = username\n\t\t\tvcc.Password = password\n\t\t\tvcc.TenantRef = tenantRef\n\t\t\tvcc.VCenterIP = vcenterIP\n\t\t\tvcc.VCenterPort = port\n\t\t\tvcc.InsecureFlag = insecureFlag\n\t\t\tvcc.Datacenters = datacenters\n\t\t\tvcc.RoundTripperCount = roundtrip\n\t\t\tvcc.CAFile = caFile\n\t\t\tvcc.Thumbprint = thumbprint\n\t\t\tvcc.SecretRef = secretRef\n\t\t\tvcc.SecretName = secretName\n\t\t\tvcc.SecretNamespace = secretNamespace\n\t\t\tvcc.IPFamilyPriority = iPFamilyPriority\n\t\t}\n\t}\n\n\treturn nil\n}", "func initConfig() *domain.ApplicationConfig {\n\tconfigPath := util.GetEnv(envConfigPath, defaultConfigPath)\n\tprefix := util.GetEnv(envConfigPrefix, defaultConfigPrefix)\n\tcfg, err := util.ReadConfig(configPath, prefix)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn cfg\n}", "func NewConfig(fileName FilePath) *Config {\n\n\tif err := godotenv.Load(string(fileName)); err != nil {\n\t\tlog.Printf(\"Config file not found for file name: %s\", fileName)\n\t\tpanic(err)\n\t}\n\n\treturn &Config{\n\t\tserverConfig: server.Config{\n\t\t\tHost: os.Getenv(\"SERVER_HOST\"),\n\t\t\tPort: convertToInt(os.Getenv(\"SERVER_PORT\")),\n\t\t\tListenLimit: convertToInt(os.Getenv(\"SERVER_LISTEN_LIMIT\")),\n\t\t\tKeepAlive: convertToInt(os.Getenv(\"SERVER_KEEP_ALIVE_TIME\")),\n\t\t\tReadTimeout: convertToInt(os.Getenv(\"SERVER_READ_TIMEOUT\")),\n\t\t\tWriteTimeout: convertToInt(os.Getenv(\"SERVER_WRITE_TIMEOUT\")),\n\t\t\tShutdownTimeout: convertToInt(os.Getenv(\"SERVER_SHUTDOWN_TIME\")),\n\t\t},\n\t\tdbConfig: mysql.Config{\n\t\t\tHost: os.Getenv(\"MYSQL_HOST\"),\n\t\t\tPort: convertToInt(os.Getenv(\"MYSQL_PORT\")),\n\t\t\tDatabase: os.Getenv(\"MYSQL_DATABASE\"),\n\t\t\tUser: os.Getenv(\"MYSQL_USER\"),\n\t\t\tPassword: os.Getenv(\"MYSQL_PASSWORD\"),\n\t\t},\n\t\trequestsConfig: requests.Config{\n\t\t\tArjBackendURL: os.Getenv(\"ARJ_BACKEND_URL\"),\n\t\t},\n\t}\n}", "func InitConfig() Config {\n\tif !(testingMode == \"true\") && gopath != \"\" {\n\t\tfullpath := gopath + \"/src/github.com/lancetw/lubike/.env\"\n\t\terr := godotenvLoad(fullpath)\n\t\tif err != nil {\n\t\t\tlogFatalf(\"Error loading .env file %v\", fullpath)\n\t\t}\n\t}\n\n\tvar config Config\n\tconfig.UbikeEndpoint = os.Getenv(\"UBIKE_ENDPOINT\")\n\tconfig.UbikeEndpointTimeout, _ = strconv.Atoi(os.Getenv(\"UBIKE_ENDPOINT_TIMEOUT\"))\n\tconfig.MapquestAPIKey = os.Getenv(\"MAPQUEST_API_KEY\")\n\tconfig.MapquestRouteMatrixEndpoint = os.Getenv(\"MAPQUEST_ROUTE_MATRIX_ENDPOINT\")\n\tconfig.MapquestRouteMatrixEndpointTimeout, _ = strconv.Atoi(os.Getenv(\"MAPQUEST_ROUTE_MATRIX_ENDPOINT_TIMEOUT\"))\n\tconfig.GoogleMapMatrixAPIKey = os.Getenv(\"GOOGLEMAP_MATRIX_API_KEY\")\n\tconfig.GoogleMapMatrixEndpoint = os.Getenv(\"GOOGLEMAP_MATRIX_ENDPOINT\")\n\tconfig.GoogleMapMatrixEndpointTimeout, _ = strconv.Atoi(os.Getenv(\"GOOGLEMAP_MATRIX_API_ENDPOINT_TIMEOUT\"))\n\n\treturn config\n}", "func initBaseConf() {\n\tssLEnable := false\n\tif viper.GetBool(defaultEnvHttpsEnable) {\n\t\tssLEnable = true\n\t} else {\n\t\tssLEnable = viper.GetBool(\"sslEnable\")\n\t}\n\trunMode := viper.GetString(\"runmode\")\n\tvar apiBase string\n\tif \"debug\" == runMode {\n\t\tapiBase = viper.GetString(\"dev_url\")\n\t} else if \"test\" == runMode {\n\t\tapiBase = viper.GetString(\"test_url\")\n\t} else {\n\t\tapiBase = viper.GetString(\"prod_url\")\n\t}\n\n\turi, err := url.Parse(apiBase)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tbaseHOSTByEnv := viper.GetString(defaultEnvHost)\n\tif baseHOSTByEnv != \"\" {\n\t\turi.Host = baseHOSTByEnv\n\t\tapiBase = uri.String()\n\t} else {\n\t\tisAutoHost := viper.GetBool(defaultEnvAutoGetHost)\n\t\tSugar().Debugf(\"isAutoHost %v\", isAutoHost)\n\t\tif isAutoHost {\n\t\t\tipv4, err := sys.NetworkLocalIP()\n\t\t\tif err == nil {\n\t\t\t\taddrStr := viper.GetString(\"addr\")\n\t\t\t\tvar proc string\n\t\t\t\tif ssLEnable {\n\t\t\t\t\tproc = \"https\"\n\t\t\t\t} else {\n\t\t\t\t\tproc = \"http\"\n\t\t\t\t}\n\t\t\t\tapiBase = fmt.Sprintf(\"%v://%v%v\", proc, ipv4, addrStr)\n\t\t\t}\n\t\t}\n\t}\n\n\tif ssLEnable {\n\t\tapiBase = strings.Replace(apiBase, \"http://\", \"https://\", 1)\n\t}\n\tSugar().Debugf(\"config file uri.Host %v\", uri.Host)\n\tSugar().Debugf(\"apiBase %v\", apiBase)\n\tbaseConf = BaseConf{\n\t\tBaseURL: apiBase,\n\t\tSSLEnable: ssLEnable,\n\t}\n}", "func NewConfig(\n\tloadGlobalConfig, loadUserConfig bool,\n\tconfigName, configType string) *Config {\n\n\tlog.Debug(\"initializing configuration\")\n\n\tc := &Config{\n\t\tsecureConfig: secureConfig{},\n\t\tplainTextConfig: plainTextConfig{},\n\t\tViper: viper.New(),\n\t\tGlobalFlags: &flag.FlagSet{},\n\t\tAdditionalFlags: &flag.FlagSet{},\n\t\tjsonMarshalStrategy: JSONMarshalSecure,\n\t}\n\tc.Viper.SetTypeByDefaultValue(true)\n\tc.Viper.SetConfigName(configName)\n\tc.Viper.SetConfigType(configType)\n\n\tcfgFile := fmt.Sprintf(\"%s.%s\", configName, configType)\n\tetcRexRayFile := util.EtcFilePath(cfgFile)\n\tusrRexRayFile := fmt.Sprintf(\"%s/.rexray/%s\", util.HomeDir(), cfgFile)\n\n\tif loadGlobalConfig && util.FileExists(etcRexRayFile) {\n\t\tlog.WithField(\"path\", etcRexRayFile).Debug(\"loading global config file\")\n\t\tif err := c.ReadConfigFile(etcRexRayFile); err != nil {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"path\": etcRexRayFile,\n\t\t\t\t\"error\": err}).Error(\n\t\t\t\t\"error reading global config file\")\n\t\t}\n\t}\n\n\tif loadUserConfig && util.FileExists(usrRexRayFile) {\n\t\tlog.WithField(\"path\", usrRexRayFile).Debug(\"loading user config file\")\n\t\tif err := c.ReadConfigFile(usrRexRayFile); err != nil {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"path\": usrRexRayFile,\n\t\t\t\t\"error\": err}).Error(\n\t\t\t\t\"error reading user config file\")\n\t\t}\n\t}\n\n\tc.initConfigKeys()\n\n\treturn c\n\n}", "func NewConfig(config *configuration.Data, setTemplateRepoInfo TemplateRepoInfoSetter, clusterUser, clusterToken, clusterURL string) Config {\n\ttr := &http.Transport{\n\t\tTLSClientConfig: &tls.Config{\n\t\t\tInsecureSkipVerify: config.APIServerInsecureSkipTLSVerify(),\n\t\t},\n\t}\n\n\tconf := Config{\n\t\tOriginalConfig: config,\n\t\tConsoleURL: config.GetConsoleURL(),\n\t\tHTTPTransport: tr,\n\t\tMasterUser: clusterUser,\n\t\tToken: clusterToken,\n\t\tMasterURL: clusterURL,\n\t}\n\treturn setTemplateRepoInfo(conf)\n}", "func NewConfig(username, password string) (Config, error) {\n\talias := os.Getenv(\"CLC_ALIAS\")\n\tagent := userAgentDefault\n\tif v := os.Getenv(\"CLC_USER_AGENT\"); v != \"\" {\n\t\tagent = v\n\t}\n\tbase := baseUriDefault\n\tif v := os.Getenv(\"CLC_BASE_URL\"); v != \"\" {\n\t\tbase = v\n\t}\n\turi, err := url.Parse(base)\n\treturn Config{\n\t\tUser: User{\n\t\t\tUsername: username,\n\t\t\tPassword: password,\n\t\t},\n\t\tAlias: alias,\n\t\tBaseURL: uri,\n\t\tUserAgent: agent,\n\t}, err\n}", "func initConfig() {\n\tlog.SetHandler(text.New(os.Stderr))\n\tif debug {\n\t\tlog.SetLevel(log.DebugLevel)\n\t}\n\tviper.SetEnvPrefix(\"ecs\")\n\tviper.AutomaticEnv() // read in environment variables that match\n\tif cfgFile != \"\" || environment != \"\" {\n\t\t// Use config file from the flag. cfgFile takes precedence over environment\n\t\tif cfgFile != \"\" {\n\t\t\tviper.SetConfigFile(cfgFile)\n\t\t} else {\n\t\t\tif cfg, err := findConfigByEnvironment(environment); err != nil {\n\t\t\t\tlog.WithError(err).Fatal(\"Can't find the config\")\n\t\t\t} else {\n\t\t\t\tviper.SetConfigFile(cfg)\n\t\t\t}\n\t\t}\n\t\t// If a config file is found, read it in.\n\t\tif err := viper.ReadInConfig(); err == nil {\n\t\t\tlog.Infof(\"Using config file: %s\", viper.ConfigFileUsed())\n\t\t} else {\n\t\t\tlog.WithError(err).Fatal(\"Had some errors while parsing the config\")\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\n}", "func initConfig() {\n\n\tviper.SetEnvPrefix(`HELM_API`)\n\n\te := viper.BindEnv(\n\t\t`DEBUG`,\n\t)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\te = viper.BindEnv(\n\t\t`LOGLEVEL`,\n\t)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\tviper.SetDefault(`LOGLEVEL`, `info`)\n\n\te = viper.BindEnv(\n\t\t`TMP`,\n\t)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\tviper.SetDefault(`TMP`, `/var/tmp/helm-api`)\n\n\te = viper.BindEnv(`PORT`)\n\tviper.SetDefault(`PORT`, `8848`)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\te = viper.BindEnv(`HTTP_PORT`)\n\tviper.SetDefault(`HTTP_PORT`, `8611`)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\tviper.AllowEmptyEnv(true)\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tutils.Error().Err(err).Send()\n\t}\n}", "func NewConfig(issuer, keyID string, env Environment) Config {\n\treturn Config{\n\t\tenv: env,\n\t\tissuer: issuer,\n\t\tkeyID: keyID,\n\t}\n}", "func NewConfig() *Config {\n\n\tconf := &Config{}\n\n\tflag.StringVar(&conf.serverAddr, \"serverAddr\", os.Getenv(\"SERVER_HOST\"), \"server host\")\n\tflag.StringVar(&conf.serverPort, \"serverPort\", os.Getenv(\"SERVER_PORT\"), \"server port\")\n\t// flag.StringVar(&conf.MongoURL, \"mongoURL\", \"mongodb://127.0.0.1:27017\", \"mongodb url\")\n\tflag.StringVar(&conf.mongoUsername, \"mongoUsername\", os.Getenv(\"MONGODB_USERNAME\"), \"mongodb username\")\n\tflag.StringVar(&conf.mongoPassword, \"mongoPassword\", os.Getenv(\"MONGODB_PASSWORD\"), \"mongodb password\")\n\tflag.StringVar(&conf.mongoURI, \"mongoURI\", os.Getenv(\"MONGODB_URI\"), \"mongodb uri\")\n\t// flag.StringVar(&conf.Database, \"database\", \"Lessons\", \"datbase\")\n\tflag.StringVar(&conf.Database, \"database\", os.Getenv(\"DB_NAME\"), \"datbase\")\n\tflag.StringVar(&conf.LessonCollection, \"lessonCollection\", os.Getenv(\"DB_COLLECTION\"), \"database collecion of lesson\")\n\tflag.StringVar(&conf.ModelCollection, \"modelCollection\", \"model\", \"database collecion of model\")\n\n\tflag.Parse()\n\n\treturn conf\n}", "func initConfig() {\n\thome, err := homedir.Dir()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\ttdPath := path.Join(home, \".td\")\n\tif _, err := os.Stat(tdPath); os.IsNotExist(err) {\n\t\tos.MkdirAll(tdPath, os.ModePerm)\n\t}\n\n\tviper.AddConfigPath(tdPath)\n\tviper.Set(\"tdPath\", tdPath)\n\tviper.SetConfigName(\".config\")\n\tviper.AutomaticEnv()\n\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tviper.WriteConfigAs(path.Join(tdPath, \".config.json\"))\n\t}\n\n\tviper.SetDefault(\"boards_file\", path.Join(tdPath, \"boards.json\"))\n\tviper.SetDefault(\"current_board\", \"default\")\n}", "func New() *Config {\n\tvar conf Config\n\tappName := \"live-config\"\n\n\terr := envconfig.Process(appName, &conf)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn &conf\n}", "func initConfig() {\n\n\tviper.SetDefault(\"server_port\", 3000)\n\tviper.SetDefault(\"database_file\", \"instagram_bot.db\")\n\n\tif cfgFile != \"\" {\n\t\t// Use config file from the flag.\n\t\tviper.SetConfigFile(cfgFile)\n\t} else {\n\t\t// Find home directory.\n\t\thome, err := homedir.Dir()\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\tviper.SetConfigName(\"config\") // name of config file (without extension)\n\t\tviper.AddConfigPath(home) // call multiple times to add many search paths\n\t\tviper.AddConfigPath(\".\") // optionally look for config in the working directory\n\t\terr = viper.ReadInConfig() // Find and read the config file\n\t}\n\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t} else {\n\n\t}\n}", "func (c *configuration) cmdlineOverride(opts *cliOptions) {\n\t// Populate options that can be provided on both the commandline and config.\n\tif opts.Port > 0 {\n\t\tc.Port = int(opts.Port)\n\t}\n\tif opts.Rank != nil {\n\t\t// global rank parameter should only apply to first I/O service\n\t\tc.Servers[0].Rank = opts.Rank\n\t}\n\tif opts.Insecure {\n\t\tc.TransportConfig.AllowInsecure = true\n\t}\n\t// override each per-server config\n\tfor i := range c.Servers {\n\t\tsrv := &c.Servers[i]\n\n\t\tif opts.MountPath != \"\" {\n\t\t\t// override each per-server config in addition to global value\n\t\t\tc.ScmMountPath = opts.MountPath\n\t\t\tsrv.ScmMount = opts.MountPath\n\t\t} else if srv.ScmMount == \"\" {\n\t\t\t// if scm not specified for server, apply global\n\t\t\tsrv.ScmMount = c.ScmMountPath\n\t\t}\n\t\tif opts.Cores > 0 {\n\t\t\tlog.Debugf(\"-c option deprecated, please use -t instead\")\n\t\t\tsrv.Targets = int(opts.Cores)\n\t\t}\n\t\t// Targets should override Cores if specified in cmdline or\n\t\t// config file.\n\t\tif opts.Targets > 0 {\n\t\t\tsrv.Targets = int(opts.Targets)\n\t\t}\n\t\tif opts.NrXsHelpers != nil {\n\t\t\tsrv.NrXsHelpers = int(*opts.NrXsHelpers)\n\t\t}\n\t\tif opts.FirstCore > 0 {\n\t\t\tsrv.FirstCore = int(opts.FirstCore)\n\t\t}\n\t}\n\n\tif opts.Group != \"\" {\n\t\tc.SystemName = opts.Group\n\t}\n\tif opts.SocketDir != \"\" {\n\t\tc.SocketDir = opts.SocketDir\n\t}\n\tif opts.Modules != nil {\n\t\tc.Modules = *opts.Modules\n\t}\n\tif opts.Attach != nil {\n\t\tc.Attach = *opts.Attach\n\t}\n\tif opts.Map != nil {\n\t\tc.SystemMap = *opts.Map\n\t}\n}", "func configDefault(config ...Config) Config {\n\t// Return default config if nothing provided\n\tif len(config) < 1 {\n\t\treturn ConfigDefault\n\t}\n\n\t// Override default config\n\tcfg := config[0]\n\n\t// Set default values\n\tif cfg.Host == \"\" {\n\t\tcfg.Host = ConfigDefault.Host\n\t}\n\tif cfg.Port <= 0 {\n\t\tcfg.Port = ConfigDefault.Port\n\t}\n\tif cfg.Database == \"\" {\n\t\tcfg.Database = ConfigDefault.Database\n\t}\n\tif cfg.Table == \"\" {\n\t\tcfg.Table = ConfigDefault.Table\n\t}\n\tif int(cfg.GCInterval.Seconds()) <= 0 {\n\t\tcfg.GCInterval = ConfigDefault.GCInterval\n\t}\n\treturn cfg\n}", "func initConfig() {\n\n\t_, hasToken := os.LookupEnv(\"PRIVATE_ACCESS_TOKEN\")\n\t_, hasURL := os.LookupEnv(\"CI_PROJECT_URL\")\n\tif !hasToken || !hasURL {\n\t\tlog.Fatal(\"You need to set 'CI_PROJECT_URL' and 'PRIVATE_ACCESS_TOKEN'\")\n\t}\n\n\tviper.Set(\"Token\", os.Getenv(\"PRIVATE_ACCESS_TOKEN\"))\n\tviper.Set(\"ProjectUrl\", os.Getenv(\"CI_PROJECT_URL\"))\n\n\tu, err := url.Parse(viper.GetString(\"ProjectUrl\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tviper.Set(\"BaseUrl\", fmt.Sprintf(\"%s://%s\", u.Scheme, u.Host))\n\tviper.Set(\"RegistryUrl\", fmt.Sprintf(\"%s/container_registry.json\", viper.GetString(\"ProjectUrl\")))\n\n}", "func newConfig(opts ...Option) config {\n\tc := config{\n\t\tMeterProvider: otel.GetMeterProvider(),\n\t}\n\tfor _, opt := range opts {\n\t\topt.apply(&c)\n\t}\n\treturn c\n}", "func NewConfig() (*Config, error){\n\n\tvar config Config\n\n\tif err := envconfig.Process(\"APP\", &config); err != nil {\n\t\treturn nil, fmt.Errorf(\"error loading values from environment variables: %s\",\n\t\terr.Error())\n\t}\n\n\treturn &config, nil\n}", "func newSSHDefaultConfig(userName, identity string) (*sshClientConfig, error) {\n\tconfig, err := sshDefaultConfig(userName, identity)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &sshClientConfig{ClientConfig: config}, nil\n}", "func initConfig() {\n\t// viper.AutomaticEnv() // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tviper.SetConfigFile(configFile)\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Load config to memory.\n\tconfig.Server = viper.GetString(\"server\")\n\tif config.Server == \"\" {\n\t\tconfig.Server = defaultServer\n\t}\n\n\tconfig.LogDir = viper.GetString(\"log_dir\")\n\tif config.LogDir == \"\" {\n\t\tconfig.LogDir = defaultLogDir\n\t}\n\n\tconfig.LogLevel = viper.GetString(\"log_level\")\n\tif config.LogLevel == \"\" {\n\t\tconfig.LogLevel = defaultLogLevel\n\t}\n\n\tlogging.Init(config.LogDir, defaultLogFilename, config.LogLevel, 1, false)\n}", "func initConfig() {\n\tif cfgFile != \"\" {\n\t\t// Use config file from the flag.\n\t\tviper.SetConfigFile(cfgFile)\n\t} else {\n\t\t// Find home directory.\n\t\thome, err := homedir.Dir()\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\t// Search config in home directory with name \".server\" (without extension).\n\t\tviper.AddConfigPath(home)\n\t\tviper.SetConfigName(\".server\")\n\t}\n\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t}\n}", "func InitConfig() {\n\tglobalConfig.BackendServerAddr = \"http://localhost:8080\"\n}", "func NewConfig() *Config {\n\treturn &Config{\n\t\tMode: \t\t gin.ReleaseMode,\n\t\tMiddlewares: []string{},\n\t\tHealthz: \t true,\n\t}\n}", "func NewConfig(loc string) (cfg *Config, err error) {\n\tvar c Config\n\tif _, err = toml.DecodeFile(loc, &c); err != nil {\n\t\treturn\n\t}\n\n\tif err = c.loadIncludes(); err != nil {\n\t\treturn\n\t}\n\n\tif c.Dir == \"\" {\n\t\tc.Dir = \"./\"\n\t}\n\n\tif c.Environment == nil {\n\t\tc.Environment = make(map[string]string)\n\t}\n\n\tc.populateFromOSEnv()\n\tcfg = &c\n\treturn\n}", "func MakeDefaultConfig(clusterGRPCAddress string, oauthServerAddress string, insecure bool) Config {\n\treturn Config{\n\t\tBase: conf.Base{\n\t\t\tLog: conf.Log{\n\t\t\t\tFormat: \"console\",\n\t\t\t\tLevel: log.InfoLevel,\n\t\t\t},\n\t\t},\n\t\tInputFormat: \"json\",\n\t\tOutputFormat: \"json\",\n\t\tOAuthServerAddress: oauthServerAddress,\n\t\tIdentityServerGRPCAddress: clusterGRPCAddress,\n\t\tGatewayServerEnabled: true,\n\t\tGatewayServerGRPCAddress: clusterGRPCAddress,\n\t\tNetworkServerEnabled: true,\n\t\tNetworkServerGRPCAddress: clusterGRPCAddress,\n\t\tApplicationServerEnabled: true,\n\t\tApplicationServerGRPCAddress: clusterGRPCAddress,\n\t\tJoinServerEnabled: true,\n\t\tJoinServerGRPCAddress: clusterGRPCAddress,\n\t\tDeviceTemplateConverterGRPCAddress: clusterGRPCAddress,\n\t\tDeviceClaimingServerGRPCAddress: clusterGRPCAddress,\n\t\tQRCodeGeneratorGRPCAddress: clusterGRPCAddress,\n\t\tPacketBrokerAgentGRPCAddress: clusterGRPCAddress,\n\t\tInsecure: insecure,\n\t\tRetry: defaultRetryConfig,\n\t\tTelemetry: defaultTelemetryConfig,\n\t}\n}", "func ReadConfig(file string) (*Config, error) {\n\n\tc := new(Config)\n\n\tlocalIP := net.ParseIP(\"127.0.0.1\")\n\n\t// defaults\n\tc.FlowAPI.Bind = fmt.Sprintf(\"%s:7777\", localIP)\n\tc.FlowAPI.Endpoint = c.FlowAPI.Bind\n\n\tc.IngressAPI.Bind = fmt.Sprintf(\"%s:6666\", localIP)\n\tc.IngressAPI.Endpoint = c.IngressAPI.Bind\n\n\tc.IsolateAPI.Bind = fmt.Sprintf(\"%s:8888\", localIP)\n\tc.IsolateAPI.Endpoint = c.IsolateAPI.Bind\n\tc.IsolateAPI.Isolation = \"vorteil\"\n\n\tc.SecretsAPI.Bind = fmt.Sprintf(\"%s:2610\", localIP)\n\tc.SecretsAPI.Endpoint = c.SecretsAPI.Bind\n\n\tc.Minio.Endpoint = \"127.0.0.1:9000\"\n\tc.Minio.User = \"vorteil\"\n\tc.Minio.Password = \"vorteilvorteil\"\n\tc.Minio.Encrypt = c.Minio.Password\n\tc.Minio.Region = \"us-east-1\"\n\n\tc.Kernel.Runtime = \"21.3.5\"\n\tc.Kernel.Linux = \"21.3.5\"\n\n\t// read config file if exists\n\tif len(file) > 0 {\n\n\t\tlog.Printf(\"read config file %s\", file)\n\n\t\tdata, err := ioutil.ReadFile(file)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = toml.Unmarshal(data, c)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t}\n\n\t// overwrite with envs\n\tints := []struct {\n\t\tname string\n\t\tvalue *int\n\t}{\n\t\t{minioSecure, &c.Minio.Secure},\n\t\t{minioSSL, &c.Minio.SSL},\n\t\t{certSecure, &c.Certs.Secure},\n\t}\n\n\tfor _, i := range ints {\n\t\terr := setInt(c, i.name, i.value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tstrings := []struct {\n\t\tname string\n\t\tvalue *string\n\t}{\n\t\t{dbConn, &c.Database.DB},\n\t\t{minioEndpoint, &c.Minio.Endpoint},\n\t\t{minioUser, &c.Minio.User},\n\t\t{minioPassword, &c.Minio.Password},\n\t\t{minioEncrypt, &c.Minio.Encrypt},\n\t\t{instanceLoggingDriver, &c.InstanceLogging.Driver},\n\t\t{minioRegion, &c.Minio.Region},\n\t\t{kernelLinux, &c.Kernel.Linux},\n\t\t{kernelRuntime, &c.Kernel.Runtime},\n\t\t{flowBind, &c.FlowAPI.Bind},\n\t\t{flowEndpoint, &c.FlowAPI.Endpoint},\n\t\t{flowRegistry, &c.FlowAPI.Registry.Name},\n\t\t{flowRegistryUser, &c.FlowAPI.Registry.User},\n\t\t{flowRegistryToken, &c.FlowAPI.Registry.Token},\n\t\t{ingressBind, &c.IngressAPI.Bind},\n\t\t{ingressEndpoint, &c.IngressAPI.Endpoint},\n\t\t{isolateBind, &c.IsolateAPI.Bind},\n\t\t{isolateEndpoint, &c.IsolateAPI.Endpoint},\n\t\t{secretsBind, &c.SecretsAPI.Bind},\n\t\t{secretsEndpoint, &c.SecretsAPI.Endpoint},\n\t\t{secretsConn, &c.SecretsAPI.DB},\n\t\t{certDir, &c.Certs.Directory},\n\t\t{isolation, &c.IsolateAPI.Isolation},\n\t}\n\n\tfor _, i := range strings {\n\t\terr := setString(c, i.name, i.value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// test database is set\n\tif len(c.Database.DB) == 0 && len(c.SecretsAPI.DB) == 0 {\n\t\treturn nil, fmt.Errorf(\"no database configured\")\n\t}\n\n\treturn c, nil\n\n}", "func NewConfig(appName string) (Config, error) {\n\tvar err error\n\tvar c Config\n\n\tif err = envconfig.Process(appName, &c); err != nil {\n\t\treturn Config{}, err\n\t}\n\treturn c, nil\n}", "func NewConfig() *Config {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tlogrus.Info(\"Error loading .env file\")\n\t}\n\n\tappHost := getEnv(\"APP_HOST\", \"0.0.0.0\")\n\tappPort := getEnv(\"APP_PORT\", \"8000\")\n\treturn &Config{\n\t\tAppVersion: getEnv(\"APP_VERSION\", \"0.0.0\"),\n\t\tAppHost: appHost,\n\t\tAppPort: appPort,\n\t\tAppAddr: net.JoinHostPort(appHost, appPort),\n\t\tRmqURI: getRequiredEnv(\"RMQ_URI\"),\n\t\tMongoURI: getRequiredEnv(\"MONGODB_CONNECTION_STRING\"),\n\t\tMongoDbName: getRequiredEnv(\"MONGO_DBNAME\"),\n\t\tMongoMigrationsDir: \"file://migrations\",\n\t\tPageSize: 25,\n\t\tLogLevel: getEnv(\"LOGS_LEVEL\", \"INFO\"),\n\t\tLogFormat: getEnv(\"LOGS_FORMAT\", \"TEXT\"),\n\t\tSentryDSN: getEnv(\"SENTRY_DSN\", \"\"),\n\t}\n}", "func createMainConfig(file *string, paths *string, basename *string) *viper.Viper {\n\tconfig := viper.New()\n\n\tconfig.SetEnvPrefix(utils.ConfigPrefix) // Env vars start with 'SLA_'\n\tconfig.AutomaticEnv()\n\tconfig.SetDefault(utils.CheckPeriodPropertyName, utils.DefaultCheckPeriod)\n\tconfig.SetDefault(utils.RepositoryTypePropertyName, utils.DefaultRepositoryType)\n\tconfig.SetDefault(utils.ExternalIDsPropertyName, utils.DefaultExternalIDs)\n\n\tif *file != \"\" {\n\t\tconfig.SetConfigFile(*file)\n\t} else {\n\t\tconfig.SetConfigName(*basename)\n\t\tfor _, path := range strings.Split(*paths, \":\") {\n\t\t\tconfig.AddConfigPath(path)\n\t\t}\n\t}\n\n\terrConfig := config.ReadInConfig()\n\tif errConfig != nil {\n\t\tlog.Println(\"Can't find configuration file: \" + errConfig.Error())\n\t\tlog.Println(\"Using defaults\")\n\t}\n\treturn config\n}", "func New(baseURL, user, pass string) *Config {\n\tif baseURL == \"\" {\n\t\tbaseURL = \"http://localhost:8080\" // default base URL\n\t}\n\tvar secret string\n\tif user != \"\" && pass != \"\" {\n\t\tsecret = base64.StdEncoding.EncodeToString([]byte(user + \":\" + pass))\n\t}\n\treturn &Config{BaseURL: baseURL, secret: secret}\n}", "func NewConfig(listen, raftDir, raftPort, nodeID string, join string) *Config {\n\treturn &Config{\n\t\tListenAddress: listen,\n\t\tRaftDir: raftDir,\n\t\tRaftPort: raftPort,\n\t\tJoin: join,\n\t\tNodeID: nodeID,\n\t}\n}", "func NewConfig(data map[string]string) (settings *Config) {\n cfg := &Config{\n ConsumerKey: data[\"consumer_key\"],\n ConsumerSecret: data[\"consumer_secret\"],\n }\n\n // save access token if defined\n if atoken, ok := data[\"access_token\"]; ok {\n cfg.AccessToken = atoken\n }\n\n // save access token secret if defined\n if asecret, ok := data[\"access_secret\"]; ok {\n cfg.AccessSecret = asecret\n }\n\n // save debug flag if defined\n if debug, ok := data[\"debug\"]; ok && debug == \"on\" {\n cfg.Debug = true\n }\n\n return cfg\n}", "func NewConfig(c *v2.ServerConfig) *Config {\n\treturn &Config{\n\t\tServerName: c.ServerName,\n\t\tLogPath: c.DefaultLogPath,\n\t\tLogLevel: configmanager.ParseLogLevel(c.DefaultLogLevel),\n\t\tLogRoller: c.GlobalLogRoller,\n\t\tGracefulTimeout: c.GracefulTimeout.Duration,\n\t\tUseNetpollMode: c.UseNetpollMode,\n\t}\n}", "func loadConfig() {\n\toldUploadKeys = newUploadKeys\n\tuploadKeys = &oldUploadKeys\n\toldConfig = newConfig\n\tconfig = &oldConfig\n\tnewConfig = defaultConfig\n\n\t// populate with values from config file\n\tconfigBytes, err := ioutil.ReadFile(*configPath)\n\tif os.IsNotExist(err) {\n\t\t// don't continue if file doesn't exist\n\t} else if err != nil {\n\t\tlog.Printf(\"error loading config file: %v\", err)\n\t} else {\n\t\tif err := json.Unmarshal(configBytes, &newConfig); err != nil {\n\t\t\tlog.Printf(\"error parsing config file: %v\", err)\n\t\t}\n\t}\n\n\t// apply values from flags\n\tif *listenAddr != \"\" {\n\t\tnewConfig.ListenAddr = *listenAddr\n\t}\n\tif *uploadPath != \"\" {\n\t\tnewConfig.UploadPath = *uploadPath\n\t}\n\tif *uploadURL != \"\" {\n\t\tnewConfig.UploadURL = *uploadURL\n\t}\n\tif *remoteAddrHeader != \"\" {\n\t\tnewConfig.RemoteAddrHeader = *remoteAddrHeader\n\t}\n\n\t// just making config.Keys is initialized\n\tif newConfig.Keys == nil {\n\t\tnewConfig.Keys = make(map[string]string)\n\t}\n\n\tnewUploadKeys = make(map[string]bool)\n\n\tuploadKeyEnv := os.Getenv(\"UPLOAD_KEY\")\n\tif uploadKeyEnv != \"\" {\n\t\tenvKeys := strings.Split(uploadKeyEnv, \",\")\n\t\tfor _, key := range envKeys {\n\t\t\tnewUploadKeys[key] = true\n\t\t}\n\t}\n\n\tfor key := range newConfig.Keys {\n\t\tnewUploadKeys[key] = true\n\t}\n\n\tuploadKeys = &newUploadKeys\n\tconfig = &newConfig\n}", "func newRestConfig(apiConfig *api.Config, overrides clientcmd.ConfigOverrides) (*rest.Config, error) {\n\treturn clientcmd.NewDefaultClientConfig(*apiConfig, &overrides).ClientConfig()\n}", "func newDatabaseConfig() *databaseConfig {\n\treturn &databaseConfig {\n\t\thost: viper.GetString(\"DB_HOST\"),\n\t\tport: getIntOrPanic(\"DB_PORT\"),\n\t\tname: viper.GetString(\"DB_NAME\"),\n\t\tusername: viper.GetString(\"DB_USER\"),\n\t\tpassword: viper.GetString(\"DB_PASSWORD\"),\n\t\tmaxPoolSize: getIntOrPanic(\"DB_POOL\"),\n\t}\n}", "func (client *HTTPClient) NewConfig(config *Config) {\n\tclient.sendRequest(\"POST\", config, nil, &HTTPClientMetrics{NewConfig: true})\n}", "func createDefaultConfig() component.Config {\n\treturn &Config{\n\t\tProtocols: Protocols{\n\t\t\tGRPC: &configgrpc.GRPCServerSettings{\n\t\t\t\tNetAddr: confignet.NetAddr{\n\t\t\t\t\tEndpoint: defaultGRPCEndpoint,\n\t\t\t\t\tTransport: \"tcp\",\n\t\t\t\t},\n\t\t\t\t// We almost write 0 bytes, so no need to tune WriteBufferSize.\n\t\t\t\tReadBufferSize: 512 * 1024,\n\t\t\t},\n\t\t\tHTTP: &HTTPConfig{\n\t\t\t\tHTTPServerSettings: &confighttp.HTTPServerSettings{\n\t\t\t\t\tEndpoint: defaultHTTPEndpoint,\n\t\t\t\t},\n\t\t\t\tTracesURLPath: defaultTracesURLPath,\n\t\t\t\tMetricsURLPath: defaultMetricsURLPath,\n\t\t\t\tLogsURLPath: defaultLogsURLPath,\n\t\t\t},\n\t\t},\n\t}\n}", "func testNewConfigWithDefaults(in *Config) *Config {\n\tcfg := NewConfig()\n\tcfg.Name = in.Name\n\tcfg.ClusterName = in.ClusterName\n\tcfg.InitialCluster = in.InitialCluster\n\tcfg.InitialClusterToken = in.InitialClusterToken\n\tcfg.Dir = in.Dir\n\tcfg.PeerAutoTLS = in.PeerAutoTLS\n\tcfg.PeerTLSInfo = in.PeerTLSInfo\n\tcfg.LPUrls = in.LPUrls\n\tcfg.APUrls = in.APUrls\n\tcfg.ClientAutoTLS = in.ClientAutoTLS\n\tcfg.ClientTLSInfo = in.ClientTLSInfo\n\tcfg.LCUrls = in.LCUrls\n\tcfg.ACUrls = in.ACUrls\n\tcfg.Metrics = in.Metrics\n\tcfg.ListenMetricsUrls = in.ListenMetricsUrls\n\tcfg.ClusterState = in.ClusterState\n\treturn cfg\n}", "func initConfig() {\n\tif cfgFile != \"\" {\n\t\t// Use config file from the flag.\n\t\tviper.SetConfigFile(cfgFile)\n\t} else {\n\t\t// Find home directory.\n\t\thome, err := homedir.Dir()\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\t// Search config in home directory with name \".gotsumon\" (without extension).\n\t\tviper.AddConfigPath(home)\n\t\tviper.SetConfigName(fmt.Sprintf(\".%s\", appName))\n\t}\n\n\trep := strings.NewReplacer(\".\", \"_\", \"-\", \"_\")\n\tviper.SetEnvKeyReplacer(rep)\n\tviper.SetEnvPrefix(appName)\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t}\n}", "func newConfig(path string) *Config {\n\tfile, e := ioutil.ReadFile(path)\n\tif e != nil {\n\t\tlog.Fatalf(\"config error: %v\", e)\n\t}\n\tvar cfg Config\n\te = json.Unmarshal(file, &cfg)\n\tif e != nil {\n\t\tlog.Fatalf(\"config error: %v\", e)\n\t}\n\n\t// redirect logging to a file\n\twriter, err := os.OpenFile(\"gorobot.log\", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to open file log: %v\", err)\n\t}\n\tlog.SetOutput(writer)\n\treturn &cfg\n}", "func NewConfig() Config {\n\treturn Config{\n\t\tBindAddress: DefaultBindAddress,\n\t\tDatabase: DefaultDatabase,\n\t\tProtocol: DefaultProtocol,\n\t\tNamePosition: DefaultNamePosition,\n\t\tNameSeparator: DefaultNameSeparator,\n\t\tConsistencyLevel: DefaultConsistencyLevel,\n\t}\n}", "func initConfig() {\n\tvp := viper.New()\n\tif cfgFile != \"\" {\n\t\t// Use vp file from the flag.\n\t\tvp.SetConfigFile(cfgFile)\n\t} else {\n\t\t// Find home directory.\n\t\tvp.SetConfigType(\"yaml\")\n\t\tvp.AddConfigPath(\"/etc/canis/\")\n\t\tvp.AddConfigPath(\"./config/docker/\")\n\t\tvp.SetConfigName(\"steward_config\")\n\t}\n\n\tvp.AutomaticEnv() // read in environment variables that match\n\t_ = vp.BindPFlags(pflag.CommandLine)\n\n\t// If a vp file is found, read it in.\n\tif err := vp.ReadInConfig(); err != nil {\n\t\tfmt.Println(\"unable to read vp:\", vp.ConfigFileUsed(), err)\n\t\tos.Exit(1)\n\t}\n\n\tctx = context.NewProvider(vp)\n}", "func initConfig() {\n\tif cfgFile == \"\" {\n\t\t// Use default.\n\t\tcfgFile = filepath.Join(os.Getenv(\"HOME\"), util.ConfigFileName)\n\t}\n\tviper.SetConfigFile(cfgFile)\n\n\tviper.AutomaticEnv()\n\n\tviper.SetDefault(util.SettingServer, util.DefaultAPIServer)\n\n\terr := viper.ReadInConfig()\n\tif err == nil {\n\t\tfmt.Println(\"[alauda] Using config file:\", viper.ConfigFileUsed())\n\t} else {\n\t\tfmt.Println(\"[alauda] WARNING: Unable to read config file:\", cfgFile)\n\t}\n}", "func initConfig() {\n\tlogger.SetLogLevel(viper.GetString(\"log.level\"))\n\n\t// Find home directory.\n\thome, err := homedir.Dir()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\tif cfgFile != \"\" {\n\t\t// Use config file from the flag.\n\t\tviper.SetConfigFile(cfgFile)\n\t} else {\n\t\t// Search config in home directory or current directory with name \".box\" (without extension).\n\t\tviper.AddConfigPath(home)\n\t\tviper.AddConfigPath(\".\")\n\t\tviper.SetConfigName(\".box\")\n\t}\n\n\tviper.SetEnvPrefix(\"box\")\n\tviper.SetEnvKeyReplacer(strings.NewReplacer(\"_\", \".\"))\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\tviper.SetDefault(\"workspace\", path.Join(home, \".boxd\"))\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tlogger.Infof(\"Using config file: %s\", viper.ConfigFileUsed())\n\t}\n}", "func newConfigDirectory(baseDirectory string) *configDirectory {\n\treturn &configDirectory{nil, baseDirectory, make([]string, 0)}\n}", "func initConfig() {\n\n\tif ver {\n\t\t_, err := fmt.Fprintln(os.Stdout, formatVersion(version.New(), false))\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\n\t\tos.Exit(0)\n\t}\n\n\tif configFile != \"\" { // enable ability to specify config file via flag\n\t\tviper.SetConfigFile(configFile)\n\t}\n\n\tviper.SetConfigName(\"apphc\") // name of config file (without extension)\n\tviper.AddConfigPath(\"/opt/cisco/apphc/config\")\n\tviper.AddConfigPath(appcommon.ApphcHomePath) // adding home directory as first search path\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\n\tlogrus.Info(\"Config file: \", viper.ConfigFileUsed())\n\n\t// Set prefix for environment variables\n\t// It will check for a environment variable with a name matching the key\n\t// uppercased and prefixed with the EnvPrefix if set.\n\tviper.SetEnvPrefix(\"apphc\")\n\n\t// Bind keys to appropriate environment variables\n\terr := viper.BindEnv(appcommon.EnvApphcLogFormat,\n\t\tappcommon.EnvApphSvcsUrlExternalIp,\n\t\tappcommon.EnvApphExternalIp,\n\t\tappcommon.EnvApphcNetworkPort,\n\t\tappcommon.EnvApphcCachePath,\n\t\tappcommon.EnvApphcAppsUpgradePolicyRecreate,\n\t\tappcommon.EnvApphcAppsRollbackEnabled,\n\t\tappcommon.EnvApphcInternalAuthorizationEnabled,\n\t\tappcommon.EnvApphcBearerToken,\n\t\tappcommon.EnvApphcPrivateDockerRegistry,\n\t\tappcommon.EnvApphcAppFlexApiHost,\n\t\tappcommon.EnvApphcAppFlexApiPort,\n\t\tappcommon.EnvApphcAdaptersRancherEnabled,\n\t\tappcommon.EnvApphMasterNodeUser,\n\t\tappcommon.EnvApphMasterNodeIp,\n\t\tappcommon.EnvApphcPurgeAppMetadata,\n\t\trancher.EnvApphcAdaptersRancherClusterName,\n\t\trancher.EnvApphcAdaptersRancherServerEndpoint,\n\t\trancher.EnvApphcAdaptersRancherServerCredsToken,\n\t\trancher.EnvApphcAdaptersRancherCatalogProto,\n\t\trancher.EnvApphcAdaptersRancherCatalogPassword,\n\t\trancher.EnvApphcAdaptersRancherTemplatesCatalogBranch,\n\t\trancher.EnvApphcAdaptersRancherAppsCatalogName,\n\t\trancher.EnvApphcAdaptersRancherAppsCatalogBranch)\n\n\tif err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\n\t// Set default values\n\tviper.SetDefault(appcommon.EnvApphcLogFormat, appcommon.LogFormatText)\n\tviper.SetDefault(appcommon.EnvApphcNetworkPort, 10000)\n\tviper.SetDefault(appcommon.EnvApphcCachePath, \"/tmp/.cache\")\n\tviper.SetDefault(appcommon.EnvApphcAppsUpgradePolicyRecreate, true)\n\tviper.SetDefault(appcommon.EnvApphcAppsRollbackEnabled, true)\n\tviper.SetDefault(appcommon.EnvApphcInternalAuthorizationEnabled, true)\n\tviper.SetDefault(appcommon.EnvApphcBearerToken, \"YXBwaG9zdGVyLWRlcGxveWVyLTIwMTgK\") // apphoster-deployer-2018 in base64\n\tviper.SetDefault(appcommon.EnvApphcAdaptersRancherEnabled, true)\n\tviper.SetDefault(appcommon.EnvApphMasterNodeUser, \"intucell\")\n\tviper.SetDefault(appcommon.EnvApphcAppFlexApiPort, 7000)\n\tviper.SetDefault(appcommon.EnvApphcPurgeAppMetadata, true)\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherClusterName, \"apphoster\")\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherCatalogProto, \"http\")\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherCatalogPassword, \"catalog\")\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherTemplatesCatalogBranch, \"master\")\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherAppsCatalogName, \"son-flex-apps\")\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherAppsCatalogBranch, \"master\")\n\tviper.SetDefault(rancher.EnvApphcAdaptersRancherServerCredsToken, \"kubeconfig-user-vxg8h:rf94p78gx2mk9fbmchvq7r9xbmzphhz42pltpskj2q8rdsf626n2sf\")\n\tviper.AutomaticEnv()\n\n\tvar formatter logrus.Formatter\n\tif viper.Get(appcommon.EnvApphcLogFormat).(appcommon.LogFormat) == appcommon.LogFormatJson {\n\t\tformatter = &logrus.JSONFormatter{}\n\t} else if viper.Get(appcommon.EnvApphcLogFormat).(appcommon.LogFormat) == appcommon.LogFormatText {\n\t\tformatter = &logrus.TextFormatter{}\n\t}\n\n\tlogrus.SetFormatter(formatter)\n\n\t// Set debug level\n\tif levelDebug {\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t}\n\n\tverification()\n}", "func NewConfig() *Config {\n\treturn &Config{\n\t\tinjectString: defaultInject,\n\t\tconfigString: defaultConfig,\n\t\tactivateES: false,\n\t}\n}", "func initConfig() {\n\tviper.BindEnv(\"CNI_CONF_NAME\")\n\tviper.BindEnv(\"CNI_ETC_DIR\")\n\tviper.BindEnv(\"CNI_BIN_DIR\")\n\tviper.BindEnv(\"COIL_PATH\")\n\tviper.BindEnv(\"CNI_NETCONF_FILE\")\n\tviper.BindEnv(\"CNI_NETCONF\")\n\tviper.BindEnv(\"COIL_BOOT_TAINT\")\n\n\tviper.SetDefault(\"CNI_CONF_NAME\", defaultCniConfName)\n\tviper.SetDefault(\"CNI_ETC_DIR\", defaultCniEtcDir)\n\tviper.SetDefault(\"CNI_BIN_DIR\", defaultCniBinDir)\n\tviper.SetDefault(\"COIL_PATH\", defaultCoilPath)\n}", "func initConfig() {\n\n\tif Verbose {\n\t\tcli.Debug = true\n\t\tlog.SetLevel(log.DebugLevel)\n\t} else {\n\t\tlog.SetLevel(log.InfoLevel)\n\t}\n\tif cfgFile != \"\" { // enable ability to specify config file via flag\n\t\tviper.SetConfigFile(cfgFile)\n\t}\n\tif DryRun {\n\t\tcli.DryRun = true\n\t}\n\n\tviper.SetConfigType(\"yaml\")\n\tviper.SetConfigName(\".mongo-sync\") // name of config file (without extension)\n\tviper.AddConfigPath(\"./\") // search in current working directory first\n\tviper.AddConfigPath(\"$HOME\") // adding home directory as second search path\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tlog.Debugf(\"Using config file:%s\", viper.ConfigFileUsed())\n\t}\n\tviper.Unmarshal(&Config)\n\n\tif val, _ := RootCmd.Flags().GetString(\"local.database\"); val != \"\" {\n\t\tConfig.Local.Database, _ = RootCmd.Flags().GetString(\"local.database\")\n\t}\n\tif val, _ := RootCmd.Flags().GetString(\"local.host\"); val != \"\" {\n\t\tConfig.Local.Host, _ = RootCmd.Flags().GetString(\"local.host\")\n\t}\n\n\tif val, _ := RootCmd.Flags().GetInt(\"local.port\"); val > 0 {\n\t\tConfig.Local.Port, _ = RootCmd.Flags().GetInt(\"local.port\")\n\t}\n\n\tif val, _ := RootCmd.Flags().GetString(\"remote.database\"); val != \"\" {\n\t\tConfig.Remote.Database, _ = RootCmd.Flags().GetString(\"remote.database\")\n\t}\n\n\tif val, _ := RootCmd.Flags().GetString(\"remote.host\"); val != \"\" {\n\t\tConfig.Remote.Host, _ = RootCmd.Flags().GetString(\"remote.host\")\n\t}\n\n\tif val, _ := RootCmd.Flags().GetInt(\"remote.port\"); val > 0 {\n\t\tConfig.Remote.Port, _ = RootCmd.Flags().GetInt(\"remote.port\")\n\t}\n\n\tif Config.Local.Port == 0 {\n\t\tConfig.Local.Port = 27017\n\t}\n\n\tif Config.Remote.Port == 0 {\n\t\tConfig.Remote.Port = 27017\n\t}\n\n}", "func NewServerConfig(hbInfo *HeartbeatInfo, opc, dpc, aspID, tmt, nwApr, corrID uint32, rtCtxs []uint32, si, ni, mp, sls uint8) *Config {\n\treturn &Config{\n\t\tHeartbeatInfo: hbInfo,\n\t\tAspIdentifier: params.NewAspIdentifier(aspID),\n\t\tTrafficModeType: params.NewTrafficModeType(tmt),\n\t\tNetworkAppearance: params.NewNetworkAppearance(nwApr),\n\t\tRoutingContexts: params.NewRoutingContext(rtCtxs...),\n\t\tCorrelationID: params.NewCorrelationID(corrID),\n\t\tOriginatingPointCode: opc,\n\t\tDestinationPointCode: dpc,\n\t\tServiceIndicator: si,\n\t\tNetworkIndicator: ni,\n\t\tMessagePriority: mp,\n\t\tSignalingLinkSelection: sls,\n\t}\n}", "func newConfig() *config {\n\t/*According to Liqo Agent installation process, first check if\n\tuser has defined XDG_DATA_HOME env variable. Otherwise, use the\n\tfallback directory according to XDG specifications\n\t(www.freedesktop.com)*/\n\tXDGBaseDir, present := os.LookupEnv(\"XDG_DATA_HOME\")\n\tif !present {\n\t\tXDGBaseDir = filepath.Join(os.Getenv(\"HOME\"), \".local/share\")\n\t}\n\tliqoPath := filepath.Join(XDGBaseDir, \"liqo\")\n\tif err := os.Setenv(client.EnvLiqoPath, liqoPath); err != nil {\n\t\tos.Exit(1)\n\t}\n\tconf := &config{notifyLevel: NotifyLevelMax, notifyIconPath: filepath.Join(liqoPath, \"icons\")}\n\tconf.notifyTranslateMap = make(map[NotifyLevel]string)\n\tconf.notifyTranslateReverseMap = make(map[string]NotifyLevel)\n\tconf.notifyTranslateMap[NotifyLevelOff] = NotifyLevelOffDescription\n\tconf.notifyTranslateMap[NotifyLevelMin] = NotifyLevelMinDescription\n\tconf.notifyTranslateMap[NotifyLevelMax] = NotifyLevelMaxDescription\n\tfor k, v := range conf.notifyTranslateMap {\n\t\tconf.notifyTranslateReverseMap[v] = k\n\t}\n\treturn conf\n}", "func initConfig() {\n\n\tvar (\n\t\tconfigFile string\n\t\tconfigFileEnv string\n\t\tconfigFileEnvPresent bool\n\t\tconfigFileOrigin string\n\t)\n\n\t// If environment variable is set, load its value.\n\tconfigFileEnv, configFileEnvPresent = os.LookupEnv(\"MH_CONFIG\")\n\tif configFileEnvPresent {\n\t\tconfigFile = configFileEnv\n\t\tconfigFileOrigin = \"env\"\n\t}\n\tif configFileFlag != \"\" {\n\t\t// If flag isn't empty, load its value instead.\n\t\tconfigFile = configFileFlag\n\t\tconfigFileOrigin = \"flag\"\n\t}\n\tviper.SetConfigFile(configFile)\n\tviper.SetEnvPrefix(\"mh\") // will be uppercased automatically\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\t// If a configFile is found, read it in.\n\terr := viper.ReadInConfig()\n\tif viper.GetBool(\"json\") {\n\t\tlog.SetFormatter(&log.JSONFormatter{})\n\t}\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"configFile\": configFile,\n\t\t\t\"configFileEnv\": configFileEnv,\n\t\t\t\"configFileEnvPresent\": configFileEnvPresent,\n\t\t\t\"configFileFlag\": configFileFlag,\n\t\t\t\"configFileOrigin\": configFileOrigin,\n\t\t\t\"configFileUsed\": viper.ConfigFileUsed(),\n\t\t\t\"err\": err,\n\t\t}).Warnln(\"Failed to load mh config.\",\n\t\t\t\"Please consider exporting environment variable: MH_CONFIG.\")\n\t}\n}", "func initConfig() {\n\tif privateKey != \"\" {\n\t\t// Use config file from the flag.\n\t\tviper.SetConfigFile(privateKey)\n\t} else {\n\t\t// Find home directory.\n\t\thome, err := homedir.Dir()\n\t\tcobra.CheckErr(err)\n\n\t\t// Search config in home directory with name \".gitserve\" (without extension).\n\t\tviper.AddConfigPath(home)\n\t\tviper.SetConfigName(\".gitserve\")\n\t}\n\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Fprintln(os.Stderr, \"Using config file:\", viper.ConfigFileUsed())\n\t}\n}", "func (bs *BusinessServer) initConfig() {\n\tcfg := config{}\n\tviper, err := cfg.init(bs.setting.Configfile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbs.viper = viper\n}", "func (sm *ShardMaster) CreateNewConfig() *Config{\n\t// get current config (the last config in config list)\n\tsz := len(sm.configs)\n\tcurr_config := &sm.configs[sz - 1]\n\n\t// create a new config\n\tnew_config := Config{Num: curr_config.Num + 1}\n\tnew_config.Groups = make(map[int64][]string)\n\n\t// copy the shards from curr_config\n\tfor s, gid := range curr_config.Shards{\n\t\tnew_config.Shards[s] = gid\n\t}\n\n\t// copy the group from curr_config\n\tfor gid, server := range curr_config.Groups{\n\t\tnew_config.Groups[gid] = server\n\t}\n\treturn &new_config\n}", "func New() (*Config, error) {\n\tflags := pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)\n\tcfg := &Config{\n\t\tFlags: flags,\n\t\tHTTPAddr: flags.StringP(\"http-addr\", \"l\", \":8080\", \"http listen address\"),\n\t\tHTTPReadHeaderTimeout: flags.DurationP(\"http-timeout\", \"h\", 1*time.Second, \"http timeout for reading request headers\"),\n\t\tCallTimeout: flags.DurationP(\"call-timeout\", \"t\", 0*time.Second, \"function call timeout\"),\n\t\tReadLimit: flags.Int64(\"read-limit\", -1, \"limit the amount of data which can be contained in a requests body\"),\n\t\tFramer: flags.StringP(\"framer\", \"f\", \"\", \"afterburn framer to use: line, json or http\"),\n\t\tBuffer: flags.BoolP(\"buffer\", \"b\", false, \"buffer output before writing\"),\n\t}\n\tif err := cfg.parseCommandline(); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := cfg.parseEnvironment(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn cfg, nil\n}" ]
[ "0.73115087", "0.70333534", "0.69000286", "0.67219496", "0.6460424", "0.6443269", "0.6437713", "0.63716805", "0.6369636", "0.6347529", "0.63264453", "0.63229084", "0.6315524", "0.63034165", "0.6300839", "0.6279276", "0.6262298", "0.6255001", "0.6136349", "0.6126579", "0.61171925", "0.605729", "0.6018562", "0.6015699", "0.597547", "0.597091", "0.59661067", "0.59629816", "0.5959077", "0.5950047", "0.5912011", "0.5902696", "0.58952636", "0.58900225", "0.5880281", "0.58796656", "0.5878133", "0.5867786", "0.5866814", "0.58640176", "0.5853106", "0.5843002", "0.5836692", "0.58266747", "0.5813649", "0.5805457", "0.579691", "0.579225", "0.5790766", "0.57845104", "0.57775396", "0.5763751", "0.5754555", "0.5752975", "0.57509196", "0.5750882", "0.57492393", "0.57433116", "0.574206", "0.5739603", "0.5737488", "0.57344556", "0.57301414", "0.5729949", "0.5724323", "0.57228315", "0.57163477", "0.5710451", "0.5709872", "0.5706497", "0.5702733", "0.57012564", "0.5692789", "0.56887144", "0.56872696", "0.56829494", "0.56822854", "0.5681579", "0.5681088", "0.56808996", "0.56777877", "0.5669196", "0.56673336", "0.5666042", "0.566579", "0.5665107", "0.56606054", "0.56597495", "0.56592447", "0.565575", "0.5655352", "0.5653523", "0.56480044", "0.5642592", "0.5637331", "0.5634173", "0.5626404", "0.56253093", "0.5624893", "0.56225646" ]
0.8209749
0
loadConfig loads a new config from disk, overrides params from env if found and valid
loadConfig загружает новый конфиг с диска, перезаписывает параметры из env, если они найдены и действительны
func loadConfig(envParams envParams) error { configFile := getConfigFile() if _, err := os.Stat(configFile); err != nil { return err } srvCfg := &serverConfigV14{} qc, err := quick.New(srvCfg) if err != nil { return err } if err = qc.Load(configFile); err != nil { return err } // If env is set override the credentials from config file. if globalIsEnvCreds { srvCfg.SetCredential(envParams.creds) } if globalIsEnvBrowser { srvCfg.SetBrowser(envParams.browser) } if strings.ToLower(srvCfg.GetBrowser()) == "off" { globalIsBrowserEnabled = false } // hold the mutex lock before a new config is assigned. serverConfigMu.Lock() // Save the loaded config globally. serverConfig = srvCfg serverConfigMu.Unlock() if serverConfig.Version != v14 { return errors.New("Unsupported config version `" + serverConfig.Version + "`.") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func LoadConfig(logger *zap.Logger, cfg interface{}) {\n\terr := envconfig.Process(\"\", cfg)\n\tif err != nil {\n\t\tenvconfig.Usage(\"\", cfg)\n\t\tlogger.Fatal(\"app: could not process config\", zap.Error(err))\n\t}\n}", "func loadConfig() {\n\toldUploadKeys = newUploadKeys\n\tuploadKeys = &oldUploadKeys\n\toldConfig = newConfig\n\tconfig = &oldConfig\n\tnewConfig = defaultConfig\n\n\t// populate with values from config file\n\tconfigBytes, err := ioutil.ReadFile(*configPath)\n\tif os.IsNotExist(err) {\n\t\t// don't continue if file doesn't exist\n\t} else if err != nil {\n\t\tlog.Printf(\"error loading config file: %v\", err)\n\t} else {\n\t\tif err := json.Unmarshal(configBytes, &newConfig); err != nil {\n\t\t\tlog.Printf(\"error parsing config file: %v\", err)\n\t\t}\n\t}\n\n\t// apply values from flags\n\tif *listenAddr != \"\" {\n\t\tnewConfig.ListenAddr = *listenAddr\n\t}\n\tif *uploadPath != \"\" {\n\t\tnewConfig.UploadPath = *uploadPath\n\t}\n\tif *uploadURL != \"\" {\n\t\tnewConfig.UploadURL = *uploadURL\n\t}\n\tif *remoteAddrHeader != \"\" {\n\t\tnewConfig.RemoteAddrHeader = *remoteAddrHeader\n\t}\n\n\t// just making config.Keys is initialized\n\tif newConfig.Keys == nil {\n\t\tnewConfig.Keys = make(map[string]string)\n\t}\n\n\tnewUploadKeys = make(map[string]bool)\n\n\tuploadKeyEnv := os.Getenv(\"UPLOAD_KEY\")\n\tif uploadKeyEnv != \"\" {\n\t\tenvKeys := strings.Split(uploadKeyEnv, \",\")\n\t\tfor _, key := range envKeys {\n\t\t\tnewUploadKeys[key] = true\n\t\t}\n\t}\n\n\tfor key := range newConfig.Keys {\n\t\tnewUploadKeys[key] = true\n\t}\n\n\tuploadKeys = &newUploadKeys\n\tconfig = &newConfig\n}", "func (c *Config) LoadConfig() (err error) {\n\tpath := os.Getenv(envConfigPath)\n\tif path == \"\" {\n\t\tpath, err = os.Getwd()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif path == \"/\" {\n\t\t\tpath = \".\"\n\t\t}\n\t}\n\tc.path = path + \"/config.json\"\n\terr = LoadConfig(c.path, c)\n\tif err != nil {\n\t\tfmt.Println(\"LoadConfig err\", err)\n\t\treturn\n\t}\n\n\terr = c.overWrite()\n\n\treturn\n}", "func loadConfig(config *Config) {\n\t// Load path to config from CONFIGPATH environment variable\n\tconfigpath := os.Getenv(\"CONFIGPATH\")\n\tfmt.Println(\"Loading config.json from:\", configpath)\n\tfile, _ := os.Open(configpath)\n\tdecoder := json.NewDecoder(file)\n\terr := decoder.Decode(&config)\n\tif err != nil {\n\t\tlog.Fatal(\"Error loading config.json:\", err)\n\t}\n}", "func (c *Config) LoadConfig() (err error) {\n\tpath = os.Getenv(envConfigPath)\n\tif path == \"\" {\n\t\tpath, err = os.Getwd()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif path == \"/\" {\n\t\t\tpath = \".\"\n\t\t}\n\t}\n\tpath = path + \"/config.json\"\n\n\terr = LoadConfig(path, c)\n\tif err != nil {\n\t\tfmt.Println(\"LoadConfig err\", err)\n\t\treturn\n\t}\n\terr = c.overWrite()\n\n\treturn\n}", "func Load(env string) (Config, error) {\n\tconfig, err := configFromFile(env)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\tconfig.Environment = env\n\n\t// override with environment variables as needed and accepted by `Config`\n\terr = envconfig.Init(&config)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\n\treturn config, nil\n}", "func LoadConfig(configPath string) *models.Configuration {\r\n\r\n\tviper.SetEnvPrefix(\"EDUCATIVE\")\r\n\tviper.AddConfigPath(\".\")\r\n\tviper.SetConfigFile(configPath)\r\n\terr := viper.MergeInConfig()\r\n\tif err != nil {\r\n\t\tfmt.Println(\"Error in reading config\")\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\terr = viper.Unmarshal(&CFG, func(config *mapstructure.DecoderConfig) {\r\n\t\tconfig.TagName = \"yaml\"\r\n\t})\r\n\tif err != nil {\r\n\t\tfmt.Println(\"Error in un-marshaling config\")\r\n\t\tpanic(err)\r\n\t}\r\n\t// fillBanningJobTime()\r\n\tif CFG.APP.LogLevel == \"info\" {\r\n\t\tfmt.Printf(\"%#v \\n\", CFG)\r\n\t}\r\n\r\n\tpostgres, err := GetPostgres()\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tutil.Initialize()\r\n\treturn &models.Configuration{\r\n\t\tPostgresConnection: postgres,\r\n\t}\r\n}", "func loadConfig() error {\n\terr := json.Unmarshal([]byte(defaultConf), &conf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Check format version.\n\tif conf.Version != CONF_VER {\n\t\thelper.ColorLog(\"[WARN] Your conf.json is out-of-date, please update!\\n\")\n\t\thelper.ColorLog(\"[HINT] Compare bee.json under bee source code path and yours\\n\")\n\t}\n\n\t// Set variables.\n\tif len(conf.DirStruct.Controllers) == 0 {\n\t\tconf.DirStruct.Controllers = \"controllers\"\n\t}\n\tif len(conf.DirStruct.Models) == 0 {\n\t\tconf.DirStruct.Models = \"models\"\n\t}\n\n\t// Append watch exts.\n\twatchExts = append(watchExts, conf.WatchExt...)\n\treturn nil\n}", "func Load() (*Config, error) {\n\tcfg := &Config{}\n\terr := envconfig.Process(\"\", cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif cfg.TranslationsPath == \"\" {\n\t\tv, err := promtParameter(\"TRANSLATIONS_PATH\", true)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcfg.TranslationsPath = v\n\t}\n\n\tif cfg.TargetAPIAuthorizationKey == \"\" {\n\t\tv, err := promtParameter(\"TARGET_API_AUTHORIZATION_KEY\", true)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcfg.TargetAPIAuthorizationKey = v\n\t}\n\n\tif cfg.TargetAPIHost == \"\" {\n\t\tv, err := promtParameter(\"TARGET_API_HOST\", true)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcfg.TargetAPIHost = v\n\t}\n\n\tif cfg.OrgIDSNCF == \"\" {\n\t\tv, err := promtParameter(\"ORGID_SNCF\", false)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif v == \"\" {\n\t\t\tfmt.Println(fmt.Sprintf(\"Note! Translations won't be uploaded for SNCF\"))\n\t\t}\n\n\t\tcfg.OrgIDSNCF = v\n\t}\n\n\tif cfg.OrgIDThalys == \"\" {\n\t\tv, err := promtParameter(\"ORGID_THALYS\", false)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif v == \"\" {\n\t\t\tfmt.Println(fmt.Sprintf(\"Note! Translations won't be uploaded for THALYS\"))\n\t\t}\n\n\t\tcfg.OrgIDThalys = v\n\t}\n\n\treturn cfg, nil\n}", "func Load() (config *Config, err error) {\n\tconfig = &Config{}\n\n\tif err = env.Set(config); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn\n}", "func (config *Config) Load() error {\n\tvar env string\n\tflag.StringVar(&env, \"env\", \"dev\", \"environment\")\n\n\tflag.Parse()\n\n\tviperRegistry := viper.New()\n\tviperRegistry.AddConfigPath(\"./config\")\n\tviperRegistry.SetConfigName(env)\n\tviperRegistry.SetConfigType(\"json\")\n\tviperRegistry.SetEnvPrefix(\"todo\")\n\tviperRegistry.AutomaticEnv()\n\n\tconfig.Env = env\n\n\tif err := viperRegistry.ReadInConfig(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := config.configureApplication(viperRegistry); err != nil {\n\t\treturn err\n\t}\n\n\tif err := config.configureDB(viperRegistry); err != nil {\n\t\treturn err\n\t}\n\n\tif err := config.configureAuth(viperRegistry); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func loadConfig() Config {\n\tvar args struct {\n\t\tConfigfile string `arg:\"positional\" help:\"the name of the .toml config file to load\"`\n\t\tNoCheck bool `help:\"set this to disable checking that envvar substitutions are fully resolved\"`\n\t}\n\targ.MustParse(&args)\n\n\tvar cfg Config\n\tvar err error\n\tif args.Configfile != \"\" {\n\t\tcfg, err = Load(args.Configfile, args.NoCheck)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"%s\\n\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\treturn cfg\n\t}\n\tfmt.Println(\"a config file name is required!\")\n\tos.Exit(1)\n\treturn cfg\n}", "func Load() error {\n\tfile, err := os.Open(\".env/config.json\")\n\tdefer file.Close()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tparser := json.NewDecoder(file)\n\terr = parser.Decode(&config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(config.Backend.MongoDB.URI) < 1 {\n\t\tconfig.Backend.MongoDB.URI = \"mongodb://127.0.0.1:27017\"\n\t}\n\n\tif len(config.Backend.MongoDB.Database) < 1 {\n\t\tconfig.Backend.MongoDB.Database = \"ikuta\"\n\t}\n\n\tif len(config.HTTP.Address) < 1 {\n\t\tconfig.HTTP.Address = \":7136\"\n\t}\n\n\treturn nil\n}", "func LoadConfig(filename string) *revel.MergedConfig {\n\tif *searchPath != \"\" {\n\t\tAddSearchPath(*searchPath)\n\t\t*searchPath = \"\"\n\t}\n\n\tc, err := loadPriorConfig(filename)\n\tif err != nil {\n\t\trevel.ERROR.Printf(\"error load config: %s\", err.Error())\n\t\trevel.ERROR.Printf(\"filename: %s, runmode: %s, path: %s\", filename, revel.RunMode, revel.ConfPaths)\n\t}\n\treturn c\n}", "func LoadConfig(params map[string]string) *Config {\n\treturn &Config{params[\"githubToken\"], params[\"githubGistID\"], params[\"githubGistFileName\"]}\n}", "func LoadConfig(args []string) (configData *ConfigData) {\n\t//default\n\tdefaultConfig := GetDefaultConfig()\n\t_configData = defaultConfig\n\t//http.conf\n\tfileConfig, _ := ParseConfigFromFile(CONFIGFILE)\n\n\t//-c,not use http.conf\n\n\t//Print config\n}", "func LoadConfig(path string) (config Config, err error) {\n\tviper.AddConfigPath(path)\n\tviper.SetConfigName(\"app\") // since app.env\n\tviper.SetConfigType(\"env\") // json-xml etx could have been also be used\n\n\tviper.AutomaticEnv()\n\t// automatically override values from config file with the values of the env vars\n\n\t// start reading\n\terr = viper.ReadInConfig()\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// unmarshal the values to target config object\n\terr = viper.Unmarshal(&config)\n\treturn\n}", "func loadConfig() (config Config) {\n var set bool\n if config.DockerSock, set = os.LookupEnv(\"DOCKER_SOCK\"); !set {\n config.DockerSock = \"/var/run/docker.sock\"\n }\n if config.VaultAddr, set = os.LookupEnv(\"VAULT_ADDR\"); !set {\n config.VaultAddr = \"http://127.0.0.1:8200\"\n }\n config.VaultSalt, _ = os.LookupEnv(\"VAULT_SALT\")\n return\n}", "func Load(r io.Reader, config interface{}, logFunc func(args ...interface{})) error {\n\tif logFunc == nil {\n\t\tlogFunc = log.Println\n\t}\n\n\tconfigBytes, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\tlogFunc(\"ERROR reading from source\", err)\n\t\treturn err\n\t}\n\tlogFunc(\"CONFIG: \", string(configBytes))\n\n\ttpl := template.Must(template.New(\"config\").Parse(string(configBytes)))\n\n\t//pass env to config\n\tvar b bytes.Buffer\n\terr = tpl.Execute(&b, getEnv())\n\tif err != nil {\n\t\tlogFunc(\"ERROR in compiling the template. Check http://golang.org/pkg/text/template/ for the template format\", err)\n\t\treturn err\n\t}\n\n\tkt := reflect.TypeOf(\"\")\n\tvt := reflect.TypeOf(config)\n\tm := reflect.MakeMap(reflect.MapOf(kt, vt))\n\n\tconfigData := m.Interface()\n\n\terr = yaml.Unmarshal(b.Bytes(), configData)\n\tif err != nil {\n\t\tlogFunc(\"ERROR in parsing YAML\", err)\n\t\treturn err\n\t}\n\n\tc := m.MapIndex(reflect.ValueOf(GOENV))\n\n\tcptr := reflect.ValueOf(config)\n\n\tel := cptr.Elem()\n\n\tif !el.CanSet() {\n\t\terr = errors.New(\"ERROR: the config variable should be a pointer\")\n\t\tlogFunc(err)\n\t\treturn err\n\t}\n\n\tel.Set(c.Elem())\n\treturn nil\n}", "func loadConfig() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tlog.Println(\"did not load any .env file\")\n\t}\n\n\terr = env.Parse(&cfg)\n\n\tif err != nil {\n\t\tlog.Fatal(\"The .env format is not valid\", err)\n\t}\n}", "func (kr *KRun) LoadConfig() *KRun {\n\n\tif kr.KSA == \"\" {\n\t\t// Same environment used for VMs\n\t\tkr.KSA = os.Getenv(\"WORKLOAD_SERVICE_ACCOUNT\")\n\t}\n\tif kr.KSA == \"\" {\n\t\tkr.KSA = \"default\"\n\t}\n\n\tif kr.Namespace == \"\" {\n\t\t// Same environment used for VMs\n\t\tkr.Namespace = os.Getenv(\"WORKLOAD_NAMESPACE\")\n\t}\n\tif kr.Name == \"\" {\n\t\tkr.Name = os.Getenv(\"WORKLOAD_NAME\")\n\t}\n\tif kr.Gateway == \"\" {\n\t\tkr.Gateway = os.Getenv(\"GATEWAY_NAME\")\n\t}\n\n\tks := os.Getenv(\"K_SERVICE\")\n\tif kr.Namespace == \"\" {\n\t\tverNsName := strings.SplitN(ks, \"--\", 2)\n\t\tif len(verNsName) > 1 {\n\t\t\tks = verNsName[1]\n\t\t\tkr.Labels[\"ver\"] = verNsName[0]\n\t\t}\n\t\tparts := strings.Split(ks, \"-\")\n\t\tkr.Namespace = parts[0]\n\t\tif len(parts) > 1 {\n\t\t\tkr.Name = parts[1]\n\t\t}\n\t}\n\n\tif kr.Namespace == \"\" {\n\t\tkr.Namespace = \"default\"\n\t}\n\tif kr.Name == \"\" {\n\t\tkr.Name = kr.Namespace\n\t}\n\n\tkr.Aud2File = map[string]string{}\n\tprefix := \".\"\n\tif os.Getuid() == 0 {\n\t\tprefix = \"\"\n\t}\n\tif kr.BaseDir == \"\" {\n\t\tkr.BaseDir = os.Getenv(\"MESH_BASE_DIR\")\n\t}\n\tif kr.BaseDir != \"\" {\n\t\tprefix = kr.BaseDir\n\t}\n\tfor _, kv := range os.Environ() {\n\t\tkvl := strings.SplitN(kv, \"=\", 2)\n\t\tif strings.HasPrefix(kvl[0], \"K8S_SECRET_\") {\n\t\t\tkr.Secrets2Dirs[kvl[0][11:]] = prefix + kvl[1]\n\t\t}\n\t\tif strings.HasPrefix(kvl[0], \"K8S_CM_\") {\n\t\t\tkr.CM2Dirs[kvl[0][7:]] = prefix + kvl[1]\n\t\t}\n\t\tif strings.HasPrefix(kvl[0], \"K8S_TOKEN_\") {\n\t\t\tkr.Aud2File[kvl[0][10:]] = prefix + kvl[1]\n\t\t}\n\t\tif strings.HasPrefix(kvl[0], \"LABEL_\") {\n\t\t\tkr.Labels[kvl[0][6:]] = prefix + kvl[1]\n\t\t}\n\t}\n\n\tif kr.TrustDomain == \"\" {\n\t\tkr.TrustDomain = os.Getenv(\"TRUST_DOMAIN\")\n\t}\n\tif kr.TrustDomain == \"\" {\n\t\tkr.TrustDomain = kr.ProjectId + \".svc.id.goog\"\n\t}\n\tkr.Aud2File[kr.TrustDomain] = prefix + \"/var/run/secrets/tokens/istio-token\"\n\tif !kr.InCluster {\n\t\tkr.Aud2File[\"api\"] = prefix + \"/var/run/secrets/kubernetes.io/serviceaccount/token\"\n\t}\n\tif kr.KSA == \"\" {\n\t\tkr.KSA = \"default\"\n\t}\n\n\tif kr.XDSAddr == \"\" {\n\t\tkr.XDSAddr = os.Getenv(\"XDS_ADDR\")\n\t}\n\t// Advanced options\n\n\t// example dns:debug\n\tkr.AgentDebug = cfg(\"XDS_AGENT_DEBUG\", \"\")\n\n\treturn kr\n}", "func Load(config interface{}, filename string) error {\n\tv := reflect.ValueOf(config).Elem()\n\tif err := applyDefaults(reflect.StructField{}, v); err != nil {\n\t\treturn fmt.Errorf(\"init config with default values: %s\", err)\n\t}\n\n\tif err := mergeJSONConfig(config, filename); err != nil {\n\t\treturn err\n\t}\n\n\tif err := applyEnv(config); err != nil {\n\t\treturn err\n\t}\n\n\treturn validate(config)\n}", "func (f *Frontend) Loadconfig() error {\n\tcfgFile := configFile()\n\tcfgExists, err := exists(cfgFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !cfgExists {\n\t\treturn fmt.Errorf(configNotFound)\n\t}\n\tbs, err := ioutil.ReadFile(cfgFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = json.Unmarshal(bs, f.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.storage.Config = f.Config\n\tf.loader.Config = f.Config\n\treturn err\n}", "func (kr *KRun) LoadConfig(ctx context.Context) error {\n\terr := kr.K8SClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Load additional settings from env.\n\tkr.initFromEnv()\n\n\t// It is possible to have only one of the 2 mesh connector services installed\n\tif kr.XDSAddr == \"\" || kr.ProjectNumber == \"\" ||\n\t\t(kr.MeshConnectorAddr == \"\" && kr.MeshConnectorInternalAddr == \"\") {\n\t\terr := kr.loadMeshEnv(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn err\n}", "func loadConfig(configName string, configType string) error {\n\tviper.SetConfigName(configName)\n\tviper.SetConfigType(configType)\n\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot read configuration file: %s\\n\", err)\n\t}\n\n\treturn nil\n}", "func (c *Config) Load() error {\n\tif err := env.Parse(c); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func loadConfig() (*provider.Config, error) {\n\t// Gets the config file path.\n\tpath := os.Getenv(configFile)\n\tif path == \"\" {\n\t\tpath = defaultConfigFilePath\n\t}\n\n\tlogger.WithField(\"filename\", path).Info(\"Parsing config file\")\n\n\t// Reads config file.\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"cannot read config file\")\n\t}\n\n\tvar c *provider.Config\n\n\t// Unmarshals the read bytes.\n\tif err = yaml.Unmarshal(data, &c); err != nil {\n\t\treturn nil, errors.Annotate(err, \"cannot unmarshal config file\")\n\t}\n\n\tc.Label = strings.ToLower(c.Label)\n\n\treturn c, nil\n}", "func (clbCfg *CLBConfig) LoadFromEnv() error {\n\tvar err error\n\tclbCfg.ImplementMode = os.Getenv(ConfigBcsClbImplement)\n\tif clbCfg.ImplementMode != ConfigBcsClbImplementAPI &&\n\t\tclbCfg.ImplementMode != ConfigBcsClbImplementSDK {\n\t\tblog.Errorf(\"implement type [%s] from env %s is invalid\", clbCfg.BackendMode, ConfigBcsClbImplement)\n\t\treturn fmt.Errorf(\"backend type [%s] from env %s is invalid\", clbCfg.BackendMode, ConfigBcsClbImplement)\n\t}\n\tclbCfg.BackendMode = os.Getenv(ConfigBcsClbBackendMode)\n\tif clbCfg.BackendMode != ConfigBcsClbBackendModeENI &&\n\t\tclbCfg.BackendMode != ConfigBcsClbBackendModeCVM {\n\t\tblog.Errorf(\"backend type [%s] from env %s is invalid\", clbCfg.BackendMode, ConfigBcsClbBackendMode)\n\t\treturn fmt.Errorf(\"backend type [%s] from env %s is invalid\", clbCfg.BackendMode, ConfigBcsClbBackendMode)\n\t}\n\tclbCfg.Region = os.Getenv(ConfigBcsClbRegion)\n\tif !CheckRegion(clbCfg.Region) {\n\t\tblog.Errorf(\"region [%s] is invalid\", clbCfg.Region)\n\t\treturn fmt.Errorf(\"region [%s] is invalid\", clbCfg.Region)\n\t}\n\tclbCfg.SecretID = os.Getenv(ConfigBcsClbSecretID)\n\tif len(clbCfg.SecretID) == 0 {\n\t\tblog.Errorf(\"secret id cannot be empty\")\n\t\treturn fmt.Errorf(\"secret id cannot be empty\")\n\t}\n\tclbCfg.SecretKey = os.Getenv(ConfigBcsClbSecretKey)\n\tif len(clbCfg.SecretKey) == 0 {\n\t\tblog.Errorf(\"secret key cannot be empty\")\n\t\treturn fmt.Errorf(\"secret key cannot be empty\")\n\t}\n\n\tprojectID := os.Getenv(ConfigBcsClbProjectID)\n\tif len(projectID) == 0 {\n\t\tblog.Errorf(\"project id cannot be empty\")\n\t\treturn fmt.Errorf(\"project id cannot be empty\")\n\t}\n\tclbCfg.ProjectID, err = strconv.Atoi(projectID)\n\tif err != nil {\n\t\tblog.Errorf(\"convert project id %s to int failed, err %s\", projectID, err.Error())\n\t\treturn fmt.Errorf(\"convert project id %s to int failed, err %s\", projectID, err.Error())\n\t}\n\tclbCfg.VpcID = os.Getenv(ConfigBcsClbVpcID)\n\tif len(clbCfg.VpcID) == 0 {\n\t\tblog.Errorf(\"vpc id cannot be empty\")\n\t\treturn fmt.Errorf(\"vpc id cannot be empty\")\n\t}\n\n\t//load expire time\n\texpireTime := os.Getenv(ConfigBcsClbExpireTime)\n\tif len(expireTime) != 0 {\n\t\teTime, err := strconv.Atoi(expireTime)\n\t\tif err != nil {\n\t\t\tblog.Errorf(\"expire time %s invalid, set default value 0\", expireTime)\n\t\t\tclbCfg.ExpireTime = 0\n\t\t} else {\n\t\t\t//expire time: range 30~3600\n\t\t\tif eTime < 30 {\n\t\t\t\tclbCfg.ExpireTime = 30\n\t\t\t} else if eTime > 3600 {\n\t\t\t\tclbCfg.ExpireTime = 3600\n\t\t\t} else {\n\t\t\t\tclbCfg.ExpireTime = eTime\n\t\t\t}\n\t\t}\n\t} else {\n\t\t//default 0: means do not set expire time\n\t\tclbCfg.ExpireTime = 0\n\t}\n\n\tclbCfg.SubnetID = os.Getenv(ConfigBcsClbSubnet)\n\tmaxTimeout := os.Getenv(ConfigBcsClbMaxTimeout)\n\tif len(maxTimeout) != 0 {\n\t\ttimeout, err := strconv.Atoi(maxTimeout)\n\t\tif err != nil {\n\t\t\tblog.Errorf(\"convert max timeout %s to int error, err %s, set default value 180\", maxTimeout, err.Error())\n\t\t\tclbCfg.MaxTimeout = DefaultClbMaxTimeout\n\t\t} else {\n\t\t\tclbCfg.MaxTimeout = timeout\n\t\t}\n\t} else {\n\t\tclbCfg.MaxTimeout = DefaultClbMaxTimeout\n\t}\n\twaitPeriodExceedLimit := os.Getenv(ConfigBcsClbWaitPeriodExceedLimit)\n\tif len(waitPeriodExceedLimit) != 0 {\n\t\tperiod, err := strconv.Atoi(waitPeriodExceedLimit)\n\t\tif err != nil {\n\t\t\tblog.Errorf(\"convert wait period exceed limit %s to int error, err %s, set default value 10\",\n\t\t\t\twaitPeriodExceedLimit, err.Error())\n\t\t\tclbCfg.WaitPeriodExceedLimit = DefaultClbWaitPeriodExceedLimit\n\t\t} else {\n\t\t\tclbCfg.WaitPeriodExceedLimit = period\n\t\t}\n\t} else {\n\t\tclbCfg.WaitPeriodExceedLimit = DefaultClbWaitPeriodExceedLimit\n\t}\n\twaitPeriodLBDealing := os.Getenv(ConfigBcsClbWaitPeriodDealing)\n\tif len(waitPeriodLBDealing) != 0 {\n\t\tperiod, err := strconv.Atoi(waitPeriodLBDealing)\n\t\tif err != nil {\n\t\t\tblog.Errorf(\"convert wait period lb dealing limit %s to int error, err %s, set default value 3\",\n\t\t\t\twaitPeriodLBDealing, err.Error())\n\t\t\tclbCfg.WaitPeriodLBDealing = DefaultClbWaitPeriodDealing\n\t\t} else {\n\t\t\tclbCfg.WaitPeriodLBDealing = period\n\t\t}\n\t} else {\n\t\tclbCfg.WaitPeriodLBDealing = DefaultClbWaitPeriodDealing\n\t}\n\n\tblog.Infof(\"load clb config successfully\\n\")\n\treturn nil\n}", "func Load(env string) *Configuration {\n\t_, filePath, _, _ := runtime.Caller(0)\n\tconfigName := \"config.\" + env + \".yaml\"\n\tconfigPath := filePath[:len(filePath)-9] + \"files\" + string(filepath.Separator)\n\n\tviper.SetConfigName(configName)\n\tviper.AddConfigPath(configPath)\n\tviper.SetConfigType(\"yaml\")\n\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar config Configuration\n\tviper.Unmarshal(&config)\n\tsetGinMode(config.Server.Mode)\n\n\treturn &config\n}", "func LoadConfig(filePath string, edwardVersion string) (Config, error) {\n\treader, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn Config{}, errors.WithStack(err)\n\t}\n\tworkingDir := path.Dir(filePath)\n\tconfig, err := loadConfigContents(reader, workingDir)\n\tconfig.FilePath = filePath\n\tif err != nil {\n\t\treturn Config{}, errors.WithStack(err)\n\t}\n\tif config.MinEdwardVersion != \"\" && edwardVersion != \"\" {\n\t\t// Check that this config is supported by this version\n\t\tminVersion, err1 := version.NewVersion(config.MinEdwardVersion)\n\t\tif err1 != nil {\n\t\t\treturn Config{}, errors.WithStack(err)\n\t\t}\n\t\tcurrentVersion, err2 := version.NewVersion(edwardVersion)\n\t\tif err2 != nil {\n\t\t\treturn Config{}, errors.WithStack(err)\n\t\t}\n\t\tif currentVersion.LessThan(minVersion) {\n\t\t\treturn Config{}, errors.New(\"this config requires at least version \" + config.MinEdwardVersion)\n\t\t}\n\t}\n\terr = config.initMaps()\n\n\tlog.Printf(\"Config loaded with: %d groups and %d services\\n\", len(config.GroupMap), len(config.ServiceMap))\n\treturn config, errors.WithStack(err)\n}", "func LoadConfig(path string, env string) (Config, error) {\n\tvar config Config\n\tviper.AddConfigPath(path + \"/env\")\n\tviper.SetConfigName(env)\n\tviper.SetConfigType(\"env\")\n\tviper.AutomaticEnv()\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\treturn config, err\n\t}\n\terr = viper.Unmarshal(&config)\n\treturn config, err\n}", "func loadConfiguration() Config {\n\tvar conf Config\n\t_, b, _, _ := runtime.Caller(0)\n\tbasepath := filepath.Dir(b)\n\tfilename := fmt.Sprintf(\"%s/config.json\", basepath)\n\tconfigFile, err := os.Open(filename)\n\tdefer configFile.Close()\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\tjsonParser := json.NewDecoder(configFile)\n\tjsonParser.Decode(&conf)\n\t// Use ENV var if it's set\n\tconf.Port = getEnvIntValue(\"Port\", conf.Port)\n\tconf.ReqPerSec = getEnvIntValue(\"ReqPerSec\", conf.ReqPerSec)\n\tconf.ReqPerMin = getEnvIntValue(\"ReqPerMin\", conf.ReqPerMin)\n\tconf.ReqPerHour = getEnvIntValue(\"ReqPerHour\", conf.ReqPerHour)\n\tconf.RedisHost = getEnvStrValue(\"RedisHost\", conf.RedisHost)\n\tconf.RedisPort = getEnvIntValue(\"RedisPort\", conf.RedisPort)\n\n\treturn conf\n}", "func loadConfig() error {\n\t//if path != \"\" {\n\tif defaultConfig.IsSet(\"cfgFile\") && defaultConfig.GetString(\"cfgFile\") != \"\" {\n\t\tpath := defaultConfig.GetString(\"cfgFile\")\n\t\t_, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfilename := filepath.Base(path)\n\t\tdefaultConfig.SetConfigName(filename[:len(filename)-len(filepath.Ext(filename))])\n\t\tdefaultConfig.AddConfigPath(filepath.Dir(path))\n\n\t\tif err := defaultConfig.ReadInConfig(); err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to read config file (%s): %s\\n\", path, err.Error())\n\t\t}\n\t}\n\treturn nil\n}", "func (c *AppConfig) LoadConfig() {\n\tif Config.WorkPath != Config.AppPath {\n\t\tos.Chdir(Config.AppPath)\n\t}\n\n\tconfigFile := filepath.Join(Config.AppPath, \".env\")\n\tif _, err := os.Stat(configFile); os.IsNotExist(err) {\n\t\tlog.Warnf(\"No Config File Loaded, Using Default Config ...\")\n\t} else {\n\t\tgodotenv.Load(configFile)\n\t}\n}", "func loadConfig() {\n\tpath, err := tcpauseCmd.PersistentFlags().GetString(\"config\")\n\tif err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not get config path\")\n\t}\n\n\t// configure viper\n\tif path != \"\" {\n\t\tv.SetConfigFile(path)\n\t} else {\n\t\tv.SetConfigName(\"config\")\n\t\tv.AddConfigPath(\"/etc/puppetlabs/puppet-proxy\")\n\t\tv.AddConfigPath(\".\")\n\t}\n\n\t// read config\n\terr = v.ReadInConfig()\n\tif err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not read config\")\n\t}\n\n\t// parse config\n\terr = v.Unmarshal(&cfg)\n\tif err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not parse config\")\n\t}\n}", "func Load(env string) error {\n\tvar wd string\n\tvar yes bool\n\tvar err error\n\tif wd, err = os.Getwd(); err != nil {\n\t\treturn err\n\t}\n\n\tcwdConfig := filepath.Join(wd, DATA_DIR, CONFIG)\n\tif yes, err = paths.FileExists(cwdConfig); err != nil {\n\t\treturn err\n\t} else if yes {\n\t\treturn LoadFile(cwdConfig, env)\n\t}\n\n\tvar vcsRoot string\n\tif _, vcsRoot, err = paths.FindVCSRoot(wd); err != nil {\n\t\treturn err\n\t} else if len(vcsRoot) == 0 {\n\t\treturn errors.New(errVCSRoot)\n\t}\n\n\tvcsConfig := filepath.Join(vcsRoot, DATA_DIR, CONFIG)\n\tif yes, err = paths.FileExists(vcsConfig); err != nil {\n\t\treturn err\n\t} else if yes {\n\t\treturn LoadFile(vcsConfig, env)\n\t}\n\n\treturn errors.New(errConfig)\n}", "func loadConfig() *config {\n\tc := &config{}\n\tdefaults := configDefaults[Env()]\n\tconfigFile, err := loadConfigFile(os.ExpandEnv(\"$HOME/.gotrix/config.json\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tc.ApplicationName = configValue(\"APPLICATION_NAME\", configFile.ApplicationName, defaults.ApplicationName)\n\tc.DatabaseURL = configValue(\"DATABASE_URL\", configFile.DatabaseURL, defaults.DatabaseURL)\n\tc.Port = configValue(\"PORT\", configFile.Port, defaults.Port)\n\n\treturn c\n}", "func (appConf *AppConf) Load(filename string, forceReload bool) (*AppConf, error){\n\t// appConf is load and force reload is false return direction\n\tif isLoad && !forceReload{\n\t\treturn appConf, nil\n\t}\n\tfilename, err := appConf.getEnvConfigPath(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, err = toml.DecodeFile(filename, appConf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Infof(\"使用配置文件: %s\", filename)\n\t// mark appConf as loaded\n\tisLoad = true\n\treturn appConf, nil\n}", "func (ts *Tester) LoadConfig() (eksconfig.Config, error) {\n\treturn *ts.cfg, nil\n}", "func loadConfig() Config {\n\tc := Config{}\n\n\t// if config file isn't passed in, don't try to look at it\n\tif len(os.Getenv(\"KIOSK_CONFIG_FILE\")) == 0 {\n\t\treturn c\n\t}\n\n\tfile, err := ioutil.ReadFile(os.Getenv(\"KIOSK_CONFIG_FILE\"))\n\tif err != nil {\n\t\tlog.Debugf(\"error reading in the config file: %s\", err)\n\t}\n\n\t_ = json.Unmarshal([]byte(file), &c)\n\n\t// if we still don't have an access secret let's generate a random one\n\treturn c\n}", "func loadConfig() configuration {\n\terr := godotenv.Load(\"config.env\")\n\tif err != nil {\n\t\tlog.Fatal(\"Error loading .env file\")\n\t}\n\n\tconfig := configuration{}\n\n\tconfig.cityName = os.Getenv(\"CITY_NAME\")\n\tconfig.cityLat, err = strconv.ParseFloat(os.Getenv(\"CITY_LAT\"), 64)\n\tif err != nil {\n\t\tlog.Fatal(\"CITY_LAT configuration is missing\")\n\t}\n\n\tconfig.cityLong, err = strconv.ParseFloat(os.Getenv(\"CITY_LONG\"), 64)\n\tif err != nil {\n\t\tlog.Fatal(\"CITY_LONG configuration is missing\")\n\t}\n\n\tconfig.cityTimezone, err = strconv.Atoi(os.Getenv(\"CITY_TIMEZONE\"))\n\tif err != nil {\n\t\tlog.Fatal(\"CITY_TIMEZONE configuration is missing\")\n\t}\n\n\tconfig.azanFile = os.Getenv(\"AZAN_FILENAME\")\n\tif config.azanFile == \"\" {\n\t\tlog.Fatal(\"AZAN_FILENAME configuration is missing\")\n\t}\n\n\tconfig.method = os.Getenv(\"METHOD\")\n\tif config.azanFile == \"\" {\n\t\tlog.Fatal(\"METHOD configuration is missing\")\n\t}\n\n\treturn config\n}", "func Load(configFile string) (*Config, error) {\n\t// User explicitly specified a config file\n\tif configFile != \"\" {\n\t\treturn ParseConfigFile(configFile)\n\t}\n\n\t// There is a config in the current directory\n\tif fi, err := os.Stat(defaultConfigFile); err == nil {\n\t\treturn ParseConfigFile(fi.Name())\n\t}\n\n\t// Use default values\n\tlog.Println(\"Running dev mode with default settings, consult config when you're ready to run in production\")\n\tcfg := defaultConfig()\n\treturn cfg, envOverride(cfg)\n}", "func LoadConfig(fileName string) (*model.Config, string, map[string]interface{}, *model.AppError) {\n\tvar configPath string\n\n\tif fileName != filepath.Base(fileName) {\n\t\tconfigPath = fileName\n\t} else {\n\t\tif path, err := EnsureConfigFile(fileName); err != nil {\n\t\t\tappErr := model.NewAppError(\"LoadConfig\", \"utils.config.load_config.opening.panic\", map[string]interface{}{\"Filename\": fileName, \"Error\": err.Error()}, \"\", 0)\n\t\t\treturn nil, \"\", nil, appErr\n\t\t} else {\n\t\t\tconfigPath = path\n\t\t}\n\t}\n\n\tconfig, envConfig, err := ReadConfigFile(configPath, true)\n\tif err != nil {\n\t\tappErr := model.NewAppError(\"LoadConfig\", \"utils.config.load_config.decoding.panic\", map[string]interface{}{\"Filename\": fileName, \"Error\": err.Error()}, \"\", 0)\n\t\treturn nil, \"\", nil, appErr\n\t}\n\n\tneedSave := len(config.SqlSettings.AtRestEncryptKey) == 0 || len(*config.FileSettings.PublicLinkSalt) == 0 ||\n\t\tlen(config.EmailSettings.InviteSalt) == 0\n\n\tconfig.SetDefaults()\n\n\t// Don't treat it as an error right now if custom terms of service are enabled but text is empty.\n\t// This is because terms of service text will be fetched from database at a later state, but\n\t// the flag indicating it is enabled is fetched from config file right away.\n\tif err := config.IsValid(); err != nil && err.Id != termsOfServiceEnabledAndEmpty.Id {\n\t\treturn nil, \"\", nil, err\n\t}\n\n\tif needSave {\n\t\tif err := SaveConfig(configPath, config); err != nil {\n\t\t\tmlog.Warn(err.Error())\n\t\t}\n\t}\n\n\tif err := ValidateLocales(config); err != nil {\n\t\tif err := SaveConfig(configPath, config); err != nil {\n\t\t\tmlog.Warn(err.Error())\n\t\t}\n\t}\n\n\tif *config.FileSettings.DriverName == model.IMAGE_DRIVER_LOCAL {\n\t\tdir := config.FileSettings.Directory\n\t\tif len(dir) > 0 && dir[len(dir)-1:] != \"/\" {\n\t\t\tconfig.FileSettings.Directory += \"/\"\n\t\t}\n\t}\n\n\treturn config, configPath, envConfig, nil\n}", "func Load(config *api.Config) error {\n\terr := yamlToProto(viper.ConfigFileUsed(), config)\n\tif err != nil {\n\t\treturn errors.Trace(fmt.Errorf(\"error unmarshalling config file: %w\", err))\n\t}\n\tif config.Target.RepoName == \"\" {\n\t\tklog.Warning(\"'target.repoName' property is empty. Using 'myrepo' default value\")\n\t\tconfig.Target.RepoName = defaultRepoName\n\t}\n\tif err := config.Source.Repo.SetBasicAuth(os.Getenv(\"SOURCE_AUTH_USERNAME\"), os.Getenv(\"SOURCE_AUTH_PASSWORD\")); err != nil {\n\t\treturn err\n\t}\n\tif err := config.Target.Repo.SetBasicAuth(os.Getenv(\"TARGET_AUTH_USERNAME\"), os.Getenv(\"TARGET_AUTH_PASSWORD\")); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (c *Config) LoadFromEnv() error {\n\terr := envconfig.Process(\"\", c)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"can't process environment for config: %w\", err)\n\t}\n\n\treturn nil\n}", "func loadConfig() error {\n\tconfigMap = make(map[string]interface{})\n\tfmt.Println(\"Reading \", os.Args[1])\n\tdat, err := ioutil.ReadFile(os.Args[1])\n\tcheckError(err)\n\n\tif err := json.Unmarshal(dat, &configMap); err != nil {\n\t\tlog.Fatal(\"Error in loading config \", err)\n\t}\n\tprotocol = configMap[\"protocol\"].(string)\n\tipAdd = configMap[\"ipAddress\"].(string)\n\tport = configMap[\"port\"].(string)\n\taddr := []string{ipAdd, port}\n\tselfaddr = strings.Join(addr, \"\")\n\tif selfaddr == \"\" {\n\t\tfmt.Println(\"Could not initialize selfaddr\")\n\t}\n\tchordid = getChordId(port, ipAdd)\n\tpersiStorage :=\n\t\tconfigMap[\"persistentStorageContainer\"].(map[string]interface{})\n\tdict3File = persiStorage[\"file\"].(string)\n\tmethods = configMap[\"methods\"].([]interface{})\n\tstabilizeInterval = configMap[\"stabilizeInterval\"].(float64)\n\tcheckPredInterval = configMap[\"checkPredInterval\"].(float64)\n\tfixfingersInterval = configMap[\"fixfingersInterval\"].(float64)\n\tentrypt = configMap[\"entrypoint\"].(string)\n\tfmt.Println(\"Methods exposed by server: \", methods)\n\treturn nil\n}", "func LoadConfig() (Config, error) {\n\tvar c Config\n\n\tctx := context.Background()\n\n\terr := envconfig.Process(ctx, &c)\n\treturn c, err\n}", "func LoadConfig(conf interface{}, filename string) (err error) {\n\tvar decoder *json.Decoder\n\tfile := OpenFile(conf, filename)\n\tdefer file.Close()\n\tdecoder = json.NewDecoder(file)\n\tif err = decoder.Decode(conf); err != nil {\n\t\treturn\n\t}\n\tjson.Marshal(&conf)\n\treturn\n}", "func load() (*cfgfile.ConfigFile, error) {\n\tif changeConfigDir {\n\t\tlogrus.Infoln(\"use config:\", filepath.Join(configDir, ConfigFileName))\n\t}\n\tconf := newcfgfile(filepath.Join(configDir, ConfigFileName))\n\terr := conf.Load()\n\tif err != nil && err != cfgfile.ErrConfigFileMiss {\n\t\treturn nil, err\n\t}\n\tprgpath, _ := utils.GetProcAbsDir()\n\ttmp, err := ioutil.ReadFile(filepath.Join(prgpath, DefaultUniqueAgentIdFile))\n\tif err != nil {\n\t\tconf.Agentid = ZERO_AGENT_ID\n\t} else {\n\t\tconf.Agentid = strings.TrimSpace(string(tmp))\n\t}\n\n\tConf = conf\n\n\treturn conf, nil\n}", "func loadConfig() (TestingConfig, error) {\n\tvar config TestingConfig\n\n\tusr, err := user.Current()\n\tif err != nil {\n\t\tfmt.Println(\"Could not get current user.\", err)\n\t\treturn TestingConfig{}, err\n\t}\n\n\tpath := filepath.Join(usr.HomeDir, \"/.config/slackposter/config.json\")\n\n\tstr, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\tfmt.Println(\"Could not read config.json. \", err)\n\t\treturn TestingConfig{}, err\n\t}\n\n\tif err := json.Unmarshal(str, &config); err != nil {\n\t\tfmt.Println(\"Failed to unmarshal config.json:\", err)\n\t\treturn config, err\n\t}\n\n\treturn config, nil\n}", "func LoadConfig() {\n\tvar configFile string\n\t//todo the default config Path\n\tflag.IntVar(&Config.HttpPort, \"httpport\", 13000, \"the http port\")\n\tflag.IntVar(&Config.MsgPort, \"port\", 13001, \"the msg port\")\n\tflag.IntVar(&Config.Retry, \"r\", 3, \"the retry times\")\n\tflag.StringVar(&Config.Aof, \"aof\", \"msgo.aof\", \"the aof file path\")\n\tflag.IntVar(&Config.SyncType, \"sync\", 0, \"the default sync type of aof\")\n\tflag.IntVar(&Config.Threshold, \"rewrite-threshold\", 10000, \"the default threshold of deleteOps that triggers rewrite operation\")\n\tflag.StringVar(&configFile, \"c\", \"\", \"the config file path\")\n\tflag.Parse()\n\tif configFile != \"\" {\n\t\tBytes, err := ioutil.ReadFile(configFile)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"reading config file error %s: %v\", configFile, err))\n\t\t}\n\t\tif _, err := toml.Decode(string(Bytes), Config); err != nil {\n\t\t\tpanic(fmt.Sprintf(\"parse config file error %s: %v\", configFile, err))\n\t\t}\n\t}\n\tArbitrateConfigs(Config)\n}", "func Load(c Config) error {\n\tc.setDefaults()\n\tc.setCoreUp()\n\n\tif err := c.load(defaultEnv); err != nil {\n\t\treturn fmt.Errorf(\"error reading default configuration file:\", err)\n\t}\n\n\tenv := c.getEnv()\n\tif err := c.merge(env); err != nil {\n\t\treturn fmt.Errorf(\"error reading %s configuration file:\", env, err)\n\t}\n\n\treturn nil\n}", "func LoadConfig(path string) (config Config, err error) {\n\tSetDefaults()\n\tviper.AddConfigPath(path)\n\t// viper.SetConfigName(\"\")\n\tviper.SetConfigFile(\".env\")\n\tviper.SetConfigType(\"env\")\n\tviper.SetEnvPrefix(\"ezptt\") // will be uppercased automatically\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\tif err = viper.ReadInConfig(); err != nil {\n\t\tfmt.Println(\"ReadInConfig:\", err)\n\t}\n\n\terr = viper.Unmarshal(&config)\n\tfmt.Println(\"config:\", config)\n\treturn\n}", "func loadConfig() (*config, error) {\n\tloadConfigError := func(err error) (*config, error) {\n\t\treturn nil, err\n\t}\n\n\t// Default config\n\tcfg := defaultConfig\n\tdefaultConfigNow := defaultConfig\n\n\t// Load settings from environment variables.\n\terr := env.Parse(&cfg)\n\tif err != nil {\n\t\treturn loadConfigError(err)\n\t}\n\n\t// If appdata was specified but not the config file, change the config file\n\t// path, and record this as the new default config file location.\n\tif defaultHomeDir != cfg.HomeDir && defaultConfigNow.ConfigFile == cfg.ConfigFile {\n\t\tcfg.ConfigFile = filepath.Join(cfg.HomeDir, defaultConfigFilename)\n\t\t// Update the defaultConfig to avoid an error if the config file in this\n\t\t// \"new default\" location does not exist.\n\t\tdefaultConfigNow.ConfigFile = cfg.ConfigFile\n\t}\n\n\t// Pre-parse the command line options to see if an alternative config file\n\t// or the version flag was specified. Override any environment variables\n\t// with parsed command line flags.\n\tpreCfg := cfg\n\tpreParser := flags.NewParser(&preCfg, flags.HelpFlag|flags.PassDoubleDash)\n\t_, flagerr := preParser.Parse()\n\n\tif flagerr != nil {\n\t\te, ok := flagerr.(*flags.Error)\n\t\tif !ok || e.Type != flags.ErrHelp {\n\t\t\tpreParser.WriteHelp(os.Stderr)\n\t\t}\n\t\tif ok && e.Type == flags.ErrHelp {\n\t\t\tpreParser.WriteHelp(os.Stdout)\n\t\t\tos.Exit(0)\n\t\t}\n\t\treturn loadConfigError(flagerr)\n\t}\n\n\t// Show the version and exit if the version flag was specified.\n\tappName := filepath.Base(os.Args[0])\n\tappName = strings.TrimSuffix(appName, filepath.Ext(appName))\n\tif preCfg.ShowVersion {\n\t\tfmt.Printf(\"%s version %s (Go version %s)\\n\", appName,\n\t\t\tVersion(), runtime.Version())\n\t\tos.Exit(0)\n\t}\n\n\t// If a non-default appdata folder is specified on the command line, it may\n\t// be necessary adjust the config file location. If the the config file\n\t// location was not specified on the command line, the default location\n\t// should be under the non-default appdata directory. However, if the config\n\t// file was specified on the command line, it should be used regardless of\n\t// the appdata directory.\n\tif defaultHomeDir != preCfg.HomeDir && defaultConfigNow.ConfigFile == preCfg.ConfigFile {\n\t\tpreCfg.ConfigFile = filepath.Join(preCfg.HomeDir, defaultConfigFilename)\n\t\t// Update the defaultConfig to avoid an error if the config file in this\n\t\t// \"new default\" location does not exist.\n\t\tdefaultConfigNow.ConfigFile = preCfg.ConfigFile\n\t}\n\n\t// Load additional config from file.\n\tvar configFileError error\n\t// Config file name for logging.\n\tconfigFile := \"NONE (defaults)\"\n\tparser := flags.NewParser(&cfg, flags.Default)\n\n\t// Do not error default config file is missing.\n\tif _, err := os.Stat(preCfg.ConfigFile); os.IsNotExist(err) {\n\t\t// Non-default config file must exist\n\t\tif defaultConfigNow.ConfigFile != preCfg.ConfigFile {\n\t\t\tfmt.Fprintln(os.Stderr, err)\n\t\t\treturn loadConfigError(err)\n\t\t}\n\t\t// Warn about missing default config file, but continue\n\t\tfmt.Printf(\"Config file (%s) does not exist. Using defaults.\\n\",\n\t\t\tpreCfg.ConfigFile)\n\t} else {\n\t\t// The config file exists, so attempt to parse it.\n\t\terr = flags.NewIniParser(parser).ParseFile(preCfg.ConfigFile)\n\t\tif err != nil {\n\t\t\tif _, ok := err.(*os.PathError); !ok {\n\t\t\t\tfmt.Fprintln(os.Stderr, err)\n\t\t\t\tparser.WriteHelp(os.Stderr)\n\t\t\t\treturn loadConfigError(err)\n\t\t\t}\n\t\t\tconfigFileError = err\n\t\t}\n\t\tconfigFile = preCfg.ConfigFile\n\t}\n\n\t// Parse command line options again to ensure they take precedence.\n\t_, err = parser.Parse()\n\tif err != nil {\n\t\tif e, ok := err.(*flags.Error); !ok || e.Type != flags.ErrHelp {\n\t\t\tparser.WriteHelp(os.Stderr)\n\t\t}\n\t\treturn loadConfigError(err)\n\t}\n\n\t// Create the home directory if it doesn't already exist.\n\tfuncName := \"loadConfig\"\n\terr = os.MkdirAll(cfg.HomeDir, 0700)\n\tif err != nil {\n\t\t// Show a nicer error message if it's because a symlink is linked to a\n\t\t// directory that does not exist (probably because it's not mounted).\n\t\tif e, ok := err.(*os.PathError); ok && os.IsExist(err) {\n\t\t\tif link, lerr := os.Readlink(e.Path); lerr == nil {\n\t\t\t\tstr := \"is symlink %s -> %s mounted?\"\n\t\t\t\terr = fmt.Errorf(str, e.Path, link)\n\t\t\t}\n\t\t}\n\n\t\tstr := \"%s: failed to create home directory: %v\"\n\t\terr := fmt.Errorf(str, funcName, err)\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\treturn nil, err\n\t}\n\n\t// If a non-default appdata folder is specified, it may be necessary to\n\t// adjust the DataDir and LogDir. If these other paths are their defaults,\n\t// they should be modifed to look under the non-default appdata directory.\n\t// If they are not their defaults, the user-specified values should be used.\n\tif defaultHomeDir != cfg.HomeDir {\n\t\tif defaultDataDir == cfg.DataDir {\n\t\t\tcfg.DataDir = filepath.Join(cfg.HomeDir, defaultDataDirname)\n\t\t}\n\t\tif defaultLogDir == cfg.LogDir {\n\t\t\tcfg.LogDir = filepath.Join(cfg.HomeDir, defaultLogDirname)\n\t\t}\n\t}\n\n\t// Warn about missing config file after the final command line parse\n\t// succeeds. This prevents the warning on help messages and invalid\n\t// options.\n\tif configFileError != nil {\n\t\tfmt.Printf(\"%v\\n\", configFileError)\n\t\treturn loadConfigError(configFileError)\n\t}\n\n\t// Choose the active network params based on the selected network. Multiple\n\t// networks can't be selected simultaneously.\n\tnumNets := 0\n\tactiveNet = &netparams.MainNetParams\n\tactiveChain = chaincfg.MainNetParams()\n\tdefaultPort := defaultMainnetPort\n\tif cfg.TestNet {\n\t\tactiveNet = &netparams.TestNet3Params\n\t\tactiveChain = chaincfg.TestNet3Params()\n\t\tdefaultPort = defaultTestnetPort\n\t\tnumNets++\n\t}\n\tif cfg.SimNet {\n\t\tactiveNet = &netparams.SimNetParams\n\t\tactiveChain = chaincfg.SimNetParams()\n\t\tdefaultPort = defaultSimnetPort\n\t\tnumNets++\n\t}\n\tif numNets > 1 {\n\t\tstr := \"%s: the testnet and simnet params can't be \" +\n\t\t\t\"used together -- choose one of the three\"\n\t\terr := fmt.Errorf(str, funcName)\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tparser.WriteHelp(os.Stderr)\n\t\treturn loadConfigError(err)\n\t}\n\n\t// Append the network type to the data directory so it is \"namespaced\" per\n\t// network. In addition to the block database, there are other pieces of\n\t// data that are saved to disk such as address manager state. All data is\n\t// specific to a network, so namespacing the data directory means each\n\t// individual piece of serialized data does not have to worry about changing\n\t// names per network and such.\n\t//\n\t// Make list of old versions of testnet directories here since the network\n\t// specific DataDir will be used after this.\n\tcfg.DataDir = cleanAndExpandPath(cfg.DataDir)\n\tcfg.DataDir = filepath.Join(cfg.DataDir, activeNet.Name)\n\t// Create the data folder if it does not exist.\n\terr = os.MkdirAll(cfg.DataDir, 0700)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlogRotator = nil\n\t// Append the network type to the log directory so it is \"namespaced\"\n\t// per network in the same fashion as the data directory.\n\tcfg.LogDir = cleanAndExpandPath(cfg.LogDir)\n\tcfg.LogDir = filepath.Join(cfg.LogDir, activeNet.Name)\n\n\t// Initialize log rotation. After log rotation has been initialized, the\n\t// logger variables may be used. This creates the LogDir if needed.\n\tif cfg.MaxLogZips < 0 {\n\t\tcfg.MaxLogZips = 0\n\t}\n\tinitLogRotator(filepath.Join(cfg.LogDir, defaultLogFilename), cfg.MaxLogZips)\n\n\tlog.Infof(\"Log folder: %s\", cfg.LogDir)\n\tlog.Infof(\"Config file: %s\", configFile)\n\n\t// Disable dev balance prefetch if network has invalid script.\n\t_, err = dbtypes.DevSubsidyAddress(activeChain)\n\tif !cfg.NoDevPrefetch && err != nil {\n\t\tcfg.NoDevPrefetch = true\n\t\tlog.Warnf(\"%v. Disabling balance prefetch (--no-dev-prefetch).\", err)\n\t}\n\n\t// Validate SyncStatusLimit has been set. Zero means always show sync status\n\t// page instead of full block explorer pages.\n\tif cfg.SyncStatusLimit != 0 {\n\t\t// The sync-status-limit value should not be set to a value less than 2\n\t\t// or greater than maxSyncStatusLimit.\n\t\tif cfg.SyncStatusLimit < 2 || cfg.SyncStatusLimit > maxSyncStatusLimit {\n\t\t\treturn nil, fmt.Errorf(\"sync-status-limit should not be set to \"+\n\t\t\t\t\"a value less than 2 or more than %d\", maxSyncStatusLimit)\n\t\t}\n\t}\n\n\t// Validate block purge options.\n\tif cfg.PurgeNBestBlocks < 0 {\n\t\treturn nil, fmt.Errorf(\"purge-n-blocks must be non-negative\")\n\t}\n\n\t// Set the host names and ports to the default if the user does not specify\n\t// them.\n\tcfg.DcrdServ, err = normalizeNetworkAddress(cfg.DcrdServ, defaultHost, activeNet.JSONRPCClientPort)\n\tif err != nil {\n\t\treturn loadConfigError(err)\n\t}\n\n\t// Output folder\n\tcfg.OutFolder = cleanAndExpandPath(cfg.OutFolder)\n\tcfg.OutFolder = filepath.Join(cfg.OutFolder, activeNet.Name)\n\n\t// Special show command to list supported subsystems and exit.\n\tif cfg.DebugLevel == \"show\" {\n\t\tfmt.Println(\"Supported subsystems\", supportedSubsystems())\n\t\tos.Exit(0)\n\t}\n\n\t// Ensure HTTP profiler is mounted with a valid path prefix.\n\tif cfg.HTTPProfile && (cfg.HTTPProfPath == \"/\" || len(defaultHTTPProfPath) == 0) {\n\t\treturn loadConfigError(fmt.Errorf(\"httpprofprefix must not be \\\"\\\" or \\\"/\\\"\"))\n\t}\n\n\t// Parse, validate, and set debug log level(s).\n\tif cfg.Quiet {\n\t\tcfg.DebugLevel = \"error\"\n\t}\n\n\t// Validate DB timeout. Zero or negative should be set to the large default\n\t// timeout to effectively disable timeouts.\n\tif cfg.PGQueryTimeout <= 0 {\n\t\tcfg.PGQueryTimeout = defaultPGQueryTimeout\n\t}\n\n\t// Parse, validate, and set debug log level(s).\n\tif err := parseAndSetDebugLevels(cfg.DebugLevel); err != nil {\n\t\terr = fmt.Errorf(\"%s: %v\", funcName, err.Error())\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tparser.WriteHelp(os.Stderr)\n\t\treturn loadConfigError(err)\n\t}\n\n\t// Check the supplied APIListen address\n\tif cfg.APIListen == \"\" {\n\t\tcfg.APIListen = defaultHost + \":\" + defaultPort\n\t} else {\n\t\tcfg.APIListen, err = normalizeNetworkAddress(cfg.APIListen, defaultHost, defaultPort)\n\t\tif err != nil {\n\t\t\treturn loadConfigError(err)\n\t\t}\n\t}\n\n\t// Checks if the expected format of the politeia URL was set. It also drops any\n\t// unnecessary parts of the URL.\n\turlPath, err := retrieveRootPath(cfg.PoliteiaURL)\n\tif err != nil {\n\t\treturn loadConfigError(err)\n\t}\n\tcfg.PoliteiaURL = urlPath\n\n\tswitch cfg.ServerHeader {\n\tcase \"off\":\n\t\tcfg.ServerHeader = \"\"\n\tcase \"version\":\n\t\tcfg.ServerHeader = AppName + \"-\" + Version()\n\t}\n\n\t// If detecting real IP from X headers, this implies you are trusting a\n\t// proxy, so we can enable inspecting the other X-Forwarded- headers for\n\t// request host and scheme.\n\tif cfg.UseRealIP {\n\t\tcfg.TrustProxy = true\n\t}\n\n\t// Expand some additional paths.\n\tcfg.DcrdCert = cleanAndExpandPath(cfg.DcrdCert)\n\tcfg.AgendasDBFileName = cleanAndExpandPath(cfg.AgendasDBFileName)\n\tcfg.ProposalsFileName = cleanAndExpandPath(cfg.ProposalsFileName)\n\tcfg.RateCertificate = cleanAndExpandPath(cfg.RateCertificate)\n\tcfg.ChartsCacheDump = cleanAndExpandPath(cfg.ChartsCacheDump)\n\n\t// Clean up the provided mainnet and testnet links, ensuring there is a single\n\t// trailing slash.\n\tcfg.MainnetLink = strings.TrimSuffix(cfg.MainnetLink, \"/\") + \"/\"\n\tcfg.TestnetLink = strings.TrimSuffix(cfg.TestnetLink, \"/\") + \"/\"\n\n\treturn &cfg, nil\n}", "func LoadConfig(configFile string) (*Configuration, error) {\n\tsetConfigDefaults()\n\n\tif len(configFile) > 0 {\n\t\tviper.SetConfigFile(configFile)\n\t} else {\n\t\tviper.SetConfigName(\"copyql\")\n\t\tviper.AddConfigPath(\".\")\n\t}\n\n\tviper.SetEnvPrefix(\"copyql\")\n\tviper.AutomaticEnv()\n\n\tviper.SetEnvKeyReplacer(strings.NewReplacer(\".\", \"_\"))\n\n\tviper.ReadInConfig()\n\n\tvar config Configuration\n\terr := viper.Unmarshal(&config)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &config, nil\n}", "func LoadConfig(configPaths ...string) error {\n\tv := viper.New()\n\n\t// Postgreslq config\n\tv.SetDefault(\"db_max_open_conns\", 5)\n\tv.SetDefault(\"db_conn_exec_timeout\", 3000000)\n\tv.SetDefault(\"db_max_idle_conns_rate\", 0.5)\n\tv.SetDefault(\"db_conn_max_lifetime\", time.Minute*30)\n\n\t// Server port\n\tv.SetDefault(\"server_port\", 9393)\n\tv.SetDefault(\"address\", \"http://localhost:9393\")\n\tv.SetDefault(\"access_token_TTL\", 8)\n\tv.SetDefault(\"jwt_signing_method\", \"HS256\")\n\n\tlogrus.Infof(\"Load configuration in DEV mode\")\n\tv.SetConfigName(\"app\")\n\tv.SetConfigType(\"yaml\")\n\tv.AutomaticEnv()\n\tfor _, path := range configPaths {\n\t\tv.AddConfigPath(path)\n\t}\n\tif err := v.ReadInConfig(); err != nil {\n\t\treturn fmt.Errorf(\"Failed to read the configuration file: %s\", err)\n\t}\n\n\tif err := v.Unmarshal(&Config); err != nil {\n\t\treturn err\n\t}\n\n\treturn Config.Validate()\n}", "func (c *Contexter) LoadConfig() (error){\n\tnewContext := new(Context)\n\terr := c.configurator.Load(newContext)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !newContext.validate(c.mode) {\n\t\treturn errors.Errorf(\"invalid config\")\n\t}\n\tmutableMutex.Lock()\n defer mutableMutex.Unlock()\n\tc.replaceContext(newContext)\n\treturn nil\n}", "func LoadConfig(parentPath string, container string, env string, fileNames ...string) ServiceConfig {\n\tviper.AutomaticEnv()\n\tviper.SetEnvKeyReplacer(strings.NewReplacer(\"-\", \"_\", \".\", \"_\"))\n\tviper.SetConfigType(\"yaml\")\n\n\tfor _, fileName := range fileNames {\n\t\tviper.SetConfigName(fileName)\n\t}\n\n\tviper.AddConfigPath(\"./\" + container + \"/\")\n\tif len(parentPath) > 0 {\n\t\tviper.AddConfigPath(\"./\" + parentPath + \"/\" + container + \"/\")\n\t}\n\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tswitch err.(type) {\n\t\tcase viper.ConfigFileNotFoundError:\n\t\t\tlog.Println(\"config file not found\")\n\t\tdefault:\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tif len(env) > 0 {\n\t\tenv2 := strings.ToLower(env)\n\t\tfor _, fileName2 := range fileNames {\n\t\t\tname := fileName2 + \"-\" + env2\n\t\t\tviper.SetConfigName(name)\n\t\t\tviper.MergeInConfig()\n\t\t}\n\t}\n\tvar c ServiceConfig\n\tbindEnvs(c)\n\tviper.Unmarshal(&c)\n\treturn c\n}", "func loadFromEnvvar() (*Config, error) {\n\t// App\n\tappServerPort, _ := strconv.Atoi(GetEnvOrDef(\"POSLAN_SERVER_PORT\", \"8080\"))\n\tappLogLevel := GetEnvOrDef(\"POSLAN_LOG_LEVEL\", \"debug\")\n\tproviders := loadProvidersFromEnvars()\n\n\tapp := AppConfig{\n\t\tServerPort: appServerPort,\n\t\tLogLevel: logLevel(appLogLevel),\n\t}\n\n\tmailers := MailerConfig{\n\t\tProviders: providers,\n\t}\n\n\tcfg := &Config{\n\t\tApp: app,\n\t\tMailer: mailers,\n\t}\n\n\treturn cfg, nil\n}", "func loadConfig(confName string, conf interface{}) (interface{}, error) {\n\tpwd := logs.GetCurrentDirectory()\n\tfile, err := os.Open(pwd + \"/\" + confName)\n\tif err != nil {\n\t\tlogs.GetLogger().Error(\"Open monitor configuration file error\", zap.Error(err))\n\t\treturn nil, error2.Errors.NoConfigFileFound\n\t}\n\tdefer file.Close()\n\n\tdecoder := jsoniter.ConfigCompatibleWithStandardLibrary.NewDecoder(file)\n\terr = decoder.Decode(&conf)\n\tif err != nil {\n\t\tlogs.GetLogger().Error(\"Parsing monitor configuration file error\", zap.Error(err))\n\t\treturn nil, error2.Errors.ConfigFileValidationError\n\t}\n\tlogs.GetLogger().Info(\"Successfully loaded monitor configuration file\")\n\treturn conf, nil\n}", "func loadEnvironmentConfig(env string) types.Options {\n\tconfigFile := \"config/\" + ServiceName + \"/\" + env + \".json\"\n\tif _, err := os.Stat(configFile); os.IsNotExist(err) {\n\t\tpanic(err)\n\t}\n\treturn parseConfigFile(configFile)\n}", "func loadConfig() error {\n\t// load template config\n\tif err := config.LoadConfig(\"assets/config.tpl.json\"); err != nil {\n\t\treturn err\n\t}\n\n\t// load custom config\n\tif err := config.LoadConfig(\"config.json\"); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func LoadConfig() {\n\tviper.SetEnvPrefix(\"yestea\")\n\tviper.AutomaticEnv()\n\n\tviper.SetConfigType(\"yaml\")\n\tviper.AddConfigPath(RootPath() + \"config\")\n\n\tviper.SetConfigName(\"config\")\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tpanic(fmt.Errorf(\"read common config failed: [%s]\", err))\n\t}\n\n\tenv := viper.GetString(\"ENV\")\n\tif env == \"\" {\n\t\tviper.SetConfigName(\"dev\")\n\t}\n\tviper.SetConfigName(env)\n\tif err := viper.MergeInConfig(); err != nil {\n\t\tpanic(fmt.Errorf(\"merge environment config failed: [%s]\", err))\n\t}\n}", "func Load() (Config, error) {\n\tvar c Config\n\terr := envconfig.Process(\"ferrum\", &c)\n\tif err != nil {\n\t\treturn Config{}, fmt.Errorf(\"failed to parse configuration env vars: %v\", err)\n\t}\n\n\tc.LogLevel, err = log.ParseLevel(c.LogLevelRaw)\n\tif err != nil {\n\t\treturn Config{}, fmt.Errorf(\"failed to parse log level: %v\", err)\n\t}\n\n\tc.Version = version\n\tc.BuildDate = buildDate\n\n\treturn c, nil\n}", "func LoadConfig(configpath string) *viper.Viper {\n\tvar conf Config\n\tviperCfg := viper.New()\n\tviperCfg.SetConfigName(\"dev\")\n\tviperCfg.AddConfigPath(configpath)\n\tviperCfg.AutomaticEnv()\n\tviperCfg.SetConfigType(\"yml\")\n\t// configPath := \"${path}/config/config.yml\"\n\n\tif err := viperCfg.ReadInConfig(); err != nil {\n\t\tfmt.Printf(\"Failed to read the config file %s\", err)\n\t}\n\n\tif err := viperCfg.Unmarshal(&conf); err != nil {\n\t\tfmt.Printf(\"Failed to read the config file %s\", err)\n\t}\n\n\tviperCfg.WatchConfig()\n\n\treturn viperCfg\n}", "func loadConfig(opt options) (original, cfg LocalConfig) {\n\tcfg, err := LoadConfigFile(opt.configPath)\n\tif err != nil {\n\t\tlog.Printf(\"unable to load config file: %q\\n\", opt.configPath)\n\t\tcfg = NewConfig()\n\t}\n\toriginal = cfg\n\n\t// Override any store specific settings.\n\tif opt.s3Region != \"\" {\n\t\tcfg.Store.S3Region = opt.s3Region\n\t}\n\tif opt.s3Bucket != \"\" {\n\t\tcfg.Store.S3Bucket = opt.s3Bucket\n\t}\n\tif opt.awsAccessKey != \"\" {\n\t\tcfg.Store.AWSAccessKey = opt.awsAccessKey\n\t}\n\tif opt.awsSecretKey != \"\" {\n\t\tcfg.Store.AWSSecretKey = opt.awsSecretKey\n\t}\n\n\treturn\n}", "func LoadConfig(fileName string) error {\n\n\tfile, err := os.Open(fileName)\n\tif err != nil {\n\t\tappError := models.NewAppError(\"LoadConfig\", \"utils.config.load_conifg.open_file: \", err.Error(), 500)\n\t\treturn appError\n\t}\n\n\tdecoder := json.NewDecoder(file)\n\tconfig := models.Config{}\n\terr = decoder.Decode(&config)\n\tif err != nil {\n\t\tappError := models.NewAppError(\"LoadConfig\", \"utils.config.load_config.decode_json: \", err.Error(), 500)\n\t\treturn appError\n\t}\n\n\tconfig.SetDefaults()\n\n\tCfg = &config\n\n\treturn nil\n}", "func LoadConfig(fileLocation string, vip *viper.Viper) (err error) {\n\tlog.Info(\"Parsing config file at location: %s\", fileLocation)\n\n\tif fileLocation == \"\" {\n\t\tfileLocation = defaultConfigFileName\n\t}\n\n\tvip.SetConfigFile(fileLocation)\n\terr = vip.ReadInConfig()\n\n\tif err != nil {\n\t\tif fileLocation != defaultConfigFileName {\n\t\t\tlog.Warning(\"failed loading %v trying %v\", fileLocation, defaultConfigFileName)\n\t\t\tvip.SetConfigFile(defaultConfigFileName)\n\t\t\terr = vip.ReadInConfig()\n\t\t}\n\t\t// we change err so check again\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to read config file %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}", "func loadConfig(confLocation string) (Config, error) {\n\tvar err error\n\tvar conf Config\n\tvar reader io.Reader\n\n\t//\tcheck for http prefix\n\tif strings.HasPrefix(confLocation, \"http\") {\n\t\tlog.Printf(\"Loading remote config (%v)\", confLocation)\n\n\t\t//\tsetup http client with a timeout\n\t\tvar httpClient = &http.Client{\n\t\t\tTimeout: time.Second * 10,\n\t\t}\n\n\t\t//\tmake the http request\n\t\tres, err := httpClient.Get(confLocation)\n\t\tif err != nil {\n\t\t\treturn conf, fmt.Errorf(\"error fetching remote config file (%v): %v \", confLocation, err)\n\t\t}\n\n\t\t//\tset the reader to the response body\n\t\treader = res.Body\n\t} else {\n\t\tlog.Printf(\"Loading local config (%v)\", confLocation)\n\n\t\t//\tcheck the conf file exists\n\t\tif _, err := os.Stat(confLocation); os.IsNotExist(err) {\n\t\t\treturn conf, fmt.Errorf(\"config file at location (%v) not found!\", confLocation)\n\t\t}\n\n\t\t//\topen the confi file\n\t\treader, err = os.Open(confLocation)\n\t\tif err != nil {\n\t\t\treturn conf, fmt.Errorf(\"error opening local config file (%v): %v \", confLocation, err)\n\t\t}\n\t}\n\n\t//\tdecode conf file\n\tif _, err := toml.DecodeReader(reader, &conf); err != nil {\n\t\treturn conf, err\n\t}\n\n\treturn conf, nil\n}", "func loadConfig() {\n\tr, err := os.Open(configPath)\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't open config file!\")\n\t}\n\tdefer r.Close()\n\tdec := json.NewDecoder(r)\n\tdec.Decode(&config)\n\n\tlog.Printf(\"Config.DBAddress: %s\\n\", config.DBAddress)\n\tlog.Printf(\"Config.WorkersNo: %d\\n\", config.WorkersNo)\n\tlog.Printf(\"Config.ClearDb: %t\\n\", config.ClearDb)\n\tlog.Printf(\"Config.From: %s\\n\", config.From)\n\tlog.Printf(\"Config.To: %s\\n\", config.To)\n\tlog.Printf(\"Config.Currency: %s\\n\", config.Currency)\n\tlog.Printf(\"Config.SupportedCurrencies: %v\\n\", config.Currencies)\n}", "func LoadConfig(path string) {\n\tConf = *NewConfigByPath(path)\n}", "func LoadConfig(fpath string) (*PinoyConfig, error) {\n\tcontent, err := ioutil.ReadFile(fpath)\n\tif err != nil {\n\t\tlog.Println(\"Config:ERROR: Failed to read config file:\", err)\n\t\treturn nil, err\n\t}\n\n\tvar cfg PinoyConfig\n\terr = json.Unmarshal(content, &cfg)\n\tif err != nil {\n\t\tlog.Println(\"Config:ERROR: Failed to unmarshal config file:\", err)\n\t}\n\tcfg.NormalizeConfig()\n\treturn &cfg, nil\n}", "func loadConfig(file string) error {\n\tf, err := os.Open(file) // Open file\n\n\t// Error checking, returns error\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close() // Defer file closing to end of function\n\n\tdecoder := json.NewDecoder(f) // Create json decoder\n\terr = decoder.Decode(&cfg) // Decode the json into the config struct\n\n\t// Error checking\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (c *Config) LoadConfig(path string, v interface{}) error {\n // get config map\n resMap, err := c.LoadFile(path)\n if err != nil {\n return err\n }\n // parse map to struct\n err = c.parseMap(resMap, v)\n if err != nil {\n return err\n }\n return nil\n}", "func loadConfig() (Config, error) {\n\t// We're looking for a file named \"stee.yaml\"\n\tviper.SetConfigName(\"stee\")\n\tviper.SetConfigType(\"yaml\")\n\n\t// In those directories\n\tviper.AddConfigPath(\".\")\n\tviper.AddConfigPath(\"/etc/stee/\")\n\n\t// Environement variables take precedence over file config. See https://github.com/spf13/viper#why-viper\n\tviper.AutomaticEnv()\n\n\t// Defaults are the less important values. https://github.com/spf13/viper#why-viper\n\tsetConfigDefaults()\n\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\n\tvar cfg Config\n\terr = viper.Unmarshal(&cfg)\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\n\treturn cfg, err\n}", "func LoadConfig(prefix string) (*Config, error) {\n\tres := &Config{}\n\treturn res, errors.Wrap(envconfig.Process(prefix, res), \"parse config\")\n}", "func (m *Meta) loadConfig(rootDir string) (*configs.Config, tfdiags.Diagnostics) {\n\tvar diags tfdiags.Diagnostics\n\trootDir = m.normalizePath(rootDir)\n\n\tloader, err := m.initConfigLoader()\n\tif err != nil {\n\t\tdiags = diags.Append(err)\n\t\treturn nil, diags\n\t}\n\n\tconfig, hclDiags := loader.LoadConfig(rootDir)\n\tdiags = diags.Append(hclDiags)\n\treturn config, diags\n}", "func Load(conf interface{}, envPrefix string, cfgFile string) error {\n\t// Apply defaults first\n\tdefaults.SetDefaults(conf)\n\n\t// Uppercase the prefix\n\tupPrefix := strings.ToUpper(envPrefix)\n\n\t// Overrides with environment\n\tfor k := range AsEnvVariables(conf, \"\", false) {\n\t\tenvName := fmt.Sprintf(\"%s_%s\", upPrefix, k)\n\t\tviper.BindEnv(strings.ToLower(strings.Replace(k, \"_\", \".\", -1)), envName)\n\t}\n\n\t// Apply file settings\n\tif cfgFile != \"\" {\n\t\t// If the config file doesn't exists, let's exit\n\t\tif _, err := os.Stat(cfgFile); os.IsNotExist(err) {\n\t\t\treturn xerrors.Errorf(\"Unable to open non-existing file '%s': %w\", cfgFile, err)\n\t\t}\n\n\t\tlog.Info(\"Load settings from file\", \"path\", cfgFile)\n\n\t\tviper.SetConfigName(\"config\")\n\t\tviper.SetConfigType(\"yaml\")\n\t\tviper.SetConfigFile(cfgFile)\n\t\tif err := viper.ReadInConfig(); err != nil {\n\t\t\treturn xerrors.Errorf(\"Unable to decode config file '%s': %w\", cfgFile, err)\n\t\t}\n\t}\n\n\t// Update viper values\n\tif err := viper.Unmarshal(conf); err != nil {\n\t\treturn xerrors.Errorf(\"Unable to apply config '%s': %w\", cfgFile, err)\n\t}\n\n\t// No error\n\treturn nil\n}", "func loadConfig(path string) Config {\n\tvar config Config\n\tviper.SetConfigName(\"config\")\n\tviper.AddConfigPath(path)\n\terr := viper.ReadInConfig() // Find and read the config file\n\tif err != nil { // Handle errors reading the config file\n\t\tpanic(fmt.Errorf(\"Fatal error config file: %s\", err))\n\t}\n\terr = viper.Unmarshal(&config)\n\thandleErr(err)\n\treturn config\n}", "func loadConfig(c *cli.Context, file string, kmsEncryptionContext map[string]*string) (*config.Config, error) {\n\tvar err error\n\tvar configPath string\n\tif c.String(\"config\") != \"\" {\n\t\tconfigPath = c.String(\"config\")\n\t} else {\n\t\t// Ignore config not found errors returned from FindConfigFile since the config file is not mandatory\n\t\tconfigPath, err = config.FindConfigFile(\".\")\n\t\tif err != nil {\n\t\t\t// If we can't find a config file, but we were not explicitly requested to, assume it does not exist\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\tconf, err := config.LoadForFile(configPath, file, kmsEncryptionContext)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn conf, nil\n}", "func loadEnv() Configuration {\n\thistorySize := 10\n\thistorySizeStr := os.Getenv(\"HISTORY_SIZE\")\n\tif historySizeStr != \"\" {\n\t\thistorySize , _ = strconv.Atoi(historySizeStr)\n\t}\n\tthreads := 10\n\tthreadsStr := os.Getenv(\"THREADS\")\n\tif threadsStr != \"\" {\n\t\tthreads, _ = strconv.Atoi(threadsStr)\n\t}\n\tserverUrl := os.Getenv(\"SERVER_URL\")\n\tif serverUrl == \"\" {\n\t\tserverUrl = \":9000\"\n\t}\n\tclientUrl := os.Getenv(\"CLIENT_URL\")\n\tif clientUrl == \"\" {\n\t\tclientUrl = \":9001\"\n\t}\n\treturn Configuration{\n\t\tHistorySize: historySize,\n\t\tClientUrl: clientUrl,\n\t\tServerUrl: serverUrl,\n\t\tThreads: threads}\n}", "func (c *Container) LoadConfig() error {\n\tfilename := filepath.Join(containerPath, c.Digest, containerConfigFile)\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\tconfigFile, err := v1.ParseConfigFile(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.Config = configFile.Config.DeepCopy()\n\treturn nil\n}", "func readConfig() {\n\tconfigPath := io.FixPrefixPath(viper.GetString(\"datadir\"), viper.GetString(\"config\"))\n\n\tif io.FileExists(configPath) {\n\t\tmergeLocalConfig(configPath)\n\t} else {\n\t\tfmt.Println(\"config file not exist \", configPath)\n\t\tmergeOnlineConfig(viper.GetString(\"config\"))\n\t}\n\n\t// load injected config from ogbootstrap if any\n\tinjectedPath := io.FixPrefixPath(viper.GetString(\"datadir\"), \"injected.toml\")\n\tif io.FileExists(injectedPath) {\n\t\tmergeLocalConfig(injectedPath)\n\t}\n\n\tmergeEnvConfig()\n\tb, err := common.PrettyJson(viper.AllSettings())\n\tpanicIfError(err, \"dump json\")\n\tfmt.Println(b)\n}", "func LoadConfig() (*Config, error) {\n\tvar config Config\n\tif err := envconfig.Process(\"\", &config); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &config, nil\n}", "func loadConfig() {\n\tvar err error\n\n\tswitch {\n\tcase !fsutil.IsExist(CONFIG_FILE):\n\t\tprintErrorAndExit(\"Configuration file %s does not exist\", CONFIG_FILE)\n\n\tcase !fsutil.IsReadable(CONFIG_FILE):\n\t\tprintErrorAndExit(\"Configuration file %s is not readable\", CONFIG_FILE)\n\n\tcase !fsutil.IsNonEmpty(CONFIG_FILE):\n\t\tprintErrorAndExit(\"Configuration file %s is empty\", CONFIG_FILE)\n\t}\n\n\terr = knf.Global(CONFIG_FILE)\n\n\tif err != nil {\n\t\tprintErrorAndExit(err.Error())\n\t}\n}", "func LoadConfig(filePath string) (*MainConfig, error) {\n\tcfg := MainConfig{}\n\tif filePath != \"\" {\n\t\terr := readFile(&cfg, filePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\terr := readEnv(&cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &cfg, nil\n}", "func (a *appState) loadConfigFile(ctx context.Context) error {\n\tcfgPath := a.configPath()\n\n\tif _, err := os.Stat(cfgPath); err != nil {\n\t\t// don't return error if file doesn't exist\n\t\treturn nil\n\t}\n\n\t// read the config file bytes\n\tfile, err := os.ReadFile(cfgPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading file: %w\", err)\n\t}\n\n\t// unmarshall them into the wrapper struct\n\tcfgWrapper := &ConfigInputWrapper{}\n\terr = yaml.Unmarshal(file, cfgWrapper)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error unmarshalling config: %w\", err)\n\t}\n\n\t// retrieve the runtime configuration from the disk configuration.\n\tnewCfg, err := cfgWrapper.RuntimeConfig(ctx, a)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// validate runtime configuration\n\tif err := newCfg.validateConfig(); err != nil {\n\t\treturn fmt.Errorf(\"error parsing chain config: %w\", err)\n\t}\n\n\t// save runtime configuration in app state\n\ta.config = newCfg\n\n\treturn nil\n}", "func LoadConfig() (*Config, error) {\n\tvar cfg Config\n\n\terr := envconfig.Process(\"\", &cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &cfg, nil\n}", "func readConfig() (*config, error) {\n\tcfgPath := *configPath\n\tuserSpecified := *configPath != \"\"\n\n\tvar homeDir string\n\tif testHomeDir != \"\" {\n\t\thomeDir = testHomeDir\n\t} else {\n\t\tu, err := user.Current()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thomeDir = u.HomeDir\n\t}\n\n\tif !userSpecified {\n\t\tcfgPath = filepath.Join(homeDir, \"src-config.json\")\n\t} else if strings.HasPrefix(cfgPath, \"~/\") {\n\t\tcfgPath = filepath.Join(homeDir, cfgPath[2:])\n\t}\n\tdata, err := os.ReadFile(os.ExpandEnv(cfgPath))\n\tif err != nil && (!os.IsNotExist(err) || userSpecified) {\n\t\treturn nil, err\n\t}\n\tvar cfg config\n\tif err == nil {\n\t\tcfg.ConfigFilePath = cfgPath\n\t\tif err := json.Unmarshal(data, &cfg); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tenvToken := os.Getenv(\"SRC_ACCESS_TOKEN\")\n\tenvEndpoint := os.Getenv(\"SRC_ENDPOINT\")\n\n\tif userSpecified {\n\t\t// If a config file is present, either zero or both environment variables must be present.\n\t\t// We don't want to partially apply environment variables.\n\t\tif envToken == \"\" && envEndpoint != \"\" {\n\t\t\treturn nil, errConfigMerge\n\t\t}\n\t\tif envToken != \"\" && envEndpoint == \"\" {\n\t\t\treturn nil, errConfigMerge\n\t\t}\n\t}\n\n\t// Apply config overrides.\n\tif envToken != \"\" {\n\t\tcfg.AccessToken = envToken\n\t}\n\tif envEndpoint != \"\" {\n\t\tcfg.Endpoint = envEndpoint\n\t}\n\tif cfg.Endpoint == \"\" {\n\t\tcfg.Endpoint = \"https://sourcegraph.com\"\n\t}\n\n\tcfg.AdditionalHeaders = parseAdditionalHeaders()\n\t// Ensure that we're not clashing additonal headers\n\t_, hasAuthorizationAdditonalHeader := cfg.AdditionalHeaders[\"authorization\"]\n\tif cfg.AccessToken != \"\" && hasAuthorizationAdditonalHeader {\n\t\treturn nil, errConfigAuthorizationConflict\n\t}\n\n\t// Lastly, apply endpoint flag if set\n\tif endpoint != nil && *endpoint != \"\" {\n\t\tcfg.Endpoint = *endpoint\n\t}\n\n\tcfg.Endpoint = cleanEndpoint(cfg.Endpoint)\n\n\treturn &cfg, nil\n}", "func Load(appName string) (*Configuration, error) {\n\tvar cfg Configuration\n\tif err := envconfig.Process(appName, &cfg); err != nil {\n\t\treturn nil, fmt.Errorf(\"error loading configuration for %s: %s\", appName, err)\n\t}\n\n\treturn &cfg, nil\n}", "func LoadConfig(filePath string) (Config, error) {\n\tdata, err := ioutil.ReadFile(filePath)\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\n\tvar conf = Config{}\n\n\terr = json.Unmarshal(data, &conf)\n\n\tlog.Println(conf)\n\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\n\tvar abs string\n\tabs, err = filepath.Abs(conf.MocksRootDir)\n\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\n\tconf.MocksRootDir = abs\n\n\tabs, err = filepath.Abs(conf.LogsPath)\n\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\n\tconf.LogsPath = abs\n\n\treturn conf, nil\n}", "func (appConfig *AppConfiguration) Load(filename string) {\n\n\tif filename != \"\" {\n\t\t// Use config file from the flag.\n\t\tappConfig.viper.SetConfigFile(filename)\n\t} else {\n\t\t// Find home directory.\n\t\thome, err := homedir.Dir()\n\t\tif err != nil {\n\t\t\tglog.Errorf(\"Error determining home directory: %v\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\t// Search config in home directory with name \".restic-manager\" (without extension).\n\t\tappConfig.viper.AddConfigPath(home)\n\t\tappConfig.viper.SetConfigName(\".restic-manager\")\n\t}\n\n\tappConfig.viper.AutomaticEnv() // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := appConfig.viper.ReadInConfig(); err != nil {\n\t\tglog.Errorf(\"Could not load application configuration from %v: %v\", filename, err)\n\t} else {\n\t\tglog.Debugf(\"Using config file: %s\", appConfig.viper.ConfigFileUsed())\n\t}\n}", "func loadConfig() *conf.ConfigFile {\n\tc := conf.NewConfigFile()\n\tglobal, err := os.Open(GlobalConfig)\n\tif err == nil {\n\t\tdefer global.Close()\n\t\tif err = c.Read(global); err != nil {\n\t\t\tlog.Fatalln(\"ERROR: reading global config: \", err)\n\t\t\treturn c\n\t\t}\n\t}\n\n\thome := os.Getenv(\"HOME\")\n\tuser, err := os.Open(filepath.Join(home, UserConfig))\n\tif err == nil {\n\t\tdefer user.Close()\n\t\tif err = c.Read(user); err != nil {\n\t\t\tlog.Fatalln(\"ERROR: reading per user config: \", err)\n\t\t\treturn c\n\t\t}\n\t}\n\n\treturn c\n}", "func LoadConfig(path string) (config Config, err error) {\n\tviper.AddConfigPath(path)\n\tviper.SetConfigName(\"app\")\n\tviper.SetConfigType(\"env\")\n\n\tviper.AutomaticEnv()\n\n\terr = viper.ReadInConfig()\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = viper.Unmarshal(&config)\n\treturn\n}", "func LoadConfig(path string) (config Config, err error) {\n\tviper.AddConfigPath(path)\n\tviper.SetConfigName(\"app\")\n\tviper.SetConfigType(\"env\")\n\n\tviper.AutomaticEnv()\n\n\terr = viper.ReadInConfig()\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = viper.Unmarshal(&config)\n\treturn\n}", "func LoadConfig(path string) (config Config, err error) {\n\tviper.AddConfigPath(path)\n\tviper.SetConfigName(\"app\")\n\tviper.SetConfigType(\"env\")\n\n\tviper.AutomaticEnv()\n\n\terr = viper.ReadInConfig()\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = viper.Unmarshal(&config)\n\treturn\n}", "func Load() (Config, error) {\n\t// STEP 1: try to load config file from SCW_CONFIG_PATH\n\tconfigPath := os.Getenv(scwConfigPathEnv)\n\tif configPath != \"\" {\n\t\tcontent, err := ioutil.ReadFile(configPath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot read config file %s: %s\", scwConfigPathEnv, err)\n\t\t}\n\t\tconfV1, err := unmarshalConfV1(content)\n\t\tif err == nil {\n\t\t\t// do not migrate automatically when using SCW_CONFIG_PATH\n\t\t\tlogger.Warningf(\"loaded config V1 from %s: config V1 is deprecated, please switch your config file to the V2: %s\", configPath, documentationLink)\n\t\t\treturn confV1.toV2().catchInvalidProfile()\n\t\t}\n\t\tconfV2, err := unmarshalConfV2(content)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"content of config file %s is invalid: %s\", configPath, err)\n\t\t}\n\n\t\tlogger.Infof(\"successfully loaded config V2 from %s\", configPath)\n\t\treturn confV2.catchInvalidProfile()\n\t}\n\n\t// STEP 2: try to load config file V2\n\tv2Path, v2PathOk := GetConfigV2FilePath()\n\tif v2PathOk && fileExist(v2Path) {\n\t\tfile, err := ioutil.ReadFile(v2Path)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot read config file: %s\", err)\n\t\t}\n\n\t\tconfV2, err := unmarshalConfV2(file)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"content of config file %s is invalid: %s\", v2Path, err)\n\t\t}\n\n\t\tlogger.Infof(\"successfully loaded config V2 from %s\", v2Path)\n\t\treturn confV2.catchInvalidProfile()\n\t}\n\n\t// STEP 3: try to load config file V1\n\tlogger.Debugf(\"no config V2 found, fall back to config V1\")\n\tv1Path, v1PathOk := GetConfigV1FilePath()\n\tif !v1PathOk {\n\t\tlogger.Infof(\"config file not found: no home directory\")\n\t\treturn (&configV2{}).catchInvalidProfile()\n\t}\n\tfile, err := ioutil.ReadFile(v1Path)\n\tif err != nil {\n\t\tlogger.Infof(\"cannot read config file: %s\", err)\n\t\treturn (&configV2{}).catchInvalidProfile() // ignore if file doesn't exist\n\t}\n\tconfV1, err := unmarshalConfV1(file)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"content of config file %s is invalid json: %s\", v1Path, err)\n\t}\n\n\t// STEP 4: migrate V1 config to V2 config file\n\tif v2PathOk {\n\t\terr = migrateV1toV2(confV1, v2Path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn confV1.toV2().catchInvalidProfile()\n}", "func LoadConfig(path string, configFileName string) *Configuration {\n\tconfig := viper.New()\n\n\tconfig.AutomaticEnv()\n\tconfig.SetEnvPrefix(\"AL\")\n\tconfig.SetDefault(\"APP_NAME\", \"AssetsLiabilities\")\n\tconfig.SetDefault(\"MODE\", DefaultMode)\n\tconfig.SetDefault(\"DOMAIN\", \"https://kwmassetsliabilities.com\")\n\t// Don't want to worry about CORS right now\n\tconfig.SetDefault(\"ALLOWABLE_ORIGIN\", \"*\")\n\n\tconfig.SetDefault(\"ADDRESS\", \"127.0.0.1\")\n\tconfig.SetDefault(\"PORT\", \"8080\")\n\n\tconfig.SetDefault(\"DB_HOST\", \"localhost\")\n\tconfig.SetDefault(\"DB_PORT\", \"5432\")\n\tconfig.SetDefault(\"DB_NAME\", \"postgres\")\n\tconfig.SetDefault(\"DB_USER\", \"postgres\")\n\tconfig.SetDefault(\"DB_PASSWORD\", \"postgres\")\n\tconfig.SetDefault(\"DB_SSL_MODE\", \"disable\")\n\n\tconfig.SetDefault(\"SESSION_SECRET\", \"\")\n\tconfig.SetDefault(\"SESSION_EXPIRE_IN\", \"40000s\")\n\tconfig.SetDefault(\"DEBUG_MODE\", \"false\")\n\n\tconfig.SetDefault(\"READ_TIMEOUT_IN_SECONDS\", \"15s\")\n\tconfig.SetDefault(\"WRITE_TIMEOUT_IN_SECONDS\", \"15s\")\n\n\treturn &Configuration{\n\t\tAppName: config.GetString(\"APP_NAME\"),\n\t\tMode: config.GetString(\"MODE\"),\n\t\tDomain: config.GetString(\"DOMAIN\"),\n\t\tAllowableOrigin: config.GetString(\"ALLOWABLE_ORIGIN\"),\n\n\t\tAddress: config.GetString(\"ADDRESS\"),\n\t\tPort: config.GetInt32(\"PORT\"),\n\n\t\tDBHost: config.GetString(\"DB_HOST\"),\n\t\tDBPort: config.GetInt32(\"DB_PORT\"),\n\t\tDBName: config.GetString(\"DB_NAME\"),\n\t\tDBUser: config.GetString(\"DB_USER\"),\n\t\tDBPassword: config.GetString(\"DB_PASSWORD\"),\n\t\tDBSSLMode: config.GetString(\"DB_SSL_MODE\"),\n\n\t\tDebugMode: config.GetBool(\"DEBUG_MODE\"),\n\n\t\tSessionSecret: config.GetString(\"SESSION_SECRET\"),\n\t\tSessionExpireIn: config.GetDuration(\"SESSION_EXPIRE_IN\"),\n\n\t\tReadTimeoutInSeconds: config.GetDuration(\"READ_TIMEOUT_IN_SECONDS\"),\n\t\tWriteTimeoutInSeconds: config.GetDuration(\"WRITE_TIMEOUT_IN_SECONDS\"),\n\t}\n}", "func LoadConfig(appName string) {\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\t\treadConfig(\"/etc/\", appName)\n\t\treadConfig(os.ExpandEnv(\"$HOME\"), appName)\n\tcase \"windows\":\n\t\treadConfig(os.ExpandEnv(\"$ALLUSERSPROFILE\"), appName)\n\t\treadConfig(os.ExpandEnv(\"$APPDATA\"), appName)\n\tdefault:\n\t\tvlog.Warn(\"App:Config\", \"Unsupported operating system\")\n\t}\n\treadConfig(GetExecDir(), appName)\n}", "func LoadConfig(filename string) (*Configuration, error) {\n\tif err := loadEnvironment(filename); err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfig := new(Configuration)\n\tif err := envconfig.Process(\"oe\", config); err != nil {\n\t\treturn nil, err\n\t}\n\tconfig.ApplyDefaults()\n\treturn config, nil\n}" ]
[ "0.7223439", "0.722297", "0.71862006", "0.71744114", "0.7138698", "0.7075792", "0.70620877", "0.69731885", "0.69388396", "0.68734336", "0.68586993", "0.6851916", "0.6850344", "0.684288", "0.68320143", "0.6828521", "0.68100923", "0.6797417", "0.6796891", "0.6795742", "0.67936856", "0.6785101", "0.6781541", "0.67756313", "0.67576504", "0.6716471", "0.67125636", "0.6700643", "0.668861", "0.668203", "0.6681939", "0.6673131", "0.6672992", "0.6670928", "0.6664617", "0.66632915", "0.66606605", "0.66515195", "0.6642683", "0.66383195", "0.6636609", "0.66351944", "0.66348803", "0.66272086", "0.6602822", "0.6600275", "0.6598526", "0.6591603", "0.6588364", "0.6586358", "0.65841407", "0.65750563", "0.6568213", "0.6562253", "0.65577745", "0.6556494", "0.65403605", "0.653748", "0.6535793", "0.6530636", "0.65284", "0.6527074", "0.65262926", "0.65235406", "0.6523303", "0.652325", "0.65221924", "0.6514864", "0.65099365", "0.6508574", "0.64977443", "0.6494539", "0.64943576", "0.6494352", "0.648991", "0.6489514", "0.6485949", "0.6480864", "0.6480384", "0.6480172", "0.6479836", "0.6475703", "0.6471706", "0.64671075", "0.64603555", "0.6458597", "0.6457333", "0.6456238", "0.6450919", "0.6445971", "0.64426154", "0.6433374", "0.6428511", "0.6427637", "0.6427637", "0.6427637", "0.64270985", "0.6426351", "0.64242536", "0.6417415" ]
0.7518673
0
GetVersion get current config version.
GetVersion получает текущую версию конфигурации.
func (s serverConfigV14) GetVersion() string { serverConfigMu.RLock() defer serverConfigMu.RUnlock() return s.Version }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cfg *Config) GetVersion() int {\n\treturn cfg.Version\n}", "func (d *MessagesDhConfig) GetVersion() (value int) {\n\tif d == nil {\n\t\treturn\n\t}\n\treturn d.Version\n}", "func (o *TeamConfiguration) GetVersion() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Version\n}", "func (m *MarshalConfig) GetVersion() string {\n\tif m.Version == \"\" {\n\t\treturn V2\n\t}\n\treturn m.Version\n}", "func GetVersion() string {\n\treturn version\n}", "func GetVersion() string {\n\treturn version\n}", "func GetVersion() string {\n\treturn version.GetVersion()\n}", "func (r *SoftwareVolumeResource) GetVersion() (string, error) {\n\tvar list SoftwareVolumeConfigList\n\tif err := r.c.ReadQuery(BasePath+SoftwareVolumeEndpoint, &list); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar version string\n\n\tfor _, vol := range list.Items {\n\t\tif vol.Active == true {\n\t\t\tversion = vol.Version + \" \" + vol.Build\n\t\t}\n\t}\n\n\treturn version, nil\n}", "func GetVersion() string {\n\treturn __VERSION__\n}", "func Get() string {\n\treturn VERSION\n}", "func Get() string {\n\treturn Version\n}", "func GetVersion() string {\n\treturn Version\n}", "func GetVersion() string {\n\treturn Version\n}", "func GetVersion() string {\n\treturn getEnv(\"ENM_API_VERSION\", \"v1\")\n}", "func (c *Context) GetVersion() string { // 获取版本号\n\treturn c.GetGinCtx().Param(\"version\")\n}", "func GetVersion() string {\n\treturn VersionString\n}", "func GetVersion() string {\n\n\tcwd, _ := os.Getwd()\n\tcurrentFolderPathList := strings.Split(cwd, \"/\")\n\tlenFolder := len(currentFolderPathList)\n\tcurrFolder := currentFolderPathList[lenFolder-1]\n\n\tversionInformation := strings.Split(currFolder, \"-\")\n\n\t// In case we are not executing in the install directory, return\n\t// the version present in versionMetadata.json.\n\tif len(versionInformation) < 3 {\n\n\t\tviper.SetConfigName(\"version_metadata.json\")\n\t\tviper.SetConfigType(\"json\")\n\t\tviper.AddConfigPath(\".\")\n\t\terr := viper.ReadInConfig()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tversionNumber := fmt.Sprint(viper.Get(\"version_number\"))\n\t\tbuildNumber := fmt.Sprint(viper.Get(\"build_number\"))\n\n\t\tversion := versionNumber + \"-\" + buildNumber\n\n\t\treturn version\n\n\t}\n\n\tversionNumber := versionInformation[1]\n\tbuildNumber := versionInformation[2]\n\n\tversion := versionNumber + \"-\" + buildNumber\n\n\treturn version\n}", "func (m *DeviceManagementConfigurationSettingDefinition) 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}", "func GetVersion() string {\n\tif len(Version) == 0 {\n\t\treturn \"dev\"\n\t}\n\treturn Version\n}", "func GetVersion() string {\n\tif len(Version) == 0 {\n\t\treturn \"dev\"\n\t}\n\treturn Version\n}", "func GetVersion() string {\n\tversion, ok := os.LookupEnv(\"VERSION\")\n\tif !ok {\n\t\tversion = \"default\"\n\t}\n\treturn version\n}", "func Get() string {\n\tvar version string\n\tversion = \"v1.3.4\"\n\treturn version\n}", "func (_PlasmaFramework *PlasmaFrameworkSession) GetVersion() (string, error) {\n\treturn _PlasmaFramework.Contract.GetVersion(&_PlasmaFramework.CallOpts)\n}", "func (m *DigicamControl) GetVersion() int {\n\tif m.HasExtensionFieldValues {\n\t\treturn 2\n\t}\n\n\treturn 1\n}", "func (_PlasmaFramework *PlasmaFrameworkCallerSession) GetVersion() (string, error) {\n\treturn _PlasmaFramework.Contract.GetVersion(&_PlasmaFramework.CallOpts)\n}", "func (c *InjectionConfig) Version() string {\n\tif c.version == \"\" {\n\t\treturn defaultVersion\n\t}\n\n\treturn c.version\n}", "func (c *Cron) GetVersion() string { return c.Version }", "func GetVersion(c echo.Context) error {\n\n\t// This is being managed by config.go file. I don't like using empty interfaces\n\tversion := config.GuitaristReleaseVersion\n\n\tv := &Version{\n\t\tStatus: \"ok\",\n\t\tVersion: version,\n\t}\n\n\treturn c.JSON(http.StatusOK, v)\n}", "func (o *EnvironmentAutoUpdateConfig) GetVersion() string {\n\tif o == nil || o.Version == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Version\n}", "func (_PlasmaFramework *PlasmaFrameworkCaller) GetVersion(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _PlasmaFramework.contract.Call(opts, out, \"getVersion\")\n\treturn *ret0, err\n}", "func GetVersion(c *gin.Context) {\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"version\": Version,\n\t\t\"merchant_name\": MerchantName,\n\t})\n}", "func (_SimpleMultiSig *SimpleMultiSigCallerSession) GetVersion() (string, error) {\n\treturn _SimpleMultiSig.Contract.GetVersion(&_SimpleMultiSig.CallOpts)\n}", "func (o *AddonStatus) GetVersion() (value string, ok bool) {\n\tok = o != nil && o.bitmap_&64 != 0\n\tif ok {\n\t\tvalue = o.version\n\t}\n\treturn\n}", "func (p Plugin) GetVersion() string {\n\treturn Version\n}", "func GetVersion() string {\n\tvar versionString bytes.Buffer\n\tfmt.Fprintf(&versionString, \"v%s\", versn)\n\tif env != \"\" {\n\t\tfmt.Fprintf(&versionString, \"-%s\", env)\n\t}\n\n\treturn versionString.String()\n}", "func GetVersion() string {\n\tv := Map[\"version\"]\n\treturn v\n}", "func (_Bridge *BridgeCallerSession) GetVersion() (string, error) {\n\treturn _Bridge.Contract.GetVersion(&_Bridge.CallOpts)\n}", "func (_Bridge *BridgeSession) GetVersion() (string, error) {\n\treturn _Bridge.Contract.GetVersion(&_Bridge.CallOpts)\n}", "func (_SimpleMultiSig *SimpleMultiSigSession) GetVersion() (string, error) {\n\treturn _SimpleMultiSig.Contract.GetVersion(&_SimpleMultiSig.CallOpts)\n}", "func (c ClientWrapper) GetVersion() uint {\n\treturn c.esVersion\n}", "func (k Keeper) GetCurrentVersion(ctx sdk.Context) uint64 {\n\treturn k.protocolKeeper.GetCurrentVersion(ctx)\n}", "func Version() (version string) {\n\treturn GetVersion()\n}", "func (_SimpleMultiSig *SimpleMultiSigCaller) GetVersion(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _SimpleMultiSig.contract.Call(opts, out, \"getVersion\")\n\treturn *ret0, err\n}", "func (p Plugin) GetVersion() string {\n\treturn \"v0.0.0\"\n}", "func (m *ComponentInformation) GetVersion() int {\n\tif m.HasExtensionFieldValues {\n\t\treturn 2\n\t}\n\n\treturn 1\n}", "func (cl *APIClient) GetVersion() string {\n\treturn \"2.2.3\"\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func Version() string {\n\treturn version\n}", "func GetVersion(rw http.ResponseWriter) error {\n\tinfostat, err := host.Info()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn share.JSONResponse(infostat, rw)\n}", "func (net *NetAPI) Version() (string, error) {\n\treq := net.requestManager.newRequest(\"net_version\")\n\tresp, err := net.requestManager.send(req)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn resp.Get(\"result\").(string), nil\n}", "func (o *MicrosoftGraphSharedPcConfiguration) GetVersion() int32 {\n\tif o == nil || o.Version == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.Version\n}", "func GetVersion() {\n\tif *versionFlag {\n\t\tversion.Get().Print()\n\t\tos.Exit(0)\n\t}\n}", "func getVersion() string {\n\tslurp, err := ioutil.ReadFile(filepath.Join(camRoot, \"VERSION\"))\n\tif err == nil {\n\t\treturn strings.TrimSpace(string(slurp))\n\t}\n\treturn gitVersion()\n}", "func Version() string {\n\treturn getData().Version\n}", "func (_Bridge *BridgeCaller) GetVersion(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Bridge.contract.Call(opts, out, \"getVersion\")\n\treturn *ret0, err\n}", "func (c *Client) Version() (v Version, err error) {\n\t// Log\n\tvar m = \"Retrieve Open Data RATP version\"\n\tc.Logger.Debugf(\"[Start] %s\", m)\n\tdefer func(now time.Time) {\n\t\tc.Logger.Debugf(\"[End] %s in %s\", m, time.Since(now))\n\t}(time.Now())\n\n\t// Build request\n\tvar req = Envelope{Body: &EnvelopeBody{GetVersionRequest: &GetVersionRequest{}}}\n\n\t// Send request\n\tvar resp Envelope\n\tif resp, err = c.SendWithMaxRetries(\"getVersion\", req); err != nil {\n\t\treturn\n\t}\n\tv = resp.Body.GetVersionResponse.Version\n\treturn\n}", "func GetVersion() string {\n\tif metadata == \"\" {\n\t\treturn version\n\t}\n\treturn version + \"+\" + metadata\n}", "func (n *Namespace) GetVersion() string {\n\treturn n.Version\n}", "func (c *Current) Version() string {\n\tswitch c.selectedRadio {\n\tcase FocusOnInvolved, FocusOnCurrentNamespace:\n\t\treturn curr.resourceVersion\n\tcase FocusOnAllNamespace:\n\t\treturn curr.resourceVersionAllNamespace\n\t}\n\treturn \"0\"\n}", "func GetVersion(val, network int) int {\n\tif network == Data.Mainnet.ID {\n\t\treturn 0x68000000 | val\n\t} else if network == Data.Testnet.ID {\n\t\treturn 0x98000000 | val\n\t}\n\treturn 0x60000000 | val\n}", "func GetVersion() string {\n\treturn vboxmanage.GetVMProperty(boxName, \"boxVersion\")\n}", "func (entry *Entry) GetVersion() int {\n\tversion := 1\n\tif entry.Sys != nil {\n\t\tversion = entry.Sys.Version\n\t}\n\n\treturn version\n}", "func (entry *Entry) GetVersion() int {\n\tversion := 1\n\tif entry.Sys != nil {\n\t\tversion = entry.Sys.Version\n\t}\n\n\treturn version\n}", "func (es *EtcdService) GetVersion(system string, collection string) (int64, error) {\n\tctx := context.Background()\n\tresponse, err := es.client.Get(ctx, system+\"_\"+collection)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\t// Processing if key absents, thus initial version is requested\n\tif len(response.Kvs) == 0 {\n\t\treturn 0, nil\n\t}\n\tversion, err := strconv.ParseInt(string(response.Kvs[0].Value), 10, 64)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn version, nil\n}", "func (o *Basic) Version() string {\n\tif \"\" == o.Options.Version {\n\t\treturn defaultVersion\n\t}\n\treturn o.Options.Version\n}", "func (s *AppServerV3) GetVersion() string {\n\treturn s.Version\n}", "func GetVersion() string {\n\tversion := fmt.Sprintf(`Version : %s\nTag : %s\nBuildTime : %s\nGitHash : %s\nRunMode : %s\nDistribution: %s\nServiceName : %s\n`, CCVersion, CCTag, CCBuildTime, CCGitHash, CCRunMode, CCDistro, ServiceName)\n\treturn version\n}", "func (o ParserConfigResponseOutput) Version() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ParserConfigResponse) string { return v.Version }).(pulumi.StringOutput)\n}", "func GetVersion() Version {\n\treturn Version{\n\t\tVersion: \"v\" + version,\n\t\tGitCommit: gitCommit,\n\t}\n}", "func (m *Heartbeat) GetVersion() int {\n\tif m.HasExtensionFieldValues {\n\t\treturn 2\n\t}\n\n\treturn 1\n}", "func (m *ManagedAppPolicy) GetVersion()(*string) {\n return m.version\n}", "func (swagger *MgwSwagger) GetVersion() string {\n\treturn swagger.version\n}", "func (f *Features) getVersion(ctx context.Context, adminDB *mongo.Database) {\n\tcmd := bson.D{\n\t\t{\n\t\t\tKey: \"buildInfo\",\n\t\t\tValue: 1,\n\t\t},\n\t}\n\tvar result buildInfo\n\terr := adminDB.RunCommand(ctx, cmd).Decode(&result)\n\tif err != nil {\n\t\tf.MongoVersion = &semver.Version{}\n\t\treturn\n\t}\n\n\tf.MongoVersion = semver.MustParse(result.Version)\n}", "func GetVersion() (major, minor, revision int) {\n\tvar (\n\t\tmaj C.int\n\t\tmin C.int\n\t\trev C.int\n\t)\n\n\tC.glfwGetVersion(&maj, &min, &rev)\n\treturn int(maj), int(min), int(rev)\n}", "func (c *Client) GetVersion() (string, string, error) {\n\tctx, cancel := getContextWithTimeout(hyperContextTimeout)\n\tdefer cancel()\n\n\tresp, err := c.client.Version(ctx, &types.VersionRequest{})\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\treturn resp.Version, resp.ApiVersion, nil\n}", "func (o *SoftwareTechs) GetVersion() string {\n\tif o == nil || o.Version == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Version\n}", "func (c *ConfigManager) GetGlobalVersion(gc *GlobalConfig) uint64 {\n\tc.RLock()\n\tdefer c.RUnlock()\n\treturn gc.getVersionLocked()\n}", "func (o HiveMetastoreConfigOutput) Version() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v HiveMetastoreConfig) *string { return v.Version }).(pulumi.StringPtrOutput)\n}", "func Version() string {\n\treturn versionNumber\n}", "func (p *ProvisionTokenV2) GetVersion() string {\n\treturn p.Version\n}", "func (store ConfigurationStore) GetAPIVersion() string {\n\treturn string(APIVersion_Value)\n}", "func (c *Client) GetVersion(ctx context.Context) (rpc.GetVersionResult, error) {\n\tres, err := c.RpcClient.GetVersion(ctx)\n\terr = checkRpcResult(res.GeneralResponse, err)\n\tif err != nil {\n\t\treturn rpc.GetVersionResult{}, err\n\t}\n\treturn res.Result, nil\n}", "func (o *VirtualizationIweHost) GetVersion() string {\n\tif o == nil || o.Version == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Version\n}", "func Version() string {\n\treturn libs.Version()\n}", "func (a *Server) GetVersion(context.Context, *restapi.GetVersionRequest) restapi.GetVersionResponseSet {\n\treturn restapi.GetVersionResponseSet{Response200: &restapi.VersionResponse{\n\t\tVersion: version.Current().String()}}\n}", "func (s *Structured) GetVersion() string {\n\treturn s.cloudEvent.CloudEventsVersion\n}", "func (c *ConfigManager) GetConfig(version *configpb.Version, component, componentID string) (*configpb.Version, string, *configpb.Status) {\n\tc.RLock()\n\tdefer c.RUnlock()\n\tvar config string\n\tvar err error\n\tvar status *configpb.Status\n\tvar localCfgs map[string]*LocalConfig\n\tvar cfg *LocalConfig\n\tvar ok bool\n\n\tif localCfgs, ok = c.LocalCfgs[component]; !ok {\n\t\treturn c.getLatestVersionLocked(component, componentID), config, &configpb.Status{Code: configpb.StatusCode_COMPONENT_NOT_FOUND}\n\t}\n\n\tif cfg, ok = localCfgs[componentID]; !ok {\n\t\treturn c.getLatestVersionLocked(component, componentID), config, &configpb.Status{Code: configpb.StatusCode_COMPONENT_ID_NOT_FOUND}\n\t}\n\n\tconfig, err = c.getComponentCfg(component, componentID)\n\tif err != nil {\n\t\treturn version, \"\", &configpb.Status{\n\t\t\tCode: configpb.StatusCode_UNKNOWN,\n\t\t\tMessage: errEncode(err),\n\t\t}\n\t}\n\tif versionEqual(cfg.getVersionLocked(), version) {\n\t\tstatus = &configpb.Status{Code: configpb.StatusCode_OK}\n\t} else {\n\t\tstatus = &configpb.Status{Code: configpb.StatusCode_WRONG_VERSION}\n\t}\n\n\treturn c.getLatestVersionLocked(component, componentID), config, status\n}", "func (wlt *Wallet) GetVersion() string {\n\treturn wlt.Meta[\"version\"]\n}", "func (e *Event) GetVersion() string {\n\treturn e.BaseEvent.Version\n}", "func (o *Manager) GetVersion(ctx context.Context) (version string, err error) {\n\terr = o.object.CallWithContext(ctx, \"org.freedesktop.DBus.Properties.Get\", 0, InterfaceManager, \"Version\").Store(&version)\n\treturn\n}", "func (h *Hub) Version() (result string, err error) {\n\treturn h.client.sendXPathRequest(mySagemcomBoxDeviceInfoProductClass)\n}", "func (obj *Edge) GetVersion() int {\n\treturn obj.getVersion()\n}", "func (s *authzServer) GetVersion(\n\tctx context.Context,\n\treq *ver_api.VersionInfoRequest) (*ver_api.VersionInfo, error) {\n\treturn &ver_api.VersionInfo{\n\t\tName: constants.ServiceName,\n\t\tVersion: version.Version,\n\t\tSha: version.GitSHA,\n\t\tBuilt: version.BuildTime,\n\t}, nil\n}", "func GetVersion() (major, minor, rev int) {\n\tvar cMajor, cMinor, cRev C.int\n\tC.glfwGetVersion(&cMajor, &cMinor, &cRev)\n\tmajor, minor, rev = int(cMajor), int(cMinor), int(cRev)\n\treturn\n}" ]
[ "0.76337713", "0.7046342", "0.6860525", "0.6821554", "0.6817502", "0.6817502", "0.6807261", "0.6802234", "0.6780509", "0.6766513", "0.6756908", "0.6733999", "0.6733999", "0.67327684", "0.6674252", "0.66709596", "0.661521", "0.6614874", "0.66082346", "0.66082346", "0.6597021", "0.6588547", "0.6529238", "0.6522174", "0.6492114", "0.64437515", "0.6424971", "0.6418553", "0.6399592", "0.6331983", "0.6292162", "0.6272426", "0.6264848", "0.62607473", "0.62401783", "0.6219372", "0.621871", "0.6211508", "0.6198934", "0.6198741", "0.61875427", "0.6187453", "0.6182507", "0.6170668", "0.6169768", "0.61658937", "0.61621237", "0.61621237", "0.61621237", "0.61621237", "0.61621237", "0.61621237", "0.61621237", "0.61621237", "0.6158895", "0.6157564", "0.6141244", "0.6088029", "0.60816985", "0.6071719", "0.60495764", "0.6042747", "0.6039804", "0.60328996", "0.6027672", "0.6016004", "0.60159796", "0.6015763", "0.6015763", "0.60118115", "0.6010956", "0.6002357", "0.60014224", "0.59991413", "0.5994365", "0.59930676", "0.59827125", "0.5981273", "0.5981044", "0.59773076", "0.5964303", "0.59580904", "0.5958062", "0.59540474", "0.5952326", "0.594448", "0.59346515", "0.59328914", "0.5928818", "0.59238493", "0.59181875", "0.59146786", "0.5910197", "0.590818", "0.5901054", "0.5899711", "0.58862853", "0.58775777", "0.5876045", "0.58652014" ]
0.71078044
1
SetBrowser set if browser is enabled.
Установить браузер, если браузер включен.
func (s *serverConfigV14) SetBrowser(v string) { serverConfigMu.Lock() defer serverConfigMu.Unlock() // Set browser param s.Browser = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *UserSimulationEventInfo) SetBrowser(value *string)() {\n m.browser = value\n}", "func (m *IosiPadOSWebClip) SetUseManagedBrowser(value *bool)() {\n err := m.GetBackingStore().Set(\"useManagedBrowser\", value)\n if err != nil {\n panic(err)\n }\n}", "func (s *Portal) SetBrowserType(v string) *Portal {\n\ts.BrowserType = &v\n\treturn s\n}", "func (s *PortalSummary) SetBrowserType(v string) *PortalSummary {\n\ts.BrowserType = &v\n\treturn s\n}", "func (env *Env) OpenBrowser(url string) error {\n\tif err := browser.OpenURL(url); err != nil {\n\t\treturn xerrors.Errorf(\"could not open the browser: %w\", err)\n\t}\n\treturn nil\n}", "func CanOpenBrowser() bool {\n\tif runtime.GOOS == \"windows\" || runtime.GOOS == \"darwin\" {\n\t\treturn true\n\t}\n\n\toutput, err := execCommand(\"xdg-settings\", \"get\", \"default-web-browser\").Output()\n\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tif string(output) == \"\" {\n\t\treturn false\n\t}\n\n\treturn true\n}", "func OpenBrowser(url string) {\n\tif !strings.HasPrefix(url, \"http\") {\n\t\turl = \"http://\" + url\n\t}\n\n\tDefaultRunner.Run(cmdOpenBrowser[0], url)\n}", "func (s serverConfigV14) GetBrowser() string {\n\tserverConfigMu.RLock()\n\tdefer serverConfigMu.RUnlock()\n\n\treturn s.Browser\n}", "func Browser(url string) error {\n\tvar err error\n\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\t\terr = execCommand(\"xdg-open\", url).Start()\n\tcase \"windows\":\n\t\terr = execCommand(\"rundll32\", \"url.dll,FileProtocolHandler\", url).Start()\n\tcase \"darwin\":\n\t\terr = execCommand(\"open\", url).Start()\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported platform\")\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (s *Spider) StartBrowser(delay time.Duration, timeout time.Duration) {\n\tcount := scheduler.CountUrl()\n\tfor i := 0; i <= count; i++ {\n\t\tif url := scheduler.PopUrl(); url != \"\" {\n\t\t\tdownloader := downloader.Download{Delay: delay, Timeout: timeout}\n\t\t\tresp, err := downloader.Get(url)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdefer resp.Body.Close()\n\n\t\t\tdoc, err := goquery.NewDocumentFromReader(resp.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdoc.Find(\"td.useragent a\").Each(func(i int, selection *goquery.Selection) {\n\t\t\t\tif value := selection.Text(); value != \"\" {\n\t\t\t\t\tuseragent.UA.Set(urlAttributeResults[url].Category, value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}", "func (m *Application) SetWeb(value WebApplicationable)() {\n m.web = value\n}", "func OptOpenBrowser(open bool) Opt {\n\treturn func(app *App) {\n\t\tapp.openBrowser = open\n\t}\n}", "func (r AuthenticationMethodsReferences) ChannelBrowser() bool {\n\treturn r.UsernameAndPassword || r.TOTP || r.WebAuthn\n}", "func (r *Relwarc) NewBrowser() *Browser {\n\tctx, cancel := chromedp.NewContext(r.ctx)\n\n\t// make sure a browser and its first tab are created.\n\tif err := chromedp.Run(ctx); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// enable network by default.\n\tif err := chromedp.Run(ctx, network.Enable()); err != nil {\n\t\tpanic(err)\n\t}\n\n\ttgt := chromedp.FromContext(ctx).Target\n\n\ttab := Tab{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\ttarget: tgt,\n\t\trequestMap: map[network.RequestID]*Request{},\n\t}\n\n\tchromedp.ListenTarget(ctx, tab.onTargetEvent)\n\n\tbrowser := Browser{\n\t\tctx: ctx,\n\t\tfirst: &tab,\n\t\ttabs: map[target.ID]*Tab{},\n\t}\n\n\treturn &browser\n}", "func (socket *MockSocket) Browser() *socket.BrowserProtocol {\n\treturn socket.browser\n}", "func (b *OGame) SetUserAgent(newUserAgent string) {\n\tb.client.SetUserAgent(newUserAgent)\n}", "func (b Builders) needsBrowser() bool {\n\tfor _, v := range b {\n\t\tif v.BrowserBuild {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func SetHTTPUserAgent(agent string) error {\n\tif agent == \"\" {\n\t\treturn errUserAgentInvalid\n\t}\n\tm.Lock()\n\t_HTTPUserAgent = agent\n\tm.Unlock()\n\treturn nil\n}", "func (m *IosiPadOSWebClip) GetUseManagedBrowser()(*bool) {\n val, err := m.GetBackingStore().Get(\"useManagedBrowser\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*bool)\n }\n return nil\n}", "func (a *App) openbrowser(url string) {\n\tvar err error\n\tif runtime.GOOS == \"windows\" {\n\t\terr = exec.Command(\"rundll32\", \"url.dll,FileProtocolHandler\", url).Start()\n\t}\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "func (s *GetBrowserSettingsOutput) SetBrowserSettings(v *BrowserSettings) *GetBrowserSettingsOutput {\n\ts.BrowserSettings = v\n\treturn s\n}", "func (m *UserSimulationEventInfo) GetBrowser()(*string) {\n return m.browser\n}", "func (m *BrowserSiteList) SetStatus(value *BrowserSiteListStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "func (s *ListBrowserSettingsOutput) SetBrowserSettings(v []*BrowserSettingsSummary) *ListBrowserSettingsOutput {\n\ts.BrowserSettings = v\n\treturn s\n}", "func (s *UpdateBrowserSettingsOutput) SetBrowserSettings(v *BrowserSettings) *UpdateBrowserSettingsOutput {\n\ts.BrowserSettings = v\n\treturn s\n}", "func openURLInBrowser(url string, browserPath string) {\n\t// Cannot open URL if browser not found\n\tif browserPath == \"\" {\n\t\tlog.Println(\"[-] Browser not found to open URL: \", url)\n\t} else {\n\t\tcmdToExec := fmt.Sprintf(\"\\\"%s\\\" '%s' 2>/dev/null 1>/dev/null &\",\n\t\t\tbrowserPath, url)\n\t\teCmd([]string{cmdToExec}, \"\")\n\t}\n\n}", "func (gauo *GithubAssetUpdateOne) SetBrowserDownloadURL(s string) *GithubAssetUpdateOne {\n\tgauo.mutation.SetBrowserDownloadURL(s)\n\treturn gauo\n}", "func (gau *GithubAssetUpdate) SetBrowserDownloadURL(s string) *GithubAssetUpdate {\n\tgau.mutation.SetBrowserDownloadURL(s)\n\treturn gau\n}", "func (win *Window) SetAcceptFocus(setting bool) {\n\twin.Candy().Guify(\"gtk_window_set_accept_focus\", win, setting)\n}", "func openBrowser(url string) {\n\tvar err error\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\t\terr = exec.Command(\"xdg-open\", url).Start()\n\tcase \"windows\":\n\t\terr = exec.Command(\"rundll32\", \"url.dll,FileProtocolHandler\", url).Start()\n\tcase \"darwin\":\n\t\terr = exec.Command(\"open\", url).Start()\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported platform\")\n\t}\n\tmust(err)\n}", "func (m *GroupPolicyDefinition) SetSupportedOn(value *string)() {\n err := m.GetBackingStore().Set(\"supportedOn\", value)\n if err != nil {\n panic(err)\n }\n}", "func openBrowser(url string) error {\n\n\tvar cmd string\n\tvar args []string\n\n\tswitch runtime.GOOS {\n\tcase \"windows\":\n\t\tcmd = \"cmd\"\n\t\targs = []string{\"/c\", \"start\"}\n\tcase \"darwin\":\n\t\tcmd = \"open\"\n\tdefault: // \"linux\", \"freebsd\", \"openbsd\", \"netbsd\"\n\t\tcmd = \"xdg-open\"\n\t}\n\targs = append(args, url)\n\terr := exec.Command(cmd, args...).Start()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error opening browser cmd:%s args:%s error: %w\", cmd, args, err)\n\t}\n\treturn nil\n}", "func (p *Page) MustSetUserAgent(req *proto.NetworkSetUserAgentOverride) *Page {\n\tp.e(p.SetUserAgent(req))\n\treturn p\n}", "func (m *WindowsUniversalAppX) SetMinimumSupportedOperatingSystem(value WindowsMinimumOperatingSystemable)() {\n m.minimumSupportedOperatingSystem = value\n}", "func openbrowser(url string) {\n\tvar err error\n\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\t\terr = exec.Command(\"xdg-open\", url).Start()\n\tcase \"windows\":\n\t\terr = exec.Command(\"rundll32\", \"url.dll,FileProtocolHandler\", url).Start()\n\tcase \"darwin\":\n\t\terr = exec.Command(\"open\", url).Start()\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported platform\")\n\t}\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "func (v *DefaultVersion) SetCapability(cap *Capability, b bool) {\n\tv.capabilities[cap] = b\n}", "func (r *Router) BrowserAvail() bool {\n\t// this is really just so otehr packages don't have to import `js` just to figure out if they should do extra browser setup\n\treturn js.Global().Truthy()\n}", "func SetForTests(c Capabilities) {\n\tcapInstance.lock.Lock()\n\tdefer capInstance.lock.Unlock()\n\tcapInstance.capabilities = &c\n}", "func (launcher *Launcher) setProcess(proc *os.Process) {\n\tlauncher.Mutex.Lock()\n\tlauncher.process = proc\n\tlauncher.Mutex.Unlock()\n}", "func (c *CmdReal) SetProcess(process *os.Process) {\n\tc.cmd.Process = process\n}", "func (m *Main) SetView(view webview.WebView) {\n\tm.w = view\n}", "func SetContext(contxt context.Context) {\n\tctx = contxt\n\ts, ok := ctx.Value(ContextKeyUserAgent).(string)\n\tif ok {\n\t\tuserAgent = s\n\t}\n}", "func (s *Settings) SetUserAgentWithApplicationDetails(appName, appVersion string) {\n\tC.webkit_settings_set_user_agent_with_application_details(s.settings, (*C.gchar)(C.CString(appName)), (*C.gchar)(C.CString(appVersion)))\n}", "func SetTest() {\n\tgin.SetMode(gin.TestMode)\n}", "func (m *AndroidLobApp) SetMinimumSupportedOperatingSystem(value AndroidMinimumOperatingSystemable)() {\n err := m.GetBackingStore().Set(\"minimumSupportedOperatingSystem\", value)\n if err != nil {\n panic(err)\n }\n}", "func (self *TextView) SetAcceptsTab(acceptsTab bool) {\n\tb := gobject.GBool(acceptsTab)\n\tdefer b.Free()\n\tC.gtk_text_view_set_accepts_tab(self.object, *((*C.gboolean)(b.GetPtr())))\n}", "func SetBackend(b Backend) {\n\tcurrentBackend = b\n}", "func WebBrowserCookieSettingsPBrowserDefault() *WebBrowserCookieSettings {\n\tv := WebBrowserCookieSettingsVBrowserDefault\n\treturn &v\n}", "func (s *UpdateBrowserSettingsInput) SetBrowserPolicy(v string) *UpdateBrowserSettingsInput {\n\ts.BrowserPolicy = &v\n\treturn s\n}", "func (*Browser) Open(url string) error {\n\treturn browser.OpenURL(url)\n}", "func (nm *NodeMonitor) setProcess(proc *os.Process) {\n\tnm.mutex.Lock()\n\tnm.process = proc\n\tnm.mutex.Unlock()\n}", "func (n *mockAgent) setAgentURL() error {\n\treturn nil\n}", "func BrowserCommand(\n\tlog Logger,\n\tcr CommandRunner,\n\tm manifest.Manifest,\n\truntimeOS string,\n) func(*cli.Cmd) {\n\treturn func(cmd *cli.Cmd) {\n\t\tproject := cmd.StringArg(\"PROJECT\", \"\", \"name or alias of project to open in browser\")\n\n\t\tcmd.Action = func() {\n\t\t\tp, err := m.FindProject(*project)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s\", err)\n\t\t\t}\n\n\t\t\tu, err := p.BrowserURL()\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"failed to build browser URL: %s\", err)\n\t\t\t}\n\n\t\t\tbin := \"xdg-open\"\n\t\t\tif runtimeOS == \"darwin\" {\n\t\t\t\tbin = \"open\"\n\t\t\t}\n\n\t\t\tc := exec.Command(bin, u)\n\t\t\terr = cr.Run(c)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"failed to open project in browser: %s\", err)\n\t\t\t}\n\t\t}\n\t}\n}", "func (m *PrinterLocation) SetSite(value *string)() {\n err := m.GetBackingStore().Set(\"site\", value)\n if err != nil {\n panic(err)\n }\n}", "func (c *IRacing) SetHTTP(client *http.Client) {\n\tc.http = client\n}", "func (d *Dnsfilter) SetSafeBrowsingServer(host string) {\n\tif len(host) == 0 {\n\t\td.safeBrowsingServer = defaultSafebrowsingServer\n\t} else {\n\t\td.safeBrowsingServer = host\n\t}\n}", "func SetProcess(proc string) {\n process = proc\n}", "func SetGenesis() {\n\tglobalData.Lock()\n\tsetGenesis()\n\tglobalData.Unlock()\n}", "func NewBrowserClient(url string) (*browserClient, error) {\n\tbc, err := newBaseClient(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &browserClient{bc}, nil\n}", "func (wc *WebClient) WindowSetColour(colour int) {\n}", "func (t *Element) RequestFullscreenByBrowser() {\n\telem := t.Value_JS\n\tif !elem.Get(\"requestFullscreen\").IsUndefined() {\n\t\telem.Call(\"requestFullscreen\", \"\")\n\t} else if !elem.Get(\"mozRequestFullScreen\").IsUndefined() { /* Firefox */\n\t\telem.Call(\"mozRequestFullScreen\", \"\")\n\t} else if !elem.Get(\"webkitRequestFullscreen\").IsUndefined() { /* Chrome, Safari and Opera */\n\t\telem.Call(\"webkitRequestFullscreen\", \"\")\n\t} else if !elem.Get(\"msRequestFullscreen\").IsUndefined() { /* IE/Edge */\n\t\telem.Call(\"msRequestFullscreen\", \"\")\n\t}\n}", "func (gbc *GomeboyColor) setHardwareMode(isColor bool) {\n\tif isColor {\n\t\tgbc.cpu.R.A = 0x11\n\t\tgbc.gpu.RunningColorGBHardware = gbc.mmu.IsCartridgeColor()\n\t\tgbc.mmu.RunningColorGBHardware = true\n\t} else {\n\t\tgbc.cpu.R.A = 0x01\n\t\tgbc.gpu.RunningColorGBHardware = false\n\t\tgbc.mmu.RunningColorGBHardware = false\n\t}\n}", "func (m *PrintConnector) SetOperatingSystem(value *string)() {\n err := m.GetBackingStore().Set(\"operatingSystem\", value)\n if err != nil {\n panic(err)\n }\n}", "func (s *CreateBrowserSettingsInput) SetBrowserPolicy(v string) *CreateBrowserSettingsInput {\n\ts.BrowserPolicy = &v\n\treturn s\n}", "func SetDB(db *config.DatabaseCfg) {\n\tdbc = db\n}", "func (u *User) SetBot(value bool) {\n\tif value {\n\t\tu.Flags.Set(14)\n\t\tu.Bot = true\n\t} else {\n\t\tu.Flags.Unset(14)\n\t\tu.Bot = false\n\t}\n}", "func (cfg *Config) SetDefaultConfig() {\n\tcfg.Title = \"APK Browser\"\n\tcfg.HTTP.SetDefaultConfig()\n}", "func (p *Protocol) Set(value string) error {\n\t*p = Protocol(strings.ToLower(value))\n\treturn nil\n}", "func (cl *APIClient) SetUserAgent(str string, rv string) *APIClient {\n\tcl.ua = str + \" (\" + runtime.GOOS + \"; \" + runtime.GOARCH + \"; rv:\" + rv + \") go-sdk/\" + cl.GetVersion() + \" go/\" + runtime.Version()\n\treturn cl\n}", "func runBrowser(exePath string, switches []string, env map[string]string, logFilePath string) (*exec.Cmd, *os.File, error) {\n\tvar logFile *os.File\n\n\tcmd := exec.Command(exePath, switches...)\n\tcmd.Env = os.Environ()\n\tif len(env) > 0 {\n\t\tfor k, v := range env {\n\t\t\tcmd.Env = append(cmd.Env, []string{k + \"=\" + v}...)\n\t\t}\n\t}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif logFilePath != \"\" {\n\t\tflags := os.O_WRONLY | os.O_CREATE | os.O_TRUNC\n\t\tlogFile, err = os.OpenFile(logFilePath, flags, 0640)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tgo io.Copy(logFile, stdout)\n\t\tgo io.Copy(logFile, stderr)\n\t} else {\n\t\tgo io.Copy(os.Stdout, stdout)\n\t\tgo io.Copy(os.Stderr, stderr)\n\t}\n\treturn cmd, logFile, nil\n}", "func (m *BrowserSiteList) SetDisplayName(value *string)() {\n err := m.GetBackingStore().Set(\"displayName\", value)\n if err != nil {\n panic(err)\n }\n}", "func (wc *WebClient) WindowSetTitle(title string) {}", "func (s *BrowserSettings) SetBrowserPolicy(v string) *BrowserSettings {\n\ts.BrowserPolicy = &v\n\treturn s\n}", "func (m *MockSession) SetIsFrontend(arg0 bool) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"SetIsFrontend\", arg0)\n}", "func SetFlavor(f string) {\n\tagentFlavor = f\n\n\tif agentFlavor == flavor.IotAgent {\n\t\tC.m.Lock()\n\t\tC.IotHost = true\n\t\tC.m.Unlock()\n\t}\n}", "func SetOSNotifier(n Notifier) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tif globalNotifier != nil {\n\t\tglobalNotifier.Shutdown()\n\t}\n\tglobalNotifier = n\n}", "func (m *BrowserSiteList) SetSites(value []BrowserSiteable)() {\n err := m.GetBackingStore().Set(\"sites\", value)\n if err != nil {\n panic(err)\n }\n}", "func (c *ChromeNetwork) SetUserAgentOverride(userAgent string, ) (*ChromeResponse, error) {\n\tparamRequest := make(map[string]interface{}, 1)\n\tparamRequest[\"userAgent\"] = userAgent\n\treturn sendDefaultRequest(c.target.sendCh, &ParamRequest{Id: c.target.getId(), Method: \"Network.setUserAgentOverride\", Params: paramRequest})\n}", "func (m *Setup) SetCapability(network string, capName string, args interface{}) error {\n\tfor i := range m.networks {\n\t\tif m.networks[i] == network {\n\t\t\thasCap := false\n\t\t\tfor _, plugin := range m.networkConfList[i].Plugins {\n\t\t\t\tif plugin.Network.Capabilities[capName] {\n\t\t\t\t\thasCap = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !hasCap {\n\t\t\t\treturn fmt.Errorf(\"%s network doesn't have %s capability\", network, capName)\n\t\t\t}\n\n\t\t\tswitch args := args.(type) {\n\t\t\tcase PortMapEntry:\n\t\t\t\tif m.runtimeConf[i].CapabilityArgs[capName] == nil {\n\t\t\t\t\tm.runtimeConf[i].CapabilityArgs[capName] = make([]PortMapEntry, 0)\n\t\t\t\t}\n\t\t\t\tm.runtimeConf[i].CapabilityArgs[capName] = append(\n\t\t\t\t\tm.runtimeConf[i].CapabilityArgs[capName].([]PortMapEntry),\n\t\t\t\t\targs,\n\t\t\t\t)\n\t\t\tcase []allocator.Range:\n\t\t\t\tif m.runtimeConf[i].CapabilityArgs[capName] == nil {\n\t\t\t\t\tm.runtimeConf[i].CapabilityArgs[capName] = []allocator.RangeSet{args}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "func SetComputerName(lpComputerName string) bool {\n\tlpComputerNameStr := unicode16FromString(lpComputerName)\n\tret1 := syscall3(setComputerName, 1,\n\t\tuintptr(unsafe.Pointer(&lpComputerNameStr[0])),\n\t\t0,\n\t\t0)\n\treturn ret1 != 0\n}", "func (m *BrowserSiteList) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}", "func SetURL(url string) func(*MGO) error {\n\treturn func(m *MGO) error {\n\t\tm.url = url\n\t\treturn nil\n\t}\n}", "func WebBrowserCookieSettingsPAllowAlways() *WebBrowserCookieSettings {\n\tv := WebBrowserCookieSettingsVAllowAlways\n\treturn &v\n}", "func RegistrySet() {\n\tif *Registry == \"\" {\n\t\tApp.Errorf(\"required flag --%s not provided, try --help\", RegistryName)\n\t\tos.Exit(1)\n\t}\n}", "func LocateBrowser(preferredBrowser string) BrowserProtocol {\n\tp := BrowserProtocol{}\n\n\tswitch preferredBrowser {\n\tcase \"chrome\":\n\t\tp = LocateChrome()\n\tcase \"edge\":\n\t\tp = LocateEdge()\n\tcase \"brave\":\n\t\tp = LocateBrave()\n\t// case \"firefox\":\n\t// \tp = LocateFirefox()\n\tdefault:\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\":\n\t\tcase \"windows\":\n\t\t\tp = LocateEdge()\n\t\tdefault:\n\t\t\t// p = LocateFirefox()\n\t\t\t// ! In Firefox, remote debugging port needs to be enabled explicitly.\n\t\t}\n\t}\n\n\tif p.Path == \"\" {\n\t\tp = LocateChrome()\n\t}\n\n\tif p.Path == \"\" {\n\t\tp = LocateBrave()\n\t}\n\n\tif p.Path == \"\" {\n\t\tp = LocateEdge()\n\t}\n\n\t// if p.Path == \"\" {\n\t// \tp = LocateFirefox()\n\t// }\n\n\treturn p\n}", "func (p *Page) MustSetWindow(left, top, width, height int) *Page {\n\tp.e(p.SetWindow(&proto.BrowserBounds{\n\t\tLeft: gson.Int(left),\n\t\tTop: gson.Int(top),\n\t\tWidth: gson.Int(width),\n\t\tHeight: gson.Int(height),\n\t\tWindowState: proto.BrowserWindowStateNormal,\n\t}))\n\treturn p\n}", "func (m *BrowserSiteList) SetRevision(value *string)() {\n err := m.GetBackingStore().Set(\"revision\", value)\n if err != nil {\n panic(err)\n }\n}", "func SetBackend(backend SupportedBackend, b Backend) {\n\tswitch backend {\n\tcase YFinBackend:\n\t\tbackends.YFin = b\n\tcase BATSBackend:\n\t\tbackends.Bats = b\n\t}\n}", "func (mu *ModelUpdate) SetWeb(s string) *ModelUpdate {\n\tmu.mutation.SetWeb(s)\n\treturn mu\n}", "func (m *BookingBusiness) SetWebSiteUrl(value *string)() {\n err := m.GetBackingStore().Set(\"webSiteUrl\", value)\n if err != nil {\n panic(err)\n }\n}", "func (g *GRPC) SetHTTPServer(serv *http.Server) {\n\tg.httpServer = serv\n}", "func SetDefaultWebServer(ws WebServer) error {\n\tif DefaultWebServer != nil {\n\t\treturn fmt.Errorf(\"default web server has been already configured\")\n\t}\n\tDefaultWebServer = ws\n\treturn nil\n}", "func (s *server) setBackend(b backends.Backend) {\n\ts.backendStore.Store(b)\n}", "func Start(ctx context.Context) error {\n\n\tfs := flagset.NewFlagSet(\"browser\")\n\n\tserver_uri := fs.String(\"server-uri\", \"http://localhost:8080\", \"A valid aaronland/go-http-server URI.\")\n\n\tstatic_prefix := fs.String(\"static-prefix\", \"\", \"Prepend this prefix to URLs for static assets.\")\n\n\tpath_templates := fs.String(\"templates\", \"\", \"An optional string for local templates. This is anything that can be read by the 'templates.ParseGlob' method.\")\n\n\tdata_source := fs.String(\"reader-source\", \"whosonfirst-data://\", \"A valid go-reader Reader URI string.\")\n\tcache_source := fs.String(\"cache-source\", \"gocache://\", \"A valid go-cache Cache URI string.\")\n\n\tnextzen_api_key := fs.String(\"nextzen-api-key\", \"\", \"A valid Nextzen API key (https://developers.nextzen.org/).\")\n\tnextzen_style_url := fs.String(\"nextzen-style-url\", \"/tangram/refill-style.zip\", \"A valid Tangram scene file URL.\")\n\tnextzen_tile_url := fs.String(\"nextzen-tile-url\", tangramjs.NEXTZEN_MVT_ENDPOINT, \"A valid Nextzen MVT tile URL.\")\n\n\tproxy_tiles := fs.Bool(\"proxy-tiles\", false, \"Proxy (and cache) Nextzen tiles.\")\n\tproxy_tiles_url := fs.String(\"proxy-tiles-url\", \"/tiles/\", \"The URL (a relative path) for proxied tiles.\")\n\tproxy_tiles_cache := fs.String(\"proxy-tiles-cache\", \"gocache://\", \"A valid tile proxy DSN string.\")\n\tproxy_tiles_timeout := fs.Int(\"proxy-tiles-timeout\", 30, \"The maximum number of seconds to allow for fetching a tile from the proxy.\")\n\n\tenable_all := fs.Bool(\"enable-all\", false, \"Enable all the available output handlers.\")\n\tenable_graphics := fs.Bool(\"enable-graphics\", false, \"Enable the 'png' and 'svg' output handlers.\")\n\tenable_data := fs.Bool(\"enable-data\", false, \"Enable the 'geojson' and 'spr' and 'select' output handlers.\")\n\n\tenable_png := fs.Bool(\"enable-png\", false, \"Enable the 'png' output handler.\")\n\tenable_svg := fs.Bool(\"enable-svg\", false, \"Enable the 'svg' output handler.\")\n\n\tenable_geojson := fs.Bool(\"enable-geojson\", true, \"Enable the 'geojson' output handler.\")\n\tenable_geojsonld := fs.Bool(\"enable-geojson-ld\", true, \"Enable the 'geojson-ld' output handler.\")\n\tenable_spr := fs.Bool(\"enable-spr\", true, \"Enable the 'spr' (or \\\"standard places response\\\") output handler.\")\n\tenable_select := fs.Bool(\"enable-select\", false, \"Enable the 'select' output handler.\")\n\n\tselect_pattern := fs.String(\"select-pattern\", \"properties(?:.[a-zA-Z0-9-_]+){1,}\", \"A valid regular expression for sanitizing select parameters.\")\n\n\tenable_html := fs.Bool(\"enable-html\", true, \"Enable the 'html' (or human-friendly) output handlers.\")\n\n\tenable_search_api := fs.Bool(\"enable-search-api\", true, \"Enable the (API) search handlers.\")\n\tenable_search_api_geojson := fs.Bool(\"enable-search-api-geojson\", false, \"Enable the (API) search handlers to return results as GeoJSON.\")\n\n\tenable_search_html := fs.Bool(\"enable-search-html\", true, \"Enable the (human-friendly) search handlers.\")\n\n\tenable_search := fs.Bool(\"enable-search\", false, \"Enable both the API and human-friendly search handlers.\")\n\n\tsearch_database_uri := fs.String(\"search-database-uri\", \"\", \"A valid whosonfirst/go-whosonfist-search/fulltext URI.\")\n\n\tpath_png := fs.String(\"path-png\", \"/png/\", \"The path that PNG requests should be served from.\")\n\tpath_svg := fs.String(\"path-svg\", \"/svg/\", \"The path that SVG requests should be served from.\")\n\tpath_geojson := fs.String(\"path-geojson\", \"/geojson/\", \"The path that GeoJSON requests should be served from.\")\n\tpath_geojsonld := fs.String(\"path-geojson-ld\", \"/geojson-ld/\", \"The path that GeoJSON-LD requests should be served from.\")\n\tpath_spr := fs.String(\"path-spr\", \"/spr/\", \"The path that SPR requests should be served from.\")\n\tpath_select := fs.String(\"path-select\", \"/select/\", \"The path that 'select' requests should be served from.\")\n\n\tpath_search_api := fs.String(\"path-search-api\", \"/search/spr/\", \"The path that API 'search' requests should be served from.\")\n\tpath_search_html := fs.String(\"path-search-html\", \"/search/\", \"The path that API 'search' requests should be served from.\")\n\n\tpath_id := fs.String(\"path-id\", \"/id/\", \"The that Who's On First documents should be served from.\")\n\n\tflagset.Parse(fs)\n\n\terr := flagset.SetFlagsFromEnvVarsWithFeedback(fs, \"BROWSER\", true)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif *enable_all {\n\t\t*enable_graphics = true\n\t\t*enable_data = true\n\t\t*enable_html = true\n\t\t*enable_search = true\n\t}\n\n\tif *enable_search {\n\t\t*enable_search_api = true\n\t\t*enable_search_api_geojson = true\n\t\t*enable_search_html = true\n\t}\n\n\tif *enable_graphics {\n\t\t*enable_png = true\n\t\t*enable_svg = true\n\t}\n\n\tif *enable_data {\n\t\t*enable_geojson = true\n\t\t*enable_geojsonld = true\n\t\t*enable_spr = true\n\t\t*enable_select = true\n\t}\n\n\tif *enable_search_html {\n\t\t*enable_html = true\n\t}\n\n\tif *enable_html {\n\t\t*enable_geojson = true\n\t\t*enable_png = true\n\t}\n\n\tif *cache_source == \"tmp://\" {\n\n\t\tnow := time.Now()\n\t\tprefix := fmt.Sprintf(\"go-whosonfirst-browser-%d\", now.Unix())\n\n\t\ttempdir, err := ioutil.TempDir(\"\", prefix)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tlog.Println(tempdir)\n\t\tdefer os.RemoveAll(tempdir)\n\n\t\t*cache_source = fmt.Sprintf(\"fs://%s\", tempdir)\n\t}\n\n\tcr_q := url.Values{}\n\tcr_q.Set(\"reader\", *data_source)\n\tcr_q.Set(\"cache\", *cache_source)\n\n\tcr_uri := url.URL{}\n\tcr_uri.Scheme = \"cachereader\"\n\tcr_uri.RawQuery = cr_q.Encode()\n\n\tcr, err := reader.NewReader(ctx, cr_uri.String())\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// start of sudo put me in a package\n\n\tt := template.New(\"whosonfirst-browser\").Funcs(template.FuncMap{\n\t\t\"Add\": func(i int, offset int) int {\n\t\t\treturn i + offset\n\t\t},\n\t})\n\n\tif *path_templates != \"\" {\n\n\t\tt, err = t.ParseGlob(*path_templates)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t} else {\n\n\t\tfor _, name := range templates.AssetNames() {\n\n\t\t\tbody, err := templates.Asset(name)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tt, err = t.Parse(string(body))\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// end of sudo put me in a package\n\n\tif *static_prefix != \"\" {\n\n\t\t*static_prefix = strings.TrimRight(*static_prefix, \"/\")\n\n\t\tif !strings.HasPrefix(*static_prefix, \"/\") {\n\t\t\treturn errors.New(\"Invalid -static-prefix value\")\n\t\t}\n\t}\n\n\tmux := gohttp.NewServeMux()\n\n\tping_handler, err := http.PingHandler()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmux.Handle(\"/ping\", ping_handler)\n\n\tif *enable_png {\n\n\t\tpng_opts, err := http.NewDefaultRasterOptions()\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpng_handler, err := http.RasterHandler(cr, png_opts)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_png, png_handler)\n\t}\n\n\tif *enable_svg {\n\n\t\tsvg_opts, err := http.NewDefaultSVGOptions()\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsvg_handler, err := http.SVGHandler(cr, svg_opts)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_svg, svg_handler)\n\t}\n\n\tif *enable_spr {\n\n\t\tspr_handler, err := http.SPRHandler(cr)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_spr, spr_handler)\n\t}\n\n\tif *enable_geojson {\n\n\t\tgeojson_handler, err := http.GeoJSONHandler(cr)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_geojson, geojson_handler)\n\t}\n\n\tif *enable_geojsonld {\n\n\t\tgeojsonld_handler, err := http.GeoJSONLDHandler(cr)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_geojsonld, geojsonld_handler)\n\t}\n\n\tif *enable_select {\n\n\t\tif *select_pattern == \"\" {\n\t\t\treturn errors.New(\"Missing -select-pattern parameter.\")\n\t\t}\n\n\t\tpat, err := regexp.Compile(*select_pattern)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tselect_opts := &http.SelectHandlerOptions{\n\t\t\tPattern: pat,\n\t\t}\n\n\t\tselect_handler, err := http.SelectHandler(cr, select_opts)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_select, select_handler)\n\t}\n\n\tif *enable_search_api {\n\n\t\tsearch_db, err := fulltext.NewFullTextDatabase(ctx, *search_database_uri)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsearch_opts := http.SearchAPIHandlerOptions{\n\t\t\tDatabase: search_db,\n\t\t}\n\n\t\tif *enable_search_api_geojson {\n\n\t\t\tsearch_opts.EnableGeoJSON = true\n\n\t\t\tgeojson_reader, err := reader.NewReader(ctx, *data_source)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tsearch_opts.GeoJSONReader = geojson_reader\n\n\t\t\t/*\n\t\t\t\tif resolver_uri != \"\" {\n\n\t\t\t\tresolver_func, err := geojson.NewSPRPathResolverFunc(ctx, resolver_uri)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tapi_pip_opts.SPRPathResolver = resolver_func\n\t\t\t*/\n\t\t}\n\n\t\tsearch_handler, err := http.SearchAPIHandler(search_opts)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tmux.Handle(*path_search_api, search_handler)\n\t}\n\n\tif *enable_html {\n\n\t\tif *proxy_tiles {\n\n\t\t\ttile_cache, err := cache.NewCache(ctx, *proxy_tiles_cache)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\ttimeout := time.Duration(*proxy_tiles_timeout) * time.Second\n\n\t\t\tproxy_opts := &tzhttp.TilezenProxyHandlerOptions{\n\t\t\t\tCache: tile_cache,\n\t\t\t\tTimeout: timeout,\n\t\t\t}\n\n\t\t\tproxy_handler, err := tzhttp.TilezenProxyHandler(proxy_opts)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// the order here is important - we don't have a general-purpose \"add to\n\t\t\t// mux with prefix\" function here, like we do in the tangram handler so\n\t\t\t// we set the nextzen tile url with *proxy_tiles_url and then update it\n\t\t\t// (*proxy_tiles_url) with a prefix if necessary (20190911/thisisaaronland)\n\n\t\t\t*nextzen_tile_url = fmt.Sprintf(\"%s{z}/{x}/{y}.mvt\", *proxy_tiles_url)\n\n\t\t\tif *static_prefix != \"\" {\n\n\t\t\t\t*proxy_tiles_url = filepath.Join(*static_prefix, *proxy_tiles_url)\n\n\t\t\t\tif !strings.HasSuffix(*proxy_tiles_url, \"/\") {\n\t\t\t\t\t*proxy_tiles_url = fmt.Sprintf(\"%s/\", *proxy_tiles_url)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmux.Handle(*proxy_tiles_url, proxy_handler)\n\t\t}\n\n\t\tbootstrap_opts := bootstrap.DefaultBootstrapOptions()\n\n\t\ttangramjs_opts := tangramjs.DefaultTangramJSOptions()\n\t\ttangramjs_opts.Nextzen.APIKey = *nextzen_api_key\n\t\ttangramjs_opts.Nextzen.StyleURL = *nextzen_style_url\n\t\ttangramjs_opts.Nextzen.TileURL = *nextzen_tile_url\n\n\t\tendpoints := &http.Endpoints{\n\t\t\tData: *path_geojson,\n\t\t\tPng: *path_png,\n\t\t\tSvg: *path_svg,\n\t\t\tSpr: *path_spr,\n\t\t\tId: *path_id,\n\t\t\tIndex: \"/\",\n\t\t}\n\n\t\tif *enable_search_html {\n\t\t\tendpoints.Search = *path_search_html\n\t\t}\n\n\t\tindex_opts := http.IndexHandlerOptions{\n\t\t\tTemplates: t,\n\t\t\tEndpoints: endpoints,\n\t\t}\n\n\t\tindex_handler, err := http.IndexHandler(index_opts)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tindex_handler = bootstrap.AppendResourcesHandlerWithPrefix(index_handler, bootstrap_opts, *static_prefix)\n\n\t\tmux.Handle(\"/\", index_handler)\n\n\t\tid_opts := http.IDHandlerOptions{\n\t\t\tTemplates: t,\n\t\t\tEndpoints: endpoints,\n\t\t}\n\n\t\tid_handler, err := http.IDHandler(cr, id_opts)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tid_handler = bootstrap.AppendResourcesHandlerWithPrefix(id_handler, bootstrap_opts, *static_prefix)\n\t\tid_handler = tangramjs.AppendResourcesHandlerWithPrefix(id_handler, tangramjs_opts, *static_prefix)\n\n\t\tmux.Handle(*path_id, id_handler)\n\n\t\tif *enable_search_html {\n\n\t\t\tsearch_db, err := fulltext.NewFullTextDatabase(ctx, *search_database_uri)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tsearch_opts := http.SearchHandlerOptions{\n\t\t\t\tTemplates: t,\n\t\t\t\tEndpoints: endpoints,\n\t\t\t\tDatabase: search_db,\n\t\t\t}\n\n\t\t\tsearch_handler, err := http.SearchHandler(search_opts)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tsearch_handler = bootstrap.AppendResourcesHandlerWithPrefix(search_handler, bootstrap_opts, *static_prefix)\n\t\t\tsearch_handler = tangramjs.AppendResourcesHandlerWithPrefix(search_handler, tangramjs_opts, *static_prefix)\n\n\t\t\tmux.Handle(*path_search_html, search_handler)\n\t\t}\n\n\t\terr = bootstrap.AppendAssetHandlersWithPrefix(mux, *static_prefix)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = tangramjs.AppendAssetHandlersWithPrefix(mux, *static_prefix)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = http.AppendStaticAssetHandlersWithPrefix(mux, *static_prefix)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\ts, err := server.NewServer(ctx, *server_uri)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Printf(\"Listening on %s\\n\", s.Address())\n\n\treturn s.ListenAndServe(ctx, mux)\n}", "func browsers() []string {\n\tvar cmds []string\n\tif userBrowser := os.Getenv(\"BROWSER\"); userBrowser != \"\" {\n\t\tcmds = append(cmds, userBrowser)\n\t}\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\tcmds = append(cmds, \"/usr/bin/open\")\n\tcase \"windows\":\n\t\tcmds = append(cmds, \"cmd /c start\")\n\tdefault:\n\t\t// Commands opening browsers are prioritized over xdg-open, so browser()\n\t\t// command can be used on linux to open the .svg file generated by the -web\n\t\t// command (the .svg file includes embedded javascript so is best viewed in\n\t\t// a browser).\n\t\tcmds = append(cmds, []string{\"chrome\", \"google-chrome\", \"chromium\", \"firefox\", \"sensible-browser\"}...)\n\t\tif os.Getenv(\"DISPLAY\") != \"\" {\n\t\t\t// xdg-open is only for use in a desktop environment.\n\t\t\tcmds = append(cmds, \"xdg-open\")\n\t\t}\n\t}\n\treturn cmds\n}", "func (filterdev *NetworkTap) SetPromisc(m int) error {\n\t_, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(filterdev.device.Fd()), syscall.BIOCPROMISC, uintptr(unsafe.Pointer(&m)))\n\tif err != 0 {\n\t\treturn syscall.Errno(err)\n\t}\n\treturn nil\n}", "func SetAPI(token string, url string, ver string) {\n\tSetToken(token)\n\tif url != \"\" {\n\t\tAPI.URL = url\n\t}\n\tif ver != \"\" {\n\t\tAPI.Ver = ver\n\t}\n}", "func SetHTTPClient(client *http.Client) error {\n\tif client == nil {\n\t\treturn errHTTPClientInvalid\n\t}\n\tm.Lock()\n\t_HTTPClient = client\n\tm.Unlock()\n\treturn nil\n}", "func (c *Capabilities) Set(capability string, values ...string) {\n\tif _, ok := c.m[capability]; ok {\n\t\tdelete(c.m, capability)\n\t}\n\n\tc.Add(capability, values...)\n}", "func (f *Fridge) SetOn(turnOn bool) {\n\tlog.Warnf(\"SetOn: %v\", turnOn)\n\ts := f.GetStatusReport().Settings\n\tif s.On != turnOn {\n\t\ts.On = turnOn\n\t\tf.settingsC <- s\n\t}\n}" ]
[ "0.72971094", "0.66990113", "0.5628305", "0.55711406", "0.5487769", "0.53573465", "0.5282512", "0.5175293", "0.51374984", "0.5120229", "0.5111362", "0.5064141", "0.50546795", "0.49590006", "0.4958929", "0.48795363", "0.4874678", "0.4832962", "0.47898892", "0.47596237", "0.47570115", "0.4729475", "0.47120574", "0.47114974", "0.4703784", "0.46995518", "0.46916026", "0.46744516", "0.46723762", "0.4655997", "0.46167868", "0.4606578", "0.45966655", "0.45864534", "0.45732036", "0.45468912", "0.4541628", "0.45335716", "0.45240378", "0.45193875", "0.45104378", "0.4500928", "0.44997832", "0.44909668", "0.44605264", "0.4446379", "0.4444392", "0.44440767", "0.4443639", "0.44384602", "0.4438325", "0.44349933", "0.44225174", "0.44123697", "0.44066885", "0.44051096", "0.44017506", "0.44011462", "0.44006315", "0.43907622", "0.4390053", "0.43889502", "0.43465477", "0.43457073", "0.43401295", "0.43277475", "0.43243542", "0.432361", "0.43196765", "0.4319627", "0.43165633", "0.4315735", "0.43143612", "0.43073156", "0.43006477", "0.42933032", "0.42890325", "0.42783046", "0.42732254", "0.4263733", "0.42598003", "0.424707", "0.42416254", "0.42332438", "0.42321813", "0.42208725", "0.42166138", "0.42163426", "0.42153746", "0.42106125", "0.42073408", "0.420259", "0.41992882", "0.4198757", "0.4197218", "0.41938275", "0.41918752", "0.4180207", "0.4163537", "0.416253" ]
0.7992024
0
UpdateAdminRole updates role of an admin
UpdateAdminRole обновляет роль администратора
func (orm *ORM) UpdateAdminRole(ctx context.Context, adminID string, role string) (bool, error) { var _Admin models.Admin err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return false, errors.New("AdminNotFound") } _Admin.Role = role orm.DB.DB.Save(&_Admin) return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bs *DefaultSecurity) UpdateAdminRoles(login string, delete bool) error {\n\tfor i, name := range bs.Admins.Roles {\n\t\tif name == login {\n\t\t\tif delete {\n\t\t\t\tbs.Admins.Roles = append(bs.Admins.Roles[:i], bs.Admins.Roles[i+1:]...)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn errors.New(\"Role already exists\")\n\t\t}\n\t}\n\tbs.Admins.Roles = append(bs.Admins.Roles, login)\n\treturn nil\n}", "func (sc *ServiceController) UpdateRole(name string, body map[string]interface{}) (bool, string) {\n\turl := urlRole(sc.ID, name)\n\n\treturn sc.c.boolResponse(\"PUT\", url, body)\n}", "func (s *Server) UpdateRole(ctx context.Context, params *authorization.Role) (*authorization.Role, error) {\n\treturn &authorization.Role{}, nil\n}", "func (aaa *RolesService) AdminUpdateRoleV3(input *roles.AdminUpdateRoleV3Params) (*iamclientmodels.ModelRoleResponseV3, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, internalServerError, err := aaa.Client.Roles.AdminUpdateRoleV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif internalServerError != nil {\n\t\treturn nil, internalServerError\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func UpdateRole(c *gin.Context) {\n\tupdatedRole := model.Role{}\n\tc.BindJSON(&updatedRole)\n\n\terr := service.UpdateRole(updatedRole)\n\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\terror := service.GetGormErrorCode(err.Error())\n\n\t\tc.JSON(500, error)\n\t} else {\n\t\tc.String(200, \"ok\")\n\t}\n}", "func UpdateAdmin(w http.ResponseWriter, r *http.Request) {\n\tvar body UpdateAdminRequest\n\tif err := read.JSON(r.Body, &body); err != nil {\n\t\trender.Error(w, admin.WrapError(admin.ErrorBadRequestType, err, \"error reading request body\"))\n\t\treturn\n\t}\n\n\tif err := body.Validate(); err != nil {\n\t\trender.Error(w, err)\n\t\treturn\n\t}\n\n\tid := chi.URLParam(r, \"id\")\n\tauth := mustAuthority(r.Context())\n\tadm, err := auth.UpdateAdmin(r.Context(), id, &linkedca.Admin{Type: body.Type})\n\tif err != nil {\n\t\trender.Error(w, admin.WrapErrorISE(err, \"error updating admin %s\", id))\n\t\treturn\n\t}\n\n\trender.ProtoJSON(w, adm)\n}", "func (client *Client) UpdateRole(request *UpdateRoleRequest) (_result *UpdateRoleResponse, _err error) {\n\truntime := &util.RuntimeOptions{}\n\t_result = &UpdateRoleResponse{}\n\t_body, _err := client.UpdateRoleWithOptions(request, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = _body\n\treturn _result, _err\n}", "func (aaa *RolesService) AdminUpdateRoleV4(input *roles.AdminUpdateRoleV4Params) (*iamclientmodels.ModelRoleV4Response, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.AdminUpdateRoleV4(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func (aaa *RolesService) SetRoleAsAdmin(input *roles.SetRoleAsAdminParams) error {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.SetRoleAsAdmin(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn forbidden\n\t}\n\tif notFound != nil {\n\t\treturn notFound\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (aaa *RolesService) AdminUpdateAdminRoleStatusV3(input *roles.AdminUpdateAdminRoleStatusV3Params) error {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, badRequest, unauthorized, forbidden, notFound, internalServerError, err := aaa.Client.Roles.AdminUpdateAdminRoleStatusV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn forbidden\n\t}\n\tif notFound != nil {\n\t\treturn notFound\n\t}\n\tif internalServerError != nil {\n\t\treturn internalServerError\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (_PermInterface *PermInterfaceTransactor) ApproveAdminRole(opts *bind.TransactOpts, _orgId string, _account common.Address) (*types.Transaction, error) {\n\treturn _PermInterface.contract.Transact(opts, \"approveAdminRole\", _orgId, _account)\n}", "func (db *MySQLDB) UpdateRole(ctx context.Context, role *Role) error {\n\tfLog := mysqlLog.WithField(\"func\", \"UpdateRole\").WithField(\"RequestID\", ctx.Value(constants.RequestID))\n\texist, err := db.IsRoleRecIDExist(ctx, role.RecID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exist {\n\t\treturn ErrNotFound\n\t}\n\tq := \"UPDATE HANSIP_ROLE SET ROLE_NAME=?, ROLE_DOMAIN=?, DESCRIPTION=? WHERE REC_ID=?\"\n\t_, err = db.instance.ExecContext(ctx, q,\n\t\trole.RoleName, role.RoleDomain, role.Description, role.RecID)\n\tif err != nil {\n\t\tfLog.Errorf(\"db.instance.ExecContext got %s. SQL = %s\", err.Error(), q)\n\t\treturn &ErrDBExecuteError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error UpdateRole\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\treturn nil\n}", "func (store *Store) UpdateRole(name string, prms *graylog.RoleUpdateParams) (*graylog.Role, error) {\n\tstore.imutex.Lock()\n\tdefer store.imutex.Unlock()\n\trole, ok := store.roles[name]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(`no role with name \"%s\"`, name)\n\t}\n\tif prms.Description != nil {\n\t\trole.Description = *prms.Description\n\t}\n\trole.Permissions = prms.Permissions\n\trole.Name = prms.Name\n\tdelete(store.roles, name)\n\tstore.roles[role.Name] = role\n\treturn &role, nil\n}", "func (aaa *RolesService) UpdateRole(input *roles.UpdateRoleParams) (*iamclientmodels.ModelRoleResponse, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.UpdateRole(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func UpdateRole(u RoleCreated, id int) (role Role, err error) {\n\tq := `UPDATE roles \n\t\t\tSET name=$1, parent_id=$2 WHERE id=$3 RETURNING id, name, parent_id`\n\n\tdb := GetConnection()\n\n\tdefer db.Close()\n\n\terr = db.QueryRow(\n\t\tq,\n\t\tu.Name,\n\t\tu.ParentId,\n\t\tid,\n\t).Scan(\n\t\t&role.Id,\n\t\t&role.Name,\n\t\t&role.ParentId,\n\t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "func (s Service) UpdateRole(ctx context.Context, docID, roleID []byte, dids []identity.DID) (*coredocumentpb.Role, error) {\n\treturn s.pendingDocSrv.UpdateRole(ctx, docID, roleID, dids)\n}", "func RoleUpdate(r *models.Role) error {\n\tif r.Name != \"\" {\n\t\t// Check if name already exists\n\t\tvar count uint\n\t\tbootstrap.Db().Where(\"name = ? AND id <> ?\", r.Name, r.ID).Find(&models.Role{}).Count(&count)\n\n\t\tif count == 0 {\n\t\t\terr := bootstrap.Db().Save(r).Error\n\t\t\tif err != nil {\n\t\t\t\treturn errors.New(err.Error())\n\t\t\t}\n\t\t} else {\n\t\t\treturn errors.New(\"role with this name already exists\")\n\t\t}\n\t} else {\n\t\treturn errors.New(\"role with empty name if forbidden\")\n\t}\n\treturn nil\n}", "func (srv *Service) UpdateUserRole(id string, role string) (*string, error) {\n\t//check if the user exists\n\tresponse, err := srv.mongoRepository.GetUserByID(id)\n\tif response == nil { //user doesn't exist\n\t\treturn nil, &pkg.Error{Err: err, Code: http.StatusNotFound, Message: \"User not found\"}\n\t}\n\n\t//call driven adapter responsible for updating a user's role inside the database\n\t_, err = srv.mongoRepository.UpdateUserRole(id, role)\n\n\tif err != nil {\n\t\t//return the error sent by the repository\n\t\treturn nil, err\n\t}\n\n\tmessage := \"User's role updated sucessfully\"\n\n\treturn &message, nil\n}", "func (_PermInterface *PermInterfaceSession) ApproveAdminRole(_orgId string, _account common.Address) (*types.Transaction, error) {\n\treturn _PermInterface.Contract.ApproveAdminRole(&_PermInterface.TransactOpts, _orgId, _account)\n}", "func (r *mutationResolver) UpdateRole(ctx context.Context, id string, input *models.UpdateRoleInput) (*user.Role, error) {\n\tpanic(\"not implemented\")\n}", "func (_PermInterface *PermInterfaceTransactorSession) ApproveAdminRole(_orgId string, _account common.Address) (*types.Transaction, error) {\n\treturn _PermInterface.Contract.ApproveAdminRole(&_PermInterface.TransactOpts, _orgId, _account)\n}", "func (client *Client) UpdateRole(name string, role *graylog.RoleUpdateParams) (\n\t*graylog.Role, *ErrorInfo, error,\n) {\n\treturn client.UpdateRoleContext(context.Background(), name, role)\n}", "func (role *Role) Update() error {\n\toptions := metav1.GetOptions{}\n\n\tupdate, err := role.client.Kubernetes.\n\t\tRbacV1().\n\t\tRoles(role.Namespace).\n\t\tGet(role.client.Ctx, role.Name, options)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to update role %s in namespace %s: %w\", role.Name, role.Namespace, err)\n\t}\n\n\trole.Role = *update\n\n\treturn nil\n}", "func (aaa *RolesService) AdminUpdateRolePermissionsV3(input *roles.AdminUpdateRolePermissionsV3Params) error {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, badRequest, unauthorized, forbidden, notFound, internalServerError, err := aaa.Client.Roles.AdminUpdateRolePermissionsV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn forbidden\n\t}\n\tif notFound != nil {\n\t\treturn notFound\n\t}\n\tif internalServerError != nil {\n\t\treturn internalServerError\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func NewAdminRole() *Role {\n\treturn &Role{\n\t\tname: \"admin\",\n\t\tpermissionList: PermissionList{},\n\t}\n}", "func (aaa *RolesService) AdminUpdateRolePermissionsV4(input *roles.AdminUpdateRolePermissionsV4Params) (*iamclientmodels.ModelRoleV4Response, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.AdminUpdateRolePermissionsV4(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func (s *Shell) ChangeRole(c *cli.Context) (err error) {\n\trequest := struct {\n\t\tEmail string `json:\"email\"`\n\t\tNewRole string `json:\"newRole\"`\n\t}{\n\t\tEmail: c.String(\"email\"),\n\t\tNewRole: c.String(\"new-role\"),\n\t}\n\n\trequestData, err := json.Marshal(request)\n\tif err != nil {\n\t\treturn s.errorOut(err)\n\t}\n\n\tbuf := bytes.NewBuffer(requestData)\n\tresponse, err := s.HTTP.Patch(\"/v2/users\", buf)\n\tif err != nil {\n\t\treturn s.errorOut(err)\n\t}\n\tdefer func() {\n\t\tif cerr := response.Body.Close(); cerr != nil {\n\t\t\terr = multierr.Append(err, cerr)\n\t\t}\n\t}()\n\n\treturn s.renderAPIResponse(response, &AdminUsersPresenter{}, \"Successfully updated API user\")\n}", "func (_PermInterface *PermInterfaceTransactor) AssignAdminRole(opts *bind.TransactOpts, _orgId string, _account common.Address, _roleId string) (*types.Transaction, error) {\n\treturn _PermInterface.contract.Transact(opts, \"assignAdminRole\", _orgId, _account, _roleId)\n}", "func (cli *Service) UpdateRolePri(req *restful.Request, resp *restful.Response) {\n\n\tlanguage := util.GetActionLanguage(req)\n\townerID := util.GetOwnerID(req.Request.Header)\n\tdefErr := cli.Core.CCErr.CreateDefaultCCErrorIf(language)\n\tctx := util.GetDBContext(context.Background(), req.Request.Header)\n\tdb := cli.Instance.Clone()\n\n\tpathParams := req.PathParameters()\n\tobjID := pathParams[\"bk_obj_id\"]\n\tpropertyID := pathParams[\"bk_property_id\"]\n\tvalue, err := ioutil.ReadAll(req.Request.Body)\n\tif err != nil {\n\t\tblog.Error(\"read json data error :%v\", err)\n\t\tresp.WriteError(http.StatusBadRequest, &meta.RespError{Msg: defErr.New(common.CCErrCommHTTPReadBodyFailed, err.Error())})\n\t\treturn\n\t}\n\tvar roleJSON []string\n\terr = json.Unmarshal([]byte(value), &roleJSON)\n\tif err != nil {\n\t\tblog.Error(\"read json data error :%v\", err)\n\t\tresp.WriteError(http.StatusBadRequest, &meta.RespError{Msg: defErr.New(common.CCErrCommJSONUnmarshalFailed, err.Error())})\n\t\treturn\n\t}\n\tinput := make(map[string]interface{})\n\tcond := make(map[string]interface{})\n\tcond[common.BKOwnerIDField] = ownerID\n\tcond[common.BKObjIDField] = objID\n\tcond[common.BKPropertyIDField] = propertyID\n\tinput[common.BKPrivilegeField] = roleJSON\n\tcond = util.SetModOwner(cond, ownerID)\n\n\terr = db.Table(common.BKTableNamePrivilege).Update(ctx, cond, input)\n\tif nil != err {\n\t\tblog.Error(\"update role privilege error :%v\", err)\n\t\tresp.WriteError(http.StatusBadRequest, &meta.RespError{Msg: defErr.New(common.CCErrObjectDBOpErrno, err.Error())})\n\t\treturn\n\t}\n\n\tresp.WriteEntity(meta.Response{BaseResp: meta.SuccessBaseResp})\n}", "func (_TellorMesosphere *TellorMesosphereSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _TellorMesosphere.Contract.GetRoleAdmin(&_TellorMesosphere.CallOpts, role)\n}", "func (bs *DefaultSecurity) UpdateMemberRoles(login string, delete bool) error {\n\tfor i, name := range bs.Members.Roles {\n\t\tif name == login {\n\t\t\tif delete {\n\t\t\t\tbs.Members.Roles = append(bs.Members.Roles[:i], bs.Members.Roles[i+1:]...)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn errors.New(\"Role already exists\")\n\t\t}\n\t}\n\tbs.Members.Roles = append(bs.Members.Roles, login)\n\treturn nil\n}", "func (_Distributor *DistributorSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _Distributor.Contract.GetRoleAdmin(&_Distributor.CallOpts, role)\n}", "func (sec *DatabaseSecurity) AddAdminRole(role string) error {\n\tif err := sec.db.GetSecurity(sec); err != nil {\n\t\treturn err\n\t}\n\tsec.UpdateAdminRoles(role, false)\n\tif err := sec.db.SetSecurity(sec); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (_AccessControl *AccessControlFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*AccessControlRoleAdminChangedIterator, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar previousAdminRoleRule []interface{}\n\tfor _, previousAdminRoleItem := range previousAdminRole {\n\t\tpreviousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem)\n\t}\n\tvar newAdminRoleRule []interface{}\n\tfor _, newAdminRoleItem := range newAdminRole {\n\t\tnewAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem)\n\t}\n\n\tlogs, sub, err := _AccessControl.contract.FilterLogs(opts, \"RoleAdminChanged\", roleRule, previousAdminRoleRule, newAdminRoleRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AccessControlRoleAdminChangedIterator{contract: _AccessControl.contract, event: \"RoleAdminChanged\", logs: logs, sub: sub}, nil\n}", "func (roles *RoleProvider) Update(r *idam.Role) (*idam.Role, error) {\n\troles.lock.Lock()\n\tdefer roles.lock.Unlock()\n\n\trole, ok := roles.getRole(r.Name)\n\tif !ok {\n\t\treturn nil, idam.ErrUnknownRole\n\t}\n\n\trole.Permissions = []string{}\n\n\tfor _, p := range r.Permissions {\n\t\trole.Permissions = append(role.Permissions, p)\n\t}\n\n\trole.Updated = time.Now()\n\t// TODO(ppacher): should we also allow to update the creator of the role?\n\n\treturn copyRole(role), roles.saveToFile()\n}", "func (_TellorMesosphere *TellorMesosphereCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _TellorMesosphere.Contract.GetRoleAdmin(&_TellorMesosphere.CallOpts, role)\n}", "func (_PermInterface *PermInterfaceSession) AssignAdminRole(_orgId string, _account common.Address, _roleId string) (*types.Transaction, error) {\n\treturn _PermInterface.Contract.AssignAdminRole(&_PermInterface.TransactOpts, _orgId, _account, _roleId)\n}", "func (m *manager) AdminUpdate(ctx context.Context) error {\n\ttoRun := m.adminUpdate()\n\treturn m.runSteps(ctx, toRun, \"adminUpdate\")\n}", "func (_Distributor *DistributorCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _Distributor.Contract.GetRoleAdmin(&_Distributor.CallOpts, role)\n}", "func (r *RBAC) UpdateRoles(system, uid string, roles ...string) error {\n\tr.Cache.RemoveUser(system, uid)\n\treturn r.User.UpdateRoles(system, uid, roles...)\n}", "func (_DelegationController *DelegationControllerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _DelegationController.Contract.GetRoleAdmin(&_DelegationController.CallOpts, role)\n}", "func (_PermInterface *PermInterfaceTransactorSession) AssignAdminRole(_orgId string, _account common.Address, _roleId string) (*types.Transaction, error) {\n\treturn _PermInterface.Contract.AssignAdminRole(&_PermInterface.TransactOpts, _orgId, _account, _roleId)\n}", "func (_AccessControl *AccessControlFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *AccessControlRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar previousAdminRoleRule []interface{}\n\tfor _, previousAdminRoleItem := range previousAdminRole {\n\t\tpreviousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem)\n\t}\n\tvar newAdminRoleRule []interface{}\n\tfor _, newAdminRoleItem := range newAdminRole {\n\t\tnewAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem)\n\t}\n\n\tlogs, sub, err := _AccessControl.contract.WatchLogs(opts, \"RoleAdminChanged\", roleRule, previousAdminRoleRule, newAdminRoleRule)\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(AccessControlRoleAdminChanged)\n\t\t\t\tif err := _AccessControl.contract.UnpackLog(event, \"RoleAdminChanged\", 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}", "func ChangeAdminPassword(client *gophercloud.ServiceClient, id, newPassword string) (r ActionResult) {\n\tb := map[string]interface{}{\n\t\t\"changePassword\": map[string]string{\n\t\t\t\"adminPass\": newPassword,\n\t\t},\n\t}\n\tresp, err := client.Post(actionURL(client, id), b, nil, nil)\n\t_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)\n\treturn\n}", "func (r *RoleManagementRequest) Update(ctx context.Context, reqObj *RoleManagement) error {\n\treturn r.JSONRequest(ctx, \"PATCH\", \"\", reqObj, nil)\n}", "func (_DelegationController *DelegationControllerCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _DelegationController.Contract.GetRoleAdmin(&_DelegationController.CallOpts, role)\n}", "func (s *rpcServer) UpdateAdmin(ctx context.Context, req *api.UpdateAdminRequest) (*api.UpdateAdminResponse, error) {\n\tlogger := log.GetLogger(ctx)\n\tlogger.Debugf(\"%+v\", req)\n\tadmin, err := admin.ByID(req.AdminId)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Update all the fields\n\tadmin.Name = req.Admin.Name\n\tadmin.Email = req.Admin.Email\n\tadmin.ACL = req.Admin.ACL\n\tif err := admin.Save(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"error while saving admin to db\")\n\t}\n\treturn &api.UpdateAdminResponse{\n\t\tAdmin: &api.Admin{\n\t\t\tId: admin.ID,\n\t\t\tName: admin.Name,\n\t\t\tEmail: admin.Email,\n\t\t\tACL: admin.ACL,\n\t\t},\n\t}, nil\n}", "func (_AccessControl *AccessControlSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _AccessControl.Contract.GetRoleAdmin(&_AccessControl.CallOpts, role)\n}", "func (_AccessControl *AccessControlCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) {\n\treturn _AccessControl.Contract.GetRoleAdmin(&_AccessControl.CallOpts, role)\n}", "func (o *UpdateMemberRoleAdminV1Params) WithBody(body *groupclientmodels.ModelsUpdateMemberRoleRequestV1) *UpdateMemberRoleAdminV1Params {\n\to.SetBody(body)\n\treturn o\n}", "func (client *Client) UpdateRoleWithOptions(request *UpdateRoleRequest, runtime *util.RuntimeOptions) (_result *UpdateRoleResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\tquery := map[string]interface{}{}\n\tif !tea.BoolValue(util.IsUnset(request.NewAssumeRolePolicyDocument)) {\n\t\tquery[\"NewAssumeRolePolicyDocument\"] = request.NewAssumeRolePolicyDocument\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.NewDescription)) {\n\t\tquery[\"NewDescription\"] = request.NewDescription\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.NewMaxSessionDuration)) {\n\t\tquery[\"NewMaxSessionDuration\"] = request.NewMaxSessionDuration\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.RoleName)) {\n\t\tquery[\"RoleName\"] = request.RoleName\n\t}\n\n\treq := &openapi.OpenApiRequest{\n\t\tQuery: openapiutil.Query(query),\n\t}\n\tparams := &openapi.Params{\n\t\tAction: tea.String(\"UpdateRole\"),\n\t\tVersion: tea.String(\"2020-03-31\"),\n\t\tProtocol: tea.String(\"HTTPS\"),\n\t\tPathname: tea.String(\"/\"),\n\t\tMethod: tea.String(\"POST\"),\n\t\tAuthType: tea.String(\"AK\"),\n\t\tStyle: tea.String(\"RPC\"),\n\t\tReqBodyType: tea.String(\"formData\"),\n\t\tBodyType: tea.String(\"json\"),\n\t}\n\t_result = &UpdateRoleResponse{}\n\t_body, _err := client.CallApi(params, req, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "func (aaa *RolesService) AdminGetRoleAdminStatusV3(input *roles.AdminGetRoleAdminStatusV3Params) (*iamclientmodels.ModelRoleAdminStatusResponseV3, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, internalServerError, err := aaa.Client.Roles.AdminGetRoleAdminStatusV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif internalServerError != nil {\n\t\treturn nil, internalServerError\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func (o *UpdateMemberRoleAdminV1Params) WithHTTPClient(client *http.Client) *UpdateMemberRoleAdminV1Params {\n\to.SetHTTPClient(client)\n\treturn o\n}", "func (orm *ORM) UpdateAdmin(ctx context.Context, adminID string, fullname *string, email *string, phone *string) (bool, error) {\n\tvar _Admin models.Admin\n\n\terr := orm.DB.DB.First(&_Admin, \"id = ?\", adminID).Error\n\tif errors.Is(err, gorm.ErrRecordNotFound) {\n\t\treturn false, errors.New(\"AdminNotFound\")\n\t}\n\n\tif fullname != nil {\n\t\t_Admin.FullName = *fullname\n\t}\n\tif email != nil {\n\t\t_Admin.Email = *email\n\t}\n\tif phone != nil {\n\t\t_Admin.Phone = phone\n\t}\n\torm.DB.DB.Save(&_Admin)\n\treturn true, nil\n\n}", "func saveAdmin(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\ta := models.Admin{}\n\terr := e.Bind(&a)\n\tif err != nil {\n\t\treturn err\n\t}\n\ta.ServerUpdateDateTime = time.Now().UTC()\n\n\texisting := models.Admin{}\n\terr = db.C(\"Admins\").Find(bson.M{\"adminUuid\": a.AdminUUID}).One(&existing)\n\n\tif err == nil {\n\t\tif existing.ServerUpdateDateTime.After(a.LocalUpdateDateTime) {\n\t\t\t// Server version is more recent\n\t\t\treturn e.JSON(http.StatusConflict, existing)\n\t\t}\n\n\t\ta.AdminID = existing.AdminID\n\t\t_, err = db.C(\"Admins\").UpsertId(existing.AdminID, &a)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif a.AdminID == \"\" {\n\t\t\ta.AdminID = bson.NewObjectId().String()\n\t\t}\n\n\t\terr = db.C(\"Admins\").Insert(&a)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn e.JSON(http.StatusOK, a)\n}", "func (aaa *RolesService) AdminRemoveRoleAdminV3(input *roles.AdminRemoveRoleAdminV3Params) error {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, badRequest, unauthorized, forbidden, notFound, internalServerError, err := aaa.Client.Roles.AdminRemoveRoleAdminV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn forbidden\n\t}\n\tif notFound != nil {\n\t\treturn notFound\n\t}\n\tif internalServerError != nil {\n\t\treturn internalServerError\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (r *RoleCache) updateRoles(userID string, roles []string) error {\n\tkey := makeKey(userID)\n\tbyteVal, err := json.Marshal(&roles)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Error marshalling roles\")\n\t}\n\n\terr = r.DB.Update(func(tx *buntdb.Tx) error {\n\t\t_, _, err := tx.Set(key, string(byteVal), nil)\n\t\treturn err\n\t})\n\n\treturn err\n}", "func AddAdminPermission(roleID int, ActionID int, Enable int8) (userRole []orm.Params, err error) {\n\to := orm.NewOrm()\n\t_, err = o.Raw(\"INSERT INTO `_admin_permission` (`role_id`,`action_id`,`enable`) VALUES (?, ?, ?)\", &roleID, &ActionID, &Enable).Values(&userRole)\n\tfmt.Println(\"=========\", userRole)\n\treturn userRole, err\n}", "func RoleEditHandler(s *discordgo.Session, r *discordgo.GuildRoleUpdate) {\n\t// Get Server object\n\tserver, err := db.GetServer(r.GuildID)\n\tif err != nil && err != db.NotFound {\n\t\tlogger.Log.Error(err.Error())\n\t\treturn\n\t} else if err == db.NotFound {\n\t\treturn\n\t}\n\n\t// Check for playing Server\n\tif !server.Playing {\n\t\treturn\n\t}\n\n\t// Check Discord Role\n\tfor _, role := range server.Roles {\n\t\tif role.ID == r.Role.ID {\n\t\t\t// Revert to game requirement\n\t\t\tif r.Role.Hoist != role.Hoist || r.Role.Mentionable != role.Mentionable || r.Role.Permissions != server.RolePerm {\n\t\t\t\t_, err = s.GuildRoleEdit(server.ID, r.Role.ID, r.Role.Name, r.Role.Color, role.Hoist, server.RolePerm, role.Mentionable)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Log.Error(err.Error())\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n}", "func (o *UpdateMemberRoleAdminV1Params) WithTimeout(timeout time.Duration) *UpdateMemberRoleAdminV1Params {\n\to.SetTimeout(timeout)\n\treturn o\n}", "func (a *V1EmployeesApiService) UpdateEmployeeRole(ctx context.Context, body V1EmployeeRole, roleId string) (V1EmployeeRole, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Put\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue V1EmployeeRole\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/v1/me/roles/{role_id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"role_id\"+\"}\", fmt.Sprintf(\"%v\", roleId), -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 = &body\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 V1EmployeeRole\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}", "func NewUpdateRole(id string, name string, actions []string, projects []string) (*Role, error) {\n\trole := &Role{\n\t\tID: id,\n\t\tName: name,\n\t\tActions: actions,\n\t\tProjects: projects,\n\t}\n\n\treturn role, nil\n}", "func NewSetRoleAsAdminForbidden() *SetRoleAsAdminForbidden {\n\treturn &SetRoleAsAdminForbidden{}\n}", "func (_AccessControl *AccessControlCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _AccessControl.contract.Call(opts, &out, \"getRoleAdmin\", role)\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}", "func (_TellorMesosphere *TellorMesosphereCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _TellorMesosphere.contract.Call(opts, &out, \"getRoleAdmin\", role)\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}", "func (aaa *RolesService) UpdateRolePermissions(input *roles.UpdateRolePermissionsParams) error {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.UpdateRolePermissions(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn forbidden\n\t}\n\tif notFound != nil {\n\t\treturn notFound\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (s *UserRoleService) Update(userRole *UserRole) (*UserRole, error) {\n\tif userRole == nil {\n\t\treturn nil, internal.CreateRequiredParameterIsEmptyOrNilError(constants.ParameterUserRole)\n\t}\n\n\tpath, err := services.GetUpdatePath(s, userRole)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := services.ApiUpdate(s.GetClient(), userRole, new(UserRole), path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.(*UserRole), nil\n}", "func (handler httpRole) Edit() httphandler.HandlerFunc {\n\ttype Req struct {\n\t\tID string `binding:\"required\"`\n\t\tName string `binding:\"required\"`\n\t\tDescription string `binding:\"required\"`\n\t\tIcon string `binding:\"required\"`\n\t\tUpdatedAt time.Time `binding:\"required\"`\n\t}\n\tresp := jsont.F{\n\t\t\"UpdatedAt\": nil,\n\t}\n\treturn func(c *httphandler.Context) {\n\t\treq := Req{}\n\t\tif c.BindJSON(&req) {\n\t\t\treturn\n\t\t}\n\t\trec := coremodel.Role{\n\t\t\tID: req.ID,\n\t\t\tName: req.Name,\n\t\t\tDescription: req.Description,\n\t\t\tIcon: req.Icon,\n\t\t\tUpdatedAt: req.UpdatedAt,\n\t\t}\n\n\t\tbiz := corebiz.NewBizRole()\n\t\ttx := c.BeginTx(handler.DB)\n\t\terr := biz.Edit(c, tx.Tx, &rec)\n\t\tif c.HandleError(err) {\n\t\t\ttx.Rollback(c)\n\t\t\treturn\n\t\t}\n\t\ttx.Commit(c)\n\t\tc.JSONWithFields(rec, resp)\n\t}\n}", "func (aaa *RolesService) AdminCreateRoleV3(input *roles.AdminCreateRoleV3Params) (*iamclientmodels.AccountcommonRoleV3, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcreated, badRequest, unauthorized, forbidden, internalServerError, err := aaa.Client.Roles.AdminCreateRoleV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif internalServerError != nil {\n\t\treturn nil, internalServerError\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn created.GetPayload(), nil\n}", "func (bs *DefaultSecurity) UpdateAdmins(login string, delete bool) error {\n\tfor i, name := range bs.Admins.Names {\n\t\tif name == login {\n\t\t\tif delete {\n\t\t\t\tbs.Admins.Names = append(bs.Admins.Names[:i], bs.Admins.Names[i+1:]...)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn errors.New(\"Login already exists\")\n\t\t}\n\t}\n\tbs.Admins.Names = append(bs.Admins.Names, login)\n\treturn nil\n}", "func AdminUserPwdUpdate(context *gin.Context,\n\tcacheDB int,\n\tsqlHandle,\n\tadminUserID,\n\tadminUserPwd,\n\tadminUserAginPwd string) *protocol.Response {\n\n\tvar pwd, oldPwd string\n\tvar err error\n\tvar oldUser *models.AdminUser\n\tvar errResult protocol.Response\n\n\tif !util.VerifyPasswordFormat(pwd) {\n\t\tlog.Debug(\"Modify admin user password format error:%s\", pwd)\n\t\terrResult = code.SpawnErrPwdFormat()\n\t\tgoto fail\n\t}\n\n\tif pwd != adminUserAginPwd {\n\t\tlog.Debug(\"Modify admin user password first!=second\")\n\t\terrResult = code.SpawnErrPwdAgin()\n\t\tgoto fail\n\t}\n\n\toldUser, err = database.AdminUserQueryPwd(sqlHandle, adminUserID)\n\tif err != nil {\n\t\terrResult = code.SpawnErrSystemMsg(err.Error())\n\t\tgoto fail\n\t}\n\n\tpwd, err = aes.Encrypt(oldUser.Secret, adminUserPwd)\n\n\tif err = database.AdminUserPwdUpdate(sqlHandle, adminUserID, pwd); err != nil {\n\t\terrResult = code.SpawnErrSystemMsg(err.Error())\n\t\tgoto fail\n\t}\n\n\tif oldPwd, err = database.GetRdsOnlineAdminPassword(cacheDB, adminUserID); err == nil {\n\t\tif oldPwd != pwd {\n\t\t\tif err = database.WithRdsOnlineAdminPwd(cacheDB, adminUserID, pwd); err != nil {\n\t\t\t\tlog.Debug(\"Modify admin user online password error:%s\", err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\nfail:\n\treturn &errResult\n}", "func UpdateComputerRole(appID int, HostID string, registerStatus int, appName string) {\n\tif registerStatus != 0 && registerStatus != 1 {\n\t\treturn\n\t}\n\tif appID == 0 || HostID == \"\" {\n\t\treturn\n\t}\n\t//Model 方法在接受 struct 时只会映射 id 到 where 子句中\n\tvar app model.App\n\tif appID == 0 {\n\t\t// 根据 name 查找 app\n\t\tdb.Session().Where(&model.App{Name: appName}).Find(&app)\n\t\tappID = app.ID\n\t}\n\n\tdb.Session().Model(&model.ComputerRole{}).Where(&model.ComputerRole{AppID: appID, HostID: HostID}).Update(\"register_status\", registerStatus)\n}", "func (m *VpnConfiguration) SetRole(value *string)() {\n err := m.GetBackingStore().Set(\"role\", value)\n if err != nil {\n panic(err)\n }\n}", "func (_TellorMesosphere *TellorMesosphereFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*TellorMesosphereRoleAdminChangedIterator, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar previousAdminRoleRule []interface{}\n\tfor _, previousAdminRoleItem := range previousAdminRole {\n\t\tpreviousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem)\n\t}\n\tvar newAdminRoleRule []interface{}\n\tfor _, newAdminRoleItem := range newAdminRole {\n\t\tnewAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem)\n\t}\n\n\tlogs, sub, err := _TellorMesosphere.contract.FilterLogs(opts, \"RoleAdminChanged\", roleRule, previousAdminRoleRule, newAdminRoleRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TellorMesosphereRoleAdminChangedIterator{contract: _TellorMesosphere.contract, event: \"RoleAdminChanged\", logs: logs, sub: sub}, nil\n}", "func (aaa *RolesService) AdminGetRoleV3(input *roles.AdminGetRoleV3Params) (*iamclientmodels.ModelRoleResponseV3, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, internalServerError, err := aaa.Client.Roles.AdminGetRoleV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif internalServerError != nil {\n\t\treturn nil, internalServerError\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func (role *Role) Save() error {\n\tupdate, err := role.client.Kubernetes.\n\t\tRbacV1().\n\t\tRoles(role.Namespace).\n\t\tUpdate(role.client.Ctx, &role.Role, metav1.UpdateOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to save role %s in namespace %s: %w\", role.Name, role.Namespace, err)\n\t}\n\n\trole.Role = *update\n\n\treturn nil\n}", "func (_Distributor *DistributorCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _Distributor.contract.Call(opts, out, \"getRoleAdmin\", role)\n\treturn *ret0, err\n}", "func (client *Client) UpdateRoleContext(\n\tctx context.Context, name string, prms *graylog.RoleUpdateParams,\n) (*graylog.Role, *ErrorInfo, error) {\n\tif name == \"\" {\n\t\treturn nil, nil, errors.New(\"name is empty\")\n\t}\n\tif prms == nil {\n\t\treturn nil, nil, fmt.Errorf(\"role is nil\")\n\t}\n\tu, err := client.Endpoints().Role(name)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\trole := &graylog.Role{}\n\tei, err := client.callPut(ctx, u.String(), prms, role)\n\treturn role, ei, err\n}", "func (m *MockClientInterface) UpdateRole(modified *v11.Role) (*v11.Role, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateRole\", modified)\n\tret0, _ := ret[0].(*v11.Role)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (aaa *RolesService) AdminGetRolesV3(input *roles.AdminGetRolesV3Params) (*iamclientmodels.ModelRoleResponseWithManagersAndPaginationV3, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, internalServerError, err := aaa.Client.Roles.AdminGetRolesV3(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif internalServerError != nil {\n\t\treturn nil, internalServerError\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func IsAdmin(role AuthorizationRole) bool {\n\tif role == Admin || role == Owner {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (client ModelClient) UpdateEntityRoleResponder(resp *http.Response) (result OperationStatus, 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}", "func RequireAdminRole(errToReturn cherry.ErrConstruct) gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tif ctx.GetHeader(textproto.CanonicalMIMEHeaderKey(UserRoleXHeader)) != \"admin\" {\n\t\t\terr := errToReturn().AddDetails(\"only admin can do this\")\n\t\t\tgonic.Gonic(err, ctx)\n\t\t}\n\t}\n}", "func (aaa *RolesService) RemoveRoleAdmin(input *roles.RemoveRoleAdminParams) error {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.RemoveRoleAdmin(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn forbidden\n\t}\n\tif notFound != nil {\n\t\treturn notFound\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func UpdateAdminLoginTime(adminID string, admin *Admin) error {\n\toid, _ := primitive.ObjectIDFromHex(adminID)\n\t_, err := adminCollection.UpdateOne(context.TODO(), bson.M{\"_id\": oid}, bson.D{\n\t\tprimitive.E{Key: \"$currentDate\", Value: bson.D{\n\t\t\tprimitive.E{Key: \"last_login_at\", Value: true},\n\t\t}},\n\t})\n\tgetAdminByID(oid).Decode(&admin)\n\treturn err\n}", "func (_DelegationController *DelegationControllerCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _DelegationController.contract.Call(opts, out, \"getRoleAdmin\", role)\n\treturn *ret0, err\n}", "func SaveAdmin(admin *model.Admin) error {\n\n\tpassword, err := crypto.AESEncrypt(admin.Password)\n\tif err != nil {\n\t\treturn err\n\t}\n\tadmin.Password = password\n\tif admin.Password == \"\" {\n\t\treturn fmt.Errorf(\"Encrypt failure\")\n\t}\n\treturn db.From(\"admin\").Save(admin)\n\n}", "func (m *MockRoleClient) UpdateRole(modified *v11.Role) (*v11.Role, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateRole\", modified)\n\tret0, _ := ret[0].(*v11.Role)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "func (orm *ORM) UpdateAdminPassword(ctx context.Context, adminID string, oldPassword string, newPassword string) (bool, error) {\n\tvar _Admin models.Admin\n\n\terr := orm.DB.DB.First(&_Admin, \"id = ?\", adminID).Error\n\tif errors.Is(err, gorm.ErrRecordNotFound) {\n\t\treturn false, errors.New(\"AdminNotFound\")\n\t}\n\n\tisSame := validatehash.ValidateCipher(oldPassword, _Admin.Password)\n\tif isSame == false {\n\t\treturn false, errors.New(\"OldPasswordIncorrect\")\n\t}\n\n\t_Admin.Password = newPassword\n\torm.DB.DB.Save(&_Admin)\n\treturn true, nil\n\n}", "func (s *ProjectService) UpdateProjectRolePermission(p *UpdateProjectRolePermissionParams) (*UpdateProjectRolePermissionResponse, error) {\n\tresp, err := s.cs.newRequest(\"updateProjectRolePermission\", p.toURLValues())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar r UpdateProjectRolePermissionResponse\n\tif err := json.Unmarshal(resp, &r); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &r, nil\n}", "func (b *azureAuthBackend) pathRoleCreateUpdate(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {\n\troleName := data.Get(\"name\").(string)\n\tif roleName == \"\" {\n\t\treturn logical.ErrorResponse(\"missing role name\"), nil\n\t}\n\n\t// Check if the role already exists\n\trole, err := b.role(ctx, req.Storage, roleName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create a new entry object if this is a CreateOperation\n\tif role == nil {\n\t\tif req.Operation == logical.UpdateOperation {\n\t\t\treturn nil, errors.New(\"role entry not found during update operation\")\n\t\t}\n\t\trole = new(azureRole)\n\t}\n\n\tif policiesRaw, ok := data.GetOk(\"policies\"); ok {\n\t\trole.Policies = policyutil.ParsePolicies(policiesRaw)\n\t}\n\n\tperiodRaw, ok := data.GetOk(\"period\")\n\tif ok {\n\t\trole.Period = time.Duration(periodRaw.(int)) * time.Second\n\t} else if req.Operation == logical.CreateOperation {\n\t\trole.Period = time.Duration(data.Get(\"period\").(int)) * time.Second\n\t}\n\tif role.Period > b.System().MaxLeaseTTL() {\n\t\treturn logical.ErrorResponse(fmt.Sprintf(\"'period' of '%q' is greater than the backend's maximum lease TTL of '%q'\", role.Period.String(), b.System().MaxLeaseTTL().String())), nil\n\t}\n\n\tif tokenNumUsesRaw, ok := data.GetOk(\"num_uses\"); ok {\n\t\trole.NumUses = tokenNumUsesRaw.(int)\n\t} else if req.Operation == logical.CreateOperation {\n\t\trole.NumUses = data.Get(\"num_uses\").(int)\n\t}\n\tif role.NumUses < 0 {\n\t\treturn logical.ErrorResponse(\"num_uses cannot be negative\"), nil\n\t}\n\n\tif tokenTTLRaw, ok := data.GetOk(\"ttl\"); ok {\n\t\trole.TTL = time.Duration(tokenTTLRaw.(int)) * time.Second\n\t} else if req.Operation == logical.CreateOperation {\n\t\trole.TTL = time.Duration(data.Get(\"ttl\").(int)) * time.Second\n\t}\n\n\tif tokenMaxTTLRaw, ok := data.GetOk(\"max_ttl\"); ok {\n\t\trole.MaxTTL = time.Duration(tokenMaxTTLRaw.(int)) * time.Second\n\t} else if req.Operation == logical.CreateOperation {\n\t\trole.MaxTTL = time.Duration(data.Get(\"max_ttl\").(int)) * time.Second\n\t}\n\n\tif boundServicePrincipalIDs, ok := data.GetOk(\"bound_service_principal_ids\"); ok {\n\t\trole.BoundServicePrincipalIDs = boundServicePrincipalIDs.([]string)\n\t}\n\n\tif boundGroupIDs, ok := data.GetOk(\"bound_group_ids\"); ok {\n\t\trole.BoundGroupIDs = boundGroupIDs.([]string)\n\t}\n\n\tif boundSubscriptionsIDs, ok := data.GetOk(\"bound_subscription_ids\"); ok {\n\t\trole.BoundSubscriptionsIDs = boundSubscriptionsIDs.([]string)\n\t}\n\n\tif boundResourceGroups, ok := data.GetOk(\"bound_resource_groups\"); ok {\n\t\trole.BoundResourceGroups = boundResourceGroups.([]string)\n\t}\n\n\tif boundLocations, ok := data.GetOk(\"bound_locations\"); ok {\n\t\trole.BoundLocations = boundLocations.([]string)\n\t}\n\n\tif len(role.BoundServicePrincipalIDs) == 0 &&\n\t\tlen(role.BoundGroupIDs) == 0 &&\n\t\tlen(role.BoundSubscriptionsIDs) == 0 &&\n\t\tlen(role.BoundResourceGroups) == 0 &&\n\t\tlen(role.BoundLocations) == 0 {\n\t\treturn logical.ErrorResponse(\"must have at least one bound constraint when creating/updating a role\"), nil\n\t}\n\n\t// Check that the TTL value provided is less than the MaxTTL.\n\t// Sanitizing the TTL and MaxTTL is not required now and can be performed\n\t// at credential issue time.\n\tif role.MaxTTL > 0 && role.TTL > role.MaxTTL {\n\t\treturn logical.ErrorResponse(\"ttl should not be greater than max_ttl\"), nil\n\t}\n\n\tvar resp *logical.Response\n\tif role.MaxTTL > b.System().MaxLeaseTTL() {\n\t\tresp = &logical.Response{}\n\t\tresp.AddWarning(\"max_ttl is greater than the system or backend mount's maximum TTL value; issued tokens' max TTL value will be truncated\")\n\t}\n\n\t// Store the entry.\n\tentry, err := logical.StorageEntryJSON(\"role/\"+strings.ToLower(roleName), role)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif entry == nil {\n\t\treturn nil, fmt.Errorf(\"failed to create storage entry for role %s\", roleName)\n\t}\n\tif err = req.Storage.Put(ctx, entry); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp, nil\n}", "func (c *VaultController) reconcileMySQLRole(rClient database.DatabaseRoleInterface, role *api.MySQLRole) error {\n\t// create role\n\terr := rClient.CreateRole()\n\tif err != nil {\n\t\t_, err2 := patchutil.UpdateMySQLRoleStatus(\n\t\t\tcontext.TODO(),\n\t\t\tc.extClient.EngineV1alpha1(),\n\t\t\trole.ObjectMeta,\n\t\t\tfunc(status *api.MySQLRoleStatus) *api.MySQLRoleStatus {\n\t\t\t\tstatus.Conditions = kmapi.SetCondition(status.Conditions, kmapi.Condition{\n\t\t\t\t\tType: kmapi.ConditionFailed,\n\t\t\t\t\tStatus: core.ConditionTrue,\n\t\t\t\t\tReason: \"FailedToCreateRole\",\n\t\t\t\t\tMessage: err.Error(),\n\t\t\t\t})\n\t\t\t\treturn status\n\t\t\t}, metav1.UpdateOptions{},\n\t\t)\n\t\treturn utilerrors.NewAggregate([]error{err2, errors.Wrap(err, \"failed to create role\")})\n\t}\n\n\t_, err = patchutil.UpdateMySQLRoleStatus(\n\t\tcontext.TODO(),\n\t\tc.extClient.EngineV1alpha1(),\n\t\trole.ObjectMeta,\n\t\tfunc(status *api.MySQLRoleStatus) *api.MySQLRoleStatus {\n\t\t\tstatus.Phase = MySQLRolePhaseSuccess\n\t\t\tstatus.ObservedGeneration = role.Generation\n\t\t\tstatus.Conditions = kmapi.RemoveCondition(status.Conditions, kmapi.ConditionFailed)\n\t\t\tstatus.Conditions = kmapi.SetCondition(status.Conditions, kmapi.Condition{\n\t\t\t\tType: kmapi.ConditionAvailable,\n\t\t\t\tStatus: core.ConditionTrue,\n\t\t\t\tReason: \"Provisioned\",\n\t\t\t\tMessage: \"role is ready to use\",\n\t\t\t})\n\t\t\treturn status\n\t\t}, metav1.UpdateOptions{},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tglog.Infof(\"Successfully processed MySQLRole: %s/%s\", role.Namespace, role.Name)\n\treturn nil\n}", "func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {\n\tc := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.profileId = profileId\n\tc.userrole = userrole\n\treturn c\n}", "func (user *User) SetAsAdmin() {\n\tuser.Role = UserRoleAdmin\n}", "func (s *projService) UpdateProjectRoleType(ctx context.Context, req *pb.UpdateProjectRoleTypeRequest) (*pb.UpdateProjectRoleTypeResponse, error) {\n\tresp := &pb.UpdateProjectRoleTypeResponse{}\n\tvar err error\n\n\tsqlstring := `UPDATE tb_ProjectRoleType SET dtmModified = NOW(), intVersion = ?, chvRoleName = ?, chvDescription = ?\n\tWHERE intProjectRoleId = ? AND inbMserviceId = ? AND intVersion = ? AND bitIsDeleted = 0`\n\n\tstmt, err := s.db.Prepare(sqlstring)\n\tif err != nil {\n\t\tlevel.Error(s.logger).Log(\"what\", \"Prepare\", \"error\", err)\n\t\tresp.ErrorCode = 500\n\t\tresp.ErrorMessage = \"db.Prepare failed\"\n\t\treturn resp, nil\n\t}\n\n\tdefer stmt.Close()\n\n\tres, err := stmt.Exec(req.GetVersion()+1, req.GetRoleName(), req.GetDescription(), req.GetProjectRoleId(),\n\t\treq.GetMserviceId(), req.GetVersion())\n\n\tif err == nil {\n\t\trowsAffected, _ := res.RowsAffected()\n\t\tif rowsAffected == 1 {\n\t\t\tresp.Version = req.GetVersion() + 1\n\t\t} else {\n\t\t\tresp.ErrorCode = 404\n\t\t\tresp.ErrorMessage = \"not found\"\n\t\t}\n\t} else {\n\t\tresp.ErrorCode = 501\n\t\tresp.ErrorMessage = err.Error()\n\t\tlevel.Error(s.logger).Log(\"what\", \"Exec\", \"error\", err)\n\t\terr = nil\n\t}\n\n\treturn resp, err\n}", "func (aaa *RolesService) GetRoleAdminStatus(input *roles.GetRoleAdminStatusParams) (*iamclientmodels.ModelRoleAdminStatusResponse, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, unauthorized, forbidden, notFound, err := aaa.Client.Roles.GetRoleAdminStatus(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif unauthorized != nil {\n\t\treturn nil, unauthorized\n\t}\n\tif forbidden != nil {\n\t\treturn nil, forbidden\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "func (_TellorMesosphere *TellorMesosphereFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *TellorMesosphereRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar previousAdminRoleRule []interface{}\n\tfor _, previousAdminRoleItem := range previousAdminRole {\n\t\tpreviousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem)\n\t}\n\tvar newAdminRoleRule []interface{}\n\tfor _, newAdminRoleItem := range newAdminRole {\n\t\tnewAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem)\n\t}\n\n\tlogs, sub, err := _TellorMesosphere.contract.WatchLogs(opts, \"RoleAdminChanged\", roleRule, previousAdminRoleRule, newAdminRoleRule)\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(TellorMesosphereRoleAdminChanged)\n\t\t\t\tif err := _TellorMesosphere.contract.UnpackLog(event, \"RoleAdminChanged\", 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}", "func (m *Manager) UpdateMembership(globalid string, username string, oldrole string, newrole string) error {\n\tqry := bson.M{\"globalid\": globalid}\n\tpull := bson.M{\n\t\t\"$pull\": bson.M{oldrole: username},\n\t}\n\tpush := bson.M{\n\t\t\"$addToSet\": bson.M{newrole: username},\n\t}\n\terr := m.collection.Update(qry, pull)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn m.collection.Update(qry, push)\n}", "func (i *Impersonator) checkAndUpdateRole(rules []rbacv1.PolicyRule) (*rbacv1.ClusterRole, error) {\n\tname := ImpersonationPrefix + i.user.GetUID()\n\tvar role *rbacv1.ClusterRole\n\terr := retry.RetryOnConflict(retry.DefaultRetry, func() error {\n\t\tvar err error\n\t\trole, err = i.clusterContext.RBAC.ClusterRoles(\"\").Controller().Lister().Get(\"\", name)\n\t\tif apierrors.IsNotFound(err) {\n\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !reflect.DeepEqual(role.Rules, rules) {\n\t\t\trole.Rules = rules\n\t\t\trole, err = i.clusterContext.RBAC.ClusterRoles(\"\").Update(role)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn role, nil\n}", "func (strategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {\n\tnewObj := obj.(*rbac.Role)\n\terrorList := validation.ValidateRole(newObj)\n\treturn append(errorList, validation.ValidateRoleUpdate(newObj, old.(*rbac.Role))...)\n}" ]
[ "0.75154316", "0.719224", "0.7145205", "0.7117579", "0.69392425", "0.6890341", "0.6837208", "0.6815211", "0.67718214", "0.6735075", "0.6655265", "0.66327924", "0.6616167", "0.66020566", "0.6572484", "0.6556261", "0.6539695", "0.649078", "0.6460554", "0.64441735", "0.6400338", "0.6384954", "0.63679284", "0.63617283", "0.6344365", "0.63045996", "0.62083524", "0.61364526", "0.60812145", "0.6057436", "0.60437745", "0.5988364", "0.59871215", "0.5976981", "0.59573734", "0.59557533", "0.59512085", "0.5932643", "0.5931133", "0.5918562", "0.591611", "0.5910244", "0.5900621", "0.58966553", "0.5885235", "0.5884711", "0.58670187", "0.58659464", "0.5839014", "0.5819295", "0.57830584", "0.5748906", "0.5745791", "0.5707523", "0.5687581", "0.56840026", "0.5677717", "0.56656295", "0.56635696", "0.56589264", "0.5640189", "0.5591141", "0.5583818", "0.55703664", "0.5566521", "0.5562906", "0.55586857", "0.55506873", "0.5549509", "0.55415595", "0.5510588", "0.5505867", "0.55036813", "0.5502039", "0.54925394", "0.54757494", "0.54722077", "0.5467885", "0.5466293", "0.5458107", "0.54513144", "0.54416955", "0.5429317", "0.5408736", "0.5406538", "0.5401417", "0.5394746", "0.5384686", "0.5366677", "0.536205", "0.53604156", "0.53511995", "0.5334379", "0.5332529", "0.53263617", "0.5325027", "0.53197664", "0.5313249", "0.5312221", "0.5302615" ]
0.75749993
0
ResendCode helps to resend a new code
ResendCode помогает отправить новый код
func (orm *ORM) ResendCode(ctx context.Context, adminID string) (*models.Admin, error) { var _Admin models.Admin // check if admin exists err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return nil, errors.New("AdminNotFound") } //generate code code := generatecode.GenerateCode(6) //save in redis and expire in an hours time redisErr := orm.rdb.Set(ctx, fmt.Sprintf("%s", _Admin.ID), code, 1*time.Hour).Err() if redisErr != nil { return nil, redisErr } // send code to email mailErr := mail.SendMail(_Admin.Email, fmt.Sprintf("Your code is %s", code)) if mailErr != nil { return nil, mailErr } return &_Admin, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (dc *DexClient) ResendActivationCode(email string) error {\n\treturn dc.ResendActivationCodeContext(context.Background(), email)\n}", "func (dc *DexClient) ResendActivationCodeContext(ctx context.Context, email string) error {\n\t// Create request body\n\treq := map[string]string{\n\t\t\"email\": email,\n\t}\n\trBytes, err := json.Marshal(&req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn dc.responseOp(ctx, http.MethodPost, ResendActivationCodePath, bytes.NewBuffer(rBytes), nil)\n}", "func (c *Client) ResendEmailAddressVerificationCode(ctx context.Context) (*EmailAddressAuthenticationCodeInfo, error) {\n\tvar result EmailAddressAuthenticationCodeInfo\n\n\trequest := &ResendEmailAddressVerificationCodeRequest{}\n\tif err := c.rpc.Invoke(ctx, request, &result); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &result, nil\n}", "func (ctr *RegistRequestController) ResendEmailRegister(c echo.Context) error {\n\tresendEmailParams := new(param.ResendEmailParams)\n\n\tif err := c.Bind(resendEmailParams); err != nil {\n\t\tmsgErrBind := err.Error()\n\t\tfieldErr := utils.GetFieldBindForm(msgErrBind)\n\n\t\tif fieldErr != \"\" {\n\t\t\treturn c.JSON(http.StatusOK, cf.JsonResponse{\n\t\t\t\tStatus: cf.FailResponseCode,\n\t\t\t\tMessage: \"Invalid field \" + fieldErr,\n\t\t\t})\n\t\t}\n\t}\n\n\trequestObj, err := ctr.RegistRequestRepo.GetRegRequestsByID(resendEmailParams.RequestID)\n\tif err != nil {\n\t\tif err.Error() == pg.ErrNoRows.Error() {\n\t\t\treturn c.JSON(http.StatusOK, cf.JsonResponse{\n\t\t\t\tStatus: cf.FailResponseCode,\n\t\t\t\tMessage: \"Request is not exists\",\n\t\t\t})\n\t\t}\n\n\t\treturn c.JSON(http.StatusInternalServerError, cf.JsonResponse{\n\t\t\tStatus: cf.FailResponseCode,\n\t\t\tMessage: \"System error\",\n\t\t})\n\t}\n\n\tnewestRegistCode, err := ctr.RegCodeRepo.GetNewRegistCodeByRequestID(resendEmailParams.RequestID)\n\tif err != nil {\n\t\tif err.Error() != pg.ErrNoRows.Error() {\n\t\t\treturn c.JSON(http.StatusInternalServerError, cf.JsonResponse{\n\t\t\t\tStatus: cf.FailResponseCode,\n\t\t\t\tMessage: \"System error\",\n\t\t\t})\n\t\t}\n\t}\n\n\tif !newestRegistCode.ExpiredAt.IsZero() && newestRegistCode.ExpiredAt.After(utils.TimeNowUTC()) {\n\t\treturn c.JSON(http.StatusInternalServerError, cf.JsonResponse{\n\t\t\tStatus: cf.FailResponseCode,\n\t\t\tMessage: \"The register code is not expired yet, please check your email and spam mail\",\n\t\t})\n\t}\n\n\tresendEmailParams.Email = requestObj.Email\n\tregCodeObj, err := ctr.RegistRequestRepo.GetResendRegistCode(ctr.RegCodeRepo, resendEmailParams)\n\n\tif err != nil {\n\t\treturn c.JSON(http.StatusInternalServerError, cf.JsonResponse{\n\t\t\tStatus: cf.FailResponseCode,\n\t\t\tMessage: \"System error\",\n\t\t})\n\t}\n\n\tuserProfile := c.Get(\"user_profile\").(m.User)\n\torg, err := ctr.OrgRepo.SelectEmailAndPassword(userProfile.OrganizationID)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusInternalServerError, cf.JsonResponse{\n\t\t\tStatus: cf.FailResponseCode,\n\t\t\tMessage: \"System error\",\n\t\t})\n\t}\n\tif org.Email == \"\" || org.EmailPassword == \"\" {\n\t\treturn c.JSON(http.StatusUnprocessableEntity, cf.JsonResponse{\n\t\t\tStatus: cf.FailResponseCode,\n\t\t\tMessage: \"Your organization must have an email\",\n\t\t})\n\t}\n\n\tctr.InitSmtp(org.Email, org.EmailPassword)\n\n\tsampleData := new(param.SampleData)\n\tsampleData.SendTo = []string{regCodeObj.Email}\n\tsampleData.URL = os.Getenv(\"BASE_SPA_URL\") + \"/organization/create-organization/\" + regCodeObj.Code\n\tif err := ctr.SendMail(\"Micro Erp Registration Email\", sampleData, cf.CreateOrganizationTemplate); err != nil {\n\t\tctr.Logger.Error(err)\n\t\treturn c.JSON(http.StatusInternalServerError, cf.JsonResponse{\n\t\t\tStatus: cf.FailResponseCode,\n\t\t\tMessage: \"System error\",\n\t\t})\n\t}\n\n\treturn c.JSON(http.StatusOK, cf.JsonResponse{\n\t\tStatus: cf.SuccessResponseCode,\n\t\tMessage: \"Success\",\n\t})\n}", "func (v *Verifier) SatisfyCode(code string, kittyID string) error {\n\tif !v.Enabled {\n\t\treturn nil\n\t}\n\n\tsatisfyRequest, err := json.Marshal(SatisfyRequest{\n\t\tcode,\n\t\tkittyID,\n\t})\n\tif err != nil {\n\t\tv.log.WithError(err).Error(\"unable to marshal satisfy request\")\n\t\treturn err\n\t}\n\n\t// make a satisfy request to verification service\n\tresp, err := v.client.Post(\"/api/satisfy_code\",\n\t\t\"application/json\", bytes.NewBuffer(satisfyRequest))\n\tif err != nil {\n\t\tv.log.WithError(err).Error(\"failed to verify reservation code\")\n\t\treturn err\n\t}\n\n\tswitch resp.StatusCode {\n\tcase http.StatusNoContent:\n\t\tbreak\n\tcase http.StatusRequestTimeout:\n\t\treturn ErrSatisfyRequestTimeOut\n\tdefault:\n\t\treturn ErrSatisfyFailed\n\t}\n\n\treturn nil\n}", "func (service AccountsService) Reopen(code string) (*Response, error) {\n\taction := fmt.Sprintf(\"accounts/%s/reopen\", code)\n\treq, err := service.client.newRequest(\"PUT\", action, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn service.client.do(req, nil)\n}", "func (c *SeaterController) Code(code int) {\n\tc.Ctx.Output.SetStatus(code)\n}", "func (p *Persister) UseRecoveryCode(ctx context.Context, fID uuid.UUID, codeVal string) (*code.RecoveryCode, error) {\n\tctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, \"persistence.sql.UseRecoveryCode\")\n\tdefer span.End()\n\n\tvar recoveryCode *code.RecoveryCode\n\n\tnid := p.NetworkID(ctx)\n\n\tflowTableName := new(recovery.Flow).TableName(ctx)\n\n\tif err := sqlcon.HandleError(p.Transaction(ctx, func(ctx context.Context, tx *pop.Connection) (err error) {\n\n\t\t//#nosec G201 -- TableName is static\n\t\tif err := sqlcon.HandleError(tx.RawQuery(fmt.Sprintf(\"UPDATE %s SET submit_count = submit_count + 1 WHERE id = ? AND nid = ?\", flowTableName), fID, nid).Exec()); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar submitCount int\n\t\t// Because MySQL does not support \"RETURNING\" clauses, but we need the updated `submit_count` later on.\n\t\t//#nosec G201 -- TableName is static\n\t\tif err := sqlcon.HandleError(tx.RawQuery(fmt.Sprintf(\"SELECT submit_count FROM %s WHERE id = ? AND nid = ?\", flowTableName), fID, nid).First(&submitCount)); err != nil {\n\t\t\tif errors.Is(err, sqlcon.ErrNoRows) {\n\t\t\t\t// Return no error, as that would roll back the transaction\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\n\t\t// This check prevents parallel brute force attacks to generate the recovery code\n\t\t// by checking the submit count inside this database transaction.\n\t\t// If the flow has been submitted more than 5 times, the transaction is aborted (regardless of whether the code was correct or not)\n\t\t// and we thus give no indication whether the supplied code was correct or not. See also https://github.com/ory/kratos/pull/2645#discussion_r984732899\n\t\tif submitCount > 5 {\n\t\t\treturn errors.WithStack(code.ErrCodeSubmittedTooOften)\n\t\t}\n\n\t\tvar recoveryCodes []code.RecoveryCode\n\t\tif err = sqlcon.HandleError(tx.Where(\"nid = ? AND selfservice_recovery_flow_id = ?\", nid, fID).All(&recoveryCodes)); err != nil {\n\t\t\tif errors.Is(err, sqlcon.ErrNoRows) {\n\t\t\t\t// Return no error, as that would roll back the transaction\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\n\tsecrets:\n\t\tfor _, secret := range p.r.Config().SecretsSession(ctx) {\n\t\t\tsuppliedCode := []byte(p.hmacValueWithSecret(ctx, codeVal, secret))\n\t\t\tfor i := range recoveryCodes {\n\t\t\t\tcode := recoveryCodes[i]\n\t\t\t\tif subtle.ConstantTimeCompare([]byte(code.CodeHMAC), suppliedCode) == 0 {\n\t\t\t\t\t// Not the supplied code\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\trecoveryCode = &code\n\t\t\t\tbreak secrets\n\t\t\t}\n\t\t}\n\n\t\tif recoveryCode == nil || !recoveryCode.IsValid() {\n\t\t\t// Return no error, as that would roll back the transaction\n\t\t\treturn nil\n\t\t}\n\n\t\tvar ra identity.RecoveryAddress\n\t\tif err := tx.Where(\"id = ? AND nid = ?\", recoveryCode.RecoveryAddressID, nid).First(&ra); err != nil {\n\t\t\tif err = sqlcon.HandleError(err); !errors.Is(err, sqlcon.ErrNoRows) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\trecoveryCode.RecoveryAddress = &ra\n\n\t\t//#nosec G201 -- TableName is static\n\t\treturn sqlcon.HandleError(tx.RawQuery(fmt.Sprintf(\"UPDATE %s SET used_at = ? WHERE id = ? AND nid = ?\", recoveryCode.TableName(ctx)), time.Now().UTC(), recoveryCode.ID, nid).Exec())\n\t})); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif recoveryCode == nil {\n\t\treturn nil, code.ErrCodeNotFound\n\t}\n\n\tif recoveryCode.IsExpired() {\n\t\treturn nil, flow.NewFlowExpiredError(recoveryCode.ExpiresAt)\n\t}\n\n\tif recoveryCode.WasUsed() {\n\t\treturn nil, code.ErrCodeAlreadyUsed\n\t}\n\n\treturn recoveryCode, nil\n}", "func (controller *playgroundController) RunCode(ctx context.Context, info *pb.RunCodeRequest) (*pb.RunCodeResponse, error) {\n\t// check for correct sdk\n\tif info.Sdk != controller.env.BeamSdkEnvs.ApacheBeamSdk {\n\t\tlogger.Errorf(\"RunCode(): request contains incorrect sdk: %s\\n\", info.Sdk)\n\t\treturn nil, errors.InvalidArgumentError(\"Run code()\", \"incorrect sdk: \"+info.Sdk.String())\n\t}\n\tswitch info.Sdk {\n\tcase pb.Sdk_SDK_UNSPECIFIED, pb.Sdk_SDK_PYTHON, pb.Sdk_SDK_SCIO:\n\t\tlogger.Errorf(\"RunCode(): unimplemented sdk: %s\\n\", info.Sdk)\n\t\treturn nil, errors.InvalidArgumentError(\"Run code()\", \"unimplemented sdk: \"+info.Sdk.String())\n\t}\n\n\tcacheExpirationTime := controller.env.ApplicationEnvs.CacheEnvs().KeyExpirationTime()\n\tpipelineId := uuid.New()\n\n\tlc, err := life_cycle.Setup(info.Sdk, info.Code, pipelineId, controller.env.ApplicationEnvs.WorkingDir())\n\tif err != nil {\n\t\tlogger.Errorf(\"RunCode(): error during setup file system: %s\\n\", err.Error())\n\t\treturn nil, errors.InternalError(\"Run code\", \"Error during setup file system: \"+err.Error())\n\t}\n\n\tcompileBuilder, err := compile_builder.Setup(lc.GetAbsoluteExecutableFilePath(), lc.GetAbsoluteExecutableFilesFolderPath(), info.Sdk, controller.env.BeamSdkEnvs.ExecutorConfig)\n\tif err != nil {\n\t\tlogger.Errorf(\"RunCode(): error during setup run builder: %s\\n\", err.Error())\n\t\treturn nil, errors.InvalidArgumentError(\"Run code\", \"Error during setup compile builder: \"+err.Error())\n\t}\n\n\tif err = utils.SetToCache(ctx, controller.cacheService, pipelineId, cache.Status, pb.Status_STATUS_VALIDATING); err != nil {\n\t\treturn nil, errors.InternalError(\"Run code()\", \"Error during set value to cache: \"+err.Error())\n\t}\n\tif err = controller.cacheService.SetExpTime(ctx, pipelineId, cacheExpirationTime); err != nil {\n\t\tlogger.Errorf(\"%s: RunCode(): cache.SetExpTime(): %s\\n\", pipelineId, err.Error())\n\t\treturn nil, errors.InternalError(\"Run code()\", \"Error during set expiration to cache: \"+err.Error())\n\t}\n\n\t// TODO change using of context.TODO() to context.Background()\n\tgo code_processing.Process(context.TODO(), controller.cacheService, lc, compileBuilder, pipelineId, &controller.env.ApplicationEnvs, &controller.env.BeamSdkEnvs)\n\n\tpipelineInfo := pb.RunCodeResponse{PipelineUuid: pipelineId.String()}\n\treturn &pipelineInfo, nil\n}", "func (controller *playgroundController) RunCode(ctx context.Context, info *pb.RunCodeRequest) (*pb.RunCodeResponse, error) {\n\t// check if we can take a new RunCode request\n\tif !utils.CheckNumOfTheParallelJobs(controller.env.ApplicationEnvs.WorkingDir(), controller.env.BeamSdkEnvs.NumOfParallelJobs()) {\n\t\tlogger.Warnf(\"RunCode(): number of parallel jobs is exceeded\\n\")\n\t\treturn nil, cerrors.ResourceExhaustedError(\"Error during preparing\", \"Number of parallel jobs is exceeded\")\n\t}\n\t// check for correct sdk\n\tif info.Sdk != controller.env.BeamSdkEnvs.ApacheBeamSdk {\n\t\tlogger.Errorf(\"RunCode(): request contains incorrect sdk: %s\\n\", info.Sdk)\n\t\treturn nil, cerrors.InvalidArgumentError(\"Error during preparing\", \"Incorrect sdk. Want to receive %s, but the request contains %s\", controller.env.BeamSdkEnvs.ApacheBeamSdk.String(), info.Sdk.String())\n\t}\n\tswitch info.Sdk {\n\tcase pb.Sdk_SDK_UNSPECIFIED:\n\t\tlogger.Errorf(\"RunCode(): unimplemented sdk: %s\\n\", info.Sdk)\n\t\treturn nil, cerrors.InvalidArgumentError(\"Error during preparing\", \"Sdk is not implemented yet: %s\", info.Sdk.String())\n\t}\n\n\tcacheExpirationTime := controller.env.ApplicationEnvs.CacheEnvs().KeyExpirationTime()\n\tpipelineId := uuid.New()\n\n\tsources := make([]entity.FileEntity, 0)\n\tif len(info.Files) > 0 {\n\t\tfor _, file := range info.Files {\n\t\t\tsources = append(sources, entity.FileEntity{\n\t\t\t\tName: file.Name,\n\t\t\t\tContent: file.Content,\n\t\t\t\tIsMain: file.IsMain,\n\t\t\t\tCntxLine: 1,\n\t\t\t})\n\t\t}\n\t} else {\n\t\tfileName, err := utils.GetFileName(\"\", info.Code, info.Sdk)\n\t\tif err != nil {\n\t\t\treturn nil, cerrors.InternalError(errorTitleRunCode, \"Failed to get default filename\")\n\t\t}\n\t\tsources = append(sources, entity.FileEntity{\n\t\t\tName: fileName,\n\t\t\tContent: info.Code,\n\t\t\tIsMain: true,\n\t\t\tCntxLine: 1,\n\t\t})\n\t}\n\n\temulatorConfiguration := emulators.EmulatorConfiguration{\n\t\tDatasets: info.Datasets,\n\t\tDatasetsPath: controller.env.ApplicationEnvs.DatasetsPath(),\n\t\tKafkaEmulatorExecutablePath: controller.env.ApplicationEnvs.KafkaExecutablePath(),\n\t}\n\n\tlc, err := life_cycle.Setup(info.Sdk, sources, pipelineId, controller.env.ApplicationEnvs.WorkingDir(), controller.env.ApplicationEnvs.PipelinesFolder(), controller.env.BeamSdkEnvs.PreparedModDir(), emulatorConfiguration)\n\tif err != nil {\n\t\tlogger.Errorf(\"RunCode(): error during setup file system: %s\\n\", err.Error())\n\t\treturn nil, cerrors.InternalError(\"Error during preparing\", \"Error during setup file system for the code processing: %s\", err.Error())\n\t}\n\n\tif err = utils.SetToCache(controller.cacheService, pipelineId, cache.Status, pb.Status_STATUS_VALIDATING); err != nil {\n\t\tcode_processing.DeleteResources(pipelineId, lc)\n\t\treturn nil, cerrors.InternalError(\"Error during preparing\", \"Error during saving status of the code processing\")\n\t}\n\tif err = utils.SetToCache(controller.cacheService, pipelineId, cache.RunOutputIndex, 0); err != nil {\n\t\tcode_processing.DeleteResources(pipelineId, lc)\n\t\treturn nil, cerrors.InternalError(\"Error during preparing\", \"Error during saving initial run output\")\n\t}\n\tif err = utils.SetToCache(controller.cacheService, pipelineId, cache.LogsIndex, 0); err != nil {\n\t\tcode_processing.DeleteResources(pipelineId, lc)\n\t\treturn nil, cerrors.InternalError(\"Error during preparing\", \"Error during saving value for the logs output\")\n\t}\n\tif err = utils.SetToCache(controller.cacheService, pipelineId, cache.Canceled, false); err != nil {\n\t\tcode_processing.DeleteResources(pipelineId, lc)\n\t\treturn nil, cerrors.InternalError(\"Error during preparing\", \"Error during saving initial cancel flag\")\n\t}\n\tif err = controller.cacheService.SetExpTime(ctx, pipelineId, cacheExpirationTime); err != nil {\n\t\tlogger.Errorf(\"%s: RunCode(): cache.SetExpTime(): %s\\n\", pipelineId, err.Error())\n\t\tcode_processing.DeleteResources(pipelineId, lc)\n\t\treturn nil, cerrors.InternalError(\"Error during preparing\", \"Internal error\")\n\t}\n\n\tgo code_processing.Process(context.Background(), controller.cacheService, lc, pipelineId, &controller.env.ApplicationEnvs, &controller.env.BeamSdkEnvs, info.PipelineOptions)\n\n\tpipelineInfo := pb.RunCodeResponse{PipelineUuid: pipelineId.String()}\n\treturn &pipelineInfo, nil\n}", "func failWithRcode(w dns.ResponseWriter, r *dns.Msg, rCode int) {\n m := new(dns.Msg)\n m.SetRcode(r, rCode)\n w.WriteMsg(m)\n m = nil\n}", "func (provider *GoogleProvider) RedeemCode(code string, redirectURL string, state string) (*RedeemResponse, error) {\n\tparams := url.Values{}\n\tparams.Add(\"redirect_uri\", redirectURL)\n\tparams.Add(\"client_id\", config.Config.GoogleClientID)\n\tparams.Add(\"client_secret\", config.Config.GoogleClientSecret)\n\tparams.Add(\"code\", code)\n\tparams.Add(\"grant_type\", \"authorization_code\")\n\n\tvar req *http.Request\n\treq, err := http.NewRequest(\"POST\", provider.pData.RedeemURL.String(), bytes.NewBufferString(params.Encode()))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar body []byte\n\tbody, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = resp.Body.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\terr = fmt.Errorf(\"got %d from %q %s\", resp.StatusCode, provider.pData.RedeemURL.String(), body)\n\t\treturn nil, err\n\t}\n\n\tvar jsonResponse struct {\n\t\tAccessToken string `json:\"access_token\"`\n\t\tRefreshToken string `json:\"refresh_token\"`\n\t\tExpiresIn int64 `json:\"expires_in\"`\n\t\tIDToken string `json:\"id_token\"`\n\t}\n\terr = json.Unmarshal(body, &jsonResponse)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tredeemResponse := RedeemResponse{}\n\tredeemResponse.AccessToken = jsonResponse.AccessToken\n\tredeemResponse.RefreshToken = jsonResponse.RefreshToken\n\tredeemResponse.ExpiresOn = time.Now().Add(time.Duration(jsonResponse.ExpiresIn) * time.Second).Truncate(time.Second)\n\tredeemResponse.IDToken = jsonResponse.IDToken\n\treturn &redeemResponse, nil\n}", "func codeHandler(w http.ResponseWriter, r *http.Request) {\n\tif r.Method == \"POST\" {\n\t\tconn, err := net.Dial(\"tcp\", \"localhost:\" + tcpPort)\n\t\tdata := make(map[string]string)\n\t\tdata[\"message\"] = \"\"\n\t\tdata[\"error\"] = \"\"\n\t\tdefer conn.Close()\n\t\tif err != nil {\n\t\t\tdata[\"error\"] = err.Error()\n\t\t\td, err := json.Marshal(data)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"Got an error encoding json error\", err.Error())\n\t\t\t}\n\t\t\tfmt.Fprint(w, d)\n\t\t\treturn\n\t\t}\n\t\tcode := r.FormValue(\"code\")\n\t\tconn.Write([]byte(code))\n\t\tconn.Write([]byte(\"\\n\"))\n\t\tconn.Write([]byte(\"exit()\"))\n\t\tconn.Write([]byte(\"\\n\"))\n\t\tbuf, _ := ioutil.ReadAll(conn)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tdata[\"message\"] = string(buf)\n\t\td, err := json.Marshal(data)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Got an error encoding json message\", err.Error())\n\t\t}\n\t\tfmt.Fprint(w, string(d))\n\t\treturn\n\t}\n\thttp.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)\n}", "func ApplyCode(target string, scene constk.CaptchaSceneType, options *ApplyCodeOptions) (code string,\n\te cserr.ICSErrCodeError) {\n\n\tstate := model.DbCaptchaState{\n\t\tTarget: target,\n\t\tScene: uint32(scene),\n\t}\n\ttimeNow := time.Now().Unix()\n\tdb := CaptchaDb\n\tnotExists := false\n\tif db.Table(DbCaptchaStateTbNameBase).First(&state, \"target=? AND scene=?\", target, scene).RecordNotFound() {\n\t\t//not exist ok , insert\n\t\tnotExists = true\n\t} else {\n\t\tif state.LastGenTime+int64(options.LimitGenTime) > timeNow {\n\t\t\tlog.Warnf(\"error target:%s gen code hz too high\", target)\n\t\t\te = cserr.ErrCaptcha\n\t\t\treturn\n\t\t}\n\t\t//update\n\t\tnotExists = false\n\t}\n\n\tcharset := util.GetRandCharset(options.Charset)\n\tcode = util.RandomStringWithCharset(options.MaxLength, charset)\n\n\tstate.ExpiredTime = timeNow + int64(options.Timeout)\n\tstate.LastGenTime = timeNow\n\tstate.Code = code\n\tstate.CheckedTimes = options.CheckTimes\n\n\tvar err error\n\tif notExists {\n\t\tstate.Uuid = uuid.NewV4().String()\n\t\terr = CaptchaDb.Table(DbCaptchaStateTbNameBase).Create(&state).Error\n\t} else {\n\t\terr = CaptchaDb.Table(DbCaptchaStateTbNameBase).Where(\"Target=? AND Scene=? \",\n\t\t\ttarget, scene).Updates(model.DbCaptchaState{\n\t\t\tCode: code,\n\t\t\tExpiredTime: state.ExpiredTime,\n\t\t\tLastGenTime: state.LastGenTime,\n\t\t\tCheckedTimes: state.CheckedTimes,\n\t\t}).Error\n\t}\n\tif err != nil {\n\t\tlog.Errorf(err, \"db save captcha sate fail for target:%s\", target)\n\t\te = cserr.ErrCaptcha\n\t\treturn\n\t}\n\n\treturn\n}", "func (p *OktaProvider) Redeem(redirectURL, code string) (*sessions.SessionState, error) {\n\tif code == \"\" {\n\t\treturn nil, ErrBadRequest\n\t}\n\tparams := url.Values{}\n\tparams.Add(\"redirect_uri\", redirectURL)\n\tparams.Add(\"client_id\", p.ClientID)\n\tparams.Add(\"client_secret\", p.ClientSecret)\n\tparams.Add(\"code\", code)\n\tparams.Add(\"grant_type\", \"authorization_code\")\n\tparams.Add(\"scope\", p.Scope)\n\n\tvar response struct {\n\t\tAccessToken string `json:\"access_token\"`\n\t\tRefreshToken string `json:\"refresh_token\"`\n\t\tExpiresIn int64 `json:\"expires_in\"`\n\t\tIDToken string `json:\"id_token\"`\n\t}\n\terr := p.oktaRequest(\"POST\", p.RedeemURL.String(), params, []string{\"action:redeem\"}, nil, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar email string\n\temail, err = p.verifyEmailWithAccessToken(response.AccessToken)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &sessions.SessionState{\n\t\tAccessToken: response.AccessToken,\n\t\tRefreshToken: response.RefreshToken,\n\n\t\tRefreshDeadline: sessions.ExtendDeadline(time.Duration(response.ExpiresIn) * time.Second),\n\t\tLifetimeDeadline: sessions.ExtendDeadline(p.SessionLifetimeTTL),\n\t\tEmail: email,\n\t}, nil\n}", "func (o *ReorderSecurityRealmsOK) Code() int {\n\treturn 200\n}", "func Code(w http.ResponseWriter, r *http.Request) {\n\tfilter, queryErr := getFilter(r)\n\tvar response string\n\tif queryErr != nil {\n\t\tresponse = `QUERY ERROR\\n` + queryErr.Error()\n\t} else {\n\t\tdumpcapOut, dumpcapErr := callDumpcap(filter)\n\t\tif dumpcapErr != nil {\n\t\t\tresponse = dumpcapErr.Error()\n\t\t} else {\n\t\t\tresponse = \"(000)\" + strings.SplitN(string(dumpcapOut), \"(000)\", 2)[1]\n\t\t}\n\t}\n\tw.Write([]byte(response + \"\\n\"))\n}", "func (h *dnsHeader) setRspRCode(que *dnsQuestion) {\n\tif que.qType != aRecord {\n\t\th.flags &= (^errNotImplemented)\n\t\th.flags |= errNotImplemented\n\t} else if que.event == eventNxDomain {\n\t\th.flags &= (^errRefused)\n\t\th.flags |= errRefused\n\t}\n}", "func SendRestoreCodeToUser(mail, code string) {\n\tfrom := \"forum.bot.alem@gmail.com\"\n\tpassword := \"8LYL6GnWpwqgs3k\" // Receiver email address.\n\tto := []string{\n\t\tmail,\n\t} // smtp server configuration.\n\tsmtpServer := smtpServer{host: \"smtp.gmail.com\", port: \"587\"}\n\tmsg := \"Here your code to restore your password: \" + code // Message.\n\tmessage := []byte(msg) // Authentication.\n\tauth := smtp.PlainAuth(\"\", from, password, smtpServer.host) // Sending email.\n\terr := smtp.SendMail(smtpServer.Address(), auth, from, to, message)\n\tif err != nil {\n\t\tfmt.Println(\"Sending mail is broken srry\")\n\t\treturn\n\t}\n}", "func (o *ReinstallMachineDefault) Code() int {\n\treturn o._statusCode\n}", "func WriteCustomCode(response http.ResponseWriter, code int, data ...interface{}) {\n\tGetReply(response, code, data...).Write()\n}", "func RunCode(c *fiber.Ctx) error {\n\t// New incoming code\n\tuserCode := new(model.UserCode)\n\n\t// Parse body into struct\n\tif bodyErr := c.BodyParser(userCode); bodyErr != nil {\n\t\treturn c.Status(400).SendString(bodyErr.Error())\n\t}\n\t//log.Println(userCode.Input)\n\n\tf, fileErr := os.Create(\"./testproblems/linked_lists/user.c\")\n\tif fileErr != nil {\n\t\treturn c.Status(500).SendString(fileErr.Error())\n\t}\n\t_, writeErr := f.WriteString(userCode.Input)\n\tif writeErr != nil {\n\t\treturn c.Status(500).SendString(writeErr.Error())\n\t}\n\n\t// Limit the bash script to only run for 3 seconds\n\tctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)\n\tdefer cancel()\n\n\tcmd := exec.CommandContext(ctx, \"bash\", \"runTest.sh\")\n\n\tcmd.Dir = \"testproblems/linked_lists/\"\n\n\tvar stdout []byte\n\tvar errStdout error\n\tstdoutIn, _ := cmd.StdoutPipe()\n\tstderrIn, _ := cmd.StderrPipe()\n\n\terr := cmd.Start()\n\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo func() {\n\t\tstdout, errStdout = copyAndCapture(stdoutIn)\n\t\twg.Done()\n\t}()\n\tvar stderr []byte\n\tvar errStderr error\n\t_ = stderr\n\t_ = errStderr\n\tstderr, errStderr = copyAndCapture(stderrIn)\n\n\twg.Wait()\n\n\terr = cmd.Wait()\n\n\tif err != nil {\n\t\tlog.Println(\"GOT ERROR:\", err.Error())\n\t\tvar errOutput string\n\t\tif err.Error() == \"exit status 1\" {\n\t\t\terrOutput = err.Error()\n\t\t\tif strings.Contains(errOutput, \"Segmentation fault\") {\n\t\t\t\terrOutput = \"Segmentation Fault: You might have forgot to check for NULL\"\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Println(\"Timed out?\")\n\t\t\terrOutput = \"Process Timed Out (Code exceeded 3 Seconds)\"\n\t\t}\n\t\treturn c.Status(400).JSON(fiber.Map{\"error\": errOutput})\n\t}\n\n\tresult := fiber.Map{\"output\": stdout}\n\treturn c.JSON(result)\n}", "func respondHTTPCodeOnly(w http.ResponseWriter, code int) {\n w.WriteHeader(code)\n}", "func (o *ReplaceServerDefault) Code() int {\n\treturn o._statusCode\n}", "func newCodeResponseWriter(w http.ResponseWriter) *codeResponseWriter {\n\treturn &codeResponseWriter{w, http.StatusOK}\n}", "func (o *UpdateLoginFlowWithCodeMethod) SetResend(v string) {\n\to.Resend = &v\n}", "func runCode(e string, code []byte, fn string, num *int, args []string) []byte {\n\tf, found := extensionMap[e]\n\tif found {\n\t\treturn f(code, fn, num, args)\n\t} else {\n\t\treturn []byte(\"Error: Extension not found.\")\n\t}\n}", "func (s *Session) restoreCode() {\n\ts.mainBody.List = s.lastStmts\n\tdecls := make([]ast.Decl, 0, len(s.file.Decls))\n\tfor _, d := range s.file.Decls {\n\t\tif d, ok := d.(*ast.FuncDecl); ok && d.Name.String() != \"main\" {\n\t\t\tfor _, ld := range s.lastDecls {\n\t\t\t\tif ld, ok := ld.(*ast.FuncDecl); ok && ld.Name.String() == d.Name.String() {\n\t\t\t\t\tdecls = append(decls, ld)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tdecls = append(decls, d)\n\t}\n\ts.file.Decls = decls\n}", "func (r *Realm) ExpireCode(db *Database, uuid string, actor Auditable) (*VerificationCode, error) {\n\tif actor == nil {\n\t\treturn nil, ErrMissingActor\n\t}\n\n\tvar vc VerificationCode\n\tif err := db.db.Transaction(func(tx *gorm.DB) error {\n\t\tif err := tx.\n\t\t\tSet(\"gorm:query_option\", \"FOR UPDATE\").\n\t\t\tWhere(\"realm_id = ? AND uuid = ?\", r.ID, uuid).\n\t\t\tFirst(&vc).\n\t\t\tError; err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get existing verification code: %w\", err)\n\t\t}\n\n\t\t// We don't want to update the expiration time on an already-expired code,\n\t\t// but this also isn't an error, so just return now.\n\t\tif vc.IsExpired() {\n\t\t\treturn nil\n\t\t}\n\n\t\t// It's not possible to expire an already-claimed code.\n\t\tif vc.Claimed {\n\t\t\treturn ErrCodeAlreadyClaimed\n\t\t}\n\n\t\toldExpires := vc.ExpiresAt\n\t\tvc.ExpiresAt = time.Now().UTC()\n\t\tvc.LongExpiresAt = vc.ExpiresAt\n\t\tif err := tx.Save(&vc).Error; err != nil {\n\t\t\treturn fmt.Errorf(\"failed to save verification code: %w\", err)\n\t\t}\n\n\t\taudit := BuildAuditEntry(actor, \"expired verification code\", &vc, r.ID)\n\t\taudit.Diff = stringDiff(oldExpires.Format(time.RFC3339), vc.ExpiresAt.Format(time.RFC3339))\n\t\tif err := tx.Save(audit).Error; err != nil {\n\t\t\treturn fmt.Errorf(\"failed to save audits: %w\", err)\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &vc, nil\n}", "func Code(code int) {\n\tDefault.ExitCode = code\n\tpanic(msg{Default, \"\"})\n}", "func (code *phoneCodeData) SendCode(theCode string, string, int) error {\n\tfmt.Println(\"SendCode()\");\n\n\tendpoint := \"https://api.twilio.com/2010-04-01/Accounts/AC25c34e873eb0348a2a7b9510f9282319/Messages.json\"\n v := url.Values{}\n v.Set(\"To\", code.phoneName)\n v.Add(\"From\", \"+14342774779\")\n v.Add(\"Body\", \"Your Airwide Code is \" + theCode)\n payload := strings.NewReader(v.Encode())\n\n var username string = \"AC25c34e873eb0348a2a7b9510f9282319\"\n var passwd string = \"c052c7e3068c0f1e64ba5067836b10d4\"\n\n req, _ := http.NewRequest(\"POST\", endpoint, payload)\n req.Header.Add(\"content-type\", \"application/x-www-form-urlencoded\")\n req.Header.Add(\"cache-control\",\"no-cache\")\n req.SetBasicAuth(username, passwd)\n\n res, err := http.DefaultClient.Do(req)\n if err != nil {\n fmt.Println(\"Fatal error occured\")\n }\n\n defer res.Body.Close();\n body, _ := ioutil.ReadAll(res.Body);\n\n fmt.Println(string(body));\n\n // TODO cater for http redirects. https://stackoverflow.com/questions/16673766/basic-http-auth-in-go\n\n\treturn nil;\n}", "func (c cognitoClient) ResendConfirmation(ctx context.Context, username string) error {\n\tlogger := log.With(c.logger, \"method\", \"ResendConfirmation\")\n\n\ts := calculateSecretHash(username, c.appClientID, c.clientSecret)\n\trc := &cognito.ResendConfirmationCodeInput{\n\t\tUsername: aws.String(username),\n\t\tClientId: aws.String(c.appClientID),\n\t\tSecretHash: aws.String(s),\n\t}\n\toutput, err := c.cognitoClient.ResendConfirmationCode(rc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogger.Log(\"Resend confirmation output:\", output)\n\treturn nil\n}", "func (m *PaymentTerm) SetCode(value *string)() {\n err := m.GetBackingStore().Set(\"code\", value)\n if err != nil {\n panic(err)\n }\n}", "func (m *UserExperienceAnalyticsDeviceStartupHistory) SetRestartStopCode(value *string)() {\n err := m.GetBackingStore().Set(\"restartStopCode\", value)\n if err != nil {\n panic(err)\n }\n}", "func (o *WebModifyDefault) Code() int {\n\treturn o._statusCode\n}", "func writeCode(code string) {\n\tfile, err := os.Create(\"./core/main.c\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer file.Close()\n\n\t_, err = io.WriteString(file, code)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "func (o *UpdateAntivirusServerDefault) Code() int {\n\treturn o._statusCode\n}", "func runCode(e string, code []byte, fn string) []byte {\n\tf, found := extensionMap[e]\n\tif found {\n\t\treturn f(code, fn)\n\t} else {\n\t\treturn []byte(\"Error: Extension not found.\")\n\t}\n}", "func (o *SchemaObjectsUpdateInternalServerError) Code() int {\n\treturn 500\n}", "func (au *AuthHandler) RequestResetPasswordCode(w http.ResponseWriter, r *http.Request){\n\tw.Header().Add(\"content-type\", \"application/json\")\n\temail := struct {Email\tstring\t`json:\"email\" validate:\"email,required\"`}{}\n\n\tif err := utils.ParseJsonFromRequest(r, &email); err != nil {\n\t\tutils.GetError(err, http.StatusUnprocessableEntity, w)\n\t\treturn\n\t}\n\n\tif err := validate.Struct(email); err != nil {\n\t\tutils.GetError(err, http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\tuser, err := FetchUserByEmail(bson.M{\"email\": strings.ToLower(email.Email)})\n\tif err != nil {\n\t\tutils.GetError(UserNotFound, http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\t// check if user already requested for password\n\tif user.PasswordResets != nil {\n\t\tx2x := map[string]interface{}{ \"password_reset_code\" : user.PasswordResets.Token }\n\t\tutils.GetSuccess(\"Password reset code already sent, check your email\", x2x, w)\n\t\treturn\n\t}\n\n\t// Update user collection with UserPasswordReset - WIP\n\t_, token := utils.RandomGen(6, \"d\")\n\n\tuserPasswordReset := map[string]interface{}{\n\t\t\"ip_address\": strings.Split(r.RemoteAddr, \":\")[0],\n\t\t\"token\": token,\n\t\t\"expired_at\": time.Now(),\n\t\t\"updated_at\": time.Now(),\n\t\t\"created_at\": time.Now(),\n\t}\n\n\tid, _ := primitive.ObjectIDFromHex(user.ID)\n\tfilter := bson.M{\"_id\": id}\n\tupdate := bson.M{\"$set\": bson.M{\"password_resets\": userPasswordReset }}\n\n\t// update db;\n\tif _, err := utils.GetCollection(user_collection).UpdateOne(context.Background(), filter, update); err != nil {\n\t\tutils.GetError(err, http.StatusInternalServerError, w)\n\t\treturn\t\t\n\t}\n\n\tmsger := au.mailService.NewMail(\n\t\t[]string{user.Email}, \n\t\t\"Reset Password Code\", service.PasswordReset, \n\t\t&service.MailData{ \n\t\t\tUsername: user.Email, \n\t\t\tCode: userPasswordReset[\"token\"].(string),\n\t\t})\n\n\tif err := au.mailService.SendMail(msger); err != nil {\n\t\tfmt.Printf(\"Error occured while sending mail: %s\", err.Error())\n\t}\n\n\tutils.GetSuccess(\"Password reset code sent\", nil, w)\n}", "func (l *littr) WriteOriginalCode() error {\n\tl.Log(1, \"writing original code\")\n\terr := ioutil.WriteFile(l.filePath, []byte(l.ogCode), 0644)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to write old code to file with %s\", err)\n\t}\n\n\treturn nil\n}", "func (o *PostEquipmentIoExpandersMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateDockerRegistryWebhookByNameUsingPUTInternalServerError) IsCode(code int) bool {\n\treturn code == 500\n}", "func SetRcode(req *dns.Msg, rcode int, do bool) *dns.Msg {\n\tm := new(dns.Msg)\n\tm.Extra = req.Extra\n\tm.SetRcode(req, rcode)\n\tm.RecursionAvailable = true\n\tm.RecursionDesired = true\n\n\tif opt := m.IsEdns0(); opt != nil {\n\t\topt.SetDo(do)\n\t}\n\n\treturn m\n}", "func (db *Database) RecycleVerificationCodes(maxAge time.Duration) (int64, error) {\n\tif maxAge > 0 {\n\t\tmaxAge = -1 * maxAge\n\t}\n\tdeleteBefore := time.Now().UTC().Add(maxAge)\n\t// Null out the codes where this can be done.\n\trtn := db.db.\n\t\tModel(&VerificationCode{}).\n\t\tSelect(\"code\", \"long_code\").\n\t\tWhere(\"expires_at < ? AND long_expires_at < ? AND (code != ? OR long_code != ?)\", deleteBefore, deleteBefore, \"\", \"\").\n\t\tUpdateColumns(map[string]interface{}{\"code\": \"\", \"long_code\": \"\"})\n\treturn rtn.RowsAffected, rtn.Error\n}", "func (o *UpdateGerritListenerByNameUsingPUTInternalServerError) IsCode(code int) bool {\n\treturn code == 500\n}", "func (s *Server) Compiled(ctx context.Context, request *proto.Request) (*proto.Response, error) {\n\t// extract the code URL, args, and stdin from request\n\tcodeURL, args, stdin := request.GetCodeURL(), request.GetArgs(), request.GetStdin()\n\n\t/*\n\t\tCode has to be downloaded in\n\t\t/home/${whoami}/remote/ruby/code-#{time.Now()}.rb\n\t*/\n\n\t// get home directory of current user\n\tcurrentUser, err := user.Current()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// get and format current time for every request\n\tt := time.Now().Format(\"20060102150405\")\n\n\t// generate string for destination (in UNIX based systems)\n\tdestinationString := fmt.Sprintf(\"%s/rpc/ruby/code-%s.rb\", currentUser.HomeDir, t)\n\n\t// download file in the provided destination\n\twget.Wget(codeURL, destinationString)\n\n\t/*\n\t\tIf no arguments were provided, only leave the\n\t\tdestinationString in the args slice otherwise\n\t\tappend location of file to arguments list\n\t*/\n\tif args[0] == \"\" {\n\t\targs = []string{destinationString}\n\t} else {\n\t\targs = append(args, destinationString)\n\t}\n\n\t// get Command struct instance by passing command name and arguments\n\tcmd := exec.Command(\"ruby\", args...)\n\n\t// provide stdin to command\n\tcmd.Stdin = bytes.NewReader(stdin)\n\n\t// store cmd.Stdout in a Bytes buffer\n\tvar Stdout bytes.Buffer\n\tcmd.Stdout = &Stdout\n\n\t// run the command\n\terr = cmd.Run()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// delete the code file\n\terr = os.Remove(destinationString)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\n\t// return full response\n\treturn &proto.Response{Body: Stdout.Bytes()}, nil\n}", "func (s *BasemumpsListener) ExitCode(ctx *CodeContext) {}", "func (pc *programCode) appendCode(code string) {\n\tpc.funcCode[pc.indentLevel] += code // Append Code to processed indent level\n\n}", "func (o *RefundPaymentByExternalKeyGatewayTimeout) Code() int {\n\treturn 504\n}", "func (w *WithCode) Code() AppErrCode { return w.code }", "func (f *WriteRequest) Code() FrameCode {\n\treturn FrameWrite\n}", "func (app *ApplicationStatus) SetCode(status int) {\n\tapp.Lock()\n\tdefer app.Unlock()\n\n\tapp.code = status\n}", "func (o *UpdateGerritListenerByNameUsingPUTOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (ws *workingSet) SetCode(addr hash.PKHash, code []byte) error {\n\tif contract, ok := ws.cachedContract[addr]; ok {\n\t\tcontract.SetCode(byteutil.BytesTo32B(hash.Hash256b(code)), code)\n\t\treturn nil\n\t}\n\tcontract, err := ws.getContract(addr)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to SetCode for contract %x\", addr)\n\t}\n\tcontract.SetCode(byteutil.BytesTo32B(hash.Hash256b(code)), code)\n\treturn nil\n}", "func (o *ReorderSecurityRealmsBadRequest) Code() int {\n\treturn 400\n}", "func (code *InterpCode) Release() {\n}", "func (m *AndroidEnrollmentCompanyCode) SetQrCodeContent(value *string)() {\n err := m.GetBackingStore().Set(\"qrCodeContent\", value)\n if err != nil {\n panic(err)\n }\n}", "func (o *DescribeServerConflict) Code() int {\n\treturn 409\n}", "func addRtncode(code string, mesg string) *API.RtnMtrlA {\n\n\treFlag = false\n\trtn := new(API.RtnMtrlA)\n\trtn.Rtncode = code\n\trtn.Rtnmesg = mesg\n\n\treturn rtn\n}", "func (o *PatchEquipmentIoExpandersMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ReorderSecurityRealmsBadRequest) IsCode(code int) bool {\n\treturn code == 400\n}", "func (o *QueryScheduledScansTooManyRequests) Code() int {\n\treturn 429\n}", "func (o *WebModifyAccepted) IsCode(code int) bool {\n\treturn code == 202\n}", "func (o *QueryApplicationsTooManyRequests) Code() int {\n\treturn 429\n}", "func (o *CreateAntivirusServerDefault) Code() int {\n\treturn o._statusCode\n}", "func ajaxCode(r *http.Request) ([]byte, error) {\n\tif tid, e := convert.Id(r.FormValue(\"test-id\")); e == nil {\n\t\tt, e := db.JUnitTest(bson.M{db.ID: tid}, bson.M{db.TEST: 1})\n\t\tif e != nil {\n\t\t\treturn nil, e\n\t\t}\n\t\treturn util.JSON(map[string]interface{}{\"code\": string(t.Test)})\n\t}\n\tm := bson.M{}\n\tif rid, e := convert.Id(r.FormValue(\"result-id\")); e == nil {\n\t\ttr, e := db.Tooler(bson.M{db.ID: rid}, bson.M{db.FILEID: 1})\n\t\tif e != nil {\n\t\t\treturn nil, e\n\t\t}\n\t\tm[db.ID] = tr.GetFileId()\n\t}\n\tif id, e := convert.Id(r.FormValue(\"file-id\")); e == nil {\n\t\tm[db.ID] = id\n\t}\n\tif n, e := webutil.String(r, \"tool-name\"); e == nil {\n\t\td, e := context.NewResult(n)\n\t\tif e != nil {\n\t\t\treturn nil, e\n\t\t}\n\t\tif d.FileID != \"\" {\n\t\t\tm[db.ID] = d.FileID\n\t\t} else if pid, e := convert.Id(r.FormValue(\"project-id\")); e == nil {\n\t\t\treturn loadTestCode(pid, d.Name)\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"could not load code for %s\", d.Format())\n\t\t}\n\t}\n\tf, e := db.File(m, bson.M{db.DATA: 1})\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn util.JSON(map[string]interface{}{\"code\": string(f.Data)})\n}", "func (c *Client) PostCode(ctx context.Context) (status string, code int, err error) {\n\tstatus, code, metadata, err := bmc.GetPostCodeInterfaces(ctx, c.Registry.GetDriverInterfaces())\n\tc.setMetadata(metadata)\n\treturn status, code, err\n}", "func (o *DcimRackRolesBulkPartialUpdateOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (s *TooManyRequests) Code() string {\n\treturn \"TooManyRequests\"\n}", "func (s *BasemumpsListener) EnterCode(ctx *CodeContext) {}", "func (c *Client) ResendVerification(rv www.ResendVerification) (*www.ResendVerificationReply, error) {\n\trespBody, err := c.makeRequest(http.MethodPost, www.PoliteiaWWWAPIRoute,\n\t\twww.RouteResendVerification, rv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar rvr www.ResendVerificationReply\n\terr = json.Unmarshal(respBody, &rvr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unmarshal ResendVerificationReply: %v\", err)\n\t}\n\n\tif c.cfg.Verbose {\n\t\terr := prettyPrintJSON(rvr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn &rvr, nil\n}", "func (p *OIDCIBMProvider) Redeem(redirectURL, code string) (s *SessionState, err error) {\n\tctx := context.Background()\n\tc := oauth2.Config{\n\t\tClientID: p.ClientID,\n\t\tClientSecret: p.ClientSecret,\n\t\tEndpoint: oauth2.Endpoint{\n\t\t\tTokenURL: p.RedeemURL.String(),\n\t\t},\n\t\tRedirectURL: redirectURL,\n\t}\n\n\t// 20180629 - TL: Added logging\n\tfmt.Printf(\"Client ID: %s\\n\", p.ClientID)\n\tfmt.Printf(\"Client Secret: %s\\n\", p.ClientSecret)\n\tfmt.Printf(\"Token URL: %s\\n\", p.RedeemURL.String())\n\tfmt.Printf(\"Redirect URL: %s\\n\", redirectURL)\n\tfmt.Printf(\"Code: %s\\n\", code)\n\n\t// 20180629 - TL: Add in a parameter to handle registering broken oauth2's\n\toauth2.RegisterBrokenAuthHeaderProvider(p.RedeemURL.String())\n\n\ttoken, err := c.Exchange(ctx, code)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"token exchange: %v\", err)\n\t}\n\tfmt.Printf(\"Token: %v\\n\", token)\n\ts, err = p.createSessionState(ctx, token)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to update session: %v\", err)\n\t}\n\treturn\n}", "func (o *UpdateDockerRegistryWebhookByNameUsingPUTOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (suo *SubjectUpdateOne) SetCode(i int) *SubjectUpdateOne {\n\tsuo.mutation.ResetCode()\n\tsuo.mutation.SetCode(i)\n\treturn suo\n}", "func respondJsendCode(w http.ResponseWriter, response *JSend, statusCode int) {\n\tw.Header().Set(\"Cache-Control\", \"no-cache\")\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tif len(response.Failures) > 0 && response.Message == \"\" {\n\t\tresponse.Message = \"One or more item has failed. Check the individual failures for details.\"\n\t}\n\n\tresult, err := json.MarshalIndent(response, \"\", \" \")\n\tif err != nil {\n\t\tlog.Errorf(\"Error marshalling response: %s\", err)\n\n\t\tresult, _ = json.Marshal(&JSend{\n\t\t\tStatus: statusError,\n\t\t\tMessage: \"An internal error occurred, and we'll look into it.\",\n\t\t})\n\t}\n\n\tif statusCode <= 0 {\n\t\tswitch response.Status {\n\t\tcase statusFail:\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tcase statusError:\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t}\n\t\t//default is status 200\n\t} else {\n\t\tw.WriteHeader(statusCode)\n\t}\n\n\t// if data has an etag use it\n\tswitch t := response.Data.(type) {\n\tcase etagger:\n\t\tw.Header().Set(\"ETag\", t.Etag())\n\t}\n\n\t_, err = w.Write(result)\n\tif err != nil {\n\t\tlog.WithField(\"JSEND\", result).Errorf(\"Error writing jsend response: %s\", err)\n\t}\n}", "func resendAccountActivationEmail(email string) api.Response {\n\tactivationLink, err := auth.ResendAccountActivationEmail(email)\n\tif err != nil {\n\t\treturn api.InternalServerError(err)\n\t}\n\n\treturn api.PlainTextResponse(http.StatusOK, activationLink)\n}", "func (o *PatchAddonDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *InvalidatesCacheBadRequest) Code() int {\n\treturn 400\n}", "func (o *PatchServiceAccountTokenOK) Code() int {\n\treturn 200\n}", "func (o *EmsDestinationModifyOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (c *APIClient) addResponseCode(code int) {\n\tc.respCodes = append(c.respCodes, code)\n}", "func (refreshProtocol *RefreshProtocol) Recode(ciphertext *ckks.Ciphertext, targetScale float64) {\n\tdckksContext := refreshProtocol.dckksContext\n\tringQ := refreshProtocol.dckksContext.ringQ\n\n\tinputScaleFlo := ring.NewFloat(ciphertext.Scale(), 256)\n\toutputScaleFlo := ring.NewFloat(targetScale, 256)\n\n\tinputScaleInt := new(big.Int)\n\toutputScaleInt := new(big.Int)\n\n\tinputScaleFlo.Int(inputScaleInt)\n\toutputScaleFlo.Int(outputScaleInt)\n\n\tringQ.InvNTTLvl(ciphertext.Level(), ciphertext.Value()[0], ciphertext.Value()[0])\n\n\tringQ.PolyToBigint(ciphertext.Value()[0], refreshProtocol.maskBigint)\n\n\tQStart := ring.NewUint(ringQ.Modulus[0])\n\tfor i := 1; i < ciphertext.Level()+1; i++ {\n\t\tQStart.Mul(QStart, ring.NewUint(ringQ.Modulus[i]))\n\t}\n\n\tQHalf := new(big.Int).Rsh(QStart, 1)\n\n\tfor ciphertext.Level() != dckksContext.params.MaxLevel() {\n\t\tciphertext.Value()[0].Coeffs = append(ciphertext.Value()[0].Coeffs, make([][]uint64, 1)...)\n\t\tciphertext.Value()[0].Coeffs[ciphertext.Level()] = make([]uint64, dckksContext.n)\n\t}\n\n\tvar sign int\n\tfor i := 0; i < dckksContext.n; i++ {\n\t\tsign = refreshProtocol.maskBigint[i].Cmp(QHalf)\n\t\tif sign == 1 || sign == 0 {\n\t\t\trefreshProtocol.maskBigint[i].Sub(refreshProtocol.maskBigint[i], QStart)\n\t\t}\n\n\t\trefreshProtocol.maskBigint[i].Mul(refreshProtocol.maskBigint[i], outputScaleInt)\n\t\trefreshProtocol.maskBigint[i].Quo(refreshProtocol.maskBigint[i], inputScaleInt)\n\t}\n\n\tringQ.SetCoefficientsBigintLvl(ciphertext.Level(), refreshProtocol.maskBigint, ciphertext.Value()[0])\n\n\tringQ.NTTLvl(ciphertext.Level(), ciphertext.Value()[0], ciphertext.Value()[0])\n\n\tciphertext.SetScale(targetScale)\n}", "func (o *UpdateSiteScriptDefault) Code() int {\n\treturn o._statusCode\n}", "func (rr *OPT) SetExtendedRcode(v uint16) {\n\trr.Hdr.Ttl = rr.Hdr.Ttl&0x00FFFFFF | uint32(v>>4)<<24\n}", "func (_BaseContent *BaseContentTransactor) SetStatusCode(opts *bind.TransactOpts, status_code *big.Int) (*types.Transaction, error) {\n\treturn _BaseContent.contract.Transact(opts, \"setStatusCode\", status_code)\n}", "func (o *UpdateGerritListenerByNameUsingPUTNotFound) IsCode(code int) bool {\n\treturn code == 404\n}", "func (o *EmsDestinationModifyDefault) Code() int {\n\treturn o._statusCode\n}", "func (su *SubjectUpdate) SetCode(i int) *SubjectUpdate {\n\tsu.mutation.ResetCode()\n\tsu.mutation.SetCode(i)\n\treturn su\n}", "func (o *PatchServiceAccountTokenNoContent) Code() int {\n\treturn 204\n}", "func (t *SimpleChaincode)ReplacePartOnAssembly(stub shim.ChaincodeStubInterface, args []string)([]byte, error) {\n\t\n\tkey := args[0] \t\t\t\t// L'id de l'Assembly\n\tidpart := args[1] \t\t\t\t// L'id de l'ancien Part \n\tidpart1 := args[2] \t\t\t\t// L'id du nouveau part \n// Debut Partie Assembly \n\t\tac,err:=findAssemblyById(stub,key)\n\t\tif(err !=nil){return nil,err}\n\t\tptAS1, _ := json.Marshal(ac)\n\tvar airc Assembly\n\t\terr = json.Unmarshal(ptAS1, &airc)\n\t\tif err != nil {return nil, errors.New(\"Failed to Unmarshal Part #\" + key)}\n\t\tairc.Parts = append(airc.Parts, idpart1)\t\n\tfor i, v := range airc.Parts{\n\t\t\tif v == idpart {\n\t\t\t\tairc.Parts = append(airc.Parts[:i], airc.Parts[i+1:]...)\n\t\t\tbreak\n\t\t}\n\t\t\t}\n\tvar tx LogAssembly\n\t\ttx.Responsible = airc.Responsible\n\t\ttx.Owner \t\t= airc.Owner\n\t\ttx.LType \t\t= \"PART_SUBSTITUTION\"\n\t\ttx.Description = \"PART_SUBSTITUTION : \" + idpart1 + \" replace \" + idpart\n\t\ttx.VDate\t\t= args [3]\n\t\tairc.Logs = append(airc.Logs, tx)\n\ty:= UpdateAssembly (stub, airc) \n\t\tif y != nil { return nil, errors.New(y.Error())}\n// Fin Partie Assembly \n// Debut Partie Part\t\n\t\tpart,err:=findPartById(stub,idpart)\n\t\tif err != nil {return nil, errors.New(\"Failed to get part #\" + key)}\n\t\tptAS, _ := json.Marshal(part)\n\tvar pt Part\n\t\terr = json.Unmarshal(ptAS, &pt)\n\t\tif err != nil {return nil, errors.New(\"Failed to Unmarshal Part #\" + key)}\n\tpartt,err:=findPartById(stub,idpart1)\n\t\tif err != nil {return nil, errors.New(\"Failed to get part #\" + key)}\n\t\tptASS, _ := json.Marshal(partt)\n\tvar ptt Part\n\t\terr = json.Unmarshal(ptASS, &ptt)\n\t\tif err != nil {return nil, errors.New(\"Failed to Unmarshal Part #\" + key)}\n\t\tptt.Assembly = key\n\t\tptt.Owner = airc.Owner \n\t\tptt.Responsible = pt.Responsible\n\t\tptt.Helicopter = pt.Helicopter\n\t\tptt.PN = pt.PN\n\tvar tff Log\n\t\ttff.Responsible = ptt.Responsible\n\t\ttff.Owner \t\t= ptt.Owner\n\t\ttff.LType \t\t= \"ASSEMBLY_AFFILIATION\"\n\t\ttff.Description = \"AFFILIATED TO ASSEMBLY \" + key + \" AND SUBSTITUTES PART: \" + idpart\n\t\ttff.VDate \t\t= args [3]\n\t\tptt.Logs = append(ptt.Logs, tff)\n\tr:= UpdatePart (stub, ptt) \n\t\tif r != nil { return nil, errors.New(r.Error())}\n\t\t\n\t\tpt.Assembly = \"\" // Le champ Assembly de la part retirée de l'Assembly revient à nul.\n\t\tpt.Owner = \"REMOVAL_MANAGER\" \n\t\tpt.Responsible = \"REMOVAL_MANAGER\"\n\tvar tf Log\n\t\ttf.Responsible = pt.Responsible\n\t\ttf.Owner \t\t= pt.Owner\n\t\ttf.LType \t\t= \"ASSEMBLY_REMOVAL\"\n\t\ttf.Description = \"REMOVED FROM ASSEMBLY \" + key + \" SUBSTITUTED BY PART: \" + idpart1 + \" This part has been transfered to \" + pt.Owner + \", the new Owner. \"\n\t\ttf.VDate \t\t= args [3]\n\t\tpt.Logs = append(pt.Logs, tf)\n\te:= UpdatePart (stub, pt) \n\t\tif e != nil { return nil, errors.New(e.Error())}\t\n// Fin Partie Part \nfmt.Println(\"Responsible created successfully\")\t\nreturn nil, nil\n}", "func (p *AzureProvider) Redeem(redirectURL, code string) (s *sessions.SessionState, err error) {\n\tif code == \"\" {\n\t\terr = errors.New(\"missing code\")\n\t\treturn\n\t}\n\n\tparams := url.Values{}\n\tparams.Add(\"redirect_uri\", redirectURL)\n\tparams.Add(\"client_id\", p.ClientID)\n\tparams.Add(\"client_secret\", p.ClientSecret)\n\tparams.Add(\"code\", code)\n\tparams.Add(\"grant_type\", \"authorization_code\")\n\tif p.ProtectedResource != nil && p.ProtectedResource.String() != \"\" {\n\t\tparams.Add(\"resource\", p.ProtectedResource.String())\n\t}\n\n\tvar req *http.Request\n\treq, err = http.NewRequest(\"POST\", p.RedeemURL.String(), bytes.NewBufferString(params.Encode()))\n\tif err != nil {\n\t\treturn\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\tvar resp *http.Response\n\tresp, err = http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar body []byte\n\tbody, err = ioutil.ReadAll(resp.Body)\n\t_ = resp.Body.Close()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\terr = fmt.Errorf(\"got %d from %q %s\", resp.StatusCode, p.RedeemURL.String(), body)\n\t\treturn\n\t}\n\n\t// blindly try json and x-www-form-urlencoded\n\tvar jsonResponse struct {\n\t\tExpiresIn int64 `json:\"expires_in,string\"`\n\t\tAccessToken string `json:\"access_token\"`\n\t\tRefreshToken string `json:\"refresh_token\"`\n\t}\n\n\tif err = json.Unmarshal(body, &jsonResponse); err != nil {\n\t\terr = fmt.Errorf(\"decoding redeem response failed, %s\", err)\n\t\treturn\n\t}\n\n\ts = &sessions.SessionState{\n\t\tCreatedAt: time.Now(),\n\t\tExpiresOn: time.Now().Add(time.Duration(jsonResponse.ExpiresIn-300) * time.Second).Truncate(time.Second),\n\t\tRefreshToken: jsonResponse.RefreshToken,\n\t\tAccessToken: jsonResponse.AccessToken,\n\t}\n\treturn\n}", "func (w showCodeOk) Changed(app gowid.IApp, widget gowid.IWidget, data ...interface{}) {\n\tvar client wormhole.Client\n\n\t// goroutine so I don't block ui goroutine\n\tgo func() {\n\t\tctx := context.Background()\n\t\tmsg, err := client.Receive(ctx, w.Args.Code)\n\t\treject := true\n\n\t\tif err != nil {\n\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\tw.previous.Close(app)\n\t\t\t\tw.doReceiveError(err, app)\n\t\t\t}))\n\t\t\treturn\n\t\t}\n\n\t\tdefer func() {\n\t\t\t//fmt.Fprintf(os.Stderr, \"GCLA: will I reject? reject is %v\\n\", reject)\n\t\t\tif reject {\n\t\t\t\tmsg.Reject()\n\t\t\t}\n\t\t}()\n\n\t\tswitch msg.Type {\n\t\tcase wormhole.TransferText:\n\n\t\t\t// Wormhole william doesn't allow rejecting text message\n\t\t\t// transfers\n\t\t\treject = false\n\n\t\t\tspin := spinner.New(spinner.Options{\n\t\t\t\tStyler: gowid.MakePaletteRef(\"progress-spinner\"),\n\t\t\t})\n\n\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\tw.previous.Close(app)\n\t\t\t\tw.doSpin(spin, app)\n\t\t\t}))\n\n\t\t\tdone := make(chan struct{})\n\t\t\tvar transferredMessage []byte\n\n\t\t\tgo func() {\n\t\t\t\ttransferredMessage, err = ioutil.ReadAll(msg)\n\n\t\t\t\tdefer close(done)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\tw.doTextTransferError(err, app)\n\t\t\t\t\t}))\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Artificial delay makes a nicer experience\n\t\t\t\ttime.Sleep(1000 * time.Millisecond)\n\t\t\t}()\n\n\t\t\tgo func() {\n\t\t\t\tc := time.Tick(100 * time.Millisecond)\n\t\t\tloop:\n\t\t\t\tfor {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-done:\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\t\tw.doMessageThenQuit(string(transferredMessage), \"Quit\", app)\n\t\t\t\t\t\t}))\n\t\t\t\t\t\tbreak loop\n\t\t\t\t\tcase <-c:\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tspin.Update()\n\t\t\t\t\t\t}))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\tcase wormhole.TransferFile:\n\t\t\tprog := progress.New(progress.Options{\n\t\t\t\tNormal: gowid.MakePaletteRef(\"progress-default\"),\n\t\t\t\tComplete: gowid.MakePaletteRef(\"progress-complete\"),\n\t\t\t})\n\n\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\tw.previous.Close(app)\n\t\t\t\tw.doProg(msg.Name, Transfer(msg.Type), prog, app)\n\t\t\t\t//w.InTransfer = true\n\t\t\t}))\n\n\t\t\tdone := make(chan struct{})\n\t\t\tread := 0\n\n\t\t\t// Only set if dir or file\n\t\t\tsavedFilename := filepath.Join(w.Args.SaveDir, msg.Name)\n\t\t\tif !w.Args.Overwrite && fileExists(savedFilename) {\n\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\tw.doNoOverwrite(savedFilename, app)\n\t\t\t\t}))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tf, err := os.Create(savedFilename)\n\t\t\tif err != nil {\n\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\tw.doFileCreateError(savedFilename, err, app)\n\t\t\t\t}))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\treject = false\n\n\t\t\tgo func() {\n\t\t\t\t_, err = io.Copy(f, &progReader{read: &read, Reader: msg})\n\n\t\t\t\tdefer func() {\n\t\t\t\t\tf.Close()\n\t\t\t\t\tclose(done)\n\t\t\t\t}()\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\tw.doFileTransferError(savedFilename, err, app)\n\t\t\t\t\t}))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tgo func() {\n\t\t\t\tc := time.Tick(250 * time.Millisecond)\n\t\t\tloop:\n\t\t\t\tfor {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-done:\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tprog.SetTarget(app, int(msg.UncompressedBytes64))\n\t\t\t\t\t\t\tprog.SetProgress(app, int(msg.UncompressedBytes64))\n\n\t\t\t\t\t\t\t// Delay at 100% is nice\n\t\t\t\t\t\t\ttime.AfterFunc(1*time.Second, func() {\n\t\t\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\t\t\t//w.InTransfer = false\n\t\t\t\t\t\t\t\t\tw.previous.Close(app)\n\n\t\t\t\t\t\t\t\t\tif w.Args.OpenCmd == \"\" {\n\t\t\t\t\t\t\t\t\t\tw.doSavedAs(savedFilename, app)\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif w.Args.NoAskOpen {\n\t\t\t\t\t\t\t\t\t\t\tw.doOpen(savedFilename, app)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tw.doAskToOpen(savedFilename, app)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t}))\n\t\t\t\t\t\tbreak loop\n\t\t\t\t\tcase <-c:\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tprog.SetTarget(app, int(msg.UncompressedBytes64))\n\t\t\t\t\t\t\tprog.SetProgress(app, read)\n\t\t\t\t\t\t}))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\tcase wormhole.TransferDirectory:\n\n\t\t\tdirName := filepath.Join(w.Args.SaveDir, msg.Name)\n\n\t\t\terr = os.Mkdir(dirName, 0777)\n\t\t\tif err != nil {\n\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\tw.doError(err, app)\n\t\t\t\t}))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\ttmpFile, err := ioutil.TempFile(w.Args.SaveDir, fmt.Sprintf(\"%s.zip.tmp\", msg.Name))\n\t\t\tif err != nil {\n\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\tw.doError(err, app)\n\t\t\t\t}))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tprog := progress.New(progress.Options{\n\t\t\t\tNormal: gowid.MakePaletteRef(\"progress-default\"),\n\t\t\t\tComplete: gowid.MakePaletteRef(\"progress-complete\"),\n\t\t\t})\n\n\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\tw.previous.Close(app)\n\t\t\t\tw.doProg(msg.Name, Transfer(msg.Type), prog, app)\n\t\t\t}))\n\n\t\t\tdone := make(chan struct{})\n\t\t\tread := 0\n\n\t\t\treject = false\n\n\t\t\tgo func() {\n\n\t\t\t\terrme := func(w showCodeOk, err error, app gowid.IApp) {\n\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\tw.doError(err, app)\n\t\t\t\t\t}))\n\t\t\t\t}\n\n\t\t\t\tdefer func() {\n\t\t\t\t\ttmpFile.Close()\n\t\t\t\t\tos.Remove(tmpFile.Name())\n\t\t\t\t\tclose(done)\n\t\t\t\t}()\n\n\t\t\t\tn, err := io.Copy(tmpFile, &progReader{read: &read, Reader: msg})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\tw.doFileTransferError(msg.Name, err, app)\n\t\t\t\t\t}))\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\ttmpFile.Seek(0, io.SeekStart)\n\t\t\t\tzr, err := zip.NewReader(tmpFile, int64(n))\n\t\t\t\tif err != nil {\n\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\tw.doError(err, app)\n\t\t\t\t\t}))\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor _, zf := range zr.File {\n\t\t\t\t\tp, err := filepath.Abs(filepath.Join(dirName, zf.Name))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terrme(w, err, app)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif !strings.HasPrefix(p, dirName) {\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\t\tw.doMessageThenQuit(fmt.Sprintf(\"Dangerous filename found: %s\", zf.Name), \"Quit\", app)\n\t\t\t\t\t\t}))\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\trc, err := zf.Open()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\t\tw.doMessageThenQuit(fmt.Sprintf(\"%s open failed: %v\", zf.Name, err), \"Quit\", app)\n\t\t\t\t\t\t}))\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tdir := filepath.Dir(p)\n\t\t\t\t\terr = os.MkdirAll(dir, 0777)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terrme(w, err, app)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tf, err := os.Create(p)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terrme(w, err, app)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t_, err = io.Copy(f, rc)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terrme(w, err, app)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\terr = f.Close()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terrme(w, err, app)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\trc.Close()\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tgo func() {\n\t\t\t\tc := time.Tick(250 * time.Millisecond)\n\t\t\tloop:\n\t\t\t\tfor {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-done:\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tprog.SetTarget(app, int(msg.UncompressedBytes64))\n\t\t\t\t\t\t\tprog.SetProgress(app, int(msg.UncompressedBytes64))\n\n\t\t\t\t\t\t\t// Delay at 100% is nice\n\t\t\t\t\t\t\ttime.AfterFunc(1*time.Second, func() {\n\t\t\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\t\t\tw.previous.Close(app)\n\t\t\t\t\t\t\t\t\tw.doSavedAs(dirName, app)\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t}))\n\t\t\t\t\t\tbreak loop\n\t\t\t\t\tcase <-c:\n\t\t\t\t\t\tapp.Run(gowid.RunFunction(func(app gowid.IApp) {\n\t\t\t\t\t\t\tprog.SetTarget(app, int(msg.UncompressedBytes64))\n\t\t\t\t\t\t\tprog.SetProgress(app, read)\n\t\t\t\t\t\t}))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\t}\n\n\t}()\n}", "func (o *QueryScheduledScansOK) Code() int {\n\treturn 200\n}", "func qrencode(_ js.Value, args []js.Value) interface{} {\n\tcode, err := qr.Encode(args[0].String(), qr.L)\n\tif err != nil {\n\t\treturn nil\n\t}\n\tpng := code.PNG()\n\tdst := js.Global().Get(\"Uint8Array\").New(len(png))\n\tjs.CopyBytesToJS(dst, png)\n\treturn dst\n}", "func (o *EmsConfigModifyOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func ReplyWithCode(w http.ResponseWriter, code int) {\n\n\tif code < 400 {\n\t\th := w.Header()\n\t\th.Set(\"Content-Length\", \"2\")\n\t\th.Set(\"Content-Type\", \"application/json\")\n\t\tw.WriteHeader(code)\n\t\tw.Write(emptyObj)\n\t} else {\n\t\terr := http.StatusText(code)\n\t\tif err == \"\" {\n\t\t\terr = \"E\" + strconv.Itoa(code)\n\t\t}\n\t\tReplyErr(w, code, err)\n\t}\n}", "func (o *DcimRackRolesBulkPartialUpdateDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateIOAExclusionsV1OK) Code() int {\n\treturn 200\n}", "func (o *UpdateFirewallPoliciesInternalServerError) Code() int {\n\treturn 500\n}" ]
[ "0.6858339", "0.59381795", "0.58342206", "0.55491394", "0.5370716", "0.53603715", "0.53393215", "0.53146356", "0.53073716", "0.53061116", "0.5272337", "0.52508247", "0.5212652", "0.5147963", "0.5101353", "0.5094711", "0.509436", "0.509355", "0.5080473", "0.5077903", "0.5073909", "0.5065425", "0.5056389", "0.50485027", "0.50375396", "0.50169647", "0.49947378", "0.49907655", "0.49905154", "0.498521", "0.497776", "0.49620366", "0.49441722", "0.49268386", "0.49203044", "0.4910305", "0.49098757", "0.48999682", "0.4892151", "0.48837614", "0.48686105", "0.4851702", "0.48483962", "0.48470986", "0.48403722", "0.48385525", "0.483784", "0.48268425", "0.48257732", "0.48239887", "0.4820037", "0.4818347", "0.4818112", "0.48080927", "0.48028305", "0.47953868", "0.47919053", "0.47918034", "0.47916904", "0.47899273", "0.47769913", "0.47743255", "0.47706616", "0.47642365", "0.47638646", "0.4759697", "0.47587776", "0.4756542", "0.4755187", "0.47529602", "0.47419357", "0.47354218", "0.47326785", "0.47319615", "0.47286615", "0.47276855", "0.47254997", "0.47187278", "0.47169146", "0.47156718", "0.47149765", "0.47134116", "0.47058365", "0.47038966", "0.47006348", "0.469522", "0.46939462", "0.4693581", "0.46933687", "0.46895328", "0.46834037", "0.46819532", "0.46764278", "0.4673289", "0.4668805", "0.46686155", "0.46680245", "0.46649602", "0.46638912", "0.46618816" ]
0.7235184
0
CompareAdminCodes compares the admin code sent by user
CompareAdminCodes сравнивает административный код, отправленный пользователем
func (orm *ORM) CompareAdminCodes(ctx context.Context, adminID string, code string) (bool, error) { //check in redis to see if its the same and not expired value, err := orm.rdb.Get(ctx, fmt.Sprintf("%s", adminID)).Result() if err == redis.Nil { return false, errors.New("CodeHasExpired") } else if err != nil { return false, err } if value != code { return false, errors.New("CodeIncorrect") } return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func checkAdmin(value int64) bool {\n\tfor _, i := range Config.Admins {\n\t\tif i == value {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (o *CTROracle) CheckAdmin(ciphertext []byte) bool {\n\tctr := stream.NewCTR(o.Key, o.Nonce)\n\tdecrypted := string(ctr.Decrypt(ciphertext))\n\n\treturn strings.Index(decrypted, \";admin=true;\") >= 0\n}", "func admin(b []byte) bool {\n\tvar dec bytes.Buffer\n\tif err := common.NewCTR(key, nonce).Process(bytes.NewReader(b), &dec); err != nil {\n\t\tpanic(err)\n\t}\n\treturn bytes.Contains(dec.Bytes(), []byte(\";admin=true;\"))\n}", "func (c AESCBC) DecryptCheckAdmin(cipherText []byte) bool {\n\ttext := c.Decrypt(cipherText)\n\tfor _, val := range bytes.Split(text, []byte(\";\")) {\n\t\ttuple := bytes.Split(val, []byte(\"=\"))\n\t\t// If the tuple is of length 2, check if we have admin = true.\n\t\tif len(tuple) == 2 && bytes.Equal(tuple[0], []byte(\"admin\")) && bytes.Equal(tuple[1], []byte(\"true\")) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func\tisAdmin(args []string) (string, error) {\n\tvar err\t\t\t\terror\n\tvar\tisAdmin\t\t\tbool\n\n\t/// CHECK ARGUMENTS\n\t/// TODO : when better API, check this better\n\tif len(args) != 0 {\n\t\treturn \"\", fmt.Errorf(\"isAdmin does not require any argument.\")\n\t}\n\n\tprintln(\"Some log\")\n\n\t/// IS USER ADMINISTRATOR\n\tisAdmin, err = isLedgerAdmin()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Cannot know is user is administrator.\")\n\t}\n\tif isAdmin == true {\n\t\treturn \"true\", nil\n\t} else {\n\t\treturn \"false\", nil\n\t}\n}", "func IsAdmin(ee engine.Exchange) sknet.HandlerFunc {\n\treturn func(c *sknet.Context) error {\n\t\tvar rlt *pp.EmptyRes\n\t\tfor {\n\t\t\treq := pp.UpdateCreditReq{}\n\t\t\tif err := c.BindJSON(&req); err != nil {\n\t\t\t\tlogger.Error(err.Error())\n\t\t\t\trlt = pp.MakeErrResWithCode(pp.ErrCode_WrongRequest)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif !ee.IsAdmin(req.GetPubkey()) {\n\t\t\t\tlogger.Error(\"not admin\")\n\t\t\t\trlt = pp.MakeErrResWithCode(pp.ErrCode_UnAuthorized)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn c.Next()\n\t\t}\n\t\treturn c.Error(rlt)\n\t}\n}", "func (s Service) checkAdminLevel(ctx context.Context, companyID string, requiredLevels ...companyadmin.AdminLevel) bool {\n\tspan := s.tracer.MakeSpan(ctx, \"checkAdminLevel\")\n\tdefer span.Finish()\n\n\tactualLevel, err := s.networkRPC.GetAdminLevel(ctx, companyID)\n\tif err != nil {\n\t\ts.tracer.LogError(span, err)\n\t\tlog.Println(\"Error: checkAdminLevel:\", err)\n\t\treturn false\n\t}\n\n\tfor _, lvl := range requiredLevels {\n\t\tif lvl == actualLevel {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "func (o ClientCertificateCommonNameOutput) IsAdmin() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v ClientCertificateCommonName) bool { return v.IsAdmin }).(pulumi.BoolOutput)\n}", "func (o *UpdateUserGroupsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UnixUserSettingsModifyOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o ClientCertificateCommonNameResponseOutput) IsAdmin() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v ClientCertificateCommonNameResponse) bool { return v.IsAdmin }).(pulumi.BoolOutput)\n}", "func authentication_admin(user, pass string) bool {\n\tvar username, password string\n\tvar tipo int\n\tdb_mu.Lock()\n\tquery2, err := db.Query(\"SELECT username, password, type FROM admin WHERE username = ?\", user)\n\tdb_mu.Unlock()\n\tif err != nil {\n\t\tError.Println(err)\n\t\treturn false\n\t}\n\tfor query2.Next() {\n\t\terr = query2.Scan(&username, &password, &tipo)\n\t\tif err != nil {\n\t\t\tError.Println(err)\n\t\t\treturn false\n\t\t}\n\t}\n\tquery2.Close()\n\n\tif user == username && pass == password && tipo == 1 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "func (_Contract *ContractFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*ContractAdminChangedIterator, error) {\n\n\tlogs, sub, err := _Contract.contract.FilterLogs(opts, \"AdminChanged\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractAdminChangedIterator{contract: _Contract.contract, event: \"AdminChanged\", logs: logs, sub: sub}, nil\n}", "func (o *UpdatePrivilegeForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UpdateUserGroupsForbidden) Code() int {\n\treturn 403\n}", "func (c Admin) checkAdminIP() revel.Result {\n remoteAddr := GetRemoteAddr(c.Controller)\n if !app.MyGlobal.IsAdminIP(remoteAddr) {\n c.Flash.Error(c.Message(\"error.require.signin\"))\n revel.WARN.Printf(\"%s is not in the admin ip list\", remoteAddr)\n return c.Redirect(routes.User.Signin())\n }\n return c.Result\n}", "func (t *TokenInfo) IsAdmin() bool {\n\tfor _, role := range t.Roles {\n\t\tif role[\"name\"] == adminRoleName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (o *DcimInventoryItemRolesBulkUpdateOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *V2UpdateClusterUISettingsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *SchemaObjectsUpdateForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *QueryScheduledScansForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *GetMachineSnapshotsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (me TxsdImpactSimpleContentExtensionType) IsAdmin() bool { return me.String() == \"admin\" }", "func (o *QueryScansForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func CheckUrlCode(db *mgo.Database, params martini.Params) (err error) {\n\tuserId := bson.ObjectIdHex(params[\"user_id\"])\n\turlCode := params[\"password_resetting_code\"]\n\n\tvar aUser User\n\terr = db.C(\"users\").Find(bson.M{\"_id\": userId}).One(&aUser)\n\tif err == nil {\n\t\tif len(aUser.PasswordResettingUrlCodes) > 0 {\n\t\t\tfor _, u := range aUser.PasswordResettingUrlCodes {\n\t\t\t\tif u.PasswordResettingUrlCode == urlCode {\n\t\t\t\t\tif time.Now().UnixNano()-u.TimeStamp < (3.6e+12) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif err == nil {\n\t\terr = errors.New(\"Previous change was successful or the link is expired.\")\n\t}\n\treturn\n}", "func (o *UpdateRepository3Forbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UpdatePrivilegeForbidden) Code() int {\n\treturn 403\n}", "func (o *ListDashboardsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *ListNodePoolsUnauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func IsAdmin(userName string) bool {\n\tif strings.ToUpper(userName) == strings.ToUpper(os.Getenv(\"CLAIMR_SUPERUSER\")) {\n\t\treturn true\n\t}\n\n\tfor _, admin := range Admins {\n\t\tif strings.ToUpper(userName) == strings.ToUpper(admin.ID) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "func (o *UpdateUserGroupsMultiStatus) IsCode(code int) bool {\n\treturn code == 207\n}", "func isAdmin(user string) bool {\n\treturn user == ROOT1 || user == ROOT2\n}", "func (o *V2UpdateClusterUISettingsUnauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func isAdmin(res http.ResponseWriter, req *http.Request) bool {\n\tmyUser := getUser(res, req)\n\treturn myUser.Username == \"admin\"\n}", "func (o *GetCombinedSensorInstallersByQueryForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *PcloudCloudinstancesSnapshotsGetallForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *SchemaObjectsUpdateUnauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func (o *UpdatePrivilegeNotFound) IsCode(code int) bool {\n\treturn code == 404\n}", "func (c *Context) RunAdmin(fn testFunc) {\n\tif c.Admin != nil {\n\t\tc.Run(\"Admin\", fn)\n\t}\n}", "func (ua *UserAddress) Compare(uat *UserAddress) ([]app.Invalid, error) {\n\tvar inv []app.Invalid\n\n\tif ua.Type != uat.Type {\n\t\tinv = append(inv, app.Invalid{Fld: \"Type\", Err: fmt.Sprintf(\"The value of Type is not the same. %d != %d\", ua.Type, uat.Type)})\n\t}\n\n\tif ua.LineOne != uat.LineOne {\n\t\tinv = append(inv, app.Invalid{Fld: \"LineOne\", Err: fmt.Sprintf(\"The value of LineOne is not the same. %s != %s\", ua.LineOne, uat.LineOne)})\n\t}\n\n\tif ua.City != uat.City {\n\t\tinv = append(inv, app.Invalid{Fld: \"City\", Err: fmt.Sprintf(\"The value of City is not the same. %s != %s\", ua.City, uat.City)})\n\t}\n\n\tif ua.State != uat.State {\n\t\tinv = append(inv, app.Invalid{Fld: \"State\", Err: fmt.Sprintf(\"The value of State is not the same. %s != %s\", ua.State, uat.State)})\n\t}\n\n\tif ua.Zipcode != uat.Zipcode {\n\t\tinv = append(inv, app.Invalid{Fld: \"Zipcode\", Err: fmt.Sprintf(\"The value of Zipcode is not the same. %s != %s\", ua.Zipcode, uat.Zipcode)})\n\t}\n\n\tif ua.Phone != uat.Phone {\n\t\tinv = append(inv, app.Invalid{Fld: \"Phone\", Err: fmt.Sprintf(\"The value of Phone is not the same. %s != %s\", ua.Phone, uat.Phone)})\n\t}\n\n\tif len(inv) > 0 {\n\t\treturn inv, errors.New(\"Compare failures identified\")\n\t}\n\n\treturn nil, nil\n}", "func (d *DB) IsAdmin(uuid string) (bool, error) {\n\tcnt := 0\n\tr := d.db.QueryRow(\"SELECT COUNT(*) FROM teammember INNER JOIN username ON teamuuid = uuid WHERE useruuid = $1 AND username = $2\", uuid, teamNameAdmin)\n\terr := r.Scan(&cnt)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn cnt == 1, nil\n}", "func (o *GetDeploymentActionsUsingGET2Unauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func (i *IRC) AdminLevel(source string) int {\n\tfor _, a := range i.Admins {\n\t\tlowerAdmin := strings.ToLower(a.Mask)\n\t\tlowerSource := strings.ToLower(source)\n\n\t\tif util.GlobToRegexp(lowerAdmin).MatchString(lowerSource) {\n\t\t\treturn a.Level\n\t\t}\n\t}\n\n\treturn 0\n}", "func (o *QueryScansForbidden) Code() int {\n\treturn 403\n}", "func (o *GetConfigurationSourceTreeUsingGETForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func IsAdmin(email string) bool {\n\tfor _, admin := range GetAdmins() {\n\t\tif email == admin {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (o *UpdateRepository24Forbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *ArchiveRunsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *AggregateScansForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *V2ReportMonitoredOperatorStatusForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *QueryApplicationsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func Compare(encoded string, plain string) bool {\n\terr := bcrypt.CompareHashAndPassword([]byte(encoded), []byte(plain))\n\treturn err == nil\n}", "func (o *QueryApplicationsForbidden) Code() int {\n\treturn 403\n}", "func (o *QueryScheduledScansForbidden) Code() int {\n\treturn 403\n}", "func CheckAuthCodeByUserAndCode(userID int64, code string) (bool, error) {\n\treturn database.Orm.Table(\"auth_code\").Exist(\n\t\t&entity.AuthCode{\n\t\t\tUserID: userID,\n\t\t\tCode: code,\n\t\t})\n}", "func adminAccessTest(t *testing.T, r *http.Request, h http.Handler, auth *mock.Authenticator,\n\toutputTester func(*http.Response)) {\n\n\toriginal := auth.GetAuthInfoFn\n\tauth.GetAuthInfoFn = getAuthInfoGenerator(\"\", false, errors.New(\"An error\"))\n\tw := httptest.NewRecorder()\n\th.ServeHTTP(w, r)\n\ttest.Equals(t, http.StatusBadRequest, w.Result().StatusCode)\n\tauth.GetAuthInfoFn = getAuthInfoGenerator(\"random_admin_name\", true, nil)\n\tw = httptest.NewRecorder()\n\th.ServeHTTP(w, r)\n\toutputTester(w.Result())\n\tauth.GetAuthInfoFn = original\n}", "func (me TxsdContactRole) IsAdmin() bool { return me.String() == \"admin\" }", "func (s UserAuthServiceImpl) CheckAdmin() (*dto.UserAuth, error) {\n\n\tfilter := struct {\n\t\tRole string `json:\"role\" bson:\"role\"`\n\t}{\n\t\tRole: \"admin\",\n\t}\n\treturn s.FindOneUserAuth(filter)\n}", "func (o *EquipmentIdentityAllOf) GetAdminActionOk() (*string, bool) {\n\tif o == nil || o.AdminAction == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AdminAction, true\n}", "func (o *TransferRunsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UpdateFirewallPoliciesForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *GetVersionStagesForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UpdateIOAExclusionsV1Forbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UserRolesActionV1Forbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UpdateUserGroupsMultiStatus) Code() int {\n\treturn 207\n}", "func (o *ArchiveRunsForbidden) Code() int {\n\treturn 403\n}", "func (_Cakevault *CakevaultCaller) Admin(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Cakevault.contract.Call(opts, &out, \"admin\")\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "func (o *TransferRunsForbidden) Code() int {\n\treturn 403\n}", "func (o *EmsConfigModifyOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *DcimRackRolesBulkPartialUpdateOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *GetCustomIntegrationVersionByIDUsingGETForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *ListDashboardsForbidden) Code() int {\n\treturn 403\n}", "func (o *UpdateLoggedInAthleteDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *BackupsCreateStatusForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (serv *ExchangeServer) IsAdmin(pubkey string) bool {\n\tlogger.Debug(\"admins:%s, pubkey:%s\", serv.cfg.Admins, pubkey)\n\treturn strings.Contains(serv.cfg.Admins, pubkey)\n}", "func (o *SchemaObjectsUpdateForbidden) Code() int {\n\treturn 403\n}", "func (o *UpdateRepository3Unauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func (o *ReorderSecurityRealmsOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *ListTemplatesForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func UpdateAuthorizationCode(mongo *mongo.Client, login, code string, codeValidUntil time.Time) error {\n\tfieldsToUpdate := primitive.D{\n\t\t{\"auth.code\", code},\n\t\t{\"auth.codeValidUntil\", codeValidUntil},\n\t}\n\n\treturn updateUser(mongo, login, fieldsToUpdate)\n}", "func (o *ListNodePoolsForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (u *User) Compare(ut *User) ([]app.Invalid, error) {\n\tvar inv []app.Invalid\n\n\tif u.UserType != ut.UserType {\n\t\tinv = append(inv, app.Invalid{Fld: \"UserType\", Err: fmt.Sprintf(\"The value of UserType is not the same. %d != %d\", u.UserType, ut.UserType)})\n\t}\n\n\tif u.FirstName != ut.FirstName {\n\t\tinv = append(inv, app.Invalid{Fld: \"FirstName\", Err: fmt.Sprintf(\"The value of FirstName is not the same. %s != %s\", u.FirstName, ut.FirstName)})\n\t}\n\n\tif u.LastName != ut.LastName {\n\t\tinv = append(inv, app.Invalid{Fld: \"LastName\", Err: fmt.Sprintf(\"The value of LastName is not the same. %s != %s\", u.LastName, ut.LastName)})\n\t}\n\n\tif u.Email != ut.Email {\n\t\tinv = append(inv, app.Invalid{Fld: \"Email\", Err: fmt.Sprintf(\"The value of Email is not the same. %s != %s\", u.Email, ut.Email)})\n\t}\n\n\tif u.Company != ut.Company {\n\t\tinv = append(inv, app.Invalid{Fld: \"Company\", Err: fmt.Sprintf(\"The value of Company is not the same. %s != %s\", u.Company, ut.Company)})\n\t}\n\n\tuLen := len(u.Addresses)\n\tutLen := len(ut.Addresses)\n\n\tif uLen != utLen {\n\t\tinv = append(inv, app.Invalid{Fld: \"Addresses\", Err: fmt.Sprintf(\"The set of Addresses is not the same. %d != %d\", uLen, utLen)})\n\t}\n\n\tfor idx, ua := range u.Addresses {\n\t\tif idx >= utLen {\n\t\t\tbreak\n\t\t}\n\n\t\tif va, err := ua.Compare(&ut.Addresses[idx]); err != nil {\n\t\t\tinv = append(inv, va...)\n\t\t}\n\t}\n\n\tif len(inv) > 0 {\n\t\treturn inv, errors.New(\"Compare failures identified\")\n\t}\n\n\treturn nil, nil\n}", "func (o *UnixUserSettingsModifyDefault) IsCode(code int) bool {\n\treturn o._statusCode == code\n}", "func Solve() string {\n\tct := encryptUserData(make([]byte, 32))\n\tblock := bytes.Xor(ct[32:48], []byte(\"<--->;admin=true\"))\n\tfor i := range block {\n\t\tct[32+i] = block[i]\n\t}\n\treturn getAdmin(ct)\n}", "func (o *AggregateScansForbidden) Code() int {\n\treturn 403\n}", "func isAdmin(ctx iris.Context) (bool, error) {\n\tu, err := bearerToUser(ctx)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn u.Active && u.Role == models.AdminRole, nil\n}", "func (o *ListNodePoolsUnauthorized) Code() int {\n\treturn 401\n}", "func (o *QueryGroupMembersForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func ValidAdmin(organization string, w http.ResponseWriter, r *http.Request) bool {\n\ttoken, err := authsdk.NewJWTTokenFromRequest(r)\n\tif err != nil {\n\t\tfmt.Printf(\"Error getting JWT Token: %v\\n\", err)\n\t\thttp.Error(w, \"Invalid Token\", http.StatusUnauthorized) //401\n\t\treturn false\n\t}\n\tisAdmin, err := token.IsOrgAdmin(organization)\n\tif err != nil {\n\t\tfmt.Printf(\"Error checking caller is an Org Admin: %v\\n\", err) //401\n\t\thttp.Error(w, \"\", http.StatusUnauthorized)\n\t\treturn false\n\t}\n\tif !isAdmin {\n\t\t//Throwing a 403\n\t\tfmt.Printf(\"Caller isn't an Org Admin\\n\")\n\t\thttp.Error(w, \"You aren't an Org Admin\", http.StatusForbidden) //403\n\t\treturn false\n\t}\n\treturn true\n}", "func (o *GetConfigurationSourceTreeUsingGETUnauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func (o *GetExecutionByIndexAndPipelineIDUsingGETForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *ResetPasswordForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *ListPeerFoldersForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UpdateUserGroupsOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *UpdateRepository24Unauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func (o *V2ReportMonitoredOperatorStatusUnauthorized) IsCode(code int) bool {\n\treturn code == 401\n}", "func (o *V2ReportMonitoredOperatorStatusOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *GetCustomNameByProjectIDForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *GetAllProjectsUsingGETForbidden) IsCode(code int) bool {\n\treturn code == 403\n}", "func (o *UserGetMeForbidden) IsCode(code int) bool {\n\treturn code == 403\n}" ]
[ "0.5926233", "0.5840442", "0.5440513", "0.5376668", "0.53707075", "0.5186763", "0.51571697", "0.51361406", "0.50601006", "0.5047268", "0.50200075", "0.5019204", "0.5016419", "0.50071216", "0.49842063", "0.49710804", "0.49564472", "0.494138", "0.49289712", "0.490529", "0.4904008", "0.48821637", "0.48757583", "0.48737934", "0.48631513", "0.48557422", "0.48521128", "0.48486784", "0.48420912", "0.48417586", "0.48389938", "0.48387638", "0.48295626", "0.48280606", "0.4827514", "0.4823496", "0.48161057", "0.48160657", "0.48152265", "0.48146048", "0.48118976", "0.48092732", "0.4806036", "0.48030517", "0.4799389", "0.4796701", "0.4793236", "0.4792485", "0.4788446", "0.47856012", "0.47837833", "0.4781452", "0.4780616", "0.47751066", "0.47702488", "0.47542223", "0.47472376", "0.47465506", "0.47371018", "0.47247368", "0.47233585", "0.47207633", "0.4716049", "0.47090596", "0.47044012", "0.47036806", "0.47033784", "0.47025412", "0.4702024", "0.46989673", "0.46985346", "0.469381", "0.4691421", "0.4689572", "0.4687976", "0.46873912", "0.4687076", "0.46843886", "0.46841183", "0.4681158", "0.46795994", "0.4678439", "0.467512", "0.4674532", "0.46702713", "0.46700907", "0.46693414", "0.4665599", "0.46642745", "0.46635595", "0.46624452", "0.46563628", "0.4652273", "0.46519965", "0.464911", "0.46480754", "0.46409523", "0.4638726", "0.46347302", "0.4629413" ]
0.80040187
0
Value returns a value constructed from the type of the event and filled via the bound contract's UnpackLog function. The optional typ parameter allows to disambiguate the type to select. This is useful in cases where the ID of an EventInfo refers to multiples EventType where each of the bound contract would be able to unpack the log with no error.
Значение возвращает значение, построенное из типа события и заполненное с помощью функции UnpackLog связанного контракта. Опциональный параметр typ позволяет разрешить неоднозначность типа для выбора. Это полезно в случаях, когда идентификатор EventInfo ссылается на несколько EventType, и каждый из связанных контрактов может распаковать лог без ошибки.
func (ev *EventInfo) Value(log types.Log, typ ...reflect.Type) (res reflect.Value, err error) { var ty reflect.Type if len(typ) > 0 { ty = typ[0] } for _, u := range ev.Types { if ty != nil && ty != u.Type { continue } event := reflect.New(u.Type.Elem()) err = u.BoundContract.UnpackLog(event.Interface(), ev.Name, log) if err != nil { continue } f := event.Elem().FieldByName("Raw") if f.IsValid() && f.CanSet() { f.Set(reflect.ValueOf(log)) } return event, nil } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e _event) Type() string { return e.Type_ }", "func (ev binlogEvent) Type() byte {\n\treturn ev.Bytes()[BinlogEventTypeOffset]\n}", "func (e *basicEvent) Type() Type {\n\treturn e.dtype\n}", "func EventType(val string) zap.Field {\n\treturn zap.String(FieldEventType, val)\n}", "func (bse *BaseEvent) Type(eventType string) {\n\tbse.EventType = eventType\n}", "func (e *Event) Type() string {\n\treturn e.eventType\n}", "func getEventLogInfo(parsedEventLogEntry types.TpmEvent) types.EventLog {\n\n\tlog.Trace(\"vmware_host_connector:getEventLogInfo() Entering\")\n\tdefer log.Trace(\"vmware_host_connector:getEventLogInfo() Leaving\")\n\teventLog := types.EventLog{Measurement: intArrayToHexString(parsedEventLogEntry.EventDetails.DataHash)}\n\n\tif parsedEventLogEntry.EventDetails.VibName != nil {\n\t\teventLog.TypeID = VIB_NAME_TYPE_ID\n\t\teventLog.TypeName = *parsedEventLogEntry.EventDetails.ComponentName\n\t\teventLog.Tags = append(eventLog.Tags, COMPONENT_PREFIX+*parsedEventLogEntry.EventDetails.ComponentName)\n\t\tif *parsedEventLogEntry.EventDetails.VibName != \"\" {\n\t\t\teventLog.Tags = append(eventLog.Tags, VIM_API_PREFIX+TPM_SOFTWARE_COMPONENT_EVENT_TYPE+DETAILS_SUFFIX+\"_\"+*parsedEventLogEntry.EventDetails.VibName+\"_\"+*parsedEventLogEntry.EventDetails.VibVendor)\n\t\t} else {\n\t\t\teventLog.Tags = append(eventLog.Tags, VIM_API_PREFIX+TPM_SOFTWARE_COMPONENT_EVENT_TYPE+DETAILS_SUFFIX)\n\t\t}\n\t} else if parsedEventLogEntry.EventDetails.CommandLine != nil {\n\t\teventLog.TypeID = COMMANDLINE_TYPE_ID\n\t\tuuid := getBootUUIDFromCL(*parsedEventLogEntry.EventDetails.CommandLine)\n\t\tif uuid != \"\" {\n\t\t\teventLog.Tags = append(eventLog.Tags, COMMANDLINE_PREFIX)\n\t\t} else {\n\t\t\teventLog.Tags = append(eventLog.Tags, COMMANDLINE_PREFIX+*parsedEventLogEntry.EventDetails.CommandLine)\n\t\t}\n\t\teventLog.TypeName = *parsedEventLogEntry.EventDetails.CommandLine\n\t\teventLog.Tags = append(eventLog.Tags, VIM_API_PREFIX+TPM_COMMAND_EVENT_TYPE+DETAILS_SUFFIX)\n\n\t} else if parsedEventLogEntry.EventDetails.OptionsFileName != nil {\n\t\teventLog.TypeID = OPTIONS_FILE_NAME_TYPE_ID\n\t\teventLog.TypeName = *parsedEventLogEntry.EventDetails.OptionsFileName\n\t\teventLog.Tags = append(eventLog.Tags, BOOT_OPTIONS_PREFIX+*parsedEventLogEntry.EventDetails.OptionsFileName)\n\t\teventLog.Tags = append(eventLog.Tags, VIM_API_PREFIX+TPM_OPTION_EVENT_TYPE+DETAILS_SUFFIX)\n\n\t} else if parsedEventLogEntry.EventDetails.BootSecurityOption != nil {\n\t\teventLog.TypeID = BOOT_SECURITY_OPTION_TYPE_ID\n\t\teventLog.TypeName = *parsedEventLogEntry.EventDetails.BootSecurityOption\n\t\teventLog.Tags = append(eventLog.Tags, BOOT_SECURITY_OPTIONS_PREFIX+*parsedEventLogEntry.EventDetails.BootSecurityOption)\n\t\teventLog.Tags = append(eventLog.Tags, VIM_API_PREFIX+TPM_BOOT_SECURITY_OPTION_EVENT_TYPE+DETAILS_SUFFIX)\n\t} else {\n\t\tlog.Warn(\"Unrecognized event in module event log\")\n\t}\n\n\treturn eventLog\n}", "func (e Event) GetType() int {\n\treturn int(C.caca_get_event_type(e.Ev))\n}", "func (e *Event) GetType() string {\n\tif e == nil || e.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Type\n}", "func EventKind(val string) zap.Field {\n\treturn zap.String(FieldEventKind, val)\n}", "func (e *basicEvent) TypeString() string {\n\treturn e.etype\n}", "func (e *Event) Type() EventType {\n\treturn e.eventID\n}", "func (c *InjectEvent) AggregateType() eh.AggregateType { return AggregateType }", "func (uem UnknownEventMetadata) Type() string {\n\treturn \"unknown\"\n}", "func gethUnpackLog(codec *contractCodec, out interface{}, event string, log types.Log) error {\n\tif len(log.Data) > 0 {\n\t\tif err := codec.abi.UnpackIntoInterface(out, event, log.Data); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tvar indexed abi.Arguments\n\tfor _, arg := range codec.abi.Events[event].Inputs {\n\t\tif arg.Indexed {\n\t\t\tindexed = append(indexed, arg)\n\t\t}\n\t}\n\treturn parseTopics(out, indexed, log.Topics[1:])\n}", "func (e *Event) GetType() EventType {\n\treturn EventType(C.CALL_MACRO_GST_EVENT_TYPE(e.g()))\n}", "func (ce *CustomEvent) GetType() string {\n\treturn ce.eventType.String()\n}", "func CastBACnetLogDataLogDataEntryAnyValue(structType any) BACnetLogDataLogDataEntryAnyValue {\n\tif casted, ok := structType.(BACnetLogDataLogDataEntryAnyValue); ok {\n\t\treturn casted\n\t}\n\tif casted, ok := structType.(*BACnetLogDataLogDataEntryAnyValue); ok {\n\t\treturn *casted\n\t}\n\treturn nil\n}", "func (f *FilterConfig) Event(ctx context.Context, event logevent.LogEvent) (logevent.LogEvent, bool) {\n\tfor _, field := range f.Fields {\n\t\tif value, ok := event.GetValue(field); ok {\n\t\t\tswitch f.ConvType {\n\t\t\tcase convTypeString:\n\t\t\t\tswitch v := value.(type) {\n\t\t\t\tcase string:\n\t\t\t\tdefault:\n\t\t\t\t\tevent.SetValue(field, fmt.Sprintf(\"%v\", v))\n\t\t\t\t}\n\t\t\tcase convTypeInt64:\n\t\t\t\tswitch v := value.(type) {\n\t\t\t\tcase string:\n\t\t\t\t\tif vparse, err := strconv.ParseInt(v, 0, 64); err == nil {\n\t\t\t\t\t\tevent.SetValue(field, vparse)\n\t\t\t\t\t} else if vparse, err := strconv.ParseFloat(v, 64); err == nil {\n\t\t\t\t\t\tevent.SetValue(field, int64(vparse))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgoglog.Logger.Error(err)\n\t\t\t\t\t\tevent.AddTag(ErrorTag)\n\t\t\t\t\t}\n\t\t\t\tcase int:\n\t\t\t\t\tevent.SetValue(field, int64(v))\n\t\t\t\tcase int8:\n\t\t\t\t\tevent.SetValue(field, int64(v))\n\t\t\t\tcase int16:\n\t\t\t\t\tevent.SetValue(field, int64(v))\n\t\t\t\tcase int32:\n\t\t\t\t\tevent.SetValue(field, int64(v))\n\t\t\t\tcase int64:\n\t\t\t\tcase float32:\n\t\t\t\t\tevent.SetValue(field, int64(v))\n\t\t\t\tcase float64:\n\t\t\t\t\tevent.SetValue(field, int64(v))\n\t\t\t\tdefault:\n\t\t\t\t\tif vparse, err := strconv.ParseInt(fmt.Sprintf(\"%v\", v), 0, 64); err == nil {\n\t\t\t\t\t\tevent.SetValue(field, vparse)\n\t\t\t\t\t} else if vparse, err := strconv.ParseFloat(fmt.Sprintf(\"%v\", v), 64); err == nil {\n\t\t\t\t\t\tevent.SetValue(field, int64(vparse))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgoglog.Logger.Error(err)\n\t\t\t\t\t\tevent.AddTag(ErrorTag)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase convTypeFloat64:\n\t\t\t\tswitch v := value.(type) {\n\t\t\t\tcase string:\n\t\t\t\t\tif vparse, err := strconv.ParseFloat(v, 64); err == nil {\n\t\t\t\t\t\tevent.SetValue(field, vparse)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgoglog.Logger.Error(err)\n\t\t\t\t\t\tevent.AddTag(ErrorTag)\n\t\t\t\t\t}\n\t\t\t\tcase int:\n\t\t\t\t\tevent.SetValue(field, float64(v))\n\t\t\t\tcase int8:\n\t\t\t\t\tevent.SetValue(field, float64(v))\n\t\t\t\tcase int16:\n\t\t\t\t\tevent.SetValue(field, float64(v))\n\t\t\t\tcase int32:\n\t\t\t\t\tevent.SetValue(field, float64(v))\n\t\t\t\tcase int64:\n\t\t\t\t\tevent.SetValue(field, float64(v))\n\t\t\t\tcase float32:\n\t\t\t\t\tevent.SetValue(field, float64(v))\n\t\t\t\tcase float64:\n\t\t\t\tdefault:\n\t\t\t\t\tif vparse, err := strconv.ParseFloat(fmt.Sprintf(\"%v\", v), 64); err == nil {\n\t\t\t\t\t\tevent.SetValue(field, vparse)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgoglog.Logger.Error(err)\n\t\t\t\t\t\tevent.AddTag(ErrorTag)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: no converts return false\n\treturn event, true\n}", "func (me TEventType) String() string { return xsdt.String(me).String() }", "func (t *TimeDynamic) LogValue() interface{} {\n\tvar now time.Time\n\tif t.TimeKeeper == nil {\n\t\tnow = time.Now()\n\t} else {\n\t\tnow = t.TimeKeeper.Now()\n\t}\n\tif t.UTC {\n\t\tnow = now.UTC()\n\t}\n\tif !t.AsString {\n\t\treturn now\n\t}\n\tif t.Layout == \"\" {\n\t\treturn now.Format(time.RFC3339)\n\t}\n\treturn now.Format(t.Layout)\n}", "func (event *GGEvent) Type() int {\n\treturn (int)(event._type)\n}", "func (s *SaveApplicationLogEventRequest) TypeInfo() tdp.Type {\n\ttyp := tdp.Type{\n\t\tName: \"saveApplicationLogEvent\",\n\t\tID: SaveApplicationLogEventRequestTypeID,\n\t}\n\tif s == nil {\n\t\ttyp.Null = true\n\t\treturn typ\n\t}\n\ttyp.Fields = []tdp.Field{\n\t\t{\n\t\t\tName: \"Type\",\n\t\t\tSchemaName: \"type\",\n\t\t},\n\t\t{\n\t\t\tName: \"ChatID\",\n\t\t\tSchemaName: \"chat_id\",\n\t\t},\n\t\t{\n\t\t\tName: \"Data\",\n\t\t\tSchemaName: \"data\",\n\t\t},\n\t}\n\treturn typ\n}", "func (a ProblemAdapter) GetEvent() string {\n\treturn a.cloudEvent.GetType()\n}", "func (e event) Data() eh.EventData {\n\treturn e.AggregateEvent.data\n}", "func (o AuditLogConfigResponseOutput) LogType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AuditLogConfigResponse) string { return v.LogType }).(pulumi.StringOutput)\n}", "func (o AuditLogConfigResponseOutput) LogType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AuditLogConfigResponse) string { return v.LogType }).(pulumi.StringOutput)\n}", "func (o AuditLogConfigResponseOutput) LogType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AuditLogConfigResponse) string { return v.LogType }).(pulumi.StringOutput)\n}", "func (o AuditLogConfigResponseOutput) LogType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AuditLogConfigResponse) string { return v.LogType }).(pulumi.StringOutput)\n}", "func (o AuditLogConfigResponseOutput) LogType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AuditLogConfigResponse) string { return v.LogType }).(pulumi.StringOutput)\n}", "func (m *EventLog) Get(key string) interface{} {\n\treturn m.Payload()[key]\n}", "func (e *Enum) Value(gtx *layout.Context) string {\n\tfor i := range e.clicks {\n\t\tfor _, ev := range e.clicks[i].Events(gtx) {\n\t\t\tswitch ev.Type {\n\t\t\tcase gesture.TypeClick:\n\t\t\t\te.value = e.values[i]\n\t\t\t}\n\t\t}\n\t}\n\treturn e.value\n}", "func (et EventerType) String() string {\n\tswitch et {\n\tcase LogFile:\n\t\treturn \"file\"\n\tcase Journald:\n\t\treturn \"journald\"\n\tcase Memory:\n\t\treturn \"memory\"\n\tcase Null:\n\t\treturn \"none\"\n\tdefault:\n\t\treturn \"invalid\"\n\t}\n}", "func (v Value) Type() Type {\n\tpanic(message)\n}", "func (fc *FilterConfig) Event(event utils.LogEvent) utils.LogEvent {\n\tif event.Extra == nil {\n\t\tevent.Extra = make(map[string]interface{})\n\t}\n\targs := strings.Split(event.Message, fc.Separator)\n\tif len(args) > 0 {\n\t\tevent.Message = args[0]\n\t}\n\n\tevent.Extra[\"args\"] = args[1:]\n\n\treturn event\n}", "func (s *Smpval) Value() reflect.Value {\n\treturn s.val\n}", "func (e *EventAPI) Get(name string) (*EventType, error) {\n\teventType := &EventType{}\n\terr := e.client.httpGET(e.backOffConf.create(), e.eventURL(name), eventType, \"unable to request event types\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn eventType, nil\n}", "func (server *p2pLogEx) GetValue(logEx *LogEx, key log.EncodedHash, object *[]byte) error {\n value, err := logEx.theLog.GetValue(key)\n if err != nil {\n return err\n }\n *object = value\n return nil\n}", "func (*SaveApplicationLogEventRequest) TypeName() string {\n\treturn \"saveApplicationLogEvent\"\n}", "func (handler *ConsoleLogHandler) Process(entry interface{}) {\r\n if data, ok := entry.([]byte); ok {\r\n fmt.Println(string(data))\r\n }\r\n}", "func (e *Event) GoString() string {\n\treturn e.String()\n}", "func (e *Event) GoString() string {\n\treturn e.String()\n}", "func (o AuditLogConfigOutput) LogType() AuditLogConfigLogTypePtrOutput {\n\treturn o.ApplyT(func(v AuditLogConfig) *AuditLogConfigLogType { return v.LogType }).(AuditLogConfigLogTypePtrOutput)\n}", "func (o AuditLogConfigOutput) LogType() AuditLogConfigLogTypePtrOutput {\n\treturn o.ApplyT(func(v AuditLogConfig) *AuditLogConfigLogType { return v.LogType }).(AuditLogConfigLogTypePtrOutput)\n}", "func (o AuditLogConfigOutput) LogType() AuditLogConfigLogTypePtrOutput {\n\treturn o.ApplyT(func(v AuditLogConfig) *AuditLogConfigLogType { return v.LogType }).(AuditLogConfigLogTypePtrOutput)\n}", "func (o AuditLogConfigOutput) LogType() AuditLogConfigLogTypePtrOutput {\n\treturn o.ApplyT(func(v AuditLogConfig) *AuditLogConfigLogType { return v.LogType }).(AuditLogConfigLogTypePtrOutput)\n}", "func (o AuditLogConfigOutput) LogType() AuditLogConfigLogTypePtrOutput {\n\treturn o.ApplyT(func(v AuditLogConfig) *AuditLogConfigLogType { return v.LogType }).(AuditLogConfigLogTypePtrOutput)\n}", "func (ul *UserlogService) StoreGlobalEvent(ctx context.Context, typ string, data map[string]string) error {\n\tctx, span := ul.tracer.Start(ctx, \"StoreGlobalEvent\")\n\tdefer span.End()\n\tswitch typ {\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown event type: %s\", typ)\n\tcase \"deprovision\":\n\t\tdps, ok := data[\"deprovision_date\"]\n\t\tif !ok {\n\t\t\treturn errors.New(\"need 'deprovision_date' in request body\")\n\t\t}\n\n\t\tformat := data[\"deprovision_date_format\"]\n\t\tif format == \"\" {\n\t\t\tformat = time.RFC3339\n\t\t}\n\n\t\tdate, err := time.Parse(format, dps)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"\", format, \"\\n\", dps)\n\t\t\treturn fmt.Errorf(\"cannot parse time to format. time: '%s' format: '%s'\", dps, format)\n\t\t}\n\n\t\tev := DeprovisionData{\n\t\t\tDeprovisionDate: date,\n\t\t\tDeprovisionFormat: format,\n\t\t}\n\n\t\tb, err := json.Marshal(ev)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn ul.alterGlobalEvents(ctx, func(evs map[string]json.RawMessage) error {\n\t\t\tevs[typ] = b\n\t\t\treturn nil\n\t\t})\n\t}\n}", "func getEventValue(event *kube_api.Event) (string, error) {\n\t// TODO: check whether indenting is required.\n\tbytes, err := json.MarshalIndent(event, \"\", \" \")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(bytes), nil\n}", "func (bot) Type(t string) string {\n\tif !contains(knownBotEvents, t) {\n\t\tlog.Printf(\"[WARN] unknown bot event type: %q\", t)\n\t}\n\treturn strings.ToLower(fmt.Sprintf(bot_type_template, t))\n}", "func (s JobLogEventData) GoString() string {\n\treturn s.String()\n}", "func (c *Collection) GetEvent(\n\tkey, typ string, ts time.Time, ordinal int64, value interface{},\n) (*Event, error) {\n\tevent := &Event{\n\t\tCollection: c,\n\t\tKey: key,\n\t\tOrdinal: ordinal,\n\t\tTimestamp: ts,\n\t\tType: typ,\n\t}\n\n\t// Perform the actual GET\n\tpath := fmt.Sprintf(\"%s/%s/events/%s/%d/%d\", c.Name, key, typ,\n\t\tts.UnixNano()/1000000, ordinal)\n\tvar responseData jsonEvent\n\t_, err := c.client.jsonReply(\"GET\", path, nil, 200, &responseData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Move the data from the returned values into the Event object.\n\tevent.Value = responseData.Value\n\tevent.Ref = responseData.Path.Ref\n\tsecs := responseData.Timestamp / 1000\n\tnsecs := (responseData.Timestamp % 1000) * 1000000\n\tevent.Timestamp = time.Unix(secs, nsecs)\n\tevent.Ordinal = responseData.Ordinal\n\n\t// If the user provided us a place to unmarshal the 'value' field into\n\t// we do that here.\n\tif value != nil {\n\t\treturn event, event.Unmarshal(value)\n\t}\n\n\t// Success\n\treturn event, nil\n}", "func (x *fastReflection_EventReceive) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tcase \"regen.ecocredit.v1alpha1.EventReceive.sender\":\n\t\tvalue := x.Sender\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"regen.ecocredit.v1alpha1.EventReceive.recipient\":\n\t\tvalue := x.Recipient\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"regen.ecocredit.v1alpha1.EventReceive.batch_denom\":\n\t\tvalue := x.BatchDenom\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"regen.ecocredit.v1alpha1.EventReceive.tradable_amount\":\n\t\tvalue := x.TradableAmount\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"regen.ecocredit.v1alpha1.EventReceive.retired_amount\":\n\t\tvalue := x.RetiredAmount\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"regen.ecocredit.v1alpha1.EventReceive.basket_denom\":\n\t\tvalue := x.BasketDenom\n\t\treturn protoreflect.ValueOfString(value)\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: regen.ecocredit.v1alpha1.EventReceive\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message regen.ecocredit.v1alpha1.EventReceive does not contain field %s\", descriptor.FullName()))\n\t}\n}", "func (e *Event) Data(out interface{}) error {\n\treturn json.Unmarshal([]byte(e.data), out)\n}", "func (s *Smpval) Type() reflect.Type {\n\treturn s.val.Type()\n}", "func (s *Structured) GetType() string {\n\treturn s.cloudEvent.EventType\n}", "func UnmarshalEvent(data []byte) (Event, error) {\n\t//first we extract the generic part\n\taux := struct {\n\t\tStreamTCStr string `json:\"stream-timecode\"`\n\t\tRecTCStr string `json:\"rec-timecode\"`\n\t\tUpdateType string `json:\"update-type\"`\n\t}{}\n\n\tif err := json.Unmarshal(data, &aux); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(aux.UpdateType) == 0 {\n\t\treturn nil, ErrNotEventMessage{}\n\t}\n\trawE := &rawEvent{\n\t\teventType: aux.UpdateType,\n\t\trecTC: -1,\n\t\tstreamTC: -1,\n\t}\n\n\tif len(aux.StreamTCStr) > 0 {\n\t\tvar err error\n\t\trawE.streamTC, err = parseTC(aux.StreamTCStr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif len(aux.RecTCStr) > 0 {\n\t\tvar err error\n\t\trawE.recTC, err = parseTC(aux.RecTCStr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// now we extract the generic part\n\tevType, ok := eventFactory[rawE.UpdateType()]\n\tif ok == false {\n\t\treturn nil, ErrUnknownEventType{rawE.UpdateType()}\n\t}\n\n\tevInst := reflect.New(evType)\n\tev := evInst.Interface().(Event)\n\n\terr := json.Unmarshal(data, &ev)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// copy back initial data\n\tev.copyFromOther(rawE)\n\treturn ev, nil\n}", "func (f Fields) ValueForFieldOfType(fieldName, typ string) string {\n\tfor _, field := range f {\n\t\tif field.Var == fieldName && field.Type == typ && len(field.Values) > 0 {\n\t\t\treturn field.Values[0]\n\t\t}\n\t}\n\treturn \"\"\n}", "func (o SolutionOutput) EventType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Solution) pulumi.StringPtrOutput { return v.EventType }).(pulumi.StringPtrOutput)\n}", "func (l *ZapLogger) LogEvent(event Event) {\n\tswitch e := event.(type) {\n\tcase *OnStartExecuting:\n\t\tl.Logger.Info(\"OnStart hook executing\",\n\t\t\tzap.String(\"callee\", e.FunctionName),\n\t\t\tzap.String(\"caller\", e.CallerName),\n\t\t)\n\tcase *OnStartExecuted:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Info(\"OnStart hook failed\",\n\t\t\t\tzap.String(\"callee\", e.FunctionName),\n\t\t\t\tzap.String(\"caller\", e.CallerName),\n\t\t\t\tzap.Error(e.Err),\n\t\t\t)\n\t\t} else {\n\t\t\tl.Logger.Info(\"OnStart hook executed\",\n\t\t\t\tzap.String(\"callee\", e.FunctionName),\n\t\t\t\tzap.String(\"caller\", e.CallerName),\n\t\t\t\tzap.String(\"runtime\", e.Runtime.String()),\n\t\t\t)\n\t\t}\n\tcase *OnStopExecuting:\n\t\tl.Logger.Info(\"OnStop hook executing\",\n\t\t\tzap.String(\"callee\", e.FunctionName),\n\t\t\tzap.String(\"caller\", e.CallerName),\n\t\t)\n\tcase *OnStopExecuted:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Info(\"OnStop hook failed\",\n\t\t\t\tzap.String(\"callee\", e.FunctionName),\n\t\t\t\tzap.String(\"caller\", e.CallerName),\n\t\t\t\tzap.Error(e.Err),\n\t\t\t)\n\t\t} else {\n\t\t\tl.Logger.Info(\"OnStop hook executed\",\n\t\t\t\tzap.String(\"callee\", e.FunctionName),\n\t\t\t\tzap.String(\"caller\", e.CallerName),\n\t\t\t\tzap.String(\"runtime\", e.Runtime.String()),\n\t\t\t)\n\t\t}\n\tcase *Supplied:\n\t\tl.Logger.Info(\"supplied\",\n\t\t\tzap.String(\"type\", e.TypeName),\n\t\t\tmoduleField(e.ModuleName),\n\t\t\tzap.Error(e.Err))\n\tcase *Provided:\n\t\tfor _, rtype := range e.OutputTypeNames {\n\t\t\tl.Logger.Info(\"provided\",\n\t\t\t\tzap.String(\"constructor\", e.ConstructorName),\n\t\t\t\tmoduleField(e.ModuleName),\n\t\t\t\tzap.String(\"type\", rtype),\n\t\t\t)\n\t\t}\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"error encountered while applying options\",\n\t\t\t\tmoduleField(e.ModuleName),\n\t\t\t\tzap.Error(e.Err))\n\t\t}\n\tcase *Decorated:\n\t\tfor _, rtype := range e.OutputTypeNames {\n\t\t\tl.Logger.Info(\"decorated\",\n\t\t\t\tzap.String(\"decorator\", e.DecoratorName),\n\t\t\t\tmoduleField(e.ModuleName),\n\t\t\t\tzap.String(\"type\", rtype),\n\t\t\t)\n\t\t}\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"error encountered while applying options\",\n\t\t\t\tmoduleField(e.ModuleName),\n\t\t\t\tzap.Error(e.Err))\n\t\t}\n\tcase *Invoking:\n\t\t// Do not log stack as it will make logs hard to read.\n\t\tl.Logger.Info(\"invoking\",\n\t\t\tzap.String(\"function\", e.FunctionName),\n\t\t\tmoduleField(e.ModuleName),\n\t\t)\n\tcase *Invoked:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"invoke failed\",\n\t\t\t\tzap.Error(e.Err),\n\t\t\t\tzap.String(\"stack\", e.Trace),\n\t\t\t\tzap.String(\"function\", e.FunctionName),\n\t\t\t\tmoduleField(e.ModuleName),\n\t\t\t)\n\t\t}\n\tcase *Stopping:\n\t\tl.Logger.Info(\"received signal\",\n\t\t\tzap.String(\"signal\", strings.ToUpper(e.Signal.String())))\n\tcase *Stopped:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"stop failed\", zap.Error(e.Err))\n\t\t}\n\tcase *RollingBack:\n\t\tl.Logger.Error(\"start failed, rolling back\", zap.Error(e.StartErr))\n\tcase *RolledBack:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"rollback failed\", zap.Error(e.Err))\n\t\t}\n\tcase *Started:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"start failed\", zap.Error(e.Err))\n\t\t} else {\n\t\t\tl.Logger.Info(\"started\")\n\t\t}\n\tcase *LoggerInitialized:\n\t\tif e.Err != nil {\n\t\t\tl.Logger.Error(\"custom logger initialization failed\", zap.Error(e.Err))\n\t\t} else {\n\t\t\tl.Logger.Info(\"initialized custom fxevent.Logger\", zap.String(\"function\", e.ConstructorName))\n\t\t}\n\t}\n}", "func (t *Type) Val() *Type", "func (e event) Data() eh.EventData {\n\treturn e.dbEvent.data\n}", "func (l eventlog) Log(context interface{}, name string, message string, data ...interface{}) {}", "func (t Type) String() string {\n\treturn fmt.Sprintf(`event.%v`, t.Name())\n}", "func (o *GetPostListParams) bindEventType(rawData []string, hasKey bool, formats strfmt.Registry) error {\n\tvar raw string\n\tif len(rawData) > 0 {\n\t\traw = rawData[len(rawData)-1]\n\t}\n\n\t// Required: false\n\t// AllowEmptyValue: false\n\n\tif raw == \"\" { // empty values pass all other validations\n\t\treturn nil\n\t}\n\to.EventType = &raw\n\n\tif err := o.validateEventType(formats); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (f *field) Val() interface{} {\n\treturn f.v\n}", "func (it *eventsIterator) Value() (*spec.Event, error) {\n\treturn deserializeEvent(it.inner.Value())\n}", "func (o FunctionEventTriggerOutput) EventType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v FunctionEventTrigger) *string { return v.EventType }).(pulumi.StringPtrOutput)\n}", "func (m MapEntry) Val() interface{} {\n\treturn m.val\n}", "func (t ProductType) Value() (driver.Value, error) {\n\tswitch t {\n\tcase IT, Decorate, Etc: //valid case\n\t\treturn string(t), nil\n\t}\n\treturn nil, errors.New(\"Invalid product type value\") //else is invalid\n}", "func (v Value) Type() querypb.Type {\n\treturn v.typ\n}", "func (s *Sentry) Event(logEvent *event.Event) error {\n\tmessage := logEvent.Message\n\tif err, ok := logEvent.FlatFields[\"error\"]; ok {\n\t\tmessage = fmt.Sprintf(\"%s: %v\", message, err)\n\t} else if err, ok := logEvent.FlatFields[\"err\"]; ok {\n\t\tmessage = fmt.Sprintf(\"%s: %v\", message, err)\n\t}\n\n\ts.RLock()\n\tpacket := raven.NewPacket(message)\n\tpacket.Logger = \"sawmill\"\n\tpacket.EventID = s.idPrefix + strconv.FormatInt(int64(logEvent.Id), 10)\n\tpacket.Timestamp = raven.Timestamp(logEvent.Time)\n\tpacket.Level = ravenLevels[logEvent.Level]\n\tfor k, v := range logEvent.FlatFields {\n\t\tpacket.Extra[k] = v\n\t}\n\n\tif len(logEvent.Stack) != 0 {\n\t\tpacket.Culprit = logEvent.Stack[0].Package + \".\" + logEvent.Stack[0].Func\n\t}\n\n\t// translate logEvent.Stack into raven.Stacktrace\n\tpacket.Interfaces = append(packet.Interfaces, ravenTrace(s.repoRoot, logEvent.Stack))\n\n\t_, errChan := s.client.Capture(packet, nil)\n\terr := <-errChan\n\ts.RUnlock()\n\treturn err\n}", "func (EventType) Values() []EventType {\n\treturn []EventType{\n\t\t\"instanceChange\",\n\t\t\"fleetRequestChange\",\n\t\t\"error\",\n\t\t\"information\",\n\t}\n}", "func (s Event) GoString() string {\n\treturn s.String()\n}", "func (handler *Handler) Event(logEvent *event.Event) error {\n\thandler.mutex.Lock()\n\thandler.events = append(handler.events, logEvent)\n\thandler.mutex.Unlock()\n\treturn nil\n}", "func (el *LagerEventListener) Event(e *event.Event) {\n\tlogger := openlogging.GetLogger()\n\tl, ok := logger.(lager.Logger)\n\tif !ok {\n\t\treturn\n\t}\n\n\topenlogging.Info(\"Get lager e\", openlogging.WithTags(openlogging.Tags{\n\t\t\"key\": e.Key,\n\t\t\"value\": e.Value,\n\t\t\"type\": e.EventType,\n\t}))\n\n\tv, ok := e.Value.(string)\n\tif !ok {\n\t\treturn\n\t}\n\n\tvar lagerLogLevel lager.LogLevel\n\tswitch strings.ToUpper(v) {\n\tcase log.DEBUG:\n\t\tlagerLogLevel = lager.DEBUG\n\tcase log.INFO:\n\t\tlagerLogLevel = lager.INFO\n\tcase log.WARN:\n\t\tlagerLogLevel = lager.WARN\n\tcase log.ERROR:\n\t\tlagerLogLevel = lager.ERROR\n\tcase log.FATAL:\n\t\tlagerLogLevel = lager.FATAL\n\tdefault:\n\t\topenlogging.Info(\"ops..., got unknown logger level\")\n\t\treturn\n\t}\n\n\tswitch e.EventType {\n\tcase common.Update:\n\t\tl.SetLogLevel(lagerLogLevel)\n\t}\n}", "func (s *SaveApplicationLogEventRequest) GetType() (value string) {\n\tif s == nil {\n\t\treturn\n\t}\n\treturn s.Type\n}", "func (c *Collection) innerAddEvent(\n\tkey, typ string, ts *time.Time, value interface{},\n) (*Event, error) {\n\tevent := &Event{\n\t\tCollection: c,\n\t\tKey: key,\n\t\tType: typ,\n\t}\n\n\t// Encode the JSON message into a raw value that we can return to the\n\t// client if necessary.\n\tif rawMsg, err := json.Marshal(value); err != nil {\n\t\treturn nil, err\n\t} else {\n\t\tevent.Value = json.RawMessage(rawMsg)\n\t}\n\n\t// Perform the actual POST\n\theaders := map[string]string{\"Content-Type\": \"application/json\"}\n\tvar path string\n\tif ts != nil {\n\t\tpath = fmt.Sprintf(\"%s/%s/events/%s/%d\", c.Name, key, typ,\n\t\t\tts.UnixNano()/1000000)\n\t} else {\n\t\tpath = fmt.Sprintf(\"%s/%s/events/%s\", c.Name, key, typ)\n\t}\n\tresp, err := c.client.emptyReply(\"POST\", path, headers,\n\t\tbytes.NewBuffer(event.Value), 201)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Get the Location header and parse it. The Header will give us the\n\t// Ordinal.\n\tlocation := resp.Header.Get(\"Location\")\n\tif location == \"\" {\n\t\treturn nil, fmt.Errorf(\"Missing Location header.\")\n\t} else if parts := strings.Split(location, \"/\"); len(parts) != 8 {\n\t\treturn nil, fmt.Errorf(\"Malformed Location header.\")\n\t} else if ts, err := strconv.ParseInt(parts[6], 10, 64); err != nil {\n\t\treturn nil, fmt.Errorf(\"Malformed Timestamp in the Location header.\")\n\t} else if ord, err := strconv.ParseInt(parts[7], 10, 64); err != nil {\n\t\treturn nil, fmt.Errorf(\"Malformed Ordinal in the Location header.\")\n\t} else {\n\t\tsecs := ts / 1000\n\t\tnsecs := (ts % 1000) * 1000000\n\t\tevent.Timestamp = time.Unix(secs, nsecs)\n\t\tevent.Ordinal = ord\n\t}\n\n\t// Get the Ref via the Etag header.\n\tif etag := resp.Header.Get(\"Etag\"); etag == \"\" {\n\t\treturn nil, fmt.Errorf(\"Missing ETag header.\")\n\t} else if parts := strings.Split(etag, `\"`); len(parts) != 3 {\n\t\treturn nil, fmt.Errorf(\"Malformed ETag header.\")\n\t} else {\n\t\tevent.Ref = parts[1]\n\t}\n\n\t// Success\n\treturn event, nil\n}", "func (ErrorEvent) Type() EventType {\n\treturn EventError\n}", "func (o GroupDiagnosticsLogAnalyticsOutput) LogType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GroupDiagnosticsLogAnalytics) *string { return v.LogType }).(pulumi.StringPtrOutput)\n}", "func (b *Bus) dispatchEvent(event *Event) {\n\thandler, ok := b.eventHandler[event.Etype]\n\tif !ok {\n\t\tlog.Warningf(\"Uninstalled event: %v\\n\", event.Etype)\n\t\treturn\n\t}\n\thandler(event)\n}", "func (this *DateTruncStr) Type() value.Type { return value.STRING }", "func (e event) String() string {\n\treturn fmt.Sprintf(\"%s@%d\", e.AggregateEvent.EventType, e.AggregateEvent.Version)\n}", "func ValueByType(value []byte, varType VarType) (interface{}, error) {\n\tswitch varType {\n\tcase Str:\n\t\tif len(value) == 0 {\n\t\t\treturn defaultValue(Str), nil\n\t\t}\n\n\t\treturn hack.SliceToString(value), nil\n\tcase Num:\n\t\tif len(value) == 0 {\n\t\t\treturn defaultValue(Str), nil\n\t\t}\n\n\t\treturn format.ParseStrInt64(hack.SliceToString(value))\n\tcase Regexp:\n\t\tif len(value) == 0 {\n\t\t\treturn defaultValue(Str), nil\n\t\t}\n\n\t\treturn regexp.Compile(hack.SliceToString(value))\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%d var type not support\", varType)\n\t}\n}", "func (v Value) Type() Type {\n\treturn v.typ\n}", "func (g *Github) GetEventType(ctx context.Context, r *http.Request) (string, error) {\n\tevent := r.Header.Get(\"X-Github-Event\")\n\tif len(event) == 0 {\n\t\treturn \"\", fmt.Errorf(\"failed to get event type\")\n\t}\n\treturn event, nil\n}", "func (val Value) Type() Type {\n\treturn val.typ\n}", "func LogEvent(thelog StructuredLog, level, event, msg string) {\n\tthelog.Timestamp = time.Now().Format(time.RFC3339)\n\thostname, _ := os.Hostname()\n\tthelog.Server = hostname\n\tthelog.Level = level\n\tthelog.Event = event\n\tthelog.Message = msg\n\t//thelog.Service = \"search-api\"\n\tlogJSON, err := json.Marshal(thelog)\n\tif err != nil {\n\t\tlog.Println(\"Structured Logger: Logger JSON Marshal failed !\")\n\t}\n\tlog.Println(string(logJSON))\n}", "func (s BotAliasHistoryEvent) GoString() string {\n\treturn s.String()\n}", "func (v Value) Type() Type {\n\treturn v.Typ\n}", "func (e *TodoMessageChanged) GetEventType() string {\n\treturn e.EventType\n}", "func (e Event) String() string {\n\tswitch e.Type {\n\tcase EvString:\n\t\treturn fmt.Sprintf(`encoding.%v(%q)`, schemas[e.Type%EvCount].Name, string(e.Data))\n\tcase EvFrequency:\n\t\treturn fmt.Sprintf(`encoding.%v(%v)`, schemas[e.Type%EvCount].Name, e.Args[0])\n\t}\n\treturn fmt.Sprintf(`encoding.%v`, schemas[e.Type%EvCount].Name)\n}", "func qmpEvent(e *libvirt.DomainEvent) (*Event, error) {\n\tvar qe Event\n\n\tif e.Details != nil {\n\t\tif err := json.Unmarshal(e.Details, &qe.Data); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tqe.Event = e.Event\n\tqe.Timestamp.Seconds = int64(e.Seconds)\n\tqe.Timestamp.Microseconds = int64(e.Microseconds)\n\n\treturn &qe, nil\n}", "func GetEventDetailType() *graphql.Object{\n if detailEventType == nil{\n detailEventType = graphql.NewObject(graphql.ObjectConfig{\n Name: \"DetailEventType\",\n Fields: graphql.Fields{\n \"id\": &graphql.Field{\n Type:graphql.Int,\n },\n \"headerId\": &graphql.Field{\n Type:graphql.Int,\n },\n \"entertainmentTicketId\": &graphql.Field{\n Type:graphql.Int,\n },\n \"entertainmentTicket\": &graphql.Field{\n Type: GetEntertainmentTicketType(),\n },\n \"quantity\": &graphql.Field{\n Type:graphql.Int,\n },\n \"type\": &graphql.Field{\n Type:graphql.String,\n },\n },\n })\n }\n return entertainmentTicketType\n}", "func (v *Value) Type() kiwi.ValueType {\n\treturn Type\n}", "func Value(val interface{}, buf []byte) ([]byte, error) {\n\tswitch v := val.(type) {\n\tcase string:\n\t\treturn String(v, buf), nil\n\tcase float64:\n\t\treturn Float64(v, buf)\n\tcase int64:\n\t\treturn Int64(v, buf), nil\n\tcase int:\n\t\treturn Int64(int64(v), buf), nil\n\tcase uint64:\n\t\treturn Uint64(v, buf), nil\n\tcase uint:\n\t\treturn Uint64(uint64(v), buf), nil\n\tcase time.Time:\n\t\treturn Time(v, buf)\n\tcase map[string]interface{}:\n\t\treturn Object(v, buf)\n\tcase []interface{}:\n\t\treturn Array(v, buf)\n\tcase JSONAppender:\n\t\treturn v.AppendJSON(buf)\n\tcase json.Marshaler:\n\t\tbb, err := v.MarshalJSON()\n\t\treturn append(buf, bb...), err\n\t}\n\tbb, err := json.Marshal(val)\n\treturn append(buf, bb...), err\n}", "func (e *TodoRegistered) GetEventType() string {\n\treturn e.EventType\n}", "func TypeSwitcher(event *replication.BinlogEvent) {\n\trebuild.EventHeaderRebuild(event)\n\tswitch event.Header.EventType {\n\tcase replication.GTID_EVENT:\n\t\trebuild.GTIDRebuild(event.Event.(*replication.GTIDEvent))\n\tcase replication.WRITE_ROWS_EVENTv0, replication.WRITE_ROWS_EVENTv1, replication.WRITE_ROWS_EVENTv2:\n\t\trebuild.InsertRebuild(event)\n\tcase replication.UPDATE_ROWS_EVENTv0, replication.UPDATE_ROWS_EVENTv1, replication.UPDATE_ROWS_EVENTv2:\n\t\trebuild.UpdateRebuild(event)\n\tcase replication.DELETE_ROWS_EVENTv0, replication.DELETE_ROWS_EVENTv1, replication.DELETE_ROWS_EVENTv2:\n\t\trebuild.DeleteRebuild(event)\n\tcase replication.QUERY_EVENT:\n\t\trebuild.QueryRebuild(event)\n\tcase replication.ROWS_QUERY_EVENT:\n\t\trebuild.RowsQueryRebuild(event)\n\tcase replication.XID_EVENT:\n\t\trebuild.XidRebuild(event)\n\tcase replication.ROTATE_EVENT:\n\t\tcommon.VerboseVerbose(\"-- [DEBUG] EventType: %s, NextLogName: %s\", event.Header.EventType.String(), string(event.Event.(*replication.RotateEvent).NextLogName))\n\t// case replication.ANONYMOUS_GTID_EVENT, replication.PREVIOUS_GTIDS_EVENT, replication.TABLE_MAP_EVENT:\n\tdefault:\n\t\tcommon.VerboseVerbose(\"-- [DEBUG] TypeSwitcher EventType: %s bypass\", event.Header.EventType.String())\n\t}\n\tsleepInterval(event)\n}", "func Reflect_Value(v interface{}) *vector_tile.Tile_Value {\n\tvar tv *vector_tile.Tile_Value\n\t//fmt.Print(v)\n\tvv := reflect.ValueOf(v)\n\tkd := vv.Kind()\n\tif (reflect.Float64 == kd) || (reflect.Float32 == kd) {\n\t\t//fmt.Print(v, \"float\", k)\n\t\ttv = Make_Tv_Float(float64(vv.Float()))\n\t\t//hash = Hash_Tv(tv)\n\t} else if (reflect.Int == kd) || (reflect.Int8 == kd) || (reflect.Int16 == kd) || (reflect.Int32 == kd) || (reflect.Int64 == kd) || (reflect.Uint8 == kd) || (reflect.Uint16 == kd) || (reflect.Uint32 == kd) || (reflect.Uint64 == kd) {\n\t\t//fmt.Print(v, \"int\", k)\n\t\ttv = Make_Tv_Int(int(vv.Int()))\n\t\t//hash = Hash_Tv(tv)\n\t} else if reflect.String == kd {\n\t\t//fmt.Print(v, \"str\", k)\n\t\ttv = Make_Tv_String(string(vv.String()))\n\t\t//hash = Hash_Tv(tv)\n\n\t} else {\n\t\ttv := new(vector_tile.Tile_Value)\n\t\tt := \"\"\n\t\ttv.StringValue = &t\n\t}\n\treturn tv\n}", "func (d *dbBase) collectFieldValue(mi *modelInfo, fi *fieldInfo, ind reflect.Value, insert bool, tz *time.Location) (interface{}, error) {\n\tvar value interface{}\n\tif fi.pk {\n\t\t_, value, _ = getExistPk(mi, ind)\n\t} else {\n\t\tfield := ind.FieldByIndex(fi.fieldIndex)\n\t\tif fi.isFielder {\n\t\t\tf := field.Addr().Interface().(Fielder)\n\t\t\tvalue = f.RawValue()\n\t\t} else {\n\t\t\tswitch fi.fieldType {\n\t\t\tcase TypeBooleanField:\n\t\t\t\tif nb, ok := field.Interface().(sql.NullBool); ok {\n\t\t\t\t\tvalue = nil\n\t\t\t\t\tif nb.Valid {\n\t\t\t\t\t\tvalue = nb.Bool\n\t\t\t\t\t}\n\t\t\t\t} else if field.Kind() == reflect.Ptr {\n\t\t\t\t\tif field.IsNil() {\n\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = field.Elem().Bool()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvalue = field.Bool()\n\t\t\t\t}\n\t\t\tcase TypeVarCharField, TypeCharField, TypeTextField, TypeJSONField, TypeJsonbField:\n\t\t\t\tif ns, ok := field.Interface().(sql.NullString); ok {\n\t\t\t\t\tvalue = nil\n\t\t\t\t\tif ns.Valid {\n\t\t\t\t\t\tvalue = ns.String\n\t\t\t\t\t}\n\t\t\t\t} else if field.Kind() == reflect.Ptr {\n\t\t\t\t\tif field.IsNil() {\n\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = field.Elem().String()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvalue = field.String()\n\t\t\t\t}\n\t\t\tcase TypeFloatField, TypeDecimalField:\n\t\t\t\tif nf, ok := field.Interface().(sql.NullFloat64); ok {\n\t\t\t\t\tvalue = nil\n\t\t\t\t\tif nf.Valid {\n\t\t\t\t\t\tvalue = nf.Float64\n\t\t\t\t\t}\n\t\t\t\t} else if field.Kind() == reflect.Ptr {\n\t\t\t\t\tif field.IsNil() {\n\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = field.Elem().Float()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvu := field.Interface()\n\t\t\t\t\tif _, ok := vu.(float32); ok {\n\t\t\t\t\t\tvalue, _ = StrTo(ToStr(vu)).Float64()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = field.Float()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase TypeTimeField, TypeDateField, TypeDateTimeField:\n\t\t\t\tvalue = field.Interface()\n\t\t\t\tif t, ok := value.(time.Time); ok {\n\t\t\t\t\td.ins.TimeToDB(&t, tz)\n\t\t\t\t\tif t.IsZero() {\n\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tswitch {\n\t\t\t\tcase fi.fieldType&IsPositiveIntegerField > 0:\n\t\t\t\t\tif field.Kind() == reflect.Ptr {\n\t\t\t\t\t\tif field.IsNil() {\n\t\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue = field.Elem().Uint()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = field.Uint()\n\t\t\t\t\t}\n\t\t\t\tcase fi.fieldType&IsIntegerField > 0:\n\t\t\t\t\tif ni, ok := field.Interface().(sql.NullInt64); ok {\n\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t\tif ni.Valid {\n\t\t\t\t\t\t\tvalue = ni.Int64\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if field.Kind() == reflect.Ptr {\n\t\t\t\t\t\tif field.IsNil() {\n\t\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue = field.Elem().Int()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = field.Int()\n\t\t\t\t\t}\n\t\t\t\tcase fi.fieldType&IsRelField > 0:\n\t\t\t\t\tif field.IsNil() {\n\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif _, vu, ok := getExistPk(fi.relModelInfo, reflect.Indirect(field)); ok {\n\t\t\t\t\t\t\tvalue = vu\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue = nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif !fi.null && value == nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"field `%s` cannot be NULL\", fi.fullName)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tswitch fi.fieldType {\n\t\tcase TypeTimeField, TypeDateField, TypeDateTimeField:\n\t\t\tif fi.autoNow || fi.autoNowAdd && insert {\n\t\t\t\tif insert {\n\t\t\t\t\tif t, ok := value.(time.Time); ok && !t.IsZero() {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttnow := time.Now()\n\t\t\t\td.ins.TimeToDB(&tnow, tz)\n\t\t\t\tvalue = tnow\n\t\t\t\tif fi.isFielder {\n\t\t\t\t\tf := field.Addr().Interface().(Fielder)\n\t\t\t\t\tf.SetRaw(tnow.In(DefaultTimeLoc))\n\t\t\t\t} else if field.Kind() == reflect.Ptr {\n\t\t\t\t\tv := tnow.In(DefaultTimeLoc)\n\t\t\t\t\tfield.Set(reflect.ValueOf(&v))\n\t\t\t\t} else {\n\t\t\t\t\tfield.Set(reflect.ValueOf(tnow.In(DefaultTimeLoc)))\n\t\t\t\t}\n\t\t\t}\n\t\tcase TypeJSONField, TypeJsonbField:\n\t\t\tif s, ok := value.(string); (ok && len(s) == 0) || value == nil {\n\t\t\t\tif fi.colDefault && fi.initial.Exist() {\n\t\t\t\t\tvalue = fi.initial.String()\n\t\t\t\t} else {\n\t\t\t\t\tvalue = nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn value, nil\n}" ]
[ "0.5817425", "0.5224016", "0.5199794", "0.5174661", "0.50340146", "0.49963158", "0.4947979", "0.48776007", "0.4869081", "0.48292866", "0.47609672", "0.47547865", "0.4714412", "0.46656308", "0.46602678", "0.4621549", "0.45972863", "0.45967934", "0.4589144", "0.4566101", "0.45597684", "0.45135134", "0.44960475", "0.44777465", "0.44630805", "0.4426621", "0.4426621", "0.4426621", "0.4426621", "0.4426621", "0.44175074", "0.441702", "0.44138616", "0.44082782", "0.44047803", "0.44035143", "0.44016346", "0.4394589", "0.43891132", "0.43764454", "0.43652204", "0.43652204", "0.43557435", "0.43552303", "0.43552303", "0.43552303", "0.43552303", "0.43545622", "0.4351818", "0.43477505", "0.43439662", "0.4338415", "0.43378082", "0.4324993", "0.4313553", "0.43097013", "0.43077096", "0.43076137", "0.430103", "0.4299862", "0.4295457", "0.4295093", "0.42925775", "0.42761755", "0.4266403", "0.42567927", "0.42437217", "0.4229707", "0.42249453", "0.4222405", "0.42037243", "0.4194834", "0.41867363", "0.41864386", "0.41793656", "0.41783923", "0.41767955", "0.4171245", "0.416989", "0.41616946", "0.4159501", "0.4159387", "0.4158279", "0.4152747", "0.41500023", "0.41488364", "0.4148442", "0.41461357", "0.41351762", "0.4133988", "0.41321462", "0.41233024", "0.4119956", "0.41143054", "0.41094273", "0.41028252", "0.4098146", "0.4095679", "0.40946296", "0.40935093" ]
0.7790924
0
NewListGroupsOK creates a ListGroupsOK with default headers values
NewListGroupsOK создает ListGroupsOK с значениями заголовков по умолчанию
func NewListGroupsOK() *ListGroupsOK { return &ListGroupsOK{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListGroupsDefault(code int) *ListGroupsDefault {\n\treturn &ListGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *DefaultIdentityProvider) ListGroups(ctx context.Context, options *metainternal.ListOptions) (*auth.GroupList, error) {\n\tkeyword := \"\"\n\tlimit := 50\n\tif options.FieldSelector != nil {\n\t\tkeyword, _ = options.FieldSelector.RequiresExactMatch(auth.KeywordQueryTag)\n\t\tlimitStr, _ := options.FieldSelector.RequiresExactMatch(auth.QueryLimitTag)\n\t\tif li, err := strconv.Atoi(limitStr); err == nil && li > 0 {\n\t\t\tlimit = li\n\t\t}\n\t}\n\n\t_, tenantID := authentication.GetUsernameAndTenantID(ctx)\n\tif tenantID != \"\" && tenantID != c.tenantID {\n\t\treturn nil, apierrors.NewBadRequest(\"must in the same tenant\")\n\t}\n\n\tallList, err := c.localGroupLister.List(labels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar localGroupList []*authv1.LocalGroup\n\tfor i, item := range allList {\n\t\tif item.Spec.TenantID == c.tenantID {\n\t\t\tlocalGroupList = append(localGroupList, allList[i])\n\t\t}\n\t}\n\n\tif keyword != \"\" {\n\t\tvar newList []*authv1.LocalGroup\n\t\tfor i, val := range localGroupList {\n\t\t\tif strings.Contains(val.Name, keyword) || strings.Contains(val.Spec.DisplayName, keyword) {\n\t\t\t\tnewList = append(newList, localGroupList[i])\n\t\t\t}\n\t\t}\n\t\tlocalGroupList = newList\n\t}\n\n\titems := localGroupList[0:min(len(localGroupList), limit)]\n\n\tgroupList := auth.GroupList{}\n\tfor _, item := range items {\n\t\tgroup := convertToGroup(item)\n\t\tgroupList.Items = append(groupList.Items, group)\n\t}\n\n\treturn &groupList, nil\n}", "func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) {\n\trequest = &ListServerGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Alb\", \"2020-06-16\", \"ListServerGroups\", \"alb\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "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}", "func NewListServerGroupOK() *ListServerGroupOK {\n\treturn &ListServerGroupOK{}\n}", "func List(c messagebird.Client, options *messagebird.PaginationRequest) (*Groups, error) {\n\tgroupList := &Groups{}\n\tif err := c.Request(groupList, http.MethodGet, path+\"?\"+options.QueryParams(), nil); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groupList, nil\n}", "func NewListGroupsBadRequest() *ListGroupsBadRequest {\n\treturn &ListGroupsBadRequest{}\n}", "func (c *GroupController) List(ctx *app.ListGroupContext) error {\n\t// GroupController_List: start_implement\n\n\tdataStore := &dal.DataStore{}\n\tdataStore.GetSession()\n\t// Close the session\n\tdefer dataStore.Close()\n\tdc := dal.NewDalGroup(dataStore)\n\n\tgroups, err := dc.FetchAll()\n\n\tif err != nil {\n\t\tctx.ResponseData.Service.LogError(\"InternalServerError\", \"req_id\", middleware.ContextRequestID(ctx), \"ctrl\", \"Group\", \"action\", \"List\", ctx.RequestData.Request.Method, ctx.RequestData.Request.URL, \"databaseError\", err.Error())\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tres := make(app.GwentapiGroupCollection, len(*groups))\n\n\tlastModified := time.Time{}\n\tfor i, group := range *groups {\n\t\tg, _ := factory.CreateGroup(&group)\n\n\t\tif lastModified.Before(group.Last_Modified) {\n\t\t\tlastModified = group.Last_Modified\n\t\t}\n\n\t\tres[i] = g\n\t}\n\n\t// GroupController_List: end_implement\n\thelpers.LastModified(ctx.ResponseData, lastModified)\n\tif ctx.IfModifiedSince != nil {\n\t\tif !helpers.IsModified(*ctx.IfModifiedSince, lastModified) {\n\t\t\treturn ctx.NotModified()\n\t\t}\n\t}\n\treturn ctx.OK(res)\n}", "func NewGroups(filename string, bad BadLineHandler) (*HTGroup, error) {\n\thtGroup := HTGroup{\n\t\tfilePath: filename,\n\t}\n\treturn &htGroup, htGroup.ReloadGroups(bad)\n}", "func NewListNSGroupsParams() *ListNSGroupsParams {\n\tvar (\n\t\tpageSizeDefault = int64(1000)\n\t\tpopulateReferencesDefault = bool(false)\n\t)\n\treturn &ListNSGroupsParams{\n\t\tPageSize: &pageSizeDefault,\n\t\tPopulateReferences: &populateReferencesDefault,\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "func (capi ClientAPI) Groups(conf map[string]string) error {\n\n\turl := fmt.Sprintf(\"http://%s:%s/v1/groups\", conf[\"host\"], conf[\"port\"])\n\n\t// Build the request\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Send the request via a client\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Defer the closing of the body\n\tdefer resp.Body.Close()\n\t// Read the content into a byte array\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Marshal API data into map\n\tvar groupmap map[string]string\n\terr = json.Unmarshal(body, &groupmap)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tw := new(tabwriter.Writer)\n\n\t// Format in tab-separated columns with a tab stop of 8.\n\tw.Init(os.Stdout, 0, 8, 0, '\\t', 0)\n\tfmt.Fprintln(w, \"UUID\\tGROUP NAME\")\n\n\tfor agentUUID, groupName := range groupmap {\n\t\tfmt.Fprintf(\n\t\t\tw,\n\t\t\t\"%s\\t%s\\n\",\n\t\t\thostresources.TruncateID(agentUUID),\n\t\t\tgroupName,\n\t\t)\n\t}\n\tfmt.Fprintln(w)\n\tw.Flush()\n\n\treturn nil\n\n}", "func getGroups(w http.ResponseWriter, r *http.Request) {\n InitResponse(&w)\n if r.Method == \"OPTIONS\" {return}\n\n allow, _ := HasPermission(&w, r, CoreGroupModuleID, CoreAccessRead)\n if !allow {\n w.WriteHeader(http.StatusUnauthorized)\n json.NewEncoder(w).Encode(&CoreMessage{\n Message: \"Not authorized!\",\n })\n return\n }\n\n groups := []CoreGroup{}\n\n err := Db.Model(&groups).Select()\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n return\n }\n\n w.WriteHeader(http.StatusOK)\n json.NewEncoder(w).Encode(groups)\n}", "func NewUserGroupListOK() *UserGroupListOK {\n\treturn &UserGroupListOK{}\n}", "func NewListNSGroupsParamsWithHTTPClient(client *http.Client) *ListNSGroupsParams {\n\tvar (\n\t\tpageSizeDefault = int64(1000)\n\t\tpopulateReferencesDefault = bool(false)\n\t)\n\treturn &ListNSGroupsParams{\n\t\tPageSize: &pageSizeDefault,\n\t\tPopulateReferences: &populateReferencesDefault,\n\t\tHTTPClient: client,\n\t}\n}", "func (s *GroupsService) List(opt ...CallOption) ([]*Group, *Response, error) {\n\tgroups, resp, err := listGroup(s.client, \"groups\", opt...)\n\n\treturn groups, resp, err\n}", "func NewListGroupsNotFound() *ListGroupsNotFound {\n\treturn &ListGroupsNotFound{}\n}", "func (s *GroupsService) List(ctx context.Context, opts *PagingOptions) (*GroupList, error) {\n\tquery := addPaging(url.Values{}, opts)\n\treq, err := s.Client.NewRequest(ctx, http.MethodGet, newURI(groupsURI), WithQuery(query))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\tres, resp, err := s.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\n\tif resp != nil && resp.StatusCode == http.StatusNotFound {\n\t\treturn nil, ErrNotFound\n\t}\n\n\tg := &GroupList{\n\t\tGroups: []*Group{},\n\t}\n\tif err := json.Unmarshal(res, g); err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed, unable to unmarshal repository list json: , %w\", err)\n\t}\n\n\tfor _, r := range g.GetGroups() {\n\t\tr.Session.set(resp)\n\t}\n\n\treturn g, nil\n}", "func CreateListServerGroupsResponse() (response *ListServerGroupsResponse) {\n\tresponse = &ListServerGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func NewGetHostGroupsDefault(code int) *GetHostGroupsDefault {\n\treturn &GetHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *tiKVGroups) List(opts v1.ListOptions) (result *v1alpha1.TiKVGroupList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1alpha1.TiKVGroupList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"tikvgroups\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListGroupsResponse\")\n\t}\n\treturn\n}", "func CreateListExperimentGroupsRequest() (request *ListExperimentGroupsRequest) {\n\trequest = &ListExperimentGroupsRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"PaiRecService\", \"2022-12-13\", \"ListExperimentGroups\", \"/api/v1/experimentgroups\", \"\", \"\")\n\trequest.Method = requests.GET\n\treturn\n}", "func newRouteGroups(c *ZalandoV1Client, namespace string) *routeGroups {\n\treturn &routeGroups{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "func NewGetGroupOK() *GetGroupOK {\n\treturn &GetGroupOK{}\n}", "func CreateGroup(params types.ContextParams, clientSet apimachinery.ClientSetInterface, groupItems []metadata.Group) []Group {\n\tresults := make([]Group, 0)\n\tfor _, grp := range groupItems {\n\n\t\tresults = append(results, &group{\n\t\t\tgrp: grp,\n\t\t\tparams: params,\n\t\t\tclientSet: clientSet,\n\t\t})\n\t}\n\n\treturn results\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func (client *ContainerGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerGroupsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewGetHostGroupsOK() *GetHostGroupsOK {\n\treturn &GetHostGroupsOK{}\n}", "func (m *GraphBaseServiceClient) Groups()(*ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.GroupsRequestBuilder) {\n return ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func (m *GraphBaseServiceClient) Groups()(*ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.GroupsRequestBuilder) {\n return ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func NewPostVolumeGroupsListDefault(code int) *PostVolumeGroupsListDefault {\n\treturn &PostVolumeGroupsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *MockResourceGroupsClient) List(ctx context.Context, filter string) ([]resources.Group, error) {\n\tif filter != \"\" {\n\t\treturn nil, fmt.Errorf(\"unsupported non-empty filter: %s\", filter)\n\t}\n\tvar l []resources.Group\n\tfor _, rg := range c.RGs {\n\t\tl = append(l, rg)\n\t}\n\treturn l, nil\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewGroup(dataframe *DataFrame, columns ...string) *Groups {\n\t// ret := &Groups{Columns: []string{}, Grouper: columns, Group: make(map[types.C][]indices.Index), Df: dataframe}\n\tret := &Groups{Keys: []Keys{}, Columns: []string{}, Grouper: columns, Group: make(map[types.C][]indices.Index), Df: dataframe}\n\n\treturn ret\n}", "func (l *GroupLookup) newKeyGroup(entries []groupKeyListElement) *groupKeyList {\n\tid := l.nextID\n\tl.nextID++\n\treturn &groupKeyList{\n\t\tid: id,\n\t\telements: entries,\n\t}\n}", "func ListUserGroup(w http.ResponseWriter, r *http.Request) {\n\tfLog := userMgmtLogger.WithField(\"func\", \"ListUserGroup\").WithField(\"RequestID\", r.Context().Value(constants.RequestID)).WithField(\"path\", r.URL.Path).WithField(\"method\", r.Method)\n\n\tiauthctx := r.Context().Value(constants.HansipAuthentication)\n\tif iauthctx == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusUnauthorized, \"You are not authorized to access this resource\", nil, nil)\n\t\treturn\n\t}\n\n\tparams, err := helper.ParsePathParams(fmt.Sprintf(\"%s/management/user/{userRecId}/groups\", apiPrefix), r.URL.Path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuser, err := UserRepo.GetUserByRecID(r.Context(), params[\"userRecId\"])\n\tif err != nil {\n\t\tfLog.Errorf(\"UserRepo.GetUserByRecID got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tif user == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusNotFound, fmt.Sprintf(\"User recid %s not found\", params[\"userRecId\"]), nil, nil)\n\t\treturn\n\t}\n\n\tpageRequest, err := helper.NewPageRequestFromRequest(r)\n\tif err != nil {\n\t\tfLog.Errorf(\"helper.NewPageRequestFromRequest got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusBadRequest, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tgroups, page, err := UserGroupRepo.ListUserGroupByUser(r.Context(), user, pageRequest)\n\tif err != nil {\n\t\tfLog.Errorf(\"UserGroupRepo.ListUserGroupByUser got %s\", err.Error())\n\t}\n\tsgroups := make([]*SimpleGroup, len(groups))\n\tfor k, v := range groups {\n\t\tsgroups[k] = &SimpleGroup{\n\t\t\tRecID: v.RecID,\n\t\t\tGroupName: v.GroupName,\n\t\t}\n\t}\n\tret := make(map[string]interface{})\n\tret[\"groups\"] = sgroups\n\tret[\"page\"] = page\n\thelper.WriteHTTPResponse(r.Context(), w, http.StatusOK, \"List of groups paginated\", nil, ret)\n}", "func (client *Client) ListResourceGroupsWithOptions(request *ListResourceGroupsRequest, runtime *util.RuntimeOptions) (_result *ListResourceGroupsResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\tquery := map[string]interface{}{}\n\tif !tea.BoolValue(util.IsUnset(request.DisplayName)) {\n\t\tquery[\"DisplayName\"] = request.DisplayName\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.IncludeTags)) {\n\t\tquery[\"IncludeTags\"] = request.IncludeTags\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Name)) {\n\t\tquery[\"Name\"] = request.Name\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageNumber)) {\n\t\tquery[\"PageNumber\"] = request.PageNumber\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageSize)) {\n\t\tquery[\"PageSize\"] = request.PageSize\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupId)) {\n\t\tquery[\"ResourceGroupId\"] = request.ResourceGroupId\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupIds)) {\n\t\tquery[\"ResourceGroupIds\"] = request.ResourceGroupIds\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Status)) {\n\t\tquery[\"Status\"] = request.Status\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Tag)) {\n\t\tquery[\"Tag\"] = request.Tag\n\t}\n\n\treq := &openapi.OpenApiRequest{\n\t\tQuery: openapiutil.Query(query),\n\t}\n\tparams := &openapi.Params{\n\t\tAction: tea.String(\"ListResourceGroups\"),\n\t\tVersion: tea.String(\"2020-03-31\"),\n\t\tProtocol: tea.String(\"HTTPS\"),\n\t\tPathname: tea.String(\"/\"),\n\t\tMethod: tea.String(\"POST\"),\n\t\tAuthType: tea.String(\"AK\"),\n\t\tStyle: tea.String(\"RPC\"),\n\t\tReqBodyType: tea.String(\"formData\"),\n\t\tBodyType: tea.String(\"json\"),\n\t}\n\t_result = &ListResourceGroupsResponse{}\n\t_body, _err := client.CallApi(params, req, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "func NewGetAllGroupsOK() *GetAllGroupsOK {\n\n\treturn &GetAllGroupsOK{}\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/compute/azure/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (client IdentityClient) listGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/groups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func (db *MySQLDB) ListGroups(ctx context.Context, tenant *Tenant, request *helper.PageRequest) ([]*Group, *helper.Page, error) {\n\tfLog := mysqlLog.WithField(\"func\", \"ListGroups\").WithField(\"RequestID\", ctx.Value(constants.RequestID))\n\tq := \"SELECT COUNT(*) AS CNT FROM HANSIP_GROUP\"\n\tret := make([]*Group, 0)\n\trow := db.instance.QueryRowContext(ctx, q)\n\tcount := 0\n\terr := row.Scan(&count)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn ret, helper.NewPage(request, uint(count)), nil\n\t\t}\n\t\tfLog.Errorf(\"row.Scan got %s\", err.Error())\n\t\treturn nil, nil, &ErrDBScanError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tpage := helper.NewPage(request, uint(count))\n\tq = fmt.Sprintf(\"SELECT REC_ID, GROUP_NAME, GROUP_DOMAIN, DESCRIPTION FROM HANSIP_GROUP WHERE GROUP_DOMAIN=? ORDER BY GROUP_NAME %s LIMIT %d, %d\", request.Sort, page.OffsetStart, page.OffsetEnd-page.OffsetStart)\n\trows, err := db.instance.QueryContext(ctx, q, tenant.Domain)\n\tif err != nil {\n\t\tfLog.Errorf(\"db.instance.QueryContext got %s. SQL = %s\", err.Error(), q)\n\t\treturn nil, nil, &ErrDBQueryError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tr := &Group{}\n\t\terr := rows.Scan(&r.RecID, &r.GroupName, &r.GroupDomain, &r.Description)\n\t\tif err != nil {\n\t\t\tfLog.Warnf(\"row.Scan got %s\", err.Error())\n\t\t\treturn nil, nil, &ErrDBScanError{\n\t\t\t\tWrapped: err,\n\t\t\t\tMessage: \"Error ListGroups\",\n\t\t\t\tSQL: q,\n\t\t\t}\n\t\t} else {\n\t\t\tret = append(ret, r)\n\t\t}\n\t}\n\treturn ret, page, nil\n}", "func (m *StoreItemRequestBuilder) Groups()(*i943058511484df328af302c39ee5cb2c343138e90a60de21e94bad79f3a4f322.GroupsRequestBuilder) {\n return i943058511484df328af302c39ee5cb2c343138e90a60de21e94bad79f3a4f322.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func CreateListExperimentGroupsResponse() (response *ListExperimentGroupsResponse) {\n\tresponse = &ListExperimentGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func NewGroup()(*Group) {\n m := &Group{\n DirectoryObject: *NewDirectoryObject(),\n }\n odataTypeValue := \"#microsoft.graph.group\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "func NewPostVolumeGroupsListOK() *PostVolumeGroupsListOK {\n\treturn &PostVolumeGroupsListOK{}\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/azure/compute/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func NewListNSGroupsParamsWithTimeout(timeout time.Duration) *ListNSGroupsParams {\n\tvar (\n\t\tpageSizeDefault = int64(1000)\n\t\tpopulateReferencesDefault = bool(false)\n\t)\n\treturn &ListNSGroupsParams{\n\t\tPageSize: &pageSizeDefault,\n\t\tPopulateReferences: &populateReferencesDefault,\n\n\t\ttimeout: timeout,\n\t}\n}", "func NewDescribeGroupsResponse(payload []byte) (*DescribeGroupsResponse, error) {\n\tvar (\n\t\terr error = nil\n\t\tl int\n\t\toffset int = 0\n\t)\n\tr := &DescribeGroupsResponse{}\n\tresponseLength := int(binary.BigEndian.Uint32(payload))\n\tif responseLength+4 != len(payload) {\n\t\treturn nil, fmt.Errorf(\"describeGroups reseponse length did not match: %d!=%d\", responseLength+4, len(payload))\n\t}\n\toffset += 4\n\n\tr.CorrelationID = uint32(binary.BigEndian.Uint32(payload[offset:]))\n\toffset += 4\n\n\tgroupCount := uint32(binary.BigEndian.Uint32(payload[offset:]))\n\toffset += 4\n\n\tr.Groups = make([]*GroupDetail, groupCount)\n\n\tfor i := range r.Groups {\n\t\tgroup := &GroupDetail{}\n\n\t\tgroup.ErrorCode = int16(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\n\t\tif err == nil && group.ErrorCode != 0 {\n\t\t\terr = getErrorFromErrorCode(group.ErrorCode)\n\t\t}\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.GroupID = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.State = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.ProtocolType = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.Protocol = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tmemberCount := int(binary.BigEndian.Uint32(payload[offset:]))\n\t\toffset += 4\n\n\t\tgroup.Members = make([]*MemberDetail, memberCount)\n\n\t\tfor i := range group.Members {\n\t\t\tgroup.Members[i] = &MemberDetail{}\n\n\t\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\t\toffset += 2\n\t\t\tgroup.Members[i].MemberID = string(payload[offset : offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\t\toffset += 2\n\t\t\tgroup.Members[i].ClientID = string(payload[offset : offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\t\toffset += 2\n\t\t\tgroup.Members[i].ClientHost = string(payload[offset : offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint32(payload[offset:]))\n\t\t\toffset += 4\n\t\t\tcopy(group.Members[i].MemberMetadata, payload[offset:offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint32(payload[offset:]))\n\t\t\toffset += 4\n\t\t\tgroup.Members[i].MemberAssignment = make([]byte, l)\n\t\t\tcopy(group.Members[i].MemberAssignment, payload[offset:offset+l])\n\t\t\toffset += l\n\t\t}\n\n\t\tr.Groups[i] = group\n\t}\n\n\treturn r, err\n}", "func DefaultGroups(clusterName, addonName string) []string {\n\treturn []string{\n\t\tfmt.Sprintf(\"system:open-cluster-management:cluster:%s:addon:%s\", clusterName, addonName),\n\t\tfmt.Sprintf(\"system:open-cluster-management:addon:%s\", addonName),\n\t\t\"system:authenticated\",\n\t}\n}", "func NewUpdateHostGroupsDefault(code int) *UpdateHostGroupsDefault {\n\treturn &UpdateHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func listGroups(cmd *cobra.Command, args []string) error {\n\tclient, err := getClient()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn nil\n\t}\n\tdefer client.Close()\n\n\tvar matchingGroups map[string]bool\n\tif len(args) != 0 {\n\t\t// Mark all groups mentioned on the command line\n\t\tmatchingGroups = make(map[string]bool, len(args))\n\t\tfor _, g := range args {\n\t\t\tmatchingGroups[g] = true\n\t\t}\n\t}\n\t// Get list of all groups and their roles\n\t_, roleGroups, err := getRoles(cmd, nil, true, client)\n\tif err != nil {\n\t\tfmt.Println(toAPIError(err))\n\t\treturn nil\n\t}\n\n\tgroupMap := make(groupMap)\n\tfor roleName, groups := range roleGroups {\n\t\tfor _, group := range groups {\n\t\t\tif matchingGroups != nil && !matchingGroups[group] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgroupMap[group] = append(groupMap[group], roleName)\n\t\t}\n\t}\n\n\t// Get sorted list of groups\n\tgroups := make([]string, 0, len(groupMap))\n\tfor group := range groupMap {\n\t\tgroups = append(groups, group)\n\t}\n\tsort.Strings(groups)\n\n\t// Display all groups\n\tverbose := viper.GetBool(verboseOpt)\n\tfor _, group := range groups {\n\t\tif verbose {\n\t\t\tfmt.Println(group, \"=\", strings.Join(groupMap[group], \", \"))\n\t\t} else {\n\t\t\tfmt.Println(group)\n\t\t}\n\t}\n\n\treturn nil\n}", "func (m *TermStoreRequestBuilder) Groups()(*i94e3df8b0a254a0fef7a65f7cbfe92598b1244a4aa6d133096ee43e26c51ba83.GroupsRequestBuilder) {\n return i94e3df8b0a254a0fef7a65f7cbfe92598b1244a4aa6d133096ee43e26c51ba83.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client WorkloadNetworksClient) ListVMGroupsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"privateCloudName\": autorest.Encode(\"path\", privateCloudName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2020-07-17-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "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}", "func newGroup() *Group {\n\tg := new(Group)\n\tg.handlers = make([]HandlerFunc, 0)\n\treturn g\n}", "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}", "func NewGroups(r io.Reader) (groups Groups) {\n\tactive := &Group{}\n\t// Ignore possible UTF-8 byte order mark at the beginning of the\n\t// robots.txt file, just like Google does.\n\tbuffer := bufio.NewReader(r)\n\tif data, err := buffer.Peek(3); err == nil && string(data) == \"\\xef\\xbb\\xbf\" {\n\t\tbuffer.Read(data)\n\t}\n\tscanner := bufio.NewScanner(buffer)\n\tfor scanner.Scan() {\n\t\tfield, value, ignore := splitRecord(scanner.Text())\n\t\tif ignore {\n\t\t\tcontinue\n\t\t}\n\t\tswitch field {\n\t\tcase \"allow\":\n\t\t\tactive.Allow = append(active.Allow, value)\n\t\tcase \"disallow\":\n\t\t\tactive.Disallow = append(active.Disallow, value)\n\t\tcase \"crawl-delay\", \"crawldelay\":\n\t\t\tactive.CrawlDelay = value\n\t\tcase \"user-agent\", \"useragent\":\n\t\t\t// If the active group has group members, the current user-agent\n\t\t\t// record marks the start of a new group.\n\t\t\tif active.HasMembers() {\n\t\t\t\t// Only add this group if it was started with one or more\n\t\t\t\t// user-agent records.\n\t\t\t\tif active.HasUserAgents() {\n\t\t\t\t\tgroups = append(groups, active)\n\t\t\t\t}\n\t\t\t\tactive = &Group{}\n\t\t\t}\n\t\t\t// Wildcards at the end of a user-agent are superfluous since\n\t\t\t// we perform prefix matches.\n\t\t\t// The user-agent is case-insensitive.\n\t\t\tif value != \"*\" {\n\t\t\t\tvalue = strings.TrimRight(value, \"*\")\n\t\t\t\tvalue = strings.ToLower(value)\n\t\t\t}\n\t\t\tactive.UserAgents = append(active.UserAgents, value)\n\t\t}\n\t}\n\tif active.HasMembers() && active.HasUserAgents() {\n\t\tgroups = append(groups, active)\n\t}\n\treturn groups\n}", "func (a *Client) UserGroupsList(params *UserGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*UserGroupsListOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewUserGroupsListParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"user_groups_list\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/v3/customer/core/user_groups/\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &UserGroupsListReader{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.(*UserGroupsListOK)\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 user_groups_list: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (ggSession *GreengrassSession) ListGroup(name string) error {\n\tvar id string\n\n\tif name != \"\" {\n\t\tlistOutput, err := ggSession.greengrass.ListGroups(&greengrass.ListGroupsInput{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, v := range listOutput.Groups {\n\t\t\tif name == *v.Name {\n\t\t\t\tid = *v.Id\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"group %s not found\", name)\n\t\t}\n\t} else {\n\t\tid = ggSession.config.Group.ID\n\t}\n\n\tgroup, err := ggSession.greengrass.GetGroup(&greengrass.GetGroupInput{\n\t\tGroupId: &id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group: %v\\n\", group)\n\n\tif group.LatestVersion == nil {\n\t\treturn nil\n\t}\n\n\tgroupVersion, err := ggSession.greengrass.GetGroupVersion(&greengrass.GetGroupVersionInput{\n\t\tGroupId: group.Id,\n\t\tGroupVersionId: group.LatestVersion,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group version: %v\\n\", groupVersion)\n\n\treturn nil\n}", "func (s *GroupsService) ListGroups(opt *ListGroupsOptions, options ...RequestOptionFunc) ([]*Group, *Response, error) {\n\treq, err := s.client.NewRequest(http.MethodGet, \"groups\", opt, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gs []*Group\n\tresp, err := s.client.Do(req, &gs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gs, resp, nil\n}", "func (c *Client) Groups() (*GroupsResponse, error) {\n\tform := url.Values{}\n\tform.Add(\"format\", \"cli\")\n\n\turl := fmt.Sprintf(\"%s/account/get_groups\", c.BaseURL)\n\treq, err := http.NewRequest(\"POST\", url, strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Add(\"Content-Type\", defaultContentTypeHeader)\n\treq.Header.Add(\"Accept\", defaultAcceptHeader)\n\n\tresp, err := c.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tif e := resp.Body.Close(); e != nil {\n\t\t\t// TODO: log event\n\t\t}\n\t}()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar v GroupsResponse\n\terr = xml.Unmarshal(body, &v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(v.ErrorMessages) > 0 {\n\t\treturn &v, errors.New(\"error listing groups\")\n\t}\n\n\treturn &v, nil\n}", "func NewGetConsistencyGroupsOK() *GetConsistencyGroupsOK {\n\treturn &GetConsistencyGroupsOK{}\n}", "func (s *EmptyStore) GroupList() (groups []*storagepb.Group, err error) {\n\treturn groups, nil\n}", "func (s *IndicesStatsService) Groups(groups ...string) *IndicesStatsService {\n\ts.groups = append(s.groups, groups...)\n\treturn s\n}", "func (o *ListNSGroupsParams) WithHTTPClient(client *http.Client) *ListNSGroupsParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "func (r *ProjectsGroupsService) List(name string) *ProjectsGroupsListCall {\n\tc := &ProjectsGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.name = name\n\treturn c\n}", "func (a *GroupsOnenoteNotebooksSectionGroupApiService) GroupsOnenoteNotebooksSectionGroupsListSectionGroups(ctx _context.Context, groupId string, notebookId string, sectionGroupId string, localVarOptionals *GroupsOnenoteNotebooksSectionGroupsListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/notebooks({notebook-id})/sectionGroups({sectionGroup-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"notebook-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", notebookId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func (gr *GroupResource) List(owner string) (g []*GroupDetails, err error) {\n\townerOrCurrentUser(gr, &owner)\n\n\tpath := fmt.Sprintf(\"/groups/%s/\", owner)\n\terr = gr.client.do(\"GET\", path, nil, nil, &g)\n\treturn g, nil\n}", "func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CassandraClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-03-15-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (o *ListNSGroupsParams) WithPageSize(pageSize *int64) *ListNSGroupsParams {\n\to.SetPageSize(pageSize)\n\treturn o\n}", "func handleGetGroups(c *Context, w http.ResponseWriter, r *http.Request) {\n\tpaging, err := parsePaging(r.URL)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse paging parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\twithInstallationCount, err := parseBool(r.URL, model.ShowInstallationCountQueryParameter, false)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse request parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tfilter := &model.GroupFilter{\n\t\tPaging: paging,\n\t\tWithInstallationCount: withInstallationCount,\n\t}\n\n\tgroups, err := c.Store.GetGroupDTOs(filter)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to query groups\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif groups == nil {\n\t\tgroups = []*model.GroupDTO{}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\toutputJSON(c, w, groups)\n}", "func TestListIamGroups(t *testing.T) {\n\tt.Parallel()\n\n\tregion, err := getRandomRegion()\n\trequire.NoError(t, err)\n\n\tlocalSession, err := session.NewSession(&awsgo.Config{\n\t\tRegion: awsgo.String(region),\n\t})\n\trequire.NoError(t, err)\n\n\tgroupNames, err := getAllIamGroups(localSession, time.Now(), config.Config{})\n\trequire.NoError(t, err)\n\tassert.NotEmpty(t, groupNames)\n}", "func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *MetricAlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MetricAlertsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (*ListGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{58}\n}", "func (o *ListNSGroupsParams) WithCursor(cursor *string) *ListNSGroupsParams {\n\to.SetCursor(cursor)\n\treturn o\n}", "func NewDeleteAuthGroupsDefault(code int) *DeleteAuthGroupsDefault {\n\treturn &DeleteAuthGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *tiDBGroups) List(opts v1.ListOptions) (result *v1alpha1.TiDBGroupList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1alpha1.TiDBGroupList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"tidbgroups\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "func NewListLabelGroupsPaginator(client ListLabelGroupsAPIClient, params *ListLabelGroupsInput, optFns ...func(*ListLabelGroupsPaginatorOptions)) *ListLabelGroupsPaginator {\n\tif params == nil {\n\t\tparams = &ListLabelGroupsInput{}\n\t}\n\n\toptions := ListLabelGroupsPaginatorOptions{}\n\tif params.MaxResults != nil {\n\t\toptions.Limit = *params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &ListLabelGroupsPaginator{\n\t\toptions: options,\n\t\tclient: client,\n\t\tparams: params,\n\t\tfirstPage: true,\n\t\tnextToken: params.NextToken,\n\t}\n}", "func (a *HyperflexApiService) GetHyperflexInitiatorGroupList(ctx context.Context) ApiGetHyperflexInitiatorGroupListRequest {\n\treturn ApiGetHyperflexInitiatorGroupListRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "func NewDeleteCIDGroupsDefault(code int) *DeleteCIDGroupsDefault {\n\treturn &DeleteCIDGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "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}", "func (o *ListNSGroupsParams) WithContext(ctx context.Context) *ListNSGroupsParams {\n\to.SetContext(ctx)\n\treturn o\n}", "func (as *AdminServer) Groups(w http.ResponseWriter, r *http.Request) {\n\tparams := newTemplateParams(r)\n\tparams.Title = \"Users & Groups\"\n\tgetTemplate(w, \"groups\").ExecuteTemplate(w, \"base\", params)\n}", "func (_e *MockQueryCoord_Expecter) ListResourceGroups(ctx interface{}, req interface{}) *MockQueryCoord_ListResourceGroups_Call {\n\treturn &MockQueryCoord_ListResourceGroups_Call{Call: _e.mock.On(\"ListResourceGroups\", ctx, req)}\n}", "func (s *GroupsService) Create(\n\tctx context.Context,\n\tgroupName string,\n) error {\n\traw, err := json.Marshal(struct {\n\t\tGroupName string `json:\"group_name\"`\n\t}{\n\t\tgroupName,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq, err := http.NewRequest(\n\t\thttp.MethodPost,\n\t\ts.client.url+\"2.0/groups/create\",\n\t\tbytes.NewBuffer(raw),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq = req.WithContext(ctx)\n\tres, err := s.client.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res.StatusCode >= 300 || res.StatusCode <= 199 {\n\t\treturn fmt.Errorf(\n\t\t\t\"Failed to returns 2XX response: %d\", res.StatusCode)\n\t}\n\n\treturn nil\n}", "func newTiKVGroups(c *PingcapV1alpha1Client, namespace string) *tiKVGroups {\n\treturn &tiKVGroups{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "func (a *API) ListGroups(fields []string) ([]*Group, error) {\n\tvar resp listGroupsResponse\n\terr := a.Call(\"list_groups\", &listGroupsRequest{\n\t\tFields: fields,\n\t}, &resp)\n\n\treturn resp, err\n}", "func (e *EmailGroupService) List(opts *ListOptions) ([]EmailGroup, *Response, error) {\n\tendpoint := \"/assets/email/groups\"\n\temailGroups := new([]EmailGroup)\n\tresp, err := e.client.getRequestListDecode(endpoint, emailGroups, opts)\n\treturn *emailGroups, resp, err\n}", "func (m *MockPlacementGroupClient) List(arg0 context.Context, arg1 hcloud.PlacementGroupListOpts) ([]*hcloud.PlacementGroup, *hcloud.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0, arg1)\n\tret0, _ := ret[0].([]*hcloud.PlacementGroup)\n\tret1, _ := ret[1].(*hcloud.Response)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "func NewGetUniverseGroupsOK() *GetUniverseGroupsOK {\n\treturn &GetUniverseGroupsOK{}\n}", "func (s *GroupsService) Groups(\n\tctx context.Context,\n) ([]string, error) {\n\treq, err := http.NewRequest(\n\t\thttp.MethodGet,\n\t\ts.client.url+\"2.0/groups/list\",\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\treq = req.WithContext(ctx)\n\tres, err := s.client.client.Do(req)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tif res.StatusCode >= 300 || res.StatusCode <= 199 {\n\t\treturn []string{}, fmt.Errorf(\n\t\t\t\"Failed to returns 2XX response: %d\", res.StatusCode)\n\t}\n\tdefer res.Body.Close()\n\tdecoder := json.NewDecoder(res.Body)\n\n\tgroupRes := struct {\n\t\tGroupNames []string `json:\"group_names\"`\n\t}{[]string{}}\n\terr = decoder.Decode(&groupRes)\n\n\treturn groupRes.GroupNames, err\n}", "func NewListGroupsForbidden() *ListGroupsForbidden {\n\treturn &ListGroupsForbidden{}\n}", "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}", "func (m *MockIApi) ListPlanGroups(arg0 *chartmogul.Cursor) (*chartmogul.PlanGroups, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListPlanGroups\", arg0)\n\tret0, _ := ret[0].(*chartmogul.PlanGroups)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "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}", "func (b *ClusterBuilder) Groups(value *GroupListBuilder) *ClusterBuilder {\n\tb.groups = value\n\tb.bitmap_ |= 2097152\n\treturn b\n}", "func newTiDBGroups(c *PingcapV1alpha1Client, namespace string) *tiDBGroups {\n\treturn &tiDBGroups{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}" ]
[ "0.6938777", "0.61539084", "0.61058784", "0.60837674", "0.6075854", "0.60570604", "0.60215706", "0.6012626", "0.60092974", "0.6003559", "0.599757", "0.59502655", "0.5944972", "0.5928773", "0.59200424", "0.5902793", "0.5882899", "0.5873967", "0.58671695", "0.5861143", "0.5815343", "0.57954234", "0.5779507", "0.57644975", "0.5719911", "0.57077056", "0.5692869", "0.56915647", "0.5681621", "0.5681621", "0.5680397", "0.5666043", "0.5665627", "0.56611323", "0.56558365", "0.5645362", "0.56410277", "0.5634732", "0.56281126", "0.56254566", "0.5619175", "0.5617065", "0.56102276", "0.5605871", "0.5592745", "0.5584613", "0.554939", "0.5547233", "0.5532629", "0.5513568", "0.5513167", "0.55072117", "0.5470641", "0.5444912", "0.5443283", "0.5442455", "0.54349005", "0.5432107", "0.5424112", "0.54114324", "0.54105866", "0.5409899", "0.5399193", "0.5390122", "0.53883475", "0.5361808", "0.53551304", "0.53551286", "0.5350901", "0.53476834", "0.53449476", "0.53361505", "0.5329527", "0.532591", "0.531846", "0.5316216", "0.5315432", "0.5291199", "0.528247", "0.5280846", "0.5280166", "0.527922", "0.5278465", "0.5268573", "0.5265381", "0.52621275", "0.5254668", "0.5243807", "0.52431405", "0.523118", "0.52308714", "0.52291065", "0.5220719", "0.5210813", "0.52089", "0.52056307", "0.51969874", "0.51819354", "0.5178992", "0.5177531" ]
0.7069612
0
NewListGroupsBadRequest creates a ListGroupsBadRequest with default headers values
NewListGroupsBadRequest создает ListGroupsBadRequest с значениями заголовков по умолчанию
func NewListGroupsBadRequest() *ListGroupsBadRequest { return &ListGroupsBadRequest{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListServerGroupBadRequest() *ListServerGroupBadRequest {\n\treturn &ListServerGroupBadRequest{}\n}", "func NewGetConsistencyGroupsBadRequest() *GetConsistencyGroupsBadRequest {\n\treturn &GetConsistencyGroupsBadRequest{}\n}", "func NewGetHostGroupsBadRequest() *GetHostGroupsBadRequest {\n\treturn &GetHostGroupsBadRequest{}\n}", "func NewUserGroupListBadRequest() *UserGroupListBadRequest {\n\treturn &UserGroupListBadRequest{}\n}", "func NewListGroupsNotFound() *ListGroupsNotFound {\n\treturn &ListGroupsNotFound{}\n}", "func NewListGroupsDefault(code int) *ListGroupsDefault {\n\treturn &ListGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetUsergroupsGroupIDBadRequest() *GetUsergroupsGroupIDBadRequest {\n\treturn &GetUsergroupsGroupIDBadRequest{}\n}", "func NewUpdateHostGroupsBadRequest() *UpdateHostGroupsBadRequest {\n\treturn &UpdateHostGroupsBadRequest{}\n}", "func NewGetAviServiceEngineGroupsBadRequest() *GetAviServiceEngineGroupsBadRequest {\n\n\treturn &GetAviServiceEngineGroupsBadRequest{}\n}", "func NewUpdateUserGroupsBadRequest() *UpdateUserGroupsBadRequest {\n\treturn &UpdateUserGroupsBadRequest{}\n}", "func NewListBadRequest(body *ListBadRequestResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func TestGroupDataSource_DoesNotSwallowListGroupError(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tprojectID := uuid.New()\n\tresourceData := createResourceData(t, projectID.String(), \"group-name\")\n\n\tgraphClient := azdosdkmocks.NewMockGraphClient(ctrl)\n\tclients := &client.AggregatedClient{GraphClient: graphClient, Ctx: context.Background()}\n\n\texpectedProjectDescriptorLookupArgs := graph.GetDescriptorArgs{StorageKey: &projectID}\n\tprojectDescriptor := converter.String(\"descriptor\")\n\tprojectDescriptorResponse := graph.GraphDescriptorResult{Value: projectDescriptor}\n\tgraphClient.\n\t\tEXPECT().\n\t\tGetDescriptor(clients.Ctx, expectedProjectDescriptorLookupArgs).\n\t\tReturn(&projectDescriptorResponse, nil)\n\n\texpectedListGroupArgs := graph.ListGroupsArgs{ScopeDescriptor: projectDescriptor}\n\tgraphClient.\n\t\tEXPECT().\n\t\tListGroups(clients.Ctx, expectedListGroupArgs).\n\t\tReturn(nil, errors.New(\"ListGroups() Failed\"))\n\n\terr := dataSourceGroupRead(resourceData, clients)\n\trequire.Contains(t, err.Error(), \"ListGroups() Failed\")\n}", "func NewGroupDeletesBadRequest() *GroupDeletesBadRequest {\n\treturn &GroupDeletesBadRequest{}\n}", "func NewQueryUserGroupsBadRequest() *QueryUserGroupsBadRequest {\n\treturn &QueryUserGroupsBadRequest{}\n}", "func NewDeleteUserGroupsBadRequest() *DeleteUserGroupsBadRequest {\n\treturn &DeleteUserGroupsBadRequest{}\n}", "func NewSetRoleGroupsBadRequest() *SetRoleGroupsBadRequest {\n\treturn &SetRoleGroupsBadRequest{}\n}", "func NewGetCustomerGroupsBadRequest() *GetCustomerGroupsBadRequest {\n\treturn &GetCustomerGroupsBadRequest{}\n}", "func (o *ListServerGroupBadRequest) Code() int {\n\treturn 400\n}", "func getGroups(w http.ResponseWriter, r *http.Request) {\n InitResponse(&w)\n if r.Method == \"OPTIONS\" {return}\n\n allow, _ := HasPermission(&w, r, CoreGroupModuleID, CoreAccessRead)\n if !allow {\n w.WriteHeader(http.StatusUnauthorized)\n json.NewEncoder(w).Encode(&CoreMessage{\n Message: \"Not authorized!\",\n })\n return\n }\n\n groups := []CoreGroup{}\n\n err := Db.Model(&groups).Select()\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n return\n }\n\n w.WriteHeader(http.StatusOK)\n json.NewEncoder(w).Encode(groups)\n}", "func NewDeleteCIDGroupsBadRequest() *DeleteCIDGroupsBadRequest {\n\treturn &DeleteCIDGroupsBadRequest{}\n}", "func NewCreateConsistencyGroupBadRequest() *CreateConsistencyGroupBadRequest {\n\treturn &CreateConsistencyGroupBadRequest{}\n}", "func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListGroupsResponse\")\n\t}\n\treturn\n}", "func NewListGroupsForbidden() *ListGroupsForbidden {\n\treturn &ListGroupsForbidden{}\n}", "func NewUpdateHostGroupsDefault(code int) *UpdateHostGroupsDefault {\n\treturn &UpdateHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewPatchApi24ProtectionGroupsBadRequest() *PatchApi24ProtectionGroupsBadRequest {\n\treturn &PatchApi24ProtectionGroupsBadRequest{}\n}", "func NewGetHostGroupsDefault(code int) *GetHostGroupsDefault {\n\treturn &GetHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetGroupMembersListV1BadRequest() *GetGroupMembersListV1BadRequest {\n\treturn &GetGroupMembersListV1BadRequest{}\n}", "func NewPostVolumeGroupsListDefault(code int) *PostVolumeGroupsListDefault {\n\treturn &PostVolumeGroupsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewPostApi24HostsProtectionGroupsBadRequest() *PostApi24HostsProtectionGroupsBadRequest {\n\treturn &PostApi24HostsProtectionGroupsBadRequest{}\n}", "func NewListGroupsOK() *ListGroupsOK {\n\treturn &ListGroupsOK{}\n}", "func (o *UpdateUserGroupsBadRequest) Code() int {\n\treturn 400\n}", "func (client *Client) ListResourceGroupsWithOptions(request *ListResourceGroupsRequest, runtime *util.RuntimeOptions) (_result *ListResourceGroupsResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\tquery := map[string]interface{}{}\n\tif !tea.BoolValue(util.IsUnset(request.DisplayName)) {\n\t\tquery[\"DisplayName\"] = request.DisplayName\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.IncludeTags)) {\n\t\tquery[\"IncludeTags\"] = request.IncludeTags\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Name)) {\n\t\tquery[\"Name\"] = request.Name\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageNumber)) {\n\t\tquery[\"PageNumber\"] = request.PageNumber\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageSize)) {\n\t\tquery[\"PageSize\"] = request.PageSize\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupId)) {\n\t\tquery[\"ResourceGroupId\"] = request.ResourceGroupId\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupIds)) {\n\t\tquery[\"ResourceGroupIds\"] = request.ResourceGroupIds\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Status)) {\n\t\tquery[\"Status\"] = request.Status\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Tag)) {\n\t\tquery[\"Tag\"] = request.Tag\n\t}\n\n\treq := &openapi.OpenApiRequest{\n\t\tQuery: openapiutil.Query(query),\n\t}\n\tparams := &openapi.Params{\n\t\tAction: tea.String(\"ListResourceGroups\"),\n\t\tVersion: tea.String(\"2020-03-31\"),\n\t\tProtocol: tea.String(\"HTTPS\"),\n\t\tPathname: tea.String(\"/\"),\n\t\tMethod: tea.String(\"POST\"),\n\t\tAuthType: tea.String(\"AK\"),\n\t\tStyle: tea.String(\"RPC\"),\n\t\tReqBodyType: tea.String(\"formData\"),\n\t\tBodyType: tea.String(\"json\"),\n\t}\n\t_result = &ListResourceGroupsResponse{}\n\t_body, _err := client.CallApi(params, req, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "func (c *DefaultIdentityProvider) ListGroups(ctx context.Context, options *metainternal.ListOptions) (*auth.GroupList, error) {\n\tkeyword := \"\"\n\tlimit := 50\n\tif options.FieldSelector != nil {\n\t\tkeyword, _ = options.FieldSelector.RequiresExactMatch(auth.KeywordQueryTag)\n\t\tlimitStr, _ := options.FieldSelector.RequiresExactMatch(auth.QueryLimitTag)\n\t\tif li, err := strconv.Atoi(limitStr); err == nil && li > 0 {\n\t\t\tlimit = li\n\t\t}\n\t}\n\n\t_, tenantID := authentication.GetUsernameAndTenantID(ctx)\n\tif tenantID != \"\" && tenantID != c.tenantID {\n\t\treturn nil, apierrors.NewBadRequest(\"must in the same tenant\")\n\t}\n\n\tallList, err := c.localGroupLister.List(labels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar localGroupList []*authv1.LocalGroup\n\tfor i, item := range allList {\n\t\tif item.Spec.TenantID == c.tenantID {\n\t\t\tlocalGroupList = append(localGroupList, allList[i])\n\t\t}\n\t}\n\n\tif keyword != \"\" {\n\t\tvar newList []*authv1.LocalGroup\n\t\tfor i, val := range localGroupList {\n\t\t\tif strings.Contains(val.Name, keyword) || strings.Contains(val.Spec.DisplayName, keyword) {\n\t\t\t\tnewList = append(newList, localGroupList[i])\n\t\t\t}\n\t\t}\n\t\tlocalGroupList = newList\n\t}\n\n\titems := localGroupList[0:min(len(localGroupList), limit)]\n\n\tgroupList := auth.GroupList{}\n\tfor _, item := range items {\n\t\tgroup := convertToGroup(item)\n\t\tgroupList.Items = append(groupList.Items, group)\n\t}\n\n\treturn &groupList, nil\n}", "func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) {\n\trequest = &ListServerGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Alb\", \"2020-06-16\", \"ListServerGroups\", \"alb\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func (a *HyperflexApiService) GetHyperflexInitiatorGroupList(ctx context.Context) ApiGetHyperflexInitiatorGroupListRequest {\n\treturn ApiGetHyperflexInitiatorGroupListRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "func (c *GroupController) List(ctx *app.ListGroupContext) error {\n\t// GroupController_List: start_implement\n\n\tdataStore := &dal.DataStore{}\n\tdataStore.GetSession()\n\t// Close the session\n\tdefer dataStore.Close()\n\tdc := dal.NewDalGroup(dataStore)\n\n\tgroups, err := dc.FetchAll()\n\n\tif err != nil {\n\t\tctx.ResponseData.Service.LogError(\"InternalServerError\", \"req_id\", middleware.ContextRequestID(ctx), \"ctrl\", \"Group\", \"action\", \"List\", ctx.RequestData.Request.Method, ctx.RequestData.Request.URL, \"databaseError\", err.Error())\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tres := make(app.GwentapiGroupCollection, len(*groups))\n\n\tlastModified := time.Time{}\n\tfor i, group := range *groups {\n\t\tg, _ := factory.CreateGroup(&group)\n\n\t\tif lastModified.Before(group.Last_Modified) {\n\t\t\tlastModified = group.Last_Modified\n\t\t}\n\n\t\tres[i] = g\n\t}\n\n\t// GroupController_List: end_implement\n\thelpers.LastModified(ctx.ResponseData, lastModified)\n\tif ctx.IfModifiedSince != nil {\n\t\tif !helpers.IsModified(*ctx.IfModifiedSince, lastModified) {\n\t\t\treturn ctx.NotModified()\n\t\t}\n\t}\n\treturn ctx.OK(res)\n}", "func NewPcloudPlacementgroupsGetallBadRequest() *PcloudPlacementgroupsGetallBadRequest {\n\treturn &PcloudPlacementgroupsGetallBadRequest{}\n}", "func NewGetGroupListPublicV1BadRequest() *GetGroupListPublicV1BadRequest {\n\treturn &GetGroupListPublicV1BadRequest{}\n}", "func (client *ContainerGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerGroupsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewPcloudVolumegroupsGetBadRequest() *PcloudVolumegroupsGetBadRequest {\n\treturn &PcloudVolumegroupsGetBadRequest{}\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func (a *IAMApiService) GetGroups(ctx context.Context) (IamGroups, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = http.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue IamGroups\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/acs/api/v1/groups\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\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 IamGroups\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 == 0 {\n\t\t\tvar v IamError\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\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}", "func NewListPermissionBadRequest() *ListPermissionBadRequest {\n\treturn &ListPermissionBadRequest{}\n}", "func NewAddEventLoopGroupBadRequest() *AddEventLoopGroupBadRequest {\n\treturn &AddEventLoopGroupBadRequest{}\n}", "func NewGroup(ctx context.Context) *errGroup {\n\tnewCtx, cancel := context.WithCancel(ctx)\n\treturn &errGroup{\n\t\tctx: newCtx,\n\t\tcancel: cancel,\n\t}\n}", "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}", "func (client WorkloadNetworksClient) ListVMGroupsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"privateCloudName\": autorest.Encode(\"path\", privateCloudName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2020-07-17-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (client IdentityClient) ListDynamicGroups(ctx context.Context, request ListDynamicGroupsRequest) (response ListDynamicGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listDynamicGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListDynamicGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListDynamicGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListDynamicGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListDynamicGroupsResponse\")\n\t}\n\treturn\n}", "func NewPcloudPlacementgroupsPostBadRequest() *PcloudPlacementgroupsPostBadRequest {\n\treturn &PcloudPlacementgroupsPostBadRequest{}\n}", "func NewObjectsListBadRequest() *ObjectsListBadRequest {\n\n\treturn &ObjectsListBadRequest{}\n}", "func validateGroups(groupID, totalGroupsNum uint) error {\n\tif totalGroupsNum == 0 {\n\t\t// Need at least one group\n\t\treturn fmt.Errorf(errTotalGroupsZero)\n\t}\n\tif groupID >= totalGroupsNum {\n\t\t// Need reasonable groupID\n\t\treturn fmt.Errorf(errInvalidGroupsFmt, groupID, totalGroupsNum)\n\t}\n\treturn nil\n}", "func CreateListExperimentGroupsRequest() (request *ListExperimentGroupsRequest) {\n\trequest = &ListExperimentGroupsRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"PaiRecService\", \"2022-12-13\", \"ListExperimentGroups\", \"/api/v1/experimentgroups\", \"\", \"\")\n\trequest.Method = requests.GET\n\treturn\n}", "func CreateListServerGroupsResponse() (response *ListServerGroupsResponse) {\n\tresponse = &ListServerGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func (_e *MockQueryCoord_Expecter) ListResourceGroups(ctx interface{}, req interface{}) *MockQueryCoord_ListResourceGroups_Call {\n\treturn &MockQueryCoord_ListResourceGroups_Call{Call: _e.mock.On(\"ListResourceGroups\", ctx, req)}\n}", "func ValidateListBadRequestResponseBody(body *ListBadRequestResponseBody) (err error) {\n\tif body.Name == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"name\", \"body\"))\n\t}\n\tif body.ID == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"id\", \"body\"))\n\t}\n\tif body.Message == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"message\", \"body\"))\n\t}\n\tif body.Temporary == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"temporary\", \"body\"))\n\t}\n\tif body.Timeout == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"timeout\", \"body\"))\n\t}\n\tif body.Fault == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"fault\", \"body\"))\n\t}\n\treturn\n}", "func (m *GraphBaseServiceClient) Groups()(*ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.GroupsRequestBuilder) {\n return ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func (m *GraphBaseServiceClient) Groups()(*ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.GroupsRequestBuilder) {\n return ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func (client DataControllersClient) ListInGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2019-07-24-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/dataControllers\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (o *QueryGroupMembersBadRequest) Code() int {\n\treturn 400\n}", "func NewGetIPAMvrfgroupBadRequest() *GetIPAMvrfgroupBadRequest {\n\treturn &GetIPAMvrfgroupBadRequest{}\n}", "func (a *Client) PublicListReasonGroups(params *PublicListReasonGroupsParams, authInfo runtime.ClientAuthInfoWriter) (*PublicListReasonGroupsOK, *PublicListReasonGroupsInternalServerError, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewPublicListReasonGroupsParams()\n\t}\n\n\tif params.Context == nil {\n\t\tparams.Context = context.Background()\n\t}\n\n\tif params.RetryPolicy != nil {\n\t\tparams.SetHTTPClientTransport(params.RetryPolicy)\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"publicListReasonGroups\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/reporting/v1/public/namespaces/{namespace}/reasonGroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &PublicListReasonGroupsReader{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, nil, err\n\t}\n\n\tswitch v := result.(type) {\n\n\tcase *PublicListReasonGroupsOK:\n\t\treturn v, nil, nil\n\n\tcase *PublicListReasonGroupsInternalServerError:\n\t\treturn nil, v, nil\n\n\tdefault:\n\t\treturn nil, nil, fmt.Errorf(\"Unexpected Type %v\", reflect.TypeOf(v))\n\t}\n}", "func (o *ListGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (o *RemoveServerGroupBadRequest) Code() int {\n\treturn 400\n}", "func handleGetGroups(c *Context, w http.ResponseWriter, r *http.Request) {\n\tpaging, err := parsePaging(r.URL)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse paging parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\twithInstallationCount, err := parseBool(r.URL, model.ShowInstallationCountQueryParameter, false)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse request parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tfilter := &model.GroupFilter{\n\t\tPaging: paging,\n\t\tWithInstallationCount: withInstallationCount,\n\t}\n\n\tgroups, err := c.Store.GetGroupDTOs(filter)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to query groups\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif groups == nil {\n\t\tgroups = []*model.GroupDTO{}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\toutputJSON(c, w, groups)\n}", "func NewAllDashboardsBadRequest() *AllDashboardsBadRequest {\n return &AllDashboardsBadRequest{\n }\n}", "func NewListIdpGroupMappingsBadRequest() *ListIdpGroupMappingsBadRequest {\n\treturn &ListIdpGroupMappingsBadRequest{}\n}", "func (ctx *ListMessageContext) BadRequest(r error) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "func (ggSession *GreengrassSession) ListGroup(name string) error {\n\tvar id string\n\n\tif name != \"\" {\n\t\tlistOutput, err := ggSession.greengrass.ListGroups(&greengrass.ListGroupsInput{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, v := range listOutput.Groups {\n\t\t\tif name == *v.Name {\n\t\t\t\tid = *v.Id\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"group %s not found\", name)\n\t\t}\n\t} else {\n\t\tid = ggSession.config.Group.ID\n\t}\n\n\tgroup, err := ggSession.greengrass.GetGroup(&greengrass.GetGroupInput{\n\t\tGroupId: &id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group: %v\\n\", group)\n\n\tif group.LatestVersion == nil {\n\t\treturn nil\n\t}\n\n\tgroupVersion, err := ggSession.greengrass.GetGroupVersion(&greengrass.GetGroupVersionInput{\n\t\tGroupId: group.Id,\n\t\tGroupVersionId: group.LatestVersion,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group version: %v\\n\", groupVersion)\n\n\treturn nil\n}", "func (db *MySQLDB) ListGroups(ctx context.Context, tenant *Tenant, request *helper.PageRequest) ([]*Group, *helper.Page, error) {\n\tfLog := mysqlLog.WithField(\"func\", \"ListGroups\").WithField(\"RequestID\", ctx.Value(constants.RequestID))\n\tq := \"SELECT COUNT(*) AS CNT FROM HANSIP_GROUP\"\n\tret := make([]*Group, 0)\n\trow := db.instance.QueryRowContext(ctx, q)\n\tcount := 0\n\terr := row.Scan(&count)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn ret, helper.NewPage(request, uint(count)), nil\n\t\t}\n\t\tfLog.Errorf(\"row.Scan got %s\", err.Error())\n\t\treturn nil, nil, &ErrDBScanError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tpage := helper.NewPage(request, uint(count))\n\tq = fmt.Sprintf(\"SELECT REC_ID, GROUP_NAME, GROUP_DOMAIN, DESCRIPTION FROM HANSIP_GROUP WHERE GROUP_DOMAIN=? ORDER BY GROUP_NAME %s LIMIT %d, %d\", request.Sort, page.OffsetStart, page.OffsetEnd-page.OffsetStart)\n\trows, err := db.instance.QueryContext(ctx, q, tenant.Domain)\n\tif err != nil {\n\t\tfLog.Errorf(\"db.instance.QueryContext got %s. SQL = %s\", err.Error(), q)\n\t\treturn nil, nil, &ErrDBQueryError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tr := &Group{}\n\t\terr := rows.Scan(&r.RecID, &r.GroupName, &r.GroupDomain, &r.Description)\n\t\tif err != nil {\n\t\t\tfLog.Warnf(\"row.Scan got %s\", err.Error())\n\t\t\treturn nil, nil, &ErrDBScanError{\n\t\t\t\tWrapped: err,\n\t\t\t\tMessage: \"Error ListGroups\",\n\t\t\t\tSQL: q,\n\t\t\t}\n\t\t} else {\n\t\t\tret = append(ret, r)\n\t\t}\n\t}\n\treturn ret, page, nil\n}", "func List(c messagebird.Client, options *messagebird.PaginationRequest) (*Groups, error) {\n\tgroupList := &Groups{}\n\tif err := c.Request(groupList, http.MethodGet, path+\"?\"+options.QueryParams(), nil); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groupList, nil\n}", "func NewAddServerGroupBadRequest() *AddServerGroupBadRequest {\n\treturn &AddServerGroupBadRequest{}\n}", "func NewDescribeGroupsResponse(payload []byte) (*DescribeGroupsResponse, error) {\n\tvar (\n\t\terr error = nil\n\t\tl int\n\t\toffset int = 0\n\t)\n\tr := &DescribeGroupsResponse{}\n\tresponseLength := int(binary.BigEndian.Uint32(payload))\n\tif responseLength+4 != len(payload) {\n\t\treturn nil, fmt.Errorf(\"describeGroups reseponse length did not match: %d!=%d\", responseLength+4, len(payload))\n\t}\n\toffset += 4\n\n\tr.CorrelationID = uint32(binary.BigEndian.Uint32(payload[offset:]))\n\toffset += 4\n\n\tgroupCount := uint32(binary.BigEndian.Uint32(payload[offset:]))\n\toffset += 4\n\n\tr.Groups = make([]*GroupDetail, groupCount)\n\n\tfor i := range r.Groups {\n\t\tgroup := &GroupDetail{}\n\n\t\tgroup.ErrorCode = int16(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\n\t\tif err == nil && group.ErrorCode != 0 {\n\t\t\terr = getErrorFromErrorCode(group.ErrorCode)\n\t\t}\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.GroupID = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.State = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.ProtocolType = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\toffset += 2\n\t\tgroup.Protocol = string(payload[offset : offset+l])\n\t\toffset += l\n\n\t\tmemberCount := int(binary.BigEndian.Uint32(payload[offset:]))\n\t\toffset += 4\n\n\t\tgroup.Members = make([]*MemberDetail, memberCount)\n\n\t\tfor i := range group.Members {\n\t\t\tgroup.Members[i] = &MemberDetail{}\n\n\t\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\t\toffset += 2\n\t\t\tgroup.Members[i].MemberID = string(payload[offset : offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\t\toffset += 2\n\t\t\tgroup.Members[i].ClientID = string(payload[offset : offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint16(payload[offset:]))\n\t\t\toffset += 2\n\t\t\tgroup.Members[i].ClientHost = string(payload[offset : offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint32(payload[offset:]))\n\t\t\toffset += 4\n\t\t\tcopy(group.Members[i].MemberMetadata, payload[offset:offset+l])\n\t\t\toffset += l\n\n\t\t\tl = int(binary.BigEndian.Uint32(payload[offset:]))\n\t\t\toffset += 4\n\t\t\tgroup.Members[i].MemberAssignment = make([]byte, l)\n\t\t\tcopy(group.Members[i].MemberAssignment, payload[offset:offset+l])\n\t\t\toffset += l\n\t\t}\n\n\t\tr.Groups[i] = group\n\t}\n\n\treturn r, err\n}", "func CreateListExperimentGroupsResponse() (response *ListExperimentGroupsResponse) {\n\tresponse = &ListExperimentGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func ListUserGroup(w http.ResponseWriter, r *http.Request) {\n\tfLog := userMgmtLogger.WithField(\"func\", \"ListUserGroup\").WithField(\"RequestID\", r.Context().Value(constants.RequestID)).WithField(\"path\", r.URL.Path).WithField(\"method\", r.Method)\n\n\tiauthctx := r.Context().Value(constants.HansipAuthentication)\n\tif iauthctx == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusUnauthorized, \"You are not authorized to access this resource\", nil, nil)\n\t\treturn\n\t}\n\n\tparams, err := helper.ParsePathParams(fmt.Sprintf(\"%s/management/user/{userRecId}/groups\", apiPrefix), r.URL.Path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuser, err := UserRepo.GetUserByRecID(r.Context(), params[\"userRecId\"])\n\tif err != nil {\n\t\tfLog.Errorf(\"UserRepo.GetUserByRecID got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tif user == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusNotFound, fmt.Sprintf(\"User recid %s not found\", params[\"userRecId\"]), nil, nil)\n\t\treturn\n\t}\n\n\tpageRequest, err := helper.NewPageRequestFromRequest(r)\n\tif err != nil {\n\t\tfLog.Errorf(\"helper.NewPageRequestFromRequest got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusBadRequest, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tgroups, page, err := UserGroupRepo.ListUserGroupByUser(r.Context(), user, pageRequest)\n\tif err != nil {\n\t\tfLog.Errorf(\"UserGroupRepo.ListUserGroupByUser got %s\", err.Error())\n\t}\n\tsgroups := make([]*SimpleGroup, len(groups))\n\tfor k, v := range groups {\n\t\tsgroups[k] = &SimpleGroup{\n\t\t\tRecID: v.RecID,\n\t\t\tGroupName: v.GroupName,\n\t\t}\n\t}\n\tret := make(map[string]interface{})\n\tret[\"groups\"] = sgroups\n\tret[\"page\"] = page\n\thelper.WriteHTTPResponse(r.Context(), w, http.StatusOK, \"List of groups paginated\", nil, ret)\n}", "func NewListPaginatedBadRequest() *ListPaginatedBadRequest {\n\treturn &ListPaginatedBadRequest{}\n}", "func (client IdentityClient) listGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/groups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func NewCreateVMPlacementGroupBadRequest() *CreateVMPlacementGroupBadRequest {\n\treturn &CreateVMPlacementGroupBadRequest{}\n}", "func (o *GetAviServiceEngineGroupsBadRequest) WithPayload(payload *models.Error) *GetAviServiceEngineGroupsBadRequest {\n\to.Payload = payload\n\treturn o\n}", "func (o *AddServerGroupBadRequest) Code() int {\n\treturn 400\n}", "func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewGetHostGroupsNotFound() *GetHostGroupsNotFound {\n\treturn &GetHostGroupsNotFound{}\n}", "func (s *GroupsService) List(ctx context.Context, opts *PagingOptions) (*GroupList, error) {\n\tquery := addPaging(url.Values{}, opts)\n\treq, err := s.Client.NewRequest(ctx, http.MethodGet, newURI(groupsURI), WithQuery(query))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\tres, resp, err := s.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\n\tif resp != nil && resp.StatusCode == http.StatusNotFound {\n\t\treturn nil, ErrNotFound\n\t}\n\n\tg := &GroupList{\n\t\tGroups: []*Group{},\n\t}\n\tif err := json.Unmarshal(res, g); err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed, unable to unmarshal repository list json: , %w\", err)\n\t}\n\n\tfor _, r := range g.GetGroups() {\n\t\tr.Session.set(resp)\n\t}\n\n\treturn g, nil\n}", "func (capi ClientAPI) Groups(conf map[string]string) error {\n\n\turl := fmt.Sprintf(\"http://%s:%s/v1/groups\", conf[\"host\"], conf[\"port\"])\n\n\t// Build the request\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Send the request via a client\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Defer the closing of the body\n\tdefer resp.Body.Close()\n\t// Read the content into a byte array\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Marshal API data into map\n\tvar groupmap map[string]string\n\terr = json.Unmarshal(body, &groupmap)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tw := new(tabwriter.Writer)\n\n\t// Format in tab-separated columns with a tab stop of 8.\n\tw.Init(os.Stdout, 0, 8, 0, '\\t', 0)\n\tfmt.Fprintln(w, \"UUID\\tGROUP NAME\")\n\n\tfor agentUUID, groupName := range groupmap {\n\t\tfmt.Fprintf(\n\t\t\tw,\n\t\t\t\"%s\\t%s\\n\",\n\t\t\thostresources.TruncateID(agentUUID),\n\t\t\tgroupName,\n\t\t)\n\t}\n\tfmt.Fprintln(w)\n\tw.Flush()\n\n\treturn nil\n\n}", "func (o *PostVolumeGroupsListDefault) Code() int {\n\treturn o._statusCode\n}", "func (a *Client) UserGroupsList(params *UserGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*UserGroupsListOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewUserGroupsListParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"user_groups_list\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/v3/customer/core/user_groups/\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &UserGroupsListReader{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.(*UserGroupsListOK)\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 user_groups_list: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "func (client WorkloadNetworksClient) ListVMGroupsResponder(resp *http.Response) (result WorkloadNetworkVMGroupsList, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (m *AccessPackage) SetIncompatibleGroups(value []Groupable)() {\n m.incompatibleGroups = value\n}", "func (c *MockResourceGroupsClient) List(ctx context.Context, filter string) ([]resources.Group, error) {\n\tif filter != \"\" {\n\t\treturn nil, fmt.Errorf(\"unsupported non-empty filter: %s\", filter)\n\t}\n\tvar l []resources.Group\n\tfor _, rg := range c.RGs {\n\t\tl = append(l, rg)\n\t}\n\treturn l, nil\n}", "func (client *MetricAlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MetricAlertsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewListProvidersBadRequest() *ListProvidersBadRequest {\n\treturn &ListProvidersBadRequest{}\n}", "func (o *GetUniverseGroupsGroupIDNotFoundBody) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.validateError(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "func handleGetGroupsStatus(c *Context, w http.ResponseWriter, r *http.Request) {\n\tfilter := &model.GroupFilter{\n\t\tPaging: model.AllPagesNotDeleted(),\n\t}\n\n\tgroups, err := c.Store.GetGroups(filter)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to query groups\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif groups == nil {\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\treturn\n\t}\n\n\tvar groupsStatus []model.GroupsStatus\n\n\tfor _, group := range groups {\n\t\tvar groupStatus model.GroupsStatus\n\t\tstatus, err := c.Store.GetGroupStatus(group.ID)\n\t\tif err != nil {\n\t\t\tc.Logger.WithError(err).Error(\"failed to query group status\")\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tif status == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tgroupStatus.ID = group.ID\n\t\tgroupStatus.Status = *status\n\n\t\tgroupsStatus = append(groupsStatus, groupStatus)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\toutputJSON(c, w, groupsStatus)\n}", "func NewListTeamsBadRequest() *ListTeamsBadRequest {\n\treturn &ListTeamsBadRequest{}\n}", "func NewListOrganizationsBadRequest() *ListOrganizationsBadRequest {\n\treturn &ListOrganizationsBadRequest{}\n}", "func NewListPrioritiesBadRequest() *ListPrioritiesBadRequest {\n\treturn &ListPrioritiesBadRequest{}\n}", "func (q *QueryGVR) resourceListInGroup(resourceLists []*metav1.APIResourceList, group string) ([]*metav1.APIResourceList, error) {\n\tvar list []*metav1.APIResourceList\n\tfor _, rscList := range resourceLists {\n\t\tgv, err := schema.ParseGroupVersion(rscList.GroupVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif strings.EqualFold(gv.Group, group) {\n\t\t\tlist = append(list, rscList)\n\t\t}\n\t}\n\treturn list, nil\n}", "func TestListIamGroups(t *testing.T) {\n\tt.Parallel()\n\n\tregion, err := getRandomRegion()\n\trequire.NoError(t, err)\n\n\tlocalSession, err := session.NewSession(&awsgo.Config{\n\t\tRegion: awsgo.String(region),\n\t})\n\trequire.NoError(t, err)\n\n\tgroupNames, err := getAllIamGroups(localSession, time.Now(), config.Config{})\n\trequire.NoError(t, err)\n\tassert.NotEmpty(t, groupNames)\n}", "func NewGroups(filename string, bad BadLineHandler) (*HTGroup, error) {\n\thtGroup := HTGroup{\n\t\tfilePath: filename,\n\t}\n\treturn &htGroup, htGroup.ReloadGroups(bad)\n}", "func (client IdentityClient) listDynamicGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/dynamicGroups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListDynamicGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}" ]
[ "0.7203379", "0.6827672", "0.6800662", "0.6767549", "0.65069234", "0.6362982", "0.6343974", "0.6341393", "0.6338169", "0.61313295", "0.6129404", "0.6056113", "0.60408044", "0.6037293", "0.60331726", "0.6015777", "0.5988406", "0.591956", "0.5843401", "0.5837527", "0.58244187", "0.58183676", "0.581339", "0.5811094", "0.57788473", "0.57504964", "0.5705735", "0.5676316", "0.5661241", "0.56479883", "0.56465256", "0.5621152", "0.55789286", "0.55788314", "0.5563469", "0.5554078", "0.55224967", "0.5507333", "0.55007964", "0.5477795", "0.5451631", "0.5443613", "0.54313976", "0.5430643", "0.5426099", "0.54249626", "0.5415829", "0.538802", "0.53796756", "0.53733087", "0.53685075", "0.5367921", "0.53553396", "0.53471863", "0.533469", "0.53307813", "0.53307813", "0.53150386", "0.5312545", "0.5311519", "0.52995044", "0.5298925", "0.52966297", "0.5285688", "0.52776057", "0.5261329", "0.5260712", "0.5229968", "0.5219416", "0.5218027", "0.52165926", "0.5216363", "0.5206988", "0.5204463", "0.52042747", "0.5202854", "0.5199073", "0.5199005", "0.5196995", "0.51862484", "0.5185724", "0.51717037", "0.5171066", "0.51691186", "0.5168337", "0.5164545", "0.5163116", "0.51450396", "0.5144002", "0.51360816", "0.51323885", "0.5128874", "0.5128042", "0.5126315", "0.5123396", "0.511231", "0.5109341", "0.51039433", "0.5096027", "0.50897664" ]
0.8323626
0
NewListGroupsForbidden creates a ListGroupsForbidden with default headers values
NewListGroupsForbidden создает ListGroupsForbidden с значениями заголовков по умолчанию
func NewListGroupsForbidden() *ListGroupsForbidden { return &ListGroupsForbidden{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListGroupsBadRequest() *ListGroupsBadRequest {\n\treturn &ListGroupsBadRequest{}\n}", "func NewGetHostGroupsForbidden() *GetHostGroupsForbidden {\n\treturn &GetHostGroupsForbidden{}\n}", "func getGroups(w http.ResponseWriter, r *http.Request) {\n InitResponse(&w)\n if r.Method == \"OPTIONS\" {return}\n\n allow, _ := HasPermission(&w, r, CoreGroupModuleID, CoreAccessRead)\n if !allow {\n w.WriteHeader(http.StatusUnauthorized)\n json.NewEncoder(w).Encode(&CoreMessage{\n Message: \"Not authorized!\",\n })\n return\n }\n\n groups := []CoreGroup{}\n\n err := Db.Model(&groups).Select()\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n return\n }\n\n w.WriteHeader(http.StatusOK)\n json.NewEncoder(w).Encode(groups)\n}", "func NewListGroupsNotFound() *ListGroupsNotFound {\n\treturn &ListGroupsNotFound{}\n}", "func NewListGroupsDefault(code int) *ListGroupsDefault {\n\treturn &ListGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) {\n\trequest = &ListServerGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Alb\", \"2020-06-16\", \"ListServerGroups\", \"alb\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func NewUpdateHostGroupsForbidden() *UpdateHostGroupsForbidden {\n\treturn &UpdateHostGroupsForbidden{}\n}", "func NewListRegistryForbidden() *ListRegistryForbidden {\n\treturn &ListRegistryForbidden{}\n}", "func NewListServerGroupBadRequest() *ListServerGroupBadRequest {\n\treturn &ListServerGroupBadRequest{}\n}", "func (c *GroupController) List(ctx *app.ListGroupContext) error {\n\t// GroupController_List: start_implement\n\n\tdataStore := &dal.DataStore{}\n\tdataStore.GetSession()\n\t// Close the session\n\tdefer dataStore.Close()\n\tdc := dal.NewDalGroup(dataStore)\n\n\tgroups, err := dc.FetchAll()\n\n\tif err != nil {\n\t\tctx.ResponseData.Service.LogError(\"InternalServerError\", \"req_id\", middleware.ContextRequestID(ctx), \"ctrl\", \"Group\", \"action\", \"List\", ctx.RequestData.Request.Method, ctx.RequestData.Request.URL, \"databaseError\", err.Error())\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tres := make(app.GwentapiGroupCollection, len(*groups))\n\n\tlastModified := time.Time{}\n\tfor i, group := range *groups {\n\t\tg, _ := factory.CreateGroup(&group)\n\n\t\tif lastModified.Before(group.Last_Modified) {\n\t\t\tlastModified = group.Last_Modified\n\t\t}\n\n\t\tres[i] = g\n\t}\n\n\t// GroupController_List: end_implement\n\thelpers.LastModified(ctx.ResponseData, lastModified)\n\tif ctx.IfModifiedSince != nil {\n\t\tif !helpers.IsModified(*ctx.IfModifiedSince, lastModified) {\n\t\t\treturn ctx.NotModified()\n\t\t}\n\t}\n\treturn ctx.OK(res)\n}", "func (client IdentityClient) ListDynamicGroups(ctx context.Context, request ListDynamicGroupsRequest) (response ListDynamicGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listDynamicGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListDynamicGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListDynamicGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListDynamicGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListDynamicGroupsResponse\")\n\t}\n\treturn\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewGetUsergroupsGroupIDForbidden() *GetUsergroupsGroupIDForbidden {\n\treturn &GetUsergroupsGroupIDForbidden{}\n}", "func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListGroupsResponse\")\n\t}\n\treturn\n}", "func (c *DefaultIdentityProvider) ListGroups(ctx context.Context, options *metainternal.ListOptions) (*auth.GroupList, error) {\n\tkeyword := \"\"\n\tlimit := 50\n\tif options.FieldSelector != nil {\n\t\tkeyword, _ = options.FieldSelector.RequiresExactMatch(auth.KeywordQueryTag)\n\t\tlimitStr, _ := options.FieldSelector.RequiresExactMatch(auth.QueryLimitTag)\n\t\tif li, err := strconv.Atoi(limitStr); err == nil && li > 0 {\n\t\t\tlimit = li\n\t\t}\n\t}\n\n\t_, tenantID := authentication.GetUsernameAndTenantID(ctx)\n\tif tenantID != \"\" && tenantID != c.tenantID {\n\t\treturn nil, apierrors.NewBadRequest(\"must in the same tenant\")\n\t}\n\n\tallList, err := c.localGroupLister.List(labels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar localGroupList []*authv1.LocalGroup\n\tfor i, item := range allList {\n\t\tif item.Spec.TenantID == c.tenantID {\n\t\t\tlocalGroupList = append(localGroupList, allList[i])\n\t\t}\n\t}\n\n\tif keyword != \"\" {\n\t\tvar newList []*authv1.LocalGroup\n\t\tfor i, val := range localGroupList {\n\t\t\tif strings.Contains(val.Name, keyword) || strings.Contains(val.Spec.DisplayName, keyword) {\n\t\t\t\tnewList = append(newList, localGroupList[i])\n\t\t\t}\n\t\t}\n\t\tlocalGroupList = newList\n\t}\n\n\titems := localGroupList[0:min(len(localGroupList), limit)]\n\n\tgroupList := auth.GroupList{}\n\tfor _, item := range items {\n\t\tgroup := convertToGroup(item)\n\t\tgroupList.Items = append(groupList.Items, group)\n\t}\n\n\treturn &groupList, nil\n}", "func NewGetCustomerGroupsForbidden() *GetCustomerGroupsForbidden {\n\treturn &GetCustomerGroupsForbidden{}\n}", "func NewQueryUserGroupsForbidden() *QueryUserGroupsForbidden {\n\treturn &QueryUserGroupsForbidden{}\n}", "func (client *Client) ListResourceGroupsWithOptions(request *ListResourceGroupsRequest, runtime *util.RuntimeOptions) (_result *ListResourceGroupsResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\tquery := map[string]interface{}{}\n\tif !tea.BoolValue(util.IsUnset(request.DisplayName)) {\n\t\tquery[\"DisplayName\"] = request.DisplayName\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.IncludeTags)) {\n\t\tquery[\"IncludeTags\"] = request.IncludeTags\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Name)) {\n\t\tquery[\"Name\"] = request.Name\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageNumber)) {\n\t\tquery[\"PageNumber\"] = request.PageNumber\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageSize)) {\n\t\tquery[\"PageSize\"] = request.PageSize\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupId)) {\n\t\tquery[\"ResourceGroupId\"] = request.ResourceGroupId\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupIds)) {\n\t\tquery[\"ResourceGroupIds\"] = request.ResourceGroupIds\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Status)) {\n\t\tquery[\"Status\"] = request.Status\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Tag)) {\n\t\tquery[\"Tag\"] = request.Tag\n\t}\n\n\treq := &openapi.OpenApiRequest{\n\t\tQuery: openapiutil.Query(query),\n\t}\n\tparams := &openapi.Params{\n\t\tAction: tea.String(\"ListResourceGroups\"),\n\t\tVersion: tea.String(\"2020-03-31\"),\n\t\tProtocol: tea.String(\"HTTPS\"),\n\t\tPathname: tea.String(\"/\"),\n\t\tMethod: tea.String(\"POST\"),\n\t\tAuthType: tea.String(\"AK\"),\n\t\tStyle: tea.String(\"RPC\"),\n\t\tReqBodyType: tea.String(\"formData\"),\n\t\tBodyType: tea.String(\"json\"),\n\t}\n\t_result = &ListResourceGroupsResponse{}\n\t_body, _err := client.CallApi(params, req, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "func (client *ContainerGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerGroupsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewUpdateUserGroupsForbidden() *UpdateUserGroupsForbidden {\n\treturn &UpdateUserGroupsForbidden{}\n}", "func Forbidden(msg string) Error {\n\te := err{msg: msg, code: forbiddenCode, group: generic, kind: forbidden}\n\treturn &e\n}", "func (client IdentityClient) listDynamicGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/dynamicGroups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListDynamicGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func NewPcloudVolumegroupsGetForbidden() *PcloudVolumegroupsGetForbidden {\n\treturn &PcloudVolumegroupsGetForbidden{}\n}", "func (c *MockResourceGroupsClient) List(ctx context.Context, filter string) ([]resources.Group, error) {\n\tif filter != \"\" {\n\t\treturn nil, fmt.Errorf(\"unsupported non-empty filter: %s\", filter)\n\t}\n\tvar l []resources.Group\n\tfor _, rg := range c.RGs {\n\t\tl = append(l, rg)\n\t}\n\treturn l, nil\n}", "func (m *AccessPackage) SetIncompatibleGroups(value []Groupable)() {\n m.incompatibleGroups = value\n}", "func CreateListServerGroupsResponse() (response *ListServerGroupsResponse) {\n\tresponse = &ListServerGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func Forbidden(format string, args ...interface{}) error {\n\treturn New(http.StatusForbidden, format, args...)\n}", "func Forbidden(messages ...string) Error {\n\treturn createMessageError(http.StatusText(http.StatusForbidden), messages)\n}", "func (client *IotSecuritySolutionClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IotSecuritySolutionClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2019-08-01\")\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewGetGroupsByDisplayNameUsingGETForbidden() *GetGroupsByDisplayNameUsingGETForbidden {\n\treturn &GetGroupsByDisplayNameUsingGETForbidden{}\n}", "func TestListIamGroups(t *testing.T) {\n\tt.Parallel()\n\n\tregion, err := getRandomRegion()\n\trequire.NoError(t, err)\n\n\tlocalSession, err := session.NewSession(&awsgo.Config{\n\t\tRegion: awsgo.String(region),\n\t})\n\trequire.NoError(t, err)\n\n\tgroupNames, err := getAllIamGroups(localSession, time.Now(), config.Config{})\n\trequire.NoError(t, err)\n\tassert.NotEmpty(t, groupNames)\n}", "func NewDeleteCIDGroupsForbidden() *DeleteCIDGroupsForbidden {\n\treturn &DeleteCIDGroupsForbidden{}\n}", "func TestGroupDataSource_DoesNotSwallowListGroupError(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tprojectID := uuid.New()\n\tresourceData := createResourceData(t, projectID.String(), \"group-name\")\n\n\tgraphClient := azdosdkmocks.NewMockGraphClient(ctrl)\n\tclients := &client.AggregatedClient{GraphClient: graphClient, Ctx: context.Background()}\n\n\texpectedProjectDescriptorLookupArgs := graph.GetDescriptorArgs{StorageKey: &projectID}\n\tprojectDescriptor := converter.String(\"descriptor\")\n\tprojectDescriptorResponse := graph.GraphDescriptorResult{Value: projectDescriptor}\n\tgraphClient.\n\t\tEXPECT().\n\t\tGetDescriptor(clients.Ctx, expectedProjectDescriptorLookupArgs).\n\t\tReturn(&projectDescriptorResponse, nil)\n\n\texpectedListGroupArgs := graph.ListGroupsArgs{ScopeDescriptor: projectDescriptor}\n\tgraphClient.\n\t\tEXPECT().\n\t\tListGroups(clients.Ctx, expectedListGroupArgs).\n\t\tReturn(nil, errors.New(\"ListGroups() Failed\"))\n\n\terr := dataSourceGroupRead(resourceData, clients)\n\trequire.Contains(t, err.Error(), \"ListGroups() Failed\")\n}", "func NewGetGroupMembersListV1Forbidden() *GetGroupMembersListV1Forbidden {\n\treturn &GetGroupMembersListV1Forbidden{}\n}", "func (client WorkloadNetworksClient) ListVMGroupsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"privateCloudName\": autorest.Encode(\"path\", privateCloudName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2020-07-17-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func ListUserGroup(w http.ResponseWriter, r *http.Request) {\n\tfLog := userMgmtLogger.WithField(\"func\", \"ListUserGroup\").WithField(\"RequestID\", r.Context().Value(constants.RequestID)).WithField(\"path\", r.URL.Path).WithField(\"method\", r.Method)\n\n\tiauthctx := r.Context().Value(constants.HansipAuthentication)\n\tif iauthctx == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusUnauthorized, \"You are not authorized to access this resource\", nil, nil)\n\t\treturn\n\t}\n\n\tparams, err := helper.ParsePathParams(fmt.Sprintf(\"%s/management/user/{userRecId}/groups\", apiPrefix), r.URL.Path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuser, err := UserRepo.GetUserByRecID(r.Context(), params[\"userRecId\"])\n\tif err != nil {\n\t\tfLog.Errorf(\"UserRepo.GetUserByRecID got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tif user == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusNotFound, fmt.Sprintf(\"User recid %s not found\", params[\"userRecId\"]), nil, nil)\n\t\treturn\n\t}\n\n\tpageRequest, err := helper.NewPageRequestFromRequest(r)\n\tif err != nil {\n\t\tfLog.Errorf(\"helper.NewPageRequestFromRequest got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusBadRequest, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tgroups, page, err := UserGroupRepo.ListUserGroupByUser(r.Context(), user, pageRequest)\n\tif err != nil {\n\t\tfLog.Errorf(\"UserGroupRepo.ListUserGroupByUser got %s\", err.Error())\n\t}\n\tsgroups := make([]*SimpleGroup, len(groups))\n\tfor k, v := range groups {\n\t\tsgroups[k] = &SimpleGroup{\n\t\t\tRecID: v.RecID,\n\t\t\tGroupName: v.GroupName,\n\t\t}\n\t}\n\tret := make(map[string]interface{})\n\tret[\"groups\"] = sgroups\n\tret[\"page\"] = page\n\thelper.WriteHTTPResponse(r.Context(), w, http.StatusOK, \"List of groups paginated\", nil, ret)\n}", "func NewDeleteUserGroupsForbidden() *DeleteUserGroupsForbidden {\n\treturn &DeleteUserGroupsForbidden{}\n}", "func CreateListExperimentGroupsRequest() (request *ListExperimentGroupsRequest) {\n\trequest = &ListExperimentGroupsRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"PaiRecService\", \"2022-12-13\", \"ListExperimentGroups\", \"/api/v1/experimentgroups\", \"\", \"\")\n\trequest.Method = requests.GET\n\treturn\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func NewListProvidersForbidden() *ListProvidersForbidden {\n\treturn &ListProvidersForbidden{}\n}", "func NewListPermissionForbidden() *ListPermissionForbidden {\n\treturn &ListPermissionForbidden{}\n}", "func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client *PolicyDefinitionsClient) listByManagementGroupCreateRequest(ctx context.Context, managementGroupID string, options *PolicyDefinitionsListByManagementGroupOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions\"\n\tif managementGroupID == \"\" {\n\t\treturn nil, errors.New(\"parameter managementGroupID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managementGroupId}\", url.PathEscape(managementGroupID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\tif options != nil && options.Top != nil {\n\t\treqQP.Set(\"$top\", strconv.FormatInt(int64(*options.Top), 10))\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\tunencodedParams := []string{req.Raw().URL.RawQuery}\n\tif options != nil && options.Filter != nil {\n\t\tunencodedParams = append(unencodedParams, \"$filter=\"+*options.Filter)\n\t}\n\treq.Raw().URL.RawQuery = strings.Join(unencodedParams, \"&\")\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (m *GraphBaseServiceClient) Groups()(*ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.GroupsRequestBuilder) {\n return ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func (m *GraphBaseServiceClient) Groups()(*ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.GroupsRequestBuilder) {\n return ia6e876e3ed2d92c29c13dbc8c37513bc38d0d5f05ab9321e43a25ff336912a2d.NewGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups\"\n\tif privateEndpointName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateEndpointName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateEndpointName}\", url.PathEscape(privateEndpointName))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewForbidden(err error, msg ...string) *Errs {\n\tif err == nil {\n\t\terr = ErrForbidden\n\t}\n\n\treturn &Errs{\n\t\tcodeHTTP: http.StatusForbidden,\n\t\terr: err,\n\t\tkind: trace(2),\n\t\tmessage: msg,\n\t}\n}", "func (_e *MockQueryCoord_Expecter) ListResourceGroups(ctx interface{}, req interface{}) *MockQueryCoord_ListResourceGroups_Call {\n\treturn &MockQueryCoord_ListResourceGroups_Call{Call: _e.mock.On(\"ListResourceGroups\", ctx, req)}\n}", "func NewQueryCIDGroupsForbidden() *QueryCIDGroupsForbidden {\n\treturn &QueryCIDGroupsForbidden{}\n}", "func (*ListDashboardGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn file_data_proto_rawDescGZIP(), []int{2}\n}", "func (client IdentityClient) listGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/groups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func (ggSession *GreengrassSession) ListGroup(name string) error {\n\tvar id string\n\n\tif name != \"\" {\n\t\tlistOutput, err := ggSession.greengrass.ListGroups(&greengrass.ListGroupsInput{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, v := range listOutput.Groups {\n\t\t\tif name == *v.Name {\n\t\t\t\tid = *v.Id\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"group %s not found\", name)\n\t\t}\n\t} else {\n\t\tid = ggSession.config.Group.ID\n\t}\n\n\tgroup, err := ggSession.greengrass.GetGroup(&greengrass.GetGroupInput{\n\t\tGroupId: &id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group: %v\\n\", group)\n\n\tif group.LatestVersion == nil {\n\t\treturn nil\n\t}\n\n\tgroupVersion, err := ggSession.greengrass.GetGroupVersion(&greengrass.GetGroupVersionInput{\n\t\tGroupId: group.Id,\n\t\tGroupVersionId: group.LatestVersion,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group version: %v\\n\", groupVersion)\n\n\treturn nil\n}", "func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-29\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func GetExclusionGroups(settings *playfab.Settings, postData *GetExclusionGroupsRequestModel, entityToken string) (*GetExclusionGroupsResultModel, error) {\r\n if entityToken == \"\" {\n return nil, playfab.NewCustomError(\"entityToken should not be an empty string\", playfab.ErrorGeneric)\n }\r\n b, errMarshal := json.Marshal(postData)\r\n if errMarshal != nil {\r\n return nil, playfab.NewCustomError(errMarshal.Error(), playfab.ErrorMarshal)\r\n }\r\n\r\n sourceMap, err := playfab.Request(settings, b, \"/Experimentation/GetExclusionGroups\", \"X-EntityToken\", entityToken)\r\n if err != nil {\r\n return nil, err\r\n }\r\n \r\n result := &GetExclusionGroupsResultModel{}\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}", "func ListGroupPath() string {\n\treturn \"/api/group\"\n}", "func (c *MockNetworkSecurityGroupsClient) List(ctx context.Context, resourceGroupName string) ([]network.SecurityGroup, error) {\n\tvar l []network.SecurityGroup\n\tfor _, nsg := range c.NSGs {\n\t\tl = append(l, nsg)\n\t}\n\treturn l, nil\n}", "func NewObjectsListForbidden() *ObjectsListForbidden {\n\n\treturn &ObjectsListForbidden{}\n}", "func Forbidden(message ...interface{}) Err {\n\treturn Boomify(http.StatusForbidden, message...)\n}", "func NewPostVolumeGroupsListDefault(code int) *PostVolumeGroupsListDefault {\n\treturn &PostVolumeGroupsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListIdpGroupMappingsForbidden() *ListIdpGroupMappingsForbidden {\n\treturn &ListIdpGroupMappingsForbidden{}\n}", "func NewUserGroupListBadRequest() *UserGroupListBadRequest {\n\treturn &UserGroupListBadRequest{}\n}", "func (*ListGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{58}\n}", "func NewGetGroupListPublicV1Forbidden() *GetGroupListPublicV1Forbidden {\n\treturn &GetGroupListPublicV1Forbidden{}\n}", "func NewGetIPAMvrfgroupForbidden() *GetIPAMvrfgroupForbidden {\n\treturn &GetIPAMvrfgroupForbidden{}\n}", "func (client *DataCollectionEndpointsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DataCollectionEndpointsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (c *Client) ListProtectionGroups(ctx context.Context, params *ListProtectionGroupsInput, optFns ...func(*Options)) (*ListProtectionGroupsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListProtectionGroupsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListProtectionGroups\", params, optFns, addOperationListProtectionGroupsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListProtectionGroupsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "func NewPcloudPlacementgroupsPostForbidden() *PcloudPlacementgroupsPostForbidden {\n\treturn &PcloudPlacementgroupsPostForbidden{}\n}", "func NewListTeamsForbidden() *ListTeamsForbidden {\n\treturn &ListTeamsForbidden{}\n}", "func NewListGroupsOK() *ListGroupsOK {\n\treturn &ListGroupsOK{}\n}", "func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func Forbidden(msg string) error {\n\treturn &forbiddenError{errors.New(msg)}\n}", "func (client LabClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req,\n\t\tazure.DoRetryWithRegistration(client.Client))\n}", "func (c *Client) ListGroups() ([]string, error) {\n\tvar groups []string\n\tif !c.authenticated {\n\t\treturn groups, errors.New(\"Not authenticated. Call Authenticate first\")\n\t}\n\n\tmsg := common.NewMessage(c.userId, \"server\",\n\t\t\"control\", \"remove_to_group\", time.Time{},\n\t\tcommon.TEXT, \"\")\n\n\tencoded, err := msg.Json()\n\tif err != nil {\n\t\tlog.Println(\"Failed to encode list groups message\", err)\n\t\treturn groups, err\n\t}\n\n\terr = c.transport.SendText(string(encoded))\n\tif err != nil {\n\t\tlog.Println(\"Failed to send list groups message\", err)\n\t\treturn groups, err\n\t}\n\n\tresp := <-c.Out\n\tif resp.Status() == common.STATUS_ERROR {\n\t\terrMsg := resp.Error()\n\t\tlog.Println(\"Delete group response error\", errMsg)\n\t\treturn groups, errors.New(errMsg)\n\t}\n\n\tgroups, _ = resp.GetJsonData(\"groups\").([]string)\n\treturn groups, nil\n}", "func (a *Client) PublicListReasonGroups(params *PublicListReasonGroupsParams, authInfo runtime.ClientAuthInfoWriter) (*PublicListReasonGroupsOK, *PublicListReasonGroupsInternalServerError, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewPublicListReasonGroupsParams()\n\t}\n\n\tif params.Context == nil {\n\t\tparams.Context = context.Background()\n\t}\n\n\tif params.RetryPolicy != nil {\n\t\tparams.SetHTTPClientTransport(params.RetryPolicy)\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"publicListReasonGroups\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/reporting/v1/public/namespaces/{namespace}/reasonGroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &PublicListReasonGroupsReader{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, nil, err\n\t}\n\n\tswitch v := result.(type) {\n\n\tcase *PublicListReasonGroupsOK:\n\t\treturn v, nil, nil\n\n\tcase *PublicListReasonGroupsInternalServerError:\n\t\treturn nil, v, nil\n\n\tdefault:\n\t\treturn nil, nil, fmt.Errorf(\"Unexpected Type %v\", reflect.TypeOf(v))\n\t}\n}", "func (client *DataCollectionEndpointsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DataCollectionEndpointsListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req)\n}", "func CreateExclusionGroup(settings *playfab.Settings, postData *CreateExclusionGroupRequestModel, entityToken string) (*CreateExclusionGroupResultModel, error) {\r\n if entityToken == \"\" {\n return nil, playfab.NewCustomError(\"entityToken should not be an empty string\", playfab.ErrorGeneric)\n }\r\n b, errMarshal := json.Marshal(postData)\r\n if errMarshal != nil {\r\n return nil, playfab.NewCustomError(errMarshal.Error(), playfab.ErrorMarshal)\r\n }\r\n\r\n sourceMap, err := playfab.Request(settings, b, \"/Experimentation/CreateExclusionGroup\", \"X-EntityToken\", entityToken)\r\n if err != nil {\r\n return nil, err\r\n }\r\n \r\n result := &CreateExclusionGroupResultModel{}\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}", "func listGroups(cmd *cobra.Command, args []string) error {\n\tclient, err := getClient()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn nil\n\t}\n\tdefer client.Close()\n\n\tvar matchingGroups map[string]bool\n\tif len(args) != 0 {\n\t\t// Mark all groups mentioned on the command line\n\t\tmatchingGroups = make(map[string]bool, len(args))\n\t\tfor _, g := range args {\n\t\t\tmatchingGroups[g] = true\n\t\t}\n\t}\n\t// Get list of all groups and their roles\n\t_, roleGroups, err := getRoles(cmd, nil, true, client)\n\tif err != nil {\n\t\tfmt.Println(toAPIError(err))\n\t\treturn nil\n\t}\n\n\tgroupMap := make(groupMap)\n\tfor roleName, groups := range roleGroups {\n\t\tfor _, group := range groups {\n\t\t\tif matchingGroups != nil && !matchingGroups[group] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgroupMap[group] = append(groupMap[group], roleName)\n\t\t}\n\t}\n\n\t// Get sorted list of groups\n\tgroups := make([]string, 0, len(groupMap))\n\tfor group := range groupMap {\n\t\tgroups = append(groups, group)\n\t}\n\tsort.Strings(groups)\n\n\t// Display all groups\n\tverbose := viper.GetBool(verboseOpt)\n\tfor _, group := range groups {\n\t\tif verbose {\n\t\t\tfmt.Println(group, \"=\", strings.Join(groupMap[group], \", \"))\n\t\t} else {\n\t\t\tfmt.Println(group)\n\t\t}\n\t}\n\n\treturn nil\n}", "func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CassandraClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-03-15-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client DataControllersClient) ListInGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2019-07-24-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/dataControllers\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WorkspacesListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "func NewListRegistryProviderTypesForbidden() *ListRegistryProviderTypesForbidden {\n\treturn &ListRegistryProviderTypesForbidden{}\n}", "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}", "func (client *ManagedInstancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedInstancesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treqQP.Set(\"api-version\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/azure/compute/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (s *GroupsService) List(opt ...CallOption) ([]*Group, *Response, error) {\n\tgroups, resp, err := listGroup(s.client, \"groups\", opt...)\n\n\treturn groups, resp, err\n}", "func (q *QueryGVR) resourceListInGroup(resourceLists []*metav1.APIResourceList, group string) ([]*metav1.APIResourceList, error) {\n\tvar list []*metav1.APIResourceList\n\tfor _, rscList := range resourceLists {\n\t\tgv, err := schema.ParseGroupVersion(rscList.GroupVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif strings.EqualFold(gv.Group, group) {\n\t\t\tlist = append(list, rscList)\n\t\t}\n\t}\n\treturn list, nil\n}", "func List(c messagebird.Client, options *messagebird.PaginationRequest) (*Groups, error) {\n\tgroupList := &Groups{}\n\tif err := c.Request(groupList, http.MethodGet, path+\"?\"+options.QueryParams(), nil); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groupList, nil\n}", "func (client WorkloadNetworksClient) ListVMGroupsResponder(resp *http.Response) (result WorkloadNetworkVMGroupsList, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func CreateSetDataLevelPermissionWhiteListResponse() (response *SetDataLevelPermissionWhiteListResponse) {\n\tresponse = &SetDataLevelPermissionWhiteListResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func (client *ContainerGroupsClient) listCreateRequest(ctx context.Context, options *ContainerGroupsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (a *IAMApiService) GetGroups(ctx context.Context) (IamGroups, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = http.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue IamGroups\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/acs/api/v1/groups\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\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 IamGroups\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 == 0 {\n\t\t\tvar v IamError\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\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}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/compute/azure/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func CreateListExperimentGroupsResponse() (response *ListExperimentGroupsResponse) {\n\tresponse = &ListExperimentGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func (c *client) GroupListToken(groupName string) ([]sdk.Token, error) {\n\tpath := fmt.Sprintf(\"/group/%s/token\", url.QueryEscape(groupName))\n\n\ttokens := []sdk.Token{}\n\t_, err := c.GetJSON(path, &tokens)\n\n\treturn tokens, err\n}", "func (client *AvailabilityGroupListenersClient) listByGroupCreateRequest(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *AvailabilityGroupListenersClientListByGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners\"\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 sqlVirtualMachineGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter sqlVirtualMachineGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{sqlVirtualMachineGroupName}\", url.PathEscape(sqlVirtualMachineGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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\", \"2022-08-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func NewQueryForbiddenInfoListRequestWithoutParam() *QueryForbiddenInfoListRequest {\n\n return &QueryForbiddenInfoListRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/forbiddenInfo:query\",\n Method: \"POST\",\n Header: nil,\n Version: \"v1\",\n },\n }\n}", "func (client *MetricAlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *MetricAlertsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2018-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (c ApiWrapper) Forbidden(msg string, objs ...interface{}) revel.Result {\n\treturn c.renderErrorString(403, fmt.Sprintf(msg, objs))\n}" ]
[ "0.6481354", "0.63941246", "0.6109768", "0.5942938", "0.5937463", "0.5933636", "0.5757323", "0.5738157", "0.5690592", "0.5634998", "0.5624124", "0.55764693", "0.5573737", "0.5562796", "0.5555221", "0.552152", "0.55055183", "0.5485115", "0.5476348", "0.54459757", "0.54165435", "0.54130036", "0.5411465", "0.53728276", "0.5366386", "0.53641224", "0.53616637", "0.53584856", "0.5357241", "0.53430027", "0.53415877", "0.533345", "0.53247714", "0.5318445", "0.53100884", "0.5309202", "0.5308899", "0.5308203", "0.5267075", "0.5261613", "0.5250847", "0.5241561", "0.52276933", "0.5222303", "0.521699", "0.521699", "0.52080864", "0.5205452", "0.5174263", "0.5172919", "0.5172206", "0.5169416", "0.51677793", "0.5166503", "0.51655996", "0.5161141", "0.51603234", "0.5159927", "0.5157961", "0.515396", "0.51498365", "0.5142708", "0.51362026", "0.51300776", "0.51254594", "0.51104915", "0.509762", "0.5091556", "0.50880456", "0.5087654", "0.507986", "0.5075829", "0.5070557", "0.5068948", "0.50687605", "0.5062787", "0.50625014", "0.5061388", "0.50611514", "0.5058161", "0.50567573", "0.5056225", "0.5053482", "0.5048256", "0.50433457", "0.50388706", "0.50341177", "0.5032854", "0.5031695", "0.5028354", "0.50252914", "0.5022048", "0.50179756", "0.50165874", "0.5014623", "0.50027263", "0.49973196", "0.49960735", "0.49859577", "0.4982028" ]
0.7673657
0
NewListGroupsNotFound creates a ListGroupsNotFound with default headers values
NewListGroupsNotFound создает ListGroupsNotFound с значениями заголовков по умолчанию
func NewListGroupsNotFound() *ListGroupsNotFound { return &ListGroupsNotFound{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListGroupsDefault(code int) *ListGroupsDefault {\n\treturn &ListGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListGroupsBadRequest() *ListGroupsBadRequest {\n\treturn &ListGroupsBadRequest{}\n}", "func NewGetHostGroupsNotFound() *GetHostGroupsNotFound {\n\treturn &GetHostGroupsNotFound{}\n}", "func NewGetAllGroupsNotFound() *GetAllGroupsNotFound {\n\n\treturn &GetAllGroupsNotFound{}\n}", "func TestGroupDataSource_DoesNotSwallowListGroupError(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tprojectID := uuid.New()\n\tresourceData := createResourceData(t, projectID.String(), \"group-name\")\n\n\tgraphClient := azdosdkmocks.NewMockGraphClient(ctrl)\n\tclients := &client.AggregatedClient{GraphClient: graphClient, Ctx: context.Background()}\n\n\texpectedProjectDescriptorLookupArgs := graph.GetDescriptorArgs{StorageKey: &projectID}\n\tprojectDescriptor := converter.String(\"descriptor\")\n\tprojectDescriptorResponse := graph.GraphDescriptorResult{Value: projectDescriptor}\n\tgraphClient.\n\t\tEXPECT().\n\t\tGetDescriptor(clients.Ctx, expectedProjectDescriptorLookupArgs).\n\t\tReturn(&projectDescriptorResponse, nil)\n\n\texpectedListGroupArgs := graph.ListGroupsArgs{ScopeDescriptor: projectDescriptor}\n\tgraphClient.\n\t\tEXPECT().\n\t\tListGroups(clients.Ctx, expectedListGroupArgs).\n\t\tReturn(nil, errors.New(\"ListGroups() Failed\"))\n\n\terr := dataSourceGroupRead(resourceData, clients)\n\trequire.Contains(t, err.Error(), \"ListGroups() Failed\")\n}", "func NewNotFound(name, group, resource string) error {\n\treturn errors.NewNotFound(schema.GroupResource{Group: group, Resource: resource}, name)\n}", "func NewGetGroupsByDisplayNameUsingGETNotFound() *GetGroupsByDisplayNameUsingGETNotFound {\n\treturn &GetGroupsByDisplayNameUsingGETNotFound{}\n}", "func NewGetHostGroupsDefault(code int) *GetHostGroupsDefault {\n\treturn &GetHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewUpdateHostGroupsNotFound() *UpdateHostGroupsNotFound {\n\treturn &UpdateHostGroupsNotFound{}\n}", "func (c *DefaultIdentityProvider) ListGroups(ctx context.Context, options *metainternal.ListOptions) (*auth.GroupList, error) {\n\tkeyword := \"\"\n\tlimit := 50\n\tif options.FieldSelector != nil {\n\t\tkeyword, _ = options.FieldSelector.RequiresExactMatch(auth.KeywordQueryTag)\n\t\tlimitStr, _ := options.FieldSelector.RequiresExactMatch(auth.QueryLimitTag)\n\t\tif li, err := strconv.Atoi(limitStr); err == nil && li > 0 {\n\t\t\tlimit = li\n\t\t}\n\t}\n\n\t_, tenantID := authentication.GetUsernameAndTenantID(ctx)\n\tif tenantID != \"\" && tenantID != c.tenantID {\n\t\treturn nil, apierrors.NewBadRequest(\"must in the same tenant\")\n\t}\n\n\tallList, err := c.localGroupLister.List(labels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar localGroupList []*authv1.LocalGroup\n\tfor i, item := range allList {\n\t\tif item.Spec.TenantID == c.tenantID {\n\t\t\tlocalGroupList = append(localGroupList, allList[i])\n\t\t}\n\t}\n\n\tif keyword != \"\" {\n\t\tvar newList []*authv1.LocalGroup\n\t\tfor i, val := range localGroupList {\n\t\t\tif strings.Contains(val.Name, keyword) || strings.Contains(val.Spec.DisplayName, keyword) {\n\t\t\t\tnewList = append(newList, localGroupList[i])\n\t\t\t}\n\t\t}\n\t\tlocalGroupList = newList\n\t}\n\n\titems := localGroupList[0:min(len(localGroupList), limit)]\n\n\tgroupList := auth.GroupList{}\n\tfor _, item := range items {\n\t\tgroup := convertToGroup(item)\n\t\tgroupList.Items = append(groupList.Items, group)\n\t}\n\n\treturn &groupList, nil\n}", "func getGroups(w http.ResponseWriter, r *http.Request) {\n InitResponse(&w)\n if r.Method == \"OPTIONS\" {return}\n\n allow, _ := HasPermission(&w, r, CoreGroupModuleID, CoreAccessRead)\n if !allow {\n w.WriteHeader(http.StatusUnauthorized)\n json.NewEncoder(w).Encode(&CoreMessage{\n Message: \"Not authorized!\",\n })\n return\n }\n\n groups := []CoreGroup{}\n\n err := Db.Model(&groups).Select()\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n return\n }\n\n w.WriteHeader(http.StatusOK)\n json.NewEncoder(w).Encode(groups)\n}", "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}", "func (ggSession *GreengrassSession) ListGroup(name string) error {\n\tvar id string\n\n\tif name != \"\" {\n\t\tlistOutput, err := ggSession.greengrass.ListGroups(&greengrass.ListGroupsInput{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, v := range listOutput.Groups {\n\t\t\tif name == *v.Name {\n\t\t\t\tid = *v.Id\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"group %s not found\", name)\n\t\t}\n\t} else {\n\t\tid = ggSession.config.Group.ID\n\t}\n\n\tgroup, err := ggSession.greengrass.GetGroup(&greengrass.GetGroupInput{\n\t\tGroupId: &id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group: %v\\n\", group)\n\n\tif group.LatestVersion == nil {\n\t\treturn nil\n\t}\n\n\tgroupVersion, err := ggSession.greengrass.GetGroupVersion(&greengrass.GetGroupVersionInput{\n\t\tGroupId: group.Id,\n\t\tGroupVersionId: group.LatestVersion,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group version: %v\\n\", groupVersion)\n\n\treturn nil\n}", "func NewGetUniverseGroupsGroupIDNotFound() *GetUniverseGroupsGroupIDNotFound {\n\treturn &GetUniverseGroupsGroupIDNotFound{}\n}", "func NewPostVolumeGroupsListDefault(code int) *PostVolumeGroupsListDefault {\n\treturn &PostVolumeGroupsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGetCustomerGroupsNotFound() *GetCustomerGroupsNotFound {\n\treturn &GetCustomerGroupsNotFound{}\n}", "func (o *ListGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func NewListServerGroupBadRequest() *ListServerGroupBadRequest {\n\treturn &ListServerGroupBadRequest{}\n}", "func NewUpdateHostGroupsDefault(code int) *UpdateHostGroupsDefault {\n\treturn &UpdateHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListGroupsOK() *ListGroupsOK {\n\treturn &ListGroupsOK{}\n}", "func TestGroupDataSource_DoesNotSwallowProjectDescriptorLookupError_NotFound(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tprojectID := uuid.New()\n\tresourceData := createResourceData(t, projectID.String(), \"group-name\")\n\n\tgraphClient := azdosdkmocks.NewMockGraphClient(ctrl)\n\tclients := &client.AggregatedClient{GraphClient: graphClient, Ctx: context.Background()}\n\n\texpectedArgs := graph.GetDescriptorArgs{StorageKey: &projectID}\n\tgraphClient.\n\t\tEXPECT().\n\t\tGetDescriptor(clients.Ctx, expectedArgs).\n\t\tReturn(nil, azuredevops.WrappedError{\n\t\t\tStatusCode: converter.Int(404),\n\t\t})\n\n\terr := dataSourceGroupRead(resourceData, clients)\n\trequire.Contains(t, err.Error(), \"was not found\")\n}", "func (client WorkloadNetworksClient) ListVMGroupsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"privateCloudName\": autorest.Encode(\"path\", privateCloudName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2020-07-17-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (a *GroupsOnenoteNotebooksSectionGroupApiService) GroupsOnenoteNotebooksSectionGroupsListSectionGroups(ctx _context.Context, groupId string, notebookId string, sectionGroupId string, localVarOptionals *GroupsOnenoteNotebooksSectionGroupsListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/notebooks({notebook-id})/sectionGroups({sectionGroup-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"notebook-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", notebookId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func NewListIdpGroupMappingsDefault(code int) *ListIdpGroupMappingsDefault {\n\treturn &ListIdpGroupMappingsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *GroupController) List(ctx *app.ListGroupContext) error {\n\t// GroupController_List: start_implement\n\n\tdataStore := &dal.DataStore{}\n\tdataStore.GetSession()\n\t// Close the session\n\tdefer dataStore.Close()\n\tdc := dal.NewDalGroup(dataStore)\n\n\tgroups, err := dc.FetchAll()\n\n\tif err != nil {\n\t\tctx.ResponseData.Service.LogError(\"InternalServerError\", \"req_id\", middleware.ContextRequestID(ctx), \"ctrl\", \"Group\", \"action\", \"List\", ctx.RequestData.Request.Method, ctx.RequestData.Request.URL, \"databaseError\", err.Error())\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tres := make(app.GwentapiGroupCollection, len(*groups))\n\n\tlastModified := time.Time{}\n\tfor i, group := range *groups {\n\t\tg, _ := factory.CreateGroup(&group)\n\n\t\tif lastModified.Before(group.Last_Modified) {\n\t\t\tlastModified = group.Last_Modified\n\t\t}\n\n\t\tres[i] = g\n\t}\n\n\t// GroupController_List: end_implement\n\thelpers.LastModified(ctx.ResponseData, lastModified)\n\tif ctx.IfModifiedSince != nil {\n\t\tif !helpers.IsModified(*ctx.IfModifiedSince, lastModified) {\n\t\t\treturn ctx.NotModified()\n\t\t}\n\t}\n\treturn ctx.OK(res)\n}", "func NewGetGroupMembersListV1NotFound() *GetGroupMembersListV1NotFound {\n\treturn &GetGroupMembersListV1NotFound{}\n}", "func NewErrGroupNotFound(groupUUID string) ErrGroupNotFound {\n\treturn ErrGroupNotFound{groupUUID: groupUUID}\n}", "func (l *GroupLookup) newKeyGroup(entries []groupKeyListElement) *groupKeyList {\n\tid := l.nextID\n\tl.nextID++\n\treturn &groupKeyList{\n\t\tid: id,\n\t\telements: entries,\n\t}\n}", "func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListGroupsResponse\")\n\t}\n\treturn\n}", "func (a *Client) PublicListReasonGroups(params *PublicListReasonGroupsParams, authInfo runtime.ClientAuthInfoWriter) (*PublicListReasonGroupsOK, *PublicListReasonGroupsInternalServerError, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewPublicListReasonGroupsParams()\n\t}\n\n\tif params.Context == nil {\n\t\tparams.Context = context.Background()\n\t}\n\n\tif params.RetryPolicy != nil {\n\t\tparams.SetHTTPClientTransport(params.RetryPolicy)\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"publicListReasonGroups\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/reporting/v1/public/namespaces/{namespace}/reasonGroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &PublicListReasonGroupsReader{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, nil, err\n\t}\n\n\tswitch v := result.(type) {\n\n\tcase *PublicListReasonGroupsOK:\n\t\treturn v, nil, nil\n\n\tcase *PublicListReasonGroupsInternalServerError:\n\t\treturn nil, v, nil\n\n\tdefault:\n\t\treturn nil, nil, fmt.Errorf(\"Unexpected Type %v\", reflect.TypeOf(v))\n\t}\n}", "func DefaultGroups(clusterName, addonName string) []string {\n\treturn []string{\n\t\tfmt.Sprintf(\"system:open-cluster-management:cluster:%s:addon:%s\", clusterName, addonName),\n\t\tfmt.Sprintf(\"system:open-cluster-management:addon:%s\", addonName),\n\t\t\"system:authenticated\",\n\t}\n}", "func (client DataControllersClient) ListInGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2019-07-24-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/dataControllers\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func NewGetUsergroupsGroupIDNotFound() *GetUsergroupsGroupIDNotFound {\n\treturn &GetUsergroupsGroupIDNotFound{}\n}", "func NewListGroupsForbidden() *ListGroupsForbidden {\n\treturn &ListGroupsForbidden{}\n}", "func NewGetNicsNotFound() *GetNicsNotFound {\n\treturn &GetNicsNotFound{}\n}", "func (a *GroupsOnenoteNotebooksSectionGroupApiService) GroupsOnenoteNotebooksListSectionGroups(ctx _context.Context, groupId string, notebookId string, localVarOptionals *GroupsOnenoteNotebooksListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/notebooks({notebook-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"notebook-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", notebookId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func GetDefaultGroups(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *DefaultGroupsState, opts ...pulumi.ResourceOption) (*DefaultGroups, error) {\n\tvar resource DefaultGroups\n\terr := ctx.ReadResource(\"keycloak:index/defaultGroups:DefaultGroups\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewPcloudVolumegroupsGetNotFound() *PcloudVolumegroupsGetNotFound {\n\treturn &PcloudVolumegroupsGetNotFound{}\n}", "func NewGetCustomObjectDefinitionsByIDAttributeGroupsByIDNotFound() *GetCustomObjectDefinitionsByIDAttributeGroupsByIDNotFound {\n\treturn &GetCustomObjectDefinitionsByIDAttributeGroupsByIDNotFound{}\n}", "func NewGroups(filename string, bad BadLineHandler) (*HTGroup, error) {\n\thtGroup := HTGroup{\n\t\tfilePath: filename,\n\t}\n\treturn &htGroup, htGroup.ReloadGroups(bad)\n}", "func (db *MySQLDB) ListGroups(ctx context.Context, tenant *Tenant, request *helper.PageRequest) ([]*Group, *helper.Page, error) {\n\tfLog := mysqlLog.WithField(\"func\", \"ListGroups\").WithField(\"RequestID\", ctx.Value(constants.RequestID))\n\tq := \"SELECT COUNT(*) AS CNT FROM HANSIP_GROUP\"\n\tret := make([]*Group, 0)\n\trow := db.instance.QueryRowContext(ctx, q)\n\tcount := 0\n\terr := row.Scan(&count)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn ret, helper.NewPage(request, uint(count)), nil\n\t\t}\n\t\tfLog.Errorf(\"row.Scan got %s\", err.Error())\n\t\treturn nil, nil, &ErrDBScanError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tpage := helper.NewPage(request, uint(count))\n\tq = fmt.Sprintf(\"SELECT REC_ID, GROUP_NAME, GROUP_DOMAIN, DESCRIPTION FROM HANSIP_GROUP WHERE GROUP_DOMAIN=? ORDER BY GROUP_NAME %s LIMIT %d, %d\", request.Sort, page.OffsetStart, page.OffsetEnd-page.OffsetStart)\n\trows, err := db.instance.QueryContext(ctx, q, tenant.Domain)\n\tif err != nil {\n\t\tfLog.Errorf(\"db.instance.QueryContext got %s. SQL = %s\", err.Error(), q)\n\t\treturn nil, nil, &ErrDBQueryError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tr := &Group{}\n\t\terr := rows.Scan(&r.RecID, &r.GroupName, &r.GroupDomain, &r.Description)\n\t\tif err != nil {\n\t\t\tfLog.Warnf(\"row.Scan got %s\", err.Error())\n\t\t\treturn nil, nil, &ErrDBScanError{\n\t\t\t\tWrapped: err,\n\t\t\t\tMessage: \"Error ListGroups\",\n\t\t\t\tSQL: q,\n\t\t\t}\n\t\t} else {\n\t\t\tret = append(ret, r)\n\t\t}\n\t}\n\treturn ret, page, nil\n}", "func NewListIdpGroupMappingsNotFound() *ListIdpGroupMappingsNotFound {\n\treturn &ListIdpGroupMappingsNotFound{}\n}", "func NewSetRoleGroupsNotFound() *SetRoleGroupsNotFound {\n\treturn &SetRoleGroupsNotFound{}\n}", "func ListUserGroup(w http.ResponseWriter, r *http.Request) {\n\tfLog := userMgmtLogger.WithField(\"func\", \"ListUserGroup\").WithField(\"RequestID\", r.Context().Value(constants.RequestID)).WithField(\"path\", r.URL.Path).WithField(\"method\", r.Method)\n\n\tiauthctx := r.Context().Value(constants.HansipAuthentication)\n\tif iauthctx == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusUnauthorized, \"You are not authorized to access this resource\", nil, nil)\n\t\treturn\n\t}\n\n\tparams, err := helper.ParsePathParams(fmt.Sprintf(\"%s/management/user/{userRecId}/groups\", apiPrefix), r.URL.Path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuser, err := UserRepo.GetUserByRecID(r.Context(), params[\"userRecId\"])\n\tif err != nil {\n\t\tfLog.Errorf(\"UserRepo.GetUserByRecID got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tif user == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusNotFound, fmt.Sprintf(\"User recid %s not found\", params[\"userRecId\"]), nil, nil)\n\t\treturn\n\t}\n\n\tpageRequest, err := helper.NewPageRequestFromRequest(r)\n\tif err != nil {\n\t\tfLog.Errorf(\"helper.NewPageRequestFromRequest got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusBadRequest, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tgroups, page, err := UserGroupRepo.ListUserGroupByUser(r.Context(), user, pageRequest)\n\tif err != nil {\n\t\tfLog.Errorf(\"UserGroupRepo.ListUserGroupByUser got %s\", err.Error())\n\t}\n\tsgroups := make([]*SimpleGroup, len(groups))\n\tfor k, v := range groups {\n\t\tsgroups[k] = &SimpleGroup{\n\t\t\tRecID: v.RecID,\n\t\t\tGroupName: v.GroupName,\n\t\t}\n\t}\n\tret := make(map[string]interface{})\n\tret[\"groups\"] = sgroups\n\tret[\"page\"] = page\n\thelper.WriteHTTPResponse(r.Context(), w, http.StatusOK, \"List of groups paginated\", nil, ret)\n}", "func NewGetGroupsByDisplayNameUsingGETUnauthorized() *GetGroupsByDisplayNameUsingGETUnauthorized {\n\treturn &GetGroupsByDisplayNameUsingGETUnauthorized{}\n}", "func NewListByReferenceNotFound(body *ListByReferenceNotFoundResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func NewAddServerGroupNotFound() *AddServerGroupNotFound {\n\treturn &AddServerGroupNotFound{}\n}", "func (s *GroupsService) List(ctx context.Context, opts *PagingOptions) (*GroupList, error) {\n\tquery := addPaging(url.Values{}, opts)\n\treq, err := s.Client.NewRequest(ctx, http.MethodGet, newURI(groupsURI), WithQuery(query))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\tres, resp, err := s.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\n\tif resp != nil && resp.StatusCode == http.StatusNotFound {\n\t\treturn nil, ErrNotFound\n\t}\n\n\tg := &GroupList{\n\t\tGroups: []*Group{},\n\t}\n\tif err := json.Unmarshal(res, g); err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed, unable to unmarshal repository list json: , %w\", err)\n\t}\n\n\tfor _, r := range g.GetGroups() {\n\t\tr.Session.set(resp)\n\t}\n\n\treturn g, nil\n}", "func NewGetIPAMvrfgroupNotFound() *GetIPAMvrfgroupNotFound {\n\treturn &GetIPAMvrfgroupNotFound{}\n}", "func NewGroup(dataframe *DataFrame, columns ...string) *Groups {\n\t// ret := &Groups{Columns: []string{}, Grouper: columns, Group: make(map[types.C][]indices.Index), Df: dataframe}\n\tret := &Groups{Keys: []Keys{}, Columns: []string{}, Grouper: columns, Group: make(map[types.C][]indices.Index), Df: dataframe}\n\n\treturn ret\n}", "func (a *GroupsOnenotePagesNotebookApiService) GroupsOnenotePagesParentNotebookSectionGroupsListSectionGroups(ctx _context.Context, groupId string, onenotePageId string, sectionGroupId string, localVarOptionals *GroupsOnenotePagesParentNotebookSectionGroupsListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/pages({onenotePage-id})/parentNotebook/sectionGroups({sectionGroup-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenotePage-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenotePageId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func (op *ListOp) NotGroupID(val string) *ListOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"not_group_id\", val)\n\t}\n\treturn op\n}", "func newRouteGroups(c *ZalandoV1Client, namespace string) *routeGroups {\n\treturn &routeGroups{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "func NewGetGroupMembersListPublicV1NotFound() *GetGroupMembersListPublicV1NotFound {\n\treturn &GetGroupMembersListPublicV1NotFound{}\n}", "func (a *MeOnenoteSectionsNotebookApiService) MeOnenoteSectionsParentNotebookSectionGroupsListSectionGroups(ctx _context.Context, onenoteSectionId string, sectionGroupId string, localVarOptionals *MeOnenoteSectionsParentNotebookSectionGroupsListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/me/onenote/sections({onenoteSection-id})/parentNotebook/sectionGroups({sectionGroup-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenoteSection-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenoteSectionId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func handleGetGroups(c *Context, w http.ResponseWriter, r *http.Request) {\n\tpaging, err := parsePaging(r.URL)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse paging parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\twithInstallationCount, err := parseBool(r.URL, model.ShowInstallationCountQueryParameter, false)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to parse request parameters\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tfilter := &model.GroupFilter{\n\t\tPaging: paging,\n\t\tWithInstallationCount: withInstallationCount,\n\t}\n\n\tgroups, err := c.Store.GetGroupDTOs(filter)\n\tif err != nil {\n\t\tc.Logger.WithError(err).Error(\"failed to query groups\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif groups == nil {\n\t\tgroups = []*model.GroupDTO{}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\toutputJSON(c, w, groups)\n}", "func (client IdentityClient) ListDynamicGroups(ctx context.Context, request ListDynamicGroupsRequest) (response ListDynamicGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listDynamicGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListDynamicGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListDynamicGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListDynamicGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListDynamicGroupsResponse\")\n\t}\n\treturn\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func GetMissingSecGroup(sliceSource, sliceToInspect []models.SecurityGroupFields) []models.SecurityGroupFields {\n\telementsNotFound := make([]models.SecurityGroupFields, 0)\n\tfor _, elt := range sliceSource {\n\t\tif !containsSecGroup(sliceToInspect, elt) {\n\t\t\telementsNotFound = append(elementsNotFound, elt)\n\t\t}\n\t}\n\treturn elementsNotFound\n}", "func NewQueryUserGroupsDefault(code int) *QueryUserGroupsDefault {\n\treturn &QueryUserGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func GetNonMemberGroupsHandler(c *gin.Context) {\n\tphonenr := c.Param(\"number\")\n\tnumber, _ := strconv.Atoi(phonenr)\n\tvar groups = GetNonMemberGroups(number)\n\tc.JSON(http.StatusAccepted, groups)\n}", "func NewListByPathNotFound(body *ListByPathNotFoundResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func NewListByPathNotFound(body *ListByPathNotFoundResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "func NewAddNamespaceToGroupNotFound() *AddNamespaceToGroupNotFound {\n\n\treturn &AddNamespaceToGroupNotFound{}\n}", "func (a *GroupsOnenotePagesNotebookApiService) GroupsOnenotePagesParentNotebookSectionsParentSectionGroupListSectionGroups(ctx _context.Context, groupId string, onenotePageId string, onenoteSectionId string, localVarOptionals *GroupsOnenotePagesParentNotebookSectionsParentSectionGroupListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/pages({onenotePage-id})/parentNotebook/sections({onenoteSection-id})/parentSectionGroup/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenotePage-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenotePageId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenoteSection-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenoteSectionId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func NewGetSystemObjectDefinitionsByIDAttributeGroupsNotFound() *GetSystemObjectDefinitionsByIDAttributeGroupsNotFound {\n\treturn &GetSystemObjectDefinitionsByIDAttributeGroupsNotFound{}\n}", "func (a *SitesOnenotePagesNotebookApiService) SitesOnenotePagesParentNotebookSectionGroupsListSectionGroups(ctx _context.Context, siteId string, onenotePageId string, sectionGroupId string, localVarOptionals *SitesOnenotePagesParentNotebookSectionGroupsListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/sites({site-id})/onenote/pages({onenotePage-id})/parentNotebook/sectionGroups({sectionGroup-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"site-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", siteId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenotePage-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenotePageId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func NewGetHostGroupsBadRequest() *GetHostGroupsBadRequest {\n\treturn &GetHostGroupsBadRequest{}\n}", "func findHostGroups(hg *defs, td *defs, hOffset hostOffset) hostgroupOffset {\n hgrpOffset := newHostGroupOffset()\n hostnameExcl := \"!\"+hOffset.GetHostName()\n for idx,def := range *hg {\n if def.attrExist(\"members\"){\n if def[\"members\"].RegexHas(hOffset.GetHostName()) && !hgrpOffset.members.Has(idx) {\n hgrpOffset.members.Add(idx)\n findHostGroupMembership(hg, idx, *hgrpOffset)\n } else if def[\"members\"].Has(hostnameExcl) && !hgrpOffset.membersExcl.Has(idx) {\n hgrpOffset.membersExcl.Add(idx)\n }\n }\n }\n // hostgroups from host obj definition(include host template)\n for _, hgrp := range hOffset.GetEnabledHostgroupsName(){\n hgrp := strings.TrimLeft(hgrp,\"+\")\n findHostGroupMembership(hg, hgrp, *hgrpOffset)\n }\n // set enabled hostgroups\n (*hgrpOffset).SetEnabledDisabledHostgroups()\n // add hostgroups extracted from host obj definition to hostgroups list in the hostgroupOffset\n hOffset.SetEnabledHostgroups(hgrpOffset)\n return *hgrpOffset\n}", "func TestListIamGroups(t *testing.T) {\n\tt.Parallel()\n\n\tregion, err := getRandomRegion()\n\trequire.NoError(t, err)\n\n\tlocalSession, err := session.NewSession(&awsgo.Config{\n\t\tRegion: awsgo.String(region),\n\t})\n\trequire.NoError(t, err)\n\n\tgroupNames, err := getAllIamGroups(localSession, time.Now(), config.Config{})\n\trequire.NoError(t, err)\n\tassert.NotEmpty(t, groupNames)\n}", "func (a *IAMApiService) GetGroups(ctx context.Context) (IamGroups, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = http.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue IamGroups\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/acs/api/v1/groups\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\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 IamGroups\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 == 0 {\n\t\t\tvar v IamError\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\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}", "func (a *GroupsOnenotePagesOnenoteSectionApiService) GroupsOnenotePagesParentSectionParentNotebookSectionGroupsListSectionGroups(ctx _context.Context, groupId string, onenotePageId string, sectionGroupId string, localVarOptionals *GroupsOnenotePagesParentSectionParentNotebookSectionGroupsListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/pages({onenotePage-id})/parentSection/parentNotebook/sectionGroups({sectionGroup-id})/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenotePage-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenotePageId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func (a *HyperflexApiService) GetHyperflexInitiatorGroupList(ctx context.Context) ApiGetHyperflexInitiatorGroupListRequest {\n\treturn ApiGetHyperflexInitiatorGroupListRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "func NewUpdateBugfieldTemplateGroupNotFound() *UpdateBugfieldTemplateGroupNotFound {\n\treturn &UpdateBugfieldTemplateGroupNotFound{}\n}", "func NewUserGroupListBadRequest() *UserGroupListBadRequest {\n\treturn &UserGroupListBadRequest{}\n}", "func NewGetGroupBackupNotFound() *GetGroupBackupNotFound {\n\treturn &GetGroupBackupNotFound{}\n}", "func NewSingleAdminGetGroupNotFound() *SingleAdminGetGroupNotFound {\n\treturn &SingleAdminGetGroupNotFound{}\n}", "func NewAddEventLoopGroupNotFound() *AddEventLoopGroupNotFound {\n\treturn &AddEventLoopGroupNotFound{}\n}", "func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-08\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func findHostGroupMembership(d *defs, hgName string, hgrpOffset hostgroupOffset) {\n hostgroupNameExcl := fmt.Sprintf(\"!%v\",hgName)\n hgrpExist := false\n for idx, def := range *d {\n if def[\"hostgroup_name\"].ToString() == hgName {\n hgrpExist = true\n }\n if def.attrExist(\"hostgroup_members\"){\n if def[\"hostgroup_members\"].Has(hgName) && !hgrpOffset.hostgroupMembers.Has(idx){\n hgrpOffset.hostgroupMembers.Add(idx)\n findHostGroupMembership(d, idx, hgrpOffset)\n // I dont think you can exclude hostgroup in hostgroup object definition\n // this could be removed if the above is true 100%\n } else if def[\"hostgroup_members\"].Has(hostgroupNameExcl) && !hgrpOffset.hostgroupMembers.Has(idx){\n hgrpOffset.hostgroupMembersExcl.Add(idx)\n }\n }\n }\n if !hgrpExist {\n fmt.Println(\"warning, hostgroup does not exist\", hgName)\n }\n}", "func (o *PostVolumeGroupsListDefault) Code() int {\n\treturn o._statusCode\n}", "func NewListIssueGroupOfProjectVersionParams() *ListIssueGroupOfProjectVersionParams {\n\tvar (\n\t\tlimitDefault = int32(200)\n\t\tshowhiddenDefault = bool(false)\n\t\tshowremovedDefault = bool(false)\n\t\tshowshortfilenamesDefault = bool(false)\n\t\tshowsuppressedDefault = bool(false)\n\t\tstartDefault = int32(0)\n\t)\n\treturn &ListIssueGroupOfProjectVersionParams{\n\t\tLimit: &limitDefault,\n\t\tShowhidden: &showhiddenDefault,\n\t\tShowremoved: &showremovedDefault,\n\t\tShowshortfilenames: &showshortfilenamesDefault,\n\t\tShowsuppressed: &showsuppressedDefault,\n\t\tStart: &startDefault,\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "func NewGroup(ctx context.Context) *errGroup {\n\tnewCtx, cancel := context.WithCancel(ctx)\n\treturn &errGroup{\n\t\tctx: newCtx,\n\t\tcancel: cancel,\n\t}\n}", "func (m *AccessPackage) SetIncompatibleGroups(value []Groupable)() {\n m.incompatibleGroups = value\n}", "func (me *XsdGoPkgHasElem_DefaultResponseGroupssequenceTxsdOperationInformationOperationInformationschema_DefaultResponseGroups_TxsdOperationInformationSequenceDefaultResponseGroups_) Walk() (err error) {\n\tif fn := WalkHandlers.XsdGoPkgHasElem_DefaultResponseGroupssequenceTxsdOperationInformationOperationInformationschema_DefaultResponseGroups_TxsdOperationInformationSequenceDefaultResponseGroups_; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.DefaultResponseGroups.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "func (client LabClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, orderBy string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2015-05-21-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\tif len(filter) > 0 {\n\t\tqueryParameters[\"$filter\"] = autorest.Encode(\"query\", filter)\n\t}\n\tif top != nil {\n\t\tqueryParameters[\"$top\"] = autorest.Encode(\"query\", *top)\n\t}\n\tif len(orderBy) > 0 {\n\t\tqueryParameters[\"$orderBy\"] = autorest.Encode(\"query\", orderBy)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func NewGetUsergroupsGroupIDBadRequest() *GetUsergroupsGroupIDBadRequest {\n\treturn &GetUsergroupsGroupIDBadRequest{}\n}", "func (client *ContainerGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerGroupsClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups\"\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\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *Client) ListResourceGroupsWithOptions(request *ListResourceGroupsRequest, runtime *util.RuntimeOptions) (_result *ListResourceGroupsResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\tquery := map[string]interface{}{}\n\tif !tea.BoolValue(util.IsUnset(request.DisplayName)) {\n\t\tquery[\"DisplayName\"] = request.DisplayName\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.IncludeTags)) {\n\t\tquery[\"IncludeTags\"] = request.IncludeTags\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Name)) {\n\t\tquery[\"Name\"] = request.Name\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageNumber)) {\n\t\tquery[\"PageNumber\"] = request.PageNumber\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.PageSize)) {\n\t\tquery[\"PageSize\"] = request.PageSize\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupId)) {\n\t\tquery[\"ResourceGroupId\"] = request.ResourceGroupId\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.ResourceGroupIds)) {\n\t\tquery[\"ResourceGroupIds\"] = request.ResourceGroupIds\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Status)) {\n\t\tquery[\"Status\"] = request.Status\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.Tag)) {\n\t\tquery[\"Tag\"] = request.Tag\n\t}\n\n\treq := &openapi.OpenApiRequest{\n\t\tQuery: openapiutil.Query(query),\n\t}\n\tparams := &openapi.Params{\n\t\tAction: tea.String(\"ListResourceGroups\"),\n\t\tVersion: tea.String(\"2020-03-31\"),\n\t\tProtocol: tea.String(\"HTTPS\"),\n\t\tPathname: tea.String(\"/\"),\n\t\tMethod: tea.String(\"POST\"),\n\t\tAuthType: tea.String(\"AK\"),\n\t\tStyle: tea.String(\"RPC\"),\n\t\tReqBodyType: tea.String(\"formData\"),\n\t\tBodyType: tea.String(\"json\"),\n\t}\n\t_result = &ListResourceGroupsResponse{}\n\t_body, _err := client.CallApi(params, req, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "func CreateDefaultGroup(db *gorp.DbMap, groupName string) error {\n\tquery := `SELECT id FROM \"group\" where name = $1`\n\tvar id int64\n\tif err := db.QueryRow(query, groupName).Scan(&id); err == sql.ErrNoRows {\n\t\tlog.Debug(\"CreateDefaultGroup> create %s group in DB\", groupName)\n\t\tquery = `INSERT INTO \"group\" (name) VALUES ($1)`\n\t\tif _, err := db.Exec(query, groupName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func (l *GroupLookup) createOrSetInGroup(index int, key flux.GroupKey, value interface{}) {\n\t// If this index is at -1, then we are inserting a value with a smaller key\n\t// than every group and we need to create a new group to insert it at the\n\t// beginning.\n\tif index == -1 {\n\t\tl.groups = append(l.groups, nil)\n\t\tcopy(l.groups[1:], l.groups[:])\n\t\tl.groups[0] = l.newKeyGroup([]groupKeyListElement{\n\t\t\t{key: key, value: value},\n\t\t})\n\t\tl.lastIndex = 0\n\t\treturn\n\t}\n\n\tkg := l.groups[index]\n\n\t// Find the location where this should be inserted.\n\ti := kg.InsertAt(key)\n\n\t// If this should be inserted after the last element, do it and leave.\n\tif i == len(kg.elements) {\n\t\tkg.elements = append(kg.elements, groupKeyListElement{\n\t\t\tkey: key,\n\t\t\tvalue: value,\n\t\t})\n\t\treturn\n\t} else if kg.elements[i].key.Equal(key) {\n\t\t// If the entry already exists at this index, set the value.\n\t\tkg.set(i, value)\n\t\treturn\n\t}\n\n\t// We have to split this entry into two new elements. First, we start\n\t// by creating space for the new entry.\n\tl.groups = append(l.groups, nil)\n\tcopy(l.groups[index+2:], l.groups[index+1:])\n\t// Construct the new group entry and copy the end of the slice\n\t// into the new key group.\n\tl.groups[index+1] = func() *groupKeyList {\n\t\t// TODO(rockstar): A nice optimization here would be to prevent\n\t\t// the deleted items from being copied. However, this entire function\n\t\t// needs to be refactored to support that, as it's possible that *all*\n\t\t// the elements have been deleted, so no split is needed.\n\t\t// Moving currently deleted elements out of this key group, the deleted\n\t\t// count must be decremented.\n\t\tfor _, item := range kg.elements[i:] {\n\t\t\tif item.deleted {\n\t\t\t\tkg.deleted--\n\t\t\t}\n\t\t}\n\n\t\tentries := make([]groupKeyListElement, len(kg.elements[i:]))\n\t\tcopy(entries, kg.elements[i:])\n\n\t\treturn l.newKeyGroup(entries)\n\t}()\n\t// Use a slice on the key group elements to remove the extra elements.\n\t// Then append the new key group entry.\n\tkg.elements = kg.elements[:i:cap(kg.elements)]\n\tkg.elements = append(kg.elements, groupKeyListElement{\n\t\tkey: key,\n\t\tvalue: value,\n\t})\n}", "func (o *GetAllGroupsNotFound) WithPayload(payload *models.Error) *GetAllGroupsNotFound {\n\to.Payload = payload\n\treturn o\n}", "func (a *Client) PublicListReasonGroupsShort(params *PublicListReasonGroupsParams, authInfo runtime.ClientAuthInfoWriter) (*PublicListReasonGroupsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewPublicListReasonGroupsParams()\n\t}\n\n\tif params.Context == nil {\n\t\tparams.Context = context.Background()\n\t}\n\n\tif params.RetryPolicy != nil {\n\t\tparams.SetHTTPClientTransport(params.RetryPolicy)\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"publicListReasonGroups\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/reporting/v1/public/namespaces/{namespace}/reasonGroups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &PublicListReasonGroupsReader{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\n\tswitch v := result.(type) {\n\n\tcase *PublicListReasonGroupsOK:\n\t\treturn v, nil\n\tcase *PublicListReasonGroupsInternalServerError:\n\t\treturn nil, v\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unexpected Type %v\", reflect.TypeOf(v))\n\t}\n}", "func (client IdentityClient) listDynamicGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/dynamicGroups\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListDynamicGroupsResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "func ListGroupPath() string {\n\treturn \"/api/group\"\n}", "func NewDeleteCIDGroupsDefault(code int) *DeleteCIDGroupsDefault {\n\treturn &DeleteCIDGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *MockResourceGroupsClient) List(ctx context.Context, filter string) ([]resources.Group, error) {\n\tif filter != \"\" {\n\t\treturn nil, fmt.Errorf(\"unsupported non-empty filter: %s\", filter)\n\t}\n\tvar l []resources.Group\n\tfor _, rg := range c.RGs {\n\t\tl = append(l, rg)\n\t}\n\treturn l, nil\n}", "func (a *GroupsOnenoteNotebooksSectionGroupApiService) GroupsOnenoteNotebooksSectionGroupsListSections(ctx _context.Context, groupId string, notebookId string, sectionGroupId string, localVarOptionals *GroupsOnenoteNotebooksSectionGroupsListSectionsOpts) (CollectionOfOnenoteSection, *_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 CollectionOfOnenoteSection\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/notebooks({notebook-id})/sectionGroups({sectionGroup-id})/sections\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"notebook-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", notebookId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"sectionGroup-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", sectionGroupId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfOnenoteSection\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 == 0 {\n\t\t\tvar v OdataError\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\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}", "func CreateListServerGroupsResponse() (response *ListServerGroupsResponse) {\n\tresponse = &ListServerGroupsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "func (a *GroupsOnenotePagesOnenoteSectionApiService) GroupsOnenotePagesParentSectionParentSectionGroupListSectionGroups(ctx _context.Context, groupId string, onenotePageId string, localVarOptionals *GroupsOnenotePagesParentSectionParentSectionGroupListSectionGroupsOpts) (CollectionOfSectionGroup, *_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 CollectionOfSectionGroup\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups({group-id})/onenote/pages({onenotePage-id})/parentSection/parentSectionGroup/sectionGroups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", groupId)), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"onenotePage-id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", onenotePageId)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Top.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$top\", parameterToString(localVarOptionals.Top.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Skip.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$skip\", parameterToString(localVarOptionals.Skip.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Search.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$search\", parameterToString(localVarOptionals.Search.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Filter.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$filter\", parameterToString(localVarOptionals.Filter.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Count.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$count\", parameterToString(localVarOptionals.Count.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Orderby.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$orderby\", parameterToString(localVarOptionals.Orderby.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Select_.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$select\", parameterToString(localVarOptionals.Select_.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Expand.IsSet() {\n\t\tlocalVarQueryParams.Add(\"$expand\", parameterToString(localVarOptionals.Expand.Value(), \"csv\"))\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\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 CollectionOfSectionGroup\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 == 0 {\n\t\t\tvar v OdataError\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\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}" ]
[ "0.63562137", "0.6228668", "0.6198471", "0.6065619", "0.58854806", "0.58265823", "0.5792491", "0.57695234", "0.57186234", "0.56959563", "0.5435722", "0.54346776", "0.5393077", "0.53348124", "0.5326011", "0.53110677", "0.5290318", "0.528526", "0.5273268", "0.52673376", "0.5266709", "0.52624816", "0.52567506", "0.5255441", "0.52532643", "0.52529013", "0.5250166", "0.5249367", "0.5234415", "0.52164394", "0.5213501", "0.51720965", "0.51354957", "0.5097718", "0.50818783", "0.50795865", "0.5073121", "0.50596106", "0.50434816", "0.503819", "0.50345486", "0.5031207", "0.5029554", "0.5021751", "0.50084037", "0.4996552", "0.49890736", "0.49870145", "0.49851552", "0.49815112", "0.49808022", "0.49801806", "0.49779123", "0.49741602", "0.49729225", "0.4964679", "0.49551782", "0.4953333", "0.49467587", "0.49411237", "0.49401936", "0.49375156", "0.49375156", "0.4929768", "0.4925819", "0.49210924", "0.49131843", "0.49045852", "0.48962298", "0.48938563", "0.48923892", "0.4887884", "0.48812434", "0.4876263", "0.48730245", "0.48672014", "0.48642623", "0.48627397", "0.48620582", "0.48572066", "0.4856331", "0.48513272", "0.48409277", "0.48353192", "0.4833705", "0.48313853", "0.4824129", "0.482099", "0.48162866", "0.48124015", "0.48102245", "0.48069453", "0.48012614", "0.47961485", "0.47958863", "0.47885495", "0.4788068", "0.47821927", "0.47704387", "0.47692686" ]
0.7558979
0
NewListGroupsDefault creates a ListGroupsDefault with default headers values
NewListGroupsDefault создает ListGroupsDefault с значениями заголовков по умолчанию
func NewListGroupsDefault(code int) *ListGroupsDefault { return &ListGroupsDefault{ _statusCode: code, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "func NewGetHostGroupsDefault(code int) *GetHostGroupsDefault {\n\treturn &GetHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewPostVolumeGroupsListDefault(code int) *PostVolumeGroupsListDefault {\n\treturn &PostVolumeGroupsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func DefaultGroups(clusterName, addonName string) []string {\n\treturn []string{\n\t\tfmt.Sprintf(\"system:open-cluster-management:cluster:%s:addon:%s\", clusterName, addonName),\n\t\tfmt.Sprintf(\"system:open-cluster-management:addon:%s\", addonName),\n\t\t\"system:authenticated\",\n\t}\n}", "func NewUpdateHostGroupsDefault(code int) *UpdateHostGroupsDefault {\n\treturn &UpdateHostGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func GetDefaultGroups(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *DefaultGroupsState, opts ...pulumi.ResourceOption) (*DefaultGroups, error) {\n\tvar resource DefaultGroups\n\terr := ctx.ReadResource(\"keycloak:index/defaultGroups:DefaultGroups\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewDeleteCIDGroupsDefault(code int) *DeleteCIDGroupsDefault {\n\treturn &DeleteCIDGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *DefaultIdentityProvider) ListGroups(ctx context.Context, options *metainternal.ListOptions) (*auth.GroupList, error) {\n\tkeyword := \"\"\n\tlimit := 50\n\tif options.FieldSelector != nil {\n\t\tkeyword, _ = options.FieldSelector.RequiresExactMatch(auth.KeywordQueryTag)\n\t\tlimitStr, _ := options.FieldSelector.RequiresExactMatch(auth.QueryLimitTag)\n\t\tif li, err := strconv.Atoi(limitStr); err == nil && li > 0 {\n\t\t\tlimit = li\n\t\t}\n\t}\n\n\t_, tenantID := authentication.GetUsernameAndTenantID(ctx)\n\tif tenantID != \"\" && tenantID != c.tenantID {\n\t\treturn nil, apierrors.NewBadRequest(\"must in the same tenant\")\n\t}\n\n\tallList, err := c.localGroupLister.List(labels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar localGroupList []*authv1.LocalGroup\n\tfor i, item := range allList {\n\t\tif item.Spec.TenantID == c.tenantID {\n\t\t\tlocalGroupList = append(localGroupList, allList[i])\n\t\t}\n\t}\n\n\tif keyword != \"\" {\n\t\tvar newList []*authv1.LocalGroup\n\t\tfor i, val := range localGroupList {\n\t\t\tif strings.Contains(val.Name, keyword) || strings.Contains(val.Spec.DisplayName, keyword) {\n\t\t\t\tnewList = append(newList, localGroupList[i])\n\t\t\t}\n\t\t}\n\t\tlocalGroupList = newList\n\t}\n\n\titems := localGroupList[0:min(len(localGroupList), limit)]\n\n\tgroupList := auth.GroupList{}\n\tfor _, item := range items {\n\t\tgroup := convertToGroup(item)\n\t\tgroupList.Items = append(groupList.Items, group)\n\t}\n\n\treturn &groupList, nil\n}", "func NewQueryUserGroupsDefault(code int) *QueryUserGroupsDefault {\n\treturn &QueryUserGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewDeleteUserGroupsDefault(code int) *DeleteUserGroupsDefault {\n\treturn &DeleteUserGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewDeleteAuthGroupsDefault(code int) *DeleteAuthGroupsDefault {\n\treturn &DeleteAuthGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewResonateUserListUsersUserGroupsDefault(code int) *ResonateUserListUsersUserGroupsDefault {\n\treturn &ResonateUserListUsersUserGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func DefaultDescribeGroupParser() *DelegatingParser {\n\treturn &DelegatingParser{\n\t\t[]DescribeGroupParser{\n\t\t\tkafka0_9_0_1DescribeGroupParser,\n\t\t\tkafka0_10_0_1DescribeGroupParser,\n\t\t\tkafka0_10_1DescribeGroupParser,\n\t\t\tkafka0_10_2_1DescribeGroupParser,\n\t\t},\n\t}\n}", "func NewListIdpGroupMappingsDefault(code int) *ListIdpGroupMappingsDefault {\n\treturn &ListIdpGroupMappingsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListGroupsNotFound() *ListGroupsNotFound {\n\treturn &ListGroupsNotFound{}\n}", "func (o *SamlConfigurationProperties) SetDefaultGroups(v SamlConfigurationPropertyItemsArray) {\n\to.DefaultGroups = &v\n}", "func DefaultImportGroupsWithCurrent(current string) ImportsGrouper {\n\toncer.Do(initStdlibPackages)\n\treturn defaultImportGrouper(current)\n}", "func CreateDefaultGroup(db *gorp.DbMap, groupName string) error {\n\tquery := `SELECT id FROM \"group\" where name = $1`\n\tvar id int64\n\tif err := db.QueryRow(query, groupName).Scan(&id); err == sql.ErrNoRows {\n\t\tlog.Debug(\"CreateDefaultGroup> create %s group in DB\", groupName)\n\t\tquery = `INSERT INTO \"group\" (name) VALUES ($1)`\n\t\tif _, err := db.Exec(query, groupName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func NewQueryCIDGroupsDefault(code int) *QueryCIDGroupsDefault {\n\treturn &QueryCIDGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewDefaultNodeGroupListProcessor() NodeGroupListProcessor {\n\treturn &NoOpNodeGroupListProcessor{}\n}", "func NewListGroupsOK() *ListGroupsOK {\n\treturn &ListGroupsOK{}\n}", "func (c *GroupController) List(ctx *app.ListGroupContext) error {\n\t// GroupController_List: start_implement\n\n\tdataStore := &dal.DataStore{}\n\tdataStore.GetSession()\n\t// Close the session\n\tdefer dataStore.Close()\n\tdc := dal.NewDalGroup(dataStore)\n\n\tgroups, err := dc.FetchAll()\n\n\tif err != nil {\n\t\tctx.ResponseData.Service.LogError(\"InternalServerError\", \"req_id\", middleware.ContextRequestID(ctx), \"ctrl\", \"Group\", \"action\", \"List\", ctx.RequestData.Request.Method, ctx.RequestData.Request.URL, \"databaseError\", err.Error())\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tres := make(app.GwentapiGroupCollection, len(*groups))\n\n\tlastModified := time.Time{}\n\tfor i, group := range *groups {\n\t\tg, _ := factory.CreateGroup(&group)\n\n\t\tif lastModified.Before(group.Last_Modified) {\n\t\t\tlastModified = group.Last_Modified\n\t\t}\n\n\t\tres[i] = g\n\t}\n\n\t// GroupController_List: end_implement\n\thelpers.LastModified(ctx.ResponseData, lastModified)\n\tif ctx.IfModifiedSince != nil {\n\t\tif !helpers.IsModified(*ctx.IfModifiedSince, lastModified) {\n\t\t\treturn ctx.NotModified()\n\t\t}\n\t}\n\treturn ctx.OK(res)\n}", "func InitializeDefaultGroupName(db gorp.SqlExecutor, defaultGrpName string) error {\n\t//Load the famous sharedInfraGroup\n\tvar err error\n\tSharedInfraGroup, err = LoadByName(context.Background(), db, sdk.SharedInfraGroupName)\n\tif err != nil {\n\t\treturn sdk.WrapError(err, \"group.InitializeDefaultGroupName> Cannot load shared infra group\")\n\t}\n\n\tif defaultGrpName != \"\" {\n\t\tDefaultGroup, err = LoadByName(context.Background(), db, defaultGrpName)\n\t\tif err != nil {\n\t\t\treturn sdk.WrapError(err, \"group.InitializeDefaultGroupName> Cannot load %s group\", defaultGrpName)\n\t\t}\n\t}\n\n\treturn nil\n}", "func NewListOfDevicesDefault(code int) *ListOfDevicesDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &ListOfDevicesDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListDashboardsDefault(code int) *ListDashboardsDefault {\n\treturn &ListDashboardsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewPostVolumeGroupBackupsListDefault(code int) *PostVolumeGroupBackupsListDefault {\n\treturn &PostVolumeGroupBackupsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListGroupsBadRequest() *ListGroupsBadRequest {\n\treturn &ListGroupsBadRequest{}\n}", "func NewListNSGroupsParams() *ListNSGroupsParams {\n\tvar (\n\t\tpageSizeDefault = int64(1000)\n\t\tpopulateReferencesDefault = bool(false)\n\t)\n\treturn &ListNSGroupsParams{\n\t\tPageSize: &pageSizeDefault,\n\t\tPopulateReferences: &populateReferencesDefault,\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "func NewTenancyContactGroupsCreateDefault(code int) *TenancyContactGroupsCreateDefault {\n\treturn &TenancyContactGroupsCreateDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListGroupnetSubnetsDefault(code int) *ListGroupnetSubnetsDefault {\n\treturn &ListGroupnetSubnetsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o *SamlConfigurationProperties) GetDefaultGroups() SamlConfigurationPropertyItemsArray {\n\tif o == nil || o.DefaultGroups == nil {\n\t\tvar ret SamlConfigurationPropertyItemsArray\n\t\treturn ret\n\t}\n\treturn *o.DefaultGroups\n}", "func (gc *GroupCreate) defaults() {\n\tif _, ok := gc.mutation.CreatedAt(); !ok {\n\t\tv := group.DefaultCreatedAt()\n\t\tgc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := gc.mutation.UpdatedAt(); !ok {\n\t\tv := group.DefaultUpdatedAt()\n\t\tgc.mutation.SetUpdatedAt(v)\n\t}\n}", "func NewListComponentVersionsDefault(code int) *ListComponentVersionsDefault {\n\treturn &ListComponentVersionsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (rm *resourceManager) newListRequestPayload(\n\tr *resource,\n) (*svcsdk.DescribeReplicationGroupsInput, error) {\n\tres := &svcsdk.DescribeReplicationGroupsInput{}\n\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\n\treturn res, nil\n}", "func (me *XsdGoPkgHasElem_DefaultResponseGroupssequenceTxsdOperationInformationOperationInformationschema_DefaultResponseGroups_TxsdOperationInformationSequenceDefaultResponseGroups_) Walk() (err error) {\n\tif fn := WalkHandlers.XsdGoPkgHasElem_DefaultResponseGroupssequenceTxsdOperationInformationOperationInformationschema_DefaultResponseGroups_TxsdOperationInformationSequenceDefaultResponseGroups_; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.DefaultResponseGroups.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "func NewListGCPNetworksNoCredentialsDefault(code int) *ListGCPNetworksNoCredentialsDefault {\n\treturn &ListGCPNetworksNoCredentialsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func ListUserGroup(w http.ResponseWriter, r *http.Request) {\n\tfLog := userMgmtLogger.WithField(\"func\", \"ListUserGroup\").WithField(\"RequestID\", r.Context().Value(constants.RequestID)).WithField(\"path\", r.URL.Path).WithField(\"method\", r.Method)\n\n\tiauthctx := r.Context().Value(constants.HansipAuthentication)\n\tif iauthctx == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusUnauthorized, \"You are not authorized to access this resource\", nil, nil)\n\t\treturn\n\t}\n\n\tparams, err := helper.ParsePathParams(fmt.Sprintf(\"%s/management/user/{userRecId}/groups\", apiPrefix), r.URL.Path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuser, err := UserRepo.GetUserByRecID(r.Context(), params[\"userRecId\"])\n\tif err != nil {\n\t\tfLog.Errorf(\"UserRepo.GetUserByRecID got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tif user == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusNotFound, fmt.Sprintf(\"User recid %s not found\", params[\"userRecId\"]), nil, nil)\n\t\treturn\n\t}\n\n\tpageRequest, err := helper.NewPageRequestFromRequest(r)\n\tif err != nil {\n\t\tfLog.Errorf(\"helper.NewPageRequestFromRequest got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusBadRequest, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tgroups, page, err := UserGroupRepo.ListUserGroupByUser(r.Context(), user, pageRequest)\n\tif err != nil {\n\t\tfLog.Errorf(\"UserGroupRepo.ListUserGroupByUser got %s\", err.Error())\n\t}\n\tsgroups := make([]*SimpleGroup, len(groups))\n\tfor k, v := range groups {\n\t\tsgroups[k] = &SimpleGroup{\n\t\t\tRecID: v.RecID,\n\t\t\tGroupName: v.GroupName,\n\t\t}\n\t}\n\tret := make(map[string]interface{})\n\tret[\"groups\"] = sgroups\n\tret[\"page\"] = page\n\thelper.WriteHTTPResponse(r.Context(), w, http.StatusOK, \"List of groups paginated\", nil, ret)\n}", "func (me *XsdGoPkgHasElems_DefaultResponseGroupssequenceTxsdOperationInformationOperationInformationschema_DefaultResponseGroups_TxsdOperationInformationSequenceDefaultResponseGroups_) Walk() (err error) {\n\tif fn := WalkHandlers.XsdGoPkgHasElems_DefaultResponseGroupssequenceTxsdOperationInformationOperationInformationschema_DefaultResponseGroups_TxsdOperationInformationSequenceDefaultResponseGroups_; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfor _, x := range me.DefaultResponseGroupses {\n\t\t\tif err = x.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "func (o SparseCloudSnapshotAccountsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (client WorkloadNetworksClient) ListVMGroupsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"privateCloudName\": autorest.Encode(\"path\", privateCloudName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2020-07-17-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "func (o *SamlConfigurationProperties) GetDefaultGroupsOk() (*SamlConfigurationPropertyItemsArray, bool) {\n\tif o == nil || o.DefaultGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.DefaultGroups, true\n}", "func List(c messagebird.Client, options *messagebird.PaginationRequest) (*Groups, error) {\n\tgroupList := &Groups{}\n\tif err := c.Request(groupList, http.MethodGet, path+\"?\"+options.QueryParams(), nil); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groupList, nil\n}", "func (l *GroupLookup) newKeyGroup(entries []groupKeyListElement) *groupKeyList {\n\tid := l.nextID\n\tl.nextID++\n\treturn &groupKeyList{\n\t\tid: id,\n\t\telements: entries,\n\t}\n}", "func (a *HyperflexApiService) GetHyperflexInitiatorGroupList(ctx context.Context) ApiGetHyperflexInitiatorGroupListRequest {\n\treturn ApiGetHyperflexInitiatorGroupListRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "func (o SparseAPIChecksList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func NewDeleteIamLdapGroupsMoidDefault(code int) *DeleteIamLdapGroupsMoidDefault {\n\treturn &DeleteIamLdapGroupsMoidDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o SparseClaimsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func newRouteGroups(c *ZalandoV1Client, namespace string) *routeGroups {\n\treturn &routeGroups{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "func NewGetSystemObjectDefinitionsByIDAttributeGroupsDefault(code int) *GetSystemObjectDefinitionsByIDAttributeGroupsDefault {\n\treturn &GetSystemObjectDefinitionsByIDAttributeGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewGroups(filename string, bad BadLineHandler) (*HTGroup, error) {\n\thtGroup := HTGroup{\n\t\tfilePath: filename,\n\t}\n\treturn &htGroup, htGroup.ReloadGroups(bad)\n}", "func NewListUsersDefault(code int) *ListUsersDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &ListUsersDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o SparseOAUTHKeysList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (ss SectionSlice) Defaults() DefaultMap {\n\tvar dm = make(DefaultMap)\n\tfor _, s := range ss {\n\t\tfor _, g := range s.Groups {\n\t\t\tfor _, f := range g.Fields {\n\t\t\t\tdm[ScopeKey(Path(s.ID, g.ID, f.ID))] = f.Default\n\t\t\t}\n\t\t}\n\t}\n\treturn dm\n}", "func (ggSession *GreengrassSession) ListGroup(name string) error {\n\tvar id string\n\n\tif name != \"\" {\n\t\tlistOutput, err := ggSession.greengrass.ListGroups(&greengrass.ListGroupsInput{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, v := range listOutput.Groups {\n\t\t\tif name == *v.Name {\n\t\t\t\tid = *v.Id\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"group %s not found\", name)\n\t\t}\n\t} else {\n\t\tid = ggSession.config.Group.ID\n\t}\n\n\tgroup, err := ggSession.greengrass.GetGroup(&greengrass.GetGroupInput{\n\t\tGroupId: &id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group: %v\\n\", group)\n\n\tif group.LatestVersion == nil {\n\t\treturn nil\n\t}\n\n\tgroupVersion, err := ggSession.greengrass.GetGroupVersion(&greengrass.GetGroupVersionInput{\n\t\tGroupId: group.Id,\n\t\tGroupVersionId: group.LatestVersion,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"group version: %v\\n\", groupVersion)\n\n\treturn nil\n}", "func NewListProviderPresetsDefault(code int) *ListProviderPresetsDefault {\n\treturn &ListProviderPresetsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewTemplateDefault() *gomol.Template {\n\ttpl, _ := gomol.NewTemplate(\"[{{color}}{{ucase .LevelName}}{{reset}}] {{.Message}}\")\n\treturn tpl\n}", "func (s *EmptyStore) GroupList() (groups []*storagepb.Group, err error) {\n\treturn groups, nil\n}", "func (o ClaimsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func NewGetCustomObjectDefinitionsByIDAttributeGroupsByIDDefault(code int) *GetCustomObjectDefinitionsByIDAttributeGroupsByIDDefault {\n\treturn &GetCustomObjectDefinitionsByIDAttributeGroupsByIDDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o SparseEnforcerReportsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (o APIChecksList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) {\n\trequest = &ListServerGroupsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Alb\", \"2020-06-16\", \"ListServerGroups\", \"alb\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "func NewListNSGroupsParamsWithHTTPClient(client *http.Client) *ListNSGroupsParams {\n\tvar (\n\t\tpageSizeDefault = int64(1000)\n\t\tpopulateReferencesDefault = bool(false)\n\t)\n\treturn &ListNSGroupsParams{\n\t\tPageSize: &pageSizeDefault,\n\t\tPopulateReferences: &populateReferencesDefault,\n\t\tHTTPClient: client,\n\t}\n}", "func NewGetUserGroupMembersByIDDefault(code int) *GetUserGroupMembersByIDDefault {\n\treturn &GetUserGroupMembersByIDDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o SparseAccessibleNamespacesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func (s *GroupsService) List(opt ...CallOption) ([]*Group, *Response, error) {\n\tgroups, resp, err := listGroup(s.client, \"groups\", opt...)\n\n\treturn groups, resp, err\n}", "func (o AccessibleNamespacesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func NewGroup(dataframe *DataFrame, columns ...string) *Groups {\n\t// ret := &Groups{Columns: []string{}, Grouper: columns, Group: make(map[types.C][]indices.Index), Df: dataframe}\n\tret := &Groups{Keys: []Keys{}, Columns: []string{}, Grouper: columns, Group: make(map[types.C][]indices.Index), Df: dataframe}\n\n\treturn ret\n}", "func (o EnforcerReportsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (o *SamlConfigurationProperties) HasDefaultGroups() bool {\n\tif o != nil && o.DefaultGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.listGroups, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = ListGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = ListGroupsResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(ListGroupsResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into ListGroupsResponse\")\n\t}\n\treturn\n}", "func NewWafGetPolicyGroupsResponseWithDefaults() *WafGetPolicyGroupsResponse {\n\tthis := WafGetPolicyGroupsResponse{}\n\treturn &this\n}", "func NewPatchDeviceGroupPropertyByNameDefault(code int) *PatchDeviceGroupPropertyByNameDefault {\n\treturn &PatchDeviceGroupPropertyByNameDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (r *defaultReview) Groups() []string {\n\treturn r.groups\n}", "func NewDefaultColLevel(n int, name string) ColLevel {\n\tcolsInt := values.MakeStringRange(0, n)\n\tlvl := ColLevel{Labels: colsInt, DataType: options.Int64, Name: name, IsDefault: true}\n\tlvl.Refresh()\n\treturn lvl\n}", "func (c *tiKVGroups) List(opts v1.ListOptions) (result *v1alpha1.TiKVGroupList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1alpha1.TiKVGroupList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"tikvgroups\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "func NewDeleteRuleGroupsMixin0Default(code int) *DeleteRuleGroupsMixin0Default {\n\treturn &DeleteRuleGroupsMixin0Default{\n\t\t_statusCode: code,\n\t}\n}", "func (s *GroupsService) List(ctx context.Context, opts *PagingOptions) (*GroupList, error) {\n\tquery := addPaging(url.Values{}, opts)\n\treq, err := s.Client.NewRequest(ctx, http.MethodGet, newURI(groupsURI), WithQuery(query))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\tres, resp, err := s.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed: , %w\", err)\n\t}\n\n\tif resp != nil && resp.StatusCode == http.StatusNotFound {\n\t\treturn nil, ErrNotFound\n\t}\n\n\tg := &GroupList{\n\t\tGroups: []*Group{},\n\t}\n\tif err := json.Unmarshal(res, g); err != nil {\n\t\treturn nil, fmt.Errorf(\"list groups failed, unable to unmarshal repository list json: , %w\", err)\n\t}\n\n\tfor _, r := range g.GetGroups() {\n\t\tr.Session.set(resp)\n\t}\n\n\treturn g, nil\n}", "func (o SparseRenderTemplatesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (o CloudSnapshotAccountsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func getGroups(w http.ResponseWriter, r *http.Request) {\n InitResponse(&w)\n if r.Method == \"OPTIONS\" {return}\n\n allow, _ := HasPermission(&w, r, CoreGroupModuleID, CoreAccessRead)\n if !allow {\n w.WriteHeader(http.StatusUnauthorized)\n json.NewEncoder(w).Encode(&CoreMessage{\n Message: \"Not authorized!\",\n })\n return\n }\n\n groups := []CoreGroup{}\n\n err := Db.Model(&groups).Select()\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n return\n }\n\n w.WriteHeader(http.StatusOK)\n json.NewEncoder(w).Encode(groups)\n}", "func NewGroup()(*Group) {\n m := &Group{\n DirectoryObject: *NewDirectoryObject(),\n }\n odataTypeValue := \"#microsoft.graph.group\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "func (o OAUTHKeysList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/compute/azure/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (c *MockResourceGroupsClient) List(ctx context.Context, filter string) ([]resources.Group, error) {\n\tif filter != \"\" {\n\t\treturn nil, fmt.Errorf(\"unsupported non-empty filter: %s\", filter)\n\t}\n\tvar l []resources.Group\n\tfor _, rg := range c.RGs {\n\t\tl = append(l, rg)\n\t}\n\treturn l, nil\n}", "func (o SparseImageVulnerabilitiesList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {\n\tr := client.NewRequest(http.MethodGet, \"/azure/compute/group\")\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ListGroupsOutput{Groups: gs}, nil\n}", "func (o SparsePCSearchResultsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func listGroups(cmd *cobra.Command, args []string) error {\n\tclient, err := getClient()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn nil\n\t}\n\tdefer client.Close()\n\n\tvar matchingGroups map[string]bool\n\tif len(args) != 0 {\n\t\t// Mark all groups mentioned on the command line\n\t\tmatchingGroups = make(map[string]bool, len(args))\n\t\tfor _, g := range args {\n\t\t\tmatchingGroups[g] = true\n\t\t}\n\t}\n\t// Get list of all groups and their roles\n\t_, roleGroups, err := getRoles(cmd, nil, true, client)\n\tif err != nil {\n\t\tfmt.Println(toAPIError(err))\n\t\treturn nil\n\t}\n\n\tgroupMap := make(groupMap)\n\tfor roleName, groups := range roleGroups {\n\t\tfor _, group := range groups {\n\t\t\tif matchingGroups != nil && !matchingGroups[group] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgroupMap[group] = append(groupMap[group], roleName)\n\t\t}\n\t}\n\n\t// Get sorted list of groups\n\tgroups := make([]string, 0, len(groupMap))\n\tfor group := range groupMap {\n\t\tgroups = append(groups, group)\n\t}\n\tsort.Strings(groups)\n\n\t// Display all groups\n\tverbose := viper.GetBool(verboseOpt)\n\tfor _, group := range groups {\n\t\tif verbose {\n\t\t\tfmt.Println(group, \"=\", strings.Join(groupMap[group], \", \"))\n\t\t} else {\n\t\t\tfmt.Println(group)\n\t\t}\n\t}\n\n\treturn nil\n}", "func (o SparseSSHAuthorizationPoliciesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func NewListClusterPatchPatchesDefault(code int) *ListClusterPatchPatchesDefault {\n\treturn &ListClusterPatchPatchesDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o PCSearchResultsList) DefaultOrder() []string {\n\n\treturn []string{}\n}", "func NewListGroupsForbidden() *ListGroupsForbidden {\n\treturn &ListGroupsForbidden{}\n}", "func NewGetNetworkGroupnetDefault(code int) *GetNetworkGroupnetDefault {\n\treturn &GetNetworkGroupnetDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (o *UsersGroupsBulkDeleteParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (o SparseSSHAuthoritiesList) DefaultOrder() []string {\n\n\treturn []string{\n\t\t\"name\",\n\t}\n}", "func (db *MySQLDB) ListGroups(ctx context.Context, tenant *Tenant, request *helper.PageRequest) ([]*Group, *helper.Page, error) {\n\tfLog := mysqlLog.WithField(\"func\", \"ListGroups\").WithField(\"RequestID\", ctx.Value(constants.RequestID))\n\tq := \"SELECT COUNT(*) AS CNT FROM HANSIP_GROUP\"\n\tret := make([]*Group, 0)\n\trow := db.instance.QueryRowContext(ctx, q)\n\tcount := 0\n\terr := row.Scan(&count)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn ret, helper.NewPage(request, uint(count)), nil\n\t\t}\n\t\tfLog.Errorf(\"row.Scan got %s\", err.Error())\n\t\treturn nil, nil, &ErrDBScanError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tpage := helper.NewPage(request, uint(count))\n\tq = fmt.Sprintf(\"SELECT REC_ID, GROUP_NAME, GROUP_DOMAIN, DESCRIPTION FROM HANSIP_GROUP WHERE GROUP_DOMAIN=? ORDER BY GROUP_NAME %s LIMIT %d, %d\", request.Sort, page.OffsetStart, page.OffsetEnd-page.OffsetStart)\n\trows, err := db.instance.QueryContext(ctx, q, tenant.Domain)\n\tif err != nil {\n\t\tfLog.Errorf(\"db.instance.QueryContext got %s. SQL = %s\", err.Error(), q)\n\t\treturn nil, nil, &ErrDBQueryError{\n\t\t\tWrapped: err,\n\t\t\tMessage: \"Error ListGroups\",\n\t\t\tSQL: q,\n\t\t}\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tr := &Group{}\n\t\terr := rows.Scan(&r.RecID, &r.GroupName, &r.GroupDomain, &r.Description)\n\t\tif err != nil {\n\t\t\tfLog.Warnf(\"row.Scan got %s\", err.Error())\n\t\t\treturn nil, nil, &ErrDBScanError{\n\t\t\t\tWrapped: err,\n\t\t\t\tMessage: \"Error ListGroups\",\n\t\t\t\tSQL: q,\n\t\t\t}\n\t\t} else {\n\t\t\tret = append(ret, r)\n\t\t}\n\t}\n\treturn ret, page, nil\n}", "func NewListNSGroupsParamsWithTimeout(timeout time.Duration) *ListNSGroupsParams {\n\tvar (\n\t\tpageSizeDefault = int64(1000)\n\t\tpopulateReferencesDefault = bool(false)\n\t)\n\treturn &ListNSGroupsParams{\n\t\tPageSize: &pageSizeDefault,\n\t\tPopulateReferences: &populateReferencesDefault,\n\n\t\ttimeout: timeout,\n\t}\n}", "func NewPostHostsListDefault(code int) *PostHostsListDefault {\n\treturn &PostHostsListDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListVnicAttachmentsDefault(code int) *ListVnicAttachmentsDefault {\n\treturn &ListVnicAttachmentsDefault{\n\t\t_statusCode: code,\n\t}\n}" ]
[ "0.6909627", "0.6855606", "0.6750744", "0.67320436", "0.6511958", "0.6096127", "0.6058161", "0.6057901", "0.6002544", "0.5979988", "0.5939993", "0.5933852", "0.58916205", "0.5888019", "0.58734596", "0.5857483", "0.5743509", "0.5674591", "0.5649271", "0.562719", "0.56152534", "0.5582357", "0.5558763", "0.5500531", "0.54939806", "0.54578555", "0.5412796", "0.5402376", "0.5393324", "0.5376026", "0.5367704", "0.53667563", "0.53346044", "0.5321065", "0.53123814", "0.53088343", "0.5307141", "0.5296614", "0.52961844", "0.5294298", "0.5283816", "0.5268576", "0.5263733", "0.52634716", "0.5258482", "0.52535814", "0.52493584", "0.52491146", "0.52344596", "0.52335954", "0.52287567", "0.52234656", "0.5216773", "0.5215906", "0.5213223", "0.5205109", "0.52024275", "0.5198184", "0.51920694", "0.5191568", "0.51911163", "0.51877195", "0.51876324", "0.51708627", "0.5170292", "0.51694405", "0.51682943", "0.51675", "0.5163441", "0.51201624", "0.5118188", "0.5107403", "0.5104304", "0.50969446", "0.5092661", "0.5085538", "0.5083975", "0.50797063", "0.5078683", "0.5073951", "0.50697535", "0.5069415", "0.5066587", "0.50642097", "0.5059564", "0.50517535", "0.5050455", "0.5046771", "0.5038782", "0.50372726", "0.5030838", "0.5030085", "0.5016002", "0.5015481", "0.5004053", "0.50006694", "0.4992403", "0.4985935", "0.4985809", "0.49847472" ]
0.77026397
0
Code gets the status code for the list groups default response
Код получает код состояния для стандартного ответа списка групп по умолчанию
func (o *ListGroupsDefault) Code() int { return o._statusCode }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *PostVolumeGroupsListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetHostGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryCIDGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListServerGroupOK) Code() int {\n\treturn 200\n}", "func (o *QueryUserGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ResonateUserListUsersUserGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteCIDGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteAuthGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateHostGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteUserGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteIamLdapGroupsMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListIdpGroupMappingsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateUserGroupsOK) Code() int {\n\treturn 200\n}", "func (o *GetUserGroupMembersByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetCustomObjectDefinitionsByIDAttributeGroupsByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetNetworkGroupnetDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetSystemObjectDefinitionsByIDAttributeGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *TenancyContactGroupsCreateDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateDashboardGroupByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryGroupMembersOK) Code() int {\n\treturn 200\n}", "func (o *S3GroupGetDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListGroupnetSubnetsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListServerGroupBadRequest) Code() int {\n\treturn 400\n}", "func (o *DeleteRuleGroupsMixin0Default) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteMsgVpnAuthorizationGroupDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *S3GroupDeleteDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteNetworksNetworkIDRatingGroupsRatingGroupIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *PostVolumeGroupBackupsListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *PatchReportGroupByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListDashboardsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *NetgroupsSettingsCollectionGetDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListServerGroupInternalServerError) Code() int {\n\treturn 500\n}", "func (o *GetSitesByIDCustomerGroupsByIDMembersByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *PostContainersListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryCIDGroupMembersOK) Code() int {\n\treturn 200\n}", "func (o *UpdateUserGroupsMultiStatus) Code() int {\n\treturn 207\n}", "func (o *PatchRecipientGroupByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *AddServerGroupNotFound) Code() int {\n\treturn 404\n}", "func (o *GetSecurityGroupOK) Code() int {\n\treturn 200\n}", "func (o *AddServerGroupNoContent) Code() int {\n\treturn 204\n}", "func (o *UpdateRecipientGroupByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *RemoveServerGroupNotFound) Code() int {\n\treturn 404\n}", "func (o *PatchDeviceGroupPropertyByNameDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *CreateSecurityListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListOrganizationMemberNamesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListRolesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListServerGroupConflict) Code() int {\n\treturn 409\n}", "func (o *ListServerGroupOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *PostOauthClientListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *RemoveServerGroupNoContent) Code() int {\n\treturn 204\n}", "func (o *PostSitesByIDCustomerGroupsByIDMemberSearchDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateUserGroupsBadRequest) Code() int {\n\treturn 400\n}", "func (o *LocalCifsGroupMembersBulkDeleteDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetLeaderboardDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *PutProductsByIDVariationGroupsByIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryCombinedDeviceControlPolicyMembersDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListVnicAttachmentsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *LoginMessagesCollectionGetDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetManagementControllersMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *LdapGetDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *FindVmsByFiltersDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteCategoriesNameValueDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *PcloudVolumegroupsGetOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *RemoveServerGroupBadRequest) Code() int {\n\treturn 400\n}", "func (o *GetOrganizationsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *UpdateUserGroupsForbidden) Code() int {\n\treturn 403\n}", "func (o *PostHostsListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListAWSZonesNoCredentialsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ProjectGetContainerRegistriesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListDashboardsOK) Code() int {\n\treturn 200\n}", "func (o *AddServerGroupBadRequest) Code() int {\n\treturn 400\n}", "func (o *ListGCPNetworksNoCredentialsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetServerConfigImportsMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetSearchSearchItemsMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *AddAPIDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryGroupMembersInternalServerError) Code() int {\n\treturn 500\n}", "func (o *GetCondHclStatusesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListClusterRoleDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *DeleteIamLdapProvidersMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetSearchTagItemsMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetAvailabilityZonesUUIDDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *RemoveServerGroupInternalServerError) Code() int {\n\treturn 500\n}", "func (o *PostHclCompatibilityStatusesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryGroupMembersNotFound) Code() int {\n\treturn 404\n}", "func (o *PostClustersMulticlusterConfigDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListFirewallsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *BackendModuleServiceV1GetModulesGetDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListSyncJobsDefault) Code() int {\n\treturn o._statusCode\n}", "func (s *SecurityGroupLimitExceeded) StatusCode() int {\n\treturn s.RespMetadata.StatusCode\n}", "func (o *GetNetworkPoolsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetNiaapiApicSweolsMoidDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetNodesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *CreateSettingsReportingEulaItemDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListSiteFilesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListCloudJobsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListProviderPresetsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *AddServerGroupInternalServerError) Code() int {\n\treturn 500\n}", "func (o *GetPassesDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListComponentVersionsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetModelRegistryDefault) Code() int {\n\treturn o._statusCode\n}" ]
[ "0.8499957", "0.84434056", "0.8435817", "0.8416033", "0.8345299", "0.8230771", "0.8145179", "0.80832684", "0.79981744", "0.79788136", "0.7896459", "0.7836262", "0.7748716", "0.7699286", "0.7659471", "0.7655369", "0.76534915", "0.7602137", "0.7558863", "0.75421864", "0.7498871", "0.7498372", "0.7490497", "0.7426853", "0.73809016", "0.7366736", "0.73510975", "0.7340894", "0.73315006", "0.732588", "0.73006034", "0.7298013", "0.7295274", "0.72597003", "0.72462624", "0.7246078", "0.7245233", "0.7235873", "0.72346455", "0.7198633", "0.7194821", "0.7151231", "0.71368015", "0.7130802", "0.71047944", "0.7042134", "0.70282346", "0.7026574", "0.7010944", "0.70050186", "0.6962129", "0.6958888", "0.69576705", "0.6945851", "0.69334054", "0.69128287", "0.69123715", "0.6911115", "0.6909678", "0.6908535", "0.6897717", "0.68935937", "0.68880945", "0.6885164", "0.68781173", "0.6867512", "0.6858455", "0.68492544", "0.6847801", "0.68466127", "0.68357104", "0.6831532", "0.6824546", "0.6823494", "0.68224484", "0.68184966", "0.6805688", "0.6803432", "0.67977536", "0.67891854", "0.6788822", "0.6788009", "0.67824185", "0.6781209", "0.678032", "0.6777828", "0.6768513", "0.6767991", "0.6756146", "0.67540103", "0.6753646", "0.675157", "0.67390007", "0.6738618", "0.6729516", "0.67282474", "0.67247933", "0.6714722", "0.67141956", "0.6711939" ]
0.8957152
0
ReactionDelete Handle when a reaction is deleted from a message
Обработка удаления реакции из сообщения
func (b *Bot) ReactionDelete(s *discordgo.Session, event *discordgo.MessageReactionRemove) { if f, ok := b.Commands.ReactionRemoveCommands[event.Emoji.Name]; ok { f(b, s, event) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func HandleDeleteRemindCommand(ctx context.Context, s *discordgo.Session, m *discordgo.MessageCreate, content []string) {\n\tuserID := fmt.Sprintf(\"%s-%s\", m.Author.Username, m.Author.ID)\n\n\terr := models.DeleteRemind(ctx, content[1], userID)\n\n\tif err != nil {\n\t\ts.ChannelMessageSend(m.ChannelID, fmt.Sprintf(\"%s\", err))\n\t\ts.MessageReactionAdd(m.ChannelID, m.ID, \"❌\")\n\t\treturn\n\t}\n\ts.MessageReactionAdd(m.ChannelID, m.ID, \"✅\")\n}", "func handleMsgDelete(ctx sdk.Context, k Keeper, msg *MsgDelete) (*sdk.Result, error) {\n\tif err := k.Delete(ctx, msg); err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.EventManager().EmitEvent(\n\t\tsdk.NewEvent(\n\t\t\tsdk.EventTypeMessage,\n\t\t\tsdk.NewAttribute(sdk.AttributeKeyModule, ModuleName),\n\t\t\tsdk.NewAttribute(sdk.AttributeKeySender, msg.Owner.String()),\n\t\t),\n\t)\n\n\treturn &sdk.Result{Events: ctx.EventManager().Events()}, nil\n}", "func ReactionDelete(\n\tconnections connection.Service,\n\tobjects object.Service,\n\treactions reaction.Service,\n) ReactionDeleteFunc {\n\treturn func(\n\t\tcurrentApp *app.App,\n\t\torigin, postID uint64,\n\t\treactionType reaction.Type,\n\t) error {\n\t\tp, err := PostFetch(objects)(currentApp, postID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := isPostVisible(connections, currentApp, p.Object, origin); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trs, err := reactions.Query(currentApp.Namespace(), reaction.QueryOptions{\n\t\t\tDeleted: &defaultDeleted,\n\t\t\tObjectIDs: []uint64{\n\t\t\t\tpostID,\n\t\t\t},\n\t\t\tOwnerIDs: []uint64{\n\t\t\t\torigin,\n\t\t\t},\n\t\t\tTypes: []reaction.Type{\n\t\t\t\treactionType,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif len(rs) == 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\treaction := rs[0]\n\t\treaction.Deleted = true\n\n\t\t_, err = reactions.Put(currentApp.Namespace(), reaction)\n\n\t\treturn err\n\t}\n}", "func Delete(s *discordgo.Session, m *discordgo.MessageCreate) {\n}", "func messageReactionRemove(session *discordgo.Session, reaction *discordgo.MessageReactionRemove) {\n\n\t// Bot permissions\n\tbotPermissions, err := session.State.UserChannelPermissions(session.State.User.ID, reaction.ChannelID)\n\n\t// Return if unable to check bot permissions\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\t// Return if bot does not have permission to manage roles\n\tif botPermissions&discordgo.PermissionManageRoles == 0 {\n\t\tsession.ChannelMessage(reaction.ChannelID, \"<@\"+reaction.UserID+\"> I don't have permission to manage roles.\")\n\t\treturn\n\t}\n\n\tfor _, reactionRoleMessage := range reactionrole.Messages {\n\t\tif reaction.MessageID == reactionRoleMessage {\n\t\t\tfor _, reactionRoleCatagory := range reactionrole.Catagories {\n\t\t\t\tfor _, reactionRole := range reactionRoleCatagory.Role {\n\t\t\t\t\tif reactionRole.Emoji.ID == reaction.Emoji.ID {\n\t\t\t\t\t\tsession.GuildMemberRoleRemove(reaction.GuildID, reaction.UserID, reactionRole.ID)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "func (client ScheduleMessageClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusBadRequest, http.StatusUnauthorized, http.StatusForbidden, http.StatusNotFound, http.StatusInternalServerError),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (c *Config) handleActionDeleteMessage(client MQTT.Client, message MQTT.Message) {\n\tactionsToBeDeleted := []actionmanager.Action{}\n\terr := json.Unmarshal(message.Payload(), &actionsToBeDeleted)\n\tif err != nil {\n\t\tklog.Errorf(\"Error in unmarshalling: %s\", err)\n\t}\n\tfor _, actionToBeDeleted := range actionsToBeDeleted {\n\t\tactionExists := false\n\t\tfor index, action := range c.ActionManager.Actions {\n\t\t\tif strings.EqualFold(action.Name, actionToBeDeleted.Name) {\n\t\t\t\tactionExists = true\n\t\t\t\tcopy(c.ActionManager.Actions[index:], c.ActionManager.Actions[index+1:])\n\t\t\t\tc.ActionManager.Actions = c.ActionManager.Actions[:len(c.ActionManager.Actions)-1]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tconfiguration.Config.ActionManager = c.ActionManager\n\t\tif !actionExists {\n\t\t\tklog.Errorf(\"Action: %s did not exist\", actionToBeDeleted.Name)\n\t\t} else {\n\t\t\tklog.Infof(\"Action: %s has been deleted \", actionToBeDeleted.Name)\n\t\t}\n\t}\n}", "func (h Handler) Delete(ctx context.Context, request *proto.Identifier) (*proto.Message, error) {\n\terr := h.meta.SetStatus(ctx, request.UserID, deleted)\n\terr = errors.Wrap(err, \"Error while changing status\")\n\treturn &proto.Message{}, err\n}", "func handleMsgDeleteMixnode(ctx sdk.Context, k keeper.Keeper, msg types.MsgDeleteMixnode) (*sdk.Result, error) {\n\tif !k.MixnodeExists(ctx, msg.ID) {\n\t\t// replace with ErrKeyNotFound for 0.39+\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, msg.ID)\n\t}\n\tif !msg.Creator.Equals(k.GetMixnodeOwner(ctx, msg.ID)) {\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, \"Incorrect Owner\")\n\t}\n\n\tk.DeleteMixnode(ctx, msg.ID)\n\treturn &sdk.Result{}, nil\n}", "func (s *session) handleDELE(args []string) error {\n\treturn s.withMessageDo(args[0], func(msgId uint64) error {\n\t\ts.markedDeleted[msgId] = struct{}{}\n\t\treturn s.respondOK(\"message %d deleted\", msgId)\n\t})\n}", "func (p *SignalChannel) HandleDelete(req Request, customer *models.Customer) (res Response, err error) {\n\tlog.Debug(\"[HandleDelete] SignalChannel\")\n\treturn p.forward(req, customer)\n}", "func (l *Logger) OnMessageDelete(ds *discordgo.Session, md *discordgo.MessageDelete) {\n\tif l.LogDeletes == false {\n\t\treturn\n\t}\n\n\t// TODO: Create separate log for bots.\n\tif md.Author.ID == ds.State.User.ID {\n\t\treturn\n\t}\n\n\tlog.Printf(\"%+v\", md)\n\tlog.Printf(\"%+v\", md.Message)\n\n\t// TODO: Implement delete logging\n\tembed := message.GetDefaultEmbed()\n\tembed.Title = \"Message Deleted\"\n\tembed.Description = fmt.Sprintf(\"Message Deleted: %s\", md.Content)\n\n\tmessage.SendEmbed(ds, l.ChannelID, embed)\n}", "func DeleteReaction(ctx context.Context, opts *ReactionOptions) error {\n\treaction := &Reaction{\n\t\tType: opts.Type,\n\t\tUserID: opts.DoerID,\n\t\tIssueID: opts.IssueID,\n\t\tCommentID: opts.CommentID,\n\t}\n\n\tsess := db.GetEngine(ctx).Where(\"original_author_id = 0\")\n\tif opts.CommentID == -1 {\n\t\treaction.CommentID = 0\n\t\tsess.MustCols(\"comment_id\")\n\t}\n\n\t_, err := sess.Delete(reaction)\n\treturn err\n}", "func (s *Storage) updateReactionTargetOnDelete(ctx context.Context, convID chat1.ConversationID,\n\tuid gregor1.UID, reactionMsg *chat1.MessageUnboxed) (*chat1.MessageUnboxed, bool, Error) {\n\ts.Debug(ctx, \"updateReactionTargetOnDelete: reationMsg: %v\", reactionMsg)\n\n\tif reactionMsg.Valid().MessageBody.IsNil() {\n\t\treturn nil, false, nil\n\t}\n\n\ttargetMsgID := reactionMsg.Valid().MessageBody.Reaction().MessageID\n\ttargetMsg, err := s.getMessage(ctx, convID, uid, targetMsgID)\n\tif err != nil || targetMsg == nil {\n\t\treturn nil, false, err\n\t}\n\tif targetMsg.IsValid() {\n\t\tmvalid := targetMsg.Valid()\n\t\treactionIDs := []chat1.MessageID{}\n\t\tfor _, msgID := range mvalid.ServerHeader.ReactionIDs {\n\t\t\tif msgID != reactionMsg.GetMessageID() {\n\t\t\t\treactionIDs = append(reactionIDs, msgID)\n\t\t\t}\n\t\t}\n\t\tupdated := len(mvalid.ServerHeader.ReactionIDs) != len(reactionIDs)\n\t\tmvalid.ServerHeader.ReactionIDs = reactionIDs\n\t\tnewMsg := chat1.NewMessageUnboxedWithValid(mvalid)\n\t\treturn &newMsg, updated, nil\n\t}\n\treturn nil, false, nil\n}", "func (bot Bot) onDelete(s *discordgo.Session, msg *discordgo.MessageCreate) {\n\t//checks if user exists- last message contains a value\n\tif _, exists := bot.allVars.dm[bot.allVars.m[msg.Author.Username]]; exists {\n\t\ts.ChannelMessageDelete(bot.allVars.m[msg.Author.Username], bot.allVars.dm[bot.allVars.m[msg.Author.Username]])\n\t\ts.ChannelMessageSend(msg.ChannelID, \"The message has been deleted\")\n\t} else {\n\t\t//if user doesnt exist return\n\t\ts.ChannelMessageSend(msg.ChannelID, \"There is no prior message available to be deleted\")\n\t}\n}", "func messageDelete(w http.ResponseWriter, r *http.Request) {\n\tvar rBody request\n\n\tif err := json.NewDecoder(r.Body).Decode(&rBody); err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Unable to decode message\", err.Error()), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tid, err := strconv.Atoi(mux.Vars(r)[\"id\"])\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Unable to convert ID to int. Error: %v\", err), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\terr = models.DeleteMessage(id)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Unable to delete message. Error: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttype deleteMessage struct {\n\t\tdefaultProperties\n\t\tID int `json:\"id\"`\n\t}\n\n\tpayload := deleteMessage{\n\t\tdefaultProperties: defaultProperties{\n\t\t\tChannel: rBody.Channel,\n\t\t\tType: \"message\",\n\t\t\tSubType: \"message_deleted\",\n\t\t},\n\t\tID: id,\n\t}\n\n\t// prep for ws\n\tbytes, err := json.Marshal(payload)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Unable to marshal chat message\", err.Error()), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tpubMessage := hub.PublishMessage{\n\t\tTopic: rBody.Channel,\n\t\tPayload: bytes,\n\t}\n\n\tbroker.Hub.Publish(pubMessage)\n\n\tw.WriteHeader(http.StatusOK)\n\treturn\n\n}", "func MessageBotReactionRemove(s *discordgo.Session, m *discordgo.Message, emojis ...string) {\n\tfor _, emoji := range emojis {\n\t\ts.MessageReactionRemove(m.ChannelID, m.ID, emoji, s.State.Ready.User.ID)\n\t}\n}", "func handleMsgDeleteAllowance(ctx sdk.Context, k keeper.Keeper, msg types.MsgDeleteAllowance) (*sdk.Result, error) {\n\tif !k.AllowanceExists(ctx, msg.ID) {\n\t\t// replace with ErrKeyNotFound for 0.39+\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, msg.ID)\n\t}\n\tif !msg.Creator.Equals(k.GetAllowanceOwner(ctx, msg.ID)) {\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, \"Incorrect Owner\")\n\t}\n\n\tk.DeleteAllowance(ctx, msg.ID)\n\treturn &sdk.Result{}, nil\n}", "func (client MeshNetworkClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client PatternClient) DeletePatternResponder(resp *http.Response) (result OperationStatus, 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}", "func (f5 *BigIP) handleDelete(msg comm.Message) comm.Message {\n\tswitch f5.UpdateMode {\n\tcase vsUpdateMode:\n\t\tm := f5.handleVSDelete(msg)\n\t\treturn m\n\tcase policyUpdateMode:\n\t\tm := f5.handleGlobalPolicyDelete(msg)\n\t\treturn m\n\tdefault:\n\t\tmsg.Error = fmt.Sprintf(\"unsupported updateMode %v\", f5.UpdateMode)\n\t\treturn msg\n\t}\n}", "func (s *Service) HandleDelete(w http.ResponseWriter, r *http.Request) {\n\terr := s.subscriptionRepository.Delete(r.Context(), s.getResourceID(r), s.getSubscriptionID(r))\n\tif err != nil {\n\t\tstatus := http.StatusInternalServerError\n\t\tif errRepo, ok := err.(flare.SubscriptionRepositoryError); ok && errRepo.NotFound() {\n\t\t\tstatus = http.StatusNotFound\n\t\t}\n\n\t\ts.writer.Error(w, \"error during subscription delete\", err, status)\n\t\treturn\n\t}\n\n\ts.writer.Response(w, nil, http.StatusNoContent, nil)\n}", "func (client PublishedBlueprintsClient) DeleteResponder(resp *http.Response) (result PublishedBlueprint, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "func handleMessage(m *sqs.Message, h Handler) error {\n var err error\n err = h.HandleMessage(m)\n if err != nil {\n return err\n }\n\n _, err = SqsService.Delete(m.ReceiptHandle)\n if err != nil {\n return err\n }\n\n log.Printf(\"Deleted message from queue: %s\\n\", aws.StringValue(m.ReceiptHandle))\n return nil\n}", "func (client ModelClient) DeleteRegexEntityRoleResponder(resp *http.Response) (result OperationStatus, 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}", "func (client ModelClient) DeleteIntentResponder(resp *http.Response) (result OperationStatus, 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}", "func (c *Client) Delete() error {\n\treturn c.sendJSONToChannel(struct {\n\t\tID int `json:\"id\"`\n\t\tAction string `json:\"action\"`\n\t}{c.nextEventID(), \"delete\"})\n}", "func DeleteCommentReaction(doerID, issueID, commentID int64, content string) error {\n\treturn DeleteReaction(db.DefaultContext, &ReactionOptions{\n\t\tType: content,\n\t\tDoerID: doerID,\n\t\tIssueID: issueID,\n\t\tCommentID: commentID,\n\t})\n}", "func (r *AlertsConfigReconciler) HandleDelete(ctx context.Context, alertsConfig *alertmanagerv1alpha1.AlertsConfig) error {\n\tlog := log.Logger(ctx, \"controllers\", \"alertsconfig_controller\", \"HandleDelete\")\n\tlog = log.WithValues(\"alertsConfig_cr\", alertsConfig.Name, \"namespace\", alertsConfig.Namespace)\n\t// Lets check the status of the CR and\n\t// retrieve all the alerts associated with this CR and delete it\n\t//Check if any alerts were created with this config\n\tif len(alertsConfig.Status.AlertsStatus) > 0 {\n\t\t//Call wavefront api and delete the alerts one by one\n\t\tfor _, alert := range alertsConfig.Status.AlertsStatus {\n\t\t\tif err := r.DeleteIndividualAlert(ctx, alertsConfig.Name, alert, alertsConfig.Namespace); err != nil {\n\t\t\t\tlog.Error(err, \"skipping alert deletion\", \"alertID\", alert.ID)\n\t\t\t\t// Just skip it for now\n\t\t\t\t// this is too opinionated but we don't want to stop the delete execution for other alerts as well\n\t\t\t\t// if there is any valid reasons not to skip it, we can look into it in future\n\t\t\t}\n\t\t}\n\t}\n\n\t// Ok. Lets delete the finalizer so controller can delete the custom object\n\tlog.Info(\"Removing finalizer from WavefrontAlert\")\n\talertsConfig.ObjectMeta.Finalizers = utils.RemoveString(alertsConfig.ObjectMeta.Finalizers, alertsConfigFinalizerName)\n\tr.CommonClient.UpdateMeta(ctx, alertsConfig)\n\tlog.Info(\"Successfully deleted wfAlert\")\n\tr.Recorder.Event(alertsConfig, v1.EventTypeNormal, \"Deleted\", \"Successfully deleted WavefrontAlert\")\n\treturn nil\n}", "func sendMsgRemovePostReaction(\n\tr *rand.Rand, app *baseapp.BaseApp, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper,\n\tmsg *types.MsgRemovePostReaction, ctx sdk.Context, chainID string, privkeys []cryptotypes.PrivKey,\n) error {\n\taddr, _ := sdk.AccAddressFromBech32(msg.User)\n\taccount := ak.GetAccount(ctx, addr)\n\tcoins := bk.SpendableCoins(ctx, account.GetAddress())\n\n\tfees, err := simtypes.RandomFees(r, ctx, coins)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttxGen := simappparams.MakeTestEncodingConfig().TxConfig\n\ttx, err := helpers.GenTx(\n\t\ttxGen,\n\t\t[]sdk.Msg{msg},\n\t\tfees,\n\t\tDefaultGasValue,\n\t\tchainID,\n\t\t[]uint64{account.GetAccountNumber()},\n\t\t[]uint64{account.GetSequence()},\n\t\tprivkeys...,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, _, err = app.Deliver(txGen.TxEncoder(), tx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (client DataFlowClient) DeleteDataFlowResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client ModelClient) DeleteRegexEntityModelResponder(resp *http.Response) (result OperationStatus, 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}", "func (client ModelClient) DeleteClosedListResponder(resp *http.Response) (result OperationStatus, 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}", "func (inms *IndividualMessageHandler) DeleteMessage(response http.ResponseWriter, request *http.Request) {\n\tresponse.Header().Set(\"Content-Type\", \"application/json; charset\")\n\tmessageNo := request.FormValue(\"message_no\")\n\talieid := request.FormValue(\"friend_id\")\n\tsession := inms.Session.GetSession(request)\n\tresponse.Header().Set(\"Content-Type\", \"application/json\")\n\tres := &struct {\n\t\tSuccess bool `json:\"success\"`\n\t\tMessage string `json:\"message\"`\n\t\tFriendID string `json:\"friend_id\"`\n\t\tMessageNo int `json:\"message_no\"`\n\t}{\n\t\tSuccess: false,\n\t}\n\tif session == nil {\n\t\tresponse.Write([]byte(\" UnAuthorized User \"))\n\t\treturn\n\t}\n\tmessageNumber, er := strconv.Atoi(messageNo)\n\tres.MessageNo = messageNumber\n\tres.FriendID = alieid\n\tif er != nil || messageNumber <= 0 || alieid == \"\" {\n\t\tres.Message = \"Invalid Input please Try Again \"\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\talies := inms.AlieSer.GetAlies(alieid, session.UserID)\n\tif alies == nil {\n\t\tres.Message = \" No Message Found \"\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\talies.Messages = func() []*entity.Message {\n\t\tvar messages = []*entity.Message{}\n\t\tfor _, mess := range alies.Messages {\n\t\t\tif mess.MessageNumber != messageNumber {\n\t\t\t\tmessages = append(messages, mess)\n\t\t\t}\n\t\t}\n\t\treturn messages\n\t}()\n\n\talies = inms.AlieSer.UpdateAlies(alies)\n\n\tif alies != nil {\n\t\tres.Success = true\n\t\tres.Message = \"Succesfuly Deleted Message Number \" + strconv.Itoa(messageNumber)\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tres.Success = false\n\tres.Message = \" Internal Server ERROR \"\n\tresponse.WriteHeader(http.StatusInternalServerError)\n\tresponse.Write(Helper.MarshalThis(res))\n}", "func (client IotHubResourceClient) DeleteResponder(resp *http.Response) (result SetObject, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound),\n\t\tautorest.ByUnmarshallingJSON(&result.Value),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "func (c *ChannelMessage) DeleteReplies() error {\n\tmr := NewMessageReply()\n\tmr.MessageId = c.Id\n\n\t// list returns ChannelMessage\n\tmessageReplies, err := mr.ListAll()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// delete message replies\n\tfor _, replyMessage := range messageReplies {\n\t\terr := replyMessage.DeleteMessageAndDependencies(false)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "func (client ThreatIntelligenceIndicatorClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func ReactionAddHandler(s *discordgo.Session, r *discordgo.MessageReactionAdd) {\n\t// Check author for bot\n\tu, err := s.User(r.UserID)\n\tif err != nil {\n\t\tlogger.Log.Error(err.Error())\n\t\treturn\n\t}\n\tif u.Bot {\n\t\treturn\n\t}\n\n\t// Get Server object\n\tc, err := s.Channel(r.ChannelID)\n\tif err != nil {\n\t\tlogger.Log.Error(err.Error())\n\t\treturn\n\t}\n\tserver, err := db.GetServer(c.GuildID)\n\tif err != nil {\n\t\tlogger.Log.Error(err.Error())\n\t\treturn\n\t}\n\n\t// Call reaction command\n\tfor _, cmd := range command.ReactionCommands {\n\t\tif cmd.Trigger() == r.Emoji.ID {\n\t\t\tcmd.Execute(server, s, r)\n\t\t\treturn\n\t\t}\n\t}\n}", "func DeleteMessage() {\n\n}", "func (shareXRouter *ShareXRouter) handleDelete(writer http.ResponseWriter, request *http.Request) {\n\t//get the delete reference\n\tdeleteReference, ok := mux.Vars(request)[deleteReferenceVar]\n\tif !ok {\n\t\thttp.Error(writer, \"400 Bad request\", http.StatusBadRequest)\n\t\treturn\n\t}\n\t//delete the entry\n\terr := shareXRouter.Storage.Delete(deleteReference)\n\tif err != nil {\n\t\tshareXRouter.sendInternalError(writer, fmt.Sprintf(\"deleting entry with call reference %v\", strconv.Quote(deleteReference)), err)\n\t\treturn\n\t}\n\twriter.WriteHeader(http.StatusOK)\n}", "func (client ModelClient) DeleteClosedListEntityRoleResponder(resp *http.Response) (result OperationStatus, 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}", "func (client PatternClient) DeletePatternsResponder(resp *http.Response) (result OperationStatus, 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}", "func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client FeatureStateClient) DeleteStateResponder(resp *http.Response) (result autorest.Response, err error) {\n err = autorest.Respond(\n resp,\n azure.WithErrorUnlessStatusCode(http.StatusOK,http.StatusNoContent),\n autorest.ByClosing())\n result.Response = resp\n return\n }", "func (dtm *DirectToMessage) Delete(db XODB) error {\n\tvar err error\n\n\t// if doesn't exist, bail\n\tif !dtm._exists {\n\t\treturn nil\n\t}\n\n\t// if deleted, bail\n\tif dtm._deleted {\n\t\treturn nil\n\t}\n\n\t// sql query\n\tconst sqlstr = `DELETE FROM ms.direct_to_message WHERE Id = ?`\n\n\t// run query\n\tXOLog(sqlstr, dtm.Id)\n\t_, err = db.Exec(sqlstr, dtm.Id)\n\tif err != nil {\n\t\tXOLogErr(err)\n\t\treturn err\n\t}\n\n\t// set deleted\n\tdtm._deleted = true\n\n\tOnDirectToMessage_AfterDelete(dtm)\n\n\treturn nil\n}", "func SimulateMsgRemovePostReaction(\n\tk keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper,\n) simtypes.Operation {\n\treturn func(\n\t\tr *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context,\n\t\taccs []simtypes.Account, chainID string,\n\t) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {\n\n\t\tdata, skip := randomRemovePostReactionFields(r, ctx, accs, k, ak)\n\t\tif skip {\n\t\t\treturn simtypes.NoOpMsg(types.RouterKey, types.ModuleName, \"MsgRemovePostReaction\"), nil, nil\n\t\t}\n\n\t\tmsg := types.NewMsgRemovePostReaction(data.PostID, data.User.Address.String(), data.Shortcode)\n\t\terr := sendMsgRemovePostReaction(r, app, ak, bk, msg, ctx, chainID, []cryptotypes.PrivKey{data.User.PrivKey})\n\t\tif err != nil {\n\t\t\treturn simtypes.NoOpMsg(types.RouterKey, types.ModuleName, \"MsgRemovePostReaction\"), nil, err\n\t\t}\n\n\t\treturn simtypes.NewOperationMsg(msg, true, \"MsgRemovePostReaction\"), nil, nil\n\t}\n}", "func Deleted(c *routing.Context, msg string, service string) error {\n\tResponse(c, `{\"error\": false, \"msg\": \"`+msg+`\"}`, 200, service, \"application/json\")\n\treturn nil\n}", "func handleDelete(w http.ResponseWriter, r *http.Request) (err error) {\n\n\t// 베이스 경로 문자에서 숫자로\n\tid, err := strconv.Atoi(path.Base(r.URL.Path))\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// 일단 가져오기\n\tpost, err := retrieve(id)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// 이걸 구지 post 에서 해야하나? 음..\n\terr = post.delete()\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// 완료 때리기\n\tw.WriteHeader(200)\n\treturn\n}", "func (client AccountClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n err = autorest.Respond(\n resp,\n azure.WithErrorUnlessStatusCode(http.StatusOK,http.StatusAccepted,http.StatusNoContent),\n autorest.ByClosing())\n result.Response = resp\n return\n }", "func (client AppsClient) DeleteResponder(resp *http.Response) (result OperationStatus, 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}", "func (client ModelClient) DeleteCustomEntityRoleResponder(resp *http.Response) (result OperationStatus, 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}", "func DeleteMessage(clientId string, mid uint16, direction MessageDirection) error {\n\tmeta := broker.GetService(ServiceName).(*MetadataService)\n\treturn meta.deleteMessage(clientId, mid, direction)\n}", "func (client MSIXPackagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (s *GoJobServer) handleDelete(conn net.Conn, cmdReader *bufio.Reader) {\n\t// DELETE<\\0><id>\n\tjobID, err := data.ParseUint64(cmdReader)\n\tif err != nil {\n\t\terrorResponse(conn, \"Malformed DELETE command: failed to parse job ID\")\n\t\treturn\n\t}\n\n\terr = s.queue.DeleteJob(jobID)\n\tif err != nil {\n\t\terrorResponse(conn, fmt.Sprintf(\"Job %v already deleted\", jobID))\n\t\treturn\n\t}\n\n\tconn.Write(data.PackString(\"OK\"))\n}", "func (client OpenShiftManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func DeleteTrigger(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Received a DELETE. Working. \")\n}", "func (s *API) DeleteMessage(w http.ResponseWriter, req *http.Request) {\n\tlog.Debug(\"DeleteMessage\")\n\tw.WriteHeader(http.StatusNotImplemented)\n}", "func (p *metadataService) deleteMessage(clientID string, pid uint16, direction uint8) {\n\tp.deleteMessageWithValidator(clientID, func(msg *base.Message) bool {\n\t\treturn msg.PacketId == pid && msg.Direction == direction\n\t})\n}", "func (c *Client) Delete(ID int) error {\n\terr := c.writeMsg(fmt.Sprintf(\"DELE %v\\r\\n\", ID))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmsg, err := c.readMsg(singleLineMessageTerminator)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif c.isError(msg) {\n\t\treturn fmt.Errorf(\"Unknown error returned %v\", msg)\n\t}\n\n\tfmt.Printf(\"Deleting message %d\\n\", ID)\n\n\treturn nil\n}", "func (client ViewsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client IngestionSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (h *Handler) DeleteHandler(w http.ResponseWriter, r *http.Request) {\n\tid := chi.URLParam(r, \"id\")\n\n\tctx, cancel := context.WithCancel(r.Context())\n\tdefer cancel()\n\n\tvar err error\n\n\trole, err := auth.GetRole(r)\n\tif err != nil {\n\t\t_ = response.HTTPError(w, http.StatusBadRequest, response.ErrorBadRequest.Error())\n\t\treturn\n\t}\n\n\tselect {\n\tcase <-ctx.Done():\n\t\t_ = response.HTTPError(w, http.StatusBadGateway, response.ErrTimeout.Error())\n\t\treturn\n\tdefault:\n\t\terr = h.service.Delete(ctx, role, id)\n\t}\n\tif err != nil {\n\t\th.log.Error(err)\n\t\t_ = response.HTTPError(w, http.StatusNotFound, err.Error())\n\t\treturn\n\t}\n\n\trender.JSON(w, r, render.M{})\n}", "func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n err = autorest.Respond(\n resp,\n azure.WithErrorUnlessStatusCode(http.StatusOK,http.StatusAccepted,http.StatusNoContent),\n autorest.ByClosing())\n result.Response = resp\n return\n }", "func (_m *SlackClient) RemoveReaction(name string, item slack.ItemRef) {\n\t_m.Called(name, item)\n}", "func (client Client) DeleteResponder(resp *http.Response) (result VolumeInstancesDeleteResponse, err error) {\n\terr = autorest.Respond(\n\t\tresp,\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}", "func (h *Handler) Delete(w http.ResponseWriter, r *http.Request) {\n\n\tp := mux.Vars(r)\n\tid := p[\"id\"]\n\n\terr := h.Source.Delete(id)\n\n\tif err != nil {\n\t\te := Error{\n\t\t\tMessage: fmt.Sprintf(\"An error occured when trying to delete the delivery : %s\", err),\n\t\t}\n\t\tJSONWithHTTPCode(w, e, 500)\n\t\treturn\n\t}\n\n\tJSONWithHTTPCode(w, nil, 204)\n\n}", "func DeleteMessage(m *tb.Message, b *tb.Bot, timeout time.Duration) {\n\ttime.Sleep(timeout)\n\terr := b.Delete(m)\n\tif err != nil {\n\t\tlogrus.Info(err)\n\t}\n\tlogrus.Info(\"Remove message \", m.ID)\n}", "func (m *Message) Delete(d ...*time.Duration) {\n\tif len(d) > 0 && d[0] != nil {\n\t\ttime.Sleep(*d[0])\n\t}\n\terr := m.Session.ChannelMessageDelete(m.Message.ChannelID, m.Message.ID)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n}", "func (o *DMessageEmbed) Delete(exec boil.Executor) error {\n\tif o == nil {\n\t\treturn errors.New(\"models: no DMessageEmbed provided for delete\")\n\t}\n\n\targs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), dMessageEmbedPrimaryKeyMapping)\n\tsql := \"DELETE FROM \\\"d_message_embeds\\\" WHERE \\\"id\\\"=$1\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\t_, err := exec.Exec(sql, args...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to delete from d_message_embeds\")\n\t}\n\n\treturn nil\n}", "func (client CloudEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (c *Cache) HandleDelete(ctx *fasthttp.RequestCtx) {\n\tc.Remove(ctx.UserValue(\"key\").(string))\n}", "func (client DeviceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusBadRequest, http.StatusUnauthorized, http.StatusForbidden, http.StatusNotFound, http.StatusInternalServerError),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client DatabasesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (c *ChannelMessage) DeleteMessageAndDependencies(deleteReplies bool) error {\n\t// fetch interactions\n\ti := NewInteraction()\n\ti.MessageId = c.Id\n\tinteractions, err := i.FetchAll(\"like\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// delete interactions\n\tfor _, interaction := range interactions {\n\t\terr := interaction.Delete()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif deleteReplies {\n\t\tif err := c.DeleteReplies(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// delete any associated channel message lists\n\tif err = c.DeleteChannelMessageLists(); err != nil {\n\t\treturn err\n\t}\n\n\terr = NewMessageReply().DeleteByOrQuery(c.Id)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// delete channel message itself\n\treturn c.Delete()\n}", "func (c *ConversationsRepo) Delete(conversation *models.Conversation) error {\n _, err := c.DB.Model(conversation).Where(\"id = ?\", conversation.ID).Delete()\n return err\n}", "func DeleteIssueReaction(doerID, issueID int64, content string) error {\n\treturn DeleteReaction(db.DefaultContext, &ReactionOptions{\n\t\tType: content,\n\t\tDoerID: doerID,\n\t\tIssueID: issueID,\n\t\tCommentID: -1,\n\t})\n}", "func Delete(c messagebird.Client, id string) error {\n\treturn c.Request(nil, http.MethodDelete, path+\"/\"+id, nil)\n}", "func (client FirewallPolicyRuleGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func handleDelete(ctx *verifierContext, status *types.VerifyImageStatus) {\n\n\tlog.Functionf(\"handleDelete(%s) refcount %d\",\n\t\tstatus.ImageSha256, status.RefCount)\n\n\tif _, err := os.Stat(status.FileLocation); err == nil {\n\t\tlog.Functionf(\"handleDelete removing %s\",\n\t\t\tstatus.FileLocation)\n\t\tif err := os.RemoveAll(status.FileLocation); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t} else {\n\t\tlog.Warnf(\"handleDelete: Unable to delete %s: %s\",\n\t\t\tstatus.FileLocation, err)\n\t}\n\n\tunpublishVerifyImageStatus(ctx, status)\n\tlog.Functionf(\"handleDelete done for %s\", status.ImageSha256)\n}", "func (c *Controller) onDelete(obj interface{}) {\n\tfmt.Println(\"onDelete called\")\n\tc.dequeue(obj)\n}", "func (m *Message) Delete() error {\n\treturn globalMessage.Delete(m.ID)\n}", "func (client ModelClient) DeleteHierarchicalEntityRoleResponder(resp *http.Response) (result OperationStatus, 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}", "func PolicyDeleteMessage(deleted int, labels []string, revision uint64) AgentNotifyMessage {\n\tnotification := PolicyUpdateNotification{\n\t\tLabels: labels,\n\t\tRevision: revision,\n\t\tRuleCount: deleted,\n\t}\n\n\treturn AgentNotifyMessage{\n\t\tType: AgentNotifyPolicyDeleted,\n\t\tNotification: notification,\n\t}\n}", "func (s *StanServer) handleChannelDelete(c *channel) {\n\tdelete := false\n\tcs := s.channels\n\tcs.Lock()\n\ta := c.activity\n\tif a.preventDelete || a.deleteInProgress || c.ss.hasActiveSubs() {\n\t\tif s.debug {\n\t\t\ts.log.Debugf(\"Channel %q cannot be deleted: preventDelete=%v inProgress=%v hasActiveSubs=%v\",\n\t\t\t\tc.name, a.preventDelete, a.deleteInProgress, c.ss.hasActiveSubs())\n\t\t}\n\t\tc.stopDeleteTimer()\n\t} else {\n\t\telapsed := time.Since(a.last)\n\t\tif elapsed >= a.maxInactivity {\n\t\t\tif s.debug {\n\t\t\t\ts.log.Debugf(\"Channel %q is being deleted\", c.name)\n\t\t\t}\n\t\t\tc.stopDeleteTimer()\n\t\t\t// Leave in map for now, but mark as deleted. If we removed before\n\t\t\t// completion of the removal, a new lookup could re-create while\n\t\t\t// in the process of deleting it.\n\t\t\ta.deleteInProgress = true\n\t\t\tdelete = true\n\t\t} else {\n\t\t\tvar next time.Duration\n\t\t\tif elapsed < 0 {\n\t\t\t\tnext = a.maxInactivity\n\t\t\t} else {\n\t\t\t\t// elapsed < a.maxInactivity\n\t\t\t\tnext = a.maxInactivity - elapsed\n\t\t\t}\n\t\t\tif s.debug {\n\t\t\t\ts.log.Debugf(\"Channel %q cannot be deleted now, reset timer to fire in %v\",\n\t\t\t\t\tc.name, next)\n\t\t\t}\n\t\t\tc.resetDeleteTimer(next)\n\t\t}\n\t}\n\tcs.Unlock()\n\tif delete {\n\t\tif testDeleteChannel {\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t\tif s.isClustered {\n\t\t\ts.replicateDeleteChannel(c)\n\t\t} else {\n\t\t\ts.processDeleteChannel(c.name)\n\t\t}\n\t}\n}", "func DeleteMessage(c *gin.Context) {\n\tif messageId, err := strconv.Atoi(c.Param(\"messageid\")); err == nil {\n\t\tif err := store.DeleteMessage(messageId); err == nil {\n\t\t\trender(c, gin.H{\n\t\t\t\t\"title\": \"Successfully deleted message\"}, \"delete-successful.html\")\n\t\t} else {\n\t\t\tc.AbortWithError(http.StatusNoContent, fmt.Errorf(\"Not find corresponding message based in id %d\", messageId))\n\t\t}\n\t} else {\n\t\tc.AbortWithStatus(http.StatusInternalServerError)\n\t}\n}", "func (client BaseClient) DeleteFeatureInstanceResponder(resp *http.Response) (result FeatureInstance, 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}", "func (srv *Server) handleDelete(res http.ResponseWriter, req *http.Request) {\n\tfor _, rute := range srv.routeDeletes {\n\t\tvals, ok := rute.parse(req.URL.Path)\n\t\tif ok {\n\t\t\trute.endpoint.call(res, req, srv.evals, vals)\n\t\t\treturn\n\t\t}\n\t}\n\tres.WriteHeader(http.StatusNotFound)\n}", "func (client ListManagementTermListsClient) DeleteResponder(resp *http.Response) (result String, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result.Value),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "func (s Service) DeleteMessage(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tidS, ok := mux.Vars(r)[\"id\"] // Gets params\n\tif !ok {\n\t\thttp.NotFound(w, r)\n\t\treturn\n\t}\n\n\tid, err := strconv.Atoi(idS)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tmes, err := s.strg.DeleteByID(uint(id))\n\tif err == errors.New(\"Deleted message\") {\n\t\thttp.Error(w, err.Error(), http.StatusGone)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tjsonResponse, err := json.Marshal(mes)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tfmt.Fprint(w, string(jsonResponse))\n\t// params := mux.Vars(r)\n\t// for index, mas := range Messages {\n\t// \tif mas.ID == params[\"id\"] {\n\t// \t\tMessages = append(Messages[:index], Messages[index+1:]...)\n\t// \t\tbreak\n\t// \t}\n\t// }\n\t// json.NewEncoder(w).Encode(Messages)\n}", "func (client VersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client ReferenceDataSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func DeleteMessage(ctx *context.Context, session *context.Session, w http.ResponseWriter, r *http.Request, vars map[string]string) {\n\terr := ctx.MessageService.DeleteMessage(vars[\"id\"], session.CurrentUser)\n\n\tif err != nil {\n\t\thandleError(w, err)\n\t\treturn\n\t}\n}", "func DelayedMessageDelete(session *discordgo.Session, delay time.Duration, cID, mID string) {\n\ttime.Sleep(delay)\n\terr := session.ChannelMessageDelete(cID, mID)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed deleing message\")\n\t}\n}", "func (client ModelClient) DeleteEntityResponder(resp *http.Response) (result OperationStatus, 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}", "func deleteHandler(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received a content request. Preparing response\")\n\tresp := response{\n\t\tSuccessful: false,\n\t\tErrMsg: errors.New(\"Unknown failure\"),\n\t}\n\twriter := json.NewEncoder(w)\n\tdefer writer.Encode(resp)\n\n\t// Parse the request.\n\tfmt.Println(\"Parsing request\")\n\tdata := form{}\n\tresp.ErrMsg = json.NewDecoder(r.Body).Decode(&data)\n\n\tfmt.Println(\"Obtained following data: \")\n\tfmt.Printf(\"%+v\\n\", data)\n\n\t// Validate requestor token\n\tvalid := true\n\tvalid, resp.ErrMsg = session.Validate(data.User, data.Token)\n\n\tfilepath = path + data.ID + data.ContentType\n\n\tmodErr = update.ModifyContentFilePath(\"\")\n\tdeleteErr = delete(filepath)\n\n\tif modErr != nil {\n\t\tresp.ErrMsg = modErr\n\t} else {\n\t\tresp.ErrMsg = deleteErr\n\t}\n\n}", "func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}", "func (client ListManagementImageClient) DeleteImageResponder(resp *http.Response) (result String, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result.Value),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "func (client ModelClient) DeleteSubListResponder(resp *http.Response) (result OperationStatus, 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}", "func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),\n\t\tautorest.ByClosing())\n\tresult.Response = resp\n\treturn\n}" ]
[ "0.7750925", "0.6899156", "0.68633205", "0.6679848", "0.6557125", "0.65511835", "0.6498537", "0.63918865", "0.6388954", "0.6379347", "0.63770807", "0.6354654", "0.6294034", "0.62326926", "0.6200813", "0.6182433", "0.60744053", "0.60292774", "0.5997569", "0.5922095", "0.5871016", "0.58615226", "0.5842901", "0.5833292", "0.5820513", "0.58204347", "0.5815642", "0.5795602", "0.5788443", "0.57817775", "0.577598", "0.57605517", "0.5758787", "0.5744594", "0.5744594", "0.5743632", "0.57351947", "0.5732404", "0.5719675", "0.5709982", "0.5709636", "0.57063204", "0.57042664", "0.56951594", "0.5690281", "0.5677391", "0.5660791", "0.56491494", "0.5648552", "0.5646356", "0.5633689", "0.56325346", "0.5631446", "0.56214416", "0.5617177", "0.56157184", "0.561398", "0.5613888", "0.5609109", "0.5607614", "0.56068385", "0.5588251", "0.5586849", "0.5583235", "0.5578354", "0.55728185", "0.5571957", "0.55594033", "0.55589277", "0.5554228", "0.5544391", "0.55382335", "0.5513217", "0.55126494", "0.5505811", "0.5505107", "0.55015045", "0.5499423", "0.54965323", "0.54877687", "0.5484497", "0.5482687", "0.5473122", "0.54706717", "0.5467267", "0.54621094", "0.54602385", "0.54589957", "0.5450957", "0.54492664", "0.5447832", "0.54451585", "0.544133", "0.54364645", "0.54315585", "0.5430209", "0.5426583", "0.54258037", "0.5423913", "0.5421391" ]
0.7663503
1
Initialize will create database connection and wire up routes
Initialize будет создавать соединение с базой данных и настраивать маршруты
func (app *App) Initialize(user, password, dbname string) { connectionString := fmt.Sprintf("user=%s password=%s dbname=%s", user, password, dbname) var err error app.DB, err = sql.Open("postgres", connectionString) if err != nil { log.Fatal(err) } app.Router = mux.NewRouter() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *App) Initialize() {\n\tpsqlInfo := fmt.Sprintf(\"host=%s port=%d user=%s \"+\"password=%s dbname=%s sslmode=disable\",\n\thost, port, user, password, dbname)\n\tvar err error\n\ta.DB, err = sql.Open(\"postgres\", psqlInfo)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ta.Router = mux.NewRouter()\n\ta.initializeRoutes()\n}", "func (a *App) Initialize() {\n\tvar err error\n\ta.db, err = sql.Open(\"mysql\",\n\t\t\"dbu309mg6:1XFA40wc@tcp(mysql.cs.iastate.edu:3306)/db309mg6?charset=utf8mb4\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\terr = a.db.Ping()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\ta.router = mux.NewRouter()\n\ta.initializeRoutes()\n}", "func (a *App) Initialize(user, dbname string) {\n\tconnectionString := fmt.Sprintf(\"user=%s dbname=%s sslmode=disable\", user, dbname)\n\t// connectionString := fmt.Sprintf(\"user=john dbname=subscription_test sslmode=disable\")\n\n\tvar err error\n\ta.DB, err = sql.Open(\"postgres\", connectionString)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ta.Router = mux.NewRouter()\n\ta.initializeRoutes()\n}", "func (a *App) Initialize(ctx context.Context) {\n\n\t// Setup database\n\tclient, err := models.ConfigureDB(ctx)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Couldn't connect to the database\", err)\n\t}\n\tmodels.TestDbConnection(client)\n\n\ta.DB = client.Database(models.DB_NAME)\n\n\t// Setup routes\n\ta.Router = server.ConfigureRoutes()\n\n}", "func (api *Api) Initialize(config *config.Configuration) {\n\tapi.DB = db.InitialConnection(config.DBName, config.MongoURL)\n\tapi.createIndexes()\n\n\tapi.Router = mux.NewRouter()\n\tapi.UseMiddleware(handler.JSONContentTypeMiddleware)\n\tapi.setRouters()\n}", "func (a *App) Initialize(databaseURL string) {\n\t// commenting out for Heroku Postgres service\n\t// connectionString :=\n\t// \tfmt.Sprintf(\"user=%s password=%s dbname=%s sslmode=disable\", user, password, dbname)\n\n\tvar err error\n\ta.DB, err = sql.Open(\"postgres\", databaseURL)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not connect to postgres: %+v\", err)\n\t}\n\n\ta.Router = mux.NewRouter()\n\ta.initializeRoutes()\n}", "func (a *App) Initialize(dbType, dbString string) {\n\tvar err error\n\ta.DB, err = gorm.Open(sqlite.Open(dbString))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\ta.Engine = gin.Default()\n\ta.initializeRoutes()\n}", "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "func init() {\n\trouter = chi.NewRouter()\n\trouter.Use(middleware.Recoverer)\n\n\tdbSource := fmt.Sprintf(\"root:%s@tcp(%s:%s)/%s?charset=utf8\", dbPass, dbHost, dbPort, dbName)\n\n\tvar err error\n\tdb, err = sql.Open(\"mysql\", dbSource)\n\n\tcatch(err)\n}", "func init() {\n\t//func NewRouter() *Mux, its like if they did router=&newMux (if NewMux were a struct)\n\troute = chi.NewRouter() //NewRouter returns a new Mux object (*chi.Mux) that implements the Router interface,\n\t//so we assign it to router (which a pointer to a chi.Mux)\n\troute.Use(middleware.Recoverer) //Recoverer is a middleware that recovers from panics, logs the panic (and a\n\t// backtrace), and returns a HTTP 500 (Internal Server Error) status if\n\t// possible. Recoverer prints a request ID if one is provided.\n\tdbSource := fmt.Sprintf(\"host=%s port=%s dbname=%s user=%s password=%s sslmode=disable\", dbHost, dbPort, dbName, dbUser, dbPass)\n\t//%s for strings, %d for int\n\tvar err error //error var\n\thandlers.DB, err = sql.Open(\"postgres\", dbSource) //Create the sql db with the name: \"mysql\" and the source\n\thelper.Catch(err)\n\tlog.Println(\"Connected to the local DB!\")\n}", "func (a *App) Initialize(user, password, dbname string) {\n\ta.Router = mux.NewRouter()\n\n\ta.Router.HandleFunc(\"/shorten\", CreateShortCode).Methods(POST)\n\ta.Router.HandleFunc(\"/{shortcode}\", GetShortenCode).Methods(GET)\n}", "func (app *App) Initialize(config *config.Config) {\r\n\tapp.DB = mongodb.InitialConnection(\"id-card-ocr\", config.MongoURI())\r\n\r\n\tapp.Router = mux.NewRouter()\r\n\tapp.UseMiddleware(handler.JSONContentTypeMiddleware)\r\n\tapp.setRouters()\r\n}", "func init() {\n\tconfig.Read()\n\tdao.DialInfo = &mgo.DialInfo{\n\t\tAddrs: []string{config.Server},\n\t\tDatabase: config.Database,\n\t\tUsername: config.Username,\n\t\tPassword: config.Password,\n\t}\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n\n}", "func init() {\n\tconnectionString := os.Getenv(\"CLOUDSQL_CONNECTION\")\n\tdb, err := NewDb(\"mymysql\", connectionString)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// running in google app engine complains that the db gets closed\n\t// by the time we get requests. removing that here but that can't be\n\t// right...\n\n\trouter := NewRouter(db)\n\n\thttp.Handle(\"/\", router)\n}", "func (a *App) Initialize(config *Configuration) {\n\tif !config.Debug {\n\t\tif config.Postgres == nil {\n\t\t\tlog.Panic(\"No postgres configuration is given, but debug mode is disabled\")\n\t\t}\n\t\tvar PgDbURL = config.Postgres.DbURL\n\t\tdbURLSliced := strings.Split(PgDbURL, \":\")\n\t\thost := dbURLSliced[0]\n\t\tport, err := strconv.Atoi(dbURLSliced[1])\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tcreateErr := CreatePostgreDBIfNotExist(config.Postgres.Database, host, port, config.Postgres.Username, config.Postgres.Password)\n\t\tif createErr != nil {\n\t\t\tlog.Fatalf(\"Error during db creation: %v\", createErr)\n\t\t}\n\t\tconnectionString := fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\t\thost, port, config.Postgres.Username, config.Postgres.Password, config.Postgres.Database)\n\t\ta.DB, err = sql.Open(\"postgres\", connectionString)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tCreateTable(a.DB)\n\t} else {\n\t\ta.DB = nil\n\t}\n\ta.DataGenerationWg.Add(1)\n\tgo generateRandomInitData(a.DB, config, &a.DataGenerationWg)\n\ta.Router = mux.NewRouter()\n\ta.InitializeRoutes()\n}", "func (a *App) Initialize() {\r\n\tlog.Println(\"API Init\")\r\n\tstartTime := time.Now()\r\n\ta.DB = make(map[string]db.DBHandler)\r\n\tdbHandler, err := db.OpenDB(\"postgres\", config.Env.DbConn)\r\n\tif err != nil {\r\n\t\tlog.Println(\"Could not connect database\")\r\n\t\tlog.Fatal(err.Error())\r\n\t}\r\n\ta.DB[\"db\"] = db.AutoMigrate(dbHandler)\r\n\ta.DB[\"db\"].LogMode(true)\r\n\r\n\tmockDbHandler, errMock := db.OpenDB(\"postgres\", config.Env.DbConnMock)\r\n\tif errMock != nil {\r\n\t\tlog.Println(\"Could not connect database\")\r\n\t\tlog.Fatal(errMock.Error())\r\n\t}\r\n\ta.DB[\"mock\"] = db.AutoMigrate(mockDbHandler)\r\n\r\n\ta.Artemis = &model.Artemis{\r\n\t\tSkip: config.Env.ArtemisSkip,\r\n\t}\r\n\ta.Artemis.Conn, err = stomp.Dial(\"tcp\", config.Env.ArtemisConn, config.Env.ArtemisOptions...)\r\n\tif err != nil {\r\n\t\tlog.Println(\"Could not connect artemis\")\r\n\t\tlog.Println(err.Error())\r\n\t}\r\n\r\n\t// set router\r\n\ta.Router = mux.NewRouter()\r\n\ta.setRouters()\r\n\r\n\tlog.Println(\"Init finished in \", time.Now().Sub(startTime))\r\n\tlog.Println(\"API Ready\")\r\n}", "func (app *App) Initialize(dbConfig DatabaseConfig, serverConfig ServerConfig) {\n\tvar err error\n\tapp.database, err = gorm.Open(\"mysql\", dbConfig.ToString())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// Disable table name pluralization that uses gorm\n\tapp.database.SingularTable(true)\n\tif app.Debug {\n\t\tapp.database.LogMode(true)\n\t}\n\n\t// Create the package service\n\tds := service.PackageService{DB: app.database}\n\n\t// Create router and add logging middleware\n\tapp.router = mux.NewRouter()\n\tapp.router.Use(logger.Logger)\n\n\tv1group := app.router.PathPrefix(\"/v1\").Subrouter()\n\tv1group.HandleFunc(\"/packages\", ds.GetPackagesHandler).Methods(\"GET\")\n\tv1group.HandleFunc(\"/package\", ds.GetPackageHandler).Methods(\"GET\")\n\tv1group.HandleFunc(\"/package/latest\", ds.GetLatestPackageHandler).Methods(\"GET\")\n\n\t// Create server and set timeouts to avoid Slowloris attacks\n\tapp.server = &http.Server{\n\t\tAddr: serverConfig.ToString(),\n\t\tWriteTimeout: time.Second * 10,\n\t\tReadTimeout: time.Second * 10,\n\t\tIdleTimeout: time.Second * 60,\n\t\tHandler: app.router,\n\t}\n}", "func init() {\n\tRepoCreateDatabaseConnection(DatabaseConnection{Name: \"Write presentation\"})\n\tRepoCreateDatabaseConnection(DatabaseConnection{Name: \"Host meetup\"})\n}", "func (Server *Server) Initialize(Dbdriver, DbUser, DbPassword, DbPort, DbHost, DbName string) {\n\n\tvar err error\n\tDBURL := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local\", DbUser, DbPassword, DbHost, DbPort, DbName)\n\tServer.DBServer, err = gorm.Open(Dbdriver, DBURL)\n\tif err != nil {\n\t\tfmt.Printf(\"Cannot connect to %s database\", Dbdriver)\n\t\tlog.Fatal(\"This is the error:\", err)\n\t} else {\n\t\tfmt.Printf(\"We are connected to the %s database\", Dbdriver)\n\t}\n\n\tServer.DBServer.Debug().AutoMigrate(&Data{})\n}", "func Initialize() {\n\tfmt.Println(\"inited DB\")\n\tvar err error\n\tclient, err = mongo.Connect(bg(), options.Client().ApplyURI(config.DatabaseURL))\n\tif err != nil {\n\t\tlog.Fatalf(\"%+v\\n\", err)\n\t}\n\n\tdb = client.Database(config.DatabaseName)\n}", "func (a *Context) Init(config *structs.Config) {\r\n\tvar err error\r\n\r\n\ta.DB, err = database.Init(config)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err, \"couldn't connect to db\")\r\n\t}\r\n\r\n\ta.Router = routes.Init(a.DB, config)\r\n}", "func Initalize(r *httprouter.Router) {\n\tvar err error\n\n\tdbUsername := os.Getenv(\"DB_USERNAME\")\n\tdbPassword := os.Getenv(\"DB_PASSWORD\")\n\tdbDatabase := os.Getenv(\"DB_DATABASE\")\n\n\tmessageRaw, err := ioutil.ReadFile(\"./message.txt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tmessage = strings.Split(string(messageRaw), \"\\n\")\n\n\tdb, err = sql.Open(\"mysql\", dbUsername+\":\"+dbPassword+\"@/\"+dbDatabase+\"?charset=utf8mb4&collation=utf8mb4_unicode_ci\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpassword = os.Getenv(\"PASSWORD\")\n\n\tfmt.Printf(\"PASSWORD: %s\\n\", password)\n\n\tr.POST(\"/login\", loginRoute)\n\tr.GET(\"/contestants\", contestantsRoute)\n\tr.POST(\"/vote\", voteRoute)\n\tr.GET(\"/photos/:name\", photosRoute)\n}", "func Initialize() {\r\n\tlog.Info(\"BB: Initializing database service\")\r\n\r\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\r\n\tdefer cancel()\r\n\r\n\tc, err := mongo.Connect(ctx, options.Client().ApplyURI(os.Getenv(\"M_URL\")))\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tClient = c\r\n\r\n\tRestCollection = Client.Database(os.Getenv(\"M_DB\")).Collection(\"restaurants\")\r\n\tUserCollection = Client.Database(os.Getenv(\"M_DB\")).Collection(\"users\")\r\n\tCardCollection = Client.Database(os.Getenv(\"M_DB\")).Collection(\"cards\")\r\n\r\n\terr = Client.Ping(ctx, nil)\r\n\tif err != nil {\r\n\t\tlog.Error(err)\r\n\t}\r\n\r\n\tlog.Info(\"BB: Connected to the following databases:\")\r\n\tlog.Info(Client.ListDatabaseNames(ctx, bson.D{}))\r\n}", "func (a *prUserIdMapperApp) Initialize() {\n\n\t// Override defaults\n\ta.initializeEnvironment()\n\n\t// Build connection strings\n\tconnectionString := fmt.Sprintf(\"user=%s password=%s dbname=%s sslmode=%s host=%s port=%s\",\n\t\tdbconf.username,\n\t\tdbconf.password,\n\t\tdbconf.database,\n\t\tdbconf.sslMode,\n\t\tdbconf.ip,\n\t\tdbconf.port)\n\n\thttpconf.listenString = fmt.Sprintf(\"%s:%s\", httpconf.ip, httpconf.port)\n\n\tvar err error\n\ta.DB, err = sql.Open(dbconf.dbDriver, connectionString)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ta.Router = mux.NewRouter()\n\ta.initializeRoutes()\n}", "func Init() {\n\n\t// Crear un nuevo router.-\n\trouter := mux.NewRouter()\n\n\t// Configurar los recursos.-\n\n\t//\tGET.-\n\trouter.HandleFunc(\"/mongoDB/HeaderInfo\", getHeaders).Methods(\"GET\")\n\trouter.HandleFunc(\"/mongoDB/Database/{databaseName}/Collection/{collectionName}/Locomotives\", getLocomotives).Methods(\"GET\")\n\trouter.HandleFunc(\"/mongoDB/Database/{databaseName}/Collection/{collectionName}/Locomotive/{model}\", getLocomotive).Methods(\"GET\")\n\n\t//\tPOST.-\n\trouter.HandleFunc(\"/mongoDB/Database/{databaseName}/Collection/{collectionName}/Locomotive\", postLocomotive).Methods(\"POST\")\n\n\t//\tPATCH.-\n\trouter.HandleFunc(\"/mongoDB/Database/{databaseName}/Collection/{collectionName}/Locomotive/{model}\", patchLocomotive).Methods(\"PATCH\")\n\n\t//\tDELETE.-\n\trouter.HandleFunc(\"/mongoDB/Database/{databaseName}/Collection/{collectionName}/Locomotive/{model}\", deleteLocomotive).Methods(\"DELETE\")\n\n\t//\tDejar el servicio escuchando.-\n\tlog.Fatal(http.ListenAndServe(port, router))\n}", "func Initialize() {\n\tdatabaseHost := os.Getenv(\"DB_HOST\")\n\tdatabasePort := os.Getenv(\"DB_PORT\")\n\tdatabaseUser := os.Getenv(\"DB_USER\")\n\tdatabasePass := os.Getenv(\"DB_PASS\")\n\tdatabaseName := os.Getenv(\"DB_NAME\")\n\n\tpostgresConnectionURL := fmt.Sprintf(\"postgres://%s:%s@%s:%s/%s?sslmode=disable\", databaseUser, databasePass, databaseHost, databasePort, databaseName)\n\n\tvar err error\n\tdb, err = sql.Open(\"postgres\", postgresConnectionURL)\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\tmaxOpenConn, err := strconv.Atoi(os.Getenv(\"DB_MAX_OPEN_CONN\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tmaxIdleConn, err := strconv.Atoi(os.Getenv(\"DB_MAX_IDLE_CONN\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdb.SetMaxOpenConns(maxOpenConn)\n\tdb.SetMaxIdleConns(maxIdleConn)\n\n\tfmt.Println(\"Database connected!\")\n\n}", "func InitializeDb() {\n\tdbPort, err := strconv.Atoi(os.Getenv(\"DB_PORT\"))\n\tif err != nil {\n\t\tlog.Fatal(\"Database port is not valid\")\n\t}\n\n\tdbConnString := fmt.Sprintf(\n\t\t\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\tos.Getenv(\"DB_HOST\"),\n\t\tdbPort,\n\t\tos.Getenv(\"DB_USER\"),\n\t\tos.Getenv(\"DB_PASS\"),\n\t\tos.Getenv(\"DB_NAME\"),\n\t)\n\n\tDB, err = sql.Open(\"postgres\", dbConnString)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not connect to db- \", err)\n\t}\n}", "func init() {\n\tlog.Info(\"Initializing database\")\n\tpsqlInfo := fmt.Sprintf(\"host=%s port=%s user=%s \"+\n\t\t\"password=%s dbname=%s sslmode=disable\",\n\t\tconfig.Config().GetString(\"database.host\"),\n\t\tconfig.Config().GetString(\"database.port\"),\n\t\tconfig.Config().GetString(\"database.user\"),\n\t\tconfig.Config().GetString(\"database.password\"),\n\t\tconfig.Config().GetString(\"database.name\"))\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\tlog.Info(\"Successfully connected to database!\")\n}", "func init() {\n\t_ = godotenv.Load()\n\n\thostname := os.Getenv(\"HOST\")\n\tdbname := os.Getenv(\"DBNAME\")\n\tusername := os.Getenv(\"DBUSER\")\n\tpassword := os.Getenv(\"PASSWORD\")\n\n\tdbString := \"host=\" + hostname + \" user=\" + username + \" dbname=\" + dbname + \" sslmode=disable password=\" + password\n\n\tvar err error\n\tdb, err = gorm.Open(\"postgres\", dbString)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\tpanic(\"Unable to connect to DB\")\n\t}\n\n\tdb.AutoMigrate(&QuestionModel{})\n\tdb.AutoMigrate(&AnswerModel{})\n\tdb.AutoMigrate(&UserModel{})\n\tdb.AutoMigrate(&Cohort{})\n}", "func init() {\r\n\tCandidates = ConnectDB(\"Candidates\")\r\n}", "func (db *Database) Init() {\n\tdata, dbErr := tiedot.OpenDB(db.Location)\n\tif dbErr != nil {\n\t\tlog.Error(dbConnectionError{\n\t\t\tmsg: \"Failed to connect to the tiedot database\",\n\t\t\terr: dbErr,\n\t\t})\n\t}\n\n\t// Set up the collections - throw away the error for now.\n\tfor _, c := range db.Collections {\n\t\tdata.Create(c.Name)\n\t\tdata.Use(c.Name).Index(c.Index)\n\t}\n\n\tdb.Data = data\n}", "func InitializeDatabase() {\n\tvar err error\n\tconnectionString := os.Getenv(\"POSTGRES_CONNECTION_STRING\")\n\n\tif connectionString == \"\" {\n\t\tconnectionString = \"user=crudwizard password=crudwizard dbname=crudwizard sslmode=disable\"\n\t}\n\n\tDatabase, err = gorm.Open(\"postgres\", connectionString)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvalidations.RegisterCallbacks(Database)\n\n\tDatabase.LogMode(true)\n\tDatabase.AutoMigrate(&models.User{})\n\tDatabase.AutoMigrate(&models.Project{})\n\tDatabase.AutoMigrate(&models.AuthToken{})\n}", "func (p *DatabaseHandler) init(s *Server) error {\n\tdb, err := sql.Open(\"sqlite3\", s.srcDir+\"/database.db\")\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn StringError{\"ERROR: Some of databases weren't opened!\"}\n\t}\n\tp.db = db\n\n\tp.createTable()\n\treturn nil\n}", "func (server *Server) Initialize(Dbdriver, DbUser, DbPassword, DbPort, DbHost, DbName string) *gorm.DB {\n\tvar err error\n\n\tif Dbdriver == \"postgres\" {\n\t\tDBURL := fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s sslmode=disable password=%s\", DbHost, DbPort, DbUser, DbName, DbPassword)\n\t\tserver.DB, err = gorm.Open(Dbdriver, DBURL)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Cannot connect to %s database\", err)\n\n\t\t} else {\n\t\t\tlog.Printf(\"We are connected to the %s database\", Dbdriver)\n\t\t}\n\t}\n\n\treturn server.DB\n}", "func init() {\n\t// Open a connection to GORM\n\tdb, err := gorm.Open(\"sqlite3\", \"shop.db\")\n\tif err != nil {\n\t\tpanic(\"Failed to connect database\")\n\t}\n\n\tDB = db\n\n\tDB.AutoMigrate(models.Supply{})\n}", "func Initialize() {\n\tdb, err := gorm.Open(\"mysql\", os.Getenv(\"MYSQL_CACHE_ENDPOINT\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tConnection = db\n\tautoMigrate()\n}", "func Init() {\n\tvar err error\n\tdsn := \"host=localhost user=postgres password=postgres dbname=goMux_db port=5430 sslmode=disable\"\n\tDB, err = gorm.Open(postgres.Open(dsn), &gorm.Config{})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"Connect to the DB\")\n\t// DB.AutoMigrate(&models.User{})\n}", "func init() {\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tclient, err := mongo.Connect(ctx, options.Client().ApplyURI(os.Getenv(\"BRAIN_DB\")))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdb = client.Database(dbName)\n}", "func Initialize(host string, routers []*Router, domain string, service string, secretCookie string) Routers {\n\thandlers = routers\n\treturn &routing{\n\t\thost: host,\n\t\tdomain: domain,\n\t\tservice: service,\n\t\tsecretCookie: secretCookie,\n\t}\n}", "func init() {\n\tvar err error\n\n\tsignKey, err = ioutil.ReadFile(privKeyPath)\n\tif err != nil {\n\t\tlog.Fatal(\"Error reading private key\")\n\t\treturn\n\t}\n\n\tverifyKey, err = ioutil.ReadFile(pubKeyPath)\n\tif err != nil {\n\t\tlog.Fatal(\"Error reading private key\")\n\t\treturn\n\t}\n\n\t// set up DB\n\tsession, err = mgo.Dial(\"localhost\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tsession.SetSafe(&mgo.Safe{})\n\n\tuserDB = session.DB(\"Theseus\").C(\"users\")\n\tfileDB = session.DB(\"Theseus\").C(\"files\")\n\tfs = http.FileServer(http.Dir(\"client\"))\n\thttp.HandleFunc(\"/\", routeHandler)\n}", "func init() {\n\tctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\n\tclient, err := mongo.Connect(ctx, options.Client().ApplyURI(CONNECTIONSTRING))\n\n\tif err != nil {\n\t\tlog.Fatal(\"[init]: %s\\n\", err)\n\t}\n\t// Collection types can be used to access the database\n\tdb = client.Database(DBNAME)\n\n}", "func (ua *App) Initialize(ev *enliven.Enliven) {\n\tif !ev.MiddlewareInstalled(\"session\") {\n\t\tpanic(\"The User app requires Session middleware to be registered.\")\n\t}\n\tif !ev.AppInstalled(\"default_database\") {\n\t\tpanic(\"The User app requires that the Database app is initialized with a default connection.\")\n\t}\n\n\tvar conf = config.Config{\n\t\t\"user_login_route\": \"/user/login/\",\n\t\t\"user_logout_route\": \"/user/logout/\",\n\t\t\"user_register_route\": \"/user/register/\",\n\t\t\"user_verify_route\": \"/user/verify/{code}/\",\n\t\t\"user_forgot_password_route\": \"/user/forgot-password/\",\n\t\t\"user_password_reset_route\": \"/user/reset-password/{code}\",\n\t\t\"user_profile_route\": \"/user/profile/\",\n\n\t\t// Where the user will be redirected after these successful actions\n\t\t\"user_login_redirect\": \"/\",\n\t\t\"user_logout_redirect\": \"/\",\n\t\t\"user_register_redirect\": \"/user/login/\",\n\t\t\"user_password_reset_redirect\": \"/user/login/\",\n\t\t\"user_profile_redirect\": \"/user/profile/\",\n\n\t\t\"user_default_group\": \"Member\",\n\t\t\"user_require_verification\": \"1\",\n\t}\n\n\tconf = config.UpdateConfig(config.MergeConfig(conf, config.GetConfig()))\n\n\tdb := database.GetDatabase()\n\n\t// Migrating the user tables\n\tdb.AutoMigrate(&Permission{}, &Group{}, &User{})\n\tua.initDefaultUserModels(db)\n\n\t// Routing setup\n\tev.AddRoute(conf[\"user_login_route\"], LoginGetHandler, \"GET\")\n\tev.AddRoute(conf[\"user_login_route\"], LoginPostHandler, \"POST\")\n\tev.AddRoute(conf[\"user_register_route\"], RegisterGetHandler, \"GET\")\n\tev.AddRoute(conf[\"user_register_route\"], RegisterPostHandler, \"POST\")\n\tev.AddRoute(conf[\"user_profile_route\"], ProfileGetHandler, \"GET\")\n\tev.AddRoute(conf[\"user_profile_route\"], ProfilePostHandler, \"POST\")\n\tev.AddRoute(conf[\"user_verify_route\"], VerifyHandler)\n\tev.AddRoute(conf[\"user_logout_route\"], LogoutHandler)\n\tev.AddRoute(conf[\"user_forgot_password_route\"], ForgotPasswordGetHandler, \"GET\")\n\tev.AddRoute(conf[\"user_forgot_password_route\"], ForgotPasswordPostHandler, \"POST\")\n\tev.AddRoute(conf[\"user_password_reset_route\"], PasswordResetGetHandler, \"GET\")\n\tev.AddRoute(conf[\"user_password_reset_route\"], PasswordResetPostHandler, \"POST\")\n\n\t// Handles the setup of context variables to support user session management\n\tev.AddMiddlewareFunc(SessionMiddleware)\n\n\tfor _, templateType := range []string{\"login\", \"forgot_password\", \"forgot_password_email\", \"register\", \"verify\", \"profile\", \"verify_email\"} {\n\t\tev.Core.TemplateManager.BaseTemplate.Parse(getTemplate(templateType))\n\t}\n\n\tadmin.AddResources(&User{}, &Group{}, &Permission{})\n\n\t// Setting this app as the authorizer\n\tev.Auth = ua\n}", "func DBInit(conStr string) {\n\tif db == nil {\n\t\tvar err error\n\t\tdbConnection, err := gorm.Open(\"mysql\", conStr+\"?charset=utf8&parseTime=True&loc=Local\")\n\t\t// db connection will be closed if there's no request for a while\n\t\t// which would cause 500 error when a new request comes.\n\t\t// diable pool here to avoid this problem.\n\t\tdbConnection.DB().SetMaxIdleConns(0)\n\t\tif err != nil {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"error\": err.Error(),\n\t\t\t}).Fatal(\"Faile to create db connection pool\")\n\t\t} else {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"message\": dbConnection.GetErrors(),\n\t\t\t\t\"db\": conStr,\n\t\t\t}).Info(\"connected to mysql\")\n\t\t}\n\t\tdb = &DB{dbConnection}\n\t}\n\tdb.dbConnect.SetLogger(log.StandardLogger())\n\t// db.Debug message will be logged be logrug with Info level\n\tdb.dbConnect.Debug().AutoMigrate(&Todo{})\n}", "func InitDBConnection() *Database {\n\thost := viper.GetString(\"db.host\")\n\tuser := viper.GetString(\"db.user\")\n\tdbname := viper.GetString(\"db.dbname\")\n\tdbConfig := fmt.Sprintf(\"host=%s user=%s dbname=%s sslmode=disable\", host, user, dbname)\n\tdb, err := gorm.Open(\"postgres\", dbConfig)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"Failed to initiate a connection to the database: %s\", err))\n\t}\n\n\tfmt.Println(\"Migrating database\")\n\tdb.AutoMigrate(&User{}, &Organization{}, &Restaurant{}, &Menu{}, &Activity{}, &OrderItem{})\n\n\treturn &Database{db}\n}", "func Init() {\n\trouter := mux.NewRouter()\n\t// Routes consist of a path and a handler function.\n\trouter.HandleFunc(\"/v1/transaction\", transaction).Methods(http.MethodPost)\n\n\t// Bind to a port and pass our router in\n\tlog.Fatal(http.ListenAndServe(viper.GetString(config.ListeningPort), router))\n}", "func (a *App) Initialize(config *models.StartupConfiguration) {\n\ta.IP = config.DBIp\n\ta.Port = config.Port\n}", "func init() {\n\n\t// Standard routes\n\trouter.Get(\"/userteam\", GetAllUserTeams)\n\trouter.Get(\"/userteam/:id\", GetUserTeam)\n\trouter.Post(\"/userteam\", PostUserTeam)\n\trouter.Put(\"/userteam/:id\", PutUserTeam)\n\trouter.Delete(\"/userteam/:id\", DeleteUserTeam)\n}", "func InitializeDatabase(config string, log debug.Logger) {\n\tdatabaseAccess = databaseConnection{dbconfig: config, log: log}\n\tdatabaseAccess.initialize()\n}", "func init() {\n\tschemaConfig := graphql.SchemaConfig{\n\t\tQuery: rootQuery,\n\t\tMutation: rootMutation,\n\t}\n\tschema, err = graphql.NewSchema(schemaConfig)\n\tif err != nil {\n\t\tlog.Fatal(errors.Wrap(err, \"Failed to create a new schema\"))\n\t}\n\tmuxRouter.HandleFunc(\"/graphql\", graphQLHandler)\n}", "func (a *App) Initialise() {\n\ta.initialiseConfig()\n\ta.Router = mux.NewRouter()\n\ta.Client = a.initialiseDatabase()\n\ta.initialiseRoutes()\n}", "func init() {\n\tuser := \"root\"\n\tpass := \"pwpw\"\n\tname := \"itemsDB\"\n\n\tdbconf := user + \":\" + pass + \"@/\" + name\n\tconn, err := sql.Open(\"mysql\", dbconf)\n\tif err != nil {\n\t\tpanic(err.Error)\n\t}\n\tConn = conn\n}", "func Init() {\n\tvar mongoURL bytes.Buffer\n\tvar err error\n\tconfiguration := conf.Get()\n\ttemplate.Must(template.New(\"mongo_url\").Parse(`mongodb://{{.UserName}}:{{.Password}}@localhost:{{.Port}}`)).Execute(&mongoURL, configuration.Database)\n\tSession, err = mgo.Dial(mongoURL.String())\n\tif err != nil {\n\t\tgolog.Errorf(\"Database connection error: %s\", err.Error())\n\t}\n\tDatabase = Session.DB(configuration.Database.Name)\n}", "func init() {\n\tos.RemoveAll(DataPath)\n\n\tdc := DatabaseConfig{\n\t\tDataPath: DataPath,\n\t\tIndexDepth: 4,\n\t\tPayloadSize: 16,\n\t\tBucketDuration: 3600000000000,\n\t\tResolution: 60000000000,\n\t\tSegmentSize: 100000,\n\t}\n\n\tcfg := &ServerConfig{\n\t\tVerboseLogs: true,\n\t\tRemoteDebug: true,\n\t\tListenAddress: Address,\n\t\tDatabases: map[string]DatabaseConfig{\n\t\t\tDatabase: dc,\n\t\t},\n\t}\n\n\tdbs := map[string]kdb.Database{}\n\tdb, err := dbase.New(dbase.Options{\n\t\tDatabaseName: Database,\n\t\tDataPath: dc.DataPath,\n\t\tIndexDepth: dc.IndexDepth,\n\t\tPayloadSize: dc.PayloadSize,\n\t\tBucketDuration: dc.BucketDuration,\n\t\tResolution: dc.Resolution,\n\t\tSegmentSize: dc.SegmentSize,\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdbs[\"test\"] = db\n\td = db\n\to = dc\n\n\ts = NewServer(dbs, cfg)\n\tgo s.Listen()\n\n\t// wait for the server to start\n\ttime.Sleep(time.Second * 2)\n\n\tc = NewClient(Address)\n\tif err := c.Connect(); err != nil {\n\t\tpanic(err)\n\t}\n}", "func (a *App) Initialize() {\n\terr := a.session.Open()\n\tif err != nil {\n\t\tlog.Fatalln(\"unable to connect to mongodb\")\n\t}\n\tu := mongo.NewUserService(a.session.Copy())\n\ta.server = server.NewServer(u)\n}", "func Init() {\n\tdbType := config.LoadEnv(\"DB_CONNECTION\")\n\tvar connectionString string\n\n\tif dbType == \"mysql\" {\n\t\tconnectionString = fmt.Sprintf(\n\t\t\t\"%s:%s@(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local\",\n\t\t\tconfig.LoadEnv(\"DB_USERNAME\"), config.LoadEnv(\"DB_PASSWORD\"), config.LoadEnv(\"DB_HOST\"), config.LoadEnv(\"DB_NAME\"))\n\t} else if dbType == \"postgres\" {\n\t\tconnectionString = fmt.Sprintf(\n\t\t\t\"host=%s port=%s user=%s dbname=%s sslmode=disable password=%s\",\n\t\t\tconfig.LoadEnv(\"DB_HOST\"), config.LoadEnv(\"DB_PORT\"), config.LoadEnv(\"DB_USERNAME\"), config.LoadEnv(\"DB_NAME\"), config.LoadEnv(\"DB_PASSWORD\"))\n\t}\n\n\tdb, err = gorm.Open(dbType, connectionString)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n}", "func (r *RavelDatabase) Init(path string) error {\n\tvar err error\n\n\toptions := badger.DefaultOptions(path)\n\toptions.Logger = nil\n\toptions.SyncWrites = true\n\n\tr.Conn, err = badger.Open(options)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func DBInit() {\n\t// Mode = \"PRODUCTION\"\n\t// if Mode == \"PRODUCTION\" {\n\t// \tDatabaseURL = \"test.sqlite3\"\n\t// \tDatabaseName = \"sqlite3\"\n\t// } else if Mode == \"DEPLOY\" {\n\tDatabaseURL = os.Getenv(\"DATABASE_URL\")\n\tDatabaseName = \"postgres\"\n\t// }\n\n\tdb, err := gorm.Open(DatabaseName, DatabaseURL)\n\tif err != nil {\n\t\tpanic(\"We can't open database!(dbInit)\")\n\t}\n\t//残りのモデルはまだ入れてない。\n\tdb.AutoMigrate(&model.Post{})\n\tdb.AutoMigrate(&model.User{})\n\tdb.AutoMigrate(&model.Room{})\n\tdefer db.Close()\n}", "func Init(mongoclient *mongo.Client, mongostore *mongostore.MongoStore, apiclient *grpc.ClientConn) *mux.Router {\n\tclient = mongoclient\n\tstore = mongostore\n\tapiClient = apiclient\n\n\terr := initTemplates()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\trouter = initRouter()\n\n\t// seed roles\n\terr = roleSeed()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// seed routes\n\terr = routeSeed()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn router\n}", "func (db *Database) init() (*gorm.DB, error) {\n\tvar connection, err = gorm.Open(db.Driver, db.getURI())\n\tif err != nil {\n\t\tfmt.Printf(\"✖ Cannot connect to %s database\\n\", db.Driver)\n\t\tlog.Fatal(\"This is the error:\", err)\n\t} else {\n\t\tfmt.Printf(\"⚡ We are connected to the %s database\\n\", db.Driver)\n\t}\n\treturn connection, err\n}", "func (app *App) Initialize() {\r\n\tapp.Router = mux.NewRouter()\r\n\tapp.initializeRoutes()\r\n}", "func (a *App) Initialize() {\n\ta.Router = mux.NewRouter()\n\ta.setRouters()\n\ta.Clientset = k8manager.Initialize()\n}", "func (a *App) InitRoutes() {\n\ta.Router = mux.NewRouter()\n\n\tsrv := handler.NewDefaultServer(generated.NewExecutableSchema(generated.Config{Resolvers: &graph.Resolver{Service: a.Service}}))\n\ta.Router.Handle(\"/playground\", playground.Handler(\"GoNeo4jGql GraphQL playground\", \"/movies\"))\n\ta.Router.Handle(\"/movies\", srv)\n}", "func init() {\n\tdao.Server = \"mongodb://shivam:msmpsm1@ds225294.mlab.com:25294/shayona-store\"\n\tdao.Database = \"shayona-store\"\n\tdao.Connect()\n}", "func (m *SiteSearchTagsDAO) Initialize(mclient *mongo.Client, config *config.AppConfig) error {\n\n\terr := mclient.Ping(context.TODO(), nil)\n\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Error connecting to mongodb\")\n\t}\n\n\t//log.Info().Msg(\"MediaTagsDAO connected successfully to mongodb\")\n\n\tm.DBClient = mclient\n\tm.Config = config\n\n\treturn nil\n}", "func init() {\n\tcfg = pkg.InitializeConfig()\n\t_, err := pkg.InitializeDb()\n\tif err != nil {\n\t\tpanic(\"failed to initialize db connection : \" + err.Error())\n\t}\n}", "func Init(debug bool) {\n\t// Connect to the database\n\tInitDB(debug)\n}", "func Init() {\n\tcreateDB(\"backendtest\")\n\tuseDB(\"backendtest\")\n\tCreateUserTable()\n\tCreateEventTable()\n\tCreateAddFriendTable()\n}", "func (c *FwRouter) Initialize(con util.XapiClient) {\n\tc.con = con\n\tc.ns = namespace.New(singular, plural, con)\n}", "func (programRepo *mockProgramRepo) Initialize(ctx context.Context, db *sql.DB) {}", "func InitRoutes(db *sql.DB, cnf config.Config) *mux.Router {\n\trouter := mux.NewRouter()\n\trouter = setRESTRoutes(db, cnf, router)\n\trouter = setIPCRoutes(db, cnf, router)\n\treturn router\n}", "func InitDatabase() *Database {\n\t// eg. \"postgres://postgres:postgres@localhost/postgres?sslmode=disable\"\n\t// TODO: enable SSL on DB\n\tconn, err := sql.Open(\"postgres\", os.Getenv(\"PG_CONNECTION_STRING\"))\n\tif err != nil {\n\t\tlog.Fatal(err) // kill server if we can't use DB on startup\n\t}\n\treturn &Database{\n\t\tconn: conn,\n\t}\n}", "func (server *Server) InitialiseRoutes() {\n\tserver.router = mux.NewRouter().StrictSlash(true)\n\tserver.router.Handle(\"/\", appHandler(server.hello))\n\tserver.router.Handle(\"/runs\", appHandler(server.createRun)).Methods(\"POST\")\n\n\trunRouter := server.router.PathPrefix(\"/runs/{id}\").Subrouter()\n\trunRouter.Handle(\"/app\", appHandler(server.getApp)).Methods(\"GET\")\n\trunRouter.Handle(\"/app\", appHandler(server.putApp)).Methods(\"PUT\")\n\trunRouter.Handle(\"/cache\", appHandler(server.getCache)).Methods(\"GET\")\n\trunRouter.Handle(\"/cache\", appHandler(server.putCache)).Methods(\"PUT\")\n\trunRouter.Handle(\"/output\", appHandler(server.getOutput)).Methods(\"GET\")\n\trunRouter.Handle(\"/output\", appHandler(server.putOutput)).Methods(\"PUT\")\n\trunRouter.Handle(\"/exit-data\", appHandler(server.getExitData)).Methods(\"GET\")\n\trunRouter.Handle(\"/start\", appHandler(server.startRun)).Methods(\"POST\")\n\trunRouter.Handle(\"/events\", appHandler(server.getEvents)).Methods(\"GET\")\n\trunRouter.Handle(\"/events\", appHandler(server.createEvent)).Methods(\"POST\")\n\trunRouter.Handle(\"\", appHandler(server.delete)).Methods(\"DELETE\")\n\tserver.router.Use(server.recordTraffic)\n\trunRouter.Use(server.checkRunCreated)\n\tserver.router.Use(logRequests)\n}", "func (service *Service) Initialize(ctx context.Context) error {\n\thandleErr(service.openSQLDBConnections(ctx))\n\thandleErr(service.openRedisConnections(ctx))\n\thandleErr(service.openExternalConnections(ctx))\n\thandleErr(service.initGRPC(ctx))\n\treturn nil\n}", "func (a *WsApp) Initialize(pg *pgx.Conn) {\n\n\ta.DB = pg\n\n\tchannel := \"address_notify\"\n\terr := a.DB.Listen(channel)\n\tif err != nil {\n\t\tlog.Fatalf(\"Cannot subscribe on the %s channel, %v\", channel, err)\n\t}\n\n\tchannel = \"blocks_notify\"\n\terr = a.DB.Listen(channel)\n\tif err != nil {\n\t\tlog.Fatalf(\"Cannot subscribe on the %s channel, %v\", channel, err)\n\t}\n}", "func (announceRepo *mockAnnounceRepo) Initialize(ctx context.Context, db *sql.DB) {}", "func init() {\n\n\tvar err error\n db, err = sql.Open(\"postgres\",\"user=snake dbname=snake_game sslmode=disable port=26257\")\n\t\n\tif err != nil {\n\t\tlog.Fatal(\"error connecting to the database: \", err, nil)\n\t}\n\n if err != nil {\n\t\tlog.Fatal(\"error connecting to the database: \", err, nil)\n\t}\n}", "func InitDatabase() *Server {\n\tvar err error\n\n\tconnString := getConnString()\n\n\tlog.Printf(\"Setting connection to db with configuration: %s \\n\", connString)\n\n\tserver := &Server{}\n\tserver.db, err = sql.Open(\"sqlserver\", connString)\n\tif err != nil {\n\t\tlog.Fatal(\"Error opening connection: \", err.Error())\n\t}\n\n\tserver.db.SetConnMaxLifetime(time.Minute * 4)\n\n\treturn server\n}", "func Initialize() error {\n\tsugar.Debug(\"Initialize\")\n\tif nil != DB {\n\t\tDB.Close()\n\t\tDB = nil\n\t}\n\tif err := removeDatabase(); err != nil {\n\t\treturn err\n\t}\n\treturn ConnectDB()\n}", "func init() {\n\tvar err error\n\tDB, err = gorm.Open(config.MysqlConf.DriverName, config.MysqlConf.Conn)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tDB.DB().SetMaxOpenConns(config.MysqlConf.MaxOpenConns)\n\tDB.DB().SetMaxIdleConns(config.MysqlConf.MaxIdleConns)\n\tDB.DB().SetConnMaxLifetime(time.Duration(config.MysqlConf.ConnMaxLifetime))\n\t//DB.LogMode(true)\n}", "func Init() {\n\tc := config.GetConfig()\n\n\tdb, err = gorm.Open(\"postgres\", \"host=\"+c.GetString(\"db.host\")+\" user=\"+c.GetString(\"db.user\")+\" dbname=\"+c.GetString(\"db.dbname\")+\" sslmode=disable password=\"+c.GetString(\"db.password\"))\n\tif err != nil {\n\t\tpanic(\"failed to connect database : \" + err.Error())\n\t}\n\n\tdb.Exec(\"CREATE EXTENSION IF NOT EXISTS \\\"uuid-ossp\\\";\")\n\n\tdb.AutoMigrate(&models.SendTemplate{}, &models.SmsTemplate{}, &models.User{})\n\n\tdb.Model(&models.SmsTemplate{}).AddForeignKey(\"user_id\", \"users(id)\", \"RESTRICT\", \"RESTRICT\")\n\tdb.Model(&models.SendTemplate{}).AddForeignKey(\"sms_template_id\", \"sms_templates(id)\", \"RESTRICT\", \"RESTRICT\")\n}", "func Initialize(mongo *mongo.Client, opts ...*DBOptions) {\n\tdbManager = &DBManager{}\n\toptions := &DBOptions{}\n\n\tif len(opts) == 0 {\n\t\toptions.databaseName = \"Cryb\"\n\t\toptions.userCollection = \"Users\"\n\t\toptions.portalCollection = \"Portals\"\n\t\toptions.roomCollection = \"Rooms\"\n\t\toptions.messageCollection = \"Messages\"\n\t} else {\n\t\toptions = opts[0]\n\n\t\tif options.databaseName == \"\" {\n\t\t\toptions.databaseName = \"Cryb\"\n\t\t}\n\t\tif options.userCollection == \"\" {\n\t\t\toptions.userCollection = \"Users\"\n\t\t}\n\t\tif options.portalCollection == \"\" {\n\t\t\toptions.portalCollection = \"Portals\"\n\t\t}\n\t\tif options.roomCollection == \"\" {\n\t\t\toptions.roomCollection = \"Rooms\"\n\t\t}\n\t\tif options.messageCollection == \"\" {\n\t\t\toptions.messageCollection = \"Messages\"\n\t\t}\n\t}\n\n\tdbManager.database = mongo.Database(options.databaseName)\n\tdbManager.userCollection = dbManager.database.Collection(options.userCollection)\n\tdbManager.portalCollection = dbManager.database.Collection(options.portalCollection)\n\tdbManager.roomCollection = dbManager.database.Collection(options.roomCollection)\n\tdbManager.messageCollection = dbManager.database.Collection(options.messageCollection)\n\n\tpackageReady = true\n}", "func (locationRepo *mockLocationRepo) Initialize(ctx context.Context, db *sql.DB) {}", "func init() {\n\tdbinfo := fmt.Sprintf(\"user=%s password=%s dbname=%s sslmode=disable\",\n\t\tos.Getenv(\"POSTGRES_USER\"), os.Getenv(\"POSTGRES_PASSWORD\"), DATABASE_NAME)\n\tdb, err := sql.Open(\"postgres\", dbinfo)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tDB = db\n}", "func (a *App) Initialize() {\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n\ta.Router = mux.NewRouter()\n\ta.MiddleWares = &MiddleWare{}\n\ta.initializeRoutes()\n}", "func Init(d *db.Database, c config.Config) *Server {\n\tr := mux.NewRouter()\n\th := &http.Server{\n\t\tHandler: r,\n\t\tAddr: c.Web.Addr,\n\t\tWriteTimeout: 15 * time.Second,\n\t\tReadTimeout: 15 * time.Second,\n\t}\n\tsrv := &Server{\n\t\tDB: d,\n\t\trouter: r,\n\t\tHS: h,\n\t\tConfig: c,\n\t}\n\treturn srv\n}", "func init() {\n\tdbconn, err := database.NewPostgreDB(dbType, connStr)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsesconn, err := database.NewRedisCache(addr, pass)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tconfig.dbconn = dbconn\n\tconfig.sessionconn = sesconn\n}", "func Initialize() {\n\tconnection := os.Getenv(\"DB_HOST\")\n\tusername := os.Getenv(\"MYSQLUSER\")\n\tpassword := os.Getenv(\"MYSQLPASS\")\n\n\tfor {\n\t\tconn, err := net.DialTimeout(\"tcp\", connection, 6*time.Second)\n\t\tif conn != nil {\n\t\t\tconn.Close()\n\t\t\tbreak\n\t\t}\n\n\t\tlogrus.Info(\"Sleeping till mysql be available... \", err)\n\t\ttime.Sleep(5 * time.Second)\n\t}\n\n\tdb, err := sql.Open(\"mysql\", \"\"+username+\":\"+password+\"@tcp(\"+connection+\")/zinnion?charset=utf8\")\n\tif err != nil {\n\t\tlogrus.Info(\"No connection with mysql, \", err)\n\t}\n\tMysqlClient = db\n}", "func InitializeRouter(s *config.Server) {\n\tr := &Router{\n\t\tRouter: mux.NewRouter(),\n\t\tServer: s,\n\t}\n\n\tinitializeUserRoutes(r)\n\n\tlog.Fatal(http.ListenAndServe(\":8080\", r.Router))\n}", "func (s *Server) InitRoutes() {\n\ts.Router.GET(\"/ingredients\", s.AllIngredients)\n\ts.Router.POST(\"/ingredients\", s.NewIngredient)\n\ts.Router.GET(\"/ingredients/:id\", s.GetIngredient)\n\n\ts.Router.GET(\"/ingredients/:id/relations\", s.GetIngredientRelations)\n\ts.Router.DELETE(\"/ingredients/:id\", s.DeleteIngredient)\n\n\ts.Router.GET(\"/categories\", s.AllCategories)\n\ts.Router.POST(\"/categories\", s.NewCategory)\n\ts.Router.DELETE(\"/categories/:id\", s.DeleteCategory)\n\n\ts.Router.GET(\"/utensils\", s.AllUtensils)\n\ts.Router.POST(\"/utensils\", s.NewUtensil)\n\ts.Router.DELETE(\"/utensils/:id\", s.DeleteUtensil)\n\n\ts.Router.GET(\"/measures\", s.AllMeasures)\n\n\ts.Router.POST(\"/recipes\", s.NewRecipe)\n\ts.Router.GET(\"/recipes\", s.SearchRecipe)\n\ts.Router.GET(\"/recipes/:id\", s.RecipeById)\n\ts.Router.PUT(\"/recipes/:id\", s.UpdateRecipe)\n\ts.Router.DELETE(\"/recipes/:id\", s.DeleteRecipe)\n\n\ts.Router.POST(\"/recipes/images\", s.UploadImages)\n\n\ts.Router.GET(\"/live\", s.Live)\n}", "func Initialize() common.Router {\n\tportNumber := \"9000\"\n\n\t//CORS\n\tcorsConfig := cors.DefaultConfig()\n\tcorsConfig.AllowOrigins = whiteList\n\tcorsConfig.AllowMethods = allowMethods\n\tcorsConfig.AllowHeaders = allowHeaders\n\tcorsConfig.AllowCredentials = true\n\n\treturn common.Router{\n\t\tEngine: gin.Default(),\n\t\tPort: portNumber,\n\t}\n}", "func init() {\n\trouter().GET(\"/ping\", pingHandler)\n}", "func init() {\n\t//orm.RegisterDriver(\"mysql\", orm.DRMySQL)\n\n\tmysqlReg := beego.AppConfig.String(\"mysqluser\") + \":\" +\n\t\tbeego.AppConfig.String(\"mysqlpass\") + \"@tcp(127.0.0.1:3306)/\" +\n\t\tbeego.AppConfig.String(\"mysqldb\") + \"?charset=utf8&parseTime=true&loc=Australia%2FSydney\"\n\torm.RegisterDataBase(\"default\", \"mysql\", mysqlReg)\n}", "func init() {\n\t// db, err := sql.Open(\"mysql\", mysql_connect)\n\t// if err != nil {\n\t// \tlog.Fatal(err)\n\t// } else {\n\t// \tlog.Println(\"Successfully connected to mysql database\")\n\t// }\n\t// defer db.Close()\n\n}", "func init() {\n\tlog.DebugMode = cuxs.IsDebug()\n\tlog.Log = log.New()\n\n\tif e := cuxs.DbSetup(); e != nil {\n\t\tpanic(e)\n\t}\n}", "func (a *App) Init() {\n\tvar connectionString = \"user:password@tcp(127.0.0.1:3306)/sports_betting_db\"\n\targs := os.Args[1:]\n\tif len(args) > 0 {\n\t\tconnectionString = args[0]\n\t}\n\ta.BetsRepo = betsrepo.NewMysqlRepo(connectionString)\n\ta.Validator = validator.New()\n\ta.Router = chi.NewRouter()\n\ta.initializeRoutes()\n}", "func (s *Server) initializeRoutes() {\n\n\t// Home Route\n\ts.Router.HandleFunc(\"/\", middlewares.SetMiddlewareJSON(s.Home)).Methods(\"GET\")\n\n\ts.Router.HandleFunc(\"/products\", middlewares.SetMiddlewareJSON(s.FindAllProducts)).Methods(\"GET\")\n\ts.Router.HandleFunc(\"/product\", middlewares.SetMiddlewareJSON(s.CreateProduct)).Methods(\"POST\")\n\ts.Router.HandleFunc(\"/product/{id:[0-9]+}\", middlewares.SetMiddlewareJSON(s.GetProduct)).Methods(\"GET\")\n\ts.Router.HandleFunc(\"/product/{id:[0-9]+}\", middlewares.SetMiddlewareJSON(s.UpdateProduct)).Methods(\"PUT\")\n\ts.Router.HandleFunc(\"/product/{id:[0-9]+}\", middlewares.SetMiddlewareJSON(s.DeleteProduct)).Methods(\"DELETE\")\n}", "func (goservice *GoService) Initialize() {\n\tgoservice.Router = mux.NewRouter()\n\n\tgoservice.Router.HandleFunc(\"/health\", goservice.healthCheckHandler)\n\tgoservice.Router.Handle(\"/metrics\", promhttp.Handler())\n\n\tgoservice.Router.HandleFunc(\"/api/v1/event\", goservice.PostCreate).Methods(\"POST\")\n\tgoservice.Router.HandleFunc(\"/api/v1/event\", goservice.GetAll).Methods(\"GET\")\n\tgoservice.Router.HandleFunc(\"/api/v1/event/{id}\", goservice.GetByID).Methods(\"GET\")\n\n\tgoservice.Router.PathPrefix(\"/debug/\").Handler(http.DefaultServeMux)\n\n\tgoservice.Router.Use(loggingMiddleware)\n\tgoservice.Router.Use(goservice.authMiddleware)\n\n\tvar appconfig ConfigParameters = handleConfiguration()\n\tgoservice.Config = &appconfig\n}", "func Init() {\n\tr := router()\n\tr.Run(\":3001\")\n}", "func Init() {\n\tlog.Info(\"Init mongodb instance....\")\n\tclientOptions := options.Client().ApplyURI(connectionString)\n\tclient, err := mongo.Connect(context.TODO(), clientOptions)\n\n\tif err != nil {\n\t\tlog.Error(err.Error())\n\t\treturn\n\t}\n\n\tlog.Info(\"Init mongodb done...\")\n\tdatabase := client.Database(dbName)\n\tusersCollection = database.Collection(\"users\")\n\tproductsCollection = database.Collection(\"products\")\n\tcategoriesCollection = database.Collection(\"categories\")\n\ttestCollection = database.Collection(\"test\")\n}" ]
[ "0.7584453", "0.75465846", "0.7507653", "0.74276567", "0.7385693", "0.7308852", "0.7270049", "0.7269961", "0.7269961", "0.71667546", "0.71504784", "0.71273017", "0.70464236", "0.7006716", "0.6994363", "0.6990787", "0.6919952", "0.68893766", "0.6831192", "0.6829179", "0.67651004", "0.67358905", "0.67140603", "0.6709692", "0.66940063", "0.6657589", "0.6646916", "0.6635729", "0.6634861", "0.66322684", "0.66192573", "0.661232", "0.6602029", "0.65698147", "0.65586245", "0.65342885", "0.6516996", "0.64921355", "0.6482929", "0.64536136", "0.64383024", "0.6414376", "0.641317", "0.64065176", "0.6393308", "0.63798475", "0.63760924", "0.6374439", "0.6360813", "0.63591325", "0.6355499", "0.63552123", "0.6349662", "0.6348678", "0.63467747", "0.6341072", "0.6340196", "0.6319061", "0.6317488", "0.6317081", "0.63157016", "0.6303498", "0.62785894", "0.62690014", "0.62559515", "0.62556887", "0.6250546", "0.624879", "0.6247159", "0.62460554", "0.6240881", "0.62284034", "0.6228323", "0.6222755", "0.62211174", "0.6214182", "0.6209097", "0.6195432", "0.6194221", "0.6194003", "0.6191376", "0.61910146", "0.6183355", "0.61825037", "0.6179881", "0.6175962", "0.616994", "0.6167048", "0.61622554", "0.6160384", "0.61566585", "0.61531985", "0.6150615", "0.61333567", "0.61298925", "0.6125228", "0.6121413", "0.6117536", "0.6116832", "0.61123586" ]
0.767754
0
HookClientConfigForWebhook construct a webhook.ClientConfig using a v1beta1.Webhook API object. webhook.ClientConfig is used to create a HookClient and the purpose of the config struct is to share that with other packages that need to create a HookClient.
HookClientConfigForWebhook строит webhook.ClientConfig с использованием объекта API v1beta1.Webhook. webhook.ClientConfig используется для создания HookClient, и цель структуры конфига — предоставить её другим пакетам, которым необходимо создать HookClient.
func HookClientConfigForWebhook(w *v1beta1.Webhook) webhook.ClientConfig { ret := webhook.ClientConfig{Name: w.Name, CABundle: w.ClientConfig.CABundle} if w.ClientConfig.URL != nil { ret.URL = *w.ClientConfig.URL } if w.ClientConfig.Service != nil { ret.Service = &webhook.ClientConfigService{ Name: w.ClientConfig.Service.Name, Namespace: w.ClientConfig.Service.Namespace, } if w.ClientConfig.Service.Path != nil { ret.Service.Path = *w.ClientConfig.Service.Path } } return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func BuildClientConfigFor(webhookPath string, namespace, componentName string, servicePort int, mode, url string, caBundle []byte) admissionregistrationv1.WebhookClientConfig {\n\tvar (\n\t\tpath = webhookPath\n\t\tclientConfig = admissionregistrationv1.WebhookClientConfig{\n\t\t\t// can be empty if injected later on\n\t\t\tCABundle: caBundle,\n\t\t}\n\t)\n\n\tif !strings.HasPrefix(path, \"/\") {\n\t\tpath = \"/\" + path\n\t}\n\n\tswitch mode {\n\tcase ModeURL:\n\t\tclientConfig.URL = pointer.String(fmt.Sprintf(\"https://%s%s\", url, path))\n\tcase ModeURLWithServiceName:\n\t\tclientConfig.URL = pointer.String(fmt.Sprintf(\"https://%s.%s:%d%s\", PrefixedName(componentName), namespace, servicePort, path))\n\tcase ModeService:\n\t\tclientConfig.Service = &admissionregistrationv1.ServiceReference{\n\t\t\tNamespace: namespace,\n\t\t\tName: PrefixedName(componentName),\n\t\t\tPath: &path,\n\t\t}\n\t}\n\n\treturn clientConfig\n}", "func NewWebhookConfigController(p WebhookParameters) (*WebhookConfigController, error) {\n\n\t// Configuration must be updated whenever the caBundle changes. watch the parent directory of\n\t// the target files so we can catch symlink updates of k8s secrets.\n\tfileWatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, file := range []string{p.CACertFile, p.WebhookConfigFile} {\n\t\twatchDir, _ := filepath.Split(file)\n\t\tif err := fileWatcher.Watch(watchDir); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not watch %v: %v\", file, err)\n\t\t}\n\t}\n\n\twhc := &WebhookConfigController{\n\t\tconfigWatcher: fileWatcher,\n\t\twebhookParameters: &p,\n\t\tcreateInformerWebhookSource: defaultCreateInformerWebhookSource,\n\t}\n\n\tgalleyNamespace, err := whc.webhookParameters.Clientset.CoreV1().Namespaces().Get(\n\t\twhc.webhookParameters.DeploymentAndServiceNamespace, metav1.GetOptions{})\n\tif err != nil {\n\t\tscope.Warnf(\"Could not find %s namespace to set ownerRef. \"+\n\t\t\t\"The validatingwebhookconfiguration must be deleted manually\",\n\t\t\twhc.webhookParameters.DeploymentAndServiceNamespace)\n\t} else {\n\t\twhc.ownerRefs = []metav1.OwnerReference{\n\t\t\t*metav1.NewControllerRef(\n\t\t\t\tgalleyNamespace,\n\t\t\t\tcorev1.SchemeGroupVersion.WithKind(\"Namespace\"),\n\t\t\t),\n\t\t}\n\t}\n\n\treturn whc, nil\n}", "func NewClient(webhook, token string) (*Client, error) {\n\tif len(webhook) == 0 {\n\t\treturn nil, fmt.Errorf(\"webhook url is missing\")\n\t}\n\tif len(token) == 0 {\n\t\treturn nil, fmt.Errorf(\"token is missing\")\n\t}\n\n\tp, err := url.Parse(webhook)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"fail to parse url\")\n\t}\n\tc := &Client{\n\t\tWebhookURL: p,\n\t\tHTTPClient: &http.Client{},\n\t\tHeader: map[string]string{\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"X-Zoom-Token\": token,\n\t\t},\n\t}\n\n\treturn c, nil\n}", "func NewWithConfig(conf Config) (*WebhookHandler, error) {\n\th := &WebhookHandler{}\n\n\tcli, err := newClient(conf)\n\tif err != nil {\n\t\th.loggingError(\"newClient error: %s\", err)\n\t\treturn nil, err\n\t}\n\n\tif conf.BotID == 0 {\n\t\t// get bot's id from github's current user.\n\t\tctx := context.Background()\n\t\tu, _, err := cli.Users.Get(ctx, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tconf.BotID = u.GetID()\n\t\th.loggingInfo(\"botID is fetched from github: %d\", conf.BotID)\n\t}\n\n\th.client = cli\n\th.Config = conf\n\th.loggingInfo(\"initialized\")\n\treturn h, nil\n}", "func (k *KubernetesClient) CreateValidatingWebhookConfiguration(webhookFile, certFile, apiKey, port string) (*admissionv1.ValidatingWebhookConfiguration, error) {\n\twebhooks := admissionv1.ValidatingWebhookConfiguration{}\n\tdata, err := ioutil.ReadFile(webhookFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treader := bytes.NewReader(data)\n\tdecoder := yaml.NewYAMLOrJSONDecoder(reader, 1024)\n\terr = decoder.Decode(&webhooks)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcertData, err := ioutil.ReadFile(certFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\twebhook := &webhooks.Webhooks[0]\n\twebhook.ClientConfig.CABundle = certData\n\tip, err := GetIP()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\turl := fmt.Sprintf(\"https://%s:%s/v1/k8s/webhooks/%s/scan/validate\", ip.String(), port, apiKey)\n\twebhook.ClientConfig.URL = &url\n\n\tadmr := k.client.AdmissionregistrationV1()\n\n\tcreatedWebhookConfig, err := admr.ValidatingWebhookConfigurations().Create(context.TODO(), &webhooks, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn createdWebhookConfig, nil\n}", "func GetCABundleFromWebhookConfig(obj client.Object) ([]byte, error) {\n\tswitch config := obj.(type) {\n\tcase *admissionregistrationv1.MutatingWebhookConfiguration:\n\t\tfor _, webhook := range config.Webhooks {\n\t\t\tif caBundle := webhook.ClientConfig.CABundle; len(caBundle) > 0 {\n\t\t\t\treturn caBundle, nil\n\t\t\t}\n\t\t}\n\tcase *admissionregistrationv1.ValidatingWebhookConfiguration:\n\t\tfor _, webhook := range config.Webhooks {\n\t\t\tif caBundle := webhook.ClientConfig.CABundle; len(caBundle) > 0 {\n\t\t\t\treturn caBundle, nil\n\t\t\t}\n\t\t}\n\tcase *admissionregistrationv1beta1.MutatingWebhookConfiguration:\n\t\tfor _, w := range config.Webhooks {\n\t\t\tif caBundle := w.ClientConfig.CABundle; len(caBundle) > 0 {\n\t\t\t\treturn caBundle, nil\n\t\t\t}\n\t\t}\n\tcase *admissionregistrationv1beta1.ValidatingWebhookConfiguration:\n\t\tfor _, webhook := range config.Webhooks {\n\t\t\tif caBundle := webhook.ClientConfig.CABundle; len(caBundle) > 0 {\n\t\t\t\treturn caBundle, nil\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unexpected webhook config type: %T\", obj)\n\t}\n\n\treturn nil, nil\n}", "func BuildClientConfig(kubeconfig, context string) (*rest.Config, error) {\n\tif kubeconfig != \"\" {\n\t\tinfo, err := os.Stat(kubeconfig)\n\t\tif err != nil || info.Size() == 0 {\n\t\t\t// If the specified kubeconfig doesn't exists / empty file / any other error\n\t\t\t// from file stat, fall back to default\n\t\t\tkubeconfig = \"\"\n\t\t}\n\t}\n\n\t//Config loading rules:\n\t// 1. kubeconfig if it not empty string\n\t// 2. In cluster config if running in-cluster\n\t// 3. Config(s) in KUBECONFIG environment variable\n\t// 4. Use $HOME/.kube/config\n\tloadingRules := clientcmd.NewDefaultClientConfigLoadingRules()\n\tloadingRules.DefaultClientConfig = &clientcmd.DefaultClientConfig\n\tloadingRules.ExplicitPath = kubeconfig\n\tconfigOverrides := &clientcmd.ConfigOverrides{\n\t\tClusterDefaults: clientcmd.ClusterDefaults,\n\t\tCurrentContext: context,\n\t}\n\n\treturn clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides).ClientConfig()\n}", "func NewClientConfig(s *state.State, host kubeone.HostConfig) (*clientv3.Config, error) {\n\tsshconn, err := s.Connector.Connect(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgrpcDialer, err := sshtunnel.NewGRPCDialer(s.Connector, host)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to create grpc tunnel dialer\")\n\t}\n\n\ttlsConf, err := LoadTLSConfig(sshconn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &clientv3.Config{\n\t\tEndpoints: []string{fmt.Sprintf(\"%s:2379\", host.PrivateAddress)},\n\t\tTLS: tlsConf,\n\t\tContext: s.Context,\n\t\tDialTimeout: 5 * time.Second,\n\t\tDialOptions: []grpc.DialOption{\n\t\t\tgrpc.WithBlock(),\n\t\t\tgrpcDialer,\n\t\t},\n\t}, nil\n}", "func NewClientConfig(credentials auth.CredentialProvider, tokenURL string) (*Config, error) {\n\n\tif len(credentials.GetAppID()) < 0 || len(credentials.GetAppPassword()) < 0 {\n\t\treturn &Config{}, errors.New(\"Invalid client credentials\")\n\t}\n\n\tparsedURL, err := url.Parse(tokenURL)\n\tif err != nil {\n\t\treturn &Config{}, errors.New(\"Invalid token URL\")\n\t}\n\n\treturn &Config{\n\t\tCredentials: credentials,\n\t\tAuthURL: *parsedURL,\n\t}, nil\n}", "func populateClientConfig(config *Config) *Config {\n\tif config == nil {\n\t\tconfig = &Config{}\n\t}\n\tversions := config.Versions\n\tif len(versions) == 0 {\n\t\tversions = protocol.SupportedVersions\n\t}\n\n\thandshakeTimeout := protocol.DefaultHandshakeTimeout\n\tif config.HandshakeTimeout != 0 {\n\t\thandshakeTimeout = config.HandshakeTimeout\n\t}\n\tidleTimeout := protocol.DefaultIdleTimeout\n\tif config.IdleTimeout != 0 {\n\t\tidleTimeout = config.IdleTimeout\n\t}\n\n\tmaxReceiveStreamFlowControlWindow := config.MaxReceiveStreamFlowControlWindow\n\tif maxReceiveStreamFlowControlWindow == 0 {\n\t\tmaxReceiveStreamFlowControlWindow = protocol.DefaultMaxReceiveStreamFlowControlWindowClient\n\t}\n\tmaxReceiveConnectionFlowControlWindow := config.MaxReceiveConnectionFlowControlWindow\n\tif maxReceiveConnectionFlowControlWindow == 0 {\n\t\tmaxReceiveConnectionFlowControlWindow = protocol.DefaultMaxReceiveConnectionFlowControlWindowClient\n\t}\n\n\treturn &Config{\n\t\tVersions: versions,\n\t\tHandshakeTimeout: handshakeTimeout,\n\t\tIdleTimeout: idleTimeout,\n\t\tRequestConnectionIDTruncation: config.RequestConnectionIDTruncation,\n\t\tMaxReceiveStreamFlowControlWindow: maxReceiveStreamFlowControlWindow,\n\t\tMaxReceiveConnectionFlowControlWindow: maxReceiveConnectionFlowControlWindow,\n\t\tKeepAlive: config.KeepAlive,\n\t\tCacheHandshake: config.CacheHandshake,\n\t\tCreatePaths: config.CreatePaths,\n\t}\n}", "func CreateWebhookListener(config,\n\tremoteConfig *rest.Config,\n\tscheme *runtime.Scheme,\n\ttlsKeyFile, tlsCrtFile string,\n\tcreateService bool) (*WebhookListener, error) {\n\tif klog.V(utils.QuiteLogLel) {\n\t\tfnName := utils.GetFnName()\n\t\tklog.Infof(\"Entering: %v()\", fnName)\n\n\t\tdefer klog.Infof(\"Exiting: %v()\", fnName)\n\t}\n\n\tvar err error\n\n\tdynamicClient := dynamic.NewForConfigOrDie(config)\n\n\tl := &WebhookListener{\n\t\tDynamicClient: dynamicClient,\n\t\tlocalConfig: config,\n\t}\n\n\t// The user-provided key and cert files take precedence over the default provided files if both sets exist.\n\tif _, err := os.Stat(defaultKeyFile); err == nil {\n\t\tl.TLSKeyFile = defaultKeyFile\n\t}\n\n\tif _, err := os.Stat(defaultCrtFile); err == nil {\n\t\tl.TLSCrtFile = defaultCrtFile\n\t}\n\n\tif _, err := os.Stat(tlsKeyFile); err == nil {\n\t\tl.TLSKeyFile = tlsKeyFile\n\t}\n\n\tif _, err := os.Stat(tlsCrtFile); err == nil {\n\t\tl.TLSCrtFile = tlsCrtFile\n\t}\n\n\tl.LocalClient, err = client.New(config, client.Options{})\n\n\tif err != nil {\n\t\tklog.Error(\"Failed to initialize client to update local status. error: \", err)\n\t\treturn nil, err\n\t}\n\n\tl.RemoteClient = l.LocalClient\n\tif remoteConfig != nil {\n\t\tl.RemoteClient, err = client.New(remoteConfig, client.Options{})\n\n\t\tif err != nil {\n\t\t\tklog.Error(\"Failed to initialize client to update remote status. error: \", err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif createService {\n\t\tnamespace, err := getOperatorNamespace()\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Create the webhook listener service only when the subscription controller runs in hub mode.\n\t\terr = createWebhookListnerService(l.LocalClient, namespace)\n\n\t\tif err != nil {\n\t\t\tklog.Error(\"Failed to create a service for Git webhook listener. error: \", err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn l, err\n}", "func BuildClientConfig(kubeConfigPath string, clusterName string) (*rest.Config, error) {\n\toverrides := clientcmd.ConfigOverrides{}\n\t// Override the cluster name if provided.\n\tif clusterName != \"\" {\n\t\toverrides.Context.Cluster = clusterName\n\t}\n\treturn clientcmd.NewNonInteractiveDeferredLoadingClientConfig(\n\t\t&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfigPath},\n\t\t&overrides).ClientConfig()\n}", "func NewWebhooksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebhooksClient, error) {\n\tcl, err := arm.NewClient(internal.ModuleName+\"/armcontainerregistry.WebhooksClient\", internal.ModuleVersion, credential, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient := &WebhooksClient{\n\t\tsubscriptionID: subscriptionID,\n\t\tinternal: cl,\n\t}\n\treturn client, nil\n}", "func GRPCClientFromConfig(cfg config.View, prefix string) (*grpc.ClientConn, error) {\n\tclientParams := &ClientParams{\n\t\tHostname: cfg.GetString(prefix + \".hostname\"),\n\t\tPort: cfg.GetInt(prefix + \".grpcport\"),\n\t\tEnableRPCLogging: cfg.GetBool(configNameEnableRPCLogging),\n\t\tEnableMetrics: cfg.GetBool(telemetry.ConfigNameEnableMetrics),\n\t}\n\n\t// If TLS support is enabled in the config, fill in the trusted certificates for decrpting server certificate.\n\tif cfg.GetString(configNameClientTrustedCertificatePath) != \"\" {\n\t\t_, err := os.Stat(cfg.GetString(configNameClientTrustedCertificatePath))\n\t\tif err != nil {\n\t\t\tclientLogger.WithError(err).Error(\"trusted certificate file may not exists.\")\n\t\t\treturn nil, err\n\t\t}\n\n\t\tclientParams.TrustedCertificate, err = ioutil.ReadFile(cfg.GetString(configNameClientTrustedCertificatePath))\n\t\tif err != nil {\n\t\t\tclientLogger.WithError(err).Error(\"failed to read tls trusted certificate to establish a secure grpc client.\")\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn GRPCClientFromParams(clientParams)\n}", "func rebuildWebhookConfigHelper(\n\tcaFile, webhookConfigFile, webhookName string,\n\townerRefs []metav1.OwnerReference,\n) (*v1beta1.ValidatingWebhookConfiguration, error) {\n\t// load and validate configuration\n\twebhookConfigData, err := ioutil.ReadFile(webhookConfigFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar webhookConfig v1beta1.ValidatingWebhookConfiguration\n\tif err := yaml.Unmarshal(webhookConfigData, &webhookConfig); err != nil {\n\t\treturn nil, fmt.Errorf(\"could not decode validatingwebhookconfiguration from %v: %v\",\n\t\t\twebhookConfigFile, err)\n\t}\n\n\t// fill in missing defaults to minimize desired vs. actual diffs later.\n\tfor i := 0; i < len(webhookConfig.Webhooks); i++ {\n\t\tif webhookConfig.Webhooks[i].FailurePolicy == nil {\n\t\t\tfailurePolicy := v1beta1.Fail\n\t\t\twebhookConfig.Webhooks[i].FailurePolicy = &failurePolicy\n\t\t}\n\t\tif webhookConfig.Webhooks[i].NamespaceSelector == nil {\n\t\t\twebhookConfig.Webhooks[i].NamespaceSelector = &metav1.LabelSelector{}\n\t\t}\n\t}\n\n\t// the webhook name is fixed at startup time\n\twebhookConfig.Name = webhookName\n\n\t// update ownerRefs so configuration is cleaned up when the galley's namespace is deleted.\n\twebhookConfig.OwnerReferences = ownerRefs\n\n\tin, err := os.Open(caFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read ca bundle from %v: %v\", caFile, err)\n\t}\n\tdefer in.Close() // nolint: errcheck\n\n\tcaPem, err := loadCaCertPem(in)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// patch the ca-cert into the user provided configuration\n\tfor i := range webhookConfig.Webhooks {\n\t\twebhookConfig.Webhooks[i].ClientConfig.CABundle = caPem\n\t}\n\n\treturn &webhookConfig, nil\n}", "func (p *Plugin) getClientConfig(config *mux.Config, logger logging.Logger, topic string) (*client.Config, error) {\n\tclientCfg := client.NewConfig(logger)\n\t// Set brokers obtained from kafka config. In case there are none available, use a default one\n\tif len(config.Addrs) > 0 {\n\t\tclientCfg.SetBrokers(config.Addrs...)\n\t} else {\n\t\tclientCfg.SetBrokers(mux.DefAddress)\n\t}\n\t// Set group ID obtained from kafka config. In case there is none, use a service label\n\tif config.GroupID != \"\" {\n\t\tclientCfg.SetGroup(config.GroupID)\n\t} else {\n\t\tclientCfg.SetGroup(p.ServiceLabel.GetAgentLabel())\n\t}\n\tclientCfg.SetRecvMessageChan(p.subscription)\n\tclientCfg.SetInitialOffset(sarama.OffsetNewest)\n\tclientCfg.SetTopics(topic)\n\tif config.TLS.Enabled {\n\t\tp.Log.Info(\"TLS enabled\")\n\t\ttlsConfig, err := clienttls.CreateTLSConfig(config.TLS)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tclientCfg.SetTLS(tlsConfig)\n\t}\n\treturn clientCfg, nil\n}", "func (in *WebhookClient) DeepCopy() *WebhookClient {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(WebhookClient)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "func Convert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(in *auditregistration.WebhookClientConfig, out *v1alpha1.WebhookClientConfig, s conversion.Scope) error {\n\treturn autoConvert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(in, out, s)\n}", "func ApplyValidatingWebhookConfiguration(client admissionregistrationclientv1.ValidatingWebhookConfigurationsGetter, recorder events.Recorder,\n\trequiredOriginal *admissionregistrationv1.ValidatingWebhookConfiguration, expectedGeneration int64) (*admissionregistrationv1.ValidatingWebhookConfiguration, bool, error) {\n\tif requiredOriginal == nil {\n\t\treturn nil, false, fmt.Errorf(\"Unexpected nil instead of an object\")\n\t}\n\trequired := requiredOriginal.DeepCopy()\n\n\texisting, err := client.ValidatingWebhookConfigurations().Get(context.TODO(), required.GetName(), metav1.GetOptions{})\n\tif apierrors.IsNotFound(err) {\n\t\tactual, err := client.ValidatingWebhookConfigurations().Create(context.TODO(), required, metav1.CreateOptions{})\n\t\treportCreateEvent(recorder, required, err)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\treturn actual, true, nil\n\t} else if err != nil {\n\t\treturn nil, false, err\n\t}\n\n\tmodified := resourcemerge.BoolPtr(false)\n\texistingCopy := existing.DeepCopy()\n\n\tresourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta)\n\tif !*modified && existingCopy.GetGeneration() == expectedGeneration {\n\t\treturn existingCopy, false, nil\n\t}\n\t// at this point we know that we're going to perform a write. We're just trying to get the object correct\n\ttoWrite := existingCopy // shallow copy so the code reads easier\n\t// Providing upgrade compatibility with service-ca-bundle operator\n\t// and ignore clientConfig.caBundle changes on \"inject-cabundle\" label\n\tif required.GetAnnotations() != nil && required.GetAnnotations()[genericCABundleInjectorAnnotation] != \"\" {\n\t\t// Populate unpopulated webhooks[].clientConfig.caBundle fields from existing resource\n\t\tcopyValidatingWebhookCABundle(existing, required)\n\t}\n\ttoWrite.Webhooks = required.Webhooks\n\n\tklog.V(4).Infof(\"ValidatingWebhookConfiguration %q changes: %v\", required.GetNamespace()+\"/\"+required.GetName(), JSONPatchNoError(existing, toWrite))\n\n\tactual, err := client.ValidatingWebhookConfigurations().Update(context.TODO(), toWrite, metav1.UpdateOptions{})\n\treportUpdateEvent(recorder, required, err)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\treturn actual, *modified || actual.GetGeneration() > existingCopy.GetGeneration(), nil\n}", "func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig {\n\tlogger := hclog.New(&hclog.LoggerOptions{\n\t\tName: \"plugin\",\n\t\tLevel: hclog.Trace,\n\t\tOutput: os.Stderr,\n\t})\n\n\treturn &plugin.ClientConfig{\n\t\tCmd: exec.Command(m.Path),\n\t\tHandshakeConfig: Handshake,\n\t\tVersionedPlugins: VersionedPlugins,\n\t\tManaged: true,\n\t\tLogger: logger,\n\t\tAllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC},\n\t\tAutoMTLS: true,\n\t}\n}", "func tlsClientConfig(caPath string, certPath string, keyPath, serverName string) (*tls.Config, error) {\n\tif caPath == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tcaCert, err := ioutil.ReadFile(caPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcaCertPool := x509.NewCertPool()\n\tcaCertPool.AppendCertsFromPEM(caCert)\n\n\ttlsConfig := &tls.Config{\n\t\tInsecureSkipVerify: true,\n\t\tClientCAs: caCertPool,\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t}\n\n\tcert, err := tls.LoadX509KeyPair(certPath, keyPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttlsConfig.Certificates = []tls.Certificate{cert}\n\ttlsConfig.NextProtos = []string{\"h2\"}\n\ttlsConfig.ServerName = serverName\n\n\treturn tlsConfig, nil\n}", "func HTTPClientFromConfig(cfg config.View, prefix string) (*http.Client, string, error) {\n\tclientParams := &ClientParams{\n\t\tHostname: cfg.GetString(prefix + \".hostname\"),\n\t\tPort: cfg.GetInt(prefix + \".httpport\"),\n\t\tEnableRPCLogging: cfg.GetBool(configNameEnableRPCLogging),\n\t\tEnableMetrics: cfg.GetBool(telemetry.ConfigNameEnableMetrics),\n\t}\n\n\t// If TLS support is enabled in the config, fill in the trusted certificates for decrpting server certificate.\n\tif cfg.GetString(configNameClientTrustedCertificatePath) != \"\" {\n\t\t_, err := os.Stat(cfg.GetString(configNameClientTrustedCertificatePath))\n\t\tif err != nil {\n\t\t\tclientLogger.WithError(err).Error(\"trusted certificate file may not exists.\")\n\t\t\treturn nil, \"\", err\n\t\t}\n\n\t\tclientParams.TrustedCertificate, err = ioutil.ReadFile(cfg.GetString(configNameClientTrustedCertificatePath))\n\t\tif err != nil {\n\t\t\tclientLogger.WithError(err).Error(\"failed to read tls trusted certificate to establish a secure grpc client.\")\n\t\t\treturn nil, \"\", err\n\t\t}\n\t}\n\n\treturn HTTPClientFromParams(clientParams)\n}", "func NewClientConfigurationForBroker(meta metav1.ObjectMeta, commonSpec *v1beta1.CommonServiceBrokerSpec, authConfig *osb.AuthConfig) *osb.ClientConfiguration {\n\tclientConfig := osb.DefaultClientConfiguration()\n\tclientConfig.Name = meta.Name\n\tclientConfig.URL = commonSpec.URL\n\tclientConfig.AuthConfig = authConfig\n\tclientConfig.EnableAlphaFeatures = true\n\tclientConfig.Insecure = commonSpec.InsecureSkipTLSVerify\n\tclientConfig.CAData = commonSpec.CABundle\n\treturn clientConfig\n}", "func WithClientConfig(rcg *genericclioptions.ConfigFlags, clientOpts *runclient.Options) BuilderOptionFunc {\n\treturn func(b *Builder) error {\n\t\tkubeClient, err := utils.KubeClient(rcg, clientOpts)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trestMapper, err := rcg.ToRESTMapper()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tb.client = kubeClient\n\t\tb.restMapper = restMapper\n\t\tb.namespace = *rcg.Namespace\n\t\treturn nil\n\t}\n}", "func ReconcileWebhookConfiguration(webhookServerReady, stopCh <-chan struct{},\n\tvc *WebhookParameters, kubeConfig string) {\n\n\tclientset, err := kube.CreateClientset(kubeConfig, \"\")\n\tif err != nil {\n\t\tlog.Fatalf(\"could not create k8s clientset: %v\", err)\n\t}\n\tvc.Clientset = clientset\n\n\twhc, err := NewWebhookConfigController(*vc)\n\tif err != nil {\n\t\tlog.Fatalf(\"cannot create validation webhook config: %v\", err)\n\t}\n\n\tif vc.EnableValidation {\n\t\t//wait for galley endpoint to be available before register ValidatingWebhookConfiguration\n\t\t<-webhookServerReady\n\t}\n\twhc.reconcile(stopCh)\n\n}", "func Init(ctx context.Context, cfg *Config) (*Proxy, error) {\n\tif cfg.Log == nil {\n\t\tcfg.Log = &log.Logger{Out: io.Discard}\n\t}\n\n\t// validate forward-urls args\n\tif cfg.UseConfiguredWebhooks && len(cfg.ForwardURL) > 0 {\n\t\tif strings.HasPrefix(cfg.ForwardURL, \"/\") {\n\t\t\treturn nil, errors.New(\"forward_to cannot be a relative path when loading webhook endpoints from the API\")\n\t\t}\n\t\tif strings.HasPrefix(cfg.ForwardConnectURL, \"/\") {\n\t\t\treturn nil, errors.New(\"forward_connect_to cannot be a relative path when loading webhook endpoints from the API\")\n\t\t}\n\t} else if cfg.UseConfiguredWebhooks && len(cfg.ForwardURL) == 0 {\n\t\treturn nil, errors.New(\"load_from_webhooks_api requires a location to forward to with forward_to\")\n\t}\n\n\t// if no events are passed, listen for all events\n\tif len(cfg.Events) == 0 {\n\t\tcfg.Events = []string{\"*\"}\n\t} else {\n\t\tfor _, event := range cfg.Events {\n\t\t\tif _, found := validEvents[event]; !found {\n\t\t\t\tcfg.Log.Infof(\"Warning: You're attempting to listen for \\\"%s\\\", which isn't a valid event\\n\", event)\n\t\t\t}\n\t\t}\n\t}\n\n\t// build from --forward-to urls if --forward-connect-to was not provided\n\tif len(cfg.ForwardConnectURL) == 0 {\n\t\tcfg.ForwardConnectURL = cfg.ForwardURL\n\t}\n\tif len(cfg.ForwardConnectHeaders) == 0 {\n\t\tcfg.ForwardConnectHeaders = cfg.ForwardHeaders\n\t}\n\n\t// build endpoint routes\n\tvar endpointRoutes []EndpointRoute\n\tif cfg.UseConfiguredWebhooks {\n\t\t// build from user's API config\n\t\tendpoints := getEndpointsFromAPI(ctx, cfg.Key, cfg.APIBaseURL)\n\t\tif len(endpoints.Data) == 0 {\n\t\t\treturn nil, errors.New(\"You have not defined any webhook endpoints on your account. Go to the Stripe Dashboard to add some: https://dashboard.stripe.com/test/webhooks\")\n\t\t}\n\t\tvar err error\n\t\tendpointRoutes, err = buildEndpointRoutes(endpoints, parseURL(cfg.ForwardURL), parseURL(cfg.ForwardConnectURL), cfg.ForwardHeaders, cfg.ForwardConnectHeaders)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif len(cfg.ForwardURL) > 0 {\n\t\t\t// non-connect endpoints\n\t\t\tendpointRoutes = append(endpointRoutes, EndpointRoute{\n\t\t\t\tURL: parseURL(cfg.ForwardURL),\n\t\t\t\tForwardHeaders: cfg.ForwardHeaders,\n\t\t\t\tConnect: false,\n\t\t\t\tEventTypes: cfg.Events,\n\t\t\t})\n\t\t}\n\n\t\tif len(cfg.ForwardConnectURL) > 0 {\n\t\t\t// connect endpoints\n\t\t\tendpointRoutes = append(endpointRoutes, EndpointRoute{\n\t\t\t\tURL: parseURL(cfg.ForwardConnectURL),\n\t\t\t\tForwardHeaders: cfg.ForwardConnectHeaders,\n\t\t\t\tConnect: true,\n\t\t\t\tEventTypes: cfg.Events,\n\t\t\t})\n\t\t}\n\t}\n\n\tp := &Proxy{\n\t\tcfg: cfg,\n\t\tstripeAuthClient: stripeauth.NewClient(cfg.Key, &stripeauth.Config{\n\t\t\tLog: cfg.Log,\n\t\t\tAPIBaseURL: cfg.APIBaseURL,\n\t\t}),\n\t\tevents: convertToMap(cfg.Events),\n\t}\n\n\tfor _, route := range endpointRoutes {\n\t\t// append to endpointClients\n\t\tp.endpointClients = append(p.endpointClients, NewEndpointClient(\n\t\t\troute.URL,\n\t\t\troute.ForwardHeaders,\n\t\t\troute.Connect,\n\t\t\troute.EventTypes,\n\t\t\t&EndpointConfig{\n\t\t\t\tHTTPClient: &http.Client{\n\t\t\t\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\t\t\t\treturn http.ErrUseLastResponse\n\t\t\t\t\t},\n\t\t\t\t\tTimeout: time.Duration(cfg.Timeout) * time.Second,\n\t\t\t\t\tTransport: &http.Transport{\n\t\t\t\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: cfg.SkipVerify},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tLog: p.cfg.Log,\n\t\t\t\tResponseHandler: EndpointResponseHandlerFunc(p.processEndpointResponse),\n\t\t\t\tOutCh: p.cfg.OutCh,\n\t\t\t},\n\t\t))\n\t}\n\n\treturn p, nil\n}", "func BuildWebhookConfigs(\n\twebhooks []*Webhook,\n\tc client.Client,\n\tnamespace, providerName string,\n\tservicePort int,\n\tmode, url string,\n\tcaBundle []byte,\n) (\n\tseedWebhookConfig client.Object,\n\tshootWebhookConfig *admissionregistrationv1.MutatingWebhookConfiguration,\n\terr error,\n) {\n\tvar (\n\t\texact = admissionregistrationv1.Exact\n\t\tsideEffects = admissionregistrationv1.SideEffectClassNone\n\n\t\tseedWebhooks []admissionregistrationv1.MutatingWebhook\n\t\tshootWebhooks []admissionregistrationv1.MutatingWebhook\n\t)\n\n\tfor _, webhook := range webhooks {\n\t\tvar rules []admissionregistrationv1.RuleWithOperations\n\n\t\tfor _, t := range webhook.Types {\n\t\t\trule, err := buildRule(c, t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\trules = append(rules, *rule)\n\t\t}\n\n\t\twebhookToRegister := admissionregistrationv1.MutatingWebhook{\n\t\t\tAdmissionReviewVersions: []string{\"v1\", \"v1beta1\"},\n\t\t\tName: fmt.Sprintf(\"%s.%s.extensions.gardener.cloud\", webhook.Name, strings.TrimPrefix(providerName, \"provider-\")),\n\t\t\tNamespaceSelector: webhook.Selector,\n\t\t\tObjectSelector: webhook.ObjectSelector,\n\t\t\tRules: rules,\n\t\t\tSideEffects: &sideEffects,\n\t\t\tTimeoutSeconds: pointer.Int32(10),\n\t\t}\n\n\t\tif webhook.TimeoutSeconds != nil {\n\t\t\twebhookToRegister.TimeoutSeconds = webhook.TimeoutSeconds\n\t\t}\n\n\t\tshootMode := ModeURLWithServiceName\n\t\tif mode == ModeURL {\n\t\t\tshootMode = ModeURL\n\t\t}\n\n\t\tswitch webhook.Target {\n\t\tcase TargetSeed:\n\t\t\twebhookToRegister.FailurePolicy = getFailurePolicy(admissionregistrationv1.Fail, webhook.FailurePolicy)\n\t\t\twebhookToRegister.MatchPolicy = &exact\n\t\t\twebhookToRegister.ClientConfig = BuildClientConfigFor(webhook.Path, namespace, providerName, servicePort, mode, url, caBundle)\n\t\t\tseedWebhooks = append(seedWebhooks, webhookToRegister)\n\t\tcase TargetShoot:\n\t\t\twebhookToRegister.FailurePolicy = getFailurePolicy(admissionregistrationv1.Ignore, webhook.FailurePolicy)\n\t\t\twebhookToRegister.MatchPolicy = &exact\n\t\t\twebhookToRegister.ClientConfig = BuildClientConfigFor(webhook.Path, namespace, providerName, servicePort, shootMode, url, caBundle)\n\t\t\tshootWebhooks = append(shootWebhooks, webhookToRegister)\n\t\tdefault:\n\t\t\treturn nil, nil, fmt.Errorf(\"invalid webhook target: %s\", webhook.Target)\n\t\t}\n\t}\n\n\t// if all webhooks for one target are removed in a new version, extensions need to explicitly delete the respective\n\t// webhook config\n\tif len(seedWebhooks) > 0 {\n\t\tseedWebhookConfig = &admissionregistrationv1.MutatingWebhookConfiguration{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: NamePrefix + providerName,\n\t\t\t\tLabels: map[string]string{v1beta1constants.LabelExcludeWebhookFromRemediation: \"true\"},\n\t\t\t},\n\t\t\tWebhooks: seedWebhooks,\n\t\t}\n\t}\n\n\tif len(shootWebhooks) > 0 {\n\t\tshootWebhookConfig = &admissionregistrationv1.MutatingWebhookConfiguration{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: NamePrefix + providerName + NameSuffixShoot,\n\t\t\t\tLabels: map[string]string{v1beta1constants.LabelExcludeWebhookFromRemediation: \"true\"},\n\t\t\t},\n\t\t\tWebhooks: shootWebhooks,\n\t\t}\n\t}\n\n\treturn seedWebhookConfig, shootWebhookConfig, nil\n}", "func Convert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(in *v1alpha1.WebhookClientConfig, out *auditregistration.WebhookClientConfig, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(in, out, s)\n}", "func ConfigFromWebhookURL(webhookURL url.URL) (*Config, format.PropKeyResolver, error) {\n\tconfig, pkr := DefaultConfig()\n\n\tconfig.webhookURL = &webhookURL\n\t// TODO: Decide what to do with custom URL queries. Right now they are passed\n\t// to the inner url.URL and not processed by PKR.\n\t// customQuery, err := format.SetConfigPropsFromQuery(&pkr, webhookURL.Query())\n\t// goland:noinspection GoNilness: SetConfigPropsFromQuery always return non-nil\n\t// config.webhookURL.RawQuery = customQuery.Encode()\n\tconfig.DisableTLS = webhookURL.Scheme == \"http\"\n\treturn config, pkr, nil\n}", "func NewValidatingWebhookConfiguration(ctx *pulumi.Context,\n\tname string, args *ValidatingWebhookConfigurationArgs, opts ...pulumi.ResourceOption) (*ValidatingWebhookConfiguration, error) {\n\tif args == nil {\n\t\targs = &ValidatingWebhookConfigurationArgs{}\n\t}\n\targs.ApiVersion = pulumi.StringPtr(\"admissionregistration.k8s.io/v1\")\n\targs.Kind = pulumi.StringPtr(\"ValidatingWebhookConfiguration\")\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"kubernetes:admissionregistration.k8s.io/v1beta1:ValidatingWebhookConfiguration\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource ValidatingWebhookConfiguration\n\terr := ctx.RegisterResource(\"kubernetes:admissionregistration.k8s.io/v1:ValidatingWebhookConfiguration\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (in *ClientConfig) DeepCopy() *ClientConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ClientConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "func WebhookWithOptions(o WebhookOptions) filters.Spec {\n\treturn &webhookSpec{options: o}\n}", "func NewWebhook(ops ...ConfigOption) (*Webhook, error) {\n\tconf := toConfig(ops...)\n\ttemplater, err := templates.NewTemplater(conf.templateName, conf.sidecarConfig, conf.sidecarTemplate)\n\tif err != nil {\n\t\topenlogging.Error(fmt.Sprintf(\"new templater failed: error = %v, template = %s\", err.Error(), conf.templateName))\n\t\treturn nil, err\n\t}\n\n\treturn &Webhook{\n\t\tserver: &http.Server{\n\t\t\tAddr: fmt.Sprintf(\":%d\", conf.port),\n\t\t\tTLSConfig: &tls.Config{GetCertificate: conf.getCertificate},\n\t\t},\n\t\tconfig: conf,\n\t\ttemplater: templater,\n\t}, nil\n}", "func (h *handler) clientConfig(kubeconfig []byte, contextName string) (*rest.Config, error) {\n\tif len(kubeconfig) > 0 {\n\t\tccfg, err := clientcmd.Load(kubeconfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif contextName != \"\" {\n\t\t\tccfg.CurrentContext = contextName\n\t\t}\n\t\terr = writeKubeconfig(kubeconfig, contextName, h.kubeConfigPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn clientcmd.NewDefaultClientConfig(*ccfg, &clientcmd.ConfigOverrides{}).ClientConfig()\n\t}\n\treturn rest.InClusterConfig()\n}", "func ConsulClientConfig(serverStrs, datacenter, token string) (client *api.Client, conf *api.Config, err error) {\r\n\tscStrs := strings.Split(strings.TrimSpace(serverStrs), \",\")\r\n\tif len(scStrs) < 1 {\r\n\t\terr = fmt.Errorf(\"noServerConfig\")\r\n\t\treturn\r\n\t}\r\n\tconf = api.DefaultConfig()\r\n\tconf.Datacenter = datacenter\r\n\tconf.Token = token\r\n\r\n\tfor _, sc := range scStrs {\r\n\t\tconf.Address = strings.TrimSpace(sc)\r\n\t\tclient, err = api.NewClient(conf)\r\n\t\tif err == nil {\r\n\t\t\treturn\r\n\t\t}\r\n\t}\r\n\terr = fmt.Errorf(\"noAvaiableServer\")\r\n\treturn\r\n}", "func WebsocketTLSClientConfig(tcc *tls.Config) optSetter {\n\treturn func(f *Forwarder) error {\n\t\tf.websocketDialer.TLSClientConfig = tcc.Clone()\n\t\t// WebSocket is only in http/1.1\n\t\tf.websocketDialer.TLSClientConfig.NextProtos = []string{\"http/1.1\"}\n\n\t\treturn nil\n\t}\n}", "func ReconcileSeedWebhookConfig(ctx context.Context, c client.Client, webhookConfig client.Object, ownerNamespace string, caBundle []byte) error {\n\tvar ownerReference *metav1.OwnerReference\n\tif len(ownerNamespace) > 0 {\n\t\tns := &corev1.Namespace{}\n\t\tif err := c.Get(ctx, client.ObjectKey{Name: ownerNamespace}, ns); err != nil {\n\t\t\treturn err\n\t\t}\n\t\townerReference = metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind(\"Namespace\"))\n\t\townerReference.BlockOwnerDeletion = pointer.Bool(false)\n\t}\n\n\tdesiredWebhookConfig := webhookConfig.DeepCopyObject().(client.Object)\n\n\tif _, err := controllerutils.GetAndCreateOrStrategicMergePatch(ctx, c, webhookConfig, func() error {\n\t\tif ownerReference != nil {\n\t\t\twebhookConfig.SetOwnerReferences(kubernetes.MergeOwnerReferences(webhookConfig.GetOwnerReferences(), *ownerReference))\n\t\t}\n\n\t\tif len(caBundle) == 0 {\n\t\t\tvar err error\n\t\t\t// we can safely assume, that the CA bundles in all webhooks are the same, as we manage it ourselves\n\t\t\tcaBundle, err = GetCABundleFromWebhookConfig(webhookConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := InjectCABundleIntoWebhookConfig(desiredWebhookConfig, caBundle); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn OverwriteWebhooks(webhookConfig, desiredWebhookConfig)\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"error reconciling seed webhook config: %w\", err)\n\t}\n\n\treturn nil\n}", "func LoadApiClientConfigFromOptions(options *KubectlOptions) (*restclient.Config, error) {\n\tlogger := logging.GetProjectLogger()\n\n\tvar server, token string\n\tvar caData []byte\n\n\tauthScheme := options.AuthScheme()\n\tswitch authScheme {\n\tcase ConfigBased:\n\t\tlogger.Infof(\"Using config on disk and context.\")\n\t\treturn LoadApiClientConfig(options.ConfigPath, options.ContextName)\n\t// for the other two methods, we need to extract the server cadata and token to construct the client config\n\tcase DirectAuth:\n\t\tlogger.Infof(\"Using direct auth methods to setup client.\")\n\t\tcaDataRaw, err := base64.StdEncoding.DecodeString(options.Base64PEMCertificateAuthority)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcaData = caDataRaw\n\t\tserver = options.Server\n\t\ttoken = options.BearerToken\n\tcase EKSClusterBased:\n\t\tinfo, err := getKubeCredentialsFromEKSCluster(options.EKSClusterArn)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcaDataRaw, err := base64.StdEncoding.DecodeString(info.Base64PEMCertificateAuthority)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcaData = caDataRaw\n\t\tserver = info.Server\n\t\ttoken = info.BearerToken\n\tdefault:\n\t\t// This should never happen, but is required by the compiler\n\t\treturn nil, errors.WithStackTrace(AuthSchemeNotSupported{authScheme})\n\t}\n\n\tconfig := &restclient.Config{\n\t\tHost: server,\n\t\tBearerToken: token,\n\t\tContentConfig: restclient.ContentConfig{\n\t\t\tGroupVersion: &corev1.SchemeGroupVersion,\n\t\t\tNegotiatedSerializer: scheme.Codecs,\n\t\t},\n\t\tTLSClientConfig: restclient.TLSClientConfig{\n\t\t\tInsecure: false,\n\t\t\tCAData: caData,\n\t\t},\n\t}\n\treturn config, nil\n}", "func InjectCABundleIntoWebhookConfig(obj client.Object, caBundle []byte) error {\n\tswitch config := obj.(type) {\n\tcase *admissionregistrationv1.MutatingWebhookConfiguration:\n\t\tfor i, w := range config.Webhooks {\n\t\t\tw.ClientConfig.CABundle = caBundle\n\t\t\tconfig.Webhooks[i] = w\n\t\t}\n\tcase *admissionregistrationv1.ValidatingWebhookConfiguration:\n\t\tfor i, w := range config.Webhooks {\n\t\t\tw.ClientConfig.CABundle = caBundle\n\t\t\tconfig.Webhooks[i] = w\n\t\t}\n\tcase *admissionregistrationv1beta1.MutatingWebhookConfiguration:\n\t\tfor i, w := range config.Webhooks {\n\t\t\tw.ClientConfig.CABundle = caBundle\n\t\t\tconfig.Webhooks[i] = w\n\t\t}\n\tcase *admissionregistrationv1beta1.ValidatingWebhookConfiguration:\n\t\tfor i, w := range config.Webhooks {\n\t\t\tw.ClientConfig.CABundle = caBundle\n\t\t\tconfig.Webhooks[i] = w\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected webhook config type: %T\", obj)\n\t}\n\n\treturn nil\n}", "func NewClient(config *Config) (client *Client, err error) {\n\t// bootstrap the config\n\tdefConfig := DefaultConfig()\n\n\tif len(config.ApiAddress) == 0 {\n\t\tconfig.ApiAddress = defConfig.ApiAddress\n\t}\n\n\tif len(config.Username) == 0 {\n\t\tconfig.Username = defConfig.Username\n\t}\n\n\tif len(config.Password) == 0 {\n\t\tconfig.Password = defConfig.Password\n\t}\n\n\tif len(config.Token) == 0 {\n\t\tconfig.Token = defConfig.Token\n\t}\n\n\tif len(config.UserAgent) == 0 {\n\t\tconfig.UserAgent = defConfig.UserAgent\n\t}\n\n\tif config.HttpClient == nil {\n\t\tconfig.HttpClient = defConfig.HttpClient\n\t}\n\n\tif config.HttpClient.Transport == nil {\n\t\tconfig.HttpClient.Transport = shallowDefaultTransport()\n\t}\n\n\tvar tp *http.Transport\n\n\tswitch t := config.HttpClient.Transport.(type) {\n\tcase *http.Transport:\n\t\ttp = t\n\tcase *oauth2.Transport:\n\t\tif bt, ok := t.Base.(*http.Transport); ok {\n\t\t\ttp = bt\n\t\t}\n\t}\n\n\tif tp != nil {\n\t\tif tp.TLSClientConfig == nil {\n\t\t\ttp.TLSClientConfig = &tls.Config{}\n\t\t}\n\t\ttp.TLSClientConfig.InsecureSkipVerify = config.SkipSslValidation\n\t}\n\n\tconfig.ApiAddress = strings.TrimRight(config.ApiAddress, \"/\")\n\n\tclient = &Client{\n\t\tConfig: *config,\n\t}\n\n\tif err := client.refreshEndpoint(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn client, nil\n}", "func (cc *Client) WithClientConfig(ctx context.Context, req *http.Request) *http.Request {\n\ttrace := cc.HTTPTrace()\n\tif trace != nil && trace.ClientTrace != nil {\n\t\treturn req.WithContext(httptrace.WithClientTrace(ctx, trace.ClientTrace))\n\t}\n\treturn req.WithContext(ctx)\n}", "func createValidatingWebhookConfiguration(f *framework.Framework, config *admissionregistrationv1.ValidatingWebhookConfiguration) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) {\n\tctx := f.Context\n\tfor _, webhook := range config.Webhooks {\n\t\tif webhook.NamespaceSelector != nil && webhook.NamespaceSelector.MatchLabels[uniqueName] == \"true\" {\n\t\t\tcontinue\n\t\t}\n\t\tif webhook.ObjectSelector != nil && webhook.ObjectSelector.MatchLabels[uniqueName] == \"true\" {\n\t\t\tcontinue\n\t\t}\n\t\tf.Log.Failf(`webhook %s in config %s has no namespace or object selector with %s=\"true\", and can interfere with other tests`, webhook.Name, config.Name, uniqueName)\n\t}\n\treturn f.VclusterClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Create(ctx, config, metav1.CreateOptions{})\n}", "func (c WebhooksConfig) NewWebhooks(ctx context.Context, server io.Server) (web.Webhooks, error) {\n\tvar target web.Sink\n\tswitch c.Target {\n\tcase \"\":\n\t\treturn nil, nil\n\tcase \"direct\":\n\t\tclient, err := server.HTTPClient(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tclient.Timeout = c.Timeout\n\t\ttarget = &web.HTTPClientSink{\n\t\t\tClient: client,\n\t\t}\n\tdefault:\n\t\treturn nil, errWebhooksTarget.WithAttributes(\"target\", c.Target)\n\t}\n\tif c.Registry == nil {\n\t\treturn nil, errWebhooksRegistry.New()\n\t}\n\tif c.QueueSize > 0 || c.Workers > 0 {\n\t\ttarget = &web.QueuedSink{\n\t\t\tTarget: target,\n\t\t\tQueue: make(chan *http.Request, c.QueueSize),\n\t\t\tWorkers: c.Workers,\n\t\t}\n\t}\n\tif controllable, ok := target.(web.ControllableSink); ok {\n\t\tgo func() {\n\t\t\tif err := controllable.Run(ctx); err != nil && !errors.IsCanceled(err) {\n\t\t\t\tlog.FromContext(ctx).WithError(err).Error(\"Webhooks target sink failed\")\n\t\t\t}\n\t\t}()\n\t}\n\treturn web.NewWebhooks(ctx, server, c.Registry, target, c.Downlinks)\n}", "func NewGenericWebhook(kubeConfigFile string, groupVersions []unversioned.GroupVersion) (*GenericWebhook, error) {\n\tfor _, groupVersion := range groupVersions {\n\t\tif !registered.IsEnabledVersion(groupVersion) {\n\t\t\treturn nil, fmt.Errorf(\"webhook plugin requires enabling extension resource: %s\", groupVersion)\n\t\t}\n\t}\n\n\tloadingRules := clientcmd.NewDefaultClientConfigLoadingRules()\n\tloadingRules.ExplicitPath = kubeConfigFile\n\tloader := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, &clientcmd.ConfigOverrides{})\n\n\tclientConfig, err := loader.ClientConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcodec := api.Codecs.LegacyCodec(groupVersions...)\n\tclientConfig.ContentConfig.NegotiatedSerializer = runtimeserializer.NegotiatedSerializerWrapper(\n\t\truntime.SerializerInfo{Serializer: codec},\n\t\truntime.StreamSerializerInfo{},\n\t)\n\n\trestClient, err := restclient.UnversionedRESTClientFor(clientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO(ericchiang): Can we ensure remote service is reachable?\n\n\treturn &GenericWebhook{restClient}, nil\n}", "func NewForConfig(config clientcmd.ClientConfig) (client *Client, err error) {\n\tif config == nil {\n\t\t// initialize client-go clients\n\t\tloadingRules := clientcmd.NewDefaultClientConfigLoadingRules()\n\t\tconfigOverrides := &clientcmd.ConfigOverrides{}\n\t\tconfig = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides)\n\t}\n\n\tclient = new(Client)\n\tclient.KubeConfig = config\n\n\tclient.KubeClientConfig, err = client.KubeConfig.ClientConfig()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, errorMsg)\n\t}\n\n\tclient.KubeClient, err = kubernetes.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.Namespace, _, err = client.KubeConfig.Namespace()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.OperatorClient, err = operatorsclientset.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.DynamicClient, err = dynamic.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.appsClient, err = appsclientset.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.serviceCatalogClient, err = servicecatalogclienset.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.discoveryClient, err = discovery.NewDiscoveryClientForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.checkIngressSupports = true\n\n\tclient.userClient, err = userclientset.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.projectClient, err = projectclientset.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.routeClient, err = routeclientset.NewForConfig(client.KubeClientConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn client, nil\n}", "func (cm *CertificateManager) updateWebhookConfigs(ctx context.Context, caCertData []byte) error {\n\tcm.opts.Logger.Info(\"Updating webhook configs with CA bundle\")\n\n\t// Update validating webhooks with new CA data.\n\tlabelSelector, err := metav1.ParseToLabelSelector(cm.opts.WebhookConfigLabel)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse webhook label: %w\", err)\n\t}\n\tmatchLabels := client.MatchingLabels(labelSelector.MatchLabels)\n\tvalidatingWebhookList := &adminregv1.ValidatingWebhookConfigurationList{}\n\tif err := cm.opts.Client.List(ctx, validatingWebhookList, matchLabels); err != nil && !apierrors.IsNotFound(err) {\n\t\treturn fmt.Errorf(\"failed to list validating webhooks: %w\", err)\n\t}\n\n\tfor i := range validatingWebhookList.Items {\n\t\twebhookConfig := validatingWebhookList.Items[i]\n\t\tfor i := range webhookConfig.Webhooks {\n\t\t\twebhookConfig.Webhooks[i].ClientConfig.CABundle = caCertData\n\t\t}\n\n\t\tif err := cm.opts.Client.Update(ctx, &webhookConfig); err != nil {\n\t\t\tif !apierrors.IsConflict(err) {\n\t\t\t\treturn fmt.Errorf(\"failed to update validating webhook configuration %s/%s: %w\", webhookConfig.Namespace, webhookConfig.Name, err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Update mutating webhooks with new CA data.\n\tmutatingWebhookList := &adminregv1.MutatingWebhookConfigurationList{}\n\tif err := cm.opts.Client.List(ctx, mutatingWebhookList, matchLabels); err != nil && !apierrors.IsNotFound(err) {\n\t\treturn fmt.Errorf(\"failed to list mutating webhooks: %w\", err)\n\t}\n\n\tfor i := range mutatingWebhookList.Items {\n\t\twebhookConfig := mutatingWebhookList.Items[i]\n\t\tfor i := range webhookConfig.Webhooks {\n\t\t\twebhookConfig.Webhooks[i].ClientConfig.CABundle = caCertData\n\t\t}\n\n\t\tif err := cm.opts.Client.Update(ctx, &webhookConfig); err != nil {\n\t\t\tif !apierrors.IsConflict(err) {\n\t\t\t\treturn fmt.Errorf(\"failed to update mutating webhook configuration %s/%s: %w\", webhookConfig.Namespace, webhookConfig.Name, err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "func clientConfig(m discovery.PluginMeta, loglevel hclog.Level) *goPlugin.ClientConfig {\n\tlogger := hclog.New(&hclog.LoggerOptions{\n\t\tName: \"plugin\",\n\t\tLevel: loglevel,\n\t\tOutput: os.Stderr,\n\t})\n\n\treturn &goPlugin.ClientConfig{\n\t\tCmd: exec.Command(m.Path), //nolint:gosec\n\t\tHandshakeConfig: plugin.Handshake,\n\t\tVersionedPlugins: plugin.VersionedPlugins,\n\t\tManaged: true,\n\t\tLogger: logger,\n\t\tAllowedProtocols: []goPlugin.Protocol{goPlugin.ProtocolGRPC},\n\t\tAutoMTLS: true,\n\t}\n}", "func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ConfigV1Client, error) {\n\tconfig := *c\n\tif err := setConfigDefaults(&config); err != nil {\n\t\treturn nil, err\n\t}\n\tclient, err := rest.RESTClientForConfigAndClient(&config, h)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ConfigV1Client{client}, nil\n}", "func New(\n\tctx context.Context,\n\tcontrollers []interface{},\n) (webhook *Webhook, err error) {\n\n\t// ServeMux.Handle panics on duplicate paths\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terr = fmt.Errorf(\"error creating webhook %v\", r)\n\t\t}\n\t}()\n\n\topts := GetOptions(ctx)\n\tif opts == nil {\n\t\treturn nil, errors.New(\"context must have Options specified\")\n\t}\n\tlogger := logging.FromContext(ctx)\n\n\tif opts.StatsReporter == nil {\n\t\treporter, err := NewStatsReporter()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\topts.StatsReporter = reporter\n\t}\n\n\tdefaultTLSMinVersion := uint16(tls.VersionTLS13)\n\tif opts.TLSMinVersion == 0 {\n\t\topts.TLSMinVersion = TLSMinVersionFromEnv(defaultTLSMinVersion)\n\t} else if opts.TLSMinVersion != tls.VersionTLS12 && opts.TLSMinVersion != tls.VersionTLS13 {\n\t\treturn nil, fmt.Errorf(\"unsupported TLS version: %d\", opts.TLSMinVersion)\n\t}\n\n\tsyncCtx, cancel := context.WithCancel(context.Background())\n\n\twebhook = &Webhook{\n\t\tOptions: *opts,\n\t\tLogger: logger,\n\t\tsynced: cancel,\n\t}\n\n\tif opts.SecretName != \"\" {\n\t\t// Injection is too aggressive for this case because by simply linking this\n\t\t// library we force consumers to have secret access. If we require that one\n\t\t// of the admission controllers' informers *also* require the secret\n\t\t// informer, then we can fetch the shared informer factory here and produce\n\t\t// a new secret informer from it.\n\t\tsecretInformer := kubeinformerfactory.Get(ctx).Core().V1().Secrets()\n\n\t\twebhook.tlsConfig = &tls.Config{\n\t\t\tMinVersion: opts.TLSMinVersion,\n\n\t\t\t// If we return (nil, error) the client sees - 'tls: internal error\"\n\t\t\t// If we return (nil, nil) the client sees - 'tls: no certificates configured'\n\t\t\t//\n\t\t\t// We'll return (nil, nil) when we don't find a certificate\n\t\t\tGetCertificate: func(*tls.ClientHelloInfo) (*tls.Certificate, error) {\n\t\t\t\tsecret, err := secretInformer.Lister().Secrets(system.Namespace()).Get(opts.SecretName)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Errorw(\"failed to fetch secret\", zap.Error(err))\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\twebOpts := GetOptions(ctx)\n\t\t\t\tsKey, sCert := getSecretDataKeyNamesOrDefault(webOpts.ServerPrivateKeyName, webOpts.ServerCertificateName)\n\t\t\t\tserverKey, ok := secret.Data[sKey]\n\t\t\t\tif !ok {\n\t\t\t\t\tlogger.Warn(\"server key missing\")\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\tserverCert, ok := secret.Data[sCert]\n\t\t\t\tif !ok {\n\t\t\t\t\tlogger.Warn(\"server cert missing\")\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\tcert, err := tls.X509KeyPair(serverCert, serverKey)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn &cert, nil\n\t\t\t},\n\t\t}\n\t}\n\n\twebhook.mux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.Error(w, fmt.Sprint(\"no controller registered for: \", html.EscapeString(r.URL.Path)), http.StatusBadRequest)\n\t})\n\n\tfor _, controller := range controllers {\n\t\tswitch c := controller.(type) {\n\t\tcase AdmissionController:\n\t\t\thandler := admissionHandler(logger, opts.StatsReporter, c, syncCtx.Done())\n\t\t\twebhook.mux.Handle(c.Path(), handler)\n\n\t\tcase ConversionController:\n\t\t\thandler := conversionHandler(logger, opts.StatsReporter, c)\n\t\t\twebhook.mux.Handle(c.Path(), handler)\n\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown webhook controller type: %T\", controller)\n\t\t}\n\t}\n\n\treturn\n}", "func GetClientConfig(kubeConfig string) (*rest.Config, error) {\n\tif kubeConfig != \"\" {\n\t\treturn clientcmd.BuildConfigFromFlags(\"\", kubeConfig)\n\t}\n\treturn rest.InClusterConfig()\n\n}", "func ValidatingWebhookConfigurationCreator(timeout int) reconciling.NamedValidatingWebhookConfigurationCreatorGetter {\n\treturn func() (string, reconciling.ValidatingWebhookConfigurationCreator) {\n\t\treturn resources.GatekeeperValidatingWebhookConfigurationName, func(validatingWebhookConfigurationWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) {\n\t\t\tfailurePolicyIgnore := admissionregistrationv1.Ignore\n\t\t\tsideEffectsNone := admissionregistrationv1.SideEffectClassNone\n\t\t\tmatchPolicyExact := admissionregistrationv1.Exact\n\t\t\tallScopes := admissionregistrationv1.AllScopes\n\n\t\t\tvalidatingWebhookConfigurationWebhookConfiguration.Labels = map[string]string{\"gatekeeper.sh/system\": \"yes\"}\n\t\t\t// Get cabundle if set\n\t\t\tvar caBundle []byte\n\t\t\tif len(validatingWebhookConfigurationWebhookConfiguration.Webhooks) > 0 {\n\t\t\t\tcaBundle = validatingWebhookConfigurationWebhookConfiguration.Webhooks[0].ClientConfig.CABundle\n\t\t\t}\n\t\t\tvalidatingWebhookConfigurationWebhookConfiguration.Webhooks = []admissionregistrationv1.ValidatingWebhook{\n\t\t\t\t{\n\t\t\t\t\tName: \"validation.gatekeeper.sh\",\n\t\t\t\t\tAdmissionReviewVersions: []string{admissionregistrationv1.SchemeGroupVersion.Version, admissionregistrationv1beta1.SchemeGroupVersion.Version},\n\t\t\t\t\tFailurePolicy: &failurePolicyIgnore,\n\t\t\t\t\tSideEffects: &sideEffectsNone,\n\t\t\t\t\tTimeoutSeconds: pointer.Int32Ptr(int32(timeout)),\n\t\t\t\t\tMatchPolicy: &matchPolicyExact,\n\t\t\t\t\tNamespaceSelector: &metav1.LabelSelector{\n\t\t\t\t\t\tMatchExpressions: []metav1.LabelSelectorRequirement{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tKey: \"control-plane\",\n\t\t\t\t\t\t\t\tOperator: metav1.LabelSelectorOpDoesNotExist,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tKey: resources.GatekeeperExemptNamespaceLabel,\n\t\t\t\t\t\t\t\tOperator: metav1.LabelSelectorOpDoesNotExist,\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\tObjectSelector: &metav1.LabelSelector{},\n\t\t\t\t\tClientConfig: admissionregistrationv1.WebhookClientConfig{\n\t\t\t\t\t\tCABundle: caBundle,\n\t\t\t\t\t\tService: &admissionregistrationv1.ServiceReference{\n\t\t\t\t\t\t\tName: resources.GatekeeperWebhookServiceName,\n\t\t\t\t\t\t\tNamespace: resources.GatekeeperNamespace,\n\t\t\t\t\t\t\tPath: pointer.StringPtr(\"/v1/admit\"),\n\t\t\t\t\t\t\tPort: pointer.Int32Ptr(443),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRules: []admissionregistrationv1.RuleWithOperations{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tOperations: []admissionregistrationv1.OperationType{\n\t\t\t\t\t\t\t\tadmissionregistrationv1.Create,\n\t\t\t\t\t\t\t\tadmissionregistrationv1.Update,\n\t\t\t\t\t\t\t\tadmissionregistrationv1.Delete,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tRule: admissionregistrationv1.Rule{\n\t\t\t\t\t\t\t\tAPIGroups: []string{\"*\"},\n\t\t\t\t\t\t\t\tAPIVersions: []string{\"*\"},\n\t\t\t\t\t\t\t\tResources: []string{\"*\"},\n\t\t\t\t\t\t\t\tScope: &allScopes,\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\t{\n\t\t\t\t\tName: \"check-ignore-label.gatekeeper.sh\",\n\t\t\t\t\tAdmissionReviewVersions: []string{admissionregistrationv1.SchemeGroupVersion.Version, admissionregistrationv1beta1.SchemeGroupVersion.Version},\n\t\t\t\t\tFailurePolicy: &failurePolicyIgnore,\n\t\t\t\t\tSideEffects: &sideEffectsNone,\n\t\t\t\t\tTimeoutSeconds: pointer.Int32Ptr(int32(timeout)),\n\t\t\t\t\tMatchPolicy: &matchPolicyExact,\n\t\t\t\t\tNamespaceSelector: &metav1.LabelSelector{\n\t\t\t\t\t\tMatchExpressions: []metav1.LabelSelectorRequirement{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tKey: \"control-plane\",\n\t\t\t\t\t\t\t\tOperator: metav1.LabelSelectorOpDoesNotExist,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tKey: resources.GatekeeperExemptNamespaceLabel,\n\t\t\t\t\t\t\t\tOperator: metav1.LabelSelectorOpDoesNotExist,\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\tObjectSelector: &metav1.LabelSelector{},\n\t\t\t\t\tClientConfig: admissionregistrationv1.WebhookClientConfig{\n\t\t\t\t\t\tCABundle: caBundle,\n\t\t\t\t\t\tService: &admissionregistrationv1.ServiceReference{\n\t\t\t\t\t\t\tName: resources.GatekeeperWebhookServiceName,\n\t\t\t\t\t\t\tNamespace: resources.GatekeeperNamespace,\n\t\t\t\t\t\t\tPath: pointer.StringPtr(\"/v1/admitlabel\"),\n\t\t\t\t\t\t\tPort: pointer.Int32Ptr(443),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRules: []admissionregistrationv1.RuleWithOperations{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tOperations: []admissionregistrationv1.OperationType{\n\t\t\t\t\t\t\t\tadmissionregistrationv1.Create,\n\t\t\t\t\t\t\t\tadmissionregistrationv1.Update,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tRule: admissionregistrationv1.Rule{\n\t\t\t\t\t\t\t\tAPIGroups: []string{\"\"},\n\t\t\t\t\t\t\t\tAPIVersions: []string{\"*\"},\n\t\t\t\t\t\t\t\tResources: []string{\"namespaces\"},\n\t\t\t\t\t\t\t\tScope: &allScopes,\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\n\t\t\treturn validatingWebhookConfigurationWebhookConfiguration, nil\n\t\t}\n\t}\n}", "func GetClientConfig(kubeconfig string) (*rest.Config, error) {\n\tif kubeconfig != \"\" {\n\t\treturn clientcmd.BuildConfigFromFlags(\"\", kubeconfig)\n\t}\n\treturn rest.InClusterConfig()\n}", "func GetClientConfig(kubeconfig string) (*rest.Config, error) {\n\tif kubeconfig != \"\" {\n\t\treturn clientcmd.BuildConfigFromFlags(\"\", kubeconfig)\n\t}\n\treturn rest.InClusterConfig()\n}", "func (c WebhooksConfig) NewWebhooks(ctx context.Context, server io.Server) (web.Webhooks, error) {\n\tvar target web.Sink\n\tswitch c.Target {\n\tcase \"\":\n\t\treturn nil, nil\n\tcase \"direct\":\n\t\ttarget = &web.HTTPClientSink{\n\t\t\tClient: &http.Client{\n\t\t\t\tTimeout: c.Timeout,\n\t\t\t},\n\t\t}\n\tdefault:\n\t\treturn nil, errWebhooksTarget.WithAttributes(\"target\", c.Target)\n\t}\n\tif c.Registry == nil {\n\t\treturn nil, errWebhooksRegistry.New()\n\t}\n\tif c.QueueSize > 0 || c.Workers > 0 {\n\t\ttarget = &web.QueuedSink{\n\t\t\tTarget: target,\n\t\t\tQueue: make(chan *http.Request, c.QueueSize),\n\t\t\tWorkers: c.Workers,\n\t\t}\n\t}\n\tif controllable, ok := target.(web.ControllableSink); ok {\n\t\tgo func() {\n\t\t\tif err := controllable.Run(ctx); err != nil && !errors.IsCanceled(err) {\n\t\t\t\tlog.FromContext(ctx).WithError(err).Error(\"Webhooks target sink failed\")\n\t\t\t}\n\t\t}()\n\t}\n\treturn web.NewWebhooks(ctx, server, c.Registry, target, c.Downlinks), nil\n}", "func NewClientWithConfig(config *Config) *Client {\n\tvar tlsConfig *tls.Config\n\tif len(config.CertificateP12) > 0 {\n\t\t// 密码为商户ID\n\t\t// 这里忽略错误, 因为没有证书只会影响高级接口, 高级接口调用时输出相应的日志即可\n\t\tvar err error\n\t\ttlsConfig, err = getTLSConfig(config.CertificateP12, config.MerchantID, config.RootCAPem)\n\t\tif err != nil {\n\t\t\tlog.Warningf(\"[%s:%s] Failed to init tls config, secure APIs with certificate validation would be unavailable, error: %+v\",\n\t\t\t\tconfig.AppID, config.AppName, err)\n\t\t}\n\t} else {\n\t\tlog.Warningf(\"[%s:%s] certificate was not configured, secure APIs with certificate validation would be unavailable\",\n\t\t\tconfig.AppID, config.AppName)\n\t}\n\n\treturn &Client{\n\t\tconfig: config,\n\t\ttlsConfig: tlsConfig,\n\t}\n}", "func NewConfigClientFactory(name string, config *rest.Config) *ConfigClientFactory {\n\treturn &ConfigClientFactory{name, config}\n}", "func (b *AdapterBase) ClientConfig() (*rest.Config, error) {\n\tif b.clientConfig == nil {\n\t\tvar clientConfig *rest.Config\n\t\tvar err error\n\t\tif len(b.RemoteKubeConfigFile) > 0 {\n\t\t\tloadingRules := &clientcmd.ClientConfigLoadingRules{ExplicitPath: b.RemoteKubeConfigFile}\n\t\t\tloader := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, &clientcmd.ConfigOverrides{})\n\n\t\t\tclientConfig, err = loader.ClientConfig()\n\t\t} else {\n\t\t\tclientConfig, err = rest.InClusterConfig()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to construct lister client config to initialize provider: %v\", err)\n\t\t}\n\t\tb.clientConfig = clientConfig\n\t}\n\treturn b.clientConfig, nil\n}", "func NewHTTPClientFromConfig(cfg *config.Config) (*HTTPClient, error) {\n\t// get clients\n\tordererClients, err := getOrdererHTTPClients(cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpeerClients, err := getPeerHTTPClients(cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &HTTPClient{\n\t\tordererHTTPClients: ordererClients,\n\t\tpeerHTTPClients: peerClients,\n\t\tprivKey: cfg.KeyStore.Privs[0],\n\t}, nil\n}", "func (c *clientSet) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationClient {\n\treturn NewValidatingWebhookConfigurationClient(c.client)\n}", "func createOpenAPIBuilderConfig() *common.Config {\n\treturn &common.Config{\n\t\tProtocolList: []string{\"https\"},\n\t\tIgnorePrefixes: []string{\"/swaggerapi\"},\n\t\tInfo: &spec.Info{\n\t\t\tInfoProps: spec.InfoProps{\n\t\t\t\tTitle: \"Argo-Events\",\n\t\t\t\tVersion: \"v0.6\",\n\t\t\t},\n\t\t},\n\t}\n}", "func (c *Client) initClientConfig() error {\n\tif c.clientConfig != nil {\n\t\t// ssh.CLientConfig has been provided for us\n\t\treturn nil\n\t}\n\thostKeyCallback, err := knownhosts.New(fmt.Sprintf(\"%s/.ssh/known_hosts\", os.Getenv(\"HOME\")))\n\tif err != nil {\n\t\treturn err\n\t}\n\tsshAuthMethods := []ssh.AuthMethod{AgentAuth(), PublicKeyAuth(), PasswordAuth()}\n\tif c.agent != nil {\n\t\tsshAuthMethods = append(sshAuthMethods, ssh.PublicKeysCallback(c.agent.Signers))\n\t}\n\tc.clientConfig = &ssh.ClientConfig{\n\t\tUser: c.user,\n\t\tAuth: sshAuthMethods,\n\t\tHostKeyCallback: hostKeyCallback,\n\t\tTimeout: time.Duration(int64(time.Second * 20)),\n\t}\n\treturn nil\n}", "func LoadApiClientConfig(path string, context string) (*restclient.Config, error) {\n\toverrides := clientcmd.ConfigOverrides{}\n\tif context != \"\" {\n\t\toverrides.CurrentContext = context\n\t}\n\tconfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(\n\t\t&clientcmd.ClientConfigLoadingRules{ExplicitPath: path},\n\t\t&overrides)\n\treturn config.ClientConfig()\n}", "func (client *WebhooksClient) getCallbackConfigCreateRequest(ctx context.Context, resourceGroupName string, registryName string, webhookName string, options *WebhooksClientGetCallbackConfigOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig\"\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 registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\tif webhookName == \"\" {\n\t\treturn nil, errors.New(\"parameter webhookName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{webhookName}\", url.PathEscape(webhookName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, 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\", \"2019-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "func (client *Client) UpdateHookConfigurationWithChan(request *UpdateHookConfigurationRequest) (<-chan *UpdateHookConfigurationResponse, <-chan error) {\n\tresponseChan := make(chan *UpdateHookConfigurationResponse, 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.UpdateHookConfiguration(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}", "func NewWebhook(client kubernetes.Interface, resources *WebhookResources, controllerNamespace string, noInitContainer bool) (*Webhook, error) {\n\tvar (\n\t\tscheme = runtime.NewScheme()\n\t\tcodecs = serializer.NewCodecFactory(scheme)\n\t)\n\n\treturn &Webhook{\n\t\tdeserializer: codecs.UniversalDeserializer(),\n\t\tcontrollerNamespace: controllerNamespace,\n\t\tresources: resources,\n\t\tnoInitContainer: noInitContainer,\n\t}, nil\n}", "func NewClientWithConfig(config *vaultapi.Config, vaultCfg *Config, gcpCfg *GCPBackendConfig) (*Client, error) {\n\tvar clientToken string\n\tvar err error\n\trawClient, err := vaultapi.NewClient(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogical := rawClient.Logical()\n\tclient := &Client{Client: rawClient, Logical: logical}\n\n\tswitch vaultCfg.Backend {\n\tcase \"gcp\":\n\t\tclientToken, err = GCPBackendLogin(client, gcpCfg, vaultCfg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\tjwt, err := GetServiceAccountToken(vaultCfg.TokenPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tclientToken, err = KubernetesBackendLogin(client, vaultCfg.Role, jwt)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif err == nil {\n\t\trawClient.SetToken(string(clientToken))\n\t} else {\n\t\treturn nil, err\n\t}\n\treturn client, nil\n}", "func loadClientConfig() *client.Config {\n\tcfg := &client.Config{\n\t\tHost: viper.GetString(\"host\"),\n\t\tPort: viper.GetInt(\"port\"),\n\t\tSSL: viper.GetBool(\"insecure\"),\n\t\tInsecure: viper.GetBool(\"insecure\"),\n\t\tBindDN: viper.GetString(\"bind\"),\n\t\tBindPassword: viper.GetString(\"password\"),\n\t}\n\tlog.WithFields(log.Fields{\n\t\t\"host\": cfg.Host,\n\t\t\"port\": cfg.Port,\n\t\t\"bind\": cfg.BindDN,\n\t}).Debug(\"LDAP client config\")\n\treturn cfg\n}", "func (o *ClientConfig) NewClient(options ...ClientOption) (Client, error) {\n\n\t// Run provided ClientOption configuration options.\n\tfor _, opt := range options {\n\t\terr := opt(o)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed applying functional option: %w\", err)\n\t\t}\n\t}\n\n\t// Check mandatory option is provided.\n\tif o.githubUserClient == nil {\n\t\treturn nil, fmt.Errorf(\"github client not provided\")\n\t}\n\n\ttokenGenerator := secret.GetTokenGenerator(o.tokenPath)\n\n\tgitFactory, err := o.GitClient(o.githubUserClient, tokenGenerator, secret.Censor, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgitClient := &client{}\n\t// Initialize map to enable writing to it in methods.\n\tgitClient.clonedRepos = make(map[string]string)\n\tgitClient.ClientFactory = gitFactory\n\treturn gitClient, err\n}", "func GetValidatingWebhookConfiguration(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ValidatingWebhookConfigurationState, opts ...pulumi.ResourceOption) (*ValidatingWebhookConfiguration, error) {\n\tvar resource ValidatingWebhookConfiguration\n\terr := ctx.ReadResource(\"kubernetes:admissionregistration.k8s.io/v1:ValidatingWebhookConfiguration\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func ExampleClientConfig() {\n\t// In real code this MUST be replaced by the factory from the actual implementation.\n\tvar ecFactory ecinterface.Factory\n\n\tvar cfg Config\n\tif err := baseplate.ParseConfigYAML(&cfg); err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx, bp, err := baseplate.New(context.Background(), baseplate.NewArgs{\n\t\tConfig: cfg,\n\t\tEdgeContextFactory: ecFactory,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer bp.Close()\n\n\tclient := redisbp.NewMonitoredClient(\"redis\", redisbp.OptionsMust(cfg.Redis.Options()))\n\tclient.Ping(ctx)\n}", "func (c *ClusterProvider) NewClientConfig() (*ClientConfig, error) {\n\tclusterName := fmt.Sprintf(\"%s.%s.eksctl.io\", c.cfg.ClusterName, c.cfg.Region)\n\tcontextName := fmt.Sprintf(\"%s@%s\", c.getUsername(), clusterName)\n\n\tclientConfig := &ClientConfig{\n\t\tCluster: c.cfg,\n\t\tClient: &clientcmdapi.Config{\n\t\t\tClusters: map[string]*clientcmdapi.Cluster{\n\t\t\t\tclusterName: {\n\t\t\t\t\tServer: c.cfg.MasterEndpoint,\n\t\t\t\t\tCertificateAuthorityData: c.cfg.CertificateAuthorityData,\n\t\t\t\t},\n\t\t\t},\n\t\t\tContexts: map[string]*clientcmdapi.Context{\n\t\t\t\tcontextName: {\n\t\t\t\t\tCluster: clusterName,\n\t\t\t\t\tAuthInfo: contextName,\n\t\t\t\t},\n\t\t\t},\n\t\t\tAuthInfos: map[string]*clientcmdapi.AuthInfo{\n\t\t\t\tcontextName: &clientcmdapi.AuthInfo{},\n\t\t\t},\n\t\t\tCurrentContext: contextName,\n\t\t},\n\t\tClusterName: clusterName,\n\t\tContextName: contextName,\n\t\troleARN: c.svc.arn,\n\t\tsts: c.svc.sts,\n\t}\n\n\treturn clientConfig, nil\n}", "func (s *AsyncInferenceConfig) SetClientConfig(v *AsyncInferenceClientConfig) *AsyncInferenceConfig {\n\ts.ClientConfig = v\n\treturn s\n}", "func (c *TLSConfig) BuildModuleClientConfig(host string) *tls.Config {\n\tif c == nil {\n\t\t// use default TLS settings, if config is empty.\n\t\treturn &tls.Config{\n\t\t\tServerName: host,\n\t\t\tInsecureSkipVerify: true,\n\t\t\tVerifyConnection: makeVerifyConnection(&TLSConfig{\n\t\t\t\tVerification: VerifyFull,\n\t\t\t}),\n\t\t}\n\t}\n\n\tconfig := c.ToConfig()\n\tconfig.ServerName = host\n\treturn config\n}", "func NewClient(kubeConfig string) (client *Client, err error) {\n\tconfig, err := GetClientConfig(kubeConfig)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tclientset, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\textClientset, err := apiextensionsclientset.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\treturn &Client{\n\t\tClient: clientset,\n\t\tExtClient: extClientset,\n\t}, nil\n}", "func NewForConfig(c *rest.Config) (*ServicebrokerV1alpha1Client, error) {\n\tconfig := *c\n\tif err := setConfigDefaults(&config); err != nil {\n\t\treturn nil, err\n\t}\n\tclient, err := rest.RESTClientFor(&config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ServicebrokerV1alpha1Client{client}, nil\n}", "func NewClient(config *Config) (*Client, error) {\n\tdefConfig := DefaultConfig()\n\n\tif len(config.Address) == 0 {\n\t\tconfig.Address = defConfig.Address\n\t}\n\n\tif len(config.Scheme) == 0 {\n\t\tconfig.Scheme = defConfig.Scheme\n\t}\n\n\tif config.HTTPClient == nil {\n\t\tconfig.HTTPClient = defConfig.HTTPClient\n\t}\n\n\tclient := &Client{\n\t\tConfig: *config,\n\t}\n\treturn client, nil\n}", "func NewClientFromConfiguration(config *Configuration) (*Client, error) {\n\terr := config.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient, err := NewClient(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn client, nil\n}", "func EventListenerConfig(generatedResourceName string) EventListenerStatusOp {\n\treturn func(e *v1alpha1.EventListenerStatus) {\n\t\te.Configuration.GeneratedResourceName = generatedResourceName\n\t}\n}", "func EventListenerConfig(generatedResourceName string) EventListenerStatusOp {\n\treturn func(e *v1alpha1.EventListenerStatus) {\n\t\te.Configuration.GeneratedResourceName = generatedResourceName\n\t}\n}", "func (whc *WebhookConfigController) rebuildWebhookConfig() error {\n\twebhookConfig, err := rebuildWebhookConfigHelper(\n\t\twhc.webhookParameters.CACertFile,\n\t\twhc.webhookParameters.WebhookConfigFile,\n\t\twhc.webhookParameters.WebhookName,\n\t\twhc.ownerRefs)\n\tif err != nil {\n\t\treportValidationConfigLoadError(err)\n\t\tscope.Errorf(\"validatingwebhookconfiguration (re)load failed: %v\", err)\n\t\treturn err\n\t}\n\twhc.webhookConfiguration = webhookConfig\n\n\t// pretty-print the validatingwebhookconfiguration as YAML\n\tvar webhookYAML string\n\tif b, err := yaml.Marshal(whc.webhookConfiguration); err == nil {\n\t\twebhookYAML = string(b)\n\t}\n\tscope.Infof(\"%v validatingwebhookconfiguration (re)loaded: \\n%v\",\n\t\twhc.webhookConfiguration.Name, webhookYAML)\n\n\treportValidationConfigLoad()\n\n\treturn nil\n}", "func NewClient(conf *ClientConfig, opt ...grpc.DialOption) *Client {\n\tc := new(Client)\n\tif err := c.SetConfig(conf); err != nil {\n\t\tpanic(err)\n\t}\n\tc.UseOpt(opt...)\n\tc.Use(c.recovery(), c.handle())\n\treturn c\n}", "func (target *WebhookTarget) initWebhook() error {\n\targs := target.args\n\ttransport := target.transport\n\n\tif args.ClientCert != \"\" && args.ClientKey != \"\" {\n\t\tmanager, err := certs.NewManager(context.Background(), args.ClientCert, args.ClientKey, tls.LoadX509KeyPair)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmanager.ReloadOnSignal(syscall.SIGHUP) // allow reloads upon SIGHUP\n\t\ttransport.TLSClientConfig.GetClientCertificate = manager.GetClientCertificate\n\t}\n\ttarget.httpClient = &http.Client{Transport: transport}\n\n\tyes, err := target.isActive()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !yes {\n\t\treturn errNotConnected\n\t}\n\n\treturn nil\n}", "func NewClientWrapper(config *api.Config, httpClient *http.Client) (IClient, error) {\n\tvar err error\n\tconfig.HttpClient = httpClient\n\tcfg := &ClientWrapper{}\n\tcfg.Client, err = api.NewClient(config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create new Consul client: %s\", err)\n\t}\n\treturn cfg, nil\n}", "func NewClient(config *config.Configuration, messageHandler exchange.MessageHandler) (*Client, error) {\n\n\tclientLogger := logger.NewLogger()\n\n\twebsocketBase, err := websocket.New(Url, clientLogger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient := &Client{\n\t\tconfig: config,\n\t\tws: websocketBase,\n\t\tlogger: clientLogger,\n\t\tsubscriptions: map[string][]string{},\n\t}\n\n\tif config != nil {\n\t\tif config.GetAuth() != nil {\n\t\t\twebsocketBase.OnConnected = client.Authenticate\n\t\t}\n\t}\n\n\twebsocketBase.OnMessage = websocket.OnMessageHandler(messageHandler)\n\n\twebsocketBase.SetKeepAliveTimeout(30 * time.Second)\n\n\treturn client, nil\n}", "func NewWebhookAPI(webhookChan chan dockworker.Job) WebhookAPI {\n\treturn WebhookAPI{\n\t\twebhookChan: webhookChan,\n\t}\n}", "func NewClient(cfg *Config) (*Client, error) {\n\t// Pass the transport with TLS settings to the oauth2 library in the context\n\tif cfg.TLSConfig == nil {\n\t\tcfg.TLSConfig = defaultTLSConfig\n\t}\n\tif cfg.HTTPTimeout == 0 {\n\t\tcfg.HTTPTimeout = defaultHTTPTimeout\n\t}\n\ttransport := http.DefaultTransport.(*http.Transport).Clone()\n\ttransport.TLSClientConfig = cfg.TLSConfig\n\tctxClient := &http.Client{Transport: transport}\n\tctx := context.TODO()\n\tctx = context.WithValue(ctx, oauth2.HTTPClient, ctxClient)\n\n\t// Create the oauth2 Client\n\tconfig := &clientcredentials.Config{\n\t\tClientID: cfg.ClientID,\n\t\tClientSecret: cfg.ClientSecret,\n\t\tTokenURL: cfg.TokenURL,\n\t}\n\thttpClient := config.Client(ctx)\n\tif httpClient == nil {\n\t\treturn nil, fmt.Errorf(\"Error creating Oauth2 http client for %s\", config.TokenURL)\n\t}\n\thttpClient.Timeout = cfg.HTTPTimeout\n\tclient := &Client{\n\t\tHTTPClient: httpClient,\n\t\tRetryWaitMin: defaultRetryWaitMin,\n\t\tRetryWaitMax: defaultRetryWaitMax,\n\t\tRetryMax: defaultRetryMax,\n\t\tCheckRetry: DefaultRetryPolicy,\n\t\tBackoff: DefaultBackoff,\n\t}\n\tlog.Infof(\"oauth2/clientcredential client created: RetryWaitMin=%v, RetryWaitMax=%v, RetryMax=%d\\n\",\n\t\tclient.RetryWaitMin, client.RetryWaitMax, client.RetryMax)\n\n\treturn client, nil\n}", "func ValidatingWebhookConfigurationObjectWrapper(create ValidatingWebhookConfigurationCreator) ObjectCreator {\n\treturn func(existing runtime.Object) (runtime.Object, error) {\n\t\tif existing != nil {\n\t\t\treturn create(existing.(*admissionregistrationv1beta1.ValidatingWebhookConfiguration))\n\t\t}\n\t\treturn create(&admissionregistrationv1beta1.ValidatingWebhookConfiguration{})\n\t}\n}", "func (client *Client) UpdateHookConfigurationWithCallback(request *UpdateHookConfigurationRequest, callback func(response *UpdateHookConfigurationResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *UpdateHookConfigurationResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.UpdateHookConfiguration(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}", "func (c *Client) ClientConfig(conf ssh.ClientConfig) *Client {\n\tc.clientConfig = &conf\n\treturn c\n}", "func (p *EtcdClientV3) GetConfig() *ClientConfig {\n\treturn &ClientConfig{\n\t\tendpoints: p.endpoints,\n\t\tTLSConfig: p.tlsConfig,\n\t}\n}", "func (o *DeleteV1WebhooksWebhookIDParams) WithHTTPClient(client *http.Client) *DeleteV1WebhooksWebhookIDParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "func NewClient(cfg *Config, args ...interface{}) (endpoint.Connector, error) {\n\treturn cfg.newClient(args)\n}", "func NewConfigClient() api.ConfigClient {\n\treturn &configClientImpl{}\n}", "func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *JusticeLobbyService {\n\t// ensure nullable parameters have default\n\tif cfg == nil {\n\t\tcfg = DefaultTransportConfig()\n\t}\n\n\t// create transport and client\n\ttransport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)\n\n\t// custom transport runtime\n\tutils.CustomTransportRuntime(transport)\n\n\treturn New(transport, transport, formats)\n}", "func NewClientWith(config *config.Configuration, tickerHandler exchange.TickerHandler,\n\ttradesHandler exchange.TradesHandler, orderBookSnapshotHandler exchange.OrderBookSnapshotHandler,\n\torderBookDeltaHandler exchange.OrderBookDeltaHandler) (*Client, error) {\n\n\tclientLogger := logger.NewLogger()\n\n\twebsocketBase, err := websocket.New(Url, clientLogger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient := &Client{\n\t\tconfig: config,\n\t\tws: websocketBase,\n\t\tlogger: clientLogger,\n\t\tsubscriptions: map[string][]string{},\n\t\tOnTicker: tickerHandler,\n\t\tOnTrades: tradesHandler,\n\t\tOnOrderBookSnapshot: orderBookSnapshotHandler,\n\t\tOnOrderBookDelta: orderBookDeltaHandler,\n\t}\n\n\tif config != nil {\n\t\tif config.GetAuth() != nil {\n\t\t\twebsocketBase.OnConnected = client.Authenticate\n\t\t}\n\t}\n\n\twebsocketBase.OnMessage = client.OnMessage\n\n\twebsocketBase.SetKeepAliveTimeout(30 * time.Second)\n\n\treturn client, nil\n}", "func buildConfig(log logrus.FieldLogger, masterURL, kubeConfig string) (*rest.Config, error) {\n\tif os.Getenv(\"KUBERNETES_SERVICE_HOST\") != \"\" && os.Getenv(\"KUBERNETES_SERVICE_PORT\") != \"\" {\n\t\t// If these env vars are set, we can build an in-cluster config.\n\t\tlog.Debug(\"Creating in-cluster client\")\n\t\treturn rest.InClusterConfig()\n\t}\n\n\tif masterURL != \"\" || kubeConfig != \"\" {\n\t\tlog.Debug(\"Creating cluster-external client from provided masterURL or kubeconfig\")\n\t\treturn clientcmd.BuildConfigFromFlags(masterURL, kubeConfig)\n\t}\n\n\treturn nil, fmt.Errorf(\"could not create client: missing masterURL or kubeConfig\")\n}", "func NewClient(config *api.APIConfig, tokenSource oauth2.TokenSource, sourcerepoService *sourcerepo.Service) Client {\n\tif config == nil || config.Integrations == nil || config.Integrations.CloudSource == nil || !config.Integrations.CloudSource.Enable {\n\t\treturn &client{\n\t\t\tenabled: false,\n\t\t}\n\t}\n\n\treturn &client{\n\t\tenabled: true,\n\t\tconfig: config,\n\t\tservice: sourcerepoService,\n\t\ttokenSource: tokenSource,\n\t}\n}", "func NewWebhookSender(config Config) Sender {\n\treturn webhookSender{config}\n}", "func (c *Client) AddWebhook(w *Webhook) error {\n\treturn c.AddWebHookContext(context.TODO(), w)\n}", "func NewAlertConfigClient(aviSession *session.AviSession) *AlertConfigClient {\n\treturn &AlertConfigClient{aviSession: aviSession}\n}" ]
[ "0.6975738", "0.58652604", "0.5590961", "0.5589027", "0.5560638", "0.54133326", "0.5370507", "0.5327911", "0.53260064", "0.531939", "0.5312625", "0.5310126", "0.53042454", "0.5289221", "0.5241468", "0.52322096", "0.52140266", "0.52014375", "0.5191292", "0.5150803", "0.51305264", "0.5123919", "0.5119834", "0.51063", "0.5097295", "0.50875825", "0.50853026", "0.50834537", "0.5066761", "0.50651246", "0.5052988", "0.4989516", "0.4979448", "0.49436846", "0.49166462", "0.48784208", "0.4856261", "0.48411462", "0.48383394", "0.48110372", "0.48094043", "0.4809188", "0.4767653", "0.47670183", "0.47564796", "0.47358906", "0.4726078", "0.47237274", "0.47209874", "0.47188976", "0.47148538", "0.47136626", "0.47136626", "0.46985254", "0.46972826", "0.4682923", "0.46787944", "0.46765363", "0.46722764", "0.46698332", "0.4658553", "0.46578023", "0.46461886", "0.464186", "0.4632603", "0.46307003", "0.4620698", "0.46095398", "0.46054047", "0.46024978", "0.45895994", "0.4569542", "0.45691633", "0.4566361", "0.45557067", "0.45417082", "0.45272508", "0.45240963", "0.45240963", "0.4514674", "0.4513713", "0.4511813", "0.4507946", "0.45079008", "0.4507576", "0.45075685", "0.45044178", "0.45019335", "0.44924277", "0.44876587", "0.4483287", "0.44731838", "0.44639963", "0.44604117", "0.4459118", "0.44571632", "0.44445655", "0.44370356", "0.4427394", "0.44256738" ]
0.85725427
0
Write writes len(b) bytes to memory. It returns the number of bytes written and an error, if any. Write returns a nonnil error when n != len(b).
Write записывает len(b) байтов в память. Он возвращает количество записанных байтов и ошибку, если она возникает. Write возвращает ненулевую ошибку, когда n != len(b).
func (m *Memory) Write(b []byte) (n int, err error) { if m == nil { return 0, os.ErrInvalid } if len(b) > len(m.buf) { n = len(m.buf) } else { n = len(b) } for i := 0; i < n; i++ { m.buf[i] = b[i] } m.buf = m.buf[n:] return n, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (w *Writer) Write(b []byte) (n int, err error) {\n\tw.Lock()\n\tdefer w.Unlock()\n\tn = len(b)\n\twrite(w, b)\n\treturn n, err\n}", "func (w *Writer) Write(b []byte) int {\n\tif w.err != nil {\n\t\treturn 0\n\t}\n\tn, err := w.W.Write(b)\n\tw.check(n, err)\n\treturn n\n}", "func (w *ReadWriter) Write(b []byte) (int, error) {\n\tdefer func() { w.done <- struct{}{} }()\n\tif w.withErr != nil {\n\t\treturn 0, w.withErr\n\t}\n\tw.b = b\n\treturn len(b), nil\n}", "func (b *Writer) Write(buf []byte) (n int, err error)", "func (c *TestConnection) Write(b []byte) (n int, err error) {\n if c.WriteError != nil && c.ThrowWriteErrorAfter == c.TimesWriteCalled {\n return 0, c.WriteError\n }\n\n if c.WriteCount > -1 {\n return c.WriteCount, nil\n }\n\n c.TimesWriteCalled++\n c.Written = append(c.Written, string(b))\n return len(b), nil\n}", "func (d *Download) Write(b []byte) (int, error) {\n\tn := len(b)\n\tatomic.AddUint64(&d.size, uint64(n))\n\treturn n, nil\n}", "func (w *Writer) Write(b []byte) (n int, err error) {\n\tif w.Maxsize > 0 && w.size > w.Maxsize {\n\t\tw.rolling()\n\t}\n\n\tif w.file == nil {\n\t\tif err := w.open(); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tif w.bw != nil {\n\t\tn, err = w.bw.Write(b)\n\t} else {\n\t\tn, err = w.file.Write(b)\n\t}\n\n\tif err == nil {\n\t\tw.size += int64(n)\n\t}\n\treturn n, err\n}", "func (m *Memory) Write(b []byte) (n int, err error) {\n\tpanic(\"not implemented\")\n}", "func (r *WriteCounter) Write(b []byte) (n int, err error) {\n\tif nil == r {\n\t\treturn 0, errors.New(\"Invalid parameter, 'nil' value\")\n\t}\n\n\tr.numWrites++\n\tr.numBytes += uint(len(b))\n\treturn len(b), nil\n}", "func (writer *FileWriter) Write(b []byte) (n int, err error) {\n\tbyteLen := len(b)\n\n\t// notify the detector before actually writing to prevent overrunning\n\t// any implementation specific thresholds which may be set\n\twriter.rollDetector.NotifyWrite(byteLen)\n\n\tif writer.rollDetector.ShouldRoll() {\n\t\twriter.roller.Roll(writer.file)\n\t\twriter.Init()\n\t}\n\n\tif byteLen > writer.bufferSize {\n\t\t// Break up messages that exceed the downstream buffer length,\n\t\t// using a bytes.Buffer since it's easy. This may result in an\n\t\t// undesirable amount of allocations, but the assumption is that\n\t\t// bursts of too-long messages are rare.\n\t\tbuf := bytes.NewBuffer(b)\n\t\tfor buf.Len() > 0 {\n\t\t\twriter.file.Write(buf.Next(writer.bufferSize))\n\t\t\twriter.file.Write([]byte(NL))\n\t\t}\n\t} else {\n\t\twriter.file.Write(b)\n\t\twriter.file.Write([]byte(NL))\n\t}\n\n\treturn byteLen, nil\n}", "func (b *ByteArray) Write(p []byte) (n int, err error) {\n\tfor n = 0; n < len(p); {\n\t\tvar slice []byte\n\t\tslice = b.WriteSlice()\n\t\tif slice == nil {\n\t\t\tpanic(\"ASSERT\")\n\t\t}\n\n\t\twritten := copy(slice, p[n:])\n\t\tb.writePos = b.seek(b.writePos, written, SEEK_CUR)\n\t\tn += written\n\t}\n\treturn n, err\n}", "func (fb *fakeBuffer) Write(p []byte) (int, error) {\n\tsize := len(p)\n\tfb.n += int64(size)\n\treturn size, nil\n}", "func (b *Bytes) Write(p []byte) (int, error) {\n\tn := b.Len()\n\tb.grow(n + len(p))\n\tcopy((*b.p)[n:], p)\n\treturn len(p), nil\n}", "func (s *Stream) Write(b []byte) (n int, err error) {\n\ts.sendLock.Lock()\n\tdefer s.sendLock.Unlock()\n\ttotal := 0\n\tfor total < len(b) {\n\t\tn, err := s.write(b[total:])\n\t\ttotal += n\n\t\tif err != nil {\n\t\t\treturn total, err\n\t\t}\n\t}\n\treturn total, nil\n}", "func (b *Buffer) Write(p []byte) (n int, err error) {\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\treturn b.b.Write(p)\n}", "func (c *Conn) Write(b []byte) (written int, err error) {\n\tif len(b) == 0 {\n\t\treturn 0, nil\n\t}\n\terr = tryAgain\n\tfor err == tryAgain {\n\t\tn, errcb := c.write(b)\n\t\terr = c.handleError(errcb)\n\t\tif err == nil {\n\t\t\treturn n, c.flushOutputBuffer()\n\t\t}\n\t}\n\treturn 0, err\n}", "func (c *Conn) Write(b []byte) (n int, err error) {\n\treturn syscall.Write(c.fd, b)\n}", "func (b *SafeBuffer) Write(p []byte) (n int, err error) {\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\treturn b.b.Write(p)\n}", "func (w *Writer) Write(b []byte) (n int, err error) {\n\treturn w.OnWrite(b)\n}", "func (nw noopWriter) Write(b []byte) (int, error) {\n\treturn len(b), nil\n}", "func (s *Conn) Write(b []byte) (int, error) {\n\tnow := s.timeFn()\n\tn := 0\n\tfor n < len(b) {\n\t\tif s.state >= stateDraining {\n\t\t\t// Closing\n\t\t\tbreak\n\t\t}\n\t\ti, err := s.recv(b[n:], now)\n\t\tn += i\n\t\t// Keep track bytes received from peer to limit bytes sending back\n\t\t// until its address is verified.\n\t\ts.recvPackets++\n\t\ts.recvBytes += uint64(i)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t}\n\tif n == 0 || !s.handshakeConfirmed {\n\t\t// Check probe timeout when the connection does not receive anything or\n\t\t// during handshake where there are multiple packet number spaces.\n\t\t// FIXME: What if peer does not send ACK?\n\t\ts.checkTimeout(now)\n\t}\n\treturn n, nil\n}", "func (aio *AsyncIO) Write(b []byte) (int, error) {\n\tnw, err := aio.WriteAt(b, aio.offset)\n\taio.offset += int64(nw)\n\treturn nw, err\n}", "func (e errorConnection) Write(b []byte) (n int, err error) {\n\treturn 0, e.err\n}", "func (c *conn) Write(b []byte) (int, error) {\n\tc.wonce.Do(c.sleepLatency)\n\n\tvar total int64\n\tfor len(b) > 0 {\n\t\tvar max int64\n\n\t\tn, err := c.wb.FillThrottle(func(remaining int64) (int64, error) {\n\t\t\tmax = remaining\n\t\t\tif l := int64(len(b)); remaining >= l {\n\t\t\t\tmax = l\n\t\t\t}\n\n\t\t\tn, err := c.Conn.Write(b[:max])\n\t\t\treturn int64(n), err\n\t\t})\n\n\t\ttotal += n\n\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tlog.Errorf(\"trafficshape: failed write: %v\", err)\n\t\t\t}\n\t\t\treturn int(total), err\n\t\t}\n\n\t\tb = b[max:]\n\t}\n\n\treturn int(total), nil\n}", "func (bw *BlockWriter) Write(b []byte) (int, error) {\n\tvar blockFull bool\n\tif bw.offset >= bw.blockSize {\n\t\treturn 0, ErrEndOfBlock\n\t} else if (bw.offset + int64(len(b))) > bw.blockSize {\n\t\tblockFull = true\n\t\tb = b[:bw.blockSize-bw.offset]\n\t}\n\n\tif bw.stream == nil {\n\t\terr := bw.connectNext()\n\t\t// TODO: handle failures, set up recovery pipeline\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\t// TODO: handle failures, set up recovery pipeline\n\tn, err := bw.stream.Write(b)\n\tbw.offset += int64(n)\n\tif err == nil && blockFull {\n\t\terr = ErrEndOfBlock\n\t}\n\n\treturn n, err\n}", "func (f errorWriter) Write(p []byte) (int, error) {\n\treturn f.n, errorWriterErr\n}", "func (bw *BlockWriter) Write(b []byte) (int, error) {\n\tvar blockFull bool\n\tif bw.Offset >= bw.BlockSize {\n\t\treturn 0, ErrEndOfBlock\n\t} else if (bw.Offset + int64(len(b))) > bw.BlockSize {\n\t\tblockFull = true\n\t\tb = b[:bw.BlockSize-bw.Offset]\n\t}\n\n\tif bw.stream == nil {\n\t\terr := bw.connectNext()\n\t\t// TODO: handle failures, set up recovery pipeline\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\t// TODO: handle failures, set up recovery pipeline\n\tn, err := bw.stream.Write(b)\n\tbw.Offset += int64(n)\n\tif err == nil && blockFull {\n\t\terr = ErrEndOfBlock\n\t}\n\n\treturn n, err\n}", "func (b *ByteBuffer) Write(p []byte) (int, error) {\n\tb.B = append(b.B, p...)\n\treturn len(p), nil\n}", "func (w *Writer) Write(b []byte) (n int, e error) {\n\treturn w.cw.Write(b)\n}", "func (dc *dummyConn) Write(p []byte) (int, error) { return len(p), nil }", "func (n *NetConn) Write([]byte) (numBytes int, err error) {\n\treturn 1, n.errOnWrite\n}", "func (cw *chanWriter) Write(b []byte) (int, error) {\n cw.downstream <- b\n\n return len(b), nil\n}", "func (dc *Conn) Write(b []byte) (n int, err error) {\n\tif dc.inState(stateInitial) {\n\t\tif n, err = dc.writeLocalBuffer(b); err != nil {\n\t\t\treturn n, fmt.Errorf(\"Unable to write local buffer: %s\", err)\n\t\t}\n\t}\n\tif n, err = dc.getConn().Write(b); err != nil {\n\t\tlog.Debugf(\"Error while write %d bytes to %s %s: %s\", len(b), dc.addr, dc.stateDesc(), err)\n\t\treturn\n\t}\n\tlog.Tracef(\"Wrote %d bytes to %s %s\", len(b), dc.addr, dc.stateDesc())\n\treturn\n}", "func (mlog *MultiLogger) Write(b []byte) (n int, err error) {\n\tmlog.qerr <- libbytes.Copy(b)\n\treturn len(b), nil\n}", "func (w *Writer) Write(p []byte) (n int, err error) {\n\tif w.closed {\n\t\terr = ErrWriteAfterClose\n\t\treturn\n\t}\n\toverwrite := false\n\tif int64(len(p)) > w.nb {\n\t\tp = p[0:w.nb]\n\t\toverwrite = true\n\t}\n\tn, err = w.w.Write(p)\n\tw.nb -= int64(n)\n\tif err == nil && overwrite {\n\t\terr = ErrWriteTooLong\n\t\treturn\n\t}\n\tw.err = err\n\treturn\n}", "func (b *Buffer) Write(p []byte) (int, error) {\n\treturn b.Append(p), nil\n}", "func (b *Packet) Write(p []byte) (n int, err error) {\n\n\tl := len(p)\n\tif !b.GuaranteSpace(l) {\n\t\tpanic(errors.New(\"Packet: not enough space\"))\n\t}\n\n\ts := b._buf[b._write_pos:]\n\tcopy(s, p)\n\n\tb._write_pos += l\n\n\treturn l, nil\n}", "func (s *BufferSink) Write(b []byte) (n int, err error) {\n\treturn s.buf.Write(b)\n}", "func (mc *MockConn) Write(b []byte) (n int, err error) {\n\tif mc.closed {\n\t\treturn 0, errors.New(\"Connection closed.\")\n\t}\n\n\tdata := make([]byte, len(b))\n\tcopy(data, b)\n\tmc.sendChan <- data\n\treturn len(b), nil\n}", "func (w *ByteCountWriter) Write(data []byte) (int, error) {\n\tatomic.AddInt64(&w.written, int64(len(data)))\n\treturn len(data), nil\n}", "func (f *File) Write(b []byte) (n int, err error) {\n\tswitch f.fd {\n\tcase Stdout.fd, Stderr.fd:\n\t\tfor _, c := range b {\n\t\t\tputchar(c)\n\t\t}\n\t\treturn len(b), nil\n\tdefault:\n\t\treturn 0, errUnsupported\n\t}\n}", "func (b *buf) Write(p []byte) (n int, err error) {\n\tb.b = b.base[b.i : b.i+len(p)]\n\tcopy(b.b, p)\n\tb.i += len(p)\n\t//fmt.Printf(\"Write: len(b.b)=%d, len(p)=%d, % #X\\n\", len(b.b), len(p), p)\n\t//fmt.Printf(\"b=%#v\\n\", b)\n\treturn len(p), nil\n}", "func (b *Buffer) Write(bt byte) int {\n\tb.bytes[b.length] = bt\n\tb.length++\n\treturn b.length\n}", "func (h *Hash) Write(b []byte) (int, error) {\n\tsize := len(b)\n\t// Deal with bytes left over in h.buf.\n\t// h.n <= bufSize is always true.\n\t// Checking it is ~free and it lets the compiler eliminate a bounds check.\n\tif h.n > 0 && h.n <= bufSize {\n\t\tk := copy(h.buf[h.n:], b)\n\t\th.n += k\n\t\tif h.n < bufSize {\n\t\t\t// Copied the entirety of b to h.buf.\n\t\t\treturn size, nil\n\t\t}\n\t\tb = b[k:]\n\t\th.flush()\n\t\t// No need to set h.n = 0 here; it happens just before exit.\n\t}\n\t// Process as many full buffers as possible, without copying, and calling initSeed only once.\n\tif len(b) > bufSize {\n\t\th.initSeed()\n\t\tfor len(b) > bufSize {\n\t\t\th.state.s = rthash(&b[0], bufSize, h.state.s)\n\t\t\tb = b[bufSize:]\n\t\t}\n\t}\n\t// Copy the tail.\n\tcopy(h.buf[:], b)\n\th.n = len(b)\n\treturn size, nil\n}", "func (r *MockReadWriteCloser) Write(p []byte) (n int, err error) {\n\n\tif err = r.WriteErr; err != nil {\n\t\tr.BytesWritten = p\n\t\tn = len(p)\n\t}\n\treturn\n}", "func (f *BufioWriter) Write(b []byte) (int, error) {\n\tf.Lock()\n\tdefer f.Unlock()\n\treturn f.buf.Write(b)\n}", "func (c *Conn) Write(b []byte) (int, error) {\n\tif c.writeTimeout > 0 {\n\t\tif err := c.Conn.SetWriteDeadline(time.Now().Add(c.writeTimeout)); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tn, err := c.Conn.Write(b)\n\tif err == nil && c.Stats != nil {\n\t\tc.Stats.WriteTotal.Add(uint64(n))\n\t}\n\tc.incBytesOut(n)\n\treturn n, err\n}", "func (a ReverseHttpFile) Write(n []byte) (int, error) {\n\treturn 0, syscall.EPERM\n}", "func (d *Device) Write(p []byte) (n int, err error) {\n\td.writeLock.Lock()\n\tavailableBuffer := 1024 - d.WriteLength\n\tif len(p) < availableBuffer {\n\t\tavailableBuffer = len(p)\n\t}\n\tpos := d.WritePosition + d.WriteLength\n\tfor i := 0; i < availableBuffer; i++ {\n\t\tif pos >= 1024 {\n\t\t\tpos = 0\n\t\t}\n\t\td.WriteBuffer[pos] = p[i]\n\t\tpos++\n\t}\n\td.WriteLength = d.WriteLength + availableBuffer\n\td.writeLock.Unlock()\n\treturn availableBuffer, nil\n}", "func Write(fd uintptr, p unsafe.Pointer, n int32) int32", "func (conn *Conn) Write(b []byte) (n int, err error) {\n\terr = conn.Handler.WriteMessage(conn.FrameType, b)\n\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn len(b), nil\n}", "func (ws *wsConn) Write(b []byte) (i int, err error) {\n\tif !utf8.Valid(b) {\n\t\tbuflen := len(ws.buf)\n\t\tblen := len(b)\n\t\tws.buf = append(ws.buf, b...)[:buflen+blen]\n\t\tif utf8.Valid(ws.buf) {\n\t\t\t_, e := ws.conn.Write(ws.buf)\n\t\t\tws.buf = ws.buf[:0]\n\t\t\treturn blen, e\n\t\t}\n\t\treturn blen, nil\n\t}\n\n\tif len(ws.buf) > 0 {\n\t\tn, err := ws.conn.Write(ws.buf)\n\t\tws.buf = ws.buf[:0]\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t}\n\tn, e := ws.conn.Write(b)\n\treturn n, e\n}", "func (b *blockWriter) Write(input []byte) (int, error) {\n\tif b.err != nil {\n\t\treturn 0, b.err\n\t}\n\n\t// fill buffer if possible\n\tn := b.buf[0] // n is block size\n\tcopied := copy(b.buf[n+1:], input)\n\tb.buf[0] = n + byte(copied)\n\n\tif n+byte(copied) < 255 {\n\t\t// buffer not full; don't write yet\n\t\treturn copied, nil\n\t}\n\n\t// loop precondition: buffer is full\n\tfor {\n\t\tvar n2 int\n\t\tn2, b.err = b.w.Write(b.buf[:])\n\t\tif n2 < 256 && b.err == nil {\n\t\t\tb.err = io.ErrShortWrite\n\t\t}\n\t\tif b.err != nil {\n\t\t\treturn copied, b.err\n\t\t}\n\n\t\tn := copy(b.buf[1:], input[copied:])\n\t\tb.buf[0] = byte(n)\n\t\tcopied += n\n\t\tif n < 255 {\n\t\t\t// buffer not full\n\t\t\treturn copied, nil\n\t\t}\n\t}\n\n\t// postcondition: b.buf contains a block with n < 255, or b.err is set\n}", "func (b *ByteCounter) Write(p []byte) (int, error) {\n\t*b += ByteCounter(len(p)) // b is pointer so *b is b value\n\treturn len(p), nil\n}", "func (s *Buffer) Write(p []byte) (n int, err error) {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\treturn s.buffer.Write(p)\n}", "func (p *Port) Write(b []byte) (int, error) {\n\treturn p.f.Write(b)\n}", "func (f *FileWriter) Write(b []byte) (int, error) {\n\tif f.blockWriter == nil {\n\t\terr := f.startNewBlock()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\toff := 0\n\tfor off < len(b) {\n\t\tn, err := f.blockWriter.Write(b[off:])\n\t\toff += n\n\t\tif err == transfer.ErrEndOfBlock {\n\t\t\terr = f.startNewBlock()\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn off, err\n\t\t}\n\t}\n\n\treturn off, nil\n}", "func (cb *Buffer) Write(buf []byte) (n int, err error) {\n\tif buf == nil || len(buf) == 0 {\n\t\treturn 0, fmt.Errorf(\"Input buffer is null or empty\")\n\t}\n\n\ttoWrite := min(cb.WriteAvailability(), len(buf))\n\n\tif toWrite == 0 {\n\t\treturn 0, fmt.Errorf(\"Buffer is full\")\n\t}\n\n\tif cb.wpos <= cb.rpos {\n\t\tif toWrite < cb.wpos {\n\t\t\tcopy(cb.buffer[cb.wpos-toWrite:cb.wpos], buf[:toWrite])\n\t\t\tcb.wpos -= toWrite\n\t\t} else {\n\t\t\tcopy(cb.buffer[:cb.wpos], buf[:cb.wpos])\n\t\t\tcopy(cb.buffer[len(cb.buffer)-toWrite+cb.wpos:len(cb.buffer)], buf[cb.wpos:toWrite])\n\t\t\tcb.wpos = len(cb.buffer) - toWrite + cb.wpos\n\t\t}\n\t} else {\n\t\tcopy(cb.buffer[cb.wpos-toWrite:cb.wpos], buf[:toWrite])\n\t\tcb.wpos -= toWrite\n\t}\n\n\tcb.full = cb.wpos == cb.rpos\n\treturn toWrite, nil\n}", "func (p *Conn) Write(b []byte) (int, error) {\n\treturn p.conn.Write(b)\n}", "func (br *BandwidthMeter) Write(p []byte) (int, error) {\n // Always completes and never returns an error.\n br.lastRead = time.Now().UTC()\n n := len(p)\n br.bytesRead += uint64(n)\n if br.start.IsZero() {\n br.start = br.lastRead\n }\n\n return n, nil\n}", "func (l *Buffer) Write(b []byte) (int, error) {\n\tl.mu.Lock()\n\tdefer l.mu.Unlock()\n\tif l.closed {\n\t\treturn 0, io.ErrClosedPipe\n\t}\n\tl.buf = append(l.buf, b...)\n\treturn len(b), nil\n}", "func (h *Host) Write(b []byte) (nn int, err error) {\n\treturn h.W.Write(b)\n}", "func (w *counterWriter) Write(b []byte) (int, error) {\n\tw.n += int64(len(b))\n\treturn len(b), nil\n}", "func (sb *SeekableBuffer) Write(p []byte) (n int, err error) {\n\tdefer func() {\n\t\tif state := recover(); state != nil {\n\t\t\terr = state.(error)\n\t\t}\n\t}()\n\n\t// The current position we're already at is past the end of the data we\n\t// actually have. Extend our buffer up to our current position.\n\tif sb.position > len64(sb.data) {\n\t\textra := make([]byte, sb.position-len64(sb.data))\n\t\tsb.data = append(sb.data, extra...)\n\t}\n\n\tpositionFromEnd := len64(sb.data) - sb.position\n\ttailCount := positionFromEnd - len64(p)\n\n\tvar tailBytes []byte\n\tif tailCount > 0 {\n\t\ttailBytes = sb.data[len64(sb.data)-tailCount:]\n\t\tsb.data = append(sb.data[:sb.position], p...)\n\t} else {\n\t\tsb.data = append(sb.data[:sb.position], p...)\n\t}\n\n\tif tailBytes != nil {\n\t\tsb.data = append(sb.data, tailBytes...)\n\t}\n\n\tdataSize := len64(p)\n\tsb.position += dataSize\n\n\treturn int(dataSize), nil\n\n}", "func (w ErrorWriter) Write(p []byte) (n int, err error) {\n\tif w.err != nil {\n\t\treturn 0, w.err\n\t}\n\n\tif n, err = w.writer.Write(p); err != nil {\n\t\tw.err = err\n\t}\n\treturn\n}", "func (w *WriterHttpConn) Write(b []byte) (n int, err error) {\n\treader := bytes.NewReader(b)\n\treq, err := http.NewRequest(w.Method, w.url.Scheme+\"://\"+w.url.Host+w.url.Path, reader)\n\t//log.Debug(w.url.Scheme+\"://\"+w.url.Host+w.url.Path)\n\tif err != nil {\n\t\tlog.Error(\"Request failed to construct: %s\", err)\n\t\treturn 0, err\n\t}\n\n\tres, err := w.client.Do(req)\n\n\tif err != nil {\n\t\tlog.Error(\"post request failed: `%s`\", err)\n\t\treturn 0, err\n\t}\n\tio.Copy(ioutil.Discard, res.Body)\n\tres.Body.Close()\n\treturn len(b), nil\n}", "func (b *Buffer) Write(buf []byte) (int, error) {\n\t// Account for total bytes written\n\tn := len(buf)\n\tb.written += int64(n)\n\n\t// If the buffer is larger than ours, then we only care\n\t// about the last size bytes anyways\n\tif int64(n) > b.size {\n\t\tbuf = buf[int64(n)-b.size:]\n\t}\n\n\t// Copy in place\n\tremain := b.size - b.writeCursor\n\tcopy(b.data[b.offset+b.writeCursor:], buf)\n\tif int64(len(buf)) > remain {\n\t\tcopy(b.data[b.offset:], buf[remain:])\n\t}\n\n\t// Update location of the cursor\n\tb.writeCursor = ((b.writeCursor + int64(len(buf))) % b.size)\n\treturn n, nil\n}", "func (w *Writer) Write(p []byte) (n int, err error) {\n\treturn w.buf.Write(p)\n}", "func (w *testWriter) Write(p []byte) (n int, err error) {\n\tif w.buf == nil {\n\t\tw.buf = make([]byte, w.chunkSize)\n\t}\n\tn = copy(w.buf, p)\n\tassert.Equal(w.t, w.data[w.offset:w.offset+n], w.buf[:n])\n\tw.offset += n\n\treturn n, nil\n}", "func (w *fileBufferedWritable) Write(p []byte) error {\n\t// Ignoring the length written since bufio.Writer.Write is guaranteed to\n\t// return an error if the length written is < len(p).\n\t_, err := w.bw.Write(p)\n\treturn err\n}", "func (p *port) Write(b []byte) (n int, err error) {\n\tn, err = p.file.Write(b)\n\treturn\n}", "func fwrite(tls TLS, ptr uintptr, size, nmemb size_t, stream uintptr) size_t {\n\thi, lo := mathutil.MulUint128_64(uint64(size), uint64(nmemb))\n\tif hi != 0 || lo > uint64(len(rawmem{})) {\n\t\ttls.setErrno(errno.XE2BIG)\n\t\treturn 0\n\t}\n\n\tn, err := files.writer(stream).Write((*rawmem)(unsafe.Pointer(ptr))[:lo])\n\tif err != nil {\n\t\ttls.setErrno(errno.XEIO)\n\t}\n\treturn size_t(n) / size\n}", "func (p *pipe) Write(b []byte) (int, error) {\n\tmsg := msg{\n\t\tdata: make([]byte, len(b)),\n\t\terr: nil,\n\t}\n\n\t// Create copy of b in case it is modified externally.\n\tcopy(msg.data, b)\n\n\tselect {\n\tcase p.otherEnd.ch <- msg: // Sent msg to the other side's Read function.\n\t\treturn len(msg.data), msg.err\n\tcase <-p.ctx.Done():\n\t\treturn 0, p.ctx.Err()\n\t}\n}", "func (connection *Connection) Write(b []byte) (int, error) {\n\t//TODO\n}", "func (r *RingBuffer) Write(p []byte) (n int, err error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\tn, err = r.write(p)\n\treturn n, err\n}", "func (b *FixedBuffer) Write(p []byte) (n int, err error) {\n\t// Slide existing data to beginning.\n\tif b.r > 0 && len(p) > len(b.buf)-b.w {\n\t\tcopy(b.buf, b.buf[b.r:b.w])\n\t\tb.w -= b.r\n\t\tb.r = 0\n\t}\n\n\t// Write new data.\n\tn = copy(b.buf[b.w:], p)\n\tb.w += n\n\tif n < len(p) {\n\t\terr = errWriteFull\n\t}\n\treturn n, err\n}", "func (s *sanitizer) Write(b []byte) (int, error) {\n\treturn s.buf.Write(s.sanitize(b))\n}", "func (c *Conn) Write(b []byte) (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tpayload := b\n\tif len(payload) > mss {\n\t\tpayload = payload[:mss]\n\t}\n\t_, err := c.sendBuf.Push(payload)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tl, err := c.sendDATA(payload)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn l, nil\n}", "func (c *Conn) Write(p []byte) (n int, err error) {\n\tn, err = c.bufw.Write(p)\n\tc.bufw.Flush()\n\treturn n, err\n}", "func (w *HttpWriter) Write(p []byte) (n int, err error) {\n\tif w.buffer == nil {\n\t\tw.buffer = new(bytes.Buffer)\n\t}\n\n\treturn w.buffer.Write(p)\n}", "func (s *State) Write(p []byte) (nn int, err error) {\n\tl := len(p)\n\ts.clen += l\n\ts.tail = append(s.tail, p...)\n\treturn l, nil\n}", "func (c *UDPConn) Write(b []byte) (int, error) {\n\treturn c.write(b, nil)\n}", "func (b *ByteArray) WriteTo(w io.Writer) (n int64, err error) {\n\tfor b.readPos.current < b.usedBytes {\n\t\tslice, er := b.ReadSlice()\n\t\tif slice != nil {\n\t\t\tread, err := w.Write(slice)\n\t\t\tb.readPos = b.seek(b.readPos, read, SEEK_CUR)\n\t\t\tn += int64(read)\n\t\t\tif err != nil {\n\t\t\t\treturn n, err\n\t\t\t}\n\t\t} else {\n\t\t\tif er != io.EOF {\n\t\t\t\terr = er\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn n, err\n}", "func (wc *FailingWriteCloser) Write(p []byte) (n int, err error) {\n\treturn 0, fmt.Errorf(\"Writing %d bytes failed\", len(p))\n}", "func (b *LimitedBuffer) Write(p []byte) (n int, err error) {\n\tb.writeMutex.Lock()\n\tdefer b.writeMutex.Unlock()\n\n\tgotLen := len(p)\n\tif gotLen >= b.limit {\n\t\tb.buf = p[gotLen-b.limit:]\n\t} else if gotLen > 0 {\n\t\tnewLength := len(b.buf) + gotLen\n\t\tif newLength <= b.limit {\n\t\t\tb.buf = append(b.buf, p...)\n\t\t} else {\n\t\t\ttruncateIndex := newLength - b.limit\n\t\t\tb.buf = append(b.buf[truncateIndex:], p...)\n\t\t}\n\t}\n\treturn gotLen, nil\n}", "func (c *WrappedConn) Write(b []byte) (n int, err error) {\n\t//c.Conn is certainly not nil\n\tn, err = c.Conn.Write(b)\n\tif err != nil {\n\t\tc.unusable = true\n\t} else {\n\t\tc.lastAccess = time.Now()\n\t}\n\treturn\n}", "func (h *ihash) Write(b []byte) (int, error) {\n\terr := h.s.Sendto(b, unix.MSG_MORE, h.addr)\n\treturn len(b), err\n}", "func (c *Conn) Write(b []byte) (int, error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\treturn c.Conn.Write(b)\n}", "func (file *File) Write(b []byte) (n int, err error) {\n\tif file.closed {\n\t\terr = errors.New(\"write on closed file\")\n\t\treturn\n\t}\n\tif file.aborted {\n\t\terr = errors.New(\"write on aborted file\")\n\t\treturn\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tos.Remove(file.tmpfile.Name())\n\t\t\tfile.aborted = true\n\t\t}\n\t}()\n\n\tn, err = file.tmpfile.Write(b)\n\treturn\n}", "func ConnWrite(c *tls.Conn, b []byte) (int, error)", "func (stream *Stream) write(b []byte) {\n\t// Discard writes if error already occurred in prior to the write.\n\tif stream.err != nil {\n\t\treturn\n\t}\n\n\tbuf := stream.buf\n\tbufSize := len(buf)\n\tif bufSize+len(b) < initialStreamBufSize {\n\t\tbuf = buf[:bufSize+len(b)]\n\t\tstream.buf = buf\n\t\tcopy(buf[bufSize:], b)\n\t\treturn\n\t}\n\n\tif bufSize > 0 {\n\t\t_, err := stream.w.Write(buf)\n\t\t// Reset buf.\n\t\tstream.buf = buf[:0]\n\t\tif err != nil {\n\t\t\tstream.err = err\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(b) > 0 {\n\t\tif _, err := stream.w.Write(b); err != nil {\n\t\t\tstream.err = err\n\t\t\treturn\n\t\t}\n\t}\n}", "func (r *response) Write(b []byte) (int, error) {\n\tr.wrote = true\n\treturn r.rw.Write(b)\n}", "func (bc BufConn) Write(p []byte) (int, error) {\n\tif bc.IgnoreWrite {\n\t\treturn len(p), nil\n\t}\n\tif bc.OnWrite != nil {\n\t\tbc.OnWrite(p)\n\t\treturn len(p), nil\n\t}\n\treturn bc.Buf.Write(p)\n}", "func (p *Pipe) Write(b []byte) (n int, err error) {\n\tp.c.L.Lock()\n\tdefer p.c.L.Unlock()\n\tif p.err != nil {\n\t\treturn 0, io.ErrClosedPipe\n\t}\n\tdefer p.c.Signal()\n\treturn p.b.Write(b)\n}", "func (w *syncFileWriter) Write(b []byte) (n int, err error) {\n\tw.mux.Lock()\n\tdefer w.mux.Unlock()\n\treturn w.file.Write(b)\n}", "func (rb *RingBuffer) Write(p []byte) (int, error) {\n\tlen := len(p)\n\texpected := len\n\n\tif len > rb.cap-rb.count {\n\t\tif err := rb.grow(len + rb.count - rb.cap); err != nil {\n\t\t\texpected = rb.cap - rb.count\n\t\t}\n\t}\n\n\tn := copy(rb.data[rb.writeOff:], p[:expected])\n\tif n < expected {\n\t\tn += copy(rb.data[:rb.readOff], p[n:expected])\n\t}\n\n\trb.count += n\n\trb.writeOff = (rb.writeOff + n) % rb.cap\n\n\treturn n, nil\n}", "func (w *Worker) Write(data []byte) (n int, err error) {\n\tlength := len(data)\n\tw.lock.Lock()\n\tif (length + w.position) > capacity {\n\t\tn, err = w.save()\n\t\tif err != nil {\n\t\t\tw.errorCallback()\n\t\t\treturn n, err\n\t\t}\n\t}\n\tcopy(w.buffer[w.position:], data)\n\tw.position += length\n\tw.lock.Unlock()\n\treturn n, err\n}", "func (c *LimitedConnection) Write(b []byte) (written int, err error) {\n\treturn c.rateLimitLoop(&c.writeNotBefore, &c.writeDeadline, c.inner.Write, b)\n}", "func FileWrite(f *os.File, b []byte) (int, error)", "func (w *response) write(lenData int, dataB []byte, dataS string) (n int, err error) {\n\tif w.conn.hijacked() {\n\t\tif lenData > 0 {\n\t\t\tcaller := relevantCaller()\n\t\t\tw.conn.server.logf(\"http: response.Write on hijacked connection from %s (%s:%d)\", caller.Function, path.Base(caller.File), caller.Line)\n\t\t}\n\t\treturn 0, ErrHijacked\n\t}\n\n\tif w.canWriteContinue.isSet() {\n\t\t// Body reader wants to write 100 Continue but hasn't yet.\n\t\t// Tell it not to. The store must be done while holding the lock\n\t\t// because the lock makes sure that there is not an active write\n\t\t// this very moment.\n\t\tw.writeContinueMu.Lock()\n\t\tw.canWriteContinue.setFalse()\n\t\tw.writeContinueMu.Unlock()\n\t}\n\n\tif !w.wroteHeader {\n\t\tw.WriteHeader(StatusOK)\n\t}\n\tif lenData == 0 {\n\t\treturn 0, nil\n\t}\n\tif !w.bodyAllowed() {\n\t\treturn 0, ErrBodyNotAllowed\n\t}\n\n\tw.written += int64(lenData) // ignoring errors, for errorKludge\n\tif w.contentLength != -1 && w.written > w.contentLength {\n\t\treturn 0, ErrContentLength\n\t}\n\tif dataB != nil {\n\t\treturn w.w.Write(dataB)\n\t} else {\n\t\treturn w.w.WriteString(dataS)\n\t}\n}" ]
[ "0.7429347", "0.7159322", "0.7155304", "0.7095502", "0.7083462", "0.69782776", "0.69447505", "0.6820908", "0.68133396", "0.6781417", "0.66773105", "0.6669058", "0.66512936", "0.66504216", "0.65993243", "0.6598238", "0.65876794", "0.65593493", "0.6512497", "0.6491802", "0.64846146", "0.64695024", "0.64593947", "0.6412228", "0.64020675", "0.6399408", "0.6380777", "0.6373332", "0.6346728", "0.63188607", "0.6308477", "0.62888914", "0.6288609", "0.6276651", "0.6267976", "0.6262907", "0.62599516", "0.6258061", "0.6248586", "0.6236764", "0.62365013", "0.62279725", "0.6224451", "0.62137467", "0.6192045", "0.6187083", "0.6172491", "0.61501503", "0.6139186", "0.611314", "0.6112389", "0.61066794", "0.61060196", "0.61011827", "0.60996664", "0.6094939", "0.6079942", "0.60554826", "0.60314333", "0.6029835", "0.6026014", "0.6020823", "0.6016903", "0.6001497", "0.5991467", "0.5987125", "0.59810543", "0.597656", "0.5963288", "0.59484583", "0.5943873", "0.5943133", "0.5936928", "0.5936725", "0.59305763", "0.5928032", "0.59203565", "0.59168535", "0.5905876", "0.5904853", "0.5902406", "0.58988297", "0.5892496", "0.5874963", "0.5868197", "0.5865996", "0.58550805", "0.58540386", "0.5843907", "0.5843476", "0.5832302", "0.58269507", "0.5825087", "0.5824959", "0.5824018", "0.5822794", "0.58172333", "0.58169645", "0.5813573", "0.5805855" ]
0.75367165
0
ProvidersAWS : Define the aws provider function
ProvidersAWS : Определите функцию провайдера aws
func ProvidersAWS(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) if err := json.NewEncoder(w).Encode(awsResources); err != nil { panic(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewAWSProvider(dryRun bool) (Provider, error) {\n\tconfig := aws.NewConfig()\n\n\tsession, err := session.NewSessionWithOptions(session.Options{\n\t\tConfig: *config,\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprovider := &AWSProvider{\n\t\tClient: route53.New(session),\n\t\tDryRun: dryRun,\n\t}\n\n\treturn provider, nil\n}", "func (p *AWS) Initialize(config *types.ProviderConfig) error {\n\tp.Storage = &S3{}\n\n\tif config.Zone == \"\" {\n\t\treturn errors.New(\"zone missing\")\n\t}\n\n\terr := loadAWSCreds()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsession, err := session.NewSession(\n\t\t&aws.Config{\n\t\t\tRegion: aws.String(stripZone(config.Zone)),\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp.session = session\n\tp.dnsService = route53.New(session)\n\tp.ec2 = ec2.New(session)\n\tp.volumeService = ebs.New(session,\n\t\taws.NewConfig().\n\t\t\tWithRegion(stripZone(config.Zone)).\n\t\t\tWithMaxRetries(7))\n\n\t_, err = p.ec2.DescribeRegions(&ec2.DescribeRegionsInput{RegionNames: aws.StringSlice([]string{stripZone(config.Zone)})})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"region with name %v is invalid\", config.Zone)\n\t}\n\n\treturn nil\n}", "func ec2Provider(providers []ProviderPayload) *ProviderPayload {\n\tfor _, provider := range providers {\n\t\tif provider.Name == providerEc2 {\n\t\t\treturn &provider\n\t\t}\n\t}\n\tlog.Fatal(\"ec2 provider is missing\")\n\treturn nil\n}", "func FromEnv() *AWSProvider {\n\tp := &AWSProvider{\n\t\tRegion: os.Getenv(\"AWS_REGION\"),\n\t\tEndpoint: os.Getenv(\"AWS_ENDPOINT\"),\n\t\tBuildCluster: os.Getenv(\"BUILD_CLUSTER\"),\n\t\tCloudformationTopic: os.Getenv(\"CLOUDFORMATION_TOPIC\"),\n\t\tCluster: os.Getenv(\"CLUSTER\"),\n\t\tCustomTopic: os.Getenv(\"CUSTOM_TOPIC\"),\n\t\tDevelopment: os.Getenv(\"DEVELOPMENT\") == \"true\",\n\t\tDynamoBuilds: os.Getenv(\"DYNAMO_BUILDS\"),\n\t\tDynamoReleases: os.Getenv(\"DYNAMO_RELEASES\"),\n\t\tEncryptionKey: os.Getenv(\"ENCRYPTION_KEY\"),\n\t\tFargate: os.Getenv(\"FARGATE\") == \"Yes\",\n\t\tInternal: os.Getenv(\"INTERNAL\") == \"Yes\",\n\t\tLogBucket: os.Getenv(\"LOG_BUCKET\"),\n\t\tNotificationHost: os.Getenv(\"NOTIFICATION_HOST\"),\n\t\tNotificationTopic: os.Getenv(\"NOTIFICATION_TOPIC\"),\n\t\tPassword: os.Getenv(\"PASSWORD\"),\n\t\tRack: os.Getenv(\"RACK\"),\n\t\tRegistryHost: os.Getenv(\"REGISTRY_HOST\"),\n\t\tRelease: os.Getenv(\"RELEASE\"),\n\t\tSecurityGroup: os.Getenv(\"SECURITY_GROUP\"),\n\t\tSettingsBucket: os.Getenv(\"SETTINGS_BUCKET\"),\n\t\tSubnets: os.Getenv(\"SUBNETS\"),\n\t\tSubnetsPrivate: os.Getenv(\"SUBNETS_PRIVATE\"),\n\t\tVpc: os.Getenv(\"VPC\"),\n\t\tVpcCidr: os.Getenv(\"VPCCIDR\"),\n\t}\n\n\treturn p\n}", "func (o ClusterOutput) AwsProvider() aws.ProviderOutput {\n\treturn o.ApplyT(func(v *Cluster) aws.ProviderOutput { return v.AwsProvider }).(aws.ProviderOutput)\n}", "func NewAWS(aws config.AWSConfig, bucket config.S3BucketConfig, noLocks, noVersioning bool) *AWS {\n\tif bucket.Bucket == \"\" {\n\t\treturn nil\n\t}\n\n\tsess := session.Must(session.NewSession())\n\tawsConfig := aws_sdk.NewConfig()\n\tvar creds *credentials.Credentials\n\tif len(aws.APPRoleArn) > 0 {\n\t\tlog.Debugf(\"Using %s role\", aws.APPRoleArn)\n\t\tcreds = stscreds.NewCredentials(sess, aws.APPRoleArn, func(p *stscreds.AssumeRoleProvider) {\n\t\t\tif aws.ExternalID != \"\" {\n\t\t\t\tp.ExternalID = aws_sdk.String(aws.ExternalID)\n\t\t\t}\n\t\t})\n\t} else {\n\t\tif aws.AccessKey == \"\" || aws.SecretAccessKey == \"\" {\n\t\t\tlog.Fatal(\"Missing AccessKey or SecretAccessKey for AWS provider. Please check your configuration and retry\")\n\t\t}\n\t\tcreds = credentials.NewStaticCredentials(aws.AccessKey, aws.SecretAccessKey, aws.SessionToken)\n\t}\n\tawsConfig.WithCredentials(creds)\n\n\tif e := aws.Endpoint; e != \"\" {\n\t\tawsConfig.WithEndpoint(e)\n\t}\n\tif e := aws.Region; e != \"\" {\n\t\tawsConfig.WithRegion(e)\n\t}\n\tawsConfig.S3ForcePathStyle = &bucket.ForcePathStyle\n\n\treturn &AWS{\n\t\tsvc: s3.New(sess, awsConfig),\n\t\tbucket: bucket.Bucket,\n\t\tkeyPrefix: bucket.KeyPrefix,\n\t\tfileExtension: bucket.FileExtension,\n\t\tdynamoSvc: dynamodbiface.DynamoDBAPI(dynamodb.New(sess, awsConfig)),\n\t\tdynamoTable: aws.DynamoDBTable,\n\t\tnoLocks: noLocks,\n\t\tnoVersioning: noVersioning,\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\tprovider := &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"auth_url\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_AUTH_URL\", \"\"),\n\t\t\t\tDescription: descriptions[\"auth_url\"],\n\t\t\t},\n\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: descriptions[\"region\"],\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_REGION_NAME\", \"\"),\n\t\t\t},\n\n\t\t\t\"user_name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_USERNAME\", \"\"),\n\t\t\t\tDescription: descriptions[\"user_name\"],\n\t\t\t},\n\n\t\t\t\"user_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_USER_ID\", \"\"),\n\t\t\t\tDescription: descriptions[\"user_name\"],\n\t\t\t},\n\n\t\t\t\"application_credential_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_APPLICATION_CREDENTIAL_ID\", \"\"),\n\t\t\t\tDescription: descriptions[\"application_credential_id\"],\n\t\t\t},\n\n\t\t\t\"application_credential_name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_APPLICATION_CREDENTIAL_NAME\", \"\"),\n\t\t\t\tDescription: descriptions[\"application_credential_name\"],\n\t\t\t},\n\n\t\t\t\"application_credential_secret\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_APPLICATION_CREDENTIAL_SECRET\", \"\"),\n\t\t\t\tDescription: descriptions[\"application_credential_secret\"],\n\t\t\t},\n\n\t\t\t\"tenant_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"OS_TENANT_ID\",\n\t\t\t\t\t\"OS_PROJECT_ID\",\n\t\t\t\t}, \"\"),\n\t\t\t\tDescription: descriptions[\"tenant_id\"],\n\t\t\t},\n\n\t\t\t\"tenant_name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"OS_TENANT_NAME\",\n\t\t\t\t\t\"OS_PROJECT_NAME\",\n\t\t\t\t}, \"\"),\n\t\t\t\tDescription: descriptions[\"tenant_name\"],\n\t\t\t},\n\n\t\t\t\"password\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tSensitive: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_PASSWORD\", \"\"),\n\t\t\t\tDescription: descriptions[\"password\"],\n\t\t\t},\n\n\t\t\t\"token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"OS_TOKEN\",\n\t\t\t\t\t\"OS_AUTH_TOKEN\",\n\t\t\t\t}, \"\"),\n\t\t\t\tDescription: descriptions[\"token\"],\n\t\t\t},\n\n\t\t\t\"user_domain_name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_USER_DOMAIN_NAME\", \"\"),\n\t\t\t\tDescription: descriptions[\"user_domain_name\"],\n\t\t\t},\n\n\t\t\t\"user_domain_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_USER_DOMAIN_ID\", \"\"),\n\t\t\t\tDescription: descriptions[\"user_domain_id\"],\n\t\t\t},\n\n\t\t\t\"project_domain_name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_PROJECT_DOMAIN_NAME\", \"\"),\n\t\t\t\tDescription: descriptions[\"project_domain_name\"],\n\t\t\t},\n\n\t\t\t\"project_domain_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_PROJECT_DOMAIN_ID\", \"\"),\n\t\t\t\tDescription: descriptions[\"project_domain_id\"],\n\t\t\t},\n\n\t\t\t\"domain_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_DOMAIN_ID\", \"\"),\n\t\t\t\tDescription: descriptions[\"domain_id\"],\n\t\t\t},\n\n\t\t\t\"domain_name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_DOMAIN_NAME\", \"\"),\n\t\t\t\tDescription: descriptions[\"domain_name\"],\n\t\t\t},\n\n\t\t\t\"default_domain\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_DEFAULT_DOMAIN\", \"default\"),\n\t\t\t\tDescription: descriptions[\"default_domain\"],\n\t\t\t},\n\n\t\t\t\"insecure\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_INSECURE\", nil),\n\t\t\t\tDescription: descriptions[\"insecure\"],\n\t\t\t},\n\n\t\t\t\"endpoint_type\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_ENDPOINT_TYPE\", \"\"),\n\t\t\t},\n\n\t\t\t\"cacert_file\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_CACERT\", \"\"),\n\t\t\t\tDescription: descriptions[\"cacert_file\"],\n\t\t\t},\n\n\t\t\t\"cert\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_CERT\", \"\"),\n\t\t\t\tDescription: descriptions[\"cert\"],\n\t\t\t},\n\n\t\t\t\"key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_KEY\", \"\"),\n\t\t\t\tDescription: descriptions[\"key\"],\n\t\t\t},\n\n\t\t\t\"swauth\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_SWAUTH\", false),\n\t\t\t\tDescription: descriptions[\"swauth\"],\n\t\t\t},\n\n\t\t\t\"use_octavia\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_USE_OCTAVIA\", false),\n\t\t\t\tDescription: descriptions[\"use_octavia\"],\n\t\t\t},\n\n\t\t\t\"delayed_auth\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_DELAYED_AUTH\", true),\n\t\t\t\tDescription: descriptions[\"delayed_auth\"],\n\t\t\t},\n\n\t\t\t\"allow_reauth\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_ALLOW_REAUTH\", true),\n\t\t\t\tDescription: descriptions[\"allow_reauth\"],\n\t\t\t},\n\n\t\t\t\"cloud\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"OS_CLOUD\", \"\"),\n\t\t\t\tDescription: descriptions[\"cloud\"],\n\t\t\t},\n\n\t\t\t\"max_retries\": {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: 0,\n\t\t\t\tDescription: descriptions[\"max_retries\"],\n\t\t\t},\n\n\t\t\t\"endpoint_overrides\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: descriptions[\"endpoint_overrides\"],\n\t\t\t},\n\n\t\t\t\"disable_no_cache_header\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"disable_no_cache_header\"],\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"ironic_introspection\": dataSourceIronicIntrospection(),\n\t\t},\n\t\t//DataSourcesMap: map[string]*schema.Resource{\n\t\t//\t\"openstack_blockstorage_availability_zones_v3\": dataSourceBlockStorageAvailabilityZonesV3(),\n\t\t//\t\"openstack_blockstorage_snapshot_v2\": dataSourceBlockStorageSnapshotV2(),\n\t\t//\t\"openstack_blockstorage_snapshot_v3\": dataSourceBlockStorageSnapshotV3(),\n\t\t//\t\"openstack_blockstorage_volume_v2\": dataSourceBlockStorageVolumeV2(),\n\t\t//\t\"openstack_blockstorage_volume_v3\": dataSourceBlockStorageVolumeV3(),\n\t\t//\t\"openstack_compute_availability_zones_v2\": dataSourceComputeAvailabilityZonesV2(),\n\t\t//\t\"openstack_compute_instance_v2\": dataSourceComputeInstanceV2(),\n\t\t//\t\"openstack_compute_flavor_v2\": dataSourceComputeFlavorV2(),\n\t\t//\t\"openstack_compute_keypair_v2\": dataSourceComputeKeypairV2(),\n\t\t//\t\"openstack_containerinfra_clustertemplate_v1\": dataSourceContainerInfraClusterTemplateV1(),\n\t\t//\t\"openstack_containerinfra_cluster_v1\": dataSourceContainerInfraCluster(),\n\t\t//\t\"openstack_dns_zone_v2\": dataSourceDNSZoneV2(),\n\t\t//\t\"openstack_fw_policy_v1\": dataSourceFWPolicyV1(),\n\t\t//\t\"openstack_identity_role_v3\": dataSourceIdentityRoleV3(),\n\t\t//\t\"openstack_identity_project_v3\": dataSourceIdentityProjectV3(),\n\t\t//\t\"openstack_identity_user_v3\": dataSourceIdentityUserV3(),\n\t\t//\t\"openstack_identity_auth_scope_v3\": dataSourceIdentityAuthScopeV3(),\n\t\t//\t\"openstack_identity_endpoint_v3\": dataSourceIdentityEndpointV3(),\n\t\t//\t\"openstack_identity_service_v3\": dataSourceIdentityServiceV3(),\n\t\t//\t\"openstack_identity_group_v3\": dataSourceIdentityGroupV3(),\n\t\t//\t\"openstack_images_image_v2\": dataSourceImagesImageV2(),\n\t\t//\t\"openstack_networking_addressscope_v2\": dataSourceNetworkingAddressScopeV2(),\n\t\t//\t\"openstack_networking_network_v2\": dataSourceNetworkingNetworkV2(),\n\t\t//\t\"openstack_networking_qos_bandwidth_limit_rule_v2\": dataSourceNetworkingQoSBandwidthLimitRuleV2(),\n\t\t//\t\"openstack_networking_qos_dscp_marking_rule_v2\": dataSourceNetworkingQoSDSCPMarkingRuleV2(),\n\t\t//\t\"openstack_networking_qos_minimum_bandwidth_rule_v2\": dataSourceNetworkingQoSMinimumBandwidthRuleV2(),\n\t\t//\t\"openstack_networking_qos_policy_v2\": dataSourceNetworkingQoSPolicyV2(),\n\t\t//\t\"openstack_networking_subnet_v2\": dataSourceNetworkingSubnetV2(),\n\t\t//\t\"openstack_networking_secgroup_v2\": dataSourceNetworkingSecGroupV2(),\n\t\t//\t\"openstack_networking_subnetpool_v2\": dataSourceNetworkingSubnetPoolV2(),\n\t\t//\t\"openstack_networking_floatingip_v2\": dataSourceNetworkingFloatingIPV2(),\n\t\t//\t\"openstack_networking_router_v2\": dataSourceNetworkingRouterV2(),\n\t\t//\t\"openstack_networking_port_v2\": dataSourceNetworkingPortV2(),\n\t\t//\t\"openstack_networking_port_ids_v2\": dataSourceNetworkingPortIDsV2(),\n\t\t//\t\"openstack_networking_trunk_v2\": dataSourceNetworkingTrunkV2(),\n\t\t//\t\"openstack_sharedfilesystem_availability_zones_v2\": dataSourceSharedFilesystemAvailabilityZonesV2(),\n\t\t//\t\"openstack_sharedfilesystem_sharenetwork_v2\": dataSourceSharedFilesystemShareNetworkV2(),\n\t\t//\t\"openstack_sharedfilesystem_share_v2\": dataSourceSharedFilesystemShareV2(),\n\t\t//\t\"openstack_sharedfilesystem_snapshot_v2\": dataSourceSharedFilesystemSnapshotV2(),\n\t\t//\t\"openstack_keymanager_secret_v1\": dataSourceKeyManagerSecretV1(),\n\t\t//\t\"openstack_keymanager_container_v1\": dataSourceKeyManagerContainerV1(),\n\t\t//},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"ironic_node_v1\": resourceNodeV1(),\n\t\t\t\"ironic_port_v1\": resourcePortV1(),\n\t\t\t\"ironic_allocation_v1\": resourceAllocationV1(),\n\t\t\t\"ironic_deployment\": resourceDeployment(),\n\t\t},\n\t\t//ResourcesMap: map[string]*schema.Resource{\n\t\t//\t\"openstack_blockstorage_quotaset_v2\": resourceBlockStorageQuotasetV2(),\n\t\t//\t\"openstack_blockstorage_quotaset_v3\": resourceBlockStorageQuotasetV3(),\n\t\t//\t\"openstack_blockstorage_volume_v1\": resourceBlockStorageVolumeV1(),\n\t\t//\t\"openstack_blockstorage_volume_v2\": resourceBlockStorageVolumeV2(),\n\t\t//\t\"openstack_blockstorage_volume_v3\": resourceBlockStorageVolumeV3(),\n\t\t//\t\"openstack_blockstorage_volume_attach_v2\": resourceBlockStorageVolumeAttachV2(),\n\t\t//\t\"openstack_blockstorage_volume_attach_v3\": resourceBlockStorageVolumeAttachV3(),\n\t\t//\t\"openstack_compute_flavor_v2\": resourceComputeFlavorV2(),\n\t\t//\t\"openstack_compute_flavor_access_v2\": resourceComputeFlavorAccessV2(),\n\t\t//\t\"openstack_compute_instance_v2\": resourceComputeInstanceV2(),\n\t\t//\t\"openstack_compute_interface_attach_v2\": resourceComputeInterfaceAttachV2(),\n\t\t//\t\"openstack_compute_keypair_v2\": resourceComputeKeypairV2(),\n\t\t//\t\"openstack_compute_secgroup_v2\": resourceComputeSecGroupV2(),\n\t\t//\t\"openstack_compute_servergroup_v2\": resourceComputeServerGroupV2(),\n\t\t//\t\"openstack_compute_quotaset_v2\": resourceComputeQuotasetV2(),\n\t\t//\t\"openstack_compute_floatingip_v2\": resourceComputeFloatingIPV2(),\n\t\t//\t\"openstack_compute_floatingip_associate_v2\": resourceComputeFloatingIPAssociateV2(),\n\t\t//\t\"openstack_compute_volume_attach_v2\": resourceComputeVolumeAttachV2(),\n\t\t//\t\"openstack_containerinfra_clustertemplate_v1\": resourceContainerInfraClusterTemplateV1(),\n\t\t//\t\"openstack_containerinfra_cluster_v1\": resourceContainerInfraClusterV1(),\n\t\t//\t\"openstack_db_instance_v1\": resourceDatabaseInstanceV1(),\n\t\t//\t\"openstack_db_user_v1\": resourceDatabaseUserV1(),\n\t\t//\t\"openstack_db_configuration_v1\": resourceDatabaseConfigurationV1(),\n\t\t//\t\"openstack_db_database_v1\": resourceDatabaseDatabaseV1(),\n\t\t//\t\"openstack_dns_recordset_v2\": resourceDNSRecordSetV2(),\n\t\t//\t\"openstack_dns_zone_v2\": resourceDNSZoneV2(),\n\t\t//\t\"openstack_fw_firewall_v1\": resourceFWFirewallV1(),\n\t\t//\t\"openstack_fw_policy_v1\": resourceFWPolicyV1(),\n\t\t//\t\"openstack_fw_rule_v1\": resourceFWRuleV1(),\n\t\t//\t\"openstack_identity_endpoint_v3\": resourceIdentityEndpointV3(),\n\t\t//\t\"openstack_identity_project_v3\": resourceIdentityProjectV3(),\n\t\t//\t\"openstack_identity_role_v3\": resourceIdentityRoleV3(),\n\t\t//\t\"openstack_identity_role_assignment_v3\": resourceIdentityRoleAssignmentV3(),\n\t\t//\t\"openstack_identity_service_v3\": resourceIdentityServiceV3(),\n\t\t//\t\"openstack_identity_user_v3\": resourceIdentityUserV3(),\n\t\t//\t\"openstack_identity_application_credential_v3\": resourceIdentityApplicationCredentialV3(),\n\t\t//\t\"openstack_images_image_v2\": resourceImagesImageV2(),\n\t\t//\t\"openstack_images_image_access_v2\": resourceImagesImageAccessV2(),\n\t\t//\t\"openstack_images_image_access_accept_v2\": resourceImagesImageAccessAcceptV2(),\n\t\t//\t\"openstack_lb_member_v1\": resourceLBMemberV1(),\n\t\t//\t\"openstack_lb_monitor_v1\": resourceLBMonitorV1(),\n\t\t//\t\"openstack_lb_pool_v1\": resourceLBPoolV1(),\n\t\t//\t\"openstack_lb_vip_v1\": resourceLBVipV1(),\n\t\t//\t\"openstack_lb_loadbalancer_v2\": resourceLoadBalancerV2(),\n\t\t//\t\"openstack_lb_listener_v2\": resourceListenerV2(),\n\t\t//\t\"openstack_lb_pool_v2\": resourcePoolV2(),\n\t\t//\t\"openstack_lb_member_v2\": resourceMemberV2(),\n\t\t//\t\"openstack_lb_members_v2\": resourceMembersV2(),\n\t\t//\t\"openstack_lb_monitor_v2\": resourceMonitorV2(),\n\t\t//\t\"openstack_lb_l7policy_v2\": resourceL7PolicyV2(),\n\t\t//\t\"openstack_lb_l7rule_v2\": resourceL7RuleV2(),\n\t\t//\t\"openstack_networking_floatingip_v2\": resourceNetworkingFloatingIPV2(),\n\t\t//\t\"openstack_networking_floatingip_associate_v2\": resourceNetworkingFloatingIPAssociateV2(),\n\t\t//\t\"openstack_networking_network_v2\": resourceNetworkingNetworkV2(),\n\t\t//\t\"openstack_networking_port_v2\": resourceNetworkingPortV2(),\n\t\t//\t\"openstack_networking_rbac_policy_v2\": resourceNetworkingRBACPolicyV2(),\n\t\t//\t\"openstack_networking_port_secgroup_associate_v2\": resourceNetworkingPortSecGroupAssociateV2(),\n\t\t//\t\"openstack_networking_qos_bandwidth_limit_rule_v2\": resourceNetworkingQoSBandwidthLimitRuleV2(),\n\t\t//\t\"openstack_networking_qos_dscp_marking_rule_v2\": resourceNetworkingQoSDSCPMarkingRuleV2(),\n\t\t//\t\"openstack_networking_qos_minimum_bandwidth_rule_v2\": resourceNetworkingQoSMinimumBandwidthRuleV2(),\n\t\t//\t\"openstack_networking_qos_policy_v2\": resourceNetworkingQoSPolicyV2(),\n\t\t//\t\"openstack_networking_quota_v2\": resourceNetworkingQuotaV2(),\n\t\t//\t\"openstack_networking_router_v2\": resourceNetworkingRouterV2(),\n\t\t//\t\"openstack_networking_router_interface_v2\": resourceNetworkingRouterInterfaceV2(),\n\t\t//\t\"openstack_networking_router_route_v2\": resourceNetworkingRouterRouteV2(),\n\t\t//\t\"openstack_networking_secgroup_v2\": resourceNetworkingSecGroupV2(),\n\t\t//\t\"openstack_networking_secgroup_rule_v2\": resourceNetworkingSecGroupRuleV2(),\n\t\t//\t\"openstack_networking_subnet_v2\": resourceNetworkingSubnetV2(),\n\t\t//\t\"openstack_networking_subnet_route_v2\": resourceNetworkingSubnetRouteV2(),\n\t\t//\t\"openstack_networking_subnetpool_v2\": resourceNetworkingSubnetPoolV2(),\n\t\t//\t\"openstack_networking_addressscope_v2\": resourceNetworkingAddressScopeV2(),\n\t\t//\t\"openstack_networking_trunk_v2\": resourceNetworkingTrunkV2(),\n\t\t//\t\"openstack_objectstorage_container_v1\": resourceObjectStorageContainerV1(),\n\t\t//\t\"openstack_objectstorage_object_v1\": resourceObjectStorageObjectV1(),\n\t\t//\t\"openstack_objectstorage_tempurl_v1\": resourceObjectstorageTempurlV1(),\n\t\t//\t\"openstack_orchestration_stack_v1\": resourceOrchestrationStackV1(),\n\t\t//\t\"openstack_vpnaas_ipsec_policy_v2\": resourceIPSecPolicyV2(),\n\t\t//\t\"openstack_vpnaas_service_v2\": resourceServiceV2(),\n\t\t//\t\"openstack_vpnaas_ike_policy_v2\": resourceIKEPolicyV2(),\n\t\t//\t\"openstack_vpnaas_endpoint_group_v2\": resourceEndpointGroupV2(),\n\t\t//\t\"openstack_vpnaas_site_connection_v2\": resourceSiteConnectionV2(),\n\t\t//\t\"openstack_sharedfilesystem_securityservice_v2\": resourceSharedFilesystemSecurityServiceV2(),\n\t\t//\t\"openstack_sharedfilesystem_sharenetwork_v2\": resourceSharedFilesystemShareNetworkV2(),\n\t\t//\t\"openstack_sharedfilesystem_share_v2\": resourceSharedFilesystemShareV2(),\n\t\t//\t\"openstack_sharedfilesystem_share_access_v2\": resourceSharedFilesystemShareAccessV2(),\n\t\t//\t\"openstack_keymanager_secret_v1\": resourceKeyManagerSecretV1(),\n\t\t//\t\"openstack_keymanager_container_v1\": resourceKeyManagerContainerV1(),\n\t\t//\t\"openstack_keymanager_order_v1\": resourceKeyManagerOrderV1(),\n\t\t//},\n\t}\n\n\tprovider.ConfigureFunc = func(d *schema.ResourceData) (interface{}, error) {\n\t\tterraformVersion := provider.TerraformVersion\n\t\tif terraformVersion == \"\" {\n\t\t\t// Terraform 0.12 introduced this field to the protocol\n\t\t\t// We can therefore assume that if it's missing it's 0.10 or 0.11\n\t\t\tterraformVersion = \"0.11+compatible\"\n\t\t}\n\t\treturn configureProvider(d, terraformVersion)\n\t}\n\n\treturn provider\n}", "func Provider() terraform.ResourceProvider {\n\t// TODO: Move the validation to this, requires conditional schemas\n\t// TODO: Move the configuration to this, requires validation\n\n\t// The actual provider\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"access_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"access_key\"],\n\t\t\t},\n\n\t\t\t\"secret_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"secret_key\"],\n\t\t\t},\n\n\t\t\t\"profile\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"profile\"],\n\t\t\t},\n\n\t\t\t\"assume_role\": assumeRoleSchema(),\n\n\t\t\t\"shared_credentials_file\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"shared_credentials_file\"],\n\t\t\t},\n\n\t\t\t\"token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"token\"],\n\t\t\t},\n\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"AWS_REGION\",\n\t\t\t\t\t\"AWS_DEFAULT_REGION\",\n\t\t\t\t}, nil),\n\t\t\t\tDescription: descriptions[\"region\"],\n\t\t\t\tInputDefault: \"us-east-1\",\n\t\t\t},\n\n\t\t\t\"max_retries\": {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: 25,\n\t\t\t\tDescription: descriptions[\"max_retries\"],\n\t\t\t},\n\n\t\t\t\"allowed_account_ids\": {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tElem: &schema.Schema{Type: schema.TypeString},\n\t\t\t\tOptional: true,\n\t\t\t\tConflictsWith: []string{\"forbidden_account_ids\"},\n\t\t\t\tSet: schema.HashString,\n\t\t\t},\n\n\t\t\t\"forbidden_account_ids\": {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tElem: &schema.Schema{Type: schema.TypeString},\n\t\t\t\tOptional: true,\n\t\t\t\tConflictsWith: []string{\"allowed_account_ids\"},\n\t\t\t\tSet: schema.HashString,\n\t\t\t},\n\n\t\t\t\"dynamodb_endpoint\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"dynamodb_endpoint\"],\n\t\t\t\tRemoved: \"Use `dynamodb` inside `endpoints` block instead\",\n\t\t\t},\n\n\t\t\t\"kinesis_endpoint\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"kinesis_endpoint\"],\n\t\t\t\tRemoved: \"Use `kinesis` inside `endpoints` block instead\",\n\t\t\t},\n\n\t\t\t\"endpoints\": endpointsSchema(),\n\n\t\t\t\"insecure\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"insecure\"],\n\t\t\t},\n\n\t\t\t\"skip_credentials_validation\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_credentials_validation\"],\n\t\t\t},\n\n\t\t\t\"skip_get_ec2_platforms\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_get_ec2_platforms\"],\n\t\t\t},\n\n\t\t\t\"skip_region_validation\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_region_validation\"],\n\t\t\t},\n\n\t\t\t\"skip_requesting_account_id\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_requesting_account_id\"],\n\t\t\t},\n\n\t\t\t\"skip_metadata_api_check\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_metadata_api_check\"],\n\t\t\t},\n\n\t\t\t\"s3_force_path_style\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"s3_force_path_style\"],\n\t\t\t},\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"awstag_ec2_tag\": resourceAwstagEC2Tag(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func awsConnect(i *AwsInfo) *s3.Bucket {\n\tAWSAuth := aws.Auth{\n\t\tAccessKey: i.AccessKey,\n\t\tSecretKey: i.SecretKey,\n\t}\n\tregion := aws.USEast\n\tconnection := s3.New(AWSAuth, region)\n\n\treturn connection.Bucket(i.Bucket)\n}", "func AWSFuncs(f map[string]interface{}) {\n\tf2 := CreateAWSFuncs(context.Background())\n\tfor k, v := range f2 {\n\t\tf[k] = v\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"access_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: \"The access key for API operations.\",\n\t\t\t},\n\t\t\t\"secret_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: \"The secret key for API operations.\",\n\t\t\t},\n\t\t\t\"endpoint\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The endpoint for API operations.\",\n\t\t\t},\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDescription: \"The region where Nifcloud operations will take place.\",\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t// \"nifcloud_instance\": dataSourceInstance(),\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"nifcloud_instance\": resourceNifcloudInstance(),\n\t\t\t\"nifcloud_network\": resourceNifcloudNetwork(),\n\t\t\t\"nifcloud_volume\": resourceNifcloudVolume(),\n\t\t\t\"nifcloud_securitygroup\": resourceNifcloudSecurityGroup(),\n\t\t\t\"nifcloud_securitygroup_rule\": resourceNifcloudSecurityGroupRule(),\n\t\t\t\"nifcloud_keypair\": resourceNifcloudKeyPair(),\n\t\t\t\"nifcloud_instancebackup_rule\": resourceNifcloudInstanceBackupRule(),\n\t\t\t\"nifcloud_image\": resourceNifcloudImage(),\n\t\t\t\"nifcloud_customer_gateway\": resourceNifcloudCustomerGateway(),\n\t\t\t\"nifcloud_vpn_gateway\": resourceNifcloudVpnGateway(),\n\t\t\t\"nifcloud_vpn_connection\": resourceNifcloudVpnConnection(),\n\t\t\t\"nifcloud_db_parameter_group\": resourceNifcloudDbParameterGroup(),\n\t\t\t\"nifcloud_db_security_group\": resourceNifcloudDbSecurityGroup(),\n\t\t\t\"nifcloud_db_instance\": resourceNifcloudDbInstance(),\n\t\t\t\"nifcloud_router\": resourceNifcloudRouter(),\n\t\t\t\"nifcloud_route_table\": resourceNifcloudRouteTable(),\n\t\t\t\"nifcloud_route\": resourceNifcloudRoute(),\n\t\t\t\"nifcloud_route_table_association\": resourceNifcloudRouteTableAssociation(),\n\t\t\t\"nifcloud_route_table_association_with_vpn_gateway\": resourceNifcloudRouteTableAssociationWithVpnGateway(),\n\t\t\t\"nifcloud_lb\": resourceNifcloudLb(),\n\t\t\t\"nifcloud_lb_port\": resourceNifcloudLbPort(),\n\t\t\t\"nifcloud_eip\": resourceNifcloudEip(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func NewAWS(crypto appencryption.AEAD, preferredRegion string, arnMap map[string]string) (*AWSKMS, error) {\n\treturn newAWS(crypto, preferredRegion, awsARNMap(arnMap))\n}", "func NewAWS(ctx arn.Ctx, r ...Router) *AWS {\n\troot := append(ChainRouter{STSRouter{}}, r...)\n\tw := &AWS{\n\t\tCtxRouter: CtxRouter{arn.Ctx{}: &root},\n\t\tCtx: ctx,\n\t}\n\tw.Cfg = awsmock.Config(func(q *aws.Request) {\n\t\tw.mu.Lock()\n\t\tdefer w.mu.Unlock()\n\t\tif q := w.newRequest(q); !w.Route(q) {\n\t\t\tpanic(\"mock: \" + q.Name() + \" not handled\")\n\t\t}\n\t})\n\tw.Cfg.Region = ctx.Region\n\tw.Cfg.Credentials = w.UserCreds(\"\", \"alice\")\n\treturn w\n}", "func BuildAwsCloudProvider(awsManager *AwsManager, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error) {\n\taws := &awsCloudProvider{\n\t\tawsManager: awsManager,\n\t\tresourceLimiter: resourceLimiter,\n\t}\n\treturn aws, nil\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"public_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_PUBLIC_KEY\", nil),\n\t\t\t\tDescription: descriptions[\"public_key\"],\n\t\t\t},\n\n\t\t\t\"private_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_PRIVATE_KEY\", nil),\n\t\t\t\tDescription: descriptions[\"private_key\"],\n\t\t\t},\n\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_REGION\", nil),\n\t\t\t\tDescription: descriptions[\"region\"],\n\t\t\t},\n\n\t\t\t\"project_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_PROJECT_ID\", nil),\n\t\t\t\tDescription: descriptions[\"project_id\"],\n\t\t\t},\n\n\t\t\t\"max_retries\": {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: DefaultMaxRetries,\n\t\t\t\tDescription: descriptions[\"max_retries\"],\n\t\t\t},\n\n\t\t\t\"insecure\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: DefaultInSecure,\n\t\t\t\tDescription: descriptions[\"insecure\"],\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"ucloud_instances\": dataSourceUCloudInstances(),\n\t\t\t\"ucloud_projects\": dataSourceUCloudProjects(),\n\t\t\t\"ucloud_images\": dataSourceUCloudImages(),\n\t\t\t\"ucloud_zones\": dataSourceUCloudZones(),\n\t\t\t\"ucloud_eips\": dataSourceUCloudEips(),\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"ucloud_instance\": resourceUCloudInstance(),\n\t\t\t\"ucloud_eip\": resourceUCloudEIP(),\n\t\t\t\"ucloud_eip_association\": resourceUCloudEIPAssociation(),\n\t\t\t\"ucloud_vpc\": resourceUCloudVPC(),\n\t\t\t\"ucloud_subnet\": resourceUCloudSubnet(),\n\t\t\t\"ucloud_vpc_peering_connection\": resourceUCloudVPCPeeringConnection(),\n\t\t\t\"ucloud_lb\": resourceUCloudLB(),\n\t\t\t\"ucloud_lb_listener\": resourceUCloudLBListener(),\n\t\t\t\"ucloud_lb_attachment\": resourceUCloudLBAttachment(),\n\t\t\t\"ucloud_lb_rule\": resourceUCloudLBRule(),\n\t\t\t\"ucloud_disk\": resourceUCloudDisk(),\n\t\t\t\"ucloud_disk_attachment\": resourceUCloudDiskAttachment(),\n\t\t\t\"ucloud_security_group\": resourceUCloudSecurityGroup(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func AWSNS() *Funcs {\n\treturn &Funcs{}\n}", "func initAWSSvc() *s3.S3 {\n\tsess, err := session.NewSession()\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\n\tsdkLoadConfig := os.Getenv(\"AWS_SDK_LOAD_CONFIG\")\n\tif sdkLoadConfig != \"true\" {\n\t\tlog.Fatal(`Env var \"AWS_SDK_LOAD_CONFIG\" needs to be true to read credentials.\\n\\n Run \"export AWS_SDK_LOAD_CONFIG=true\" to fix this. Aborting run.`)\n\t}\n\n\treturn s3.New(sess)\n}", "func NewProvider() *ProviderConfig {\n\tproviderConfig := &ProviderConfig{\n\t\tAlibaba: make(map[string]*models.AlibabaCloudSpec),\n\t\tAnexia: make(map[string]*models.AnexiaCloudSpec),\n\t\tAws: make(map[string]*models.AWSCloudSpec),\n\t\tAzure: make(map[string]*models.AzureCloudSpec),\n\t\tDigitalocean: make(map[string]*models.DigitaloceanCloudSpec),\n\t\tFake: make(map[string]*models.FakeCloudSpec),\n\t\tGcp: make(map[string]*models.GCPCloudSpec),\n\t\tHetzner: make(map[string]*models.HetznerCloudSpec),\n\t\tKubevirt: make(map[string]*models.KubevirtCloudSpec),\n\t\tOpenstack: make(map[string]*models.OpenstackCloudSpec),\n\t\tPacket: make(map[string]*models.PacketCloudSpec),\n\t\tVsphere: make(map[string]*models.VSphereCloudSpec),\n\t}\n\n\tproviderConfig.Alibaba[\"Alibaba\"] = newAlibabaCloudSpec()\n\tproviderConfig.Anexia[\"Anexia\"] = newAnexiaCloudSpec()\n\tproviderConfig.Aws[\"Aws\"] = newAWSCloudSpec()\n\tproviderConfig.Azure[\"Azure\"] = newAzureCloudSpec()\n\tproviderConfig.Digitalocean[\"Digitalocean\"] = newDigitaloceanCloudSpec()\n\tproviderConfig.Fake[\"Fake\"] = newFakeCloudSpec()\n\tproviderConfig.Gcp[\"Gcp\"] = newGCPCloudSpec()\n\tproviderConfig.Hetzner[\"Hetzner\"] = newHetznerCloudSpec()\n\tproviderConfig.Kubevirt[\"Kubevirt\"] = newKubevirtCloudSpec()\n\tproviderConfig.Openstack[\"Openstack\"] = newOpenstackCloudSpec()\n\tproviderConfig.Packet[\"Packet\"] = newPacketCloudSpec()\n\tproviderConfig.Vsphere[\"Vsphere\"] = newVSphereCloudSpec()\n\n\treturn providerConfig\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"api_token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tSensitive: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"AIVEN_TOKEN\", nil),\n\t\t\t\tDescription: \"Aiven Authentication Token\",\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"aiven_connection_pool\": datasourceConnectionPool(),\n\t\t\t\"aiven_database\": datasourceDatabase(),\n\t\t\t\"aiven_kafka_acl\": datasourceKafkaACL(),\n\t\t\t\"aiven_kafka_topic\": datasourceKafkaTopic(),\n\t\t\t\"aiven_kafka_connector\": datasourceKafkaConnector(),\n\t\t\t\"aiven_kafka_schema\": datasourceKafkaSchema(),\n\t\t\t\"aiven_kafka_schema_configuration\": datasourceKafkaSchemaConfiguration(),\n\t\t\t\"aiven_elasticsearch_acl\": datasourceElasticsearchACL(),\n\t\t\t\"aiven_project\": datasourceProject(),\n\t\t\t\"aiven_project_user\": datasourceProjectUser(),\n\t\t\t\"aiven_project_vpc\": datasourceProjectVPC(),\n\t\t\t\"aiven_vpc_peering_connection\": datasourceVPCPeeringConnection(),\n\t\t\t\"aiven_service\": datasourceService(),\n\t\t\t\"aiven_service_integration\": datasourceServiceIntegration(),\n\t\t\t\"aiven_service_integration_endpoint\": datasourceServiceIntegrationEndpoint(),\n\t\t\t\"aiven_service_user\": datasourceServiceUser(),\n\t\t\t\"aiven_account\": datasourceAccount(),\n\t\t\t\"aiven_account_team\": datasourceAccountTeam(),\n\t\t\t\"aiven_account_team_project\": datasourceAccountTeamProject(),\n\t\t\t\"aiven_account_team_member\": datasourceAccountTeamMember(),\n\t\t\t\"aiven_mirrormaker_replication_flow\": datasourceMirrorMakerReplicationFlowTopic(),\n\t\t\t\"aiven_account_authentication\": datasourceAccountAuthentication(),\n\t\t\t\"aiven_kafka\": datasourceKafka(),\n\t\t\t\"aiven_kafka_connect\": datasourceKafkaConnect(),\n\t\t\t\"aiven_kafka_mirrormaker\": datasourceKafkaMirrormaker(),\n\t\t\t\"aiven_pg\": datasourcePG(),\n\t\t\t\"aiven_mysql\": datasourceMySQL(),\n\t\t\t\"aiven_cassandra\": datasourceCassandra(),\n\t\t\t\"aiven_elasticsearch\": datasourceElasticsearch(),\n\t\t\t\"aiven_grafana\": datasourceGrafana(),\n\t\t\t\"aiven_influxdb\": datasourceInfluxDB(),\n\t\t\t\"aiven_redis\": datasourceRedis(),\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"aiven_connection_pool\": resourceConnectionPool(),\n\t\t\t\"aiven_database\": resourceDatabase(),\n\t\t\t\"aiven_kafka_acl\": resourceKafkaACL(),\n\t\t\t\"aiven_kafka_topic\": resourceKafkaTopic(),\n\t\t\t\"aiven_kafka_connector\": resourceKafkaConnector(),\n\t\t\t\"aiven_kafka_schema\": resourceKafkaSchema(),\n\t\t\t\"aiven_kafka_schema_configuration\": resourceKafkaSchemaConfiguration(),\n\t\t\t\"aiven_elasticsearch_acl\": resourceElasticsearchACL(),\n\t\t\t\"aiven_project\": resourceProject(),\n\t\t\t\"aiven_project_user\": resourceProjectUser(),\n\t\t\t\"aiven_project_vpc\": resourceProjectVPC(),\n\t\t\t\"aiven_vpc_peering_connection\": resourceVPCPeeringConnection(),\n\t\t\t\"aiven_service\": resourceService(),\n\t\t\t\"aiven_service_integration\": resourceServiceIntegration(),\n\t\t\t\"aiven_service_integration_endpoint\": resourceServiceIntegrationEndpoint(),\n\t\t\t\"aiven_service_user\": resourceServiceUser(),\n\t\t\t\"aiven_account\": resourceAccount(),\n\t\t\t\"aiven_account_team\": resourceAccountTeam(),\n\t\t\t\"aiven_account_team_project\": resourceAccountTeamProject(),\n\t\t\t\"aiven_account_team_member\": resourceAccountTeamMember(),\n\t\t\t\"aiven_mirrormaker_replication_flow\": resourceMirrorMakerReplicationFlow(),\n\t\t\t\"aiven_account_authentication\": resourceAccountAuthentication(),\n\t\t\t\"aiven_kafka\": resourceKafka(),\n\t\t\t\"aiven_kafka_connect\": resourceKafkaConnect(),\n\t\t\t\"aiven_kafka_mirrormaker\": resourceKafkaMirrormaker(),\n\t\t\t\"aiven_pg\": resourcePG(),\n\t\t\t\"aiven_mysql\": resourceMySQL(),\n\t\t\t\"aiven_cassandra\": resourceCassandra(),\n\t\t\t\"aiven_elasticsearch\": resourceElasticsearch(),\n\t\t\t\"aiven_grafana\": resourceGrafana(),\n\t\t\t\"aiven_influxdb\": resourceInfluxDB(),\n\t\t\t\"aiven_redis\": resourceRedis(),\n\t\t},\n\n\t\tConfigureFunc: func(d *schema.ResourceData) (interface{}, error) {\n\t\t\t_ = cache.NewTopicCache()\n\n\t\t\treturn aiven.NewTokenClient(d.Get(\"api_token\").(string), \"terraform-provider-aiven/\")\n\t\t},\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\tvar p *schema.Provider\n\tp = &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"subscription_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_SUBSCRIPTION_ID\", \"\"),\n\t\t\t},\n\n\t\t\t\"client_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_CLIENT_ID\", \"\"),\n\t\t\t},\n\n\t\t\t\"client_secret\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_CLIENT_SECRET\", \"\"),\n\t\t\t},\n\n\t\t\t\"tenant_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_TENANT_ID\", \"\"),\n\t\t\t},\n\n\t\t\t\"environment\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_ENVIRONMENT\", \"public\"),\n\t\t\t},\n\n\t\t\t\"skip_provider_registration\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_SKIP_PROVIDER_REGISTRATION\", false),\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"azurerm_client_config\": dataSourceArmClientConfig(),\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t// These resources use the Azure ARM SDK\n\t\t\t\"azurerm_availability_set\": resourceArmAvailabilitySet(),\n\t\t\t\"azurerm_cdn_endpoint\": resourceArmCdnEndpoint(),\n\t\t\t\"azurerm_cdn_profile\": resourceArmCdnProfile(),\n\t\t\t\"azurerm_container_registry\": resourceArmContainerRegistry(),\n\t\t\t\"azurerm_container_service\": resourceArmContainerService(),\n\n\t\t\t\"azurerm_eventhub\": resourceArmEventHub(),\n\t\t\t\"azurerm_eventhub_authorization_rule\": resourceArmEventHubAuthorizationRule(),\n\t\t\t\"azurerm_eventhub_consumer_group\": resourceArmEventHubConsumerGroup(),\n\t\t\t\"azurerm_eventhub_namespace\": resourceArmEventHubNamespace(),\n\n\t\t\t\"azurerm_lb\": resourceArmLoadBalancer(),\n\t\t\t\"azurerm_lb_backend_address_pool\": resourceArmLoadBalancerBackendAddressPool(),\n\t\t\t\"azurerm_lb_nat_rule\": resourceArmLoadBalancerNatRule(),\n\t\t\t\"azurerm_lb_nat_pool\": resourceArmLoadBalancerNatPool(),\n\t\t\t\"azurerm_lb_probe\": resourceArmLoadBalancerProbe(),\n\t\t\t\"azurerm_lb_rule\": resourceArmLoadBalancerRule(),\n\n\t\t\t\"azurerm_managed_disk\": resourceArmManagedDisk(),\n\n\t\t\t\"azurerm_key_vault\": resourceArmKeyVault(),\n\t\t\t\"azurerm_local_network_gateway\": resourceArmLocalNetworkGateway(),\n\t\t\t\"azurerm_network_interface\": resourceArmNetworkInterface(),\n\t\t\t\"azurerm_network_security_group\": resourceArmNetworkSecurityGroup(),\n\t\t\t\"azurerm_network_security_rule\": resourceArmNetworkSecurityRule(),\n\t\t\t\"azurerm_public_ip\": resourceArmPublicIp(),\n\t\t\t\"azurerm_redis_cache\": resourceArmRedisCache(),\n\t\t\t\"azurerm_route\": resourceArmRoute(),\n\t\t\t\"azurerm_route_table\": resourceArmRouteTable(),\n\t\t\t\"azurerm_servicebus_namespace\": resourceArmServiceBusNamespace(),\n\t\t\t\"azurerm_servicebus_subscription\": resourceArmServiceBusSubscription(),\n\t\t\t\"azurerm_servicebus_topic\": resourceArmServiceBusTopic(),\n\t\t\t\"azurerm_storage_account\": resourceArmStorageAccount(),\n\t\t\t\"azurerm_storage_blob\": resourceArmStorageBlob(),\n\t\t\t\"azurerm_storage_container\": resourceArmStorageContainer(),\n\t\t\t\"azurerm_storage_share\": resourceArmStorageShare(),\n\t\t\t\"azurerm_storage_queue\": resourceArmStorageQueue(),\n\t\t\t\"azurerm_storage_table\": resourceArmStorageTable(),\n\t\t\t\"azurerm_subnet\": resourceArmSubnet(),\n\t\t\t\"azurerm_template_deployment\": resourceArmTemplateDeployment(),\n\t\t\t\"azurerm_traffic_manager_endpoint\": resourceArmTrafficManagerEndpoint(),\n\t\t\t\"azurerm_traffic_manager_profile\": resourceArmTrafficManagerProfile(),\n\t\t\t\"azurerm_virtual_machine_extension\": resourceArmVirtualMachineExtensions(),\n\t\t\t\"azurerm_virtual_machine\": resourceArmVirtualMachine(),\n\t\t\t\"azurerm_virtual_machine_scale_set\": resourceArmVirtualMachineScaleSet(),\n\t\t\t\"azurerm_virtual_network\": resourceArmVirtualNetwork(),\n\t\t\t\"azurerm_virtual_network_peering\": resourceArmVirtualNetworkPeering(),\n\n\t\t\t// These resources use the Riviera SDK\n\t\t\t\"azurerm_dns_a_record\": resourceArmDnsARecord(),\n\t\t\t\"azurerm_dns_aaaa_record\": resourceArmDnsAAAARecord(),\n\t\t\t\"azurerm_dns_cname_record\": resourceArmDnsCNameRecord(),\n\t\t\t\"azurerm_dns_mx_record\": resourceArmDnsMxRecord(),\n\t\t\t\"azurerm_dns_ns_record\": resourceArmDnsNsRecord(),\n\t\t\t\"azurerm_dns_srv_record\": resourceArmDnsSrvRecord(),\n\t\t\t\"azurerm_dns_txt_record\": resourceArmDnsTxtRecord(),\n\t\t\t\"azurerm_dns_zone\": resourceArmDnsZone(),\n\t\t\t\"azurerm_resource_group\": resourceArmResourceGroup(),\n\t\t\t\"azurerm_search_service\": resourceArmSearchService(),\n\t\t\t\"azurerm_sql_database\": resourceArmSqlDatabase(),\n\t\t\t\"azurerm_sql_firewall_rule\": resourceArmSqlFirewallRule(),\n\t\t\t\"azurerm_sql_server\": resourceArmSqlServer(),\n\t\t},\n\t}\n\n\tp.ConfigureFunc = providerConfigure(p)\n\n\treturn p\n}", "func (p providerServices) AWSCli() awscli.AWS {\n\treturn p.cli\n}", "func AWS(region string) Option {\n\treturn func(s *Server) {\n\t\tdocumentRepo := aws.NewDocumentRepository(region)\n\t\tprojectRepo := aws.ProjectRepository{\n\t\t\tDocumentRepository: documentRepo,\n\t\t}\n\n\t\ts.With(ProjectRepository(&projectRepo))\n\t\ts.With(DocumentRepository(&documentRepo))\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"account\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"SF_ACCOUNT\", nil),\n\t\t\t\tDescription: \"Name of Snowflake Account string to connect to\",\n\t\t\t\tValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {\n\t\t\t\t\tvalue := v.(string)\n\t\t\t\t\tif value == \"\" {\n\t\t\t\t\t\terrors = append(errors, fmt.Errorf(\"Account must not be an empty string\"))\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"username\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"SF_USER\", nil),\n\t\t\t\tDescription: \"Snowflake user name to connect as \",\n\t\t\t\tValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {\n\t\t\t\t\tvalue := v.(string)\n\t\t\t\t\tif value == \"\" {\n\t\t\t\t\t\terrors = append(errors, fmt.Errorf(\"Username must not be an empty string\"))\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"password\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDescription: \"Password to be used to connec to Snowflake Server\",\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"SF_PASSWORD\", nil),\n\t\t\t},\n\t\t\t\"region\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"Snowflake AWS region that is configured with account\",\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"SF_REGION\", DefaultSnowFlakeRegion),\n\t\t\t},\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"snowflake_warehouse\": resourceWarehouse(),\n\t\t\t//\"snowflake_database\": resourceDatabase(),\n\t\t\t//\"snowflake_user\": resourceUser(),\n\t\t\t//\"snowflake_grant\": resourceGrant(),\n\t\t},\n\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func setupAWS(ctx *context.Context, config *ConfigParams) (*blob.Bucket, error) {\n\tc := &aws.Config{\n\t\t// Either hard-code the region or use AWS_REGION.\n\t\tRegion: aws.String(config.Region),\n\t\t// credentials.NewEnvCredentials assumes two environment variables are\n\t\t// present:\n\t\t// 1. AWS_ACCESS_KEY_ID, and\n\t\t// 2. AWS_SECRET_ACCESS_KEY.\n\t\t// Credentials: credentials.NewEnvCredentials(),\n\t\tCredentials: credentials.NewStaticCredentials(\n\t\t\tconfig.AccessKey,\n\t\t\tconfig.SecretKey,\n\t\t\tconfig.Token,\n\t\t),\n\t}\n\ts := session.Must(session.NewSession(c))\n\treturn s3blob.OpenBucket(*ctx, config.Bucket, s, nil)\n}", "func (a *Application) RegisterProvider() {\n\n}", "func init() {\n\tdebugMode = (os.Getenv(\"DEBUG\") != \"\")\n\n\tarnPattern = regexp.MustCompile(\"\\\\Aarn:aws:sts::\\\\d+:assumed-role/([a-z0-9_-]+)/(i-[0-9a-f]+)\\\\z\")\n\n\tcaKeyBucket, caKeyPath, err := parseS3URI(os.Getenv(\"CA_KEY_URI\"))\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"CA_KEY_URI: %w\", err)\n\t\treturn\n\t}\n\n\tob, op, err := parseS3URI(os.Getenv(\"OUTPUT_URI_PREFIX\"))\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"OUTPUT_URI_PREFIX: %w\", err)\n\t\treturn\n\t}\n\toutBucket = ob\n\toutPathPrefix = op\n\n\taws, err := newAwsClient()\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"initializing aws client: %w\", err)\n\t\treturn\n\t}\n\tawsCli = aws\n\n\tcaKey, err := awsCli.getS3Object(caKeyBucket, caKeyPath)\n\tif err != nil {\n\t\tfmt.Printf(\"error getting CA key, bucket=%q path=%q\\n\", caKeyBucket, caKeyPath)\n\t\tinitError = fmt.Errorf(\"getting caKey: %w\", err)\n\t\treturn\n\t}\n\n\tsigner, err = NewSigner(caKey)\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"creating signer: %w\", err)\n\t\treturn\n\t}\n\n\tif debugMode {\n\t\tfmt.Printf(\"init completed\")\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\tlog.Printf(\"Creating Terraform Solace Provider\")\n\treturn &schema.Provider{\n\t\tSchema: providerSchema(),\n\t\tResourcesMap: providerResources(),\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func expandServiceEndpointAws(d *schema.ResourceData) (*serviceendpoint.ServiceEndpoint, *string, error) {\n\tserviceEndpoint, projectID := doBaseExpansion(d)\n\tserviceEndpoint.Authorization = &serviceendpoint.EndpointAuthorization{\n\t\tParameters: &map[string]string{\n\t\t\t\"username\": d.Get(\"access_key_id\").(string),\n\t\t\t\"password\": d.Get(\"secret_access_key\").(string),\n\t\t\t\"sessionToken\": d.Get(\"session_token\").(string),\n\t\t\t\"assumeRoleArn\": d.Get(\"role_to_assume\").(string),\n\t\t\t\"roleSessionName\": d.Get(\"role_session_name\").(string),\n\t\t\t\"externalId\": d.Get(\"external_id\").(string),\n\t\t},\n\t\tScheme: converter.String(\"UsernamePassword\"),\n\t}\n\tserviceEndpoint.Type = converter.String(\"aws\")\n\tserviceEndpoint.Url = converter.String(\"https://aws.amazon.com/\")\n\treturn serviceEndpoint, projectID, nil\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"sshcommand_command\": resourceCommand(),\n\t\t},\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"sshcommand_command\": dataSourceCommand(),\n\t\t},\n\t}\n}", "func New(auth stacks.AuthenticationOptions, localCfg stacks.AWSConfiguration, cfg stacks.ConfigurationOptions) (*stack, error) { // nolint\n\tif localCfg.Ec2Endpoint == \"\" {\n\t\tlocalCfg.Ec2Endpoint = fmt.Sprintf(\"https://ec2.%s.amazonaws.com\", localCfg.Region)\n\t}\n\tif localCfg.SsmEndpoint == \"\" {\n\t\tlocalCfg.SsmEndpoint = fmt.Sprintf(\"https://ssm.%s.amazonaws.com\", localCfg.Region)\n\t}\n\n\tstack := &stack{\n\t\tConfig: &cfg,\n\t\tAuthOptions: &auth,\n\t\tAwsConfig: &localCfg,\n\t}\n\n\taccessKeyID := auth.AccessKeyID\n\tsecretAccessKey := auth.SecretAccessKey\n\n\tss3 := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(localCfg.Region),\n\t\tEndpoint: aws.String(localCfg.S3Endpoint),\n\t}))\n\n\tsec2 := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(localCfg.Region),\n\t\tEndpoint: aws.String(localCfg.Ec2Endpoint),\n\t}))\n\n\tsssm := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(localCfg.Region),\n\t\tEndpoint: aws.String(localCfg.SsmEndpoint),\n\t}))\n\n\tspricing := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(endpoints.UsEast1RegionID),\n\t}))\n\n\tstack.S3Service = s3.New(ss3, &aws.Config{})\n\tstack.EC2Service = ec2.New(sec2, &aws.Config{})\n\tstack.SSMService = ssm.New(sssm, &aws.Config{})\n\tstack.PricingService = pricing.New(spricing, &aws.Config{})\n\n\tif cfg.Timings != nil {\n\t\tstack.MutableTimings = cfg.Timings\n\t} else {\n\t\tstack.MutableTimings = temporal.NewTimings()\n\t}\n\n\treturn stack, nil\n}", "func (ts *Tester) Provider() string {\n\treturn \"eks\"\n}", "func CheckProvider(provider string) (string, error) {\n\tprovider = strings.ToLower(provider)\n\tif provider == ProviderAWS {\n\t\treturn provider, nil\n\t}\n\n\treturn provider, fmt.Errorf(\"unsupported provider %s\", provider)\n}", "func TestAWS(t *testing.T) {\n\tlogger = runner.NewLogger(\"aws_test\")\n\n\tlogger.Info(\"TestAWS completed\")\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"ip\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"VCD_IP\", nil),\n\t\t\t\tDescription: \"The vcd IP for vcd API operations.\",\n\t\t\t},\n\n\t\t\t\"user\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"VCD_USER\", nil),\n\t\t\t\tDescription: \"The user name for vcd API operations.\",\n\t\t\t},\n\n\t\t\t\"password\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"VCD_PASSWORD\", nil),\n\t\t\t\tDescription: \"The user password for vcd API operations.\",\n\t\t\t},\n\n\t\t\t\"org\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"VCD_ORG\", nil),\n\t\t\t\tDescription: \"The vcd org for API operations\",\n\t\t\t},\n\n\t\t\t\"use_vcd_cli_profile\": &schema.Schema{\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"VCD_USE_VCD_CLI_PROFILE\", false),\n\t\t\t\tDescription: \"If set, VCDClient will use vcd cli profile and token .\",\n\t\t\t},\n\n\t\t\t\"allow_unverified_ssl\": &schema.Schema{\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"VCD_ALLOW_UNVERIFIED_SSL\", false),\n\t\t\t\tDescription: \"If set, VCDClient will permit unverifiable SSL certificates.\",\n\t\t\t},\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\n\t\t\t\"vcloud-director_catalog\": resourceCatalog(),\n\t\t\t\"vcloud-director_catalog_item_media\": resourceCatalogItemMedia(),\n\t\t\t\"vcloud-director_catalog_item_ova\": resourceCatalogItemOva(),\n\t\t\t\"vcloud-director_vapp\": resourceVApp(),\n\t\t\t\"vcloud-director_independent_disk\": resourceIndependentDisk(),\n\t\t\t\"vcloud-director_org\": resourceOrg(),\n\t\t\t\"vcloud-director_disk\": resourceIndependentDisk(),\n\t\t\t\"vcloud-director_user\": resourceUser(),\n\t\t\t\"vcloud-director_vdc\": resourceVdc(),\n\t\t\t\"vcloud-director_vapp_vm\": resourceVappVm(),\n\t\t},\n\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func Provider() tfbridge.ProviderInfo {\n\t// Instantiate the Terraform provider\n\tp := shimv2.NewProvider(xyz.Provider())\n\n\t// Create a Pulumi provider mapping\n\tprov := tfbridge.ProviderInfo{\n\t\tP: p,\n\t\tName: \"xyz\",\n\t\t// DisplayName is a way to be able to change the casing of the provider\n\t\t// name when being displayed on the Pulumi registry\n\t\tDisplayName: \"\",\n\t\t// The default publisher for all packages is Pulumi.\n\t\t// Change this to your personal name (or a company name) that you\n\t\t// would like to be shown in the Pulumi Registry if this package is published\n\t\t// there.\n\t\tPublisher: \"Pulumi\",\n\t\t// LogoURL is optional but useful to help identify your package in the Pulumi Registry\n\t\t// if this package is published there.\n\t\t//\n\t\t// You may host a logo on a domain you control or add an SVG logo for your package\n\t\t// in your repository and use the raw content URL for that file as your logo URL.\n\t\tLogoURL: \"\",\n\t\t// PluginDownloadURL is an optional URL used to download the Provider\n\t\t// for use in Pulumi programs\n\t\t// e.g https://github.com/org/pulumi-provider-name/releases/\n\t\tPluginDownloadURL: \"\",\n\t\tDescription: \"A Pulumi package for creating and managing xyz cloud resources.\",\n\t\t// category/cloud tag helps with categorizing the package in the Pulumi Registry.\n\t\t// For all available categories, see `Keywords` in\n\t\t// https://www.pulumi.com/docs/guides/pulumi-packages/schema/#package.\n\t\tKeywords: []string{\"pulumi\", \"xyz\", \"category/cloud\"},\n\t\tLicense: \"Apache-2.0\",\n\t\tHomepage: \"https://www.pulumi.com\",\n\t\tRepository: \"https://github.com/pulumi/pulumi-xyz\",\n\t\t// The GitHub Org for the provider - defaults to `terraform-providers`. Note that this\n\t\t// should match the TF provider module's require directive, not any replace directives.\n\t\tGitHubOrg: \"\",\n\t\tConfig: map[string]*tfbridge.SchemaInfo{\n\t\t\t// Add any required configuration here, or remove the example below if\n\t\t\t// no additional points are required.\n\t\t\t// \"region\": {\n\t\t\t// \tType: tfbridge.MakeType(\"region\", \"Region\"),\n\t\t\t// \tDefault: &tfbridge.DefaultInfo{\n\t\t\t// \t\tEnvVars: []string{\"AWS_REGION\", \"AWS_DEFAULT_REGION\"},\n\t\t\t// \t},\n\t\t\t// },\n\t\t},\n\t\tPreConfigureCallback: preConfigureCallback,\n\t\tResources: map[string]*tfbridge.ResourceInfo{\n\t\t\t// Map each resource in the Terraform provider to a Pulumi type. Two examples\n\t\t\t// are below - the single line form is the common case. The multi-line form is\n\t\t\t// needed only if you wish to override types or other default options.\n\t\t\t//\n\t\t\t// \"aws_iam_role\": {Tok: tfbridge.MakeResource(mainPkg, mainMod, \"IamRole\")}\n\t\t\t//\n\t\t\t// \"aws_acm_certificate\": {\n\t\t\t// \tTok: tfbridge.MakeResource(mainPkg, mainMod, \"Certificate\"),\n\t\t\t// \tFields: map[string]*tfbridge.SchemaInfo{\n\t\t\t// \t\t\"tags\": {Type: tfbridge.MakeType(mainPkg, \"Tags\")},\n\t\t\t// \t},\n\t\t\t// },\n\t\t},\n\t\tDataSources: map[string]*tfbridge.DataSourceInfo{\n\t\t\t// Map each resource in the Terraform provider to a Pulumi function. An example\n\t\t\t// is below.\n\t\t\t// \"aws_ami\": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, \"getAmi\")},\n\t\t},\n\t\tJavaScript: &tfbridge.JavaScriptInfo{\n\t\t\t// List any npm dependencies and their versions\n\t\t\tDependencies: map[string]string{\n\t\t\t\t\"@pulumi/pulumi\": \"^3.0.0\",\n\t\t\t},\n\t\t\tDevDependencies: map[string]string{\n\t\t\t\t\"@types/node\": \"^10.0.0\", // so we can access strongly typed node definitions.\n\t\t\t\t\"@types/mime\": \"^2.0.0\",\n\t\t\t},\n\t\t\t// See the documentation for tfbridge.OverlayInfo for how to lay out this\n\t\t\t// section, or refer to the AWS provider. Delete this section if there are\n\t\t\t// no overlay files.\n\t\t\t//Overlay: &tfbridge.OverlayInfo{},\n\t\t},\n\t\tPython: &tfbridge.PythonInfo{\n\t\t\t// List any Python dependencies and their version ranges\n\t\t\tRequires: map[string]string{\n\t\t\t\t\"pulumi\": \">=3.0.0,<4.0.0\",\n\t\t\t},\n\t\t},\n\t\tGolang: &tfbridge.GolangInfo{\n\t\t\tImportBasePath: filepath.Join(\n\t\t\t\tfmt.Sprintf(\"github.com/pulumi/pulumi-%[1]s/sdk/\", mainPkg),\n\t\t\t\ttfbridge.GetModuleMajorVersion(version.Version),\n\t\t\t\t\"go\",\n\t\t\t\tmainPkg,\n\t\t\t),\n\t\t\tGenerateResourceContainerTypes: true,\n\t\t},\n\t\tCSharp: &tfbridge.CSharpInfo{\n\t\t\tPackageReferences: map[string]string{\n\t\t\t\t\"Pulumi\": \"3.*\",\n\t\t\t},\n\t\t},\n\t}\n\n\t// These are new API's that you may opt to use to automatically compute resource tokens,\n\t// and apply auto aliasing for full backwards compatibility.\n\t// For more information, please reference: https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge#ProviderInfo.ComputeTokens\n\tprov.MustComputeTokens(tokens.SingleModule(\"xyz_\", mainMod,\n\t\ttokens.MakeStandard(mainPkg)))\n\tprov.MustApplyAutoAliasing()\n\tprov.SetAutonaming(255, \"-\")\n\n\treturn prov\n}", "func main() {\n\tif len(os.Args) != 3 {\n\t\texitErrorf(\"AMI ID and Instance Type are required\"+\n\t\t\t\"\\nUsage: %s image_id instance_type\", os.Args[0])\n\t}\n\n\n\t//Initialize the session that the SDK uses to load credentials from the shared credentials file ~/.aws/credentials\n\tsess, err := session.NewSession(&aws.Config{Region: aws.String(\"eu-west-1\")}, )\n\tsvc := ec2.New(sess)\n\tif err != nil {\n\t\texitErrorf(\"Error creating session, %v\", err)\n\t}\n\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"credential\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"SECRETHUB_CREDENTIAL\", nil),\n\t\t\t\tDescription: \"Credential to use for SecretHub authentication. Can also be sourced from SECRETHUB_CREDENTIAL.\",\n\t\t\t},\n\t\t\t\"credential_passphrase\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"SECRETHUB_CREDENTIAL_PASSPHRASE\", nil),\n\t\t\t\tDescription: \"Passphrase to unlock the authentication passed in `credential`. Can also be sourced from SECRETHUB_CREDENTIAL_PASSPHRASE.\",\n\t\t\t},\n\t\t\t\"path_prefix\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The default value to prefix path values with. If set, paths for resources and data sources will be prefixed with the given prefix, allowing you to use relative paths instead. If left blank, every path must be absolute (namespace/repository/[dir/]secret_name).\",\n\t\t\t},\n\t\t},\n\t\tConfigureFunc: configureProvider,\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"secrethub_secret\": resourceSecret(),\n\t\t},\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"secrethub_secret\": dataSourceSecret(),\n\t\t},\n\t}\n}", "func NewProvider(ctx *pulumi.Context,\n\tname string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) {\n\tif args == nil {\n\t\targs = &ProviderArgs{}\n\t}\n\n\tif args.AllowReauth == nil {\n\t\targs.AllowReauth = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, \"OS_ALLOW_REAUTH\").(bool))\n\t}\n\tif args.Cloud == nil {\n\t\targs.Cloud = pulumi.StringPtr(getEnvOrDefault(\"\", nil, \"OS_CLOUD\").(string))\n\t}\n\tif args.DelayedAuth == nil {\n\t\targs.DelayedAuth = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, \"OS_DELAYED_AUTH\").(bool))\n\t}\n\tif args.EndpointType == nil {\n\t\targs.EndpointType = pulumi.StringPtr(getEnvOrDefault(\"\", nil, \"OS_ENDPOINT_TYPE\").(string))\n\t}\n\tif args.Insecure == nil {\n\t\targs.Insecure = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, \"OS_INSECURE\").(bool))\n\t}\n\tif args.Region == nil {\n\t\targs.Region = pulumi.StringPtr(getEnvOrDefault(\"\", nil, \"OS_REGION_NAME\").(string))\n\t}\n\tif args.Swauth == nil {\n\t\targs.Swauth = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, \"OS_SWAUTH\").(bool))\n\t}\n\tif args.UseOctavia == nil {\n\t\targs.UseOctavia = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, \"OS_USE_OCTAVIA\").(bool))\n\t}\n\tvar resource Provider\n\terr := ctx.RegisterResource(\"pulumi:providers:openstack\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func NewAWSProvisioner(testPath, identifier string) (*AWSProvisioner, error) {\n\tterraform := &terraform{\n\t\tterraformDir: \"../../examples/terraform/aws/\",\n\t\tidendifier: identifier,\n\t}\n\n\treturn &AWSProvisioner{\n\t\tterraform: terraform,\n\t\ttestPath: testPath,\n\t}, nil\n}", "func NewAWSOperator(config AWSOperatorConfig) (string, error) {\n\tif config.InstallationName == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.InstallationName must not be empty\", config)\n\t}\n\tif config.Provider.AWS.Encrypter == \"\" {\n\t\tconfig.Provider.AWS.Encrypter = defaultEncrypter\n\t}\n\tif config.Provider.AWS.Region == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.Provider.AWS.Region must not be empty\", config)\n\t}\n\tif config.Provider.AWS.RouteTableNames == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.Provider.AWS.RouteTableNames must not be empty\", config)\n\t}\n\tif config.RegistryPullSecret == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.RegistryPullSecret must not be empty\", config)\n\t}\n\tif config.Secret.AWSOperator.SecretYaml.Service.AWS.AccessKey.ID == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.Secret.AWSOperator.SecretYaml.Service.AWS.AccessKey.ID must not be empty\", config)\n\t}\n\tif config.Secret.AWSOperator.SecretYaml.Service.AWS.AccessKey.Secret == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.Secret.AWSOperator.SecretYaml.Service.AWS.AccessKey.Secret must not be empty\", config)\n\t}\n\tif config.Secret.AWSOperator.SecretYaml.Service.AWS.HostAccessKey.ID == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.Secret.AWSOperator.SecretYaml.Service.AWS.HostAccessKey.ID must not be empty\", config)\n\t}\n\tif config.Secret.AWSOperator.SecretYaml.Service.AWS.HostAccessKey.Secret == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.Secret.AWSOperator.SecretYaml.Service.AWS.HostAccessKey.Secret must not be empty\", config)\n\t}\n\tif config.SSH.UserList == \"\" {\n\t\treturn \"\", microerror.Maskf(invalidConfigError, \"%T.SSH.UserList must not be empty\", config)\n\t}\n\n\tvalues, err := render.Render(awsOperatorTemplate, config)\n\tif err != nil {\n\t\treturn \"\", microerror.Mask(err)\n\t}\n\n\treturn values, nil\n}", "func ResourceAWS(w http.ResponseWriter, r *http.Request) {\n\n\tvars := mux.Vars(r)\n\tResourceName := vars[\"ResourceName\"]\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\n\tif err := json.NewEncoder(w).Encode(awsResources[ResourceName]); err != nil {\n\t\tpanic(err)\n\t}\n}", "func setupAWS(ctx context.Context, bucket string) (*blob.Bucket, error) {\n\tc := &aws.Config{\n\t\t// Either hard-code the region or use AWS_REGION.\n\t\tRegion: aws.String(\"us-east-2\"),\n\t\t// credentials.NewEnvCredentials assumes two environment variables are\n\t\t// present:\n\t\t// 1. AWS_ACCESS_KEY_ID, and\n\t\t// 2. AWS_SECRET_ACCESS_KEY.\n\t\tCredentials: credentials.NewEnvCredentials(),\n\t}\n\ts := session.Must(session.NewSession(c))\n\treturn s3blob.OpenBucket(ctx, s, bucket)\n}", "func (c *config) createCognitoService() error {\n\tcfg, err := external.LoadDefaultAWSConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Couldn't create AWS cfg. Error: %s\", err.Error())\n\t}\n\n\tc.svc = cognitoidentityprovider.New(cfg)\n\treturn nil\n}", "func AWSScale() {\n\tSetClusterName()\n\t// Scale the AWS infrastructure\n\tfmt.Printf(\"\\t\\t===============Starting AWS Scaling====================\\n\\n\")\n\tsshUser, osLabel := distSelect()\n\tprepareConfigFiles(osLabel)\n\tprovisioner.ExecuteTerraform(\"apply\", \"./inventory/\"+common.Name+\"/provisioner/\")\n\tmvHost := exec.Command(\"mv\", \"./inventory/hosts\", \"./inventory/\"+common.Name+\"/provisioner/hosts\")\n\tmvHost.Run()\n\tmvHost.Wait()\n\t// waiting for Infrastructure\n\ttime.Sleep(30)\n\t// Scale the Kubernetes cluster\n\tfmt.Printf(\"\\n\\n\\t\\t===============Starting Kubernetes Scaling====================\\n\\n\")\n\t_, err := os.Stat(\"./inventory/\" + common.Name + \"/provisioner/hosts\")\n\tcommon.ErrorCheck(\"No host file found.\", err)\n\tcpHost := exec.Command(\"cp\", \"./inventory/\"+common.Name+\"/provisioner/hosts\", \"./inventory/\"+common.Name+\"/installer/hosts\")\n\tcpHost.Run()\n\tcpHost.Wait()\n\tinstaller.RunPlaybook(\"./inventory/\"+common.Name+\"/installer/\", \"scale.yml\", sshUser, osLabel)\n\n\treturn\n}", "func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\tlog.Printf(\"[DEBUG] Fetching Lambda Function: %s\", d.Id())\n\n\tparams := &lambda.GetFunctionInput{\n\t\tFunctionName: aws.String(d.Get(\"function_name\").(string)),\n\t}\n\n\tgetFunctionOutput, err := conn.GetFunction(params)\n\tif err != nil {\n\t\tif awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == \"ResourceNotFoundException\" && !d.IsNewResource() {\n\t\t\td.SetId(\"\")\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\t// getFunctionOutput.Code.Location is a pre-signed URL pointing at the zip\n\t// file that we uploaded when we created the resource. You can use it to\n\t// download the code from AWS. The other part is\n\t// getFunctionOutput.Configuration which holds metadata.\n\n\tfunction := getFunctionOutput.Configuration\n\t// TODO error checking / handling on the Set() calls.\n\td.Set(\"arn\", function.FunctionArn)\n\td.Set(\"description\", function.Description)\n\td.Set(\"handler\", function.Handler)\n\td.Set(\"memory_size\", function.MemorySize)\n\td.Set(\"last_modified\", function.LastModified)\n\td.Set(\"role\", function.Role)\n\td.Set(\"runtime\", function.Runtime)\n\td.Set(\"timeout\", function.Timeout)\n\td.Set(\"kms_key_arn\", function.KMSKeyArn)\n\td.Set(\"tags\", tagsToMapGeneric(getFunctionOutput.Tags))\n\n\tconfig := flattenLambdaVpcConfigResponse(function.VpcConfig)\n\tlog.Printf(\"[INFO] Setting Lambda %s VPC config %#v from API\", d.Id(), config)\n\tvpcSetErr := d.Set(\"vpc_config\", config)\n\tif vpcSetErr != nil {\n\t\treturn fmt.Errorf(\"Failed setting vpc_config: %s\", vpcSetErr)\n\t}\n\n\td.Set(\"source_code_hash\", function.CodeSha256)\n\n\tif err := d.Set(\"environment\", flattenLambdaEnvironment(function.Environment)); err != nil {\n\t\tlog.Printf(\"[ERR] Error setting environment for Lambda Function (%s): %s\", d.Id(), err)\n\t}\n\n\tif function.DeadLetterConfig != nil && function.DeadLetterConfig.TargetArn != nil {\n\t\td.Set(\"dead_letter_config\", []interface{}{\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"target_arn\": *function.DeadLetterConfig.TargetArn,\n\t\t\t},\n\t\t})\n\t} else {\n\t\td.Set(\"dead_letter_config\", []interface{}{})\n\t}\n\n\tif function.TracingConfig != nil {\n\t\td.Set(\"tracing_config\", []interface{}{\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"mode\": *function.TracingConfig.Mode,\n\t\t\t},\n\t\t})\n\t}\n\n\t// List is sorted from oldest to latest\n\t// so this may get costly over time :'(\n\tvar lastVersion, lastQualifiedArn string\n\terr = listVersionsByFunctionPages(conn, &lambda.ListVersionsByFunctionInput{\n\t\tFunctionName: function.FunctionName,\n\t\tMaxItems: aws.Int64(10000),\n\t}, func(p *lambda.ListVersionsByFunctionOutput, lastPage bool) bool {\n\t\tif lastPage {\n\t\t\tlast := p.Versions[len(p.Versions)-1]\n\t\t\tlastVersion = *last.Version\n\t\t\tlastQualifiedArn = *last.FunctionArn\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.Set(\"version\", lastVersion)\n\td.Set(\"qualified_arn\", lastQualifiedArn)\n\n\td.Set(\"invoke_arn\", buildLambdaInvokeArn(*function.FunctionArn, meta.(*AWSClient).region))\n\n\tif getFunctionOutput.Concurrency != nil {\n\t\td.Set(\"reserved_concurrent_executions\", getFunctionOutput.Concurrency.ReservedConcurrentExecutions)\n\t} else {\n\t\td.Set(\"reserved_concurrent_executions\", nil)\n\t}\n\n\treturn nil\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"url\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARTIFACTORY_URL\", nil),\n\t\t\t},\n\t\t\t\"username\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARTIFACTORY_USERNAME\", nil),\n\t\t\t\tConflictsWith: []string{\"access_token\", \"api_key\"},\n\t\t\t},\n\t\t\t\"password\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tSensitive: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARTIFACTORY_PASSWORD\", nil),\n\t\t\t\tConflictsWith: []string{\"access_token\", \"api_key\"},\n\t\t\t},\n\t\t\t\"api_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tSensitive: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARTIFACTORY_API_KEY\", nil),\n\t\t\t\tConflictsWith: []string{\"username\", \"access_token\", \"password\"},\n\t\t\t},\n\t\t\t\"access_token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tSensitive: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARTIFACTORY_ACCESS_TOKEN\", nil),\n\t\t\t\tConflictsWith: []string{\"username\", \"api_key\", \"password\"},\n\t\t\t},\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"artifactory_local_repository\": resourceArtifactoryLocalRepository(),\n\t\t\t\"artifactory_remote_repository\": resourceArtifactoryRemoteRepository(),\n\t\t\t\"artifactory_virtual_repository\": resourceArtifactoryVirtualRepository(),\n\t\t\t\"artifactory_group\": resourceArtifactoryGroup(),\n\t\t\t\"artifactory_user\": resourceArtifactoryUser(),\n\t\t\t\"artifactory_permission_target\": resourceArtifactoryPermissionTarget(),\n\t\t\t\"artifactory_replication_config\": resourceArtifactoryReplicationConfig(),\n\t\t\t\"artifactory_single_replication_config\": resourceArtifactorySingleReplicationConfig(),\n\t\t\t\"artifactory_certificate\": resourceArtifactoryCertificate(),\n\t\t\t\"artifactory_api_key\": resourceArtifactoryApiKey(),\n\t\t\t\"artifactory_access_token\": resourceArtifactoryAcessToken(),\n\t\t\t// Deprecated. Remove in V3\n\t\t\t\"artifactory_permission_targets\": resourceArtifactoryPermissionTargets(),\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"artifactory_file\": dataSourceArtifactoryFile(),\n\t\t\t\"artifactory_fileinfo\": dataSourceArtifactoryFileInfo(),\n\t\t},\n\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func Configure(p *config.Provider) {\n\tp.AddResourceConfigurator(\"aws_instance\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t\tr.References[\"vpc_security_group_ids\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupIdRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupIdSelector\",\n\t\t}\n\t\tr.References[\"security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"root_block_device.kms_key_id\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2.Key\",\n\t\t}\n\t\tr.References[\"network_interface.network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"ebs_block_device.kms_key_id\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2.Key\",\n\t\t}\n\t\tr.LateInitializer = config.LateInitializer{\n\t\t\t// NOTE(muvaf): These are ignored because they conflict with each other.\n\t\t\t// See the following for more details: https://github.com/crossplane/terrajet/issues/107\n\t\t\tIgnoredFields: []string{\n\t\t\t\t\"subnet_id\",\n\t\t\t\t\"network_interface\",\n\t\t\t\t\"private_ip\",\n\t\t\t\t\"source_dest_check\",\n\t\t\t},\n\t\t}\n\t})\n\tp.AddResourceConfigurator(\"aws_eip\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"instance\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t\tr.References[\"network_interface\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.UseAsync = true\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t\tr.References[\"transit_gateway_route_table_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayRouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route_table\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_id\"] = config.Reference{\n\t\t\tType: \"TransitGateway\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route_table_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t\tr.References[\"transit_gateway_route_table_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayRouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_vpc_attachment\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_ids\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t\tRefFieldName: \"SubnetIdRefs\",\n\t\t\tSelectorFieldName: \"SubnetIdSelector\",\n\t\t}\n\t\tr.References[\"transit_gateway_id\"] = config.Reference{\n\t\t\tType: \"TransitGateway\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_vpc_attachment_accepter\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_launch_template\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"security_group_names\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupNameRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupNameSelector\",\n\t\t}\n\t\tr.References[\"vpc_security_group_ids\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\n\t\t\tRefFieldName: \"VpcSecurityGroupIdRefs\",\n\t\t\tSelectorFieldName: \"VpcSecurityGroupIdSelector\",\n\t\t}\n\t\tr.References[\"block_device_mappings.ebs.kms_key_id\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2.Key\",\n\t\t}\n\t\tr.References[\"iam_instance_profile.arn\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/iam/v1alpha2.InstanceProfile\",\n\t\t\tExtractor: common.PathARNExtractor,\n\t\t}\n\t\tr.References[\"iam_instance_profile.name\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/iam/v1alpha2.InstanceProfile\",\n\t\t}\n\t\tr.References[\"network_interfaces.network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"network_interfaces.security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"network_interfaces.subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc_endpoint\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_ids\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t\tRefFieldName: \"SubnetIdRefs\",\n\t\t\tSelectorFieldName: \"SubnetIdSelector\",\n\t\t}\n\t\tr.References[\"security_group_ids\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupIdRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupIdSelector\",\n\t\t}\n\t\tr.References[\"route_table_ids\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t\tRefFieldName: \"RouteTableIdRefs\",\n\t\t\tSelectorFieldName: \"RouteTableIdSelector\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_subnet\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.LateInitializer = config.LateInitializer{\n\t\t\t// NOTE(muvaf): Conflicts with AvailabilityZone. See the following\n\t\t\t// for more details: https://github.com/crossplane/terrajet/issues/107\n\t\t\tIgnoredFields: []string{\n\t\t\t\t\"availability_zone_id\",\n\t\t\t},\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_network_interface\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t\tr.References[\"security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"attachment.instance\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t\tr.LateInitializer = config.LateInitializer{\n\t\t\tIgnoredFields: []string{\n\t\t\t\t\"interface_type\",\n\t\t\t},\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_security_group\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\t// Managed by SecurityGroupRule resource.\n\t\tif s, ok := r.TerraformResource.Schema[\"ingress\"]; ok {\n\t\t\ts.Optional = false\n\t\t\ts.Computed = true\n\t\t}\n\t\t// Managed by SecurityGroupRule resource.\n\t\tif s, ok := r.TerraformResource.Schema[\"egress\"]; ok {\n\t\t\ts.Optional = false\n\t\t\ts.Computed = true\n\t\t}\n\t\tr.References[\"egress.security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"ingress.security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_security_group_rule\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"security_group_id\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t}\n\t\tr.References[\"source_security_group_id\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc_ipv4_cidr_block_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc_peering_connection\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"peer_vpc_id\"] = config.Reference{\n\t\t\tType: \"VPC\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_route\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"route_table_id\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t}\n\t\tr.References[\"gateway_id\"] = config.Reference{\n\t\t\tType: \"InternetGateway\",\n\t\t}\n\t\tr.References[\"instance_id\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t\tr.References[\"network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"transit_gateway_id\"] = config.Reference{\n\t\t\tType: \"TransitGateway\",\n\t\t}\n\t\tr.References[\"vpc_peering_connection_id\"] = config.Reference{\n\t\t\tType: \"VPCPeeringConnection\",\n\t\t}\n\t\tr.References[\"vpc_endpoint_id\"] = config.Reference{\n\t\t\tType: \"VPCEndpoint\",\n\t\t}\n\t\tr.UseAsync = true\n\t})\n\n\tp.AddResourceConfigurator(\"aws_route_table\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"route.vpc_peering_connection_id\"] = config.Reference{\n\t\t\tType: \"VPCPeeringConnection\",\n\t\t}\n\t\tr.References[\"route.vpc_endpoint_id\"] = config.Reference{\n\t\t\tType: \"VPCEndpoint\",\n\t\t}\n\t\tr.References[\"route.network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"route.instance_id\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_route_table_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t\tr.References[\"route_table_id\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_main_route_table_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"route_table_id\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route_table_propagation\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t\tr.References[\"transit_gateway_route_table_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayRouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_internet_gateway\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"credentials\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"GOOGLE_CREDENTIALS\",\n\t\t\t\t\t\"GOOGLE_CLOUD_KEYFILE_JSON\",\n\t\t\t\t\t\"GCLOUD_KEYFILE_JSON\",\n\t\t\t\t}, nil),\n\t\t\t\tValidateFunc: validateCredentials,\n\t\t\t},\n\n\t\t\t\"access_token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"GOOGLE_OAUTH_ACCESS_TOKEN\",\n\t\t\t\t}, nil),\n\t\t\t\tConflictsWith: []string{\"credentials\"},\n\t\t\t},\n\n\t\t\t\"project\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"GOOGLE_PROJECT\",\n\t\t\t\t\t\"GOOGLE_CLOUD_PROJECT\",\n\t\t\t\t\t\"GCLOUD_PROJECT\",\n\t\t\t\t\t\"CLOUDSDK_CORE_PROJECT\",\n\t\t\t\t}, nil),\n\t\t\t},\n\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"GOOGLE_REGION\",\n\t\t\t\t\t\"GCLOUD_REGION\",\n\t\t\t\t\t\"CLOUDSDK_COMPUTE_REGION\",\n\t\t\t\t}, nil),\n\t\t\t},\n\n\t\t\t\"zone\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"GOOGLE_ZONE\",\n\t\t\t\t\t\"GCLOUD_ZONE\",\n\t\t\t\t\t\"CLOUDSDK_COMPUTE_ZONE\",\n\t\t\t\t}, nil),\n\t\t\t},\n\t\t\t\"scopes\": {\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Schema{Type: schema.TypeString},\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"google_active_folder\": dataSourceGoogleActiveFolder(),\n\t\t\t\"google_billing_account\": dataSourceGoogleBillingAccount(),\n\t\t\t\"google_dns_managed_zone\": dataSourceDnsManagedZone(),\n\t\t\t\"google_client_config\": dataSourceGoogleClientConfig(),\n\t\t\t\"google_cloudfunctions_function\": dataSourceGoogleCloudFunctionsFunction(),\n\t\t\t\"google_compute_address\": dataSourceGoogleComputeAddress(),\n\t\t\t\"google_compute_backend_service\": dataSourceGoogleComputeBackendService(),\n\t\t\t\"google_compute_default_service_account\": dataSourceGoogleComputeDefaultServiceAccount(),\n\t\t\t\"google_compute_forwarding_rule\": dataSourceGoogleComputeForwardingRule(),\n\t\t\t\"google_compute_image\": dataSourceGoogleComputeImage(),\n\t\t\t\"google_compute_instance\": dataSourceGoogleComputeInstance(),\n\t\t\t\"google_compute_global_address\": dataSourceGoogleComputeGlobalAddress(),\n\t\t\t\"google_compute_instance_group\": dataSourceGoogleComputeInstanceGroup(),\n\t\t\t\"google_compute_lb_ip_ranges\": dataSourceGoogleComputeLbIpRanges(),\n\t\t\t\"google_compute_network\": dataSourceGoogleComputeNetwork(),\n\t\t\t\"google_compute_regions\": dataSourceGoogleComputeRegions(),\n\t\t\t\"google_compute_region_instance_group\": dataSourceGoogleComputeRegionInstanceGroup(),\n\t\t\t\"google_compute_subnetwork\": dataSourceGoogleComputeSubnetwork(),\n\t\t\t\"google_compute_zones\": dataSourceGoogleComputeZones(),\n\t\t\t\"google_compute_vpn_gateway\": dataSourceGoogleComputeVpnGateway(),\n\t\t\t\"google_compute_ssl_policy\": dataSourceGoogleComputeSslPolicy(),\n\t\t\t\"google_container_cluster\": dataSourceGoogleContainerCluster(),\n\t\t\t\"google_container_engine_versions\": dataSourceGoogleContainerEngineVersions(),\n\t\t\t\"google_container_registry_repository\": dataSourceGoogleContainerRepo(),\n\t\t\t\"google_container_registry_image\": dataSourceGoogleContainerImage(),\n\t\t\t\"google_iam_policy\": dataSourceGoogleIamPolicy(),\n\t\t\t\"google_iam_role\": dataSourceGoogleIamRole(),\n\t\t\t\"google_kms_secret\": dataSourceGoogleKmsSecret(),\n\t\t\t\"google_kms_key_ring\": dataSourceGoogleKmsKeyRing(),\n\t\t\t\"google_kms_crypto_key\": dataSourceGoogleKmsCryptoKey(),\n\t\t\t\"google_folder\": dataSourceGoogleFolder(),\n\t\t\t\"google_netblock_ip_ranges\": dataSourceGoogleNetblockIpRanges(),\n\t\t\t\"google_organization\": dataSourceGoogleOrganization(),\n\t\t\t\"google_project\": dataSourceGoogleProject(),\n\t\t\t\"google_project_services\": dataSourceGoogleProjectServices(),\n\t\t\t\"google_service_account\": dataSourceGoogleServiceAccount(),\n\t\t\t\"google_service_account_key\": dataSourceGoogleServiceAccountKey(),\n\t\t\t\"google_storage_bucket_object\": dataSourceGoogleStorageBucketObject(),\n\t\t\t\"google_storage_object_signed_url\": dataSourceGoogleSignedUrl(),\n\t\t\t\"google_storage_project_service_account\": dataSourceGoogleStorageProjectServiceAccount(),\n\t\t\t\"google_storage_transfer_project_service_account\": dataSourceGoogleStorageTransferProjectServiceAccount(),\n\t\t},\n\n\t\tResourcesMap: ResourceMap(),\n\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func newAWSCommand() *cobra.Command {\n\tvar (\n\t\tclusterName string\n\t\troleARN string\n\t)\n\tvar command = &cobra.Command{\n\t\tUse: \"aws\",\n\t\tRun: func(c *cobra.Command, args []string) {\n\t\t\tctx := c.Context()\n\n\t\t\tpresignedURLString, err := getSignedRequestWithRetry(ctx, time.Minute, 5*time.Second, clusterName, roleARN, getSignedRequest)\n\t\t\terrors.CheckError(err)\n\t\t\ttoken := v1Prefix + base64.RawURLEncoding.EncodeToString([]byte(presignedURLString))\n\t\t\t// Set token expiration to 1 minute before the presigned URL expires for some cushion\n\t\t\ttokenExpiration := time.Now().Local().Add(presignedURLExpiration - 1*time.Minute)\n\t\t\t_, _ = fmt.Fprint(os.Stdout, formatJSON(token, tokenExpiration))\n\t\t},\n\t}\n\tcommand.Flags().StringVar(&clusterName, \"cluster-name\", \"\", \"AWS Cluster name\")\n\tcommand.Flags().StringVar(&roleARN, \"role-arn\", \"\", \"AWS Role ARN\")\n\treturn command\n}", "func initAwsClient() aws.Client {\n\treturn aws.NewClient(\"elastisys-billing-data\")\n}", "func NewDNSProvider(accessKeyID, secretAccessKey, hostedZoneID, region string, ambient bool, dns01Nameservers []string) (*DNSProvider, error) {\n\tif accessKeyID == \"\" && secretAccessKey == \"\" {\n\t\tif !ambient {\n\t\t\treturn nil, fmt.Errorf(\"unable to construct route53 provider: empty credentials; perhaps you meant to enable ambient credentials?\")\n\t\t}\n\t} else if accessKeyID == \"\" || secretAccessKey == \"\" {\n\t\t// It's always an error to set one of those but not the other\n\t\treturn nil, fmt.Errorf(\"unable to construct route53 provider: only one of access and secret key was provided\")\n\t}\n\n\tuseAmbientCredentials := ambient && (accessKeyID == \"\" && secretAccessKey == \"\")\n\n\tr := customRetryer{}\n\tr.NumMaxRetries = maxRetries\n\tconfig := request.WithRetryer(aws.NewConfig(), r)\n\tsessionOpts := session.Options{}\n\n\tif useAmbientCredentials {\n\t\tklog.V(5).Infof(\"using ambient credentials\")\n\t\t// Leaving credentials unset results in a default credential chain being\n\t\t// used; this chain is a reasonable default for getting ambient creds.\n\t\t// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials\n\t} else {\n\t\tklog.V(5).Infof(\"not using ambient credentials\")\n\t\tconfig.WithCredentials(credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"))\n\t\t// also disable 'ambient' region sources\n\t\tsessionOpts.SharedConfigState = session.SharedConfigDisable\n\t}\n\n\t// If ambient credentials aren't permitted, always set the region, even if to\n\t// empty string, to avoid it falling back on the environment.\n\tif region != \"\" || !useAmbientCredentials {\n\t\tconfig.WithRegion(region)\n\t}\n\tsess, err := session.NewSessionWithOptions(sessionOpts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create aws session: %s\", err)\n\t}\n\tsess.Handlers.Build.PushBack(request.WithAppendUserAgent(pkgutil.CertManagerUserAgent))\n\tclient := route53.New(sess, config)\n\n\treturn &DNSProvider{\n\t\tclient: client,\n\t\thostedZoneID: hostedZoneID,\n\t\tdns01Nameservers: dns01Nameservers,\n\t}, nil\n}", "func newProviderImpl(name string) (Provider, error) {\n\tif name == LOCAL {\n\t\treturn &LocalProvider{}, nil\n\t}\n\n\tif name == AWS {\n\t\treturn &AwsProvider{}, nil\n\t}\n\n\treturn nil, errors.New(fmt.Sprintf(\"Provider '%s' doesn't exist\", name))\n}", "func NewAWSCollection(c *config.Config) []*AWS {\n\tvar awsInstances []*AWS\n\tfor _, aws := range c.AWS {\n\t\tfor _, bucket := range aws.S3 {\n\t\t\tif awsInstance := NewAWS(aws, bucket, c.Provider.NoLocks, c.Provider.NoVersioning); awsInstance != nil {\n\t\t\t\tawsInstances = append(awsInstances, awsInstance)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn awsInstances\n}", "func GetAwsSession(cfg config.ServerConfig) (*session.Session, error) {\n\tvar providers []credentials.Provider\n\n\tcustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) {\n\t\tif service == endpoints.RdsServiceID && cfg.AwsEndpointRdsURL != \"\" {\n\t\t\treturn endpoints.ResolvedEndpoint{\n\t\t\t\tURL: cfg.AwsEndpointRdsURL,\n\t\t\t\tSigningRegion: cfg.AwsEndpointSigningRegion,\n\t\t\t}, nil\n\t\t}\n\t\tif service == endpoints.Ec2ServiceID && cfg.AwsEndpointEc2URL != \"\" {\n\t\t\treturn endpoints.ResolvedEndpoint{\n\t\t\t\tURL: cfg.AwsEndpointEc2URL,\n\t\t\t\tSigningRegion: cfg.AwsEndpointSigningRegion,\n\t\t\t}, nil\n\t\t}\n\t\tif service == endpoints.MonitoringServiceID && cfg.AwsEndpointCloudwatchURL != \"\" {\n\t\t\treturn endpoints.ResolvedEndpoint{\n\t\t\t\tURL: cfg.AwsEndpointCloudwatchURL,\n\t\t\t\tSigningRegion: cfg.AwsEndpointSigningRegion,\n\t\t\t}, nil\n\t\t}\n\t\tif service == endpoints.LogsServiceID && cfg.AwsEndpointCloudwatchLogsURL != \"\" {\n\t\t\treturn endpoints.ResolvedEndpoint{\n\t\t\t\tURL: cfg.AwsEndpointCloudwatchLogsURL,\n\t\t\t\tSigningRegion: cfg.AwsEndpointSigningRegion,\n\t\t\t}, nil\n\t\t}\n\n\t\treturn endpoints.DefaultResolver().EndpointFor(service, region, optFns...)\n\t}\n\n\tif cfg.AwsAccessKeyID != \"\" {\n\t\tproviders = append(providers, &credentials.StaticProvider{\n\t\t\tValue: credentials.Value{\n\t\t\t\tAccessKeyID: cfg.AwsAccessKeyID,\n\t\t\t\tSecretAccessKey: cfg.AwsSecretAccessKey,\n\t\t\t\tSessionToken: \"\",\n\t\t\t},\n\t\t})\n\t}\n\n\t// add default providers\n\tproviders = append(providers, &credentials.EnvProvider{})\n\tproviders = append(providers, &credentials.SharedCredentialsProvider{Filename: \"\", Profile: \"\"})\n\n\t// add the metadata service\n\tdef := defaults.Get()\n\tdef.Config.HTTPClient = config.CreateEC2IMDSHTTPClient(cfg)\n\tdef.Config.MaxRetries = aws.Int(2)\n\tproviders = append(providers, defaults.RemoteCredProvider(*def.Config, def.Handlers))\n\n\tcreds := credentials.NewChainCredentials(providers)\n\n\tif cfg.AwsAssumeRole != \"\" || (cfg.AwsWebIdentityTokenFile != \"\" && cfg.AwsRoleArn != \"\") {\n\t\tsess, err := session.NewSession(&aws.Config{\n\t\t\tCredentials: creds,\n\t\t\tCredentialsChainVerboseErrors: aws.Bool(true),\n\t\t\tRegion: aws.String(cfg.AwsRegion),\n\t\t\tHTTPClient: cfg.HTTPClient,\n\t\t\tEndpointResolver: endpoints.ResolverFunc(customResolver),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif cfg.AwsAssumeRole != \"\" {\n\t\t\tcreds = stscreds.NewCredentials(sess, cfg.AwsAssumeRole)\n\t\t} else if cfg.AwsWebIdentityTokenFile != \"\" && cfg.AwsRoleArn != \"\" {\n\t\t\tcreds = stscreds.NewWebIdentityCredentials(sess, cfg.AwsRoleArn, \"\", cfg.AwsWebIdentityTokenFile)\n\t\t}\n\t}\n\n\treturn session.NewSession(&aws.Config{\n\t\tCredentials: creds,\n\t\tCredentialsChainVerboseErrors: aws.Bool(true),\n\t\tRegion: aws.String(cfg.AwsRegion),\n\t\tHTTPClient: cfg.HTTPClient,\n\t\tEndpointResolver: endpoints.ResolverFunc(customResolver),\n\t})\n}", "func NewEnvProvider() *EnvProvider {\n\treturn &EnvProvider{\n\t\t// AwsAccessKeyIDEnv is the environment variable for AWS_ACCESS_KEY_ID\n\t\tAwsAccessKeyIDEnv: EnvVar(\"AWS_ACCESS_KEY_ID\"),\n\t\t// AwsSecretAccessKeyEnv is the environment variable for AWS_SECRET_ACCESS_KEY\n\t\tAwsSecretAccessKeyEnv: EnvVar(\"AWS_SECRET_ACCESS_KEY\"),\n\t\t// AwsSessionTokenEnv is the environment variable for AWS_SESSION_TOKEN\n\t\tAwsSessionTokenEnv: EnvVar(\"AWS_SESSION_TOKEN\"),\n\t}\n}", "func awsFormatRegion(r *string) aws.Region {\n\tvar region aws.Region\n\tswitch *r {\n\tcase \"us-gov-west-1\":\n\t\tregion = aws.USGovWest\n\tcase \"us-east-1\":\n\t\tregion = aws.USEast\n\tcase \"us-west-1\":\n\t\tregion = aws.USWest\n\tcase \"us-west-2\":\n\t\tregion = aws.USWest2\n\tcase \"eu-west-1\":\n\t\tregion = aws.EUWest\n\tcase \"ap-southeast-1\":\n\t\tregion = aws.APSoutheast\n\tcase \"ap-southeast-2\":\n\t\tregion = aws.APSoutheast2\n\tcase \"ap-northeast-1\":\n\t\tregion = aws.APNortheast\n\tcase \"sa-east-1\":\n\t\tregion = aws.SAEast\n\tcase \"\":\n\t\tregion = aws.USEast\n\tdefault:\n\t\tlog.Fatalf(\"Invalid Region: %s\\n\", *r)\n\t}\n\treturn region\n}", "func InitAWS() error {\n\tsession, err := session.NewSession(&aws.Config{\n\t\tRegion: aws.String(config.GetConfig().GetString(\"aws.s3_region\")),\n\t\tCredentials: credentials.NewStaticCredentials(\n\t\t\tconfig.GetConfig().GetString(\"aws.access_key_id\"),\n\t\t\tconfig.GetConfig().GetString(\"aws.secret_access_key\"),\n\t\t\t\"\"),\n\t})\n\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to create aws session, error: %v\", err)\n\t\treturn err\n\t}\n\n\tawsSession = session\n\n\treturn nil\n}", "func NewAWS(zones []string, dnsfilters []string, delay time.Duration) (khostdns.DNSSetter, error) {\n\tlog.Info(\"Creating new AWS DNSSetter\")\n\tsess, err := session.NewSession(&aws.Config{Region: aws.String(\"us-east-1\")})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr53 := route53.New(sess)\n\tad := &AWSData{\n\t\tzones: zones,\n\t\tdnsfilters: khostdns.CreateDNSFilter(dnsfilters),\n\t\tdelay: delay,\n\t\tnotifyChannel: make(chan khostdns.Arecord),\n\t\thostChange: make(chan khostdns.Arecord),\n\t\tforceUpdate: make(chan bool),\n\t\tsession: sess,\n\t\tr53: r53,\n\t\trunning: false,\n\t}\n\tm, err := ad.getAWSZoneNames()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor awsZ, name := range m {\n\t\tfor _, zid := range ad.zones {\n\t\t\tif zid == awsZ {\n\t\t\t\tad.zoneNames.Store(zid, name)\n\t\t\t\tlog.Info(\"found zone, {}:{}\", awsZ, name)\n\t\t\t}\n\t\t}\n\t}\n\tad.running = true\n\n\tgo ad.loop()\n\treturn ad, nil\n}", "func newAWSFetcher(cfg awsFetcherConfig, plugin awsFetcherPlugin) (*awsFetcher, error) {\n\tif err := cfg.CheckAndSetDefaults(plugin.ComponentShortName()); err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\treturn &awsFetcher{cfg: cfg, plugin: plugin}, nil\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"apikey\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"NS1_APIKEY\", nil),\n\t\t\t\tDescription: descriptions[\"api_key\"],\n\t\t\t},\n\t\t\t\"endpoint\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"NS1_ENDPOINT\", nil),\n\t\t\t\tDescription: descriptions[\"endpoint\"],\n\t\t\t},\n\t\t\t\"ignore_ssl\": &schema.Schema{\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"NS1_IGNORE_SSL\", nil),\n\t\t\t\tDescription: descriptions[\"ignore_ssl\"],\n\t\t\t},\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"ns1_zone\": zoneResource(),\n\t\t\t\"ns1_record\": recordResource(),\n\t\t\t\"ns1_datasource\": dataSourceResource(),\n\t\t\t\"ns1_datafeed\": dataFeedResource(),\n\t\t\t\"ns1_monitoringjob\": monitoringJobResource(),\n\t\t\t\"ns1_notifylist\": notifyListResource(),\n\t\t\t\"ns1_user\": userResource(),\n\t\t\t\"ns1_apikey\": apikeyResource(),\n\t\t\t\"ns1_team\": teamResource(),\n\t\t},\n\t\tConfigureFunc: ns1Configure,\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"url\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"APPGATE_ADDRESS\", \"\"),\n\t\t\t},\n\t\t\t\"username\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"APPGATE_USERNAME\", \"\"),\n\t\t\t},\n\t\t\t\"password\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"APPGATE_PASSWORD\", \"\"),\n\t\t\t},\n\t\t\t\"provider\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"APPGATE_PROVIDER\", \"local\"),\n\t\t\t},\n\t\t\t\"insecure\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"APPGATE_INSECURE\", true),\n\t\t\t},\n\t\t\t\"debug\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"APPGATE_HTTP_DEBUG\", false),\n\t\t\t},\n\t\t},\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"appgate_appliance\": dataSourceAppgateAppliance(),\n\t\t\t\"appgate_entitlement\": dataSourceAppgateEntitlement(),\n\t\t\t\"appgate_site\": dataSourceAppgateSite(),\n\t\t\t\"appgate_condition\": dataSourceAppgateCondition(),\n\t\t\t\"appgate_policy\": dataSourceAppgatePolicy(),\n\t\t\t\"appgate_ringfence_rule\": dataSourceAppgateRingfenceRule(),\n\t\t\t\"appgate_criteria_script\": dataSourceCriteriaScript(),\n\t\t\t\"appgate_entitlement_script\": dataSourceEntitlementScript(),\n\t\t\t\"appgate_device_script\": dataSourceDeviceScript(),\n\t\t\t\"appgate_appliance_customization\": dataSourceAppgateApplianceCustomization(),\n\t\t\t\"appgate_ip_pool\": dataSourceAppgateIPPool(),\n\t\t\t\"appgate_administrative_role\": dataSourceAppgateAdministrativeRole(),\n\t\t\t\"appgate_global_settings\": dataSourceGlobalSettings(),\n\t\t\t\"appgate_trusted_certificate\": dataSourceAppgateTrustedCertificate(),\n\t\t\t\"appgate_mfa_provider\": dataSourceAppgateMfaProvider(),\n\t\t\t\"appgate_local_user\": dataSourceAppgateLocalUser(),\n\t\t\t\"appgate_identity_provider\": dataSourceAppgateIdentityProvider(),\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"appgate_appliance\": resourceAppgateAppliance(),\n\t\t\t\"appgate_entitlement\": resourceAppgateEntitlement(),\n\t\t\t\"appgate_site\": resourceAppgateSite(),\n\t\t\t\"appgate_ringfence_rule\": resourceAppgateRingfenceRule(),\n\t\t\t\"appgate_condition\": resourceAppgateCondition(),\n\t\t\t\"appgate_policy\": resourceAppgatePolicy(),\n\t\t\t\"appgate_criteria_script\": resourceAppgateCriteriaScript(),\n\t\t\t\"appgate_entitlement_script\": resourceAppgateEntitlementScript(),\n\t\t\t\"appgate_device_script\": resourceAppgateDeviceScript(),\n\t\t\t\"appgate_appliance_customization\": resourceAppgateApplianceCustomizations(),\n\t\t\t\"appgate_ip_pool\": resourceAppgateIPPool(),\n\t\t\t\"appgate_administrative_role\": resourceAppgateAdministrativeRole(),\n\t\t\t\"appgate_global_settings\": resourceGlobalSettings(),\n\t\t\t\"appgate_ldap_identity_provider\": resourceAppgateLdapProvider(),\n\t\t\t\"appgate_trusted_certificate\": resourceAppgateTrustedCertificate(),\n\t\t\t\"appgate_mfa_provider\": resourceAppgateMfaProvider(),\n\t\t\t\"appgate_local_user\": resourceAppgateLocalUser(),\n\t\t\t\"appgate_license\": resourceAppgateLicense(),\n\t\t\t\"appgate_admin_mfa_settings\": resourceAdminMfaSettings(),\n\t\t\t\"appgate_client_connections\": resourceClientConnections(),\n\t\t\t\"appgate_blacklist_user\": resourceAppgateBlacklistUser(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func Provider() *schema.Provider {\n\tprovider := &schema.Provider{\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"ucodecov_settings\": dataSourceCodecovSettings(),\n\t\t},\n\t}\n\treturn provider\n}", "func (provider AWSProvider) GetServers(providerOptions map[string]string, logger *log.Logger) ([]string, error) {\n\n\t// Initialise Discover struct from go-discover\n\tdiscoverer := discover.Discover{\n\t\tProviders : map[string]discover.Provider{\n\t\t\t\"aws\": discover.Providers[\"aws\"],\n\t\t},\n\t}\n\n\t// Discard logs if loggger is not set\n\tif logger == nil {\n\t\tlogger = log.New(ioutil.Discard, \"\", log.LstdFlags)\n\t}\n\n\t// Create the constraint list for discovering AWS instances\n\tcfg := fmt.Sprintf(\"provider=aws region=%s access_key_id=%s secret_access_key=%s addr_type=%s tag_key=%s tag_value=%s\", providerOptions[\"region\"], providerOptions[\"accessKeyId\"], providerOptions[\"secretAccessKey\"], providerOptions[\"addrType\"], providerOptions[\"tagKey\"], providerOptions[\"tagValue\"])\n\tserverIps, err := discoverer.Addrs(cfg, logger)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn serverIps, nil\n}", "func init() {\n\tauth, err := aws.EnvAuth()\n\tif err != nil {\n\t\trev.ERROR.Fatalln(`AWS Authorization Required.\nPlease set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.`)\n\t}\n\tPHOTO_BUCKET = s3.New(auth, aws.USEast).Bucket(\"photoboard\")\n}", "func Init(configPath ...string) {\n\tmgr = newAwsMgr(configPath...)\n}", "func (aws *awsCloudProvider) Name() string {\n\treturn ProviderName\n}", "func providerExtract(provider string) error {\n\tklog.Infof(\"extracting cloud provider name to %v\", openshiftTunedProvider)\n\n\tf, err := os.Create(openshiftTunedProvider)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create cloud provider name file %q: %v\", openshiftTunedProvider, err)\n\t}\n\tdefer f.Close()\n\tif _, err = f.WriteString(provider); err != nil {\n\t\treturn fmt.Errorf(\"failed to write cloud provider name file %q: %v\", openshiftTunedProvider, err)\n\t}\n\n\treturn nil\n}", "func getAWSRegion(s3Bucket string, config *aws.Config, settings map[string]string) (string, error) {\n\tif region, ok := settings[RegionSetting]; ok {\n\t\treturn region, nil\n\t}\n\tif config.Endpoint == nil ||\n\t\t*config.Endpoint == \"\" ||\n\t\tstrings.HasSuffix(*config.Endpoint, \".amazonaws.com\") {\n\t\tregion, err := findBucketRegion(s3Bucket, config)\n\t\treturn region, errors.Wrapf(err, \"%s is not set and s3:GetBucketLocation failed\", RegionSetting)\n\t} else {\n\t\t// For S3 compatible services like Minio, Ceph etc. use `us-east-1` as region\n\t\t// ref: https://github.com/minio/cookbook/blob/master/docs/aws-sdk-for-go-with-minio.md\n\t\treturn \"us-east-1\", nil\n\t}\n}", "func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\tfunctionName := d.Get(\"function_name\").(string)\n\treservedConcurrentExecutions := d.Get(\"reserved_concurrent_executions\").(int)\n\tiamRole := d.Get(\"role\").(string)\n\n\tlog.Printf(\"[DEBUG] Creating Lambda Function %s with role %s\", functionName, iamRole)\n\n\tfilename, hasFilename := d.GetOk(\"filename\")\n\ts3Bucket, bucketOk := d.GetOk(\"s3_bucket\")\n\ts3Key, keyOk := d.GetOk(\"s3_key\")\n\ts3ObjectVersion, versionOk := d.GetOk(\"s3_object_version\")\n\n\tif !hasFilename && !bucketOk && !keyOk && !versionOk {\n\t\treturn errors.New(\"filename or s3_* attributes must be set\")\n\t}\n\n\tvar functionCode *lambda.FunctionCode\n\tif hasFilename {\n\t\t// Grab an exclusive lock so that we're only reading one function into\n\t\t// memory at a time.\n\t\t// See https://github.com/hashicorp/terraform/issues/9364\n\t\tawsMutexKV.Lock(awsMutexLambdaKey)\n\t\tdefer awsMutexKV.Unlock(awsMutexLambdaKey)\n\t\tfile, err := loadFileContent(filename.(string))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to load %q: %s\", filename.(string), err)\n\t\t}\n\t\tfunctionCode = &lambda.FunctionCode{\n\t\t\tZipFile: file,\n\t\t}\n\t} else {\n\t\tif !bucketOk || !keyOk {\n\t\t\treturn errors.New(\"s3_bucket and s3_key must all be set while using S3 code source\")\n\t\t}\n\t\tfunctionCode = &lambda.FunctionCode{\n\t\t\tS3Bucket: aws.String(s3Bucket.(string)),\n\t\t\tS3Key: aws.String(s3Key.(string)),\n\t\t}\n\t\tif versionOk {\n\t\t\tfunctionCode.S3ObjectVersion = aws.String(s3ObjectVersion.(string))\n\t\t}\n\t}\n\n\tparams := &lambda.CreateFunctionInput{\n\t\tCode: functionCode,\n\t\tDescription: aws.String(d.Get(\"description\").(string)),\n\t\tFunctionName: aws.String(functionName),\n\t\tHandler: aws.String(d.Get(\"handler\").(string)),\n\t\tMemorySize: aws.Int64(int64(d.Get(\"memory_size\").(int))),\n\t\tRole: aws.String(iamRole),\n\t\tRuntime: aws.String(d.Get(\"runtime\").(string)),\n\t\tTimeout: aws.Int64(int64(d.Get(\"timeout\").(int))),\n\t\tPublish: aws.Bool(d.Get(\"publish\").(bool)),\n\t}\n\n\tif v, ok := d.GetOk(\"dead_letter_config\"); ok {\n\t\tdlcMaps := v.([]interface{})\n\t\tif len(dlcMaps) == 1 { // Schema guarantees either 0 or 1\n\t\t\t// Prevent panic on nil dead_letter_config. See GH-14961\n\t\t\tif dlcMaps[0] == nil {\n\t\t\t\treturn fmt.Errorf(\"Nil dead_letter_config supplied for function: %s\", functionName)\n\t\t\t}\n\t\t\tdlcMap := dlcMaps[0].(map[string]interface{})\n\t\t\tparams.DeadLetterConfig = &lambda.DeadLetterConfig{\n\t\t\t\tTargetArn: aws.String(dlcMap[\"target_arn\"].(string)),\n\t\t\t}\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"vpc_config\"); ok {\n\n\t\tconfigs := v.([]interface{})\n\t\tconfig, ok := configs[0].(map[string]interface{})\n\n\t\tif !ok {\n\t\t\treturn errors.New(\"vpc_config is <nil>\")\n\t\t}\n\n\t\tif config != nil {\n\t\t\tvar subnetIds []*string\n\t\t\tfor _, id := range config[\"subnet_ids\"].(*schema.Set).List() {\n\t\t\t\tsubnetIds = append(subnetIds, aws.String(id.(string)))\n\t\t\t}\n\n\t\t\tvar securityGroupIds []*string\n\t\t\tfor _, id := range config[\"security_group_ids\"].(*schema.Set).List() {\n\t\t\t\tsecurityGroupIds = append(securityGroupIds, aws.String(id.(string)))\n\t\t\t}\n\n\t\t\tparams.VpcConfig = &lambda.VpcConfig{\n\t\t\t\tSubnetIds: subnetIds,\n\t\t\t\tSecurityGroupIds: securityGroupIds,\n\t\t\t}\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"tracing_config\"); ok {\n\t\ttracingConfig := v.([]interface{})\n\t\ttracing := tracingConfig[0].(map[string]interface{})\n\t\tparams.TracingConfig = &lambda.TracingConfig{\n\t\t\tMode: aws.String(tracing[\"mode\"].(string)),\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"environment\"); ok {\n\t\tenvironments := v.([]interface{})\n\t\tenvironment, ok := environments[0].(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn errors.New(\"At least one field is expected inside environment\")\n\t\t}\n\n\t\tif environmentVariables, ok := environment[\"variables\"]; ok {\n\t\t\tvariables := readEnvironmentVariables(environmentVariables.(map[string]interface{}))\n\n\t\t\tparams.Environment = &lambda.Environment{\n\t\t\t\tVariables: aws.StringMap(variables),\n\t\t\t}\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"kms_key_arn\"); ok {\n\t\tparams.KMSKeyArn = aws.String(v.(string))\n\t}\n\n\tif v, exists := d.GetOk(\"tags\"); exists {\n\t\tparams.Tags = tagsFromMapGeneric(v.(map[string]interface{}))\n\t}\n\n\t// IAM profiles can take ~10 seconds to propagate in AWS:\n\t// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console\n\t// Error creating Lambda function: InvalidParameterValueException: The role defined for the task cannot be assumed by Lambda.\n\terr := resource.Retry(10*time.Minute, func() *resource.RetryError {\n\t\t_, err := conn.CreateFunction(params)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"[DEBUG] Error creating Lambda Function: %s\", err)\n\n\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"The role defined for the function cannot be assumed by Lambda\") {\n\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying CreateFunction\", err)\n\t\t\t\treturn resource.RetryableError(err)\n\t\t\t}\n\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"The provided execution role does not have permissions\") {\n\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying CreateFunction\", err)\n\t\t\t\treturn resource.RetryableError(err)\n\t\t\t}\n\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"Your request has been throttled by EC2\") {\n\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying CreateFunction\", err)\n\t\t\t\treturn resource.RetryableError(err)\n\t\t\t}\n\n\t\t\treturn resource.NonRetryableError(err)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error creating Lambda function: %s\", err)\n\t}\n\n\tif reservedConcurrentExecutions > 0 {\n\n\t\tlog.Printf(\"[DEBUG] Setting Concurrency to %d for the Lambda Function %s\", reservedConcurrentExecutions, functionName)\n\n\t\tconcurrencyParams := &lambda.PutFunctionConcurrencyInput{\n\t\t\tFunctionName: aws.String(functionName),\n\t\t\tReservedConcurrentExecutions: aws.Int64(int64(reservedConcurrentExecutions)),\n\t\t}\n\n\t\t_, err := conn.PutFunctionConcurrency(concurrencyParams)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error setting concurrency for Lambda %s: %s\", functionName, err)\n\t\t}\n\t}\n\n\td.SetId(d.Get(\"function_name\").(string))\n\n\treturn resourceAwsLambdaFunctionRead(d, meta)\n}", "func samlProviderUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error {\n\toldTags := tftags.New(oldTagsMap)\n\tnewTags := tftags.New(newTagsMap)\n\n\tif removedTags := oldTags.Removed(newTags); len(removedTags) > 0 {\n\t\tinput := &iam.UntagSAMLProviderInput{\n\t\t\tSAMLProviderArn: aws.String(identifier),\n\t\t\tTagKeys: aws.StringSlice(removedTags.Keys()),\n\t\t}\n\n\t\t_, err := conn.UntagSAMLProvider(input)\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error untagging resource (%s): %w\", identifier, err)\n\t\t}\n\t}\n\n\tif updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 {\n\t\tinput := &iam.TagSAMLProviderInput{\n\t\t\tSAMLProviderArn: aws.String(identifier),\n\t\t\tTags: Tags(updatedTags.IgnoreAWS()),\n\t\t}\n\n\t\t_, err := conn.TagSAMLProvider(input)\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error tagging resource (%s): %w\", identifier, err)\n\t\t}\n\t}\n\n\treturn nil\n}", "func NewProvider(region string, profile string) (*clusterProvider, error) {\n\tsession, err := session.NewAwsSession(profile, region)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error obtaining a valid AWS session\")\n\t}\n\n\tservices := providerServices{}\n\n\tec2Options, err := ec2.NewEC2APIHandler(session)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error initializing the EC2 API\")\n\t}\n\tservices.ec2 = ec2Options\n\n\teksOptions, err := eks.NewEKSAPIHandler(session)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error initializing the EKS API\")\n\t}\n\tservices.eks = eksOptions\n\n\tservices.eksctl = eksctl.NewEksctlClient()\n\n\tservices.cli = awscli.NewAWSCli()\n\n\tprovider := &clusterProvider{\n\t\tproviderServices: services,\n\t\tRegion: region,\n\t\tProfile: profile,\n\t}\n\treturn provider, nil\n}", "func getAWSClient(ctx context.Context, conf *config.Config, sess *session.Session, region config.Region) (*cziAWS.Client, error) {\n\t// for things meant to be run as a user\n\tuserConf := &aws.Config{\n\t\tRegion: aws.String(region.AWSRegion),\n\t}\n\n\tlambdaConf := userConf\n\tif conf.LambdaConfig.RoleARN != nil {\n\t\t// for things meant to be run as an assumed role\n\t\tlambdaConf = &aws.Config{\n\t\t\tRegion: aws.String(region.AWSRegion),\n\t\t\tCredentials: stscreds.NewCredentials(\n\t\t\t\tsess,\n\t\t\t\t*conf.LambdaConfig.RoleARN, func(p *stscreds.AssumeRoleProvider) {\n\t\t\t\t\tp.TokenProvider = stscreds.StdinTokenProvider\n\t\t\t\t},\n\t\t\t),\n\t\t}\n\t}\n\tawsClient := cziAWS.New(sess).\n\t\tWithIAM(userConf).\n\t\tWithKMS(userConf).\n\t\tWithSTS(userConf).\n\t\tWithLambda(lambdaConf)\n\treturn awsClient, nil\n}", "func (p *AWSProvider) s3() *s3.S3 {\n\treturn s3.New(session.New(), p.config().WithS3ForcePathStyle(true))\n}", "func Provide.FindProviders(RecordStore.Store, Blocks.Key) (<-Net.ID, error) {}", "func InitAWS(awsRegion, awsAccessKey, awsSecretKey string) {\n\n\tAWSSession = session.New()\n\n\t// Region\n\tif awsRegion != \"\" {\n\t\t// CLI trumps\n\t\tAWSSession.Config.Region = aws.String(awsRegion)\n\t} else if os.Getenv(\"AWS_DEFAULT_REGION\") != \"\" {\n\t\t// Env is good, too\n\t\tAWSSession.Config.Region = aws.String(os.Getenv(\"AWS_DEFAULT_REGION\"))\n\t} else {\n\t\t// Grab it from this EC2 instance, maybe\n\t\tregion, err := getAwsRegionE()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Cannot set AWS region: '%v'\\n\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tAWSSession.Config.Region = aws.String(region)\n\t}\n\n\t// Creds\n\tif awsAccessKey != \"\" && awsSecretKey != \"\" {\n\t\t// CLI trumps\n\t\tcreds := credentials.NewStaticCredentials(\n\t\t\tawsAccessKey,\n\t\t\tawsSecretKey,\n\t\t\t\"\")\n\t\tAWSSession.Config.Credentials = creds\n\t} else if os.Getenv(\"AWS_ACCESS_KEY_ID\") != \"\" {\n\t\t// Env is good, too\n\t\tcreds := credentials.NewStaticCredentials(\n\t\t\tos.Getenv(\"AWS_ACCESS_KEY_ID\"),\n\t\t\tos.Getenv(\"AWS_SECRET_ACCESS_KEY\"),\n\t\t\t\"\")\n\t\tAWSSession.Config.Credentials = creds\n\t}\n\n}", "func NewEnvProvider(config *aws.Config) *Provider {\n\tapiKey := os.Getenv(\"IBM_API_KEY_ID\")\n\tserviceInstanceID := os.Getenv(\"IBM_SERVICE_INSTANCE_ID\")\n\tauthEndPoint := os.Getenv(\"IBM_AUTH_ENDPOINT\")\n\n\treturn NewProvider(EnvProviderName, config, apiKey, authEndPoint, serviceInstanceID, nil)\n}", "func newAwsConfig(args arguments) aws.Config {\n\t// The options array will be updated within this function based on the provided command line arguments. At the end\n\t// the array will be passed to 'LoadDefaultConfig()' to create a AWS configuration for the DynamoDB client that\n\t// reflects the options the user has selected on the command line.\n\tvar options []func(*config.LoadOptions) error\n\n\tif args.region != \"\" {\n\t\toptions = append(options, config.WithRegion(args.region))\n\t}\n\n\tif args.profile != \"\" {\n\t\toptions = append(options, config.WithSharedConfigProfile(args.profile))\n\t}\n\n\toptions = append(options, config.WithRetryer(func() aws.Retryer {\n\t\treturn retry.AddWithMaxAttempts(retry.NewStandard(), 5)\n\t}))\n\n\tif args.endpoint != \"\" {\n\t\tresolver := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {\n\t\t\tif service == dynamodb.ServiceID {\n\t\t\t\treturn aws.Endpoint{\n\t\t\t\t\tPartitionID: \"aws\",\n\t\t\t\t\tURL: args.endpoint,\n\t\t\t\t\tSigningRegion: region,\n\t\t\t\t}, nil\n\t\t\t}\n\n\t\t\treturn aws.Endpoint{}, fmt.Errorf(\"unknown endpoint requested\")\n\t\t})\n\n\t\toptions = append(options, config.WithEndpointResolver(resolver))\n\t}\n\n\t// TODO: handle error.\n\tcfg, _ := config.LoadDefaultConfig(context.TODO(), options...)\n\n\treturn cfg\n}", "func getAwsRegion() (region string) {\n\tregion, _ = getAwsRegionE()\n\treturn\n}", "func ResourceServiceEndpointAws() *schema.Resource {\n\tr := genBaseServiceEndpointResource(flattenServiceEndpointAws, expandServiceEndpointAws)\n\tr.Schema[\"access_key_id\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tRequired: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_ACCESS_KEY_ID\", nil),\n\t\tDescription: \"The AWS access key ID for signing programmatic requests.\",\n\t}\n\tr.Schema[\"secret_access_key\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tRequired: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_SECRET_ACCESS_KEY\", nil),\n\t\tDescription: \"The AWS secret access key for signing programmatic requests.\",\n\t\tSensitive: true,\n\t\tDiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged,\n\t}\n\tsaSecretHashKey, saSecretHashSchema := tfhelper.GenerateSecreteMemoSchema(\"secret_access_key\")\n\tr.Schema[saSecretHashKey] = saSecretHashSchema\n\tr.Schema[\"session_token\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_SESSION_TOKEN\", nil),\n\t\tDescription: \"The AWS session token for signing programmatic requests.\",\n\t\tSensitive: true,\n\t\tDiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged,\n\t}\n\tstSecretHashKey, stSecretHashSchema := tfhelper.GenerateSecreteMemoSchema(\"session_token\")\n\tr.Schema[stSecretHashKey] = stSecretHashSchema\n\tr.Schema[\"role_to_assume\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_RTA\", nil),\n\t\tDescription: \"The Amazon Resource Name (ARN) of the role to assume.\",\n\t}\n\tr.Schema[\"role_session_name\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_RSN\", nil),\n\t\tDescription: \"Optional identifier for the assumed role session.\",\n\t}\n\tr.Schema[\"external_id\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_EXTERNAL_ID\", nil),\n\t\tDescription: \"A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.\",\n\t}\n\treturn r\n}", "func loadAWSConfig(cl *http.Client, arn arn.ARN) (aws.Config, error) {\n\tcfg, err := external.LoadDefaultAWSConfig()\n\tif err != nil {\n\t\treturn aws.Config{}, fmt.Errorf(\"unable to load AWS SDK config: %v\", err)\n\t}\n\tcfg.Region = arn.Region\n\tcfg.HTTPClient = cl\n\treturn cfg, nil\n}", "func getAwsRegionE() (region string, err error) {\n\n\tif os.Getenv(\"AWS_DEFAULT_REGION\") != \"\" {\n\t\tregion = os.Getenv(\"AWS_DEFAULT_REGION\")\n\t} else {\n\t\t// Grab it from this EC2 instace\n\t\tregion, err = ec2metadata.New(session.New()).Region()\n\t}\n\treturn\n}", "func providerConfigure(d *schema.ResourceData) (interface{}, error) {\n\n\tcfg := semp_client.NewConfiguration()\n\tcfg.Username = d.Get(ADMIN_USER).(string)\n\tcfg.Password = d.Get(ADMIN_PASSWD).(string)\n\thost := d.Get(HOST).(string)\n\tport := d.Get(PORT).(int)\n\tcfg.Host = host\n\tcfg.BasePath = \"http://\" + host + \":\" + strconv.Itoa(port) + \"/SEMP/v2/config\"\n\n\tlog.Printf(\"Configured semp_client: basePath:%s, user:%s, pass:%s\\n\",\n\t\tcfg.BasePath, cfg.Username, cfg.Password)\n\n\tstate := ProviderState{\n\t\tsempcfg: cfg,\n\t\thost: host, // this is used to help create unique IDs for each resource [host]+[vpn]+[typ]+[name]\n\t}\n\n\treturn &state, nil\n}", "func AWSCfg(ctx context.Context, accessKeyID, secretKey string) aws.Config {\n\topts := []func(*config.LoadOptions) error{\n\t\tconfig.WithRegion(\"us-west-1\"),\n\t}\n\n\t// In local environment we use the default credentials chain that\n\t// will automatically pull creds from saml2aws,\n\tif !Local {\n\t\topts = append(opts, config.WithCredentialsProvider(\n\t\t\tcredentials.NewStaticCredentialsProvider(accessKeyID, secretKey, \"\"),\n\t\t))\n\t}\n\n\tcfg, err := config.LoadDefaultConfig(ctx, opts...)\n\tif err != nil {\n\t\tfmt.Println(\"failed to load aws config:\", err)\n\t\tos.Exit(1)\n\t}\n\n\treturn cfg\n}", "func providerType(provider koanf.Provider) ItemSource {\n\tswitch provider.(type) {\n\tcase *env.Env:\n\t\treturn SourceEnv\n\tcase *file.File:\n\t\treturn SourceFile\n\tcase *structs.Structs:\n\t\treturn SourceDefault\n\tdefault:\n\t\tpanic(fmt.Errorf(\"%w: %T\", errUnsupportedProvider, provider))\n\t}\n}", "func (s AWSTestSuite) TestGetAWS() {\n\ts.Equal(\"ID\", env.GetAWSAccessKeyID())\n\ts.Equal(\"test.example.com\", env.GetAWSBucket())\n\ts.Equal(\"/backup/database\", env.GetAWSPath())\n\ts.Equal(\"secret\", env.GetAWSSecretAccessKey())\n\ts.Equal(\"us-east-1\", env.GetAWSRegion())\n}", "func awsError(err error) {\n\tif aerr, ok := err.(awserr.Error); ok {\n\t\tlog.Fatalf(\"%s\\n\", aerr.Error())\n\t} else {\n\t\tlog.Fatalf(\"%s\\n\", err.Error())\n\t}\n}", "func providerFactory(_ io.Reader) (cloudprovider.Interface, error) {\n\tlog := klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog))\n\tc, err := loadConfig(envconfig.OsLookuper())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tapiUrl := katapult.DefaultURL\n\tif c.APIHost != \"\" {\n\t\tlog.Info(\"default API base URL overrided\",\n\t\t\t\"url\", c.APIHost)\n\t\tapiUrl, err = url.Parse(c.APIHost)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse provided api url: %w\", err)\n\t\t}\n\t}\n\n\trm, err := katapult.New(\n\t\tkatapult.WithAPIKey(c.APIKey),\n\t\tkatapult.WithBaseURL(apiUrl),\n\t\tkatapult.WithUserAgent(\"kce-ccm\"), // TODO: Add version.\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient := core.New(rm)\n\n\treturn &provider{\n\t\tlog: log,\n\t\tkatapult: client,\n\t\tconfig: *c,\n\t\tloadBalancer: &loadBalancerManager{\n\t\t\tlog: log,\n\t\t\tconfig: *c,\n\t\t\tloadBalancerController: client.LoadBalancers,\n\t\t\tloadBalancerRuleController: client.LoadBalancerRules,\n\t\t},\n\t}, nil\n}", "func NewWithProvider(provider credentials.Provider, cfgs ...*aws.Config) (*session.Session, error) {\n\tcreds := credentials.NewCredentials(provider)\n\tcfg := aws.NewConfig().WithCredentials(creds).WithRegion(region)\n\tcfgs = append([]*aws.Config{cfg}, cfgs...)\n\treturn session.NewSession(cfgs...)\n}", "func Main(serviceName string, serviceDescription string, lambdaAWSInfos []*LambdaAWSInfo, api APIGateway, site *S3Site) error {\n\treturn MainEx(serviceName,\n\t\tserviceDescription,\n\t\tlambdaAWSInfos,\n\t\tapi,\n\t\tsite,\n\t\tnil,\n\t\tfalse)\n}", "func CapaProviderFn(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\n\tvar (\n\t\tworkloadCluster, namespace string\n\t\tnames, labels *starlark.List\n\t\tsshConfig, mgmtKubeConfig *starlarkstruct.Struct\n\t)\n\n\terr := starlark.UnpackArgs(\"capa_provider\", args, kwargs,\n\t\t\"ssh_config\", &sshConfig,\n\t\t\"mgmt_kube_config\", &mgmtKubeConfig,\n\t\t\"workload_cluster?\", &workloadCluster,\n\t\t\"namespace?\", &namespace,\n\t\t\"labels?\", &labels,\n\t\t\"nodes?\", &names)\n\tif err != nil {\n\t\treturn starlark.None, errors.Wrap(err, \"failed to unpack input arguments\")\n\t}\n\n\tctx, ok := thread.Local(identifiers.scriptCtx).(context.Context)\n\tif !ok || ctx == nil {\n\t\treturn starlark.None, fmt.Errorf(\"script context not found\")\n\t}\n\n\tif sshConfig == nil || mgmtKubeConfig == nil {\n\t\treturn starlark.None, errors.New(\"capa_provider requires the name of the management cluster, the ssh configuration and the management cluster kubeconfig\")\n\t}\n\n\tif mgmtKubeConfig == nil {\n\t\tmgmtKubeConfig = thread.Local(identifiers.kubeCfg).(*starlarkstruct.Struct)\n\t}\n\tmgmtKubeConfigPath, err := getKubeConfigPathFromStruct(mgmtKubeConfig)\n\tif err != nil {\n\t\treturn starlark.None, errors.Wrap(err, \"failed to extract management kubeconfig\")\n\t}\n\n\t// if workload cluster is not supplied, then the resources for the management cluster\n\t// should be enumerated\n\tclusterName := workloadCluster\n\tif clusterName == \"\" {\n\t\tconfig, err := k8s.LoadKubeCfg(mgmtKubeConfigPath)\n\t\tif err != nil {\n\t\t\treturn starlark.None, errors.Wrap(err, \"failed to load kube config\")\n\t\t}\n\t\tclusterName, err = config.GetClusterName()\n\t\tif err != nil {\n\t\t\treturn starlark.None, errors.Wrap(err, \"cannot find cluster with name \"+workloadCluster)\n\t\t}\n\t}\n\n\tbastionIpAddr, err := k8s.FetchBastionIpAddress(clusterName, namespace, mgmtKubeConfigPath)\n\tif err != nil {\n\t\treturn starlark.None, errors.Wrap(err, \"could not fetch jump host addresses\")\n\t}\n\n\tproviderConfigPath, err := provider.KubeConfig(mgmtKubeConfigPath, clusterName, namespace)\n\tif err != nil {\n\t\treturn starlark.None, err\n\t}\n\n\tnodeAddresses, err := k8s.GetNodeAddresses(ctx, providerConfigPath, toSlice(names), toSlice(labels))\n\tif err != nil {\n\t\treturn starlark.None, errors.Wrap(err, \"could not fetch host addresses\")\n\t}\n\n\t// dictionary for capa provider struct\n\tcapaProviderDict := starlark.StringDict{\n\t\t\"kind\": starlark.String(identifiers.capaProvider),\n\t\t\"transport\": starlark.String(\"ssh\"),\n\t\t\"kube_config\": starlark.String(providerConfigPath),\n\t}\n\n\t// add node info to dictionary\n\tvar nodeIps []starlark.Value\n\tfor _, node := range nodeAddresses {\n\t\tnodeIps = append(nodeIps, starlark.String(node))\n\t}\n\tcapaProviderDict[\"hosts\"] = starlark.NewList(nodeIps)\n\n\tsshConfigDict := starlark.StringDict{}\n\tsshConfig.ToStringDict(sshConfigDict)\n\n\t// modify ssh config jump credentials, if not specified\n\tif _, err := sshConfig.Attr(\"jump_host\"); err != nil {\n\t\tsshConfigDict[\"jump_host\"] = starlark.String(bastionIpAddr)\n\t}\n\tif _, err := sshConfig.Attr(\"jump_user\"); err != nil {\n\t\tsshConfigDict[\"jump_user\"] = starlark.String(\"ubuntu\")\n\t}\n\tcapaProviderDict[identifiers.sshCfg] = starlarkstruct.FromStringDict(starlark.String(identifiers.sshCfg), sshConfigDict)\n\n\treturn starlarkstruct.FromStringDict(starlark.String(identifiers.capaProvider), capaProviderDict), nil\n}", "func getAzureCloudProviderConfig(machine *actuators.MachineScope) string {\n\treturn fmt.Sprintf(`{\n\"cloud\":\"AzurePublicCloud\",\n\"tenantId\": \"%[1]s\",\n\"subscriptionId\": \"%[2]s\",\n\"aadClientId\": \"%[3]s\",\n\"aadClientSecret\": \"%[4]s\",\n\"resourceGroup\": \"%[5]s\",\n\"location\": \"%[6]s\",\n\"vmType\": \"standard\",\n\"subnetName\": \"%[7]s\",\n\"securityGroupName\": \"%[8]s\",\n\"vnetName\": \"%[9]s\",\n\"vnetResourceGroup\": \"%[5]s\",\n\"routeTableName\": \"%[10]s\",\n\"primaryAvailabilitySetName\": \"\",\n\"primaryScaleSetName\": \"\",\n\"cloudProviderBackoff\": true,\n\"cloudProviderBackoffRetries\": 6,\n\"cloudProviderBackoffExponent\": 1.5,\n\"cloudProviderBackoffDuration\": 5,\n\"cloudProviderBackoffJitter\": 1.0,\n\"cloudProviderRatelimit\": true,\n\"cloudProviderRateLimitQPS\": 3.0,\n\"cloudProviderRateLimitBucket\": 10,\n\"useManagedIdentityExtension\": false,\n\"userAssignedIdentityID\": \"\",\n\"useInstanceMetadata\": true,\n\"loadBalancerSku\": \"Standard\",\n\"excludeMasterFromStandardLB\": true,\n\"providerVaultName\": \"\",\n\"maximumLoadBalancerRuleCount\": 250,\n\"providerKeyName\": \"k8s\",\n\"providerKeyVersion\": \"\"\n}`,\n\t\tos.Getenv(\"AZURE_TENANT_ID\"),\n\t\tos.Getenv(\"AZURE_SUBSCRIPTION_ID\"),\n\t\tos.Getenv(\"AZURE_CLIENT_ID\"),\n\t\tos.Getenv(\"AZURE_CLIENT_SECRET\"),\n\t\tmachine.Scope.ClusterConfig.ResourceGroup,\n\t\tmachine.Scope.ClusterConfig.Location,\n\t\tazure.GenerateNodeSubnetName(machine.Scope.Cluster.Name),\n\t\tazure.GenerateNodeSecurityGroupName(machine.Scope.Cluster.Name),\n\t\tazure.GenerateVnetName(machine.Scope.Cluster.Name),\n\t\tazure.GenerateNodeRouteTableName(machine.Scope.Cluster.Name),\n\t)\n}", "func newAWSKMSClient(sess client.ConfigProvider, region, arn string) AWSKMSClient {\n\treturn AWSKMSClient{\n\t\tKMS: clientFactory(sess, aws.NewConfig().WithRegion(region)),\n\t\tRegion: region,\n\t\tARN: arn,\n\t}\n}", "func (vl *VlanBridge) SvcProviderUpdate(svcName string, providers []string) {\n}", "func (app *App) ApplyTKGConfigForAWS(params aws.ApplyTKGConfigForAWSParams) middleware.Responder {\n\tif app.awsClient == nil {\n\t\treturn aws.NewApplyTKGConfigForAWSInternalServerError().WithPayload(Err(errors.New(\"aws client is not initialized properly\")))\n\t}\n\tencodedCreds, err := app.awsClient.EncodeCredentials()\n\tif err != nil {\n\t\treturn aws.NewApplyTKGConfigForAWSInternalServerError().WithPayload(Err(err))\n\t}\n\n\tconfig, err := tkgconfigproviders.New(app.AppConfig.TKGConfigDir, app.TKGConfigReaderWriter).NewAWSConfig(params.Params, encodedCreds)\n\tif err != nil {\n\t\treturn aws.NewApplyTKGConfigForAWSInternalServerError().WithPayload(Err(err))\n\t}\n\n\terr = tkgconfigupdater.SaveConfig(app.getFilePathForSavingConfig(), app.TKGConfigReaderWriter, config)\n\tif err != nil {\n\t\treturn aws.NewApplyTKGConfigForAWSInternalServerError().WithPayload(Err(err))\n\t}\n\n\treturn aws.NewApplyTKGConfigForAWSOK().WithPayload(&models.ConfigFileInfo{Path: app.getFilePathForSavingConfig()})\n}", "func providerConfigure(d *schema.ResourceData) (interface{}, error) {\n\tif d.Get(\"url\") == nil {\n\t\treturn nil, fmt.Errorf(\"url cannot be nil\")\n\t}\n\n\tusername := d.Get(\"username\").(string)\n\tpassword := d.Get(\"password\").(string)\n\tapiKey := d.Get(\"api_key\").(string)\n\taccessToken := d.Get(\"access_token\").(string)\n\n\tlog.SetLogger(log.NewLogger(log.INFO, nil))\n\n\tvar client *http.Client\n\tdetails := auth.NewArtifactoryDetails()\n\n\turl := d.Get(\"url\").(string)\n\tif url[len(url)-1] != '/' {\n\t\turl += \"/\"\n\t}\n\tdetails.SetUrl(url)\n\n\tif username != \"\" && password != \"\" {\n\t\tdetails.SetUser(username)\n\t\tdetails.SetPassword(password)\n\t\ttp := transport.BasicAuth{\n\t\t\tUsername: username,\n\t\t\tPassword: password,\n\t\t}\n\t\tclient = tp.Client()\n\t} else if apiKey != \"\" {\n\t\tdetails.SetApiKey(apiKey)\n\t\ttp := &transport.ApiKeyAuth{\n\t\t\tApiKey: apiKey,\n\t\t}\n\t\tclient = tp.Client()\n\t} else if accessToken != \"\" {\n\t\tdetails.SetAccessToken(accessToken)\n\t\ttp := &transport.AccessTokenAuth{\n\t\t\tAccessToken: accessToken,\n\t\t}\n\t\tclient = tp.Client()\n\t} else {\n\t\treturn nil, fmt.Errorf(\"either [username, password] or [api_key] or [access_token] must be set to use provider\")\n\t}\n\n\tconfig, err := config.NewConfigBuilder().\n\t\tSetServiceDetails(details).\n\t\tSetDryRun(false).\n\t\tBuild()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trtold, err := artifactoryold.NewClient(d.Get(\"url\").(string), client)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trtnew, err := artifactorynew.New(&details, config)\n\n\tif err != nil {\n\t\treturn nil, err\n\t} else if _, resp, err := rtold.V1.System.Ping(context.Background()); err != nil {\n\t\treturn nil, err\n\t} else if resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"failed to ping server. Got %d\", resp.StatusCode)\n\t} else if _, err := rtnew.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tproductid := \"terraform-provider-artifactory/\" + ProviderVersion\n\tcommandid := \"Terraform/\" + version.Version\n\tusage.SendReportUsage(productid, commandid, rtnew)\n\n\trt := &ArtClient{\n\t\tArtOld: rtold,\n\t\tArtNew: rtnew,\n\t}\n\n\treturn rt, nil\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"organization_slug\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(OrgEnvVar, nil),\n\t\t\t},\n\t\t\t\"api_token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(TokenEnvVar, nil),\n\t\t\t},\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"buildkite_pipeline\": resourcePipeline(),\n\t\t\t\"buildkite_pipeline_schedule\": resourcePipelineSchedule(),\n\t\t\t\"buildkite_team\": resourceTeam(),\n\t\t\t\"buildkite_team_pipeline\": resourceTeamPipeline(),\n\t\t\t\"buildkite_team_member\": resourceTeamMember(),\n\t\t},\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"buildkite_user\": dataSourceUser(),\n\t\t},\n\t\tConfigureFunc: createClient,\n\t}\n}", "func verifyAws() {\n\t_, err := aws.EnvAuth()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"email\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"DNSIMPLE_EMAIL\", \"\"),\n\t\t\t\tDescription: \"The DNSimple account email address.\",\n\t\t\t},\n\n\t\t\t\"token\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"DNSIMPLE_TOKEN\", nil),\n\t\t\t\tDescription: \"The API v2 token for API operations.\",\n\t\t\t},\n\n\t\t\t\"account\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"DNSIMPLE_ACCOUNT\", nil),\n\t\t\t\tDescription: \"The account for API operations.\",\n\t\t\t},\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"dnsimple_record\": resourceDNSimpleRecord(),\n\t\t},\n\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func Provider() tfbridge.ProviderInfo {\n\t// Instantiate the Terraform provider\n\tp := shimv2.NewProvider(shim.NewProvider())\n\n\t// Create a Pulumi provider mapping\n\tprov := tfbridge.ProviderInfo{\n\t\tP: p,\n\t\tName: \"azuread\",\n\t\tDisplayName: \"Azure Active Directory (Azure AD)\",\n\t\tDescription: \"A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.\",\n\t\tKeywords: []string{\"pulumi\", \"azuread\"},\n\t\tLicense: \"Apache-2.0\",\n\t\tHomepage: \"https://pulumi.io\",\n\t\tGitHubOrg: \"hashicorp\",\n\t\tRepository: \"https://github.com/pulumi/pulumi-azuread\",\n\t\tConfig: map[string]*tfbridge.SchemaInfo{\n\t\t\t\"environment\": {\n\t\t\t\tDefault: &tfbridge.DefaultInfo{\n\t\t\t\t\tValue: \"public\",\n\t\t\t\t\tEnvVars: []string{\"ARM_ENVIRONMENT\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"msi_endpoint\": {\n\t\t\t\tDefault: &tfbridge.DefaultInfo{\n\t\t\t\t\tEnvVars: []string{\"ARM_MSI_ENDPOINT\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"use_msi\": {\n\t\t\t\tDefault: &tfbridge.DefaultInfo{\n\t\t\t\t\tValue: false,\n\t\t\t\t\tEnvVars: []string{\"ARM_USE_MSI\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tPreConfigureCallback: preConfigureCallback,\n\t\tResources: map[string]*tfbridge.ResourceInfo{\n\t\t\t\"azuread_application\": {Tok: makeResource(mainMod, \"Application\")},\n\t\t\t\"azuread_application_password\": {Tok: makeResource(mainMod, \"ApplicationPassword\")},\n\t\t\t\"azuread_group\": {Tok: makeResource(mainMod, \"Group\")},\n\t\t\t\"azuread_service_principal\": {Tok: makeResource(mainMod, \"ServicePrincipal\")},\n\t\t\t\"azuread_service_principal_password\": {Tok: makeResource(mainMod, \"ServicePrincipalPassword\")},\n\t\t\t\"azuread_service_principal_delegated_permission_grant\": {\n\t\t\t\tTok: makeResource(mainMod, \"ServicePrincipalDelegatedPermissionGrant\"),\n\t\t\t},\n\t\t\t\"azuread_user\": {Tok: makeResource(mainMod, \"User\")},\n\t\t\t\"azuread_group_member\": {Tok: makeResource(mainMod, \"GroupMember\")},\n\t\t\t\"azuread_application_certificate\": {Tok: makeResource(mainMod, \"ApplicationCertificate\")},\n\t\t\t\"azuread_service_principal_certificate\": {Tok: makeResource(mainMod, \"ServicePrincipalCertificate\")},\n\t\t\t\"azuread_service_principal_token_signing_certificate\": {\n\t\t\t\tTok: makeResource(mainMod, \"ServicePrincipalTokenSigningCertificate\"),\n\t\t\t},\n\t\t\t\"azuread_application_pre_authorized\": {Tok: makeResource(mainMod, \"ApplicationPreAuthorized\")},\n\t\t\t\"azuread_invitation\": {Tok: makeResource(mainMod, \"Invitation\")},\n\t\t\t\"azuread_conditional_access_policy\": {Tok: makeResource(mainMod, \"ConditionalAccessPolicy\")},\n\t\t\t\"azuread_named_location\": {Tok: makeResource(mainMod, \"NamedLocation\")},\n\t\t\t\"azuread_directory_role\": {Tok: makeResource(mainMod, \"DirectoryRole\")},\n\t\t\t\"azuread_directory_role_member\": {Tok: makeResource(mainMod, \"DirectoryRoleMember\")},\n\t\t\t\"azuread_app_role_assignment\": {Tok: makeResource(mainMod, \"AppRoleAssignment\")},\n\t\t\t\"azuread_administrative_unit\": {Tok: makeResource(mainMod, \"AdministrativeUnit\")},\n\t\t\t\"azuread_administrative_unit_member\": {Tok: makeResource(mainMod, \"AdministrativeUnitMember\")},\n\t\t\t\"azuread_application_federated_identity_credential\": {\n\t\t\t\tTok: makeResource(mainMod, \"ApplicationFederatedIdentityCredential\"),\n\t\t\t},\n\t\t\t\"azuread_custom_directory_role\": {Tok: makeResource(mainMod, \"CustomDirectoryRole\")},\n\t\t\t\"azuread_claims_mapping_policy\": {Tok: makeResource(mainMod, \"ClaimsMappingPolicy\")},\n\t\t\t\"azuread_directory_role_assignment\": {Tok: makeResource(mainMod, \"DirectoryRoleAssignment\")},\n\t\t\t\"azuread_service_principal_claims_mapping_policy_assignment\": {\n\t\t\t\tTok: makeResource(mainMod, \"ServicePrincipalClaimsMappingPolicyAssignment\"),\n\t\t\t},\n\t\t\t\"azuread_synchronization_job\": {Tok: makeResource(mainMod, \"SynchronizationJob\")},\n\t\t\t\"azuread_synchronization_secret\": {Tok: makeResource(mainMod, \"SynchronizationSecret\")},\n\t\t\t\"azuread_access_package\": {Tok: makeResource(mainMod, \"AccessPackage\")},\n\t\t\t\"azuread_access_package_assignment_policy\": {Tok: makeResource(mainMod, \"AccessPackageAssignmentPolicy\")},\n\t\t\t\"azuread_access_package_catalog\": {Tok: makeResource(mainMod, \"AccessPackageCatalog\")},\n\t\t\t\"azuread_access_package_resource_catalog_association\": {\n\t\t\t\tTok: makeResource(mainMod, \"AccessPackageResourceCatalogAssociation\"),\n\t\t\t},\n\t\t\t\"azuread_access_package_resource_package_association\": {\n\t\t\t\tTok: makeResource(mainMod, \"AccessPackageResourcePackageAssociation\"),\n\t\t\t},\n\t\t\t\"azuread_administrative_unit_role_member\": {Tok: makeResource(mainMod, \"AdministrativeUnitRoleMember\")},\n\t\t\t\"azuread_user_flow_attribute\": {Tok: makeResource(mainMod, \"UserFlowAttribute\")},\n\t\t},\n\t\tDataSources: map[string]*tfbridge.DataSourceInfo{\n\t\t\t\"azuread_client_config\": {Tok: makeDataSource(mainMod, \"getClientConfig\")},\n\t\t\t\"azuread_application_published_app_ids\": {Tok: makeDataSource(mainMod, \"getApplicationPublishedAppIds\")},\n\t\t\t\"azuread_application_template\": {Tok: makeDataSource(mainMod, \"getApplicationTemplate\")},\n\t\t\t\"azuread_service_principals\": {Tok: makeDataSource(mainMod, \"getServicePrincipals\")},\n\t\t\t\"azuread_administrative_unit\": {Tok: makeDataSource(mainMod, \"getAdministrativeUnit\")},\n\t\t\t\"azuread_directory_object\": {Tok: makeDataSource(mainMod, \"getDirectoryObject\")},\n\t\t\t\"azuread_directory_roles\": {Tok: makeDataSource(mainMod, \"getDirectoryRoles\")},\n\t\t\t\"azuread_access_package\": {Tok: makeDataSource(mainMod, \"getAccessPackage\")},\n\t\t\t\"azuread_access_package_catalog\": {Tok: makeDataSource(mainMod, \"getAccessPackageCatalog\")},\n\t\t},\n\t\tJavaScript: &tfbridge.JavaScriptInfo{\n\t\t\t// List any npm dependencies and their versions\n\t\t\tDependencies: map[string]string{\n\t\t\t\t\"@pulumi/pulumi\": \"^3.0.0\",\n\t\t\t},\n\t\t\tDevDependencies: map[string]string{\n\t\t\t\t\"@types/node\": \"^10.0.0\", // so we can access strongly typed node definitions.\n\t\t\t\t\"@types/mime\": \"^2.0.0\",\n\t\t\t},\n\t\t},\n\t\tPython: &tfbridge.PythonInfo{\n\t\t\tRequires: map[string]string{\n\t\t\t\t\"pulumi\": \">=3.0.0,<4.0.0\",\n\t\t\t},\n\t\t},\n\t\tGolang: &tfbridge.GolangInfo{\n\t\t\tImportBasePath: filepath.Join(\n\t\t\t\tfmt.Sprintf(\"github.com/pulumi/pulumi-%[1]s/sdk/\", mainPkg),\n\t\t\t\ttfbridge.GetModuleMajorVersion(version.Version),\n\t\t\t\t\"go\",\n\t\t\t\tmainPkg,\n\t\t\t),\n\t\t\tGenerateResourceContainerTypes: true,\n\t\t},\n\t\tCSharp: &tfbridge.CSharpInfo{\n\t\t\tPackageReferences: map[string]string{\n\t\t\t\t\"Pulumi\": \"3.*\",\n\t\t\t},\n\t\t\tNamespaces: map[string]string{\n\t\t\t\t\"azuread\": \"AzureAD\",\n\t\t\t},\n\t\t}, MetadataInfo: tfbridge.NewProviderMetadata(metadata),\n\t}\n\n\tprov.MustComputeTokens(tfbridgetokens.SingleModule(\"azuread_\", mainMod,\n\t\ttfbridgetokens.MakeStandard(mainPkg)))\n\tprov.SetAutonaming(255, \"-\")\n\tprov.MustApplyAutoAliases()\n\n\treturn prov\n}", "func ConfigureAWS() error {\n\n\tvar err error\n\tlog.Info(\"[Authentication]: Creates directory for aws configuration\")\n\terr = os.Mkdir(\"/root/.aws\", 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Info(\"[Authentication]: Creating credential file in aws directory\")\n\terr = CreateFile(\"/root/.aws/credentials\")\n\tif err != nil {\n\t\treturn errors.Errorf(\"failed to create the credential file, err: %v\", err)\n\t}\n\n\tlog.Info(\"[Authentication]: Copying aws credentials from cloud_config secret\")\n\terr = Copy(\"/tmp/cloud_config.yml\", \"/root/.aws/credentials\")\n\tif err != nil {\n\t\treturn errors.Errorf(\"failed to copy the credentials, err: %v\", err)\n\t}\n\n\treturn nil\n}" ]
[ "0.6819622", "0.62086576", "0.62025106", "0.61090666", "0.60824037", "0.60271865", "0.5967627", "0.59602726", "0.5927459", "0.5871286", "0.58574826", "0.5853901", "0.5825679", "0.58055574", "0.5767389", "0.5753407", "0.5695943", "0.5585618", "0.5578424", "0.5531067", "0.5527687", "0.5507161", "0.5499105", "0.5488877", "0.5458202", "0.5455641", "0.54499245", "0.54297656", "0.5425045", "0.5398024", "0.53919977", "0.5391403", "0.5390741", "0.53837615", "0.5369488", "0.5368891", "0.53675616", "0.5362716", "0.5357809", "0.5355968", "0.53537804", "0.53498244", "0.5347634", "0.5311216", "0.5305591", "0.5296128", "0.529144", "0.5289142", "0.5279207", "0.52755404", "0.52703226", "0.52611727", "0.52571255", "0.52544993", "0.52470654", "0.52459353", "0.5244638", "0.52355915", "0.52307594", "0.5228302", "0.5222793", "0.5221363", "0.52155143", "0.52032775", "0.5201431", "0.5201351", "0.5192641", "0.51899093", "0.5186874", "0.5183666", "0.517157", "0.5153386", "0.51479566", "0.5147382", "0.5141897", "0.5141449", "0.5141061", "0.5127825", "0.5116589", "0.51129806", "0.5104986", "0.51030934", "0.50978106", "0.5090822", "0.5085679", "0.50847465", "0.50833905", "0.5059711", "0.5039397", "0.50384605", "0.5033058", "0.5028906", "0.50128883", "0.5004867", "0.50034446", "0.49955535", "0.4995052", "0.49882892", "0.49862576", "0.49847412" ]
0.70843154
0
ResourceAWS : Define the aws resource function
ResourceAWS : Определить функцию ресурса aws
func ResourceAWS(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) ResourceName := vars["ResourceName"] w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) if err := json.NewEncoder(w).Encode(awsResources[ResourceName]); err != nil { panic(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\tfunctionName := d.Get(\"function_name\").(string)\n\treservedConcurrentExecutions := d.Get(\"reserved_concurrent_executions\").(int)\n\tiamRole := d.Get(\"role\").(string)\n\n\tlog.Printf(\"[DEBUG] Creating Lambda Function %s with role %s\", functionName, iamRole)\n\n\tfilename, hasFilename := d.GetOk(\"filename\")\n\ts3Bucket, bucketOk := d.GetOk(\"s3_bucket\")\n\ts3Key, keyOk := d.GetOk(\"s3_key\")\n\ts3ObjectVersion, versionOk := d.GetOk(\"s3_object_version\")\n\n\tif !hasFilename && !bucketOk && !keyOk && !versionOk {\n\t\treturn errors.New(\"filename or s3_* attributes must be set\")\n\t}\n\n\tvar functionCode *lambda.FunctionCode\n\tif hasFilename {\n\t\t// Grab an exclusive lock so that we're only reading one function into\n\t\t// memory at a time.\n\t\t// See https://github.com/hashicorp/terraform/issues/9364\n\t\tawsMutexKV.Lock(awsMutexLambdaKey)\n\t\tdefer awsMutexKV.Unlock(awsMutexLambdaKey)\n\t\tfile, err := loadFileContent(filename.(string))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to load %q: %s\", filename.(string), err)\n\t\t}\n\t\tfunctionCode = &lambda.FunctionCode{\n\t\t\tZipFile: file,\n\t\t}\n\t} else {\n\t\tif !bucketOk || !keyOk {\n\t\t\treturn errors.New(\"s3_bucket and s3_key must all be set while using S3 code source\")\n\t\t}\n\t\tfunctionCode = &lambda.FunctionCode{\n\t\t\tS3Bucket: aws.String(s3Bucket.(string)),\n\t\t\tS3Key: aws.String(s3Key.(string)),\n\t\t}\n\t\tif versionOk {\n\t\t\tfunctionCode.S3ObjectVersion = aws.String(s3ObjectVersion.(string))\n\t\t}\n\t}\n\n\tparams := &lambda.CreateFunctionInput{\n\t\tCode: functionCode,\n\t\tDescription: aws.String(d.Get(\"description\").(string)),\n\t\tFunctionName: aws.String(functionName),\n\t\tHandler: aws.String(d.Get(\"handler\").(string)),\n\t\tMemorySize: aws.Int64(int64(d.Get(\"memory_size\").(int))),\n\t\tRole: aws.String(iamRole),\n\t\tRuntime: aws.String(d.Get(\"runtime\").(string)),\n\t\tTimeout: aws.Int64(int64(d.Get(\"timeout\").(int))),\n\t\tPublish: aws.Bool(d.Get(\"publish\").(bool)),\n\t}\n\n\tif v, ok := d.GetOk(\"dead_letter_config\"); ok {\n\t\tdlcMaps := v.([]interface{})\n\t\tif len(dlcMaps) == 1 { // Schema guarantees either 0 or 1\n\t\t\t// Prevent panic on nil dead_letter_config. See GH-14961\n\t\t\tif dlcMaps[0] == nil {\n\t\t\t\treturn fmt.Errorf(\"Nil dead_letter_config supplied for function: %s\", functionName)\n\t\t\t}\n\t\t\tdlcMap := dlcMaps[0].(map[string]interface{})\n\t\t\tparams.DeadLetterConfig = &lambda.DeadLetterConfig{\n\t\t\t\tTargetArn: aws.String(dlcMap[\"target_arn\"].(string)),\n\t\t\t}\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"vpc_config\"); ok {\n\n\t\tconfigs := v.([]interface{})\n\t\tconfig, ok := configs[0].(map[string]interface{})\n\n\t\tif !ok {\n\t\t\treturn errors.New(\"vpc_config is <nil>\")\n\t\t}\n\n\t\tif config != nil {\n\t\t\tvar subnetIds []*string\n\t\t\tfor _, id := range config[\"subnet_ids\"].(*schema.Set).List() {\n\t\t\t\tsubnetIds = append(subnetIds, aws.String(id.(string)))\n\t\t\t}\n\n\t\t\tvar securityGroupIds []*string\n\t\t\tfor _, id := range config[\"security_group_ids\"].(*schema.Set).List() {\n\t\t\t\tsecurityGroupIds = append(securityGroupIds, aws.String(id.(string)))\n\t\t\t}\n\n\t\t\tparams.VpcConfig = &lambda.VpcConfig{\n\t\t\t\tSubnetIds: subnetIds,\n\t\t\t\tSecurityGroupIds: securityGroupIds,\n\t\t\t}\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"tracing_config\"); ok {\n\t\ttracingConfig := v.([]interface{})\n\t\ttracing := tracingConfig[0].(map[string]interface{})\n\t\tparams.TracingConfig = &lambda.TracingConfig{\n\t\t\tMode: aws.String(tracing[\"mode\"].(string)),\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"environment\"); ok {\n\t\tenvironments := v.([]interface{})\n\t\tenvironment, ok := environments[0].(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn errors.New(\"At least one field is expected inside environment\")\n\t\t}\n\n\t\tif environmentVariables, ok := environment[\"variables\"]; ok {\n\t\t\tvariables := readEnvironmentVariables(environmentVariables.(map[string]interface{}))\n\n\t\t\tparams.Environment = &lambda.Environment{\n\t\t\t\tVariables: aws.StringMap(variables),\n\t\t\t}\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"kms_key_arn\"); ok {\n\t\tparams.KMSKeyArn = aws.String(v.(string))\n\t}\n\n\tif v, exists := d.GetOk(\"tags\"); exists {\n\t\tparams.Tags = tagsFromMapGeneric(v.(map[string]interface{}))\n\t}\n\n\t// IAM profiles can take ~10 seconds to propagate in AWS:\n\t// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console\n\t// Error creating Lambda function: InvalidParameterValueException: The role defined for the task cannot be assumed by Lambda.\n\terr := resource.Retry(10*time.Minute, func() *resource.RetryError {\n\t\t_, err := conn.CreateFunction(params)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"[DEBUG] Error creating Lambda Function: %s\", err)\n\n\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"The role defined for the function cannot be assumed by Lambda\") {\n\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying CreateFunction\", err)\n\t\t\t\treturn resource.RetryableError(err)\n\t\t\t}\n\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"The provided execution role does not have permissions\") {\n\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying CreateFunction\", err)\n\t\t\t\treturn resource.RetryableError(err)\n\t\t\t}\n\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"Your request has been throttled by EC2\") {\n\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying CreateFunction\", err)\n\t\t\t\treturn resource.RetryableError(err)\n\t\t\t}\n\n\t\t\treturn resource.NonRetryableError(err)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error creating Lambda function: %s\", err)\n\t}\n\n\tif reservedConcurrentExecutions > 0 {\n\n\t\tlog.Printf(\"[DEBUG] Setting Concurrency to %d for the Lambda Function %s\", reservedConcurrentExecutions, functionName)\n\n\t\tconcurrencyParams := &lambda.PutFunctionConcurrencyInput{\n\t\t\tFunctionName: aws.String(functionName),\n\t\t\tReservedConcurrentExecutions: aws.Int64(int64(reservedConcurrentExecutions)),\n\t\t}\n\n\t\t_, err := conn.PutFunctionConcurrency(concurrencyParams)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error setting concurrency for Lambda %s: %s\", functionName, err)\n\t\t}\n\t}\n\n\td.SetId(d.Get(\"function_name\").(string))\n\n\treturn resourceAwsLambdaFunctionRead(d, meta)\n}", "func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\tlog.Printf(\"[DEBUG] Fetching Lambda Function: %s\", d.Id())\n\n\tparams := &lambda.GetFunctionInput{\n\t\tFunctionName: aws.String(d.Get(\"function_name\").(string)),\n\t}\n\n\tgetFunctionOutput, err := conn.GetFunction(params)\n\tif err != nil {\n\t\tif awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == \"ResourceNotFoundException\" && !d.IsNewResource() {\n\t\t\td.SetId(\"\")\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\t// getFunctionOutput.Code.Location is a pre-signed URL pointing at the zip\n\t// file that we uploaded when we created the resource. You can use it to\n\t// download the code from AWS. The other part is\n\t// getFunctionOutput.Configuration which holds metadata.\n\n\tfunction := getFunctionOutput.Configuration\n\t// TODO error checking / handling on the Set() calls.\n\td.Set(\"arn\", function.FunctionArn)\n\td.Set(\"description\", function.Description)\n\td.Set(\"handler\", function.Handler)\n\td.Set(\"memory_size\", function.MemorySize)\n\td.Set(\"last_modified\", function.LastModified)\n\td.Set(\"role\", function.Role)\n\td.Set(\"runtime\", function.Runtime)\n\td.Set(\"timeout\", function.Timeout)\n\td.Set(\"kms_key_arn\", function.KMSKeyArn)\n\td.Set(\"tags\", tagsToMapGeneric(getFunctionOutput.Tags))\n\n\tconfig := flattenLambdaVpcConfigResponse(function.VpcConfig)\n\tlog.Printf(\"[INFO] Setting Lambda %s VPC config %#v from API\", d.Id(), config)\n\tvpcSetErr := d.Set(\"vpc_config\", config)\n\tif vpcSetErr != nil {\n\t\treturn fmt.Errorf(\"Failed setting vpc_config: %s\", vpcSetErr)\n\t}\n\n\td.Set(\"source_code_hash\", function.CodeSha256)\n\n\tif err := d.Set(\"environment\", flattenLambdaEnvironment(function.Environment)); err != nil {\n\t\tlog.Printf(\"[ERR] Error setting environment for Lambda Function (%s): %s\", d.Id(), err)\n\t}\n\n\tif function.DeadLetterConfig != nil && function.DeadLetterConfig.TargetArn != nil {\n\t\td.Set(\"dead_letter_config\", []interface{}{\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"target_arn\": *function.DeadLetterConfig.TargetArn,\n\t\t\t},\n\t\t})\n\t} else {\n\t\td.Set(\"dead_letter_config\", []interface{}{})\n\t}\n\n\tif function.TracingConfig != nil {\n\t\td.Set(\"tracing_config\", []interface{}{\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"mode\": *function.TracingConfig.Mode,\n\t\t\t},\n\t\t})\n\t}\n\n\t// List is sorted from oldest to latest\n\t// so this may get costly over time :'(\n\tvar lastVersion, lastQualifiedArn string\n\terr = listVersionsByFunctionPages(conn, &lambda.ListVersionsByFunctionInput{\n\t\tFunctionName: function.FunctionName,\n\t\tMaxItems: aws.Int64(10000),\n\t}, func(p *lambda.ListVersionsByFunctionOutput, lastPage bool) bool {\n\t\tif lastPage {\n\t\t\tlast := p.Versions[len(p.Versions)-1]\n\t\t\tlastVersion = *last.Version\n\t\t\tlastQualifiedArn = *last.FunctionArn\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.Set(\"version\", lastVersion)\n\td.Set(\"qualified_arn\", lastQualifiedArn)\n\n\td.Set(\"invoke_arn\", buildLambdaInvokeArn(*function.FunctionArn, meta.(*AWSClient).region))\n\n\tif getFunctionOutput.Concurrency != nil {\n\t\td.Set(\"reserved_concurrent_executions\", getFunctionOutput.Concurrency.ReservedConcurrentExecutions)\n\t} else {\n\t\td.Set(\"reserved_concurrent_executions\", nil)\n\t}\n\n\treturn nil\n}", "func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\td.Partial(true)\n\n\tarn := d.Get(\"arn\").(string)\n\tif tagErr := setTagsLambda(conn, d, arn); tagErr != nil {\n\t\treturn tagErr\n\t}\n\td.SetPartial(\"tags\")\n\n\tconfigReq := &lambda.UpdateFunctionConfigurationInput{\n\t\tFunctionName: aws.String(d.Id()),\n\t}\n\n\tconfigUpdate := false\n\tif d.HasChange(\"description\") {\n\t\tconfigReq.Description = aws.String(d.Get(\"description\").(string))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"handler\") {\n\t\tconfigReq.Handler = aws.String(d.Get(\"handler\").(string))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"memory_size\") {\n\t\tconfigReq.MemorySize = aws.Int64(int64(d.Get(\"memory_size\").(int)))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"role\") {\n\t\tconfigReq.Role = aws.String(d.Get(\"role\").(string))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"timeout\") {\n\t\tconfigReq.Timeout = aws.Int64(int64(d.Get(\"timeout\").(int)))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"kms_key_arn\") {\n\t\tconfigReq.KMSKeyArn = aws.String(d.Get(\"kms_key_arn\").(string))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"dead_letter_config\") {\n\t\tdlcMaps := d.Get(\"dead_letter_config\").([]interface{})\n\t\tif len(dlcMaps) == 1 { // Schema guarantees either 0 or 1\n\t\t\tdlcMap := dlcMaps[0].(map[string]interface{})\n\t\t\tconfigReq.DeadLetterConfig = &lambda.DeadLetterConfig{\n\t\t\t\tTargetArn: aws.String(dlcMap[\"target_arn\"].(string)),\n\t\t\t}\n\t\t\tconfigUpdate = true\n\t\t}\n\t}\n\tif d.HasChange(\"tracing_config\") {\n\t\ttracingConfig := d.Get(\"tracing_config\").([]interface{})\n\t\tif len(tracingConfig) == 1 { // Schema guarantees either 0 or 1\n\t\t\tconfig := tracingConfig[0].(map[string]interface{})\n\t\t\tconfigReq.TracingConfig = &lambda.TracingConfig{\n\t\t\t\tMode: aws.String(config[\"mode\"].(string)),\n\t\t\t}\n\t\t\tconfigUpdate = true\n\t\t}\n\t}\n\tif d.HasChange(\"vpc_config\") {\n\t\tvpcConfigRaw := d.Get(\"vpc_config\").([]interface{})\n\t\tvpcConfig, ok := vpcConfigRaw[0].(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn errors.New(\"vpc_config is <nil>\")\n\t\t}\n\n\t\tif vpcConfig != nil {\n\t\t\tvar subnetIds []*string\n\t\t\tfor _, id := range vpcConfig[\"subnet_ids\"].(*schema.Set).List() {\n\t\t\t\tsubnetIds = append(subnetIds, aws.String(id.(string)))\n\t\t\t}\n\n\t\t\tvar securityGroupIds []*string\n\t\t\tfor _, id := range vpcConfig[\"security_group_ids\"].(*schema.Set).List() {\n\t\t\t\tsecurityGroupIds = append(securityGroupIds, aws.String(id.(string)))\n\t\t\t}\n\n\t\t\tconfigReq.VpcConfig = &lambda.VpcConfig{\n\t\t\t\tSubnetIds: subnetIds,\n\t\t\t\tSecurityGroupIds: securityGroupIds,\n\t\t\t}\n\t\t\tconfigUpdate = true\n\t\t}\n\t}\n\n\tif d.HasChange(\"runtime\") {\n\t\tconfigReq.Runtime = aws.String(d.Get(\"runtime\").(string))\n\t\tconfigUpdate = true\n\t}\n\tif d.HasChange(\"environment\") {\n\t\tif v, ok := d.GetOk(\"environment\"); ok {\n\t\t\tenvironments := v.([]interface{})\n\t\t\tenvironment, ok := environments[0].(map[string]interface{})\n\t\t\tif !ok {\n\t\t\t\treturn errors.New(\"At least one field is expected inside environment\")\n\t\t\t}\n\n\t\t\tif environmentVariables, ok := environment[\"variables\"]; ok {\n\t\t\t\tvariables := readEnvironmentVariables(environmentVariables.(map[string]interface{}))\n\n\t\t\t\tconfigReq.Environment = &lambda.Environment{\n\t\t\t\t\tVariables: aws.StringMap(variables),\n\t\t\t\t}\n\t\t\t\tconfigUpdate = true\n\t\t\t}\n\t\t} else {\n\t\t\tconfigReq.Environment = &lambda.Environment{\n\t\t\t\tVariables: aws.StringMap(map[string]string{}),\n\t\t\t}\n\t\t\tconfigUpdate = true\n\t\t}\n\t}\n\n\tif configUpdate {\n\t\tlog.Printf(\"[DEBUG] Send Update Lambda Function Configuration request: %#v\", configReq)\n\n\t\terr := resource.Retry(10*time.Minute, func() *resource.RetryError {\n\t\t\t_, err := conn.UpdateFunctionConfiguration(configReq)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"[DEBUG] Received error modifying Lambda Function Configuration %s: %s\", d.Id(), err)\n\n\t\t\t\tif isAWSErr(err, \"InvalidParameterValueException\", \"Your request has been throttled by EC2, please make sure you have enough API rate limit.\") {\n\t\t\t\t\tlog.Printf(\"[DEBUG] Received %s, retrying UpdateFunctionConfiguration\", err)\n\t\t\t\t\treturn resource.RetryableError(err)\n\t\t\t\t}\n\t\t\t\treturn resource.NonRetryableError(err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error modifying Lambda Function Configuration %s: %s\", d.Id(), err)\n\t\t}\n\n\t\td.SetPartial(\"description\")\n\t\td.SetPartial(\"handler\")\n\t\td.SetPartial(\"memory_size\")\n\t\td.SetPartial(\"role\")\n\t\td.SetPartial(\"timeout\")\n\t}\n\n\tif d.HasChange(\"filename\") || d.HasChange(\"source_code_hash\") || d.HasChange(\"s3_bucket\") || d.HasChange(\"s3_key\") || d.HasChange(\"s3_object_version\") {\n\t\tcodeReq := &lambda.UpdateFunctionCodeInput{\n\t\t\tFunctionName: aws.String(d.Id()),\n\t\t\tPublish: aws.Bool(d.Get(\"publish\").(bool)),\n\t\t}\n\n\t\tif v, ok := d.GetOk(\"filename\"); ok {\n\t\t\t// Grab an exclusive lock so that we're only reading one function into\n\t\t\t// memory at a time.\n\t\t\t// See https://github.com/hashicorp/terraform/issues/9364\n\t\t\tawsMutexKV.Lock(awsMutexLambdaKey)\n\t\t\tdefer awsMutexKV.Unlock(awsMutexLambdaKey)\n\t\t\tfile, err := loadFileContent(v.(string))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Unable to load %q: %s\", v.(string), err)\n\t\t\t}\n\t\t\tcodeReq.ZipFile = file\n\t\t} else {\n\t\t\ts3Bucket, _ := d.GetOk(\"s3_bucket\")\n\t\t\ts3Key, _ := d.GetOk(\"s3_key\")\n\t\t\ts3ObjectVersion, versionOk := d.GetOk(\"s3_object_version\")\n\n\t\t\tcodeReq.S3Bucket = aws.String(s3Bucket.(string))\n\t\t\tcodeReq.S3Key = aws.String(s3Key.(string))\n\t\t\tif versionOk {\n\t\t\t\tcodeReq.S3ObjectVersion = aws.String(s3ObjectVersion.(string))\n\t\t\t}\n\t\t}\n\n\t\tlog.Printf(\"[DEBUG] Send Update Lambda Function Code request: %#v\", codeReq)\n\n\t\t_, err := conn.UpdateFunctionCode(codeReq)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error modifying Lambda Function Code %s: %s\", d.Id(), err)\n\t\t}\n\n\t\td.SetPartial(\"filename\")\n\t\td.SetPartial(\"source_code_hash\")\n\t\td.SetPartial(\"s3_bucket\")\n\t\td.SetPartial(\"s3_key\")\n\t\td.SetPartial(\"s3_object_version\")\n\t}\n\n\tif d.HasChange(\"reserved_concurrent_executions\") {\n\t\tnc := d.Get(\"reserved_concurrent_executions\")\n\n\t\tif nc.(int) > 0 {\n\t\t\tlog.Printf(\"[DEBUG] Updating Concurrency to %d for the Lambda Function %s\", nc.(int), d.Id())\n\n\t\t\tconcurrencyParams := &lambda.PutFunctionConcurrencyInput{\n\t\t\t\tFunctionName: aws.String(d.Id()),\n\t\t\t\tReservedConcurrentExecutions: aws.Int64(int64(d.Get(\"reserved_concurrent_executions\").(int))),\n\t\t\t}\n\n\t\t\t_, err := conn.PutFunctionConcurrency(concurrencyParams)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error setting concurrency for Lambda %s: %s\", d.Id(), err)\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Printf(\"[DEBUG] Removing Concurrency for the Lambda Function %s\", d.Id())\n\n\t\t\tdeleteConcurrencyParams := &lambda.DeleteFunctionConcurrencyInput{\n\t\t\t\tFunctionName: aws.String(d.Id()),\n\t\t\t}\n\t\t\t_, err := conn.DeleteFunctionConcurrency(deleteConcurrencyParams)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error setting concurrency for Lambda %s: %s\", d.Id(), err)\n\t\t\t}\n\t\t}\n\t}\n\n\td.Partial(false)\n\n\treturn resourceAwsLambdaFunctionRead(d, meta)\n}", "func ResourceServiceEndpointAws() *schema.Resource {\n\tr := genBaseServiceEndpointResource(flattenServiceEndpointAws, expandServiceEndpointAws)\n\tr.Schema[\"access_key_id\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tRequired: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_ACCESS_KEY_ID\", nil),\n\t\tDescription: \"The AWS access key ID for signing programmatic requests.\",\n\t}\n\tr.Schema[\"secret_access_key\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tRequired: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_SECRET_ACCESS_KEY\", nil),\n\t\tDescription: \"The AWS secret access key for signing programmatic requests.\",\n\t\tSensitive: true,\n\t\tDiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged,\n\t}\n\tsaSecretHashKey, saSecretHashSchema := tfhelper.GenerateSecreteMemoSchema(\"secret_access_key\")\n\tr.Schema[saSecretHashKey] = saSecretHashSchema\n\tr.Schema[\"session_token\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_SESSION_TOKEN\", nil),\n\t\tDescription: \"The AWS session token for signing programmatic requests.\",\n\t\tSensitive: true,\n\t\tDiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged,\n\t}\n\tstSecretHashKey, stSecretHashSchema := tfhelper.GenerateSecreteMemoSchema(\"session_token\")\n\tr.Schema[stSecretHashKey] = stSecretHashSchema\n\tr.Schema[\"role_to_assume\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_RTA\", nil),\n\t\tDescription: \"The Amazon Resource Name (ARN) of the role to assume.\",\n\t}\n\tr.Schema[\"role_session_name\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_RSN\", nil),\n\t\tDescription: \"Optional identifier for the assumed role session.\",\n\t}\n\tr.Schema[\"external_id\"] = &schema.Schema{\n\t\tType: schema.TypeString,\n\t\tOptional: true,\n\t\tDefaultFunc: schema.EnvDefaultFunc(\"AZDO_AWS_SERVICE_CONNECTION_EXTERNAL_ID\", nil),\n\t\tDescription: \"A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.\",\n\t}\n\treturn r\n}", "func TagResource(awsSession *session.Session, resource string, nametag string, timestamp string) (err error) {\n\tclient := ec2.New(awsSession)\n\n\t// set up the params for tagging\n\tparams := &ec2.CreateTagsInput{\n\t\tResources: []*string{\n\t\t\taws.String(resource),\n\t\t},\n\t\tTags: []*ec2.Tag{\n\t\t\t{\n\t\t\t\tKey: aws.String(\"Name\"),\n\t\t\t\tValue: aws.String(nametag),\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: aws.String(\"Date\"),\n\t\t\t\tValue: aws.String(timestamp),\n\t\t\t},\n\t\t},\n\t}\n\n\t// actually call AWS with the command to tag. Return value is an empty {} on success, so all we care about is the error.\n\t_, err = client.CreateTags(params)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tdefault:\n\t\t\t\terr = errors.Wrapf(aerr, \"failed to create tags\")\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\terr = errors.Wrapf(aerr, \"failed to create tags\")\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn err\n}", "func AWSScale() {\n\tSetClusterName()\n\t// Scale the AWS infrastructure\n\tfmt.Printf(\"\\t\\t===============Starting AWS Scaling====================\\n\\n\")\n\tsshUser, osLabel := distSelect()\n\tprepareConfigFiles(osLabel)\n\tprovisioner.ExecuteTerraform(\"apply\", \"./inventory/\"+common.Name+\"/provisioner/\")\n\tmvHost := exec.Command(\"mv\", \"./inventory/hosts\", \"./inventory/\"+common.Name+\"/provisioner/hosts\")\n\tmvHost.Run()\n\tmvHost.Wait()\n\t// waiting for Infrastructure\n\ttime.Sleep(30)\n\t// Scale the Kubernetes cluster\n\tfmt.Printf(\"\\n\\n\\t\\t===============Starting Kubernetes Scaling====================\\n\\n\")\n\t_, err := os.Stat(\"./inventory/\" + common.Name + \"/provisioner/hosts\")\n\tcommon.ErrorCheck(\"No host file found.\", err)\n\tcpHost := exec.Command(\"cp\", \"./inventory/\"+common.Name+\"/provisioner/hosts\", \"./inventory/\"+common.Name+\"/installer/hosts\")\n\tcpHost.Run()\n\tcpHost.Wait()\n\tinstaller.RunPlaybook(\"./inventory/\"+common.Name+\"/installer/\", \"scale.yml\", sshUser, osLabel)\n\n\treturn\n}", "func handler(ctx context.Context, req *events.Request) error {\n\t// Create the config.\n\tc := createConfig(ctx, req)\n\tc.log.Print(l.Input{\"loglevel\": \"info\", \"message\": \"Function started\"})\n\tdefer c.log.Print(l.Input{\"loglevel\": \"info\", \"message\": \"Function finished\"})\n\n\t// Create the Cognit service.\n\tif err := c.createCognitoService(); err != nil {\n\t\treturn c.runError(req, err)\n\t}\n\n\t// Unmarshal the ResourceProperties and OldResourceProperties into the config.\n\tif err := req.Unmarshal(c.resourceProperties, c.oldResourceProperties); err != nil {\n\t\treturn c.runError(req, err)\n\t}\n\n\t// Set physical ID - we need the generate secret as physical id,\n\t// since changing this needs replacement of the resource.\n\tc.physicalID = fmt.Sprintf(\"%s-%t-%s\", c.resourceProperties.UserPoolID, c.resourceProperties.GenerateSecret, c.resourceProperties.ClientName)\n\n\t// create, update or delete the userpool client.\n\tdata, err := c.run(req)\n\tif err != nil {\n\t\treturn c.runError(req, err)\n\t}\n\n\t// Send the result to the pre-signed s3 url.\n\tif err := req.Send(c.physicalID, data, err); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func CreateStackResources(stackID string, subscription dynamodb.APISubscription) error {\n\n\t// Create a new CloudFormation template\n\ttemplate := cloudformation.NewTemplate()\n\n\t//Generate GUID\n\tid := stackID\n\n\ttags := []tags.Tag{\n\t\ttags.Tag{\n\t\t\tKey: \"Product\",\n\t\t\tValue: \"MaxEdge\",\n\t\t},\n\t\t// tags.Tag{\n\t\t// \tKey: \"Subscription_ID\",\n\t\t// \tValue: subscription.Name,\n\t\t// },\n\t}\n\n\t// AWS ECS Prpoperties\n\tvarRequiresCompatibilities := []string{\"FARGATE\"}\n\n\t// Lambda Environment Variables //\n\n\t// AWS Account ID\n\tvar varAwsAccountID = os.Getenv(\"AWS_ACCOUNT_ID\")\n\n\t// Task Definition\n\tvar varExecutionRoleArn = os.Getenv(\"EXECUTION_ROLE\")\n\tvar varTaskRoleArn = os.Getenv(\"TASK_ROLE\")\n\tvar varEcsTaskDefinitionRef = os.Getenv(\"CLOUDFORMATION_TASK_DEFINITION_REF\")\n\n\t// Container Definition\n\tvar varImage = os.Getenv(\"CONTAINER_IMAGE\")\n\n\t//Network Definition\n\tvar varSecurityGroup = os.Getenv(\"SECURITY_GROUP\")\n\tvar varSubnet1 = os.Getenv(\"SUBNET_1\")\n\tvar varSubnet2 = os.Getenv(\"SUBNET_2\")\n\tvar varSubnet3 = os.Getenv(\"SUBNET_3\")\n\n\t//ECS Service\n\tvar varClusterName = os.Getenv(\"CLUSTER_NAME\")\n\tvar varEcsRef = os.Getenv(\"CLOUDFORMATION_ECS_SERVICE_REF\")\n\n\t//Secret\n\tvar varSecretRef = os.Getenv(\"CLOUDFORMATION_SECRET_REF\")\n\n\t// Create IAM User\n\ttemplate.Resources[\"IAMUSER\"] = &iam.User{\n\t\tUserName: string(id),\n\t\tTags: tags,\n\t}\n\n\t// Assigning the subscribers ID to a string so it can be added to the policy\n\tbucket := fmt.Sprintf(\"\\\"arn:aws:s3:::maxedgecloudtocloudpoc-sandbox/%s/*\\\"\", id)\n\tvar roleName string = \"ROLE_\" + id\n\tvar policyName string = \"Policy\" + id\n\n\t// S3 GetObject policy for the created IAM user for a subscription\n\t// User will assume the role\n\t// Action is to Assume the sts role\n\ttemplate.Resources[\"IAMPolicy\"] = &iam.Policy{\n\t\tPolicyName: policyName,\n\t\tPolicyDocument: (\"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\\":\\\"sts:AssumeRole\\\",\\\"Resource\\\":\\\"arn:aws:iam::\" + varAwsAccountID + \":role/\" + roleName + \"\\\"}]}\"),\n\t\tUsers: []string{id},\n\t\tAWSCloudFormationDependsOn: []string{\"IAMUSER\"},\n\t}\n\n\tp := iam.Role_Policy{\n\t\tPolicyDocument: (\"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\\":\\\"s3:GetObject\\\",\\\"Resource\\\":\" + bucket + \"}]}\"),\n\t\tPolicyName: id,\n\t}\n\n\t// Assume Role or Trust Policy\n\ttemplate.Resources[\"IAMROLE\"] = &iam.Role{\n\t\tAssumeRolePolicyDocument: (\"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"AWS\\\": \\\"arn:aws:iam::\" + varAwsAccountID + \":user/\" + id + \"\\\"},\\\"Action\\\":[\\\"sts:AssumeRole\\\"]}]}\"),\n\t\tRoleName: roleName,\n\t\tPolicies: []iam.Role_Policy{p},\n\t\tAWSCloudFormationDependsOn: []string{\"IAMUSER\"},\n\t\tTags: tags,\n\t}\n\n\t// Task Definition Secret - sets the value for the container based on what was\n\t// created in the template.\n\tTaskDefSecret := []ecs.TaskDefinition_Secret{}\n\tvarTaskDefSecret := ecs.TaskDefinition_Secret{\n\t\t//Referance to the ARNs created when the secret is created\n\t\tName: cloudformation.Ref(varSecretRef),\n\t\tValueFrom: cloudformation.Ref(varSecretRef),\n\t}\n\tTaskDefSecret = append(TaskDefSecret, varTaskDefSecret)\n\n\t// TargetName come from the DynamoDB table and stores the cloud platform\n\t// endpoint for the data destination\n\tgroup := \"/MaxEdge/CloudToCloud/\" + subscription.Target\n\n\tcwLog := &ecs.TaskDefinition_LogConfiguration{\n\t\tLogDriver: \"awslogs\",\n\t\tOptions: map[string]string{\"awslogs-create-group\": \"true\", \"awslogs-group\": group, \"awslogs-region\": \"us-east-1\", \"awslogs-stream-prefix\": id},\n\t}\n\n\t//Task Definition Container Definition - Setting properties\n\tTaskDefConDef := []ecs.TaskDefinition_ContainerDefinition{}\n\tvarTaskDef := ecs.TaskDefinition_ContainerDefinition{\n\t\tImage: varImage,\n\t\tName: id,\n\t\tSecrets: TaskDefSecret,\n\t\tLogConfiguration: cwLog,\n\t}\n\tTaskDefConDef = append(TaskDefConDef, varTaskDef)\n\n\t// Create an Amazon ECS Task Definition - Setting properties\n\ttemplate.Resources[varEcsTaskDefinitionRef] = &ecs.TaskDefinition{\n\t\tExecutionRoleArn: varExecutionRoleArn,\n\t\tTaskRoleArn: varTaskRoleArn,\n\t\tMemory: \"1024\",\n\t\tNetworkMode: \"awsvpc\",\n\t\tRequiresCompatibilities: varRequiresCompatibilities,\n\t\tCpu: \"512\",\n\t\tContainerDefinitions: TaskDefConDef,\n\t\tTags: tags,\n\t}\n\n\t// ECS Service Network configuration\n\tsnc := &ecs.Service_NetworkConfiguration{\n\t\tAwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{\n\n\t\t\t// Required to access ECR\n\t\t\tAssignPublicIp: \"ENABLED\",\n\t\t\t// The Security Group needs to allow traffic via port :443\n\t\t\tSecurityGroups: []string{varSecurityGroup},\n\t\t\tSubnets: []string{varSubnet1, varSubnet2, varSubnet3},\n\t\t},\n\t}\n\n\t// Create Amazon ECS Service\n\ttemplate.Resources[varEcsRef] = &ecs.Service{\n\t\tLaunchType: \"FARGATE\",\n\t\tCluster: varClusterName,\n\t\tTaskDefinition: cloudformation.Ref(varEcsTaskDefinitionRef),\n\t\tServiceName: id,\n\t\tDesiredCount: 1,\n\t\tNetworkConfiguration: snc,\n\t\tSchedulingStrategy: \"REPLICA\",\n\t\tTags: tags,\n\t\tPropagateTags: \"TASK_DEFINITION\",\n\t}\n\n\t// Create an Amazon Secret\n\ttemplate.Resources[varSecretRef] = &secretsmanager.Secret{\n\t\tName: id,\n\t\tDescription: \"Metadata for companies\",\n\t\tTags: tags,\n\t}\n\n\t// Get JSON form of AWS CloudFormation template\n\tj, err := template.JSON()\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to generate JSON: %s\\n\", err)\n\t\treturn err\n\t}\n\tfmt.Printf(\"Template creation for %s Done.\\n\", id)\n\tfmt.Println(\"=====\")\n\tfmt.Println(\"Generated template:\")\n\tfmt.Printf(\"%s\\n\", string(j))\n\tfmt.Println(\"=====\")\n\n\t// Initialize a session that the SDK uses to load\n\t// credentials from the shared credentials file ~/.aws/credentials\n\t// and configuration from the shared configuration file ~/.aws/config.\n\t// https://docs.aws.amazon.com/sdk-for-go/api/aws/session/\n\tsess := session.Must(session.NewSessionWithOptions(session.Options{\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t}))\n\n\t// Create the stack\n\terr = createStackFromBody(sess, j, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (p *AWS) Initialize(config *types.ProviderConfig) error {\n\tp.Storage = &S3{}\n\n\tif config.Zone == \"\" {\n\t\treturn errors.New(\"zone missing\")\n\t}\n\n\terr := loadAWSCreds()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsession, err := session.NewSession(\n\t\t&aws.Config{\n\t\t\tRegion: aws.String(stripZone(config.Zone)),\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp.session = session\n\tp.dnsService = route53.New(session)\n\tp.ec2 = ec2.New(session)\n\tp.volumeService = ebs.New(session,\n\t\taws.NewConfig().\n\t\t\tWithRegion(stripZone(config.Zone)).\n\t\t\tWithMaxRetries(7))\n\n\t_, err = p.ec2.DescribeRegions(&ec2.DescribeRegionsInput{RegionNames: aws.StringSlice([]string{stripZone(config.Zone)})})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"region with name %v is invalid\", config.Zone)\n\t}\n\n\treturn nil\n}", "func makeARN(resource string) arn.ARN {\n\treturn arn.ARN{\n\t\tPartition: \"aws\",\n\t\tService: \"sqs\",\n\t\tRegion: \"us-fake-0\",\n\t\tAccountID: \"123456789012\",\n\t\tResource: resource,\n\t}\n}", "func AWSFuncs(f map[string]interface{}) {\n\tf2 := CreateAWSFuncs(context.Background())\n\tfor k, v := range f2 {\n\t\tf[k] = v\n\t}\n}", "func TestTerraformAwsS3Example(t *testing.T) {\n\tt.Parallel()\n\n\t// Give this S3 Bucket a unique ID for a name tag so we can distinguish it from any other Buckets provisioned\n\t// in your AWS account\n\texpectedName := fmt.Sprintf(\"terratest-aws-s3-example-%s\", strings.ToLower(random.UniqueId()))\n\n\t// Give this S3 Bucket an environment to operate as a part of for the purposes of resource tagging\n\texpectedEnvironment := \"Automated Testing\"\n\n\t// Pick a random AWS region to test in. This helps ensure your code works in all regions.\n\tawsRegion := aws.GetRandomStableRegion(t, nil, nil)\n\n\t// Construct the terraform options with default retryable errors to handle the most common retryable errors in\n\t// terraform testing.\n\tterraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{\n\t\t// The path to where our Terraform code is located\n\t\tTerraformDir: \"../examples/terraform-aws-s3-example\",\n\n\t\t// Variables to pass to our Terraform code using -var options\n\t\tVars: map[string]interface{}{\n\t\t\t\"tag_bucket_name\": expectedName,\n\t\t\t\"tag_bucket_environment\": expectedEnvironment,\n\t\t\t\"with_policy\": \"true\",\n\t\t\t\"region\": awsRegion,\n\t\t},\n\t})\n\n\t// At the end of the test, run `terraform destroy` to clean up any resources that were created\n\tdefer terraform.Destroy(t, terraformOptions)\n\n\t// This will run `terraform init` and `terraform apply` and fail the test if there are any errors\n\tterraform.InitAndApply(t, terraformOptions)\n\n\t// Run `terraform output` to get the value of an output variable\n\tbucketID := terraform.Output(t, terraformOptions, \"bucket_id\")\n\n\t// Verify that our Bucket has versioning enabled\n\tactualStatus := aws.GetS3BucketVersioning(t, awsRegion, bucketID)\n\texpectedStatus := \"Enabled\"\n\tassert.Equal(t, expectedStatus, actualStatus)\n\n\t// Verify that our Bucket has a policy attached\n\taws.AssertS3BucketPolicyExists(t, awsRegion, bucketID)\n\n\t// Verify that our bucket has server access logging TargetBucket set to what's expected\n\tloggingTargetBucket := aws.GetS3BucketLoggingTarget(t, awsRegion, bucketID)\n\texpectedLogsTargetBucket := fmt.Sprintf(\"%s-logs\", bucketID)\n\tloggingObjectTargetPrefix := aws.GetS3BucketLoggingTargetPrefix(t, awsRegion, bucketID)\n\texpectedLogsTargetPrefix := \"TFStateLogs/\"\n\n\tassert.Equal(t, expectedLogsTargetBucket, loggingTargetBucket)\n\tassert.Equal(t, expectedLogsTargetPrefix, loggingObjectTargetPrefix)\n}", "func TestTerraformAwsS3Example(t *testing.T) {\n\tt.Parallel()\n\n\tconst (\n\t\tawsRegion = \"eu-west-1\"\n\t\texpectedBucketName = \"paloth-test-bucket.\"\n\t\texpectedStatus = \"Enabled\"\n\t)\n\n\t// Construct the terraform options with default retryable errors to handle the most common retryable errors in\n\t// terraform testing.\n\tterraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{\n\t\tTerraformDir: \"../..\",\n\t})\n\n\tdefer terraform.Destroy(t, terraformOptions)\n\n\tterraform.InitAndApply(t, terraformOptions)\n\n\tbucketID := terraform.Output(t, terraformOptions, \"bucket_name\")\n\n\tassert.Equal(t, expectedBucketName, bucketID)\n\n\tactualStatus := aws.GetS3BucketVersioning(t, awsRegion, bucketID)\n\n\tassert.Equal(t, expectedStatus, actualStatus)\n}", "func init() {\n\tdebugMode = (os.Getenv(\"DEBUG\") != \"\")\n\n\tarnPattern = regexp.MustCompile(\"\\\\Aarn:aws:sts::\\\\d+:assumed-role/([a-z0-9_-]+)/(i-[0-9a-f]+)\\\\z\")\n\n\tcaKeyBucket, caKeyPath, err := parseS3URI(os.Getenv(\"CA_KEY_URI\"))\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"CA_KEY_URI: %w\", err)\n\t\treturn\n\t}\n\n\tob, op, err := parseS3URI(os.Getenv(\"OUTPUT_URI_PREFIX\"))\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"OUTPUT_URI_PREFIX: %w\", err)\n\t\treturn\n\t}\n\toutBucket = ob\n\toutPathPrefix = op\n\n\taws, err := newAwsClient()\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"initializing aws client: %w\", err)\n\t\treturn\n\t}\n\tawsCli = aws\n\n\tcaKey, err := awsCli.getS3Object(caKeyBucket, caKeyPath)\n\tif err != nil {\n\t\tfmt.Printf(\"error getting CA key, bucket=%q path=%q\\n\", caKeyBucket, caKeyPath)\n\t\tinitError = fmt.Errorf(\"getting caKey: %w\", err)\n\t\treturn\n\t}\n\n\tsigner, err = NewSigner(caKey)\n\tif err != nil {\n\t\tinitError = fmt.Errorf(\"creating signer: %w\", err)\n\t\treturn\n\t}\n\n\tif debugMode {\n\t\tfmt.Printf(\"init completed\")\n\t}\n}", "func spartaCustomResourceForwarder(event *json.RawMessage,\n\tcontext *LambdaContext,\n\tw http.ResponseWriter,\n\tlogger *logrus.Logger) {\n\n\tvar rawProps map[string]interface{}\n\tjson.Unmarshal([]byte(*event), &rawProps)\n\n\tvar lambdaEvent cloudformationresources.CloudFormationLambdaEvent\n\tjsonErr := json.Unmarshal([]byte(*event), &lambdaEvent)\n\tif jsonErr != nil {\n\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\"RawEvent\": rawProps,\n\t\t\t\"UnmarshalError\": jsonErr,\n\t\t}).Warn(\"Raw event data\")\n\t\thttp.Error(w, jsonErr.Error(), http.StatusInternalServerError)\n\t}\n\n\tlogger.WithFields(logrus.Fields{\n\t\t\"LambdaEvent\": lambdaEvent,\n\t}).Debug(\"CloudFormation Lambda event\")\n\n\t// Setup the request and send it off\n\tcustomResourceRequest := &cloudformationresources.CustomResourceRequest{}\n\tcustomResourceRequest.RequestType = lambdaEvent.RequestType\n\tcustomResourceRequest.ResponseURL = lambdaEvent.ResponseURL\n\tcustomResourceRequest.StackID = lambdaEvent.StackID\n\tcustomResourceRequest.RequestID = lambdaEvent.RequestID\n\tcustomResourceRequest.LogicalResourceID = lambdaEvent.LogicalResourceID\n\tcustomResourceRequest.PhysicalResourceID = lambdaEvent.PhysicalResourceID\n\tcustomResourceRequest.LogGroupName = context.LogGroupName\n\tcustomResourceRequest.LogStreamName = context.LogStreamName\n\tcustomResourceRequest.ResourceProperties = lambdaEvent.ResourceProperties\n\tif \"\" == customResourceRequest.PhysicalResourceID {\n\t\tcustomResourceRequest.PhysicalResourceID = fmt.Sprintf(\"LogStreamName: %s\", context.LogStreamName)\n\t}\n\n\trequestErr := cloudformationresources.Handle(customResourceRequest, logger)\n\tif requestErr != nil {\n\t\thttp.Error(w, requestErr.Error(), http.StatusInternalServerError)\n\t} else {\n\t\tfmt.Fprint(w, \"CustomResource handled: \"+lambdaEvent.LogicalResourceID)\n\t}\n}", "func AWSNS() *Funcs {\n\treturn &Funcs{}\n}", "func ensureIAMRoleForCustomResource(awsPrincipalName string,\n\tsourceArn *gocf.StringExpr,\n\ttemplate *gocf.Template,\n\tlogger *logrus.Logger) (string, error) {\n\n\tvar principalActions []string\n\tswitch awsPrincipalName {\n\tcase cloudformationresources.SNSLambdaEventSource:\n\t\tprincipalActions = PushSourceConfigurationActions.SNSLambdaEventSource\n\tcase cloudformationresources.S3LambdaEventSource:\n\t\tprincipalActions = PushSourceConfigurationActions.S3LambdaEventSource\n\tcase cloudformationresources.SESLambdaEventSource:\n\t\tprincipalActions = PushSourceConfigurationActions.SESLambdaEventSource\n\tcase cloudformationresources.CloudWatchLogsLambdaEventSource:\n\t\tprincipalActions = PushSourceConfigurationActions.CloudWatchLogsLambdaEventSource\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Unsupported principal for IAM role creation: %s\", awsPrincipalName)\n\t}\n\n\t// What's the stable IAMRoleName?\n\tresourceBaseName := fmt.Sprintf(\"CustomResource%sIAMRole\", awsPrincipalToService(awsPrincipalName))\n\tstableRoleName := CloudFormationResourceName(resourceBaseName, awsPrincipalName)\n\n\t// Ensure it exists, then check to see if this Source ARN is already specified...\n\t// Checking equality with Stringable?\n\n\t// Create a new Role\n\tvar existingIAMRole *gocf.IAMRole\n\texistingResource, exists := template.Resources[stableRoleName]\n\tlogger.WithFields(logrus.Fields{\n\t\t\"PrincipalActions\": principalActions,\n\t\t\"SourceArn\": sourceArn,\n\t}).Debug(\"Ensuring IAM Role results\")\n\n\tif !exists {\n\t\t// Insert the IAM role here. We'll walk the policies data in the next section\n\t\t// to make sure that the sourceARN we have is in the list\n\t\tstatements := CommonIAMStatements.Core\n\n\t\tiamPolicyList := gocf.IAMRolePolicyList{}\n\t\tiamPolicyList = append(iamPolicyList,\n\t\t\tgocf.IAMRolePolicy{\n\t\t\t\tPolicyDocument: ArbitraryJSONObject{\n\t\t\t\t\t\"Version\": \"2012-10-17\",\n\t\t\t\t\t\"Statement\": statements,\n\t\t\t\t},\n\t\t\t\tPolicyName: gocf.String(fmt.Sprintf(\"%sPolicy\", stableRoleName)),\n\t\t\t},\n\t\t)\n\n\t\texistingIAMRole = &gocf.IAMRole{\n\t\t\tAssumeRolePolicyDocument: AssumePolicyDocument,\n\t\t\tPolicies: &iamPolicyList,\n\t\t}\n\t\ttemplate.AddResource(stableRoleName, existingIAMRole)\n\n\t\t// Create a new IAM Role resource\n\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\"RoleName\": stableRoleName,\n\t\t}).Debug(\"Inserting IAM Role\")\n\t} else {\n\t\texistingIAMRole = existingResource.Properties.(*gocf.IAMRole)\n\t}\n\n\t// Walk the existing statements\n\tif nil != existingIAMRole.Policies {\n\t\tfor _, eachPolicy := range *existingIAMRole.Policies {\n\t\t\tpolicyDoc := eachPolicy.PolicyDocument.(ArbitraryJSONObject)\n\t\t\tstatements := policyDoc[\"Statement\"]\n\t\t\tfor _, eachStatement := range statements.([]spartaIAM.PolicyStatement) {\n\t\t\t\tif sourceArn.String() == eachStatement.Resource.String() {\n\n\t\t\t\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\t\t\t\"RoleName\": stableRoleName,\n\t\t\t\t\t\t\"SourceArn\": sourceArn.String(),\n\t\t\t\t\t}).Debug(\"SourceArn already exists for IAM Policy\")\n\t\t\t\t\treturn stableRoleName, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\"RoleName\": stableRoleName,\n\t\t\t\"Action\": principalActions,\n\t\t\t\"Resource\": sourceArn,\n\t\t}).Debug(\"Inserting Actions for configuration ARN\")\n\n\t\t// Add this statement to the first policy, iff the actions are non-empty\n\t\tif len(principalActions) > 0 {\n\t\t\trootPolicy := (*existingIAMRole.Policies)[0]\n\t\t\trootPolicyDoc := rootPolicy.PolicyDocument.(ArbitraryJSONObject)\n\t\t\trootPolicyStatements := rootPolicyDoc[\"Statement\"].([]spartaIAM.PolicyStatement)\n\t\t\trootPolicyDoc[\"Statement\"] = append(rootPolicyStatements, spartaIAM.PolicyStatement{\n\t\t\t\tEffect: \"Allow\",\n\t\t\t\tAction: principalActions,\n\t\t\t\tResource: sourceArn,\n\t\t\t})\n\t\t}\n\n\t\treturn stableRoleName, nil\n\t}\n\n\treturn \"\", fmt.Errorf(\"Unable to find Policies entry for IAM role: %s\", stableRoleName)\n}", "func (service *S3Service) Endpoint() string {\n return service.endpoint;\n}", "func Main(serviceName string, serviceDescription string, lambdaAWSInfos []*LambdaAWSInfo, api APIGateway, site *S3Site) error {\n\treturn MainEx(serviceName,\n\t\tserviceDescription,\n\t\tlambdaAWSInfos,\n\t\tapi,\n\t\tsite,\n\t\tnil,\n\t\tfalse)\n}", "func resourceAwsLambdaFunctionDelete(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\tlog.Printf(\"[INFO] Deleting Lambda Function: %s\", d.Id())\n\n\tparams := &lambda.DeleteFunctionInput{\n\t\tFunctionName: aws.String(d.Get(\"function_name\").(string)),\n\t}\n\n\t_, err := conn.DeleteFunction(params)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error deleting Lambda Function: %s\", err)\n\t}\n\n\td.SetId(\"\")\n\n\treturn nil\n}", "func AllAWSResources(c *awsup.MockAWSCloud) map[string]interface{} {\n\tall := make(map[string]interface{})\n\tfor k, v := range c.MockEC2.(*mockec2.MockEC2).All() {\n\t\tall[k] = v\n\t}\n\treturn all\n}", "func resourceAwsRoute53ZoneAssociationCreate(d *schema.ResourceData, meta interface{}) error {\n\tr53 := meta.(*AWSClient).r53conn\n\n\treq := &route53.AssociateVPCWithHostedZoneInput{\n\t\tHostedZoneId: aws.String(d.Get(\"zone_id\").(string)),\n\t\tVPC: &route53.VPC{\n\t\t\tVPCId: aws.String(d.Get(\"vpc_id\").(string)),\n\t\t\tVPCRegion: aws.String(meta.(*AWSClient).region),\n\t\t},\n\t\tComment: aws.String(\"Managed by Terraform\"),\n\t}\n\tif w := d.Get(\"vpc_region\"); w != \"\" {\n\t\treq.VPC.VPCRegion = aws.String(w.(string))\n\t}\n\n\tlog.Printf(\"[DEBUG] Associating Route53 Private Zone %s with VPC %s with region %s\", *req.HostedZoneId, *req.VPC.VPCId, *req.VPC.VPCRegion)\n\tvar err error\n\tresp, err := r53.AssociateVPCWithHostedZone(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Store association id\n\td.SetId(fmt.Sprintf(\"%s:%s\", *req.HostedZoneId, *req.VPC.VPCId))\n\td.Set(\"vpc_region\", req.VPC.VPCRegion)\n\n\t// Wait until we are done initializing\n\twait := resource.StateChangeConf{\n\t\tDelay: 30 * time.Second,\n\t\tPending: []string{\"PENDING\"},\n\t\tTarget: []string{\"INSYNC\"},\n\t\tTimeout: 10 * time.Minute,\n\t\tMinTimeout: 2 * time.Second,\n\t\tRefresh: func() (result interface{}, state string, err error) {\n\t\t\tchangeRequest := &route53.GetChangeInput{\n\t\t\t\tId: aws.String(cleanChangeID(*resp.ChangeInfo.Id)),\n\t\t\t}\n\t\t\treturn resourceAwsGoRoute53Wait(getSubProvider(d, meta).(*AWSClient).r53conn, changeRequest)\n\t\t},\n\t}\n\t_, err = wait.WaitForState()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (a *Funcs) ARN() (string, error) {\n\ta.stsInit.Do(a.initSTS)\n\treturn a.sts.Arn()\n}", "func ProvidersAWS(w http.ResponseWriter, r *http.Request) {\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\n\tif err := json.NewEncoder(w).Encode(awsResources); err != nil {\n\t\tpanic(err)\n\t}\n}", "func main() {\n\tsession, err := session.NewSession(&aws.Config{Region: aws.String(region)})\n\tif err != nil {\n\t\tlog.Println(\"Failed to connect to AWS:\", err)\n\t} else {\n\t\tdb = dynamodb.New(session)\n\t}\n\n\tlambda.Start(Handler)\n}", "func EnsureAWSRegion(region string) string {\n\tr := strings.ToLower(strings.Replace(string(region), \"_\", \"-\", -1))\n log.Printf(\"EnsureAWSRegion--- region:%s r:%s\", region,r)\n\treturn r\n}", "func waitForAwsResource(name, event string, c *client.Client) error {\n\ttick := time.Tick(time.Second * 2)\n\ttimeout := time.After(time.Minute * 5)\n\tfmt.Printf(\"Waiting for %s \", name)\n\tfailedEv := event + \"_FAILED\"\n\tcompletedEv := event + \"_COMPLETE\"\nLoop:\n\tfor {\n\t\tselect {\n\t\tcase <-tick:\n\t\t\trs, err := c.GetResource(name)\n\t\t\tif err != nil {\n\t\t\t\tif event == \"DELETE\" {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfmt.Print(\".\")\n\t\t\tif rs.Status == failedEv {\n\t\t\t\treturn fmt.Errorf(\"%s failed because of \\\"%s\\\"\", event, rs.StatusReason)\n\t\t\t}\n\t\t\tif rs.Status == completedEv {\n\t\t\t\tbreak Loop\n\t\t\t}\n\t\tcase <-timeout:\n\t\t\tfmt.Print(\"timeout (5 minutes). Skipping\")\n\t\t\tbreak Loop\n\t\t}\n\t}\n\n\treturn nil\n}", "func awsFormatRegion(r *string) aws.Region {\n\tvar region aws.Region\n\tswitch *r {\n\tcase \"us-gov-west-1\":\n\t\tregion = aws.USGovWest\n\tcase \"us-east-1\":\n\t\tregion = aws.USEast\n\tcase \"us-west-1\":\n\t\tregion = aws.USWest\n\tcase \"us-west-2\":\n\t\tregion = aws.USWest2\n\tcase \"eu-west-1\":\n\t\tregion = aws.EUWest\n\tcase \"ap-southeast-1\":\n\t\tregion = aws.APSoutheast\n\tcase \"ap-southeast-2\":\n\t\tregion = aws.APSoutheast2\n\tcase \"ap-northeast-1\":\n\t\tregion = aws.APNortheast\n\tcase \"sa-east-1\":\n\t\tregion = aws.SAEast\n\tcase \"\":\n\t\tregion = aws.USEast\n\tdefault:\n\t\tlog.Fatalf(\"Invalid Region: %s\\n\", *r)\n\t}\n\treturn region\n}", "func LambdaApplication_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_codedeploy.LambdaApplication\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "func TestAWS(t *testing.T) {\n\tlogger = runner.NewLogger(\"aws_test\")\n\n\tlogger.Info(\"TestAWS completed\")\n}", "func (Api) CloudFormationType() string { return \"AWS::ApiGatewayV2::Api\" }", "func (r *AWSServerlessFunction_S3Location) AWSCloudFormationType() string {\n\treturn \"AWS::Serverless::Function.S3Location\"\n}", "func AWS(region string) Option {\n\treturn func(s *Server) {\n\t\tdocumentRepo := aws.NewDocumentRepository(region)\n\t\tprojectRepo := aws.ProjectRepository{\n\t\t\tDocumentRepository: documentRepo,\n\t\t}\n\n\t\ts.With(ProjectRepository(&projectRepo))\n\t\ts.With(DocumentRepository(&documentRepo))\n\t}\n}", "func (p providerServices) AWSCli() awscli.AWS {\n\treturn p.cli\n}", "func AWSCreate() {\n\tSetClusterName()\n\tif _, err := os.Stat(\"./inventory/\" + common.Name + \"/provisioner/.terraform\"); err == nil {\n\t\tfmt.Println(\"Configuration folder already exists\")\n\t} else {\n\t\tsshUser, osLabel := distSelect()\n\t\tfmt.Printf(\"Prepairing Setup for user %s on %s\\n\", sshUser, osLabel)\n\t\tos.MkdirAll(\"./inventory/\"+common.Name+\"/provisioner\", 0755)\n\t\terr := exec.Command(\"cp\", \"-rfp\", \"./kubespray/contrib/terraform/aws/.\", \"./inventory/\"+common.Name+\"/provisioner\").Run()\n\t\tcommon.ErrorCheck(\"provisioner could not provided: %v\", err)\n\t\tprepareConfigFiles(osLabel)\n\t\tprovisioner.ExecuteTerraform(\"init\", \"./inventory/\"+common.Name+\"/provisioner/\")\n\t}\n\n\tprovisioner.ExecuteTerraform(\"apply\", \"./inventory/\"+common.Name+\"/provisioner/\")\n\n\t// waiting for Loadbalancer and other not completed stuff\n\tfmt.Println(\"Infrastructure is upcoming.\")\n\ttime.Sleep(15 * time.Second)\n\treturn\n\n}", "func NewAWS(aws config.AWSConfig, bucket config.S3BucketConfig, noLocks, noVersioning bool) *AWS {\n\tif bucket.Bucket == \"\" {\n\t\treturn nil\n\t}\n\n\tsess := session.Must(session.NewSession())\n\tawsConfig := aws_sdk.NewConfig()\n\tvar creds *credentials.Credentials\n\tif len(aws.APPRoleArn) > 0 {\n\t\tlog.Debugf(\"Using %s role\", aws.APPRoleArn)\n\t\tcreds = stscreds.NewCredentials(sess, aws.APPRoleArn, func(p *stscreds.AssumeRoleProvider) {\n\t\t\tif aws.ExternalID != \"\" {\n\t\t\t\tp.ExternalID = aws_sdk.String(aws.ExternalID)\n\t\t\t}\n\t\t})\n\t} else {\n\t\tif aws.AccessKey == \"\" || aws.SecretAccessKey == \"\" {\n\t\t\tlog.Fatal(\"Missing AccessKey or SecretAccessKey for AWS provider. Please check your configuration and retry\")\n\t\t}\n\t\tcreds = credentials.NewStaticCredentials(aws.AccessKey, aws.SecretAccessKey, aws.SessionToken)\n\t}\n\tawsConfig.WithCredentials(creds)\n\n\tif e := aws.Endpoint; e != \"\" {\n\t\tawsConfig.WithEndpoint(e)\n\t}\n\tif e := aws.Region; e != \"\" {\n\t\tawsConfig.WithRegion(e)\n\t}\n\tawsConfig.S3ForcePathStyle = &bucket.ForcePathStyle\n\n\treturn &AWS{\n\t\tsvc: s3.New(sess, awsConfig),\n\t\tbucket: bucket.Bucket,\n\t\tkeyPrefix: bucket.KeyPrefix,\n\t\tfileExtension: bucket.FileExtension,\n\t\tdynamoSvc: dynamodbiface.DynamoDBAPI(dynamodb.New(sess, awsConfig)),\n\t\tdynamoTable: aws.DynamoDBTable,\n\t\tnoLocks: noLocks,\n\t\tnoVersioning: noVersioning,\n\t}\n}", "func newAWSCommand() *cobra.Command {\n\tvar (\n\t\tclusterName string\n\t\troleARN string\n\t)\n\tvar command = &cobra.Command{\n\t\tUse: \"aws\",\n\t\tRun: func(c *cobra.Command, args []string) {\n\t\t\tctx := c.Context()\n\n\t\t\tpresignedURLString, err := getSignedRequestWithRetry(ctx, time.Minute, 5*time.Second, clusterName, roleARN, getSignedRequest)\n\t\t\terrors.CheckError(err)\n\t\t\ttoken := v1Prefix + base64.RawURLEncoding.EncodeToString([]byte(presignedURLString))\n\t\t\t// Set token expiration to 1 minute before the presigned URL expires for some cushion\n\t\t\ttokenExpiration := time.Now().Local().Add(presignedURLExpiration - 1*time.Minute)\n\t\t\t_, _ = fmt.Fprint(os.Stdout, formatJSON(token, tokenExpiration))\n\t\t},\n\t}\n\tcommand.Flags().StringVar(&clusterName, \"cluster-name\", \"\", \"AWS Cluster name\")\n\tcommand.Flags().StringVar(&roleARN, \"role-arn\", \"\", \"AWS Role ARN\")\n\treturn command\n}", "func Describe(serviceName string,\n\tserviceDescription string,\n\tlambdaAWSInfos []*LambdaAWSInfo,\n\tapi APIGateway,\n\ts3Site *S3Site,\n\ts3BucketName string,\n\tbuildTags string,\n\tlinkFlags string,\n\toutputWriter io.Writer,\n\tworkflowHooks *WorkflowHooks,\n\tlogger *logrus.Logger) error {\n\n\tvalidationErr := validateSpartaPreconditions(lambdaAWSInfos, logger)\n\tif validationErr != nil {\n\t\treturn validationErr\n\t}\n\tbuildID, buildIDErr := provisionBuildID(\"none\", logger)\n\tif buildIDErr != nil {\n\t\tbuildID = fmt.Sprintf(\"%d\", time.Now().Unix())\n\t}\n\tvar cloudFormationTemplate bytes.Buffer\n\terr := Provision(true,\n\t\tserviceName,\n\t\tserviceDescription,\n\t\tlambdaAWSInfos,\n\t\tapi,\n\t\ts3Site,\n\t\ts3BucketName,\n\t\tfalse,\n\t\tfalse,\n\t\tbuildID,\n\t\t\"\",\n\t\tbuildTags,\n\t\tlinkFlags,\n\t\t&cloudFormationTemplate,\n\t\tworkflowHooks,\n\t\tlogger)\n\tif nil != err {\n\t\treturn err\n\t}\n\n\ttmpl, err := template.New(\"description\").Parse(_escFSMustString(false, \"/resources/describe/template.html\"))\n\tif err != nil {\n\t\treturn errors.New(err.Error())\n\t}\n\n\t// Setup the describer\n\tdescriber := descriptionWriter{\n\t\tnodes: make([]*cytoscapeNode, 0),\n\t\tlogger: logger,\n\t}\n\n\t// Instead of inline mermaid stuff, we're going to stuff raw\n\t// json through. We can also include AWS images in the icon\n\t// using base64/encoded:\n\t// Example: https://cytoscape.github.io/cytoscape.js-tutorial-demo/datasets/social.json\n\t// Use the \"fancy\" CSS:\n\t// https://github.com/cytoscape/cytoscape.js-tutorial-demo/blob/gh-pages/stylesheets/fancy.json\n\t// Which is dynamically updated at: https://cytoscape.github.io/cytoscape.js-tutorial-demo/\n\n\t// Setup the root object\n\twriteErr := describer.writeNode(serviceName,\n\t\tnodeColorService,\n\t\t\"AWS-Architecture-Icons_SVG_20200131/SVG Light/Management & Governance/AWS-CloudFormation_Stack_light-bg.svg\")\n\tif writeErr != nil {\n\t\treturn writeErr\n\t}\n\tfor _, eachLambda := range lambdaAWSInfos {\n\t\t// Other cytoscape nodes\n\t\t// Create the node...\n\t\twriteErr = describer.writeNode(eachLambda.lambdaFunctionName(),\n\t\t\tnodeColorLambda,\n\t\t\t\"AWS-Architecture-Icons_SVG_20200131/SVG Light/Mobile/Amazon-API-Gateway_light-bg.svg\")\n\t\tif writeErr != nil {\n\t\t\treturn writeErr\n\t\t}\n\t\twriteErr = describer.writeEdge(eachLambda.lambdaFunctionName(),\n\t\t\tserviceName,\n\t\t\t\"\")\n\t\tif writeErr != nil {\n\t\t\treturn writeErr\n\t\t}\n\t\t// Create permission & event mappings\n\t\t// functions declared in this\n\t\tfor _, eachPermission := range eachLambda.Permissions {\n\t\t\tnodes, err := eachPermission.descriptionInfo()\n\t\t\tif nil != err {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfor _, eachNode := range nodes {\n\t\t\t\tname := strings.TrimSpace(eachNode.Name)\n\t\t\t\tlink := strings.TrimSpace(eachNode.Relation)\n\t\t\t\t// Style it to have the Amazon color\n\t\t\t\tnodeColor := eachNode.Color\n\t\t\t\tif nodeColor == \"\" {\n\t\t\t\t\tnodeColor = nodeColorEventSource\n\t\t\t\t}\n\n\t\t\t\twriteErr = describer.writeNode(name,\n\t\t\t\t\tnodeColor,\n\t\t\t\t\ticonForAWSResource(eachNode.Name))\n\t\t\t\tif writeErr != nil {\n\t\t\t\t\treturn writeErr\n\t\t\t\t}\n\t\t\t\twriteErr = describer.writeEdge(\n\t\t\t\t\tname,\n\t\t\t\t\teachLambda.lambdaFunctionName(),\n\t\t\t\t\tlink)\n\t\t\t\tif writeErr != nil {\n\t\t\t\t\treturn writeErr\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor index, eachEventSourceMapping := range eachLambda.EventSourceMappings {\n\t\t\tdynamicArn := spartaCF.DynamicValueToStringExpr(eachEventSourceMapping.EventSourceArn)\n\t\t\tjsonBytes, jsonBytesErr := json.Marshal(dynamicArn)\n\t\t\tif jsonBytesErr != nil {\n\t\t\t\tjsonBytes = []byte(fmt.Sprintf(\"%s-EventSourceMapping[%d]\",\n\t\t\t\t\teachLambda.lambdaFunctionName(),\n\t\t\t\t\tindex))\n\t\t\t}\n\t\t\tnodeName := string(jsonBytes)\n\t\t\twriteErr = describer.writeNode(nodeName,\n\t\t\t\tnodeColorEventSource,\n\t\t\t\ticonForAWSResource(dynamicArn))\n\t\t\tif writeErr != nil {\n\t\t\t\treturn writeErr\n\t\t\t}\n\t\t\twriteErr = describer.writeEdge(nodeName,\n\t\t\t\teachLambda.lambdaFunctionName(),\n\t\t\t\t\"\")\n\t\t\tif writeErr != nil {\n\t\t\t\treturn writeErr\n\t\t\t}\n\t\t}\n\t}\n\t// The API needs to know how to describe itself. So for that it needs an object that\n\t// encapsulates writing the nodes and links...so let's go ahead\n\t// and make that object, then supply it to the Describe interface function\n\n\t// API?\n\tif nil != api {\n\t\t// TODO - delegate\n\t\twriteErr := api.Describe(&describer)\n\t\tif writeErr != nil {\n\t\t\treturn writeErr\n\t\t}\n\t}\n\tcytoscapeBytes, cytoscapeBytesErr := json.MarshalIndent(describer.nodes, \"\", \" \")\n\tif cytoscapeBytesErr != nil {\n\t\treturn errors.Wrapf(cytoscapeBytesErr, \"Failed to marshal cytoscape data\")\n\t}\n\tparams := struct {\n\t\tSpartaVersion string\n\t\tServiceName string\n\t\tServiceDescription string\n\t\tCloudFormationTemplate string\n\t\tCSSFiles []*templateResource\n\t\tJSFiles []*templateResource\n\t\tImageMap map[string]string\n\t\tCytoscapeData interface{}\n\t}{\n\t\tSpartaGitHash[0:8],\n\t\tserviceName,\n\t\tserviceDescription,\n\t\tcloudFormationTemplate.String(),\n\t\ttemplateCSSFiles(logger),\n\t\ttemplateJSFiles(logger),\n\t\ttemplateImageMap(logger),\n\t\tstring(cytoscapeBytes),\n\t}\n\treturn tmpl.Execute(outputWriter, params)\n}", "func main() {\n\tif len(os.Args) != 3 {\n\t\texitErrorf(\"AMI ID and Instance Type are required\"+\n\t\t\t\"\\nUsage: %s image_id instance_type\", os.Args[0])\n\t}\n\n\n\t//Initialize the session that the SDK uses to load credentials from the shared credentials file ~/.aws/credentials\n\tsess, err := session.NewSession(&aws.Config{Region: aws.String(\"eu-west-1\")}, )\n\tsvc := ec2.New(sess)\n\tif err != nil {\n\t\texitErrorf(\"Error creating session, %v\", err)\n\t}\n\n}", "func (t *TemplateConfig) addFunctions(s *ServerlessConfig) {\n\tif len(t.Resources) == 0 {\n\t\tt.Resources = map[string]SAMFunction{}\n\t}\n\n\tfor n, f := range s.Functions {\n\t\tfName := flect.New(n).Camelize().String() + \"Function\"\n\t\t// ensure to add only http event functions\n\t\tev := f.Events[0].HTTP\n\t\tif ev != nil {\n\t\t\tt.Resources[fName] = SAMFunction{\n\t\t\t\tType: \"AWS::Serverless::Function\",\n\t\t\t\tProperties: SAMFnProp{\n\t\t\t\t\tRuntime: \"go1.x\",\n\t\t\t\t\tHandler: strings.TrimPrefix(f.Handler, \"bin/\"),\n\t\t\t\t\tCodeURI: \"debug\",\n\t\t\t\t\tEvents: map[string]SAMEvent{\n\t\t\t\t\t\t\"http\": SAMEvent{\n\t\t\t\t\t\t\tType: \"Api\",\n\t\t\t\t\t\t\tProperties: SAMProp{\n\t\t\t\t\t\t\t\tPath: \"/\" + ev.Path,\n\t\t\t\t\t\t\t\tMethod: ev.Method,\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}", "func (*DynamoConf) Name() string {\n\treturn \"aws\"\n}", "func (r *RestApi_S3Location) AWSCloudFormationType() string {\n\treturn \"AWS::ApiGateway::RestApi.S3Location\"\n}", "func AddAutoIncrementingLambdaVersionResource(serviceName string,\n\tlambdaResourceName string,\n\tcfTemplate *gocf.Template,\n\tlogger *logrus.Logger) (*AutoIncrementingLambdaVersionInfo, error) {\n\n\t// Get the template\n\tsession, sessionErr := session.NewSession()\n\tif sessionErr != nil {\n\t\treturn nil, sessionErr\n\t}\n\n\t// Get the current template - for each version we find in the version listing\n\t// we look up the actual CF resource and copy it into this template\n\texistingStackDefinition, existingStackDefinitionErr := existingStackTemplate(serviceName,\n\t\tsession,\n\t\tlogger)\n\tif nil != existingStackDefinitionErr {\n\t\treturn nil, existingStackDefinitionErr\n\t}\n\n\t// TODO - fetch the template and look up the resources\n\texistingVersions, existingVersionsErr := existingLambdaResourceVersions(serviceName,\n\t\tlambdaResourceName,\n\t\tsession,\n\t\tlogger)\n\tif nil != existingVersionsErr {\n\t\treturn nil, existingVersionsErr\n\t}\n\n\t// Initialize the auto incrementing version struct\n\tautoIncrementingLambdaVersionInfo := AutoIncrementingLambdaVersionInfo{\n\t\tCurrentVersion: 0,\n\t\tCurrentVersionResourceName: \"\",\n\t\tVersionHistory: make(map[int]string, 0),\n\t}\n\n\tlambdaVersionResourceName := func(versionIndex int) string {\n\t\treturn sparta.CloudFormationResourceName(lambdaResourceName,\n\t\t\t\"version\",\n\t\t\tstrconv.Itoa(versionIndex))\n\t}\n\n\tif nil != existingVersions {\n\t\t// Add the CloudFormation resource\n\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\"VersionCount\": len(existingVersions.Versions) - 1, // Ignore $LATEST\n\t\t\t\"ResourceName\": lambdaResourceName,\n\t\t}).Info(\"Total number of published versions\")\n\n\t\tfor _, eachEntry := range existingVersions.Versions {\n\t\t\tversionIndex, versionIndexErr := strconv.Atoi(*eachEntry.Version)\n\t\t\tif nil == versionIndexErr {\n\t\t\t\t// Find the existing resource...\n\t\t\t\tversionResourceName := lambdaVersionResourceName(versionIndex)\n\t\t\t\tif nil == existingStackDefinition {\n\t\t\t\t\treturn nil, fmt.Errorf(\"Unable to find exising Version resource in nil Template\")\n\t\t\t\t}\n\t\t\t\tcfResourceDefinition, cfResourceDefinitionExists := existingStackDefinition.Resources[versionResourceName]\n\t\t\t\tif !cfResourceDefinitionExists {\n\t\t\t\t\treturn nil, fmt.Errorf(\"Unable to find exising Version resource (Resource: %s, Version: %d) in template\",\n\t\t\t\t\t\tversionResourceName,\n\t\t\t\t\t\tversionIndex)\n\t\t\t\t}\n\t\t\t\tcfTemplate.Resources[versionResourceName] = cfResourceDefinition\n\t\t\t\t// Add the CloudFormation resource\n\t\t\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\t\t\"Version\": versionIndex,\n\t\t\t\t\t\"ResourceName\": versionResourceName,\n\t\t\t\t}).Debug(\"Preserving Lambda version\")\n\n\t\t\t\t// Store the state, tracking the latest version\n\t\t\t\tautoIncrementingLambdaVersionInfo.VersionHistory[versionIndex] = versionResourceName\n\t\t\t\tif versionIndex > autoIncrementingLambdaVersionInfo.CurrentVersion {\n\t\t\t\t\tautoIncrementingLambdaVersionInfo.CurrentVersion = versionIndex\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Bump the version and add a new entry...\n\tautoIncrementingLambdaVersionInfo.CurrentVersion++\n\tversionResource := &gocf.LambdaVersion{\n\t\tFunctionName: gocf.GetAtt(lambdaResourceName, \"Arn\").String(),\n\t}\n\tautoIncrementingLambdaVersionInfo.CurrentVersionResourceName = lambdaVersionResourceName(autoIncrementingLambdaVersionInfo.CurrentVersion)\n\tcfTemplate.AddResource(autoIncrementingLambdaVersionInfo.CurrentVersionResourceName, versionResource)\n\n\t// Log the version we're about to publish...\n\tlogger.WithFields(logrus.Fields{\n\t\t\"ResourceName\": lambdaResourceName,\n\t\t\"StackVersion\": autoIncrementingLambdaVersionInfo.CurrentVersion,\n\t}).Info(\"Inserting new version resource\")\n\n\treturn &autoIncrementingLambdaVersionInfo, nil\n}", "func resourceKeboolaAWSS3ExtractorCreate(d *schema.ResourceData, meta interface{}) error {\n\tlog.Println(\"[INFO] Creating S3Extractor Bucket in Keboola\")\n\n\ts3BucketExtractorConfiguration := S3BucketExtractorConfiguration{\n\t\tParameters: S3BucketExtractorConfigurationParameters{\n\t\t\tAccessKeyId: d.Get(\"access_key_id\").(string),\n\t\t\tEncryptedAccessKeySecret: d.Get(\"access_key\").(string),\n\t\t},\n\t}\n\n\ts3BucketExtractorConfigJSON, err := json.Marshal(s3BucketExtractorConfiguration)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcreateS3BucketForm := url.Values{}\n\tcreateS3BucketForm.Add(\"name\", d.Get(\"name\").(string))\n\tcreateS3BucketForm.Add(\"description\", d.Get(\"description\").(string))\n\tcreateS3BucketForm.Add(\"configuration\", string(s3BucketExtractorConfigJSON))\n\n\tcreateS3BucketBuffer := buffer.FromForm(createS3BucketForm)\n\n\tclient := meta.(*KBCClient)\n\tcreateResponse, err := client.PostToStorage(\"storage/components/keboola.ex-aws-s3/configs\", createS3BucketBuffer)\n\n\tif hasErrors(err, createResponse) {\n\t\treturn extractError(err, createResponse)\n\t}\n\n\tvar createResult CreateResourceResult\n\n\tdecoder := json.NewDecoder(createResponse.Body)\n\terr = decoder.Decode(&createResult)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.SetId(string(createResult.ID))\n\n\treturn resourceKeboolaAWSS3ExtractorRead(d, meta)\n}", "func CreateStackResources(stackID string, subscription dynamodb.APISubscription) error {\n\n\t// Lamba environment variables\n\n\tvar amiID = os.Getenv(\"AMI_ID\")\n\tvar securityGroup = os.Getenv(\"SECURITY_GROUP\")\n\tvar subNet = os.Getenv(\"SUBNET\")\n\tvar keyName = os.Getenv(\"KEY_NAME\")\n\tvar instanceType = os.Getenv(\"INSTANCE_TYPE\")\n\tvar iamRole = os.Getenv(\"IAM_ROLE\")\n\n\t// Create a new CloudFormation template\n\ttemplate := cloudformation.NewTemplate()\n\n\t// StackID with 'PI' as a prefix to avoid\n\t// duplicate stack names in CloudFormation\n\tid := stackID\n\n\ttags := []tags.Tag{\n\t\ttags.Tag{\n\t\t\tKey: \"Product\",\n\t\t\tValue: \"MaxEdge\",\n\t\t},\n\t\t// This tag is used to display the \"Name\" in the console\n\t\ttags.Tag{\n\t\t\tKey: \"Name\",\n\t\t\tValue: id,\n\t\t},\n\t}\n\n\t// Declaring the PI .exe for teh service to deal with the qoutes\n\t// being stripped off and not workign in PowerShell\n\tpiToPi := `C:\\Program Files (x86)\\PIPC\\Interfaces\\PItoPI\\PItoPI.exe`\n\n\t// Pi .bat file needed for the Pi interface service\n\t// The source, destination and ports are added to this string and passed in as parameters\n\t// from the user.\n\t// The PowerShell commands that updates the .bat file that is on the AMI\n\t// with the client passed in parameters.\n\t// PowerShell command and the \"<powershell></powershell>\" is required when\n\t// using UserDate in EC2 and using PowerShell commands\n\t// Then changes the directory to the location of the nssm program to start the PItoPIInt service.\n\t// Services will restart on reboot or instance restart\n\tuserData := fmt.Sprintf(`<powershell> \n\tSet-Content -Path \"C:\\Program Files (x86)\\PIPC\\Interfaces\\PItoPI\\PItoPIInt.bat\" -Value '\"`+piToPi+`\" Int /src_host=%s:%s /PS=%s /ID=%s /host=%s:%s /pisdk=0 /maxstoptime=120 /PercentUp=100 /sio /perf=8 /f=00:00:01'\n\tcd \"C:\\Program Files (x86)\\PIPC\\Interfaces\\PItoPI\\\"; .\\nssm start PItoPIInt \n\t</powershell>\n\t<persist>true</persist>`, subscription.SourceIP, subscription.SourcePort, id, id, subscription.DestinationIP, subscription.DestinationPort)\n\n\t// Required base64 encoding\n\t// If you are using a command line tool, base64-encoding is performed\n\t// for you, and you can load the text from a file. Otherwise, you must provide\n\t// base64-encoded text. User data is limited to 16 KB.\n\tencodeUserDate := e64.StdEncoding.EncodeToString([]byte(userData))\n\n\t// CloudFormation E2 properties\n\ttemplate.Resources[\"EC2Pi\"] = &ec2.Instance{\n\t\tImageId: (amiID),\n\t\tKeyName: (keyName),\n\t\tInstanceType: (instanceType),\n\t\tSecurityGroupIds: []string{securityGroup},\n\t\tSubnetId: (subNet),\n\t\tIamInstanceProfile: (iamRole),\n\t\tUserData: encodeUserDate,\n\t\tTags: (tags),\n\t}\n\n\t// Get JSON form of AWS CloudFormation template\n\tj, err := template.JSON()\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to generate JSON: %s\\n\", err)\n\t\treturn err\n\t}\n\tfmt.Printf(\"Template creation for %s Done.\\n\", id)\n\tfmt.Println(\"=====\")\n\tfmt.Println(\"Generated template:\")\n\tfmt.Printf(\"%s\\n\", string(j))\n\tfmt.Println(\"=====\")\n\n\t// Initialize a session that the SDK uses to load\n\t// credentials from the shared credentials file ~/.aws/credentials\n\t// and configuration from the shared configuration file ~/.aws/config.\n\t// https://docs.aws.amazon.com/sdk-for-go/api/aws/session/\n\tsess := session.Must(session.NewSessionWithOptions(session.Options{\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t}))\n\n\t// Create the stack\n\terr = createStackFromBody(sess, j, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (r *Function_HttpApiFunctionAuth) AWSCloudFormationType() string {\n\treturn \"AWS::Serverless::Function.HttpApiFunctionAuth\"\n}", "func initAWSSvc() *s3.S3 {\n\tsess, err := session.NewSession()\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\n\tsdkLoadConfig := os.Getenv(\"AWS_SDK_LOAD_CONFIG\")\n\tif sdkLoadConfig != \"true\" {\n\t\tlog.Fatal(`Env var \"AWS_SDK_LOAD_CONFIG\" needs to be true to read credentials.\\n\\n Run \"export AWS_SDK_LOAD_CONFIG=true\" to fix this. Aborting run.`)\n\t}\n\n\treturn s3.New(sess)\n}", "func getResourceFunc(\n\tfieldinf *fieldInfo, v reflect.Value) (reflect.Value, error) {\n\n\tvar fn reflect.Value\n\n\t// first search methods\n\tfn = v.MethodByName(fieldinf.MethodName())\n\tif fn.IsValid() {\n\t\treturn fn, nil\n\t}\n\n\t// then search fields\n\tfn = v.FieldByName(fieldinf.Name)\n\tif fn.IsValid() && !reflect.ValueOf(fn.Interface()).IsNil() {\n\t\treturn fn, nil\n\t}\n\n\treturn fn, errActionNotFound(fieldinf.Name)\n}", "func setupS3(ctx context.Context, s3 *s3Config, forETL bool) (res fileservice.FileService, readPath string, err error) {\n\treturn setupFileservice(ctx, &pathConfig{\n\t\tisS3: true,\n\t\tforETL: forETL,\n\t\ts3Config: *s3,\n\t})\n}", "func (r *Api) AWSCloudFormationType() string {\n\treturn \"AWS::Serverless::Api\"\n}", "func (m *AmazonResourceEvidence) SetResourceName(value *string)() {\n err := m.GetBackingStore().Set(\"resourceName\", value)\n if err != nil {\n panic(err)\n }\n}", "func expandServiceEndpointAws(d *schema.ResourceData) (*serviceendpoint.ServiceEndpoint, *string, error) {\n\tserviceEndpoint, projectID := doBaseExpansion(d)\n\tserviceEndpoint.Authorization = &serviceendpoint.EndpointAuthorization{\n\t\tParameters: &map[string]string{\n\t\t\t\"username\": d.Get(\"access_key_id\").(string),\n\t\t\t\"password\": d.Get(\"secret_access_key\").(string),\n\t\t\t\"sessionToken\": d.Get(\"session_token\").(string),\n\t\t\t\"assumeRoleArn\": d.Get(\"role_to_assume\").(string),\n\t\t\t\"roleSessionName\": d.Get(\"role_session_name\").(string),\n\t\t\t\"externalId\": d.Get(\"external_id\").(string),\n\t\t},\n\t\tScheme: converter.String(\"UsernamePassword\"),\n\t}\n\tserviceEndpoint.Type = converter.String(\"aws\")\n\tserviceEndpoint.Url = converter.String(\"https://aws.amazon.com/\")\n\treturn serviceEndpoint, projectID, nil\n}", "func NewAWS(ctx arn.Ctx, r ...Router) *AWS {\n\troot := append(ChainRouter{STSRouter{}}, r...)\n\tw := &AWS{\n\t\tCtxRouter: CtxRouter{arn.Ctx{}: &root},\n\t\tCtx: ctx,\n\t}\n\tw.Cfg = awsmock.Config(func(q *aws.Request) {\n\t\tw.mu.Lock()\n\t\tdefer w.mu.Unlock()\n\t\tif q := w.newRequest(q); !w.Route(q) {\n\t\t\tpanic(\"mock: \" + q.Name() + \" not handled\")\n\t\t}\n\t})\n\tw.Cfg.Region = ctx.Region\n\tw.Cfg.Credentials = w.UserCreds(\"\", \"alice\")\n\treturn w\n}", "func awsConnect(i *AwsInfo) *s3.Bucket {\n\tAWSAuth := aws.Auth{\n\t\tAccessKey: i.AccessKey,\n\t\tSecretKey: i.SecretKey,\n\t}\n\tregion := aws.USEast\n\tconnection := s3.New(AWSAuth, region)\n\n\treturn connection.Bucket(i.Bucket)\n}", "func Configure(p *config.Provider) {\n\tp.AddResourceConfigurator(\"aws_instance\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t\tr.References[\"vpc_security_group_ids\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupIdRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupIdSelector\",\n\t\t}\n\t\tr.References[\"security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"root_block_device.kms_key_id\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2.Key\",\n\t\t}\n\t\tr.References[\"network_interface.network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"ebs_block_device.kms_key_id\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2.Key\",\n\t\t}\n\t\tr.LateInitializer = config.LateInitializer{\n\t\t\t// NOTE(muvaf): These are ignored because they conflict with each other.\n\t\t\t// See the following for more details: https://github.com/crossplane/terrajet/issues/107\n\t\t\tIgnoredFields: []string{\n\t\t\t\t\"subnet_id\",\n\t\t\t\t\"network_interface\",\n\t\t\t\t\"private_ip\",\n\t\t\t\t\"source_dest_check\",\n\t\t\t},\n\t\t}\n\t})\n\tp.AddResourceConfigurator(\"aws_eip\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"instance\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t\tr.References[\"network_interface\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.UseAsync = true\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t\tr.References[\"transit_gateway_route_table_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayRouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route_table\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_id\"] = config.Reference{\n\t\t\tType: \"TransitGateway\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route_table_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t\tr.References[\"transit_gateway_route_table_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayRouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_vpc_attachment\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_ids\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t\tRefFieldName: \"SubnetIdRefs\",\n\t\t\tSelectorFieldName: \"SubnetIdSelector\",\n\t\t}\n\t\tr.References[\"transit_gateway_id\"] = config.Reference{\n\t\t\tType: \"TransitGateway\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_vpc_attachment_accepter\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_launch_template\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"security_group_names\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupNameRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupNameSelector\",\n\t\t}\n\t\tr.References[\"vpc_security_group_ids\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\n\t\t\tRefFieldName: \"VpcSecurityGroupIdRefs\",\n\t\t\tSelectorFieldName: \"VpcSecurityGroupIdSelector\",\n\t\t}\n\t\tr.References[\"block_device_mappings.ebs.kms_key_id\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2.Key\",\n\t\t}\n\t\tr.References[\"iam_instance_profile.arn\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/iam/v1alpha2.InstanceProfile\",\n\t\t\tExtractor: common.PathARNExtractor,\n\t\t}\n\t\tr.References[\"iam_instance_profile.name\"] = config.Reference{\n\t\t\tType: \"github.com/crossplane-contrib/provider-jet-aws/apis/iam/v1alpha2.InstanceProfile\",\n\t\t}\n\t\tr.References[\"network_interfaces.network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"network_interfaces.security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"network_interfaces.subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc_endpoint\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_ids\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t\tRefFieldName: \"SubnetIdRefs\",\n\t\t\tSelectorFieldName: \"SubnetIdSelector\",\n\t\t}\n\t\tr.References[\"security_group_ids\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupIdRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupIdSelector\",\n\t\t}\n\t\tr.References[\"route_table_ids\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t\tRefFieldName: \"RouteTableIdRefs\",\n\t\t\tSelectorFieldName: \"RouteTableIdSelector\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_subnet\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.LateInitializer = config.LateInitializer{\n\t\t\t// NOTE(muvaf): Conflicts with AvailabilityZone. See the following\n\t\t\t// for more details: https://github.com/crossplane/terrajet/issues/107\n\t\t\tIgnoredFields: []string{\n\t\t\t\t\"availability_zone_id\",\n\t\t\t},\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_network_interface\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t\tr.References[\"security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"attachment.instance\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t\tr.LateInitializer = config.LateInitializer{\n\t\t\tIgnoredFields: []string{\n\t\t\t\t\"interface_type\",\n\t\t\t},\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_security_group\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\t// Managed by SecurityGroupRule resource.\n\t\tif s, ok := r.TerraformResource.Schema[\"ingress\"]; ok {\n\t\t\ts.Optional = false\n\t\t\ts.Computed = true\n\t\t}\n\t\t// Managed by SecurityGroupRule resource.\n\t\tif s, ok := r.TerraformResource.Schema[\"egress\"]; ok {\n\t\t\ts.Optional = false\n\t\t\ts.Computed = true\n\t\t}\n\t\tr.References[\"egress.security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t\tr.References[\"ingress.security_groups\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t\tRefFieldName: \"SecurityGroupRefs\",\n\t\t\tSelectorFieldName: \"SecurityGroupSelector\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_security_group_rule\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"security_group_id\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t}\n\t\tr.References[\"source_security_group_id\"] = config.Reference{\n\t\t\tType: \"SecurityGroup\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc_ipv4_cidr_block_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n\n\tp.AddResourceConfigurator(\"aws_vpc_peering_connection\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"peer_vpc_id\"] = config.Reference{\n\t\t\tType: \"VPC\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_route\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"route_table_id\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t}\n\t\tr.References[\"gateway_id\"] = config.Reference{\n\t\t\tType: \"InternetGateway\",\n\t\t}\n\t\tr.References[\"instance_id\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t\tr.References[\"network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"transit_gateway_id\"] = config.Reference{\n\t\t\tType: \"TransitGateway\",\n\t\t}\n\t\tr.References[\"vpc_peering_connection_id\"] = config.Reference{\n\t\t\tType: \"VPCPeeringConnection\",\n\t\t}\n\t\tr.References[\"vpc_endpoint_id\"] = config.Reference{\n\t\t\tType: \"VPCEndpoint\",\n\t\t}\n\t\tr.UseAsync = true\n\t})\n\n\tp.AddResourceConfigurator(\"aws_route_table\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"route.vpc_peering_connection_id\"] = config.Reference{\n\t\t\tType: \"VPCPeeringConnection\",\n\t\t}\n\t\tr.References[\"route.vpc_endpoint_id\"] = config.Reference{\n\t\t\tType: \"VPCEndpoint\",\n\t\t}\n\t\tr.References[\"route.network_interface_id\"] = config.Reference{\n\t\t\tType: \"NetworkInterface\",\n\t\t}\n\t\tr.References[\"route.instance_id\"] = config.Reference{\n\t\t\tType: \"Instance\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_route_table_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"subnet_id\"] = config.Reference{\n\t\t\tType: \"Subnet\",\n\t\t}\n\t\tr.References[\"route_table_id\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_main_route_table_association\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"route_table_id\"] = config.Reference{\n\t\t\tType: \"RouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_ec2_transit_gateway_route_table_propagation\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t\tr.References[\"transit_gateway_attachment_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayVPCAttachment\",\n\t\t}\n\t\tr.References[\"transit_gateway_route_table_id\"] = config.Reference{\n\t\t\tType: \"TransitGatewayRouteTable\",\n\t\t}\n\t})\n\n\tp.AddResourceConfigurator(\"aws_internet_gateway\", func(r *config.Resource) {\n\t\tr.Version = common.VersionV1Alpha2\n\t\tr.ExternalName = config.IdentifierFromProvider\n\t})\n}", "func (r *ImageRegistryResource) decorate() (err error) {\n\treturn\n}", "func (r *AWSServerlessFunction_AlexaSkillEvent) AWSCloudFormationType() string {\n\treturn \"AWS::Serverless::Function.AlexaSkillEvent\"\n}", "func New(auth stacks.AuthenticationOptions, localCfg stacks.AWSConfiguration, cfg stacks.ConfigurationOptions) (*stack, error) { // nolint\n\tif localCfg.Ec2Endpoint == \"\" {\n\t\tlocalCfg.Ec2Endpoint = fmt.Sprintf(\"https://ec2.%s.amazonaws.com\", localCfg.Region)\n\t}\n\tif localCfg.SsmEndpoint == \"\" {\n\t\tlocalCfg.SsmEndpoint = fmt.Sprintf(\"https://ssm.%s.amazonaws.com\", localCfg.Region)\n\t}\n\n\tstack := &stack{\n\t\tConfig: &cfg,\n\t\tAuthOptions: &auth,\n\t\tAwsConfig: &localCfg,\n\t}\n\n\taccessKeyID := auth.AccessKeyID\n\tsecretAccessKey := auth.SecretAccessKey\n\n\tss3 := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(localCfg.Region),\n\t\tEndpoint: aws.String(localCfg.S3Endpoint),\n\t}))\n\n\tsec2 := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(localCfg.Region),\n\t\tEndpoint: aws.String(localCfg.Ec2Endpoint),\n\t}))\n\n\tsssm := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(localCfg.Region),\n\t\tEndpoint: aws.String(localCfg.SsmEndpoint),\n\t}))\n\n\tspricing := session.Must(session.NewSession(&aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, \"\"),\n\t\tS3ForcePathStyle: aws.Bool(true),\n\t\tRegion: aws.String(endpoints.UsEast1RegionID),\n\t}))\n\n\tstack.S3Service = s3.New(ss3, &aws.Config{})\n\tstack.EC2Service = ec2.New(sec2, &aws.Config{})\n\tstack.SSMService = ssm.New(sssm, &aws.Config{})\n\tstack.PricingService = pricing.New(spricing, &aws.Config{})\n\n\tif cfg.Timings != nil {\n\t\tstack.MutableTimings = cfg.Timings\n\t} else {\n\t\tstack.MutableTimings = temporal.NewTimings()\n\t}\n\n\treturn stack, nil\n}", "func getAWSClient(ctx context.Context, conf *config.Config, sess *session.Session, region config.Region) (*cziAWS.Client, error) {\n\t// for things meant to be run as a user\n\tuserConf := &aws.Config{\n\t\tRegion: aws.String(region.AWSRegion),\n\t}\n\n\tlambdaConf := userConf\n\tif conf.LambdaConfig.RoleARN != nil {\n\t\t// for things meant to be run as an assumed role\n\t\tlambdaConf = &aws.Config{\n\t\t\tRegion: aws.String(region.AWSRegion),\n\t\t\tCredentials: stscreds.NewCredentials(\n\t\t\t\tsess,\n\t\t\t\t*conf.LambdaConfig.RoleARN, func(p *stscreds.AssumeRoleProvider) {\n\t\t\t\t\tp.TokenProvider = stscreds.StdinTokenProvider\n\t\t\t\t},\n\t\t\t),\n\t\t}\n\t}\n\tawsClient := cziAWS.New(sess).\n\t\tWithIAM(userConf).\n\t\tWithKMS(userConf).\n\t\tWithSTS(userConf).\n\t\tWithLambda(lambdaConf)\n\treturn awsClient, nil\n}", "func main() {\n // Initialize a session in us-west-2 that the SDK will use to load\n // credentials from the shared credentials file ~/.aws/credentials.\n sess, err := session.NewSession(&aws.Config{\n Region: aws.String(\"us-east-1\")},\n )\n\n // Create S3 service client\n svc := s3.New(sess)\n\n req, _ := svc.GetObjectRequest(&s3.GetObjectInput{\n Bucket: aws.String(\"myBucket\"),\n Key: aws.String(\"myKey\"),\n })\n urlStr, err := req.Presign(15 * time.Minute)\n\n if err != nil {\n log.Println(\"Failed to sign request\", err)\n }\n\n log.Println(\"The URL is\", urlStr)\n}", "func (m *Middleware) Resource(resourceName string, resource Resource) {\n\tresourcePath := fmt.Sprintf(\"%s/{%s}\", resourceName, resource.Identifier())\n\tm.engine.registerRoute(http.MethodGet, resourceName, m.apply(resource.Index))\n\tm.engine.registerRoute(http.MethodGet, resourcePath, m.apply(resource.Get))\n\tm.engine.registerRoute(http.MethodPut, resourcePath, m.apply(resource.Put))\n\tm.engine.registerRoute(http.MethodDelete, resourcePath, m.apply(resource.Delete))\n\tm.engine.registerRoute(http.MethodPost, resourceName, m.apply(resource.Post))\n}", "func getAwsRegion() (region string) {\n\tregion, _ = getAwsRegionE()\n\treturn\n}", "func testResource(t *testing.T, s *Service) {\n\tp := &model.ArgRes{\n\t\tResID: 1233,\n\t}\n\tres, err := s.Resource(context.TODO(), p)\n\tif err != nil {\n\t\tt.Logf(\"testResource error(%v) \\n\", err)\n\t\treturn\n\t}\n\tt.Logf(\"testResource res: %+v \\n\", res)\n}", "func ExampleRDS_AddTagsToResource_shared00() {\n\tsvc := rds.New(session.New())\n\tinput := &rds.AddTagsToResourceInput{\n\t\tResourceName: aws.String(\"arn:aws:rds:us-east-1:992648334831:og:mymysqloptiongroup\"),\n\t\tTags: []*rds.Tag{\n\t\t\t{\n\t\t\t\tKey: aws.String(\"Staging\"),\n\t\t\t\tValue: aws.String(\"LocationDB\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tresult, err := svc.AddTagsToResource(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase rds.ErrCodeDBInstanceNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())\n\t\t\tcase rds.ErrCodeDBClusterNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())\n\t\t\tcase rds.ErrCodeDBSnapshotNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())\n\t\t\tcase rds.ErrCodeDBProxyNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeDBProxyNotFoundFault, aerr.Error())\n\t\t\tcase rds.ErrCodeDBProxyTargetGroupNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeDBProxyTargetGroupNotFoundFault, aerr.Error())\n\t\t\tcase rds.ErrCodeBlueGreenDeploymentNotFoundFault:\n\t\t\t\tfmt.Println(rds.ErrCodeBlueGreenDeploymentNotFoundFault, aerr.Error())\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}", "func Provider() terraform.ResourceProvider {\n\tvar p *schema.Provider\n\tp = &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"subscription_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_SUBSCRIPTION_ID\", \"\"),\n\t\t\t},\n\n\t\t\t\"client_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_CLIENT_ID\", \"\"),\n\t\t\t},\n\n\t\t\t\"client_secret\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_CLIENT_SECRET\", \"\"),\n\t\t\t},\n\n\t\t\t\"tenant_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_TENANT_ID\", \"\"),\n\t\t\t},\n\n\t\t\t\"environment\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_ENVIRONMENT\", \"public\"),\n\t\t\t},\n\n\t\t\t\"skip_provider_registration\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"ARM_SKIP_PROVIDER_REGISTRATION\", false),\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"azurerm_client_config\": dataSourceArmClientConfig(),\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t// These resources use the Azure ARM SDK\n\t\t\t\"azurerm_availability_set\": resourceArmAvailabilitySet(),\n\t\t\t\"azurerm_cdn_endpoint\": resourceArmCdnEndpoint(),\n\t\t\t\"azurerm_cdn_profile\": resourceArmCdnProfile(),\n\t\t\t\"azurerm_container_registry\": resourceArmContainerRegistry(),\n\t\t\t\"azurerm_container_service\": resourceArmContainerService(),\n\n\t\t\t\"azurerm_eventhub\": resourceArmEventHub(),\n\t\t\t\"azurerm_eventhub_authorization_rule\": resourceArmEventHubAuthorizationRule(),\n\t\t\t\"azurerm_eventhub_consumer_group\": resourceArmEventHubConsumerGroup(),\n\t\t\t\"azurerm_eventhub_namespace\": resourceArmEventHubNamespace(),\n\n\t\t\t\"azurerm_lb\": resourceArmLoadBalancer(),\n\t\t\t\"azurerm_lb_backend_address_pool\": resourceArmLoadBalancerBackendAddressPool(),\n\t\t\t\"azurerm_lb_nat_rule\": resourceArmLoadBalancerNatRule(),\n\t\t\t\"azurerm_lb_nat_pool\": resourceArmLoadBalancerNatPool(),\n\t\t\t\"azurerm_lb_probe\": resourceArmLoadBalancerProbe(),\n\t\t\t\"azurerm_lb_rule\": resourceArmLoadBalancerRule(),\n\n\t\t\t\"azurerm_managed_disk\": resourceArmManagedDisk(),\n\n\t\t\t\"azurerm_key_vault\": resourceArmKeyVault(),\n\t\t\t\"azurerm_local_network_gateway\": resourceArmLocalNetworkGateway(),\n\t\t\t\"azurerm_network_interface\": resourceArmNetworkInterface(),\n\t\t\t\"azurerm_network_security_group\": resourceArmNetworkSecurityGroup(),\n\t\t\t\"azurerm_network_security_rule\": resourceArmNetworkSecurityRule(),\n\t\t\t\"azurerm_public_ip\": resourceArmPublicIp(),\n\t\t\t\"azurerm_redis_cache\": resourceArmRedisCache(),\n\t\t\t\"azurerm_route\": resourceArmRoute(),\n\t\t\t\"azurerm_route_table\": resourceArmRouteTable(),\n\t\t\t\"azurerm_servicebus_namespace\": resourceArmServiceBusNamespace(),\n\t\t\t\"azurerm_servicebus_subscription\": resourceArmServiceBusSubscription(),\n\t\t\t\"azurerm_servicebus_topic\": resourceArmServiceBusTopic(),\n\t\t\t\"azurerm_storage_account\": resourceArmStorageAccount(),\n\t\t\t\"azurerm_storage_blob\": resourceArmStorageBlob(),\n\t\t\t\"azurerm_storage_container\": resourceArmStorageContainer(),\n\t\t\t\"azurerm_storage_share\": resourceArmStorageShare(),\n\t\t\t\"azurerm_storage_queue\": resourceArmStorageQueue(),\n\t\t\t\"azurerm_storage_table\": resourceArmStorageTable(),\n\t\t\t\"azurerm_subnet\": resourceArmSubnet(),\n\t\t\t\"azurerm_template_deployment\": resourceArmTemplateDeployment(),\n\t\t\t\"azurerm_traffic_manager_endpoint\": resourceArmTrafficManagerEndpoint(),\n\t\t\t\"azurerm_traffic_manager_profile\": resourceArmTrafficManagerProfile(),\n\t\t\t\"azurerm_virtual_machine_extension\": resourceArmVirtualMachineExtensions(),\n\t\t\t\"azurerm_virtual_machine\": resourceArmVirtualMachine(),\n\t\t\t\"azurerm_virtual_machine_scale_set\": resourceArmVirtualMachineScaleSet(),\n\t\t\t\"azurerm_virtual_network\": resourceArmVirtualNetwork(),\n\t\t\t\"azurerm_virtual_network_peering\": resourceArmVirtualNetworkPeering(),\n\n\t\t\t// These resources use the Riviera SDK\n\t\t\t\"azurerm_dns_a_record\": resourceArmDnsARecord(),\n\t\t\t\"azurerm_dns_aaaa_record\": resourceArmDnsAAAARecord(),\n\t\t\t\"azurerm_dns_cname_record\": resourceArmDnsCNameRecord(),\n\t\t\t\"azurerm_dns_mx_record\": resourceArmDnsMxRecord(),\n\t\t\t\"azurerm_dns_ns_record\": resourceArmDnsNsRecord(),\n\t\t\t\"azurerm_dns_srv_record\": resourceArmDnsSrvRecord(),\n\t\t\t\"azurerm_dns_txt_record\": resourceArmDnsTxtRecord(),\n\t\t\t\"azurerm_dns_zone\": resourceArmDnsZone(),\n\t\t\t\"azurerm_resource_group\": resourceArmResourceGroup(),\n\t\t\t\"azurerm_search_service\": resourceArmSearchService(),\n\t\t\t\"azurerm_sql_database\": resourceArmSqlDatabase(),\n\t\t\t\"azurerm_sql_firewall_rule\": resourceArmSqlFirewallRule(),\n\t\t\t\"azurerm_sql_server\": resourceArmSqlServer(),\n\t\t},\n\t}\n\n\tp.ConfigureFunc = providerConfigure(p)\n\n\treturn p\n}", "func getResource(mapping *meta.RESTMapping, config *rest.Config, group string,\n\tversion string, namespace string, name string) error {\n\trestClient, err := getRESTClient(config, group, version)\n\tif err != nil {\n\t\treturn &kfapis.KfError{\n\t\t\tCode: int(kfapis.INVALID_ARGUMENT),\n\t\t\tMessage: fmt.Sprintf(\"getResource error: %v\", err),\n\t\t}\n\t}\n\n\tif _, err = restClient.\n\t\tGet().\n\t\tResource(mapping.Resource.Resource).\n\t\tNamespaceIfScoped(namespace, mapping.Scope.Name() == \"namespace\").\n\t\tName(name).\n\t\tDo().\n\t\tGet(); err == nil {\n\t\treturn nil\n\t} else {\n\t\treturn &kfapis.KfError{\n\t\t\tCode: int(kfapis.INVALID_ARGUMENT),\n\t\t\tMessage: fmt.Sprintf(\"getResource error: %v\", err),\n\t\t}\n\t}\n}", "func (c *config) run(req *events.Request) (map[string]string, error) {\n\t// Check for the correct ResourceType\n\tif req.ResourceType != resourceType {\n\t\treturn nil, fmt.Errorf(\"Wrong ResourceType in request. Expected %s but got %s\", resourceType, req.ResourceType)\n\t}\n\n\t// Check if the client already exists.\n\tclient, err := c.getClientByName(c.resourceProperties.UserPoolID, c.resourceProperties.ClientName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to execute API call against Cognito. Error %s\", err.Error())\n\t}\n\n\tswitch {\n\t// If Delete is run on the resource but the Client doesn't exist.\n\tcase req.RequestType == \"Delete\" && client == nil:\n\t\treturn nil, nil\n\n\t// If Delete is run on the resource.\n\tcase req.RequestType == \"Delete\" && client != nil:\n\t\treturn nil, c.deleteClient(req, client.id)\n\n\t// If Update is run on the resource but the Client doesn't exist\n\t// create it. If it was a resource that needed replacement a delete event\n\t// will be sent on the old resource once the new one has been created.\n\tcase req.RequestType == \"Update\" && client == nil:\n\t\treturn c.createClient(req)\n\n\t// If Update is run on the resource.\n\tcase req.RequestType == \"Update\" && client != nil:\n\t\treturn c.updateClient(req, client.id)\n\n\t// If Create is run on the resource but the Client doesn't exist.\n\tcase req.RequestType == \"Create\" && client == nil:\n\t\treturn c.createClient(req)\n\n\t// If Create is run on the resource and the Client exists, adopt and update it.\n\tcase req.RequestType == \"Create\" && client != nil:\n\t\treturn c.updateClient(req, client.id)\n\t}\n\n\treturn nil, fmt.Errorf(\"Didn't get RequestType Create, Update or Delete\")\n}", "func genS3URL(region, bucket, s3Path string) string {\n\treturn fmt.Sprintf(\"https://s3-%s.amazonaws.com/%s/%s\", region, bucket, s3Path)\n}", "func init() {\n\tmb.Registry.MustAddMetricSet(\"rsoasset\", \"os\", New)\n}", "func isAWSVolumeResource(pv *v1.PersistentVolume) bool {\n\treturn pv.Spec.AWSElasticBlockStore != nil\n}", "func resourceInstance() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreateContext: resourceInstanceCreate,\n\t\tReadContext: resourceInstanceRead,\n\t\tUpdateContext: resourceInstanceUpdate,\n\t\tDeleteContext: resourceInstanceDelete,\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"last_updated\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tComputed: true,\n\t\t\t},\n\t\t\t\"friendly_name\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"instance_name\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"module\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"target_ads_instance\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"new_instance_id\": &schema.Schema{\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"port_number\": &schema.Schema{\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"auto_configure\": &schema.Schema{\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"provision_setting\": &schema.Schema{\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tRequired: true,\n\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "func LambdaHandler(parameters InputParameters) (ResponseData, error) {\n\n\tvar res ResponseData\n\tvar t = parameters.Subscription.Assets\n\n\t// Used to identify the EC2 instance as part of the subscription\n\tid := GenerateStackID()\n\n\tsess := session.Must(session.NewSessionWithOptions(session.Options{\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t}))\n\n\t// Creates CloudFormation stack\n\tif e := CreateStackResources(id, parameters.Subscription); e != nil {\n\t\tfmt.Println(e.Error())\n\t\treturn res, e\n\t}\n\n\t// Creates the Pi output file\n\trp, e := p.CreatePiConfig(id, t)\n\tif e != nil {\n\t\tfmt.Println(e.Error())\n\t\treturn res, e\n\t}\n\n\t// Inserts data into the 'subscriptions' table\n\tif e := dynamodb.InsertIntoDynamoDB(sess, id, parameters.Subscription); e != nil {\n\t\tfmt.Printf(\"Got error inserting data: %s\", e.Error())\n\t\treturn res, e\n\t}\n\n\t//Need to return the data to user in a response\n\t// res.ResponseMessage = fmt.Sprintln(\"Config File: \", rp)\n\n\treturn res, nil\n}", "func TestTags(t *testing.T) {\n awsRegion := \"us-east-2\"\n tagName := \"Flugel-test\"\n tagOwner := \"InfraTeam-test\"\n\n terraformOpts := terraform.WithDefaultRetryableErrors(t, &terraform.Options{\n TerraformDir: \"../\",\n\n //Now i must map the tags.\n Vars: map[string]interface{}{\n \"tag_name\": tagName,\n \"tag_owner\": tagOwner,\n },\n\n //Then set the region to make the deploy in.\n EnvVars: map[string]string{\n \"AWS_DEFAULT_REGION\": awsRegion,\n },\n },\n )\n\n //After all the testing, the infra must be destroyed.\n defer terraform.Destroy(t, terraformOpts)\n\n //Now, let's run the deploy with all the parameters set.\n terraform.InitAndApply(t, terraformOpts)\n\n //I get the instance and bucket id's, and make first verifications.\n instanceID1 := terraform.Output(t, terraformOpts, \"instance_name_web1\")\n instanceTags1 := aws.GetTagsForEc2Instance(t, awsRegion, instanceID1)\n testTag1, containsTag := instanceTags1[\"Name\"]\n assert.True(t, containsTag, \"True\")\n assert.Equal(t, tagName, testTag1)\n testTag2, containsTag := instanceTags1[\"Owner\"]\n assert.True(t, containsTag, \"True\")\n assert.Equal(t, tagOwner, testTag2)\n\n instanceID2 := terraform.Output(t, terraformOpts, \"instance_name_web2\")\n instanceTags2 := aws.GetTagsForEc2Instance(t, awsRegion, instanceID2)\n testTag3, containsTag := instanceTags2[\"Name\"]\n assert.True(t, containsTag, \"True\")\n assert.Equal(t, tagName, testTag3)\n testTag4, containsTag := instanceTags2[\"Owner\"]\n assert.True(t, containsTag, \"True\")\n assert.Equal(t, tagOwner, testTag4)\n\n //It would be easier to simply parse plain text, but as i put myself into this let's ride with it.\n\n lburl := \"http://\" + terraform.Output(t, terraformOpts, \"load_balancer_url\") + \"/index.html\"\n maxRetries := 3\n timeBetweenRetries := 5 * time.Second\n\n http_helper.HttpGetWithRetryWithCustomValidation(t, lburl, nil, maxRetries, timeBetweenRetries, validate)\n\n // There's no module with \"get X bucket tags\", so i get the bucket id from TF, and separately i seek the bucket that contains\n // tags \"Name\" and \"Owner\" with the desired content, and make sure the id returned matches the previously deployed bucket. \n bucketID := terraform.Output(t, terraformOpts, \"bucket_id\")\n bucketwithTagN := aws.FindS3BucketWithTag (t, awsRegion, \"Name\", tagName)\n bucketwithTagO := aws.FindS3BucketWithTag (t, awsRegion, \"Owner\", tagOwner)\n assert.Equal(t, bucketwithTagN, bucketID)\n assert.Equal(t, bucketwithTagO, bucketID)\n\n}", "func AWSS3AccessPointBP() {\n\tcolor.Green(\"\\nresource \\\"aws_s3_bucket\\\" \\\"example\\\" {\\n bucket = \\\"example\\\"\\n}\\n\\nresource \\\"aws_s3_access_point\\\" \\\"example\\\" {\\n bucket = aws_s3_bucket.example.id\\n name = \\\"example\\\"\\n}\")\n\tcolor.Yellow(\"\\nCheckout https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_access_point\\n\\n\")\n}", "func resourceKeboolaAWSS3ExtractorUpdate(d *schema.ResourceData, meta interface{}) error {\n\tlog.Println(\"[INFO] Updating AWS S3 Extractor in Keboola.\")\n\n\tclient := meta.(*KBCClient)\n\n\tgetExtractorResponse, err := client.GetFromStorage(fmt.Sprintf(\"storage/components/keboola.ex-aws-s3/configs/%s\", d.Id()))\n\n\tif hasErrors(err, getExtractorResponse) {\n\t\treturn extractError(err, getExtractorResponse)\n\t}\n\n\tvar aWSS3Extractor AWSS3Extractor\n\n\tdecoder := json.NewDecoder(getExtractorResponse.Body)\n\terr = decoder.Decode(&aWSS3Extractor)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts3BucketExtractorConfiguration := S3BucketExtractorConfiguration{\n\t\tParameters: S3BucketExtractorConfigurationParameters{\n\t\t\tAccessKeyId: d.Get(\"access_key_id\").(string),\n\t\t\tEncryptedAccessKeySecret: d.Get(\"access_key\").(string),\n\t\t},\n\t}\n\n\ts3BucketExtractorConfigJSON, err := json.Marshal(s3BucketExtractorConfiguration)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tupdateS3BucketForm := url.Values{}\n\tupdateS3BucketForm.Add(\"name\", d.Get(\"name\").(string))\n\tupdateS3BucketForm.Add(\"description\", d.Get(\"description\").(string))\n\tupdateS3BucketForm.Add(\"configuration\", string(s3BucketExtractorConfigJSON))\n\n\tupdateS3BucketFormBuffer := buffer.FromForm(updateS3BucketForm)\n\tupdateS3BucketResponse, err := client.PutToStorage(fmt.Sprintf(\"storage/components/keboola.ex-aws-s3/configs/%s\", d.Id()), updateS3BucketFormBuffer)\n\n\tif hasErrors(err, updateS3BucketResponse) {\n\t\treturn extractError(err, updateS3BucketResponse)\n\t}\n\n\treturn resourceKeboolaAWSS3ExtractorRead(d, meta)\n}", "func (services *ECSServices) ResourceName() string {\n\treturn \"ecsserv\"\n}", "func CreateBucket(w http.ResponseWriter, r *http.Request) *appError {\n session, err := store.Get(r, \"session-name\")\n if err != nil {\n return &appError{err: err, status: http.StatusInternalServerError, json: http.StatusText(http.StatusInternalServerError)}\n }\n s3 := S3{\n EndPointString: session.Values[\"Endpoint\"].(string),\n AccessKey: session.Values[\"AccessKey\"].(string),\n SecretKey: session.Values[\"SecretKey\"].(string),\n Namespace: session.Values[\"Namespace\"].(string),\n }\n\n decoder := json.NewDecoder(r.Body)\n var bucket NewBucket\n err = decoder.Decode(&bucket)\n if err != nil {\n return &appError{err: err, status: http.StatusBadRequest, json: \"Can't decode JSON data\"}\n }\n\n // Add the necessary headers for Metadata Search and Access During Outage\n createBucketHeaders := map[string][]string{}\n createBucketHeaders[\"Content-Type\"] = []string{\"application/xml\"}\n createBucketHeaders[\"x-emc-is-stale-allowed\"] = []string{\"true\"}\n createBucketHeaders[\"x-emc-metadata-search\"] = []string{\"ObjectName,x-amz-meta-image-width;Integer,x-amz-meta-image-height;Integer,x-amz-meta-gps-latitude;Decimal,x-amz-meta-gps-longitude;Decimal\"}\n\n createBucketResponse, _ := s3Request(s3, bucket.Name, \"PUT\", \"/\", createBucketHeaders, \"\")\n\n // Enable CORS after the bucket creation to allow the web browser to send requests directly to ECS\n if createBucketResponse.Code == 200 {\n enableBucketCorsHeaders := map[string][]string{}\n enableBucketCorsHeaders[\"Content-Type\"] = []string{\"application/xml\"}\n corsConfiguration := `\n <CORSConfiguration>\n <CORSRule>\n <AllowedOrigin>*</AllowedOrigin>\n <AllowedHeader>*</AllowedHeader>\n <ExposeHeader>x-amz-meta-image-width</ExposeHeader>\n <ExposeHeader>x-amz-meta-image-height</ExposeHeader>\n <ExposeHeader>x-amz-meta-gps-latitude</ExposeHeader>\n <ExposeHeader>x-amz-meta-gps-longitude</ExposeHeader>\n <AllowedMethod>HEAD</AllowedMethod>\n <AllowedMethod>GET</AllowedMethod>\n <AllowedMethod>PUT</AllowedMethod>\n <AllowedMethod>POST</AllowedMethod>\n <AllowedMethod>DELETE</AllowedMethod>\n </CORSRule>\n </CORSConfiguration>\n `\n enableBucketCorsResponse, _ := s3Request(s3, bucket.Name, \"PUT\", \"/?cors\", enableBucketCorsHeaders, corsConfiguration)\n if enableBucketCorsResponse.Code == 200 {\n rendering.JSON(w, http.StatusOK, struct {\n CorsConfiguration string `json:\"cors_configuration\"`\n Bucket string `json:\"bucket\"`\n } {\n CorsConfiguration: corsConfiguration,\n Bucket: bucket.Name,\n })\n } else {\n return &appError{err: err, status: http.StatusBadRequest, json: \"Bucket created, but CORS can't be enabled\"}\n }\n } else {\n return &appError{err: err, status: http.StatusBadRequest, json: \"Bucket can't be created\"}\n }\n return nil\n}", "func (r ReconcileS3) handleCreateS3Resources(cr *agillv1alpha1.S3) error {\n\n\t// create bucket\n\tif errCreatingBucket := r.createBucket(cr); errCreatingBucket != nil {\n\t\treturn errCreatingBucket\n\t}\n\n\t// change phase to completed\n\tr.recorder.Eventf(cr, v1.EventTypeNormal, \"COMPLETED\", \"All resources are successfully reconciled.\")\n\treturn createS3K8sService(cr, r.client, r.scheme)\n}", "func NewAWS(crypto appencryption.AEAD, preferredRegion string, arnMap map[string]string) (*AWSKMS, error) {\n\treturn newAWS(crypto, preferredRegion, awsARNMap(arnMap))\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"access_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: \"The access key for API operations.\",\n\t\t\t},\n\t\t\t\"secret_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: \"The secret key for API operations.\",\n\t\t\t},\n\t\t\t\"endpoint\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The endpoint for API operations.\",\n\t\t\t},\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDescription: \"The region where Nifcloud operations will take place.\",\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t// \"nifcloud_instance\": dataSourceInstance(),\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"nifcloud_instance\": resourceNifcloudInstance(),\n\t\t\t\"nifcloud_network\": resourceNifcloudNetwork(),\n\t\t\t\"nifcloud_volume\": resourceNifcloudVolume(),\n\t\t\t\"nifcloud_securitygroup\": resourceNifcloudSecurityGroup(),\n\t\t\t\"nifcloud_securitygroup_rule\": resourceNifcloudSecurityGroupRule(),\n\t\t\t\"nifcloud_keypair\": resourceNifcloudKeyPair(),\n\t\t\t\"nifcloud_instancebackup_rule\": resourceNifcloudInstanceBackupRule(),\n\t\t\t\"nifcloud_image\": resourceNifcloudImage(),\n\t\t\t\"nifcloud_customer_gateway\": resourceNifcloudCustomerGateway(),\n\t\t\t\"nifcloud_vpn_gateway\": resourceNifcloudVpnGateway(),\n\t\t\t\"nifcloud_vpn_connection\": resourceNifcloudVpnConnection(),\n\t\t\t\"nifcloud_db_parameter_group\": resourceNifcloudDbParameterGroup(),\n\t\t\t\"nifcloud_db_security_group\": resourceNifcloudDbSecurityGroup(),\n\t\t\t\"nifcloud_db_instance\": resourceNifcloudDbInstance(),\n\t\t\t\"nifcloud_router\": resourceNifcloudRouter(),\n\t\t\t\"nifcloud_route_table\": resourceNifcloudRouteTable(),\n\t\t\t\"nifcloud_route\": resourceNifcloudRoute(),\n\t\t\t\"nifcloud_route_table_association\": resourceNifcloudRouteTableAssociation(),\n\t\t\t\"nifcloud_route_table_association_with_vpn_gateway\": resourceNifcloudRouteTableAssociationWithVpnGateway(),\n\t\t\t\"nifcloud_lb\": resourceNifcloudLb(),\n\t\t\t\"nifcloud_lb_port\": resourceNifcloudLbPort(),\n\t\t\t\"nifcloud_eip\": resourceNifcloudEip(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func s3Service(bucketName string) (*s3.S3, error) {\n\tsvc := s3.New(session.New(), &aws.Config{})\n\tif bucketName == \"\" {\n\t\treturn svc, nil\n\t}\n\n\t//If bucket has a LocationConstraint, use config to access through that region specifically\n\tresult, err := svc.GetBucketLocation(&s3.GetBucketLocationInput{Bucket: &bucketName})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif result.LocationConstraint != nil {\n\t\tsvc = s3.New(session.New(), &aws.Config{Region: result.LocationConstraint})\n\t}\n\n\treturn svc, nil\n}", "func init() {\n\tauth, err := aws.EnvAuth()\n\tif err != nil {\n\t\trev.ERROR.Fatalln(`AWS Authorization Required.\nPlease set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.`)\n\t}\n\tPHOTO_BUCKET = s3.New(auth, aws.USEast).Bucket(\"photoboard\")\n}", "func Provider() terraform.ResourceProvider {\n\t// TODO: Move the validation to this, requires conditional schemas\n\t// TODO: Move the configuration to this, requires validation\n\n\t// The actual provider\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"access_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"access_key\"],\n\t\t\t},\n\n\t\t\t\"secret_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"secret_key\"],\n\t\t\t},\n\n\t\t\t\"profile\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"profile\"],\n\t\t\t},\n\n\t\t\t\"assume_role\": assumeRoleSchema(),\n\n\t\t\t\"shared_credentials_file\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"shared_credentials_file\"],\n\t\t\t},\n\n\t\t\t\"token\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"token\"],\n\t\t\t},\n\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.MultiEnvDefaultFunc([]string{\n\t\t\t\t\t\"AWS_REGION\",\n\t\t\t\t\t\"AWS_DEFAULT_REGION\",\n\t\t\t\t}, nil),\n\t\t\t\tDescription: descriptions[\"region\"],\n\t\t\t\tInputDefault: \"us-east-1\",\n\t\t\t},\n\n\t\t\t\"max_retries\": {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: 25,\n\t\t\t\tDescription: descriptions[\"max_retries\"],\n\t\t\t},\n\n\t\t\t\"allowed_account_ids\": {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tElem: &schema.Schema{Type: schema.TypeString},\n\t\t\t\tOptional: true,\n\t\t\t\tConflictsWith: []string{\"forbidden_account_ids\"},\n\t\t\t\tSet: schema.HashString,\n\t\t\t},\n\n\t\t\t\"forbidden_account_ids\": {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tElem: &schema.Schema{Type: schema.TypeString},\n\t\t\t\tOptional: true,\n\t\t\t\tConflictsWith: []string{\"allowed_account_ids\"},\n\t\t\t\tSet: schema.HashString,\n\t\t\t},\n\n\t\t\t\"dynamodb_endpoint\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"dynamodb_endpoint\"],\n\t\t\t\tRemoved: \"Use `dynamodb` inside `endpoints` block instead\",\n\t\t\t},\n\n\t\t\t\"kinesis_endpoint\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"\",\n\t\t\t\tDescription: descriptions[\"kinesis_endpoint\"],\n\t\t\t\tRemoved: \"Use `kinesis` inside `endpoints` block instead\",\n\t\t\t},\n\n\t\t\t\"endpoints\": endpointsSchema(),\n\n\t\t\t\"insecure\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"insecure\"],\n\t\t\t},\n\n\t\t\t\"skip_credentials_validation\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_credentials_validation\"],\n\t\t\t},\n\n\t\t\t\"skip_get_ec2_platforms\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_get_ec2_platforms\"],\n\t\t\t},\n\n\t\t\t\"skip_region_validation\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_region_validation\"],\n\t\t\t},\n\n\t\t\t\"skip_requesting_account_id\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_requesting_account_id\"],\n\t\t\t},\n\n\t\t\t\"skip_metadata_api_check\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"skip_metadata_api_check\"],\n\t\t\t},\n\n\t\t\t\"s3_force_path_style\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: false,\n\t\t\t\tDescription: descriptions[\"s3_force_path_style\"],\n\t\t\t},\n\t\t},\n\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"awstag_ec2_tag\": resourceAwstagEC2Tag(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func (rm *resourceManager) sdkFind(\n\tctx context.Context,\n\tr *resource,\n) (*resource, error) {\n\t// If any required fields in the input shape are missing, AWS resource is\n\t// not created yet. Return NotFound here to indicate to callers that the\n\t// resource isn't yet created.\n\tif rm.requiredFieldsMissingFromReadOneInput(r) {\n\t\treturn nil, ackerr.NotFound\n\t}\n\n\tinput, err := rm.newDescribeRequestPayload(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, respErr := rm.sdkapi.GetStageWithContext(ctx, input)\n\trm.metrics.RecordAPICall(\"READ_ONE\", \"GetStage\", respErr)\n\tif respErr != nil {\n\t\tif awsErr, ok := ackerr.AWSError(respErr); ok && awsErr.Code() == \"NotFoundException\" {\n\t\t\treturn nil, ackerr.NotFound\n\t\t}\n\t\treturn nil, respErr\n\t}\n\n\t// Merge in the information we read from the API call above to the copy of\n\t// the original Kubernetes object we passed to the function\n\tko := r.ko.DeepCopy()\n\n\tif resp.AccessLogSettings != nil {\n\t\tf0 := &svcapitypes.AccessLogSettings{}\n\t\tif resp.AccessLogSettings.DestinationArn != nil {\n\t\t\tf0.DestinationARN = resp.AccessLogSettings.DestinationArn\n\t\t}\n\t\tif resp.AccessLogSettings.Format != nil {\n\t\t\tf0.Format = resp.AccessLogSettings.Format\n\t\t}\n\t\tko.Spec.AccessLogSettings = f0\n\t}\n\tif resp.ApiGatewayManaged != nil {\n\t\tko.Status.APIGatewayManaged = resp.ApiGatewayManaged\n\t}\n\tif resp.AutoDeploy != nil {\n\t\tko.Spec.AutoDeploy = resp.AutoDeploy\n\t}\n\tif resp.ClientCertificateId != nil {\n\t\tko.Spec.ClientCertificateID = resp.ClientCertificateId\n\t}\n\tif resp.CreatedDate != nil {\n\t\tko.Status.CreatedDate = &metav1.Time{*resp.CreatedDate}\n\t}\n\tif resp.DefaultRouteSettings != nil {\n\t\tf5 := &svcapitypes.RouteSettings{}\n\t\tif resp.DefaultRouteSettings.DataTraceEnabled != nil {\n\t\t\tf5.DataTraceEnabled = resp.DefaultRouteSettings.DataTraceEnabled\n\t\t}\n\t\tif resp.DefaultRouteSettings.DetailedMetricsEnabled != nil {\n\t\t\tf5.DetailedMetricsEnabled = resp.DefaultRouteSettings.DetailedMetricsEnabled\n\t\t}\n\t\tif resp.DefaultRouteSettings.LoggingLevel != nil {\n\t\t\tf5.LoggingLevel = resp.DefaultRouteSettings.LoggingLevel\n\t\t}\n\t\tif resp.DefaultRouteSettings.ThrottlingBurstLimit != nil {\n\t\t\tf5.ThrottlingBurstLimit = resp.DefaultRouteSettings.ThrottlingBurstLimit\n\t\t}\n\t\tif resp.DefaultRouteSettings.ThrottlingRateLimit != nil {\n\t\t\tf5.ThrottlingRateLimit = resp.DefaultRouteSettings.ThrottlingRateLimit\n\t\t}\n\t\tko.Spec.DefaultRouteSettings = f5\n\t}\n\tif resp.DeploymentId != nil {\n\t\tko.Spec.DeploymentID = resp.DeploymentId\n\t}\n\tif resp.Description != nil {\n\t\tko.Spec.Description = resp.Description\n\t}\n\tif resp.LastDeploymentStatusMessage != nil {\n\t\tko.Status.LastDeploymentStatusMessage = resp.LastDeploymentStatusMessage\n\t}\n\tif resp.LastUpdatedDate != nil {\n\t\tko.Status.LastUpdatedDate = &metav1.Time{*resp.LastUpdatedDate}\n\t}\n\tif resp.RouteSettings != nil {\n\t\tf10 := map[string]*svcapitypes.RouteSettings{}\n\t\tfor f10key, f10valiter := range resp.RouteSettings {\n\t\t\tf10val := &svcapitypes.RouteSettings{}\n\t\t\tif f10valiter.DataTraceEnabled != nil {\n\t\t\t\tf10val.DataTraceEnabled = f10valiter.DataTraceEnabled\n\t\t\t}\n\t\t\tif f10valiter.DetailedMetricsEnabled != nil {\n\t\t\t\tf10val.DetailedMetricsEnabled = f10valiter.DetailedMetricsEnabled\n\t\t\t}\n\t\t\tif f10valiter.LoggingLevel != nil {\n\t\t\t\tf10val.LoggingLevel = f10valiter.LoggingLevel\n\t\t\t}\n\t\t\tif f10valiter.ThrottlingBurstLimit != nil {\n\t\t\t\tf10val.ThrottlingBurstLimit = f10valiter.ThrottlingBurstLimit\n\t\t\t}\n\t\t\tif f10valiter.ThrottlingRateLimit != nil {\n\t\t\t\tf10val.ThrottlingRateLimit = f10valiter.ThrottlingRateLimit\n\t\t\t}\n\t\t\tf10[f10key] = f10val\n\t\t}\n\t\tko.Spec.RouteSettings = f10\n\t}\n\tif resp.StageName != nil {\n\t\tko.Spec.StageName = resp.StageName\n\t}\n\tif resp.StageVariables != nil {\n\t\tf12 := map[string]*string{}\n\t\tfor f12key, f12valiter := range resp.StageVariables {\n\t\t\tvar f12val string\n\t\t\tf12val = *f12valiter\n\t\t\tf12[f12key] = &f12val\n\t\t}\n\t\tko.Spec.StageVariables = f12\n\t}\n\tif resp.Tags != nil {\n\t\tf13 := map[string]*string{}\n\t\tfor f13key, f13valiter := range resp.Tags {\n\t\t\tvar f13val string\n\t\t\tf13val = *f13valiter\n\t\t\tf13[f13key] = &f13val\n\t\t}\n\t\tko.Spec.Tags = f13\n\t}\n\n\trm.setStatusDefaults(ko)\n\treturn &resource{ko}, nil\n}", "func getResourceTagValue(id, tag string) string {\n\tc := ec2.New(session.New(&aws.Config{Region: &region}))\n\tparams := &ec2.DescribeTagsInput{\n\t\tFilters: []*ec2.Filter{\n\t\t\t{\n\t\t\t\tName: aws.String(\"resource-id\"),\n\t\t\t\tValues: []*string{\n\t\t\t\t\taws.String(id),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: aws.String(\"key\"),\n\t\t\t\tValues: []*string{\n\t\t\t\t\taws.String(tag),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tresp, err := c.DescribeTags(params)\n\tif err != nil {\n\t\tlog.Printf(\"Cannot get tag %q of %q resource: %q.\\n\", tag, id, err)\n\t\treturn \"\"\n\t}\n\tif len(resp.Tags) > 0 {\n\t\tfor _, t := range resp.Tags {\n\t\t\treturn *t.Value\n\t\t}\n\t}\n\tlog.Printf(\"Cannot get tag %q of %q resource.\\n\", tag, id)\n\treturn \"\"\n}", "func createImageResource(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {\n\t// Warning or errors can be collected in a slice type\n\tvar diags diag.Diagnostics\n\n\tclient := (meta.(Client)).Client\n\tname := rdEntryStr(d, \"name\")\n\tid := rdEntryStr(d, \"id\")\n\terrMsgPrefix := fmt.Sprintf(\"[ERROR] Image %s (id: %s) Create Failed.\",\n\t\tname, id)\n\tif client == nil {\n\t\treturn diag.Errorf(\"%s nil Client\", errMsgPrefix)\n\t}\n\tcfg := &swagger_models.ImageConfig{\n\t\tName: &name,\n\t}\n\terr := updateImageCfgFromResourceData(cfg, d)\n\tif err != nil {\n\t\treturn diag.Errorf(\"%s %s\", errMsgPrefix, err.Error())\n\t}\n\tlog.Printf(\"[INFO] Creating Image: %s\", name)\n\tclient.XRequestIdPrefix = \"TF-image-create\"\n\trspData := &swagger_models.ZsrvResponse{}\n\t_, err = client.SendReq(\"POST\", imageUrlExtension, cfg, rspData)\n\tif err != nil {\n\t\treturn diag.Errorf(\"%s Err: %s\", errMsgPrefix, err.Error())\n\t}\n\tlog.Printf(\"Image %s (ID: %s) Successfully created\\n\",\n\t\trspData.ObjectName, rspData.ObjectID)\n\td.SetId(rspData.ObjectID)\n\treturn diags\n}", "func Create(req handler.Request, prevModel *Model, currentModel *Model) (handler.ProgressEvent, error) {\n\t// Add your code here:\n\t// * Make API calls (use req.Session)\n\t// * Mutate the model\n\t// * Check/set any callback context (req.CallbackContext / response.CallbackContext)\n\n\tiotSvc := iot.New(req.Session)\n\ts3Svc := s3.New(req.Session)\n\n\ttestKey := req.LogicalResourceID\n\t_, err := s3Svc.PutObject(&s3.PutObjectInput{\n\t\tBucket: currentModel.Bucket,\n\t\tKey: &testKey,\n\t\tBody: strings.NewReader(\"test\"),\n\t})\n\tif err != nil {\n\t\taerr, ok := err.(awserr.Error)\n\t\tif ok {\n\t\t\tfmt.Printf(\"%v\", aerr)\n\t\t}\n\t\tresponse := handler.ProgressEvent{\n\t\t\tOperationStatus: handler.Failed,\n\t\t\tMessage: \"Bucket is not accessible\",\n\t\t}\n\t\treturn response, nil\n\t}\n\t_, err = s3Svc.DeleteObject(&s3.DeleteObjectInput{\n\t\tBucket: currentModel.Bucket,\n\t\tKey: &testKey,\n\t})\n\tactive := false\n\tif currentModel.Status != nil && strings.Compare(*currentModel.Status, \"ACTIVE\") == 0 {\n\t\tactive = true\n\t}\n\tres, err := iotSvc.CreateKeysAndCertificate(&iot.CreateKeysAndCertificateInput{\n\t\tSetAsActive: &active,\n\t})\n\n\tif err != nil {\n\t\taerr, ok := err.(awserr.Error)\n\t\tif ok {\n\t\t\tfmt.Printf(\"%v\", aerr)\n\t\t}\n\t\tresponse := handler.ProgressEvent{\n\t\t\tOperationStatus: handler.Failed,\n\t\t\tMessage: fmt.Sprintf(\"Failed: %s\", aerr.Error()),\n\t\t}\n\t\treturn response, nil\n\t}\n\n\tvar key string\n\tkey = fmt.Sprintf(\"%s.pem\", *res.CertificateId)\n\t_, err = s3Svc.PutObject(&s3.PutObjectInput{\n\t\tBucket: currentModel.Bucket,\n\t\tKey: &key,\n\t\tBody: strings.NewReader(*res.CertificatePem),\n\t})\n\tkey = fmt.Sprintf(\"%s.key\", *res.CertificateId)\n\t_, err = s3Svc.PutObject(&s3.PutObjectInput{\n\t\tBucket: currentModel.Bucket,\n\t\tKey: &key,\n\t\tBody: strings.NewReader(*res.KeyPair.PrivateKey),\n\t})\n\tcurrentModel.Arn = res.CertificateArn\n\tcurrentModel.Id = res.CertificateId\n\n\tresponse := handler.ProgressEvent{\n\t\tOperationStatus: handler.Success,\n\t\tMessage: \"Created certificate\",\n\t\tResourceModel: currentModel,\n\t}\n\treturn response, nil\n}", "func (r *ScanRequest) Update(evt *cloudformationevt.Event, ctx *runtime.Context) (string, interface{}, error) {\n if err := json.Unmarshal(evt.ResourceProperties, r); err != nil {\n return \"\", r, err\n }\n\n if r.Action == nil {\n r.Action = &defaultExampleThing\n }\n\n username, password := GetDockerLogin(r.Region)\n\n os.Setenv(\"DOCKER_USERNAME\", username)\n os.Setenv(\"DOCKER_PASSWORD\", password)\n os.Setenv(\"CLAIR_ADDR\", \"coreo-Clair-QDQKVCAO6IRL-2075767864.ap-southeast-2.elb.amazonaws.com\")\n os.Setenv(\"CLAIR_OUTPUT\", *r.Threshold)\n\n klar(r.Image)\n\n return evt.PhysicalResourceID, r, nil\n}", "func NewDNSErrorAWS(message, dnsName string, resources []*route53.ResourceRecord) (*DNSError) {\n ips := make([]string, len(resources))\n for i, v := range resources {\n ips[i] = *v.Value\n }\n return NewDNSError(message, dnsName, ips)\n}", "func validateEndpointRequestResource(req *request.Request, resource arn.Resource) error {\n\tresReq := s3shared.ResourceRequest{Request: req, Resource: resource}\n\n\tif len(resReq.Request.ClientInfo.PartitionID) != 0 && resReq.IsCrossPartition() {\n\t\treturn s3shared.NewClientPartitionMismatchError(resource,\n\t\t\treq.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil)\n\t}\n\n\tif !resReq.AllowCrossRegion() && resReq.IsCrossRegion() {\n\t\treturn s3shared.NewClientRegionMismatchError(resource,\n\t\t\treq.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil)\n\t}\n\n\t// Accelerate not supported\n\tif aws.BoolValue(req.Config.S3UseAccelerate) {\n\t\treturn s3shared.NewClientConfiguredForAccelerateError(resource,\n\t\t\treq.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil)\n\t}\n\treturn nil\n}", "func Provider() terraform.ResourceProvider {\n\treturn &schema.Provider{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\t\"public_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_PUBLIC_KEY\", nil),\n\t\t\t\tDescription: descriptions[\"public_key\"],\n\t\t\t},\n\n\t\t\t\"private_key\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_PRIVATE_KEY\", nil),\n\t\t\t\tDescription: descriptions[\"private_key\"],\n\t\t\t},\n\n\t\t\t\"region\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_REGION\", nil),\n\t\t\t\tDescription: descriptions[\"region\"],\n\t\t\t},\n\n\t\t\t\"project_id\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDefaultFunc: schema.EnvDefaultFunc(\"UCLOUD_PROJECT_ID\", nil),\n\t\t\t\tDescription: descriptions[\"project_id\"],\n\t\t\t},\n\n\t\t\t\"max_retries\": {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: DefaultMaxRetries,\n\t\t\t\tDescription: descriptions[\"max_retries\"],\n\t\t\t},\n\n\t\t\t\"insecure\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: DefaultInSecure,\n\t\t\t\tDescription: descriptions[\"insecure\"],\n\t\t\t},\n\t\t},\n\n\t\tDataSourcesMap: map[string]*schema.Resource{\n\t\t\t\"ucloud_instances\": dataSourceUCloudInstances(),\n\t\t\t\"ucloud_projects\": dataSourceUCloudProjects(),\n\t\t\t\"ucloud_images\": dataSourceUCloudImages(),\n\t\t\t\"ucloud_zones\": dataSourceUCloudZones(),\n\t\t\t\"ucloud_eips\": dataSourceUCloudEips(),\n\t\t},\n\t\tResourcesMap: map[string]*schema.Resource{\n\t\t\t\"ucloud_instance\": resourceUCloudInstance(),\n\t\t\t\"ucloud_eip\": resourceUCloudEIP(),\n\t\t\t\"ucloud_eip_association\": resourceUCloudEIPAssociation(),\n\t\t\t\"ucloud_vpc\": resourceUCloudVPC(),\n\t\t\t\"ucloud_subnet\": resourceUCloudSubnet(),\n\t\t\t\"ucloud_vpc_peering_connection\": resourceUCloudVPCPeeringConnection(),\n\t\t\t\"ucloud_lb\": resourceUCloudLB(),\n\t\t\t\"ucloud_lb_listener\": resourceUCloudLBListener(),\n\t\t\t\"ucloud_lb_attachment\": resourceUCloudLBAttachment(),\n\t\t\t\"ucloud_lb_rule\": resourceUCloudLBRule(),\n\t\t\t\"ucloud_disk\": resourceUCloudDisk(),\n\t\t\t\"ucloud_disk_attachment\": resourceUCloudDiskAttachment(),\n\t\t\t\"ucloud_security_group\": resourceUCloudSecurityGroup(),\n\t\t},\n\t\tConfigureFunc: providerConfigure,\n\t}\n}", "func AWSRemove() {\n\tSetClusterName()\n\tsshUser, osLabel := distSelect()\n\tinstaller.RunPlaybook(\"./inventory/\"+common.Name+\"/installer/\", \"reset.yml\", sshUser, osLabel)\n}", "func TestTerraformAwsSpotScheduler(t *testing.T) {\n\tt.Parallel()\n\n\t// Pick aws region Ireland\n\tawsRegion := \"eu-west-1\"\n\n\t// Give this Spot Instance a unique ID for a name tag so we can distinguish it from any other EC2 Instance running\n\tterratestTag := fmt.Sprintf(\"terratest-tag-%s\", random.UniqueId())\n\n\tterraformOptions := &terraform.Options{\n\t\t// The path to where our Terraform code is located\n\t\tTerraformDir: \"../../examples/spot-schedule\",\n\n\t\t// Variables to pass to our Terraform code using -var options\n\t\tVars: map[string]interface{}{\n\t\t\t\"random_tag\": terratestTag,\n\t\t},\n\n\t\t// Environment variables to set when running Terraform\n\t\tEnvVars: map[string]string{\n\t\t\t\"AWS_DEFAULT_REGION\": awsRegion,\n\t\t},\n\t}\n\n\t// At the end of the test, run `terraform destroy` to clean up any resources that were created\n\tdefer terraform.Destroy(t, terraformOptions)\n\n\t// This will run `terraform init` and `terraform apply` and fail the test if there are any errors\n\tterraform.InitAndApply(t, terraformOptions)\n\n\t// Run `terraform output` to get the value of an output variables\n\tlambdaStopName := terraform.Output(t, terraformOptions, \"lambda_stop_name\")\n\n\t// Get all ec2 spot IDs with the tag \"topstop:true\" and the state running\n\tfiltersSpotToTerminateRunning := map[string][]string{\n\t\t\"instance-state-name\": {\"running\"},\n\t\t\"tag:tostop\": {\"true\"},\n\t\t\"tag:terratest_tag\": {terratestTag},\n\t\t\"instance-lifecycle\": {\"spot\"},\n\t}\n\tSpotIDsToStopRunning := aws.GetEc2InstanceIdsByFilters(t, awsRegion, filtersSpotToTerminateRunning)\n\n\t// Get all ec2 spot IDs with the tag \"topstop:false\" and the state running\n\tfiltersSpotsNoTerminateRunning := map[string][]string{\n\t\t\"instance-state-name\": {\"running\"},\n\t\t\"tag:tostop\": {\"false\"},\n\t\t\"tag:terratest_tag\": {terratestTag},\n\t\t\"instance-lifecycle\": {\"spot\"},\n\t}\n\tSpotIDsNoTerminateRunning := aws.GetEc2InstanceIdsByFilters(t, awsRegion, filtersSpotsNoTerminateRunning)\n\n\t// Invoke lambda function to terminate all spot instances with the tag:value `tostop:true`\n\tL.RunAwslambda(awsRegion, lambdaStopName)\n\n\t// Wait for scheduler exectuion\n\ttime.Sleep(160 * time.Second)\n\n\t// Get all spot instances IDs with the tag \"topstop:true\" and the state terminate\n\tfiltersSpotToStopTerminate := map[string][]string{\n\t\t\"instance-state-name\": {\"terminated\"},\n\t\t\"tag:tostop\": {\"true\"},\n\t\t\"tag:terratest_tag\": {terratestTag},\n\t\t\"instance-lifecycle\": {\"spot\"},\n\t}\n\tSpotIDsToStopTerminate := aws.GetEc2InstanceIdsByFilters(t, awsRegion, filtersSpotToStopTerminate)\n\n\t// Get all ec2 instances IDs with the tag \"topstop:false\" and the state running\n\tfiltersSpotNoStopTerminate := map[string][]string{\n\t\t\"instance-state-name\": {\"running\"},\n\t\t\"tag:tostop\": {\"false\"},\n\t\t\"tag:terratest_tag\": {terratestTag},\n\t\t\"instance-lifecycle\": {\"spot\"},\n\t}\n\tSpotIDsNoTerminate := aws.GetEc2InstanceIdsByFilters(t, awsRegion, filtersSpotNoStopTerminate)\n\n\t// Verify the instances trigger by scheduler terminate-spot with tag \"topstop:true\" should be terminated\n\tassert.Equal(t, SpotIDsToStopRunning, SpotIDsToStopTerminate)\n\n\t// Verify the instances trigger by scheduler terminate-spot with tag \"topstop:false\" should be running\n\tassert.Equal(t, SpotIDsNoTerminateRunning, SpotIDsNoTerminate)\n}", "func (m *MockMappedResource) Aws() aws.Resource {\n\tret := m.ctrl.Call(m, \"Aws\")\n\tret0, _ := ret[0].(aws.Resource)\n\treturn ret0\n}", "func BucketStyleSample() {\n\t// New client\n\tclient, err := oss.New(endpoint, accessID, accessKey)\n\tif err != nil {\n\t\tHandleError(err)\n\t}\n\n\t// Create the bucket with default parameters\n\terr = client.CreateBucket(bucketName)\n\tif err != nil {\n\t\tHandleError(err)\n\t}\n\n\t// Get bucket's style.\n\tstyleName := \"image-style\"\n\tstyle, err := client.GetBucketStyle(bucketName, styleName)\n\tif err != nil {\n\t\tHandleError(err)\n\t}\n\tfmt.Printf(\"Style Name:%s\\n\", style.Name)\n\tfmt.Printf(\"Style Name:%s\\n\", style.Content)\n\tfmt.Printf(\"Style Create Time:%s\\n\", style.CreateTime)\n\tfmt.Printf(\"Style Last Modify Time:%s\\n\", style.LastModifyTime)\n\n\t// Set bucket's style.\n\tstyleContent := \"image/resize,p_50\"\n\terr = client.PutBucketStyle(bucketName, styleName, styleContent)\n\tif err != nil {\n\t\tHandleError(err)\n\t}\n\tfmt.Println(\"Put Bucket Style Success!\")\n\n\t// List bucket's style\n\tlist, err := client.ListBucketStyle(bucketName)\n\tif err != nil {\n\t\tHandleError(err)\n\t}\n\n\tfor _, styleInfo := range list.Style {\n\t\tfmt.Printf(\"Style Name:%s\\n\", styleInfo.Name)\n\t\tfmt.Printf(\"Style Name:%s\\n\", styleInfo.Content)\n\t\tfmt.Printf(\"Style Create Time:%s\\n\", styleInfo.CreateTime)\n\t\tfmt.Printf(\"Style Last Modify Time:%s\\n\", styleInfo.LastModifyTime)\n\t}\n\n\t// Delete bucket's style\n\terr = client.DeleteBucketStyle(bucketName, styleName)\n\tif err != nil {\n\t\tHandleError(err)\n\t}\n\tfmt.Println(\"Bucket Style Delete Success!\")\n\n\tfmt.Println(\"BucketStyleSample completed\")\n}", "func setupAWS(ctx *context.Context, config *ConfigParams) (*blob.Bucket, error) {\n\tc := &aws.Config{\n\t\t// Either hard-code the region or use AWS_REGION.\n\t\tRegion: aws.String(config.Region),\n\t\t// credentials.NewEnvCredentials assumes two environment variables are\n\t\t// present:\n\t\t// 1. AWS_ACCESS_KEY_ID, and\n\t\t// 2. AWS_SECRET_ACCESS_KEY.\n\t\t// Credentials: credentials.NewEnvCredentials(),\n\t\tCredentials: credentials.NewStaticCredentials(\n\t\t\tconfig.AccessKey,\n\t\t\tconfig.SecretKey,\n\t\t\tconfig.Token,\n\t\t),\n\t}\n\ts := session.Must(session.NewSession(c))\n\treturn s3blob.OpenBucket(*ctx, config.Bucket, s, nil)\n}", "func registerResourceAPIs(ws *restful.WebService) {\n\t// Filter the unauthorized operation.\n\t// ws.Route(ws.PUT(\"/{user_id}/resources\").\n\t// \tTo(setResource).\n\t// \tDoc(\"set a resource by id for given user\").\n\t// \tParam(ws.PathParameter(\"user_id\", \"identifier of the user\").DataType(\"string\")).\n\t// \tWrites(api.ResourceSetResponse{}))\n\n\t// Filter the unauthorized operation.\n\tws.Route(ws.GET(\"/{user_id}/resources\").\n\t\tTo(getResource).\n\t\tDoc(\"find a service by id for given user\").\n\t\tParam(ws.PathParameter(\"user_id\", \"identifier of the user\").DataType(\"string\")).\n\t\tWrites(api.ResourceGetResponse{}))\n}", "func (c *DetaClient) injectResourceHeader(headers map[string]string, account, region string) {\n\tresAddr := fmt.Sprintf(\"aws:%s:%s\", account, region)\n\tencoded := base64.StdEncoding.EncodeToString([]byte(resAddr))\n\theaders[\"X-Resource-Addr\"] = encoded\n}", "func testMakeBucketRegionsV2() {\n\t// initialize logging params\n\tstartTime := time.Now()\n\ttestName := getFuncName()\n\tfunction := \"MakeBucket(bucketName, region)\"\n\targs := map[string]interface{}{\n\t\t\"bucketName\": \"\",\n\t\t\"region\": \"eu-west-1\",\n\t}\n\n\t// Seed random based on current time.\n\trand.Seed(time.Now().Unix())\n\n\t// Instantiate new minio client object.\n\tc, err := minio.New(os.Getenv(serverEndpoint),\n\t\t&minio.Options{\n\t\t\tCreds: credentials.NewStaticV2(os.Getenv(accessKey), os.Getenv(secretKey), \"\"),\n\t\t\tSecure: mustParseBool(os.Getenv(enableHTTPS)),\n\t\t})\n\tif err != nil {\n\t\tlogError(testName, function, args, startTime, \"\", \"MinIO v2 client object creation failed\", err)\n\t\treturn\n\t}\n\n\t// Enable tracing, write to stderr.\n\t// c.TraceOn(os.Stderr)\n\n\t// Set user agent.\n\tc.SetAppInfo(\"MinIO-go-FunctionalTest\", \"0.1.0\")\n\n\t// Generate a new random bucket name.\n\tbucketName := randString(60, rand.NewSource(time.Now().UnixNano()), \"minio-go-test-\")\n\targs[\"bucketName\"] = bucketName\n\n\t// Make a new bucket in 'eu-central-1'.\n\tif err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: \"eu-west-1\"}); err != nil {\n\t\tlogError(testName, function, args, startTime, \"\", \"MakeBucket failed\", err)\n\t\treturn\n\t}\n\n\tif err = cleanupBucket(bucketName, c); err != nil {\n\t\tlogError(testName, function, args, startTime, \"\", \"CleanupBucket failed while removing bucket recursively\", err)\n\t\treturn\n\t}\n\n\t// Make a new bucket with '.' in its name, in 'us-west-2'. This\n\t// request is internally staged into a path style instead of\n\t// virtual host style.\n\tif err = c.MakeBucket(context.Background(), bucketName+\".withperiod\", minio.MakeBucketOptions{Region: \"us-west-2\"}); err != nil {\n\t\targs[\"bucketName\"] = bucketName + \".withperiod\"\n\t\targs[\"region\"] = \"us-west-2\"\n\t\tlogError(testName, function, args, startTime, \"\", \"MakeBucket test with a bucket name with period, '.', failed\", err)\n\t\treturn\n\t}\n\n\t// Delete all objects and buckets\n\tif err = cleanupBucket(bucketName+\".withperiod\", c); err != nil {\n\t\tlogError(testName, function, args, startTime, \"\", \"CleanupBucket failed while removing bucket recursively\", err)\n\t\treturn\n\t}\n\n\tsuccessLogger(testName, function, args, startTime).Info()\n}", "func (r WebAppActiveSlotResource) Update() sdk.ResourceFunc {\n\treturn r.Create()\n}" ]
[ "0.6991364", "0.6930179", "0.63717675", "0.58506465", "0.5662601", "0.5583528", "0.5579139", "0.5561207", "0.5452959", "0.54288423", "0.54267603", "0.53498", "0.53387374", "0.53074354", "0.53047895", "0.5234232", "0.5231297", "0.5206632", "0.52057105", "0.5187965", "0.5177647", "0.51641995", "0.51572657", "0.5151876", "0.5130297", "0.5107404", "0.5100857", "0.5081308", "0.5063243", "0.5061835", "0.5058244", "0.50250745", "0.5019911", "0.501936", "0.500982", "0.49984214", "0.49842668", "0.4979021", "0.49678636", "0.49675247", "0.49623117", "0.49606413", "0.495847", "0.49467808", "0.49389586", "0.4923778", "0.4921132", "0.490721", "0.4901274", "0.48967052", "0.48960832", "0.4893961", "0.48910835", "0.48802504", "0.48718533", "0.48714936", "0.48678708", "0.48646766", "0.4847332", "0.4844685", "0.4835646", "0.48338366", "0.48286703", "0.48271117", "0.48176056", "0.4815194", "0.48127064", "0.48124203", "0.48112804", "0.47990054", "0.479581", "0.47870815", "0.478591", "0.47792563", "0.4778756", "0.4774605", "0.4771269", "0.47673842", "0.4752348", "0.4746387", "0.47341895", "0.47318912", "0.47171113", "0.47101918", "0.47099993", "0.4707865", "0.47074276", "0.47032338", "0.47032073", "0.46991515", "0.46958253", "0.46924368", "0.46856782", "0.46789673", "0.46754313", "0.46719912", "0.4660785", "0.46585047", "0.46538875", "0.46537066" ]
0.7337061
0
MysqlConnect return sql.DB connection
MysqlConnect возвращает соединение sql.DB
func MysqlConnect() *sql.DB { db, err := sql.Open("mysql", "root:mysql@/go-cms") err = db.Ping() if err != nil { fmt.Println(err.Error()) panic(err.Error()) // proper error handling instead of panic in your app } return db }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Connect(ctx context.Context, dbName string) (*sql.DB, error) {\n\tdbusername := os.Getenv(\"MARIA_USERNAME\")\n\tdbpassword := os.Getenv(\"MARIA_PASSWORD\")\n\n\tdb, err := sql.Open(\"mysql\", dbusername+\":\"+dbpassword+\"@tcp(127.0.0.1:3306)/\"+dbName)\n\tif err != nil {\n\t\tlogger.Error.Println(logger.GetCallInfo(), err.Error())\n\t\treturn nil, err\n\t}\n\n\terr = db.Ping()\n\tif err != nil {\n\t\tlogger.Error.Println(\"Error:\", err.Error())\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "func (c Connector) Connect() (db *sql.DB) {\n\tif c.db != nil {\n\t\tlevel.Info(c.log).Log(\"msg\", \"returning mysql\")\n\t\treturn db\n\t}\n\tlevel.Info(c.log).Log(\"msg\", \"connecting to mysql\")\n\tlevel.Info(c.log).Log(\"msg\", \"returning connection\")\n\t_ = c.config.dbdriver\n\tdbUser := c.config.dbUser\n\tdbHost := c.config.dbHost\n\tdbPass := c.config.dbPassword\n\tdbName := c.config.dbDatabase\n\tdbPort := c.config.dbPort\n\n\tdb, err := sql.Open(\"mysql\", dbUser+\":\"+dbPass+\"@(\"+dbHost+\":\"+dbPort+\")/\"+dbName)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tc.db = db\n\tc.db.SetMaxIdleConns(10)\n\tc.db.SetMaxOpenConns(10)\n\tc.db.SetConnMaxLifetime(time.Duration(360))\n\treturn c.db\n\n}", "func DbConnect() (db *sql.DB) {\n\tdb, err := sql.Open(\"mysql\", \"root:root@tcp(127.0.0.1:3308)/ecommerce\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn db\n}", "func MysqlConnect() (*gorm.DB, error) {\n\tconfig := aws.Config{\n\t\tRegion: aws.String(os.Getenv(\"DB_BUCKET_REGION\")),\n\t}\n\tsess := session.Must(session.NewSession(&config))\n\n\tsvc := s3.New(sess)\n\tfmt.Println(\"accessing bucket: \" + os.Getenv(\"DB_BUCKET\") + \"/\" + os.Getenv(\"DB_BUCKET_KEY\"))\n\ts3Output, err := svc.GetObject(&s3.GetObjectInput{\n\t\tBucket: aws.String(os.Getenv(\"DB_BUCKET\")),\n\t\tKey: aws.String(os.Getenv(\"DB_BUCKET_KEY\")),\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuf := new(bytes.Buffer)\n\tbuf.ReadFrom(s3Output.Body)\n\tconBytes := buf.Bytes()\n\n\tvar connection DB\n\tjson.Unmarshal(conBytes, &connection)\n\n\tfmt.Println(\"accessing database\")\n\n\tdb, err := gorm.Open(\"mysql\", connection.User+\":\"+connection.Password+\"@(\"+connection.Host+\":\"+connection.Port+\")\"+\"/\"+connection.Db+\"?charset=utf8&parseTime=True\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "func Connect() *sql.DB {\n\n\tvar connStr string\n\n\tif os.Getenv(\"mode\") == \"dev\" {\n\t\tconnStr = \"root\" + \"@tcp(\" + \"127.0.0.1:3306\" + \")/\" + \"analasia\"\n\t} else {\n\t\tconnStr = os.Getenv(\"DATABASE_USER\") + \":\" + os.Getenv(\"DATABASE_PASSWORD\") + \"@tcp(\" + os.Getenv(\"DATABASE_HOST\") + \")/\" + os.Getenv(\"DATABASE_NAME\")\n\t}\n\tconn, err := sql.Open(\"mysql\", connStr)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn conn\n\n}", "func connect() (connection mysql.Conn) {\n\tuser := \"root\"\n\tpass := \"toor\"\n\tdbname := \"trackerdb\"\n\tproto := \"tcp\"\n\taddr := \"127.0.0.1:3306\"\n\n\tdb := mysql.New(proto, \"\", addr, user, pass, dbname)\n\n\terr := db.Connect()\n\tif err != nil {\n\t\tfmt.Println(\"Database Connection Error:\", err)\n\t}\n\n\treturn db\n}", "func ConnectMysqlDB() (interface{}, error) {\n\tconfig := NewConfig()\n\tdb, err := gorm.Open(\"mysql\", config.Mysql.User+\":\"+config.Mysql.Password+\"@\"+config.Mysql.TCP+\"/\"+config.Mysql.DBName)\n\treturn db, err\n}", "func (my *MySQL) Connect() (err os.Error) {\n defer my.unlock()\n my.lock()\n\n if my.conn != nil {\n return ALREDY_CONN_ERROR\n }\n\n return my.connect()\n}", "func Connect(c *Config) (*sql.DB, error) {\n\n\tdb, err := sql.Open(\"sqlserver\", generateConnectionString(c))\n\tif err != nil {\n\t\tlog.Fatal(\"Error creating connection pool: \" + err.Error())\n\t}\n\treturn db, nil\n}", "func OpenMysql(driverName, dataSourceName string) (db *MysqlDB, err error) {\n var db2 *sql.DB\n db2, err = sql.Open(driverName, dataSourceName)\n if err != nil {\n return\n }\n db = &MysqlDB{}\n db.DB.DB = *db2\n return\n}", "func Dbcon() (db *sql.DB, err error) {\n\tdb, err = sql.Open(\"mysql\", \"mremmalex:password@tcp(localhost:3306)/backendtest\")\n\treturn db, err\n}", "func Connect(ctx context.Context, host string, port int, dbName, user, password string) (*DB, error) {\n\tconfig := mysql.Config{\n\t\tAddr: fmt.Sprintf(\"%s:%d\", host, port),\n\t\tNet: \"tcp\",\n\t\tUser: user,\n\t\tPasswd: password,\n\t\tDBName: dbName,\n\t\tMultiStatements: true,\n\t}\n\tctxLogger := logger.FromContext(ctx)\n\tctx = logger.NewContext(ctx, ctxLogger.(logger.WithLogger).With(\"host\", host, \"dbName\", dbName, \"user\", user, \"port\", port))\n\n\tdb := &DB{\n\t\tCtx: ctx,\n\t\tLogger: logger.FromContext(ctx),\n\t}\n\tdb.Logger.Info(\"dsn\", config.FormatDSN(), \"msg\", \"Connecting\")\n\tif myLogger, ok := db.Logger.(logger.PrintLogger); ok {\n\t\tif myWithLogger, okWith := db.Logger.(logger.WithLogger); okWith {\n\t\t\tmyLogger = myWithLogger.With(\"package\", \"mysql\").(logger.PrintLogger)\n\t\t}\n\t\tmysql.SetLogger(myLogger)\n\t}\n\tcon, err := sql.Open(\"mysql\", config.FormatDSN())\n\tif err != nil {\n\t\treturn db, err\n\t}\n\terr = con.PingContext(ctx)\n\tif err != nil {\n\t\treturn db, err\n\t}\n\tdb.Database = goqu.New(\"mysql\", con)\n\treturn db, nil\n}", "func MysqlConn() *sqlx.DB {\n\treturn dbConn\n}", "func dbConnect() (*sql.DB, error) {\n\tdb, err := sql.Open(\"mysql\", getDataSource())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// use the library_api database\n\t_, err = db.Exec(`USE library_api`)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "func SQLConnect(name, passwd, address, dbname string) (*sql.DB, error) {\r\n\turl := name + \":\" + passwd + \"@tcp(\" + address + \":3306)/\" + dbname\r\n\tdb, err := sql.Open(\"mysql\", url)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn db, nil\r\n}", "func (p MysqlProvider) Connect(config *gormx.DatabaseConfig) (*gorm.DB, error) {\n\tif config.Dialect == gormx.DriverMysql {\n\t\tif db, err := gorm.Open(mysql.New(mysql.Config{DSN: config.DSN}), &gorm.Config{\n\t\t\tLogger: gormx.DefaultLogger(&config.Logger),\n\t\t}); err == nil {\n\t\t\tif sqlDB, err := db.DB(); err == nil {\n\t\t\t\tif config.MaxIdle > 0 {\n\t\t\t\t\tsqlDB.SetMaxIdleConns(config.MaxIdle)\n\t\t\t\t}\n\t\t\t\tif config.MaxOpen > 0 && config.MaxOpen > config.MaxIdle {\n\t\t\t\t\tsqlDB.SetMaxOpenConns(100)\n\t\t\t\t}\n\t\t\t\tif config.MaxLifetime > 0 {\n\t\t\t\t\tsqlDB.SetConnMaxLifetime(time.Duration(config.MaxLifetime) * time.Second)\n\t\t\t\t}\n\t\t\t\treturn db, nil\n\t\t\t} else {\n\t\t\t\treturn nil, errors.New(\"open DB failed\")\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Errorf(\"connect mysql db failed: error=%s\", err.Error())\n\t\t}\n\t\treturn nil, errors.New(\"connect db failed\")\n\t}\n\treturn nil, errors.New(\"driver is not postgres\")\n}", "func ConnectMySQL() (*MySQL, error) {\n\tdb, err := sql.Open(\"mysql\", \"root:admin@tcp(localhost:3306)/Todo_db\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Println(\"connected to mySql\")\n\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Println(\"pinged mySql\")\n\n\treturn &MySQL{db}, nil\n}", "func GetConnection() *gorm.DB {\n\tmsqlInfo := \"root:Kamath@123@tcp(127.0.0.1:3306)/golang_crud?charset=utf8mb4&parseTime=True&loc=Local\"\n\t// msqlInfo := fmt.Sprintf(\"host=%s port=%d user=%s \"+\n\t// \t\"password=%s dbname=%s sslmode=disable\",\n\t// \thost, port, user, password, dbname)\n\n\tdb, err := gorm.Open(\"mysql\", msqlInfo)\n\n\tif err != nil {\n\t\tpanic(\"failed to connect database\")\n\t}\n\n\tlog.Println(\"DB Connection established...\")\n\n\treturn db\n\n}", "func (m *MySQL)Connect() error {\n\tif m.URI == \"\" {\n\t\treturn fmt.Errorf(\"mysql connection uri error\")\n\t}\n\tdb, err := sql.Open(\"mysql\", m.URI)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.db = db\n\treturn nil\n}", "func Connect() (*sqlx.DB, error) {\n\tvar err error\n\tConnectOnce.Do(func() {\n\t\tdb, err = sqlx.Open(\"mysql\", GetEnv()+\"?parseTime=true\")\n\t})\n\treturn db, err\n}", "func GetDatabaseConnection() *sql.DB {\n\tdatabaseIP, err := config.GetString(\"database/host\", \"mariadb\")\n\tdatabasePort, err := config.GetInt(\"database/port\", 3306)\n\tdatabasePassword, err := config.GetString(\"database/password\", \"\")\n\tdatabaseType, err := config.GetString(\"database/type\", \"mysql\")\n\tdatabaseName, err := config.GetString(\"database/name\", \"kubeam\")\n\tdatabaseUser, err := config.GetString(\"database/user\", \"root\")\n\n\tdatabaseConn := fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s\", databaseUser,\n\t\tdatabasePassword, databaseIP, databasePort, databaseName)\n\n\tdb, err := sql.Open(databaseType, databaseConn)\n\tErrorHandler(err)\n\n\terr = db.Ping()\n\tErrorHandler(err)\n\n\treturn db\n}", "func (dbi *dbInfo) connect() (*sql.DB, error) {\n\t// Set MySQL driver parameters\n\tdbParameters := \"charset=\" + dbi.charset\n\n\t// Append cleartext and tls parameters if TLS is specified\n\tif dbi.tls == true {\n\t\tdbParameters = dbParameters + \"&allowCleartextPasswords=1&tls=skip-verify\"\n\t}\n\n\tdb, err := sql.Open(\"mysql\", dbi.user+\":\"+dbi.pass+\"@tcp(\"+dbi.host+\":\"+dbi.port+\")/?\"+dbParameters)\n\tcheckErr(err)\n\n\t// Ping database to verify credentials\n\terr = db.Ping()\n\n\treturn db, err\n}", "func connect(dsn string) *sql.DB {\n\tdb, err := sql.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Set the maximum number of idle connections in the pool. Setting this\n\t// to less than or equal to 0 will mean that no idle connections are retained.\n\tdb.SetMaxIdleConns(5)\n\n\tif err := db.Ping(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn db\n}", "func GetDBConnection(databaseURL string) (*sql.DB, error) {\n var db *sql.DB\n appEnv, err := cfenv.Current()\n if err != nil {\n db, err = sql.Open(\"mysql\", databaseURL+\"?parseTime=true\")\n if err != nil {\n return nil, err\n }\n } else {\n mysqlEnv, err := appEnv.Services.WithName(\"hero-mysql\")\n if err != nil {\n return nil, err\n }\n mysqlPort := \"\"\n if val, ok := mysqlEnv.Credentials[\"port\"].(string); ok {\n mysqlPort = val\n } else {\n mysqlPort = strconv.FormatFloat(mysqlEnv.Credentials[\"port\"].(float64), 'f', -1, 64)\n }\n db, err = sql.Open(\"mysql\", mysqlEnv.Credentials[\"username\"].(string)+\":\"+mysqlEnv.Credentials[\"password\"].(string)+\"@tcp(\"+mysqlEnv.Credentials[\"hostname\"].(string)+\":\"+mysqlPort+\")/\"+mysqlEnv.Credentials[\"name\"].(string)+\"?parseTime=true\")\n if err != nil {\n return nil, err\n }\n }\n\n err = db.Ping()\n if err != nil {\n db.Close()\n return nil, err\n }\n\n return db, nil\n}", "func Connect() *gorm.DB {\n\tURL := fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s?charset=utf8&parseTime=True&loc=Local\", DB_USER, DB_PASS, DB_HOST, DB_PORT, DB_NAME)\n\tdb, err := gorm.Open(\"mysql\", URL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn nil\n\t}\n\treturn db\n}", "func (m *MysqlRepository) connect() error {\n\tif !m.connected {\n\t\tdb, err := sql.Open(\"mysql\", m.Credentials)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tm.db = db\n\t\tm.connected = true\n\t}\n\n\treturn nil\n}", "func Connect(settings *config.Configuration) (*Connection, error) {\n\tconnnectionString := fmt.Sprintf(\n\t\t\"%s:%s@(%s:%d)/%s?charset=utf8&parseTime=True&loc=Local\",\n\t\tsettings.DatabaseUser,\n\t\tsettings.DatabasePassword,\n\t\tsettings.DatabaseHost,\n\t\tsettings.DatabasePort,\n\t\tsettings.DatabaseName,\n\t)\n\n\tdb, err := gorm.Open(\"mysql\", connnectionString)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Connection failed: %v\", err)\n\t}\n\n\tdatabase.DB = db\n\tdatabase.LogMode(settings.DatabaseVerboseMode)\n\n\treturn &database, nil\n}", "func Connect(user string, password string, host string, port int, schema string, dsn string) (*sql.DB, error) {\n\tvar err error\n\tvar connString bytes.Buffer\n\n\tpara := map[string]interface{}{}\n\tpara[\"User\"] = user\n\tpara[\"Pass\"] = password\n\tpara[\"Host\"] = host\n\tpara[\"Port\"] = port\n\tpara[\"Schema\"] = schema\n\n\ttmpl, err := template.New(\"dbconn\").Option(\"missingkey=zero\").Parse(dsn)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"tmpl parse\")\n\t\treturn nil, err\n\t}\n\n\terr = tmpl.Execute(&connString, para)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"tmpl execute\")\n\t\treturn nil, err\n\t}\n\n\tlog.Debug().Str(\"dsn\", connString.String()).Msg(\"connect to db\")\n\tdb, err := sql.Open(\"mysql\", connString.String())\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"mysql connect\")\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "func (bdm *MySQLDBManager) getConnection() (*sql.DB, error) {\n\n\tif !bdm.openedConn {\n\t\treturn nil, errors.New(\"Connection was not inited\")\n\t}\n\n\tif bdm.conn != nil {\n\t\treturn bdm.conn, nil\n\t}\n\n\tdb, err := sql.Open(\"mysql\", bdm.Config.GetMySQLConnString())\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t//db.SetMaxOpenConns(2)\n\tdb.SetMaxIdleConns(2)\n\n\tbdm.conn = db\n\n\treturn db, nil\n}", "func dbConn() (db *sql.DB) {\r\n\tdbDriver := \"mysql\"\r\n\tdbUser := \"root\"\r\n\tdbPass := \"\"\r\n\tdbName := \"golang\"\r\n\tdb, err := sql.Open(dbDriver, dbUser+\":\"+dbPass+\"@/\"+dbName)\r\n\tif err != nil {\r\n\t\tpanic(err.Error())\r\n\t}\r\n\treturn db\r\n}", "func DBCon() *sql.DB {\n\tdbCfg := readConfig()\n\n\t// dbconnection string format: \"username:password@tcp(127.0.0.1:3306)/test\"\n\tdb, err := sql.Open(\"mysql\", fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s\", dbCfg.usr, dbCfg.pass,\n\t\tdbCfg.host, dbCfg.port, dbCfg.dbname))\n\n\tif err != nil {\n\t\tlog.Fatal(\"(ERR) Database connection configuration is not satisfied: \", err)\n\t}\n\n\t// You can set the connection details here if you are using only this application for the database\n\t/*db.SetMaxOpenConns(25)\n\tdb.SetMaxIdleConns(25)\n\tdb.SetConnMaxLifetime(5 * time.Minute)*/\n\n\t// In Go, connection doesn't mean that it is connected successfully so you need to ping the database if the\n\t// connection is really available with the given config\n\tctx, cancelfunc := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancelfunc()\n\terr = db.PingContext(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"(ERR) Database: %s with host: %s is not reachable: %s\", dbCfg.dbname, dbCfg.host,\n\t\t\terr.Error())\n\t}\n\n\treturn db\n\n}", "func ConnectDB() *sql.DB {\n\thost := viper.GetString(\"db.host\")\n\tport := viper.GetString(\"db.port\")\n\tuser := viper.GetString(\"db.user\")\n\tpass := viper.GetString(\"db.pass\")\n\tdsn := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s\", user, pass, host, port, user)\n\tdb, err := sql.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error connecting to db: %s\\n\", err.Error())\n\t}\n\treturn db\n}", "func ConnectDB() {\n\ttcpString := \"@tcp(\" + Config.mysql + \")\"\n\tdb, err := sql.Open(\"mysql\", \"root:\"+tcpString+\"/\"+Config.dbName)\n\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\n\tConnection.Db = db\n\n\terr = Connection.Db.Ping()\n\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n}", "func Connect() *sql.DB {\n\tdb, err := sql.Open(\"mysql\", \"root:@tcp(localhost:3306)/task_database\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(\"Connected to the database\")\n\t// CreateDatabase(db) // uncomment to create database and reset table\n\tcon = db\n\treturn db\n}", "func Connect() (*gorm.DB, error) {\n\tdb, err := gorm.Open(\"mysql\", viper.GetString(\"mysql.username\")+\":\"+viper.GetString(\"mysql.password\")+\"@(\"+viper.GetString(\"mysql.hostname\")+\":\"+viper.GetString(\"mysql.port\")+\")/\"+viper.GetString(\"mysql.database\")+\"?charset=utf8&parseTime=True&loc=Local\")\n\treturn db, err\n}", "func ConnectMe() (db *sql.DB, err error) {\n\tgodotenv.Load()\n\tconnString := fmt.Sprintf(\"server=%s;user id=%s;password=%s;port=%s;database=%s;\",\n\t\tutilities.GoDotEnvVariable(\"Server\"), utilities.GoDotEnvVariable(\"user\"), utilities.GoDotEnvVariable(\"Password\"), utilities.GoDotEnvVariable(\"Port\"), utilities.GoDotEnvVariable(\"Database\"))\n\tdb, err = sql.Open(\"sqlserver\", connString)\n\tctx := context.Background()\n\terr = db.PingContext(ctx)\n\treturn db, err\n}", "func Connect() (*gorm.DB, error) {\n\turl := fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local\", *dbUser, *dbPassword, *dbHost, *dbPort, *dbSchema)\n\treturn gorm.Open(\"mysql\", url)\n}", "func (m *DAOUtil) Connect() *mgo.Database {\n\tsession, err := mgo.Dial(m.Server)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn session.DB(m.Database)\n}", "func dbconn() (db *sql.DB) {\n\tdbDriver := \"mysql\"\n dbUser := \"root\"\n dbPass := \"\"\n\tdbName := \"pmi\"\n\tdb, err := sql.Open(dbDriver, dbUser+\":\"+dbPass+\"@/\"+dbName)\n\tif err != nil {\n panic(err.Error())\n }\n return db\n}", "func (client *DatabaseClient) Connect() error {\n var err error\n database, err = gorm.Open(\"mysql\", client.buildDatabaseDSN())\n if err != nil {\n return errors.DatabaseConnectionError.ToError(err)\n }\n client.autoMigrate()\n return nil\n}", "func connectDB(cfg *config.DB) error{\n\turi := fmt.Sprintf(\"%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True\", cfg.User, cfg.Password, cfg.Address, cfg.Name)\n\tconn, err := gorm.Open(dialect, uri)\n\tif err != nil{\n\t\treturn err\n\t}\n\tdefaultDB = &DB{conn}\n\tdefaultDB.DB.DB().SetMaxIdleConns(cfg.MaxIdleConn)\n\tdefaultDB.DB.DB().SetMaxOpenConns(cfg.MaxOpenConn)\n\tdefaultDB.DB.DB().SetConnMaxLifetime(cfg.MaxConnLifetime)\n\tdefaultDB.DB.LogMode(cfg.Debug)\n\n\treturn nil\n}", "func connect_db() {\n\tdb, err = sql.Open(\"mysql\", \"root:jadir123@tcp(127.0.0.1:3306)/go_db\")\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\terr = db.Ping()\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}", "func connectDB(dsn string) (dbh *sql.DB, err error) {\n\tdbh, err = sql.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Set really low limits, this application is only meant to do quick serialized SQL queries\n\tdbh.SetMaxOpenConns(1)\n\tdbh.SetConnMaxLifetime(time.Second)\n\n\treturn\n}", "func ConnectDB() *sql.DB {\n\n\t// connString := fmt.Sprintf(\"%s/%s/@//****:****/%s\",\n\t// dbusername,\n\t// dbpassword,\n\t// dbsid)\n\n\t// db, err := sql.Open(\"goracle\", connString)\n\tdb, err := sql.Open(\n\t\t\"godror\", \"plnadmin/plnadmin@apkt_dev\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn db\n}", "func Connect() (*gorm.DB, error) {\n\n\tdb, err := gorm.Open(mysql.Open(config.DBURL), &gorm.Config{})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "func getDbClient(connectionInfo string) *sqlx.DB {\n\n\t// dataSource := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s\", dbUser, dbPasswd, dbAddr, dbPort, dbName)\n\n\tclient, err := sqlx.Open(\"mysql\", connectionInfo)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err = client.Ping(); err != nil {\n\t\tpanic(err)\n\t}\n\t// See \"Important settings\" section.\n\tclient.SetConnMaxLifetime(time.Minute * 3)\n\tclient.SetMaxOpenConns(10)\n\tclient.SetMaxIdleConns(10)\n\treturn client\n}", "func GetConn() (conn *sql.DB) {\n\n\tcfg, _ := config.ParseConfig()\n\n\tconnstr := cfg.Db.Username + \":\" + cfg.Db.Password + \"@tcp(\" + cfg.Db.Host + \")/\" + cfg.Db.Database + \"?parseTime=true\"\n\n\tconn, err := sql.Open(\"mysql\", connstr)\n\tif err != nil {\n\t\tutils.LogError(err.Error(), \"utils.go\", 18)\n\t\treturn\n\t}\n\treturn\n}", "func DBConn() (db *sql.DB) {\n\tdbDriver := \"mysql\"\n\tdbUser := \"root\"\n\tdbPass := \"vrajupaj\"\n\tdbName := \"example\"\n\tdb, err := sql.Open(dbDriver, dbUser+\":\"+dbPass+\"@/\"+dbName)\n\n\tif err != nil {\n\t\tpanic(err.Error())\n\t} else {\n\t\tlog.Println(\"Connection was opened correctly\")\n\t}\n\n\treturn db\n}", "func ConnectMysql() {\n\tdb, err := gorm.Open(\"mysql\", config.Config[\"mysql\"])\n\t// db.LogMode(true)\n\tif err != nil {\n\t\tfmt.Println(\"Connection Failed to Open\", err)\n\t} else {\n\t\tfmt.Println(\"Mysql Connection Established\")\n\t\tMigrate(db)\n\t}\n\tDb = db\n}", "func (w *DBInstance) connect() (req DBRequest, err error) {\n\treq.db, err = gorm.Open(\"mysql\", fmt.Sprintf(\"%v:%v@/%v?charset=utf8&parseTime=True&loc=Local\", w.sqlUser, w.sqlPass, w.sqlDBName))\n\treturn\n}", "func Connect() *sql.DB {\n\tfmtStr := \"host=%s port=%s user=%s \" +\n\t\t\"password=%s dbname=%s sslmode=disable\"\n\tpsqlInfo := fmt.Sprintf(\n\t\tfmtStr,\n\t\tos.Getenv(\"PG_HOST\"),\n\t\tos.Getenv(\"PG_PORT\"),\n\t\tos.Getenv(\"PG_USER\"),\n\t\tos.Getenv(\"PG_PASSWORD\"),\n\t\tos.Getenv(\"PG_DBNAME\"),\n\t)\n\tdb, err := sql.Open(\"postgres\", psqlInfo)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn db\n}", "func ConnectDB() *sql.DB {\n\tdb, err := sql.Open(\"mysql\", \"username:password@/dbname\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\treturn db\n}", "func GetConnection() (database *sql.DB) {\n\tdatabaseDriver := \"mysql\"\n\tdatabaseUser := \"newuser\"\n\tdatabasePass := \"newuser\"\n\tdatabaseName := \"crm\"\n\tdatabase, error := sql.Open(databaseDriver, databaseUser+\":\"+databasePass+\"@/\"+databaseName)\n\t// stops the execution if there is any error in connecting\n\tif error != nil {\n\t\tpanic(error.Error())\n\t}\n\treturn database\n}", "func Conn() (db *sql.DB) {\n\t// dbDriver := \"mysql\"\n\t// dbUser := \"root\"\n\t// dbPass := \"1234\"\n\t// dbName := \"accuknox\"\n\t// db, err := sql.Open(dbDriver, dbUser+\":\"+dbPass+\"@/\"+dbName)\n\tconnString := \"root:1234@tcp(localhost:3306)/accuknox\"\n\tdb, err := sql.Open(\"mysql\", connString)\n\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn db\n}", "func dbConn() (db *sql.DB) {\n\tdbDriver := \"mysql\"\n\tdbUser := \"root\"\n\tdbpass := \"Green2013[]\"\n\tdbName := \"goblog\"\n\n\tdb, err := sql.Open(dbDriver, dbUser+\":\"+dbpass+\"@/\"+dbName)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\treturn db\n\n}", "func (s *cinemaServiceServer) connect(ctx context.Context) (*sql.Conn, error) {\n\tc, err := s.db.Conn(ctx)\n\tif err != nil {\n\t\treturn nil, status.Error(codes.Unknown, \"failed to connect to database-> \"+err.Error())\n\t}\n\treturn c, nil\n}", "func (self *CSql) Connect(driverName string, dial string) (*sql.DB, error) {\r\n\tvar err error = nil\r\n\tself.db, err = sql.Open(driverName, dial)\r\n\tself.db.SetMaxOpenConns(20)\r\n\tself.db.SetMaxIdleConns(10)\r\n\tself.db.SetConnMaxLifetime(60 * time.Second)\r\n\treturn self.db, err\r\n}", "func (c *Client) Connect() (*DBConnection, error) {\n\tdbRegistryLock.Lock()\n\tdefer dbRegistryLock.Unlock()\n\n\tdsn := c.config.connStr(c.databaseName)\n\tconn, found := dbRegistry[dsn]\n\tif !found {\n\t\tdb, err := sql.Open(proxyDriverName, dsn)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error connecting to PostgreSQL server %s: %w\", c.config.Host, err)\n\t\t}\n\n\t\t// We don't want to retain connection\n\t\t// So when we connect on a specific database which might be managed by terraform,\n\t\t// we don't keep opened connection in case of the db has to be dopped in the plan.\n\t\tdb.SetMaxIdleConns(0)\n\t\tdb.SetMaxOpenConns(c.config.MaxConns)\n\n\t\tconn = &DBConnection{\n\t\t\tdb,\n\t\t\tc,\n\t\t}\n\t\tdbRegistry[dsn] = conn\n\t}\n\n\treturn conn, nil\n}", "func Connect(path string) (*sql.DB, error){\n\t//TODO: Commit feature\n\tlog.Println(\"INFO: Connecting to the DB\")\n\tdb, err := sql.Open(\"mysql\", path)\n\tlog.Println(\"INFO: Connected to the DB\")\n\treturn db, err\n}", "func getConn() *gorm.DB {\n\tdsn := \"host=localhost user=hello password=hello dbname=hello port=15432 sslmode=disable TimeZone=Asia/Shanghai\"\n\tdb, _ := gorm.Open(postgres.Open(dsn), &gorm.Config{})\n\n\treturn db\n\t// sqlDB, err := db.DB()\n\n\t// // SetMaxIdleConns 设置空闲连接池中连接的最大数量\n\t// sqlDB.SetMaxIdleConns(10)\n\t// // SetMaxOpenConns 设置打开数据库连接的最大数量。\n\t// sqlDB.SetMaxOpenConns(100)\n\n\t// // SetConnMaxLifetime 设置了连接可复用的最大时间。\n\t// sqlDB.SetConnMaxLifetime(time.Hour)\n}", "func dbConn() (db *sql.DB) {\n\tdbDriver := \"mysql\"\n\tdbUser := \"root\"\n\tdbPass := \"Kikker12\"\n\tdbName := \"vitaintellectdb\"\n\tdb, err := sql.Open(dbDriver, dbUser+\":\"+dbPass+\"@/\"+dbName)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn db\n}", "func Connect() *Database {\n\n\tonce.Do(func() {\n\t\tdb, err := sql.Open(\"mysql\",\n\t\t\t\"root:@tcp(127.0.0.1:3306)/messaging\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tinstance = &Database{database: db}\n\t})\n\n\treturn instance\n}", "func GetConnection() (database *sql.DB) {\n\tdatabaseDriver := \"mysql\"\n\tdatabaseUser := \"newuser\"\n\tdatabasePass := \"newuser\"\n\tdatabaseName := \"crm\"\n\tdatabase, err := sql.Open(databaseDriver, databaseUser+\":\"+databasePass+\"@/\"+databaseName)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn database\n}", "func Connect(c Configer) (*gorm.DB, error) {\n\tdb, err := gorm.Open(c.ConnectionStringWithDriver())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.LogMode(c.Logging())\n\tdb.DB().SetConnMaxLifetime(c.ConnectionMaxLifetime())\n\tdb.DB().SetMaxOpenConns(c.MaxOpenConnections())\n\tdb.DB().SetMaxIdleConns(c.MaxIdleConnections())\n\tif err = db.DB().Ping(); err != nil {\n\t\tdb.Close()\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "func DbConn() (db *sql.DB) {\n\t//var host = \"tcp(192.168.0.14)\"\n\tvar host = \"tcp(192.168.0.12)\"\n\t// var host = \"tcp(127.0.0.1)\"\n\tdbname := \"dbaexperience\"\n\tdb, err := sql.Open(config.DbDriver, fmt.Sprintf(\"%s:%s@%s/%s\", config.DbUser, config.DbPass, host, dbname))\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn db\n}", "func Connect(c *config.Config) (*sql.DB, error) {\n\tstr := fmt.Sprintf(\"postgres://%s:%s@%s:%s/%s?sslmode=disable\", c.DatabaseUser, c.DatabasePassword, c.DatabaseHost, c.DatabasePort, c.DatabaseName)\n\tdb, err := sql.Open(\"postgres\", str)\n\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n\n\treturn db, err\n}", "func InitConnectionMysql(cf *config.Configs) (*MysqlConfig, error) {\n\tdns := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True\",\n\t\tcf.Mysql.Username,\n\t\tcf.Mysql.Password,\n\t\tcf.Mysql.Host,\n\t\tcf.Mysql.Port,\n\t\tcf.Mysql.DatabaseName,\n\t)\n\n\tdatabase, err := gorm.Open(mysql.Open(dns), &gorm.Config{})\n\tif err != nil {\n\t\tlogrus.Errorf(\"[InitConnectionMysql] failed to connect to the database error: %s\", err)\n\t\treturn nil, err\n\t}\n\n\tsqlDB, err := database.DB()\n\tif err != nil {\n\t\tlogrus.Errorf(\"[InitConnectionMysql] set up to connect to the database error: %s\", err)\n\t\treturn nil, err\n\t}\n\n\tsqlDB.SetMaxOpenConns(cf.Mysql.ConnectionPool.MaxOpenConns)\n\tsqlDB.SetMaxIdleConns(cf.Mysql.ConnectionPool.MaxIdleConns)\n\tsqlDB.SetConnMaxLifetime(cf.Mysql.ConnectionPool.MaxLifeTime * time.Minute)\n\n\treturn &MysqlConfig{Database: database}, nil\n}", "func Connect(driver, db string) *sql.DB {\n\tDB, err := sql.Open(driver, db)\n\tcheckErr(err)\n\treturn DB\n}", "func ConnectMe() {\n\tgodotenv.Load()\n\tconnString := fmt.Sprintf(\"server=%s;user id=%s;password=%s;port=%s;database=%s;\",\n\t\tGoDotEnvVariable(\"Server\"), GoDotEnvVariable(\"user\"), GoDotEnvVariable(\"Password\"), GoDotEnvVariable(\"Port\"), GoDotEnvVariable(\"Database\"))\n\tdb, err = sql.Open(\"sqlserver\", connString)\n\tif err != nil {\n\t\tlog.Fatal(\"Error creating connection pool: \", err.Error())\n\t} else {\n\t\tfmt.Println(\"no eerror\")\n\t}\n\tctx := context.Background()\n\terr = db.PingContext(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t} else {\n\t\tfmt.Println(\"no eerror 2\")\n\t}\n\t//return db, err\n}", "func ConnectToMySQL(conf MySQLConfig) (*sql.DB, error) {\n\tconnectionString := fmt.Sprintf(\"%v:%v@tcp(%v:%v)/%v\", conf.User, conf.Password, conf.Host, conf.Port, conf.Db)\n\tlog.Printf(\"Connecting to the DB with string : %s\", connectionString)\n\tdb, err := sql.Open(\"mysql\", connectionString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.SetConnMaxLifetime(time.Minute * 3)\n\tdb.SetMaxOpenConns(10)\n\tdb.SetMaxIdleConns(10)\n\treturn db, nil\n}", "func connect() (*mongo.Database, *mongo.Client) {\n\tmongoURI, exists := os.LookupEnv(\"MONGO_URI\")\n\tif exists {\n\t\tclient, err := mongo.Connect(\n\t\t\tcontext.TODO(),\n\t\t\toptions.Client().ApplyURI(mongoURI),\n\t\t)\n\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// Check the connection\n\t\terr = client.Ping(context.TODO(), nil)\n\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\treturn client.Database(\"Stringtheory\"), client\n\t}\n\treturn nil, nil\n}", "func GetMySQLConnection() (*gorm.DB, error) {\n\tconnStr := fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s?charset=utf8&timeout=20s\", dbuser, dbpass, \"mysql.bookwarehouse\", dbport, dbname)\n\tdb, err := gorm.Open(mysql.Open(connStr), &gorm.Config{})\n\n\treturn db, err\n}", "func Connect() (*sql.DB, error) {\n\treturn db.Connect(*dbURI)\n}", "func Connect() (db *sqlx.DB) {\n\tdb, err := sqlx.Connect(\"mysql\", \"root:yousql@tcp(127.0.0.1:3306)/test\")\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\treturn\n}", "func dbConn() (db *sql.DB) {\n\tdbDriver := \"mysql\"\n\tdbUser := \"root\"\n\tdbName := \"appointment_db\"\n\tdb, err := sql.Open(dbDriver, dbUser+\"@tcp(127.0.0.1:3306)/\"+dbName+\"?parseTime=true\")\n\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\treturn db\n}", "func (m *MySQL) Connect() error {\n\t// user:password@protocol(server:port)/database?params...\n\tdsn := fmt.Sprintf(\n\t\t\"%s:%s@tcp(%s:%s)/%s?tls=false&autocommit=true&allowNativePasswords=true&parseTime=true\",\n\t\t\"root\",\n\t\t\"userRootPass\",\n\t\t\"127.0.0.1\",\n\t\t\"3306\",\n\t\t\"store\",\n\t)\n\n\tdb, err := sql.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tm.db = db\n\treturn nil\n}", "func Connect() *sql.DB {\n\tURL := fmt.Sprintf(\"user=%s password=%s dbname=%s sslmode=%s\", configs.Database.User, configs.Database.Pass, configs.Database.Name, \"disable\")\n\tdb, err := sql.Open(\"postgres\", URL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn nil\n\t}\n\treturn db\n}", "func MysqlConnectionString(path string) string {\n\tvar port string\n\tsettings := Settings(path)\n\n\tif len(settings[\"port\"]) == 0 {\n\t\tport = \"3306\"\n\t} else {\n\t\tport = settings[\"port\"]\n\t}\n\n\tconnection := []string{\n\t\tsettings[\"username\"], \":\",\n\t\tsettings[\"password\"], \"@tcp(\",\n\t\tsettings[\"host\"], \":\",\n\t\tport, \")/\",\n\t\tsettings[\"database\"], \"\"}\n\n\treturn strings.Join(connection, \"\")\n}", "func Connect(uri string) *mgo.Session {\n\tif uri == \"\" {\n\t\tlog.Fatalln(\"Error empty Connection String to mongo Db servers\")\n\t}\n\tdb, err := mgo.Dial(uri)\n\tif err != nil {\n\t\tlog.Fatalln(\"cannot dial mongo:\", uri, \"\\n with error:\", err)\n\t}\n\n\treturn db\n}", "func ConnectDatabase() *sql.DB {\n\tinstance, err := sql.Open(\"mysql\", \"root:root@(127.0.0.1:3306)/movingmanager\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn instance\n}", "func GormConnectDB() *gorm.DB {\n\n\thost := viper.GetString(\"db.host\")\n\tport := viper.GetString(\"db.port\")\n\tuser := viper.GetString(\"db.user\")\n\tpass := viper.GetString(\"db.pass\")\n\tdsn := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=True\", user, pass, host, port, user)\n\tdb, err := gorm.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error connecting gorm to db: %s\\n\", err.Error())\n\t}\n\treturn db\n\n}", "func GetMySQLConnection(config SQLConfig) (*sql.DB, error) {\n\tmysqlConfig := mysql.Config{\n\t\tUser: config.User, Passwd: config.PW,\n\t\tNet: \"tcp\", Addr: fmt.Sprintf(\"%s:%d\", config.Host, config.Port), DBName: config.Name,\n\t}\n\tconn, err := sql.Open(\"mysql\", mysqlConfig.FormatDSN())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconn.SetConnMaxLifetime(time.Duration(config.Pool.MaxLifetime) * time.Second)\n\tconn.SetMaxIdleConns(config.Pool.MaxIdle)\n\tconn.SetMaxOpenConns(config.Pool.MaxOpen)\n\treturn conn, nil\n}", "func DBConnection() (*sql.DB, error) {\n\n\tconfig := configuration.LoadConfiguration()\n\tdb, err := sql.Open(\"mysql\", \"\"+config.MySQLUser+\":\"+config.MySQLPass+\"@tcp(\"+config.MySQLHost+\")/\"+config.MySQLDb)\n\n\treturn db, err\n}", "func connectDb() *sql.DB {\n\tconnStr := \"user=postgres dbname=postgres sslmode=disable port=5000\"\n\tdb, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn db\n}", "func Connect(p *DBConfig) (*sql.DB, error) {\n\tconnStr := fmt.Sprintf(connFmt, p.Host, p.Port, p.User, p.Pass, p.DB)\n\tdb, err := sql.Open(\"postgres\", connStr)\n\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}", "func initializeMysqlConn() {\n\tdbConn, err := sql.Open(\"mysql\", \"admin:admin@tcp(y2search_mysql:3306)/y2search_db?collation=utf8mb4_unicode_ci\")\n\tdb = *dbConn\n\tif err != nil {\n\t\tlog.Panic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic\n\t}\n\n\t// Open doesn't open a connection. Validate DSN data:\n\terr = db.Ping()\n\tif err != nil {\n\t\tlog.Panic(err.Error()) // proper error handling instead of panic in your app\n\t}\n}", "func ConnectDB() (*DB, error) {\n\t// ?parseTime=true\n\t// https://stackoverflow.com/questions/45040319/unsupported-scan-storing-driver-value-type-uint8-into-type-time-time\n\tdb, err := sql.Open(\"mysql\", \"api:keepgrowth$@/book_report?parseTime=true\")\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// https://github.com/go-sql-driver/mysql/#important-settings\n\tdb.SetConnMaxLifetime(time.Minute * 3)\n\tdb.SetMaxOpenConns(10)\n\tdb.SetConnMaxIdleTime(10)\n\n\terrPing := db.Ping()\n\tif errPing != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tqb := goqu.New(\"mysql\", db)\n\n\treturn &DB{qb}, nil\n}", "func (w *Wrapper) Connect() (err error) {\n\terr = w.db.Connect()\n\treturn\n}", "func Connect() error {\n\tcfg := Config{}\n\tif err := env.Parse(&cfg); err != nil {\n\t\treturn fmt.Errorf(\"%+v\", err)\n\t}\n\tdsn := cfg.DbUser + \":\" + cfg.DbPassword + \"@\" + cfg.DbHost + \"/\" + cfg.\n\t\tDbName + \"?parseTime=true&charset=utf8\"\n\n\tdb, err := sql.Open(\"mysql\", dsn)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar dbErr error\n\tfor i := 1; i <= 8; i++ {\n\t\tdbErr = db.Ping()\n\t\tif dbErr != nil {\n\t\t\tif i < 8 {\n\t\t\t\tlog.Printf(\"db connection failed, %d retry : %v\", i, dbErr)\n\t\t\t\ttime.Sleep(10 * time.Second)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\tif dbErr != nil {\n\t\treturn errors.New(\"can't connect to database after 3 attempts\")\n\t}\n\n\tDbConn = db\n\n\treturn nil\n}", "func connect(ctx context.Context, conf *config.DatabaseConf) (*DB, error) {\n\tpgxConf, err := pgxpool.ParseConfig(conf.Url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpgxConf.MaxConns = conf.MaxConns\n\n\tpool, err := pgxpool.ConnectConfig(ctx, pgxConf)\n\treturn &DB{Pool: pool}, err\n}", "func connectGorm() *gorm.DB {\n\tdatabaseConfig := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?multiStatements=true&parseTime=true\", os.Getenv(\"DB_USER\"), os.Getenv(\"DB_PASSWORD\"), os.Getenv(\"DB_HOST\"), os.Getenv(\"DB_PORT\"), os.Getenv(\"DB_DATABASE\"))\n\n\tdb, err := gorm.Open(mysql.Open(databaseConfig), InitConfig())\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tpanic(\"Fail To Connect Database\")\n\t}\n\n\treturn db\n}", "func dbSQLConnect(dbType string) {\n\t// Errors\n\tvar err error\n\n\t// Getting an instance of dbConfig\n\tdbConfig := config.DataBase{}\n\n\t// Getting the DSN\n\tdsn := dbConfig.GetDSN()\n\n\t// Defining the default message\n\tmsg := fmt.Sprintf(\"Could not connect with the database [%v]\", strings.ToTitle(dbType))\n\n\tswitch {\n\tcase dbType == \"mysql\":\n\t\t// Open the connection\n\t\tDB, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})\n\t\tutils.PanicMSG(err, msg)\n\tcase dbType == \"postgresql\":\n\t\t// Open the connection\n\t\tDB, err = gorm.Open(postgres.Open(dsn), &gorm.Config{})\n\t\tutils.PanicMSG(err, msg)\n\tdefault:\n\t\tlog.Fatalln(\"Database does not have support Yet! Supported Databases: [MySQL and PostgreSQL\")\n\t}\n}", "func Connect(migrate bool) (*gorm.DB, *redis.Client, error) {\n\tvar err error\n\tdb, err := connectPostgres(migrate)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\trdb, err := connectRedis()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn db, rdb, nil\n}", "func Connect(cfg *Config) (*Connection, error) {\n\td, err := gorm.Open(cfg.Driver, cfg.Args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc := &Connection{\n\t\tC: d,\n\t\tlog: logrus.WithField(\"context\", \"db\"),\n\t}\n\tc.log.Info(\"connected to database\")\n\treturn c, nil\n}", "func GetDBconn() *sql.DB {\n\tdbName := \"userdb\"\n\tfmt.Println(\"conn info:\", dbName)\n\tdb, err := sql.Open(\"mysql\", \"root:manish1234@tcp(localhost:3306)/userdb\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\t// defer db.Close()\n\n\treturn db\n}", "func (dbInfo *DBInfo) DbConn() (db *sql.DB) {\n\tdbDriver := \"mysql\"\n\tdb, err := sql.Open(dbDriver, dbInfo.User+\":\"+dbInfo.Pass+\"@tcp(\"+dbInfo.Host+\":3306)/\"+dbInfo.Name)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn db\n}", "func (api *MysqlAPI) GetConnectionPool(dbURI string) *sql.DB {\n\tif api.connection == nil {\n\t\tpool, err := sql.Open(\"mysql\", dbURI)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err.Error())\n\t\t}\n\t\t// 3 minutes unused connections will be closed\n\t\tpool.SetConnMaxLifetime(3 * time.Minute)\n\t\tpool.SetMaxIdleConns(3)\n\t\tpool.SetMaxOpenConns(10)\n\t\tapi.connection = pool\n\t}\n\treturn api.connection\n}", "func Connect() *gorm.DB {\n\tdsn := fmt.Sprintf(\n\t\t\"host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=America/Bogota\",\n\t\tconfig.Load(\"DB_HOST\"), config.Load(\"DB_USER\"), config.Load(\"DB_PWD\"), config.Load(\"DB_NAME\"),\n\t\tconfig.Load(\"DB_PORT\"),\n\t)\n\n\tdb, err := gorm.Open(postgres.Open(dsn), &gorm.Config{\n\t\tQueryFields: true,\n\t})\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn db\n}", "func Connect(connectionString string) error {\n\tvar err error\n\tConnector, err = gorm.Open(\"mysql\", connectionString)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Println(\"Connection was successful!!\")\n\treturn nil\n}", "func Connect(ctx context.Context, cfg Config) (*DB, error) {\n\tpool, err := pgxpool.New(ctx, ConnString(cfg))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"database connection error: %w\", err)\n\t}\n\tdb := DB{pool}\n\n\treturn &db, nil\n}" ]
[ "0.7435016", "0.7401686", "0.72967714", "0.72485375", "0.72361165", "0.7153986", "0.71051663", "0.70108306", "0.6982586", "0.69476956", "0.6929489", "0.6918455", "0.69164646", "0.6911132", "0.6901979", "0.689255", "0.6888109", "0.68737906", "0.6856792", "0.6850909", "0.68465036", "0.6807335", "0.67980695", "0.6793458", "0.67911834", "0.6767546", "0.67449594", "0.671652", "0.6708229", "0.670592", "0.66830736", "0.66791207", "0.6675906", "0.6673187", "0.6653352", "0.6645858", "0.66450137", "0.6641547", "0.6640185", "0.6634728", "0.6629257", "0.6628052", "0.6606287", "0.6605942", "0.66014373", "0.65971446", "0.6589559", "0.6584501", "0.657764", "0.65668106", "0.6551569", "0.6545349", "0.6540208", "0.65341127", "0.6527269", "0.65213865", "0.6519018", "0.65113056", "0.6506631", "0.6505396", "0.6501402", "0.65005213", "0.64993834", "0.6494609", "0.6482994", "0.64822483", "0.6478667", "0.64778364", "0.6477473", "0.64764863", "0.6471034", "0.6468051", "0.6461029", "0.64498746", "0.6445729", "0.6441962", "0.6426262", "0.6420733", "0.6419664", "0.6400664", "0.6386999", "0.6367648", "0.6353056", "0.6351261", "0.6344321", "0.63428557", "0.63261634", "0.6324341", "0.6321514", "0.6317787", "0.6316967", "0.6316683", "0.6303569", "0.62996393", "0.62968034", "0.62919855", "0.62913424", "0.6280848", "0.62778443", "0.6270809" ]
0.78162384
0
SelectFromPostByID return one row by Id
SelectFromPostByID возвращает одну строку по Id
func SelectFromPostByID(id int) *Post { db := MysqlConnect() defer db.Close() var post Post err := db.QueryRow("SELECT * FROM post where id = ?", id).Scan(&post.ID, &post.Title, &post.Description, &post.Post, &post.Date, &post.Author, &post.Thumbnail, &post.Categories) if err != nil { panic(err.Error()) } return &post }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (store MySQL) GetPostByID(id int) (Post, error) {\n\tlog.Debug().Int(\"post_id\", id).Msg(\"GetPostByID\")\n\n\tconn := db.Connx(mysqlDbID)\n\n\trows, err := conn.Queryx(`\n SELECT\n `+postSelectSQL+`\n FROM\n `+postsTableName+`\n WHERE\n id = ?\n LIMIT 1`,\n\t\tid)\n\n\tif err != nil {\n\t\treturn Post{}, err\n\t}\n\n\tdefer rows.Close()\n\n\treturn parsePostFromRows(rows), nil\n\n}", "func (db *MysqlDB) GetPostByID(id int64) (*Post, error) {\n\trow := db.Conn.QueryRow(\n\t\t`SELECT p.id, p.Title, p.Description, p.ImageURL, p.Annotation, p.PostText,\n u.Name AS AuthorName, p.CreatedAt, p.UpdatedAt\n FROM Posts p INNER JOIN Users u ON p.Author = u.id\n WHERE p.id = ?;`,\n\t\tid)\n\n\tvar ID int64\n\tvar Title string\n\tvar Description string\n\tvar ImageURL string\n\tvar Annotation string\n\tvar Text string\n\tvar Author string\n\tvar CreatedAt time.Time\n\tvar UpdatedAt time.Time\n\n\terr := row.Scan(&ID, &Title, &Description, &ImageURL, &Annotation, &Text, &Author, &CreatedAt, &UpdatedAt)\n\tpost := &Post{ID: ID,\n\t\tTitle: template.HTML(Title),\n\t\tDescription: template.HTML(Description),\n\t\tImageURL: ImageURL,\n\t\tAnnotation: template.HTML(Annotation),\n\t\tText: template.HTML(Text),\n\t\tAuthor: Author,\n\t\tCreatedAt: CreatedAt,\n\t\tUpdatedAt: UpdatedAt}\n\n\treturn post, err\n}", "func GetPostByID(db *gorm.DB, postID int) (interface{}, string) {\n\n\tvar post []model.Post\n\tvar result []model.PostOutput\n\terr := db.Where(\"id = ?\", postID).Preload(\"Comments\").Preload(\"Likes\").Preload(\"Comments.Author\").Preload(\"Likes.Author\").Find(&post).Error\n\tif err == nil {\n\t\tuser := false\n\t\tcomment := 2\n\t\tresult = postsToPostOutput(post, user, comment)\n\t\tif len(result) > 0 {\n\t\t\treturn result[0], \"\"\n\t\t}\n\t\treturn \"\", \"Post not found\"\n\t}\n\treturn result[0], err.Error()\n}", "func (c *PostClient) Get(ctx context.Context, id int) (*Post, error) {\n\treturn c.Query().Where(post.ID(id)).Only(ctx)\n}", "func (ms *MongoStore) GetTextPostByID(id bson.ObjectId) (*TextPost, error) {\n\tresult := &TextPost{}\n\tcol := ms.session.DB(ms.dbname).C(ms.colname)\n\tif err := col.Find(bson.M{\"_id\": id}).One(&result); err != nil {\n\t\treturn nil, fmt.Errorf(\"error finding user: %v\", err)\n\t}\n\treturn result, nil\n}", "func retrieve(id int) (post Post, err error){\n\tpost = Post{}\n\terr = Db.QueryRow(\"select id, content, author from posts where id = $1\", id).Scan(&post.Id, &post.Content, &post.Author)\n\treturn\n}", "func GetPost(id int) (post Post, err error) {\n\tpost = Post{}\n\terr = Db.QueryRow(\"select * from posts where id = $1\", id).Scan(&post.ID, &post.Title, &post.Body, &post.CreatedAt)\n\treturn\n}", "func (repo *Posts) Post(id graphql.ID) *models.Post {\n\treturn repo.posts[id]\n}", "func (q postQuery) One(ctx context.Context, exec boil.ContextExecutor) (*Post, error) {\n\to := &Post{}\n\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Bind(ctx, exec, o)\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, \"orm: failed to execute a one query for posts\")\n\t}\n\n\tif err := o.doAfterSelectHooks(ctx, exec); err != nil {\n\t\treturn o, err\n\t}\n\n\treturn o, nil\n}", "func (c _StoreImpl) Post_ByUserId(UserId int) (*Post, bool) {\n\to, ok := RowCacheIndex.Get(\"Post_UserId:\" + fmt.Sprintf(\"%v\", UserId))\n\tif ok {\n\t\tif obj, ok := o.(*Post); ok {\n\t\t\treturn obj, true\n\t\t}\n\t}\n\n\trow, err := NewPost_Selector().UserId_Eq(UserId).GetRow(base.DB)\n\tif err == nil {\n\t\tRowCacheIndex.Set(\"Post_UserId:\"+fmt.Sprintf(\"%v\", row.UserId), row, 0)\n\t\treturn row, true\n\t}\n\n\tXOLogErr(err)\n\treturn nil, false\n}", "func retrieve(id int) (post Post, err error) {\n\tpost = Post{}\n\tstmt := \"SELECT id, title, body, author FROM posts WHERE id = $1\"\n\terr = Db.QueryRow(stmt, id).Scan(&post.Id, &post.Title, &post.Body, &post.Author)\n\treturn\n}", "func (*controller) GetPostByID(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\t// get the id from the url\n\tpostID := strings.Split(r.URL.Path, \"/\")[2]\n\n\t// cache: check/get data from the postID\n\tvar post *entity.Post = postCache.Get(postID)\n\tif post == nil {\n\t\tpost, err := postService.FindByID(postID)\n\t\tif err != nil {\n\t\t\t// cannot find id in db\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\tjson.NewEncoder(w).Encode(errors.ServiceError{Message: \"No posts found!\"})\n\t\t\treturn\n\t\t}\n\t\t// store value into cache. Set(key, value)\n\t\tpostCache.Set(postID, post)\n\t\tw.WriteHeader(http.StatusOK)\n\t\tjson.NewEncoder(w).Encode(post)\n\t} else {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tjson.NewEncoder(w).Encode(post)\n\t}\n}", "func (db *Database) GetPost(postID string) (models.Post, error) {\n\tpost := &models.Post{}\n\terr := db.DB.Model(post).\n\t\tWhere(\"post.post_id = ?\", postID).\n\t\tSelect()\n\tif err != nil {\n\t\treturn models.Post{}, err\n\t}\n\n\treturn *post, nil\n}", "func (d *DynamoDB)GetPost(id string) (models.Post, error){\n\tfmt.Printf(logRoot + \"Searching %v table for post with id:%v\\n\", postTable, id)\n\tfmt.Println(\"UNIMPLEMENTED\")\n\treturn models.Post{}, nil\n}", "func FindPost(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Post, error) {\n\tpostObj := &Post{}\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 \\\"posts\\\" where \\\"id\\\"=$1\", sel,\n\t)\n\n\tq := queries.Raw(query, iD)\n\n\terr := q.Bind(ctx, exec, postObj)\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, \"orm: unable to select from posts\")\n\t}\n\n\treturn postObj, nil\n}", "func (pc PostsController) getSinglePost(response http.ResponseWriter, request *http.Request, parameters httprouter.Params) {\n\tresponse.Header().Add(\"content-type\", \"application/json\")\n\tid_string := parameters.ByName(\"id\")\n\n\tid, _ := primitive.ObjectIDFromHex(id_string)\n\tvar post Posts\n\tctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\n\terr := pc.postscollection.FindOne(ctx, bson.M{\"_id\": id}).Decode(&post)\n\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(post)\n}", "func GetOnePost(w http.ResponseWriter, r *http.Request) {\n\tpostID := mux.Vars(r)[\"id\"]\n\tpID, err := primitive.ObjectIDFromHex(postID)\n\tif err != nil {\n\t\tresponse.Error(w, http.StatusUnprocessableEntity, err.Error())\n\t\treturn\n\t}\n\tres, err := GetOne(bson.M{\n\t\t\"_id\": pID,\n\t})\n\tif err != nil {\n\t\tresponse.Error(w, http.StatusUnprocessableEntity, err.Error())\n\t\treturn\n\t}\n\tresponse.Success(w, r,\n\t\thttp.StatusOK,\n\t\tres,\n\t)\n\treturn\n}", "func (post *Post) GetPostById(id ...bson.ObjectId) error {\n\tvar postId bson.ObjectId\n\tif len(id) == 0 {\n\t\tpostId = post.Id\n\t} else {\n\t\tpostId = id[0]\n\t}\n\n\terr := postSession.Clone().DB(DBName).C(\"posts\").FindId(postId).One(post)\n\treturn err\n}", "func (s *MockStore) GetPost(id int) (p Post, err error) {\n\tp, ok := s.mem[id]\n\tif !ok {\n\t\terr = errors.New(\"Could not find a post with that id.\")\n\t}\n\treturn p, err\n}", "func (bl *postBusiness) GetByID(id uint64) (*models.Post, *apperror.AppError) {\n\treturn bl.service.GetByID(id)\n}", "func (p *PostsController) GetPost(id int, userId uint) (*models.Post, *echo.HTTPError) {\n\tvar post models.Post\n\tp.db.Raw(`\n\t\tSELECT p.*,\n\t\t(SELECT \"value\" from \"likes\" \n\t\tWHERE \"user_id\" = ? and \"post_id\" = p.id) as \"StateValue\",\n\t\t(SELECT username FROM \"profiles\"\n\t\tWHERE user_id = p.user_id) as \"Creator\"\n\t\tFROM posts p\n\t\tWHERE p.id = ?\n\t`, userId, id).Find(&post)\n\n\tif post.ID == 0 {\n\t\treturn nil, echo.NewHTTPError(404, \"post does not exist\")\n\t}\n\n\treturn &post, nil\n}", "func (c BlogPostItem) Get(id int64) revel.Result {\n\tblogitem := new(models.BlogPost)\n\terr := c.Txn.SelectOne(blogitem,\n\t\t`SELECT * FROM BlogPost WHERE id = ?`, id)\n\tif err != nil {\n\t\treturn c.RenderText(\"Error. BlogPost probably doesn't exist.\")\n\t}\n\treturn c.RenderJson(blogitem)\n}", "func (pr postRepository) FindByID(id string) (*Post, error) {\n\tvar post Post\n\terr := pr.getCollection().Find(bson.M{\"_id\": bson.ObjectIdHex(id)}).One(&post)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &post, nil\n}", "func (repository Posts) SearchID(postID uint64) (models.Post, error) {\n\trow, err := repository.db.Query(\n\t\t`SELECT p.*, u.username FROM posts p\n\t\tINNER JOIN users u ON u.id = p.author_id \n\t\tWHERE p.id = ?`,\n\t\tpostID,\n\t)\n\tif err != nil {\n\t\treturn models.Post{}, err\n\t}\n\tdefer row.Close()\n\n\tvar post models.Post\n\tif row.Next() {\n\t\tif err = row.Scan(\n\t\t\t&post.ID,\n\t\t\t&post.Title,\n\t\t\t&post.Content,\n\t\t\t&post.AuthorID,\n\t\t\t&post.Likes,\n\t\t\t&post.CreatedOn,\n\t\t\t&post.AuthorUsername,\n\t\t); err != nil {\n\t\t\treturn models.Post{}, err\n\t\t}\n\t}\n\n\treturn post, nil\n}", "func GetPost(idString string, w http.ResponseWriter) {\r\n\tfmt.Println(\"inside GetPost\")\r\n\t//Connect Mongodb\r\n\tclient, err := mongo.NewClient(options.Client().ApplyURI(\"mongodb://127.0.0.1:27017\"))\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\r\n\terr = client.Connect(ctx)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer client.Disconnect(ctx)\r\n\r\n\t//Post Inside Database\r\n\tcollection := client.Database(\"inShotsDB\").Collection(\"posts\")\r\n\tid, err := primitive.ObjectIDFromHex(idString)\r\n\tfilter := bson.M{\"_id\": id}\r\n\tvar post Article\r\n\terr2 := collection.FindOne(context.TODO(), filter).Decode(&post)\r\n\tif err2 != nil {\r\n\t\tlog.Fatal(err2)\r\n\t}\r\n\tfmt.Println(\"Found Post\", post.Title)\r\n\tfmt.Fprintf(w, post.Title, post.Subtitle, post.Content)\r\n}", "func (r *repository) FindByID(ID int) (Posts, error) {\n\tvar post Posts\n\n\terr := r.db.Where(\"id = ?\", ID).Find(&post).Error\n\tif err != nil {\n\t\treturn post, err\n\t}\n\treturn post, nil\n}", "func (mgr *EntryManager) GetOne(entryID int) *Entry {\n\tdb, err := sql.Open(\"postgres\", mgr.ConnStr)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdefer db.Close()\n\n\tqueryStr := `\n\t\tSELECT title, date_posted, tags \n\t\tFROM entries \n\t\tWHERE id = $1;\n\t`\n\n\t// Create a \"prepared\" SQL statement context\n\tstmt, err := db.Prepare(queryStr)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil\n\t}\n\tdefer stmt.Close()\n\n\t// Fetch Entry record\n\tvar (\n\t\ttitle, tagsText string\n\t\tdatePosted time.Time\n\t)\n\terr = stmt.QueryRow(entryID).Scan(&title, &datePosted, &tagsText)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil\n\t}\n\n\t// Populate Entry record\n\treturn &Entry{\n\t\tID: entryID,\n\t\tTitle: title,\n\t\tDatePosted: datePosted,\n\t\tTags: strings.Split(tagsText, \",\"),\n\t}\n}", "func OnePost(postIDstr string) (Post, error) {\n\tconfig.Session.Refresh()\n\tcurrentSession := config.Session.Copy()\n\tdefer currentSession.Close()\n\n\tpost := Post{}\n\tif err := config.Posts.Find(bson.M{\"idstr\": postIDstr}).One(&post); err != nil {\n\t\treturn post, errors.Wrapf(err, \"find one post [%s]\", postIDstr)\n\t}\n\n\treturn post, nil\n}", "func getPost(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tid, err := strconv.Atoi(params[\"id\"])\n\tif err != nil {\n\t\tjson.NewEncoder(w).Encode(\"yeet\")\n\t}\n\n\tfor _, item := range posts {\n\t\tif item.ID == id {\n\t\t\tjson.NewEncoder(w).Encode(item)\n\t\t}\n\t}\n}", "func GetPostByID(id int) blog.Post {\n\tstmt, err := db.Prepare(\"SELECT post, author, title, timestamp FROM blogposts WHERE id = ?\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar btext, bauthor, btitle string\n\tvar timestamp uint64\n\n\terr = stmt.QueryRow(id).Scan(&btext, &bauthor, &btitle, &timestamp)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t} else {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\n\ttags := GetTagsByPostId(id)\n\treturn blog.Post{ID: id, Post: btext, Author: bauthor, Title: btitle, Timestamp: timestamp, Tags: tags}\n}", "func (d *PostDataStore) FindPost(id int) (p model.Post, err error) {\n\tif err = d.DBHandler.Find(&p, id).Error; err != nil {\n\t\treturn\n\t}\n\treturn\n}", "func GetPostById(c *gin.Context) {\n\tpostID, err := strconv.ParseInt(c.Param(\"id\"), 10, 0)\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tpost, err := postRepo.GetById(postID)\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, PostModel{\n\t\tId: post.ID,\n\t\tLinks: halgo.Links{}.\n\t\t\tSelf(\"/posts/%d\", post.ID).\n\t\t\tLink(\"author\", \"%s/users/%d\", userServiceAddress, post.AuthorID).\n\t\t\tLink(\"ratings\", \"%s/ratings?postId=%d\", ratingServiceAddress, post.ID),\n\t\tHeadline: post.Headline,\n\t\tContent: post.Content,\n\t})\n}", "func (c *PostImageClient) Get(ctx context.Context, id int) (*PostImage, error) {\n\treturn c.Query().Where(postimage.ID(id)).Only(ctx)\n}", "func ReadPostsById(Id int) []models.PostsModel {\n\tdb, err := driver.Connect()\n\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn nil\n\t}\n\n\tdefer db.Close()\n\n\tvar result []models.PostsModel\n\n\titems, err := db.Query(\"select title, content, category, status from posts where id=?\", Id)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn nil\n\t}\n\n\tfmt.Printf(\"%T\\n\", items)\n\n\tfor items.Next() {\n\t\tvar each = models.PostsModel{}\n\t\tvar err = items.Scan(&each.Title, &each.Content, &each.Category, &each.Status)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(err.Error())\n\t\t\treturn nil\n\t\t}\n\n\t\tresult = append(result, each)\n\n\t}\n\n\tif err = items.Err(); err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn nil\n\t}\n\n\treturn result\n}", "func (c *PostThumbnailClient) Get(ctx context.Context, id int) (*PostThumbnail, error) {\n\treturn c.Query().Where(postthumbnail.ID(id)).Only(ctx)\n}", "func selectByID(ctx context.Context, db *sqlx.DB, id int64) (*Todo, error) {\n\tvar todo Todo\n\terr := db.GetContext(ctx, &todo, selectTodoByID, id)\n\treturn &todo, err\n}", "func (driver *SQLDriver) Get(id string) (*pastes.Paste, error) {\n\t// Execute a SELECT query to retrieve the paste\n\trow := driver.database.QueryRow(\"SELECT * FROM ? WHERE id = ?\", driver.table, id)\n\terr := row.Err()\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\t// Scan the row into a paste and return it\n\tpaste := new(pastes.Paste)\n\terr = row.Scan(&paste)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn paste, nil\n}", "func (dao *Dao) SelectOne(ctx context.Context, id interface{}, opts ...options.SelectOption) (interface{}, error) {\n\tif len(dao.primaries) != 1 {\n\t\tpanic(\"SelectOne only support single primary key model: \" + dao.table)\n\t}\n\treturn dao.SelectOneByCondition(ctx,\n\t\t(&Query{}).\n\t\t\tEqual(dao.primaries[0].Name, id).\n\t\t\tLimit(1).\n\t\t\tData(),\n\t\topts...)\n}", "func (s *service) PostDetail(id string) (*model.Post, error) {\n\tpost, err := s.db.PostDetail(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn post, nil\n}", "func SinglePost(articleID int) dto.Article {\n\tlogfile, er := os.OpenFile(utils.LogFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)\n\tif er != nil {\n\t\tpanic(er.Error())\n\t}\n\tdefer logfile.Close()\n\t// Initalize DB Connection\n\tsql, sqlErr := utils.DBInit()\n\tif sqlErr != nil {\n\t\tlog.SetOutput(io.MultiWriter(logfile, os.Stdout))\n\t\tlog.SetFlags(log.Ldate | log.Ltime)\n\t\tlog.Fatal(sqlErr)\n\t}\n\t// Close DB connection at the end.\n\tdefer sql.Close()\n\t// SQL syntax\n\tsignlePost := `SELECT \n\t\t\t\t\t\tarticle_table.user_id, \n\t\t\t\t\t\tarticle_table.article_id, \n\t\t\t\t\tCOALESCE(\n\t\t\t\t\t\tCOUNT(liked_table.user_id), 0\n\t\t\t\t\t\t) AS liked_sum, \n\t\t\t\t\t\tuser_table.user_name, \n\t\t\t\t\t\tarticle_table.title, \n\t\t\t\t\t\tarticle_table.content, \n\t\t\t\t\t\tarticle_table.created_time, \n\t\t\t\t\t\tarticle_table.modified_time \n\t\t\t\t\tFROM (\n\t\t\t\t\t\t\tarticle_table \n\t\t\t\t\t\tINNER JOIN \n\t\t\t\t\t\t\tuser_table \n\t\t\t\t\t\tON \n\t\t\t\t\t\t\tarticle_table.user_id = user_table.user_id\n\t\t\t\t\t\t) LEFT JOIN \n\t\t\t\t\t\tliked_table \n\t\t\t\t\tON \n\t\t\t\t\t\tarticle_table.article_id = liked_table.article_id \n\t\t\t\t\tWHERE \n\t\t\t\t\t\tarticle_table.article_id = ? \n\t\t\t\t\tGROUP BY article_table.article_id`\n\tvar post dto.Article\n\n\terr := sql.QueryRow(signlePost, articleID).Scan(&post.UserID, &post.ArticleID, &post.LikedSum, &post.UserName, &post.Title, &post.Content, &post.CreatedTime, &post.ModifiedTime)\n\n\tif err != nil {\n\t\tlog.SetOutput(io.MultiWriter(logfile, os.Stdout))\n\t\tlog.SetFlags(log.Ldate | log.Ltime)\n\t\tlog.Fatal(err)\n\t}\n\n\treturn post\n}", "func GetPost(w http.ResponseWriter, r *http.Request, app api.AppServicer) (interface{}, error) {\n\tenv := app.(api.AppService)\n\tvars := mux.Vars(r)\n\tid, _ := strconv.Atoi(vars[\"id\"])\n\tpost := &models.Post{ID: id}\n\n\terr := post.GetPost(env.DB)\n\treturn post, err\n}", "func (r *Repository) GetPageByID(pageID int) (*page.Page, error) {\n var (\n title []byte\n body []byte\n ownerID int\n version int\n )\n psqlStmt := `\n SELECT title, body, author_id, version\n FROM pages\n WHERE id=$1`\n log.Printf(\"getting page-%v from DB...\", pageID)\n err := r.DB.QueryRow(psqlStmt, pageID).Scan(&title, &body, &ownerID,\n &version)\n if err != nil {\n log.Printf(\"failed to get page-%v from DB\", pageID)\n return nil, err\n }\n log.Println(\"successfully got page from DB\")\n\n return &page.Page{\n ID: pageID,\n Title: title,\n Body: body,\n OwnerID: ownerID,\n Version: version,\n }, nil\n}", "func (s *BlugService) GetPost(ctx context.Context, id int) (post *models.Post, err error) {\n\tdefer func(begin time.Time) {\n\t\ts.Logger.Info(\n\t\t\t\"blug\",\n\t\t\tzap.String(\"method\", \"getpost\"),\n\t\t\tzap.Int(\"id\", id),\n\t\t\tzap.NamedError(\"err\", err),\n\t\t\tzap.Duration(\"took\", time.Since(begin)),\n\t\t)\n\t}(time.Now())\n\n\tpost, err = s.DB.GetPost(id)\n\n\treturn post, err\n}", "func (c _StoreImpl) Photo_ByPostId(PostId int) (*Photo, bool) {\n\to, ok := RowCacheIndex.Get(\"Photo_PostId2:\" + fmt.Sprintf(\"%v\", PostId))\n\tif ok {\n\t\tif obj, ok := o.(*Photo); ok {\n\t\t\treturn obj, true\n\t\t}\n\t}\n\n\trow, err := NewPhoto_Selector().PostId_Eq(PostId).GetRow(base.DB)\n\tif err == nil {\n\t\tRowCacheIndex.Set(\"Photo_PostId2:\"+fmt.Sprintf(\"%v\", row.PostId), row, 0)\n\t\treturn row, true\n\t}\n\n\tXOLogErr(err)\n\treturn nil, false\n}", "func (db *DB) Select(\n\tctx *Context,\n\tid int64,\n) (\n\tni *msg.NewsItem,\n\terr error,\n) {\n\n\tconst selectNewsItem = `SELECT * FROM ` + tableName + ` WHERE id = $1`\n\n\tni = new(msg.NewsItem)\n\terr = db.DB.QueryRowContext(ctx.Ctx, selectNewsItem, id).Scan(\n\t\t&ni.ID,\n\t\t&ni.Header,\n\t\t&ni.Data,\n\t)\n\treturn\n}", "func (pc PostsController) getPostByUser(response http.ResponseWriter, request *http.Request, parameters httprouter.Params) {\n\tresponse.Header().Add(\"content-type\", \"application/json\")\n\tid_string := parameters.ByName(\"id\")\n\n\tid, _ := primitive.ObjectIDFromHex(id_string)\n\tvar postArray []Posts\n\tctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\n\tcursor, err := pc.postscollection.Find(ctx, bson.M{\"accountid\": id})\n\n\tif err != nil {\n\t\tresponse.WriteHeader(http.StatusInternalServerError)\n\t\tresponse.Write([]byte(`{\"message: \"` + err.Error() + `\"}\"`))\n\t\treturn\n\t}\n\tdefer cursor.Close(ctx)\n\n\tfor cursor.Next(ctx) {\n\t\tvar post Posts\n\t\tcursor.Decode(&post)\n\t\tpostArray = append(postArray, post)\n\t}\n\n\tif err := cursor.Err(); 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(postArray)\n}", "func (at *AnswerTypeDAO) ReadOne(id int32) {}", "func getPost(w http.ResponseWriter, r *http.Request) {\r\n\tw.Header().Set(\"Content-Type\", \"application/json\")\r\n\tparams := mux.Vars(r)\r\n\tfor _, item := range posts {\r\n\t\tif item.ID == params[\"id\"] {\r\n\r\n\t\t\tjson.NewEncoder(w).Encode(item)\r\n\t\t\tbreak\r\n\t\t}\r\n\t\treturn\r\n\t}\r\n\tjson.NewEncoder(w).Encode(&Post{})\r\n}", "func (c *UnsavedPostClient) Get(ctx context.Context, id int) (*UnsavedPost, error) {\n\treturn c.Query().Where(unsavedpost.ID(id)).Only(ctx)\n}", "func (gi *Sensor) GetByID(db *pg.DB) (Sensor, error) {\r\n\tlog.Printf(\"===>sensorItem.GetByID(SensorID=%d)\", gi.ID)\r\n\r\n\t//getErr := db.Select(gi)\r\n\tgetErr := db.Model(gi).Where(\"id = ?0\", gi.ID).Select()\r\n\tif getErr != nil {\r\n\t\tlog.Printf(\"Error while selecting item, Reason %v\\n\", getErr)\r\n\t\treturn *gi, getErr\r\n\t}\r\n\tlog.Printf(\"Select successful in sensorItem.GetById() sensor=%v\\n\", *gi)\r\n\treturn *gi, nil\r\n}", "func (u *USER_DB) GetById(id interface{}) error {\n\terr := dbmap.SelectOne(u, \"SELECT * FROM USER WHERE Idx = ?\", id)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (s service) GetPost(id uint) (*Post, error) {\n\tp, err := (*s.repo).GetPost(id)\n\tif err != nil {\n\t\treturn nil, ErrPostNotFound\n\t}\n\n\treturn p, err\n}", "func PostLikeGetByUserIDAndPostID(ctx context.Context, userID int, postID int) (*model.PostLike, error) {\n\tdb := config.ConnectGorm()\n\tsqlDB, _ := db.DB()\n\tdefer sqlDB.Close()\n\n\tvar postLike model.PostLike\n\n\tif err := db.Table(\"post_like\").Where(\"user_id = ? AND post_id = ?\", userID, postID).First(&postLike).Error; err != nil {\n\t\tfmt.Println(err)\n\t\treturn nil, err\n\t}\n\n\treturn &postLike, nil\n}", "func (p *postsQueryBuilder) Get() (*Post, error) {\n\tif p.err != nil {\n\t\treturn nil, p.err\n\t}\n\tmodel, err := p.builder.Get()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn model.(*Post), nil\n}", "func (ps *PostStorage) Read(id string) (socialnet.Post, error) {\n\tfor _, p := range ps.posts {\n\t\tif p.ID == id {\n\t\t\treturn p, nil\n\t\t}\n\t}\n\treturn socialnet.Post{}, fmt.Errorf(\n\t\t\"could not find post with ID %s\",\n\t\tid,\n\t)\n}", "func getPostHandler(res http.ResponseWriter, req *http.Request) {\n\tres.Header().Add(\"content-type\", \"application.json\")\n\tparams := mux.Vars(req)\n\tid, _ := primitive.ObjectIDFromHex(params[\"id\"])\n\tvar post MongoPostSchema\n\n\tpostsCol := client.Database(\"Aviroop_Nandy_Appointy\").Collection(\"posts\")\n\tctx, _ := context.WithTimeout(context.Background(), 15*time.Second)\n\terr := postsCol.FindOne(ctx, MongoPostSchema{ID: id}).Decode(&post)\n\n\tif err != nil {\n\t\tres.WriteHeader(http.StatusInternalServerError)\n\t\tres.Write([]byte(`{\"Error message\":\"` + err.Error() + `\"}`))\n\t\treturn\n\t}\n\tjson.NewEncoder(res).Encode(post)\n}", "func (c *PostClient) GetX(ctx context.Context, id int) *Post {\n\tobj, err := c.Get(ctx, id)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn obj\n}", "func (k Keeper) GetPost(ctx sdk.Context, id string) (post types.Post, found bool) {\n\tstore := ctx.KVStore(k.storeKey)\n\tif !store.Has(types.PostStoreKey(id)) {\n\t\treturn types.Post{}, false\n\t}\n\n\tk.cdc.MustUnmarshalBinaryBare(store.Get(types.PostStoreKey(id)), &post)\n\treturn post, true\n}", "func (c *PostAttachmentClient) Get(ctx context.Context, id int) (*PostAttachment, error) {\n\treturn c.Query().Where(postattachment.ID(id)).Only(ctx)\n}", "func GetPostFromStrId(context appengine.Context, strId string) (*Post, error) {\n\n\tvar post Post\n\tid, _ := strconv.ParseInt(strId, 10, 64)\n\tpostKey := datastore.NewKey(context, \"Post\", \"\", id, nil)\n\terr := datastore.Get(context, postKey, &post)\n\tpost.Id = id\n\treturn &post, err\n}", "func (c *_Comments) GetPost(ctx context.Context, db database.DB, model *Comment, relationFieldset ...string) (*Post, error) {\n\tif model == nil {\n\t\treturn nil, errors.Wrap(query.ErrNoModels, \"provided nil model\")\n\t}\n\t// Check if primary key has zero value.\n\tif model.IsPrimaryKeyZero() {\n\t\treturn nil, errors.Wrap(mapping.ErrFieldValue, \"model's: 'Comment' primary key value has zero value\")\n\t}\n\trelationField, err := c.Model.RelationByIndex(2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar fields []*mapping.StructField\n\trelationModel := relationField.Relationship().RelatedModelStruct()\n\tif len(relationFieldset) == 0 {\n\t\tfields = relationModel.Fields()\n\t} else {\n\t\tfor _, field := range relationFieldset {\n\t\t\tsField, ok := relationModel.FieldByName(field)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.Wrapf(mapping.ErrInvalidModelField, \"no field: '%s' found for the model: 'Post'\", field)\n\t\t\t}\n\t\t\tfields = append(fields, sField)\n\t\t}\n\t}\n\n\trelations, err := db.GetRelations(ctx, c.Model, []mapping.Model{model}, relationField, fields...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(relations) == 0 {\n\t\treturn nil, nil\n\t}\n\treturn relations[0].(*Post), nil\n}", "func (a ArticleDB) QueryOne(sess *sqlabble.Session, st stmt.Statement) (Article, error) {\n\tquery, values := sess.Builder.Build(st)\n\trows, err := sess.Query(query, values...)\n\tif err != nil {\n\t\treturn Article{}, err\n\t}\n\tms, err := a.Map(rows)\n\tif err != nil {\n\t\treturn Article{}, err\n\t}\n\tif len(ms) == 0 {\n\t\treturn Article{}, sqlabble.NewErrRecordNotFound(a.Table.Name)\n\t}\n\tif len(ms) > 1 {\n\t\treturn Article{}, sqlabble.NewErrFoundMultipleRecords(a.Table.Name)\n\t}\n\treturn ms[0], nil\n}", "func (c *Condition) SelectByID(db orm.DB) error {\n\treturn db.Select(c)\n}", "func (c _StoreImpl) Like_ByPostId(PostId int) (*Like, bool) {\n\to, ok := RowCacheIndex.Get(\"Like_PostId_2:\" + fmt.Sprintf(\"%v\", PostId))\n\tif ok {\n\t\tif obj, ok := o.(*Like); ok {\n\t\t\treturn obj, true\n\t\t}\n\t}\n\n\trow, err := NewLike_Selector().PostId_Eq(PostId).GetRow(base.DB)\n\tif err == nil {\n\t\tRowCacheIndex.Set(\"Like_PostId_2:\"+fmt.Sprintf(\"%v\", row.PostId), row, 0)\n\t\treturn row, true\n\t}\n\n\tXOLogErr(err)\n\treturn nil, false\n}", "func (p *Postgres) GetByID(id int) (*e.User, error) {\n\tdb := p.DB\n\tuser := e.User{}\n\n\terr := db.Model(&user).Where(\"id = ?\", id).Select()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &user, nil\n}", "func (c *PostVideoClient) Get(ctx context.Context, id int) (*PostVideo, error) {\n\treturn c.Query().Where(postvideo.ID(id)).Only(ctx)\n}", "func SelectAllFromPost() []Post {\n\tdb := MysqlConnect()\n\tdefer db.Close()\n\n\tresults, err := db.Query(\"SELECT * FROM post\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tvar result []Post\n\n\tfor results.Next() {\n\n\t\tvar post Post\n\n\t\terr = results.Scan(&post.ID, &post.Title, &post.Description, &post.Post,\n\t\t\t&post.Date, &post.Author, &post.Thumbnail, &post.Categories)\n\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t\tresult = append(result, post)\n\t}\n\n\treturn result\n}", "func GetByID(session *mgo.Session, collection *mgo.Collection, id interface{}, i interface{}) {\n\tsession.Refresh()\n\tcollection.FindId(id).One(i)\n}", "func GetElementByID(tablenameMain string, tablenameSub string, propKeyPrimaryMain string, propKeyUniqueSub string, id int) *sql.Row {\r\n\tvar stringQuery = \"SELECT \"\r\n\tstringQuery += \" p.Id, p.Name, p.Price, p.`Type`, c.Name \"\r\n\tstringQuery += \" FROM \"\r\n\tstringQuery += tablenameMain + \" as p \"\r\n\tstringQuery += \" LEFT JOIN \"\r\n\tstringQuery += tablenameSub + \" as c \"\r\n\tstringQuery += \" ON \"\r\n\tstringQuery += \" p.\" + propKeyPrimaryMain + \" = c.\" + propKeyUniqueSub\r\n\tstringQuery += \" WHERE \"\r\n\tstringQuery += \" p.Id = \" + strconv.Itoa(id)\r\n\tresult := ConnectDB().QueryRow(stringQuery)\r\n\tdefer ConnectDB().Close()\r\n\treturn result\r\n}", "func (c _StoreImpl) Comment_ByPostId(PostId int) (*Comment, bool) {\n\to, ok := RowCacheIndex.Get(\"Comment_PostId:\" + fmt.Sprintf(\"%v\", PostId))\n\tif ok {\n\t\tif obj, ok := o.(*Comment); ok {\n\t\t\treturn obj, true\n\t\t}\n\t}\n\n\trow, err := NewComment_Selector().PostId_Eq(PostId).GetRow(base.DB)\n\tif err == nil {\n\t\tRowCacheIndex.Set(\"Comment_PostId:\"+fmt.Sprintf(\"%v\", row.PostId), row, 0)\n\t\treturn row, true\n\t}\n\n\tXOLogErr(err)\n\treturn nil, false\n}", "func (m *ArticleDB) Get(ctx context.Context, id uuid.UUID) (*Article, error) {\n\tdefer goa.MeasureSince([]string{\"goa\", \"db\", \"article\", \"get\"}, time.Now())\n\n\tvar native Article\n\terr := m.Db.Table(m.TableName()).Where(\"id = ?\", id).Find(&native).Error\n\tif err == gorm.ErrRecordNotFound {\n\t\treturn nil, err\n\t}\n\n\treturn &native, err\n}", "func (db *Database) GetByID(id int) (*Todo, error) {\n\t// Create a new Todo.\n\ttodo := &Todo{}\n\n\t// Execute the query.\n\terr := db.db.QueryRow(stmtSelectByID, id).Scan(&todo.ID, &todo.MemberID, &todo.Created, &todo.Detail, &todo.Completed)\n\tswitch {\n\tcase err == sql.ErrNoRows:\n\t\treturn nil, ErrTodoNotFound\n\tcase err != nil:\n\t\treturn nil, err\n\t}\n\n\treturn todo, nil\n}", "func (c *PostThumbnailClient) QueryPost(pt *PostThumbnail) *PostQuery {\n\tquery := &PostQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := pt.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(postthumbnail.Table, postthumbnail.FieldID, id),\n\t\t\tsqlgraph.To(post.Table, post.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2O, true, postthumbnail.PostTable, postthumbnail.PostColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(pt.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "func GetByID(ctx *routing.Context) error {\n\tlogger := logger.GetLogInstance(\"\", \"\")\n\tdb := ctx.Get(\"db\").(*gorm.DB)\n\n\timg := []models.ImageModel{}\n\n\tif err := db.Model(&dbmodels.Image{}).Where(\"id = ?\", ctx.Param(\"id\")).Scan(&img).Error; err != nil {\n\t\tlogger.Error(err)\n\t\tctx.Response.SetStatusCode(404)\n\t\tres := models.NewResponse(false, nil, \"not found\")\n\t\treturn ctx.WriteData(res.MustMarshal())\n\t}\n\tres := models.NewResponse(true, img, \"OK\")\n\treturn ctx.WriteData(res.MustMarshal())\n}", "func GetByIDWithPosts(id string) models.Category {\n\tdb.DB.Where(\"id = ?\", id).Preload(\"Posts\").First(&category)\n\treturn category\n}", "func ById(d db.DB, id string) (*db.Entry, error) {\n\titr, err := d.Query(db.Query{IDs: []string{id}})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer itr.Close()\n\tif entry, err := itr.Next(); err == io.EOF {\n\t\treturn nil, fmt.Errorf(\"entry does not exist: %s\", id)\n\t} else {\n\t\treturn entry, err\n\t}\n}", "func (conn *Connection) GetByID(id interface{}, i interface{}) error {\n\treturn conn.collection.FindId(id).One(i)\n}", "func (c *TitleClient) Get(ctx context.Context, id int) (*Title, error) {\n\treturn c.Query().Where(title.ID(id)).Only(ctx)\n}", "func (handler *Handler) handlePostGet(w http.ResponseWriter, r *http.Request) {\n\t// We get the id in url and parse it as uint type\n\tvars := mux.Vars(r)\n\tid := vars[\"id\"]\n\ti, err := strconv.ParseUint(id, 10, 64)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\n\tdb := repository.NewPostRepository(handler.DB)\n\n\t// We try to find the post with given id\n\tpost, err := db.FindById(uint(i))\n\tif err != nil {\n\t\tif errors.Is(err, gorm.ErrRecordNotFound) {\n\t\t\tresponses.ERROR(w, http.StatusNotFound, errors.New(\"the post with id \" + id + \" could not found\"))\n\t\t} else {\n\t\t\t// If method is failed for another reason than \"record not found\"\n\t\t\t// We don't want to share that reason with user\n\t\t\t// Instead we send a generic error to the user\n\t\t\t// and print the actual error to the console\n\t\t\tresponses.ERROR(w, http.StatusInternalServerError, errors.New(\"something went wrong\"))\n\t\t\tlog.Println(err)\n\t\t}\n\t\treturn\n\t}\n\n\t// If post is not published only the author can access it.\n\tif post.IsPublished == false {\n\t\tuid, err := auth.ExtractTokenID(r)\n\t\tif err != nil {\n\t\t\t// If the requester not authenticated we pretend like post is not exist\n\t\t\t// for protection against data leak.\n\t\t\tresponses.ERROR(w, http.StatusNotFound, errors.New(\"the post with id \" + id + \" could not found\"))\n\t\t\treturn\n\t\t}\n\n\t\tif uid != post.Author.ID {\n\t\t\tresponses.ERROR(w, http.StatusNotFound, errors.New(\"the post with id \" + id + \" could not found\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\tresponses.JSON(w, http.StatusOK, post)\n}", "func GetByID(db *mongo.Client, ID string) (Record, error) {\n\tfilter := bson.D{{Key: \"id\", Value: ID}}\n\tctx, _ := context.WithTimeout(context.Background(), 3*time.Second)\n\tresult := db.Database(\"url-shortener\").Collection(\"urls\").FindOne(ctx, filter)\n\n\tvar record Record\n\tif result.Err() != nil {\n\t\treturn record, result.Err()\n\t}\n\tresult.Decode(&record)\n\treturn record, nil\n}", "func (m *ArticleDB) Get(ctx context.Context, id int) (*Article, error) {\n\tdefer goa.MeasureSince([]string{\"goa\", \"db\", \"article\", \"get\"}, time.Now())\n\n\tvar native Article\n\terr := m.Db.Table(m.TableName()).Where(\"id = ?\", id).Find(&native).Error\n\tif err == gorm.ErrRecordNotFound {\n\t\treturn nil, err\n\t}\n\n\treturn &native, err\n}", "func (c *Conn) SelectByID(query string, id interface{}, args ...interface{}) (found bool, err error) {\n\ts, err := c.Prepare(query, id)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer s.Finalize()\n\treturn s.SelectOneRow(args...)\n}", "func (p Posts) Get(i int) *Post {\n\treturn p[i]\n}", "func GetSpecific(bot reddit.Bot, ids []string) (Page, error) {\n\tparams := map[string]string{\n\t\t\"raw_json\": \"1\",\n\t\t\"limit\": \"100\",\n\t\t//\"before\": \"\",\n\t\t//\"count\": \"0\",\n\t}\n\n\tharvest, err := bot.ListingWithParams(\"/by_id/\"+strings.Join(ids, \",\"), params)\n\tif err != nil {\n\t\treturn Page{}, err\n\t}\n\tresultLEN := len(harvest.Posts)\n\tif resultLEN == 0 {\n\t\treturn Page{\n\t\t\tPostCount: resultLEN,\n\t\t}, nil\n\t}\n\tvar reports []Report\n\tfor _, v := range harvest.Posts {\n\t\tr := Report{\n\t\t\tFullID: v.Name,\n\t\t\tTitle: v.Title,\n\t\t\trawString: v.SelfText,\n\t\t\tDateTime: time.Unix(int64(v.CreatedUTC), 0),\n\t\t}\n\t\treports = append(reports, r)\n\t}\n\treturn Page{\n\t\tReports: reports,\n\t\tFirstID: harvest.Posts[0].Name,\n\t\tLastID: harvest.Posts[resultLEN-1].Name,\n\t\tPostCount: resultLEN,\n\t}, nil\n\n}", "func getDetail(ctx context.Context, db *sql.DB, id int64) (*Detail, error) {\n\tvar d Detail\n\terr := db.QueryRowContext(ctx, `\n\t\tselect detail\n\t\tfrom table\n\t\twhere id = $1\n\t`, id).Scan(wrapJSON(&d))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &d, nil\n}", "func (c *ConversationsRepo) GetByID(id string) (*models.Conversation, error) {\n conversation := models.Conversation{}\n err := c.DB.Model(&conversation).Where(\"id = ?\", id).Select()\n if err != nil {\n return nil, err\n }\n return &conversation, nil\n}", "func (m *SnippetModel) Get(id int) (*models.Snippet, error) {\n\t// Create the SQL statement to execute\n\t// Split over 2 lines for readibility\n\tstmt := `SELECT id, title, content, created, expires FROM snippets \n\tWHERE expires > UTC_TIMESTAMP() AND id =?`\n\n\t// Use the QueryRow() method on the comnnection pool to execute our\n\t// SQL statement, passing in the untrusted id variable as the value for the\n\t// placeholder parameter. This returns a pointer to a sql.Row object which\n\t// holds the result set from the database.\n\trow := m.DB.QueryRow(stmt, id)\n\n\t// Initialize a pointer to a new zeroed Snippet struct.\n\ts := &models.Snippet{}\n\n\t// Use row.Scan() to copy the values from each field in the sql.Row to the\n\t// corresponding field in the Snippet struct. Notice that the arguments\n\t// to row.Scan are *pointers* to the place we want to copy the data into,\n\t// and the number of arguments must be exactly the same as the number of\n\t// columns returned by the statement. If the query returns no rows, then\n\t// row.Scan() will return a sql.ErrNoRows error. We check for that and return\n\t// our models.ErrNoRecord error instead of a Snippet object\n\terr := row.Scan(&s.ID, &s.Title, &s.Content, &s.Created, &s.Expires)\n\tif err == sql.ErrNoRows {\n\t\treturn nil, models.ErrNoRecord\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\t// If everything went OK then return the Snippet object.\n\treturn s, nil\n\n\t// Version above is long hand.\n\t// As errors from DB.QueryRow() are deferred until Scan() is called, it can be shortened to:\n\t// --------------------------------------\n\t// s := &models.Snippet{}\n\t// err := m.DB.QueryRow(\"SELECT ...\", id).Scan(&s.ID, &s.Title, &s.Content, &s.Created, &s.Expires)\n\t// if err == sql.ErrNoRows {\n\t// return nil, models.ErrNoRecord }\n\t// else if err != nil {\n\t// return nil, err }\n\t// return s, nil\n}", "func (ug *userDbHandle) ByID(id uint) (*User, error) {\n\tvar user User\n\tdb := ug.db.Where(\"id = ?\", id)\n\terr := first(db, &user)\n\treturn &user, err\n}", "func JSONGetOne(table database.Table, w http.ResponseWriter, r *http.Request, sb *sqrl.SelectBuilder) {\n\ttable.Clear()\n\n\texSb := *sb\n\n\tvars := mux.Vars(r)\n\tfmt.Println(\"query\")\n\n\tvar val string\n\n\tif value, ok := vars[\"id\"]; ok {\n\t\tval = value\n\t} else if value, ok := vars[\"login\"]; ok {\n\t\tval = value\n\t}\n\n\ttype Item struct {\n\t\tData interface{} `json:\"data\"`\n\t}\n\n\tfmt.Println(val)\n\t//fmt.Println(table.GetPrimaryKey())\n\n\tquery, params, _ := exSb.Where(sqrl.Eq{table.GetPrimaryKey(): val}).ToSql()\n\tfmt.Println(query)\n\n\tif params != nil {\n\t\terrs := db.DB.Select(table.GetItems(), query, params[0])\n\t\tfmt.Println(errs)\n\t} else {\n\t\terrs := db.DB.Select(table.GetItems(), query)\n\t\tfmt.Println(errs)\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(Item{Data: table.GetItem()})\n}", "func (p *Personal) One(ctx context.Context, id string) (*PersonalData, error) {\n\tusr, err := p.DB.One(ctx, id)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not select one personal data\")\n\t}\n\treturn usr, nil\n}", "func (c *UnsavedPostThumbnailClient) Get(ctx context.Context, id int) (*UnsavedPostThumbnail, error) {\n\treturn c.Query().Where(unsavedpostthumbnail.ID(id)).Only(ctx)\n}", "func (d *DAL) SelectBookByID(ID string) (*Book, error) {\n\tvar book Book\n\t_, err := d.db.QueryOne(&book, `\n\t\tSELECT *\n\t\tFROM books\n\t\tWHERE id = ?0\n\t`, ID)\n\treturn &book, err\n}", "func FindSingleById(object interface{}, id int) interface{} {\n\terr := GetDB().Table(getTableName(object)).Where(\"id = ?\", id).First(object).Error\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn object\n}", "func (c *UnsavedPostImageClient) Get(ctx context.Context, id int) (*UnsavedPostImage, error) {\n\treturn c.Query().Where(unsavedpostimage.ID(id)).Only(ctx)\n}", "func get(db *sql.DB, todoID int) (*Todo, error) {\n\ttodos, err := read(db, -1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t//should be caught by a sql exception but just in case.\n\tif len(todos) == 0 {\n\t\treturn nil, fmt.Errorf(\"there is no todo for the ID sent\")\n\t}\n\treturn &todos[0], nil\n}", "func (r *sampleRepository) Get(id uuid.UUID) (*model.Sample, error) {\n\tvar sample model.Sample\n\n\terr := r.DB.Where(\"id = ?\", id).Take(&sample).Error\n\n\tif err == gorm.ErrRecordNotFound {\n\t\treturn nil, nil\n\t}\n\n\treturn &sample, err\n}", "func ById(user_id string) (user User) {\n var result interface {}\n condition := map[string] string {\n \"_id\": user_id,\n }\n collection.Find(condition).Select(nil).One(&result)\n mapstructure.Decode(result, &user)\n\n return user\n}", "func (db *ImageRepositoryPQ) fetchByID(dbI idb.DatabaseI, id int32) (string, error) {\n\tsqlStatement := `SELECT photo_title FROM Player WHERE id=$1`\n\trow := dbI.QueryRow(sqlStatement, id)\n\n\tvar filename string\n\terr := row.Scan(&filename)\n\treturn filename, err\n}", "func (r *DocumentRepository) GetByID(ctx context.Context, id string) (*document.Document, error) {\n\tquery := `\n\t\tSELECT d.id, d.source_id, d.url, HEX(d.checksum), d.charset, d.language, d.title, d.description,\n\t\td.image_url, d.image_name, d.image_width, d.image_height, d.image_format,\n\t\td.created_at, d.updated_at, d.deleted\n\t\tFROM documents AS d\n\t\tWHERE id = ?\n\t`\n\trow := r.db.QueryRowContext(ctx, formatQuery(query), id)\n\td, err := r.scan(row)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn d, nil\n}", "func getPostByIDnSchID(w http.ResponseWriter, r *http.Request) {\r\n\r\n\tw.Header().Set(\"Content-Type\", \"application/json\")\r\n\r\n\tvar msttbpegawai []Pegawai\r\n\r\n\tID := r.FormValue(\"id\")\r\n\tIDSekolah := r.FormValue(\"idSekolah\")\r\n\r\n\tsql := `SELECT\r\n\t\t\t\tID,\r\n\t\t\t\tIFNULL(IDSekolah,''),\r\n\t\t\t\tIFNULL(IDJabatan,'') IDJabatan,\r\n\t\t\t\tIFNULL(Inisial,'') Inisial,\r\n\t\t\t\tIFNULL(NIP,'') NIP,\r\n\t\t\t\tIFNULL(NIY,'') NIY,\r\n\t\t\t\tIFNULL(NUPTK,'') NUPTK,\r\n\t\t\t\tIFNULL(Nama,'') Nama ,\r\n\t\t\t\tIFNULL(JenisKelamin,'') JenisKelamin,\r\n\t\t\t\tIFNULL(Alamat,'') Alamat,\r\n\t\t\t\tIFNULL(Telp,'')Telp,\r\n\t\t\t\tIFNULL(HP,'')HP,\r\n\t\t\t\tIFNULL(ImageType,'')ImageType,\r\n\t\t\t\tIFNULL(ImageData,'')ImageData,\r\n\t\t\t\tIFNULL(TempatLahir,'')TempatLahir,\r\n\t\t\t\tIFNULL(TanggalLahir,'')TanggalLahir,\r\n\t\t\t\tIFNULL(Pendidikan,'')Pendidikan,\r\n\t\t\t\tIFNULL(StatusGuru,'')StatusGuru,\r\n\t\t\t\tIFNULL(MKTime,'')MKTime,\r\n\t\t\t\tIFNULL(UserID,'')UserID,\r\n\t\t\t\tIFNULL(Pass,'')Pass,\r\n\t\t\t\tIFNULL(Grup,'')Grup,\r\n\t\t\t\tIFNULL(Status,'')Status,\r\n\t\t\t\tIFNULL(Skin,'')Skin,\r\n\t\t\t\tIFNULL(Menu,'')Menu,\r\n\t\t\t\tIFNULL(Kost,'')Kost,\r\n\t\t\t\tIFNULL(Email,'')Email,\r\n\t\t\t\tIFNULL(StatusMengajar,'')StatusMengajar\r\n\t\t\tFROM msttbpegawai WHERE ID = ? AND IDSekolah = ?`\r\n\r\n\tresult, err := db.Query(sql, ID, IDSekolah)\r\n\r\n\tif err != nil {\r\n\t\tpanic(err.Error())\r\n\t}\r\n\r\n\tdefer result.Close()\r\n\r\n\tvar pegawai Pegawai\r\n\r\n\tfor result.Next() {\r\n\r\n\t\terr := result.Scan(&pegawai.ID, &pegawai.IDSekolah, &pegawai.IDJabatan,\r\n\t\t\t&pegawai.Inisial, &pegawai.NIP, &pegawai.NIY, &pegawai.NUPTK,\r\n\t\t\t&pegawai.Nama, &pegawai.JenisKelamin, &pegawai.Alamat, &pegawai.Telp, &pegawai.HP, &pegawai.ImageType, &pegawai.ImageData, &pegawai.TempatLahir, &pegawai.TanggalLahir, &pegawai.Pendidikan, &pegawai.StatusGuru, &pegawai.MKTime, &pegawai.UserID, &pegawai.Pass, &pegawai.Grup, &pegawai.Status, &pegawai.Skin, &pegawai.Menu, &pegawai.Kost, &pegawai.Email, &pegawai.StatusMengajar)\r\n\t\tif err != nil {\r\n\t\t\tpanic(err.Error())\r\n\t\t}\r\n\r\n\t\tmsttbpegawai = append(msttbpegawai, pegawai)\r\n\t}\r\n\r\n\tjson.NewEncoder(w).Encode(msttbpegawai)\r\n\r\n}" ]
[ "0.7332524", "0.70177686", "0.6865962", "0.6823647", "0.6802304", "0.67554516", "0.67408395", "0.6667746", "0.65764743", "0.6552099", "0.6530873", "0.6515364", "0.6512163", "0.644861", "0.6407746", "0.6329042", "0.63176656", "0.6305343", "0.6304021", "0.6272049", "0.624037", "0.62297857", "0.62261397", "0.6176182", "0.6162289", "0.61535764", "0.6128205", "0.61013925", "0.6089999", "0.60763395", "0.6033106", "0.6018791", "0.60124725", "0.58885175", "0.5887341", "0.5812088", "0.5811106", "0.57987416", "0.578377", "0.5781172", "0.57635844", "0.5726656", "0.57210135", "0.5720241", "0.5718044", "0.5686856", "0.5675333", "0.5668932", "0.566307", "0.5648711", "0.56474644", "0.563582", "0.562244", "0.5602236", "0.55985177", "0.5596938", "0.55946827", "0.5582549", "0.55562836", "0.5552036", "0.554336", "0.55374414", "0.55263275", "0.55230534", "0.55082244", "0.54939127", "0.5486696", "0.54859203", "0.5466145", "0.54648983", "0.5461902", "0.5457682", "0.54385674", "0.5437864", "0.5436365", "0.5422312", "0.5413561", "0.54121244", "0.54120916", "0.5412083", "0.5400841", "0.5400391", "0.53995997", "0.5399281", "0.5397234", "0.53846943", "0.5349782", "0.5334792", "0.533081", "0.53231376", "0.5319865", "0.53048265", "0.5304745", "0.52959204", "0.52951396", "0.52915126", "0.5285084", "0.5284024", "0.52751815", "0.52748764" ]
0.74236697
0
mustParseInt parses the given expression as an int or returns an error.
mustParseInt парсит заданное выражение как целое число или возвращает ошибку.
func mustParseInt(expr string) (uint, error) { num, err := strconv.Atoi(expr) if err != nil { return 0, fmt.Errorf("Failed to parse int from %s: %s", expr, err) } if num < 0 { return 0, fmt.Errorf("Negative number (%d) not allowed: %s", num, expr) } return uint(num), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MustParseInteger(s string) Number {\n\tif res, err := ParseInteger(s); err != nil {\n\t\tpanic(err)\n\t} else {\n\t\treturn res\n\t}\n}", "func ParseInt(operand string) (value int, err error) {\n\ti64, err := strconv.ParseInt(operand, 0, 32)\n\treturn int(i64), err\n}", "func ParseCompileEvaluateInt(exp string, vars map[string]interface{}, ctx interface{}, funcs FunctionMap, quotes []string) (map[string]interface{}, int, error) {\n\n\tvars, value, err := ParseCompileEvaluate(exp, vars, ctx, funcs, quotes)\n\tif err != nil {\n\t\treturn vars, 0, err\n\t}\n\n\tswitch value.(type) {\n\tcase int:\n\t\treturn vars, value.(int), nil\n\t}\n\n\treturn vars, 0, errors.New(\"ParseCompileEvaluateInt evaluation returns invalid type \" + fmt.Sprint(reflect.TypeOf(value)) + \"\")\n\n}", "func (p *parser) parseInteger() (int, error) {\n\ti := p.i\n\tstart := i\n\tfor i < len(p.s) && '0' <= p.s[i] && p.s[i] <= '9' {\n\t\ti++\n\t}\n\tif i == start {\n\t\treturn 0, errors.New(\"expected integer, but didn't find it\")\n\t}\n\tp.i = i\n\n\tval, err := strconv.Atoi(p.s[start:i])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn val, nil\n}", "func (p *parser) parseInteger() (int, error) {\n\ti := p.i\n\tstart := i\n\tfor i < len(p.s) && '0' <= p.s[i] && p.s[i] <= '9' {\n\t\ti++\n\t}\n\tif i == start {\n\t\treturn 0, errors.New(\"expected integer, but didn't find it\")\n\t}\n\tp.i = i\n\n\tval, err := strconv.Atoi(p.s[start:i])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn val, nil\n}", "func safeParseInt(s string, fallback int) int {\n\trslt, error := strconv.Atoi(s)\n\tif error == nil {\n\t\treturn rslt\n\t}\n\n\treturn fallback\n}", "func checkInteger(expr ast.Expr, env Env) (aexpr Expr, i int, ok bool, checkErrs []error) {\n\taexpr, checkErrs = CheckExpr(expr, env)\n\tif checkErrs != nil && !aexpr.IsConst() {\n\t\treturn aexpr, 0, false, checkErrs\n\t}\n\tt, err := expectSingleType(aexpr)\n\tif err != nil {\n\t\treturn aexpr, 0, false, append(checkErrs, err)\n\t}\n\n\tvar ii int64\n\tif ct, ok := t.(ConstType); ok {\n\t\tc, moreErrs := promoteConstToTyped(ct, constValue(aexpr.Const()), intType, aexpr)\n\t\tif moreErrs != nil {\n\t\t\tcheckErrs = append(checkErrs, moreErrs...)\n\t\t}\n\t\tv := reflect.Value(c)\n\t\tif v.IsValid() {\n\t\t\tii = v.Int()\n\t\t} else {\n\t\t\treturn aexpr, 0, false, checkErrs\n\t\t}\n\t} else {\n\t\tswitch t.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\tif aexpr.IsConst() {\n\t\t\t\tii = aexpr.Const().Int()\n\t\t\t}\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\tif aexpr.IsConst() {\n\t\t\t\tii = int64(aexpr.Const().Uint())\n\t\t\t}\n\t\tdefault:\n\t\t\treturn aexpr, 0, false, checkErrs\n\t\t}\n\t}\n\treturn aexpr, int(ii), true, checkErrs\n}", "func MustInt(c *gin.Context, key string) int {\n\tif strv := c.Query(key); strv != \"\" {\n\t\tv, e := strconv.Atoi(strv)\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\treturn v\n\t} else {\n\t\tpanic(fmt.Sprintf(\"cannot get value of param [%s]\", key))\n\t}\n}", "func mustAtoi(value string) int {\n\tresult, err := strconv.Atoi(value)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}", "func MustInt(key string) (value int) {\n\tvalue, err := Int(key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn\n}", "func (p Parser) Int(ctx context.Context) (*int, error) {\n\tvalue, err := p.Source.String(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif value == nil {\n\t\treturn nil, nil\n\t}\n\tparsed, err := strconv.Atoi(*value)\n\tif err != nil {\n\t\treturn nil, ex.New(err)\n\t}\n\treturn &parsed, nil\n}", "func (p *parser) ParseInt(v string) int {\n\n\tif p.err != nil {\n\t\treturn 0\n\t}\n\n\tvalue, err := strconv.Atoi(v)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn 0\n\t}\n\n\treturn value\n}", "func parseIntFromString(content string, aggErr *AggregateError) int {\n result, err := strconv.Atoi(content)\n if err != nil {\n aggErr.Append(err)\n }\n return result\n}", "func mustParseInt32(val string) int32 {\n\tvv, _ := strconv.ParseInt(val, 10, 32)\n\treturn int32(vv)\n}", "func requireOneInt(parse func(i int64) (Command, error)) Parser {\n\treturn requireNParams(1, func(tokens []string) (Command, error) {\n\t\ti, err := strconv.ParseInt(tokens[0], 0, 64)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Invalid parameter type: %w\", err)\n\t\t}\n\t\treturn parse(i)\n\t})\n}", "func MustInt(data interface{}, err error) int {\n\tn, err := Int(data, err)\n\tcheck(err, \"MustInt\", data)\n\treturn n\n}", "func ParseInt(text string, defaultValue int) int {\n\tif text == \"\" {\n\t\treturn defaultValue\n\t}\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\treturn defaultValue\n\t}\n\treturn num\n}", "func ParseInt(s string) (int, error) {\n\tif s = strings.TrimSpace(s); s != \"\" {\n\t\treturn strconv.Atoi(s)\n\t}\n\treturn 0, nil\n}", "func parseInteger(part expreduceapi.Ex) (value int64, isInteger bool) {\n\tinteger, isInteger := part.(*atoms.Integer)\n\tif isInteger {\n\t\treturn integer.Val.Int64(), true\n\t}\n\treturn 0, false\n}", "func parseIntegerValue(input string) (res int) {\n\tvar err error\n\n\tres, err = strconv.Atoi(input)\n\tif err != nil {\n\t\t// negative values must be dropped here\n\t\treturn\n\t}\n\treturn\n}", "func (t *numberUtils) ParseInt(s string) int {\n\tparsed, err := strconv.ParseInt(s, 0, 0)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int(parsed)\n}", "func MustParseInts(commaString string, separator string) []int {\n\tints, err := ParseInts(commaString, separator)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ints\n}", "func (c *StringConverter) MustInt() int {\n\ti, err := c.ToInt()\n\tpanicOnError(err)\n\treturn i\n}", "func ParseInt(str string) int {\n\ti, _ := strconv.Atoi(str)\n\treturn i\n}", "func verifyIntValue(values map[string]interface{}, tag string, want int) error {\n\tgot := framework.FetchInt(values, tag)\n\tif got != want {\n\t\treturn fmt.Errorf(\"%s: %d, want %d\", tag, got, want)\n\t}\n\treturn nil\n}", "func IsInt(str string) bool {\n\tif IsNull(str) {\n\t\treturn false\n\t}\n\treturn rxInt.MatchString(str)\n}", "func MustInt(i interface{}) int {\n\tv, err := ToInt(i)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\treturn v\n}", "func evalInteger(expr Expr, env Env) (int, error) {\n if expr.IsConst() {\n x := expr.Const()\n if ct, ok := expr.KnownType()[0].(ConstType); ok {\n cx, _ := promoteConstToTyped(ct, constValue(x), intType, expr)\n\t\t\treturn int(reflect.Value(cx).Int()), nil\n } else {\n\t\t\tpanic(dytc(\"const bool or string evaluated as int\"))\n }\n } else {\n xs, err := EvalExpr(expr, env);\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tx := xs[0]\n\t\tswitch x.Type().Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\treturn int(x.Int()), nil\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\treturn int(x.Uint()), nil\n\t\tdefault:\n\t\t\tpanic(dytc(\"non-integral type evaluated as int\"))\n\t\t}\n }\n}", "func MustDecodeInt(hex byte) int {\n\tresp, e := DecodeInt(hex)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn resp\n}", "func Int(r interface{}, err error) (int, error) {\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tswitch r := r.(type) {\n\tcase int:\n\t\treturn r, nil\n\tcase int64:\n\t\tx := int(r)\n\t\tif int64(x) != r {\n\t\t\treturn 0, strconv.ErrRange\n\t\t}\n\t\treturn x, nil\n\tcase []byte:\n\t\tn, err := strconv.ParseInt(string(r), 10, 0)\n\t\treturn int(n), err\n\tcase string:\n\t\tn, err := strconv.ParseInt(r, 10, 0)\n\t\treturn int(n), err\n\tcase nil:\n\t\treturn 0, simplesessions.ErrNil\n\t}\n\n\treturn 0, simplesessions.ErrAssertType\n}", "func parseInt(str string) int {\n\ti, err := strconv.Atoi(str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}", "func (p *parser) parseInt(annotations []Symbol, base intBase) Int {\n\ttext := p.next().Val\n\t// An empty slice of bytes is not a valid int, so we're going to make the assumption\n\t// that we can check the first element of the text slice.\n\treturn Int{annotations: annotations, isSet: true, base: base, isNegative: text[0] == '-', text: text}\n}", "func Int(str string) bool {\n\tif len(str) == 0 {\n\t\treturn true\n\t}\n\t_, err := strconv.Atoi(str)\n\n\treturn err == nil\n}", "func ValidInt(str string) bool {\n\tvar intRegex = regexp.MustCompile(`^[0-9]{1,8}$`)\n\treturn intRegex.MatchString(str)\n}", "func MustToInt(i interface{}) int {\n\tv, _ := ToInt(i)\n\treturn v\n}", "func lexInt(l *lexer) stateFn {\n\tdigits := \"0123456789\"\n\tl.acceptRuneRun(digits)\n\n\tr := l.peek()\n\n\tswitch r {\n\tcase ' ', '\\t', '\\n':\n\t\tl.emit(_INT)\n\t\tl.next()\n\t\treturn lexWhitespace\n\tcase '.':\n\t\tl.next()\n\t\treturn lexFloat\n\tcase ')':\n\t\tl.emit(_INT)\n\t\tl.next()\n\t\treturn lexCloseParen\n\tcase ';':\n\t\tl.emit(_INT)\n\t\tl.next()\n\t\treturn lexComment\n\t}\n\n\treturn l.errorf(\"unexpected rune in lexInt: %c\", r)\n}", "func checkInt(digits string) (int, error) {\n\tvar c int8\n\tfor _, x := range digits {\n\t\tif x < '0' || x > '9' {\n\t\t\treturn 0, ErrNonDigitSymbol\n\t\t}\n\t\tc = quasi[c+int8(x&0xF)]\n\t}\n\treturn int(c) / 10, nil\n}", "func MustFromString(s string) Int {\n\tv, err := FromString(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "func (p *numberPacker) mustUnpackInt(n packedNumber) int64 {\n\tnum := p.unpack(n)\n\tif !num.IsInteger() {\n\t\tpanic(\"not an integer\")\n\t}\n\treturn num.Int\n}", "func LooksLikeAnInteger(inputStr string) (matched bool, value int) {\n\tmatched = intRe.MatchString(inputStr)\n\tif matched {\n\t\tvalue, _ = strconv.Atoi(inputStr)\n\t\treturn true, value\n\t}\n\treturn\n}", "func parseNullableIntFromString(content string, aggErr *AggregateError) *int {\n if len(content) == 0 {\n return nil\n }\n result := parseIntFromString(content, aggErr)\n return &result\n}", "func MustAtoi(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}", "func CheckInt(id string) bool {\n\tconverted, err := strconv.ParseUint(id, 10, 64)\n\tif err == nil && converted > 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "func parseInt(content []byte, aggErr *AggregateError) int {\n result, err := strconv.Atoi(string(content))\n if err != nil {\n aggErr.Append(err)\n }\n return result\n}", "func ParseInt64OrReturnBadRequest(w http.ResponseWriter, s string) (n int64, ok bool) {\n\tvar err error\n\n\tn, err = strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\terr := fmt.Errorf(\"'%s' is not a valid int64\", s)\n\t\tWriteErrorResponse(w, http.StatusBadRequest, err.Error())\n\t\treturn n, false\n\t}\n\n\treturn n, true\n}", "func ParseInt(val interface{}) (int, error) {\n\tnumber, err := ParseFloat64(val)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(number), nil\n}", "func MustInt(input interface{}) int64 {\n\toutput, err := Int(input)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn output\n}", "func (v *verifier) Int() *verifier {\n\t_, err := strconv.Atoi(v.Query)\n\treturn v.addVerification(\"Int\", err == nil)\n}", "func asInt(param string) (int64, error) {\n\ti, err := strconv.ParseInt(param, 0, 32)\n\tif err != nil {\n\t\treturn 0, validator.ErrBadParameter\n\t}\n\treturn i, nil\n}", "func ParseInt(s String, base Int) Int {\n\tresult, _ := strconv.ParseInt(string(s), int(base), 0)\n\treturn Int(result)\n}", "func IntMust(val interface{}, def ...int) int {\n\tret, err := Int(val)\n\tif err != nil && len(def) > 0 {\n\t\treturn def[0]\n\t}\n\treturn ret\n}", "func TestToInt(t *testing.T) {\n\t// conversion from false to 0\n\tresult := evaluator.ToInt(false)\n\tassert.Equal(t, 0, result)\n\n\t// conversion from true to 1\n\tresult = evaluator.ToInt(true)\n\tassert.Equal(t, 1, result)\n}", "func (c *Config) MustInt(k string) int {\n\ti, err := c.GetInt(k)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}", "func (c *Context) MustInt(key string) int {\n\tc.MustBeSet(key)\n\treturn c.Int(key)\n}", "func IsInt(v string) bool {\n\tif _, err := strconv.ParseInt(v, 10, 64); err == nil {\n\t\treturn true\n\t}\n\treturn false\n}", "func ParseInt(c CFG.JobConfig,\n\tinstance *INST.Instance, member, message string, defaultVal int) error {\n\tstr, _ := reflections.GetField(c, member)\n\tif str == \"\" {\n\t\treflections.SetField(instance, member, defaultVal)\n\t} else if num, err := strconv.Atoi(str.(string)); err != nil {\n\t\treturn fmt.Errorf(message, c)\n\t} else {\n\t\treflections.SetField(instance, member, num)\n\t}\n\treturn nil\n}", "func (lx *exprLexerImpl) trySkipInteger(c byte) (byte, bool, bool) {\n\thasDigit := false\n\t// skip sign\n\tif c == '+' || c == '-' {\n\t\tlx.head++ // capture +-\n\t\tc = lx.nextByte()\n\t\tif lx.err != nil {\n\t\t\tgoto AllowEOF // allow single +-\n\t\t}\n\t}\n\tif c < '0' || c > '9' {\n\t\treturn c, false, false\n\t}\n\thasDigit = true\n\t// try skip integer part\n\tfor i := lx.head + 1; ; i++ {\n\t\tif i == lx.tail {\n\t\t\tif lx.readMore(); lx.err != nil {\n\t\t\t\tlx.head = i // capture the current integer part\n\t\t\t\tgoto AllowEOF // allow EOF\n\t\t\t}\n\t\t}\n\t\tc = lx.buffer[i]\n\t\tif c < '0' || c > '9' {\n\t\t\tlx.head = i\n\t\t\treturn c, hasDigit, false\n\t\t}\n\t}\nAllowEOF:\n\tif lx.err == io.EOF {\n\t\tlx.err = nil\n\t\treturn 0, hasDigit, true\n\t}\n\t// lx.err != nil\n\treturn 0, hasDigit, false\n}", "func MustStringToInt(s string) int64 {\n\tn, _ := strconv.ParseInt(s, 10, 64)\n\treturn n\n}", "func (v *verifier) IsntInt() *verifier {\n\t_, err := strconv.Atoi(v.Query)\n\treturn v.addVerification(\"Int\", err != nil)\n}", "func (sh *StatsHandler) readInt(intString string, min, max, defaultValue int) (int, error) {\n\tif intString == \"\" {\n\t\treturn defaultValue, nil\n\t}\n\tvalue, err := strconv.Atoi(intString)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tif value < min || value > max {\n\t\treturn 0, gimlet.ErrorResponse{\n\t\t\tMessage: fmt.Sprintf(\"integer value %d must be between %d and %d\", value, min, max),\n\t\t\tStatusCode: http.StatusBadRequest,\n\t\t}\n\t}\n\treturn value, nil\n}", "func lexSpecialInteger(t *Tokeniser) stateFunc {\n\t_, w := t.currentRune()\n\tt.advance(w)\n\tif w, ok := t.checkSet(\"xX\"); ok { // hex\n\t\tt.advance(w)\n\t\tw, ok = t.checkNumber(16)\n\t\tif !ok {\n\t\t\t// Only scanned \"0x\" or \"0X\"\n\t\t\tt.emitErrorf(\"illegal hexadecimal number: %q\", t.Input[t.start:t.pos])\n\t\t\treturn nil\n\t\t}\n\t\tt.advance(w)\n\t} else if w, ok = t.checkSet(\"oO\"); ok { // octal\n\t\tt.advance(w)\n\t\tw, ok = t.checkNumber(8)\n\t\tif !ok {\n\t\t\t// Only scanned \"0o\" or \"0O\"\n\t\t\tt.emitErrorf(\"illegal octal number: %q\", t.Input[t.start:t.pos])\n\t\t\treturn nil\n\t\t}\n\t\tt.advance(w)\n\t\tw, ok = t.checkNumber(10)\n\t\tif ok {\n\t\t\t// error, illegal octal int/float\n\t\t\tt.advance(w)\n\t\t\tt.emitErrorf(\"illegal octal number: %q\", t.Input[t.start:t.pos])\n\t\t\treturn nil\n\t\t}\n\t} else if w, ok = t.checkSet(\"bB\"); ok { // binary\n\t\tt.advance(w)\n\t\tw, ok = t.checkNumber(2)\n\t\tif !ok {\n\t\t\t// Only scanned \"0b\" or \"0B\"\n\t\t\tt.emitErrorf(\"illegal binary number: %q\", t.Input[t.start:t.pos])\n\t\t\treturn nil\n\t\t}\n\t\tw, ok := t.checkNumber(10)\n\t\tif ok {\n\t\t\t// error, illegal binary int\n\t\t\tt.advance(w)\n\t\t\tt.emitErrorf(\"illegal binary number: %q\", t.Input[t.start:t.pos])\n\t\t\treturn nil\n\t\t}\n\t} else { // to octal without \"o\"\n\t\tw, octalOk := t.checkNumber(8)\n\t\tif octalOk {\n\t\t\t// Found octal digits\n\t\t\tt.advance(w)\n\t\t}\n\t\tw, decimalOk := t.checkNumber(10)\n\t\tif decimalOk {\n\t\t\t// error, illegal octal int/float\n\t\t\tt.advance(w)\n\t\t\tt.emitErrorf(\"illegal octal number: %q\", t.Input[t.start:t.pos])\n\t\t\treturn nil\n\t\t}\n\t\t// If no octal and decimal digits found, then that means that\n\t\t// the number is just a zero, pass through and emit.\n\t}\n\tt.emit(INT)\n\treturn lexCode\n}", "func TestInt(tst *testing.T) {\n\n\t// Test bool\n\ti, err := StringToInt(\"80\")\n\tbrtesting.AssertEqual(tst, err, nil, \"StringToInt failed\")\n\tbrtesting.AssertEqual(tst, i, 80, \"StringToInt failed\")\n\ti, err = StringToInt(\"-80\")\n\tbrtesting.AssertEqual(tst, err, nil, \"StringToInt failed\")\n\tbrtesting.AssertEqual(tst, i, -80, \"StringToInt failed\")\n\ti, err = StringToInt(\"go-bedrock\")\n\tbrtesting.AssertNotEqual(tst, err, nil, \"StringToInt failed\")\n}", "func TestCheckBinaryExprStringGeqInt(t *testing.T) {\n\tenv := MakeSimpleEnv()\n\n\texpectCheckError(t, `\"abc\" >= 4`, env,\n\t\t`cannot convert \"abc\" to type int`,\n\t\t`invalid operation: \"abc\" >= 4 (mismatched types string and int)`,\n\t)\n\n}", "func (a ASTNode) Int() int {\n\tif a.t != tval {\n\t\tpanic(ConfErr{a.pos, errors.New(\"Not a basic value\")})\n\t}\n\tv, err := strconv.Atoi(a.val.(string))\n\tif err != nil {\n\t\tpanic(ConfErr{a.pos, err})\n\t}\n\treturn v\n}", "func (t *Typed) IntMust(key string) int {\n\ti, exists := t.IntIf(key)\n\tif exists == false {\n\t\tpanic(\"expected int value for \" + key)\n\t}\n\treturn i\n}", "func TestCheckBinaryExprStringEqlInt(t *testing.T) {\n\tenv := MakeSimpleEnv()\n\n\texpectCheckError(t, `\"abc\" == 4`, env,\n\t\t`cannot convert \"abc\" to type int`,\n\t\t`invalid operation: \"abc\" == 4 (mismatched types string and int)`,\n\t)\n\n}", "func MustParseBigInt(str string) *cells.BinaryCell {\n\tc, err := ParseBigInt(str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn c\n}", "func testIntegerLiteral(t *testing.T, expression ast.Expression, value int64) {\n\til, ok := expression.(*ast.IntegerLiteral)\n\tif !ok {\n\t\tt.Fatalf(\"Expected Expression type: IntegerLiteral, actual: %T\", expression)\n\t}\n\n\tassert.Equal(t, value, il.Value, \"Expected value\")\n\tassert.Equal(t, fmt.Sprintf(\"%d\", value), il.TokenLiteral(), \"Expected token literal\")\n}", "func (input *PuzzleInput) ParseAsInt() int {\n\tnum, err := strconv.Atoi(string(input.Data))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn num\n}", "func parseInt(b []byte, t reflect.Type) (int64, []byte, error) {\n\tvar value int64\n\tvar count int\n\n\tif len(b) == 0 {\n\t\treturn 0, b, syntaxError(b, \"cannot decode integer from an empty input\")\n\t}\n\n\tif b[0] == '-' {\n\t\tconst max = math.MinInt64\n\t\tconst lim = max / 10\n\n\t\tif len(b) == 1 {\n\t\t\treturn 0, b, syntaxError(b, \"cannot decode integer from '-'\")\n\t\t}\n\n\t\tif len(b) > 2 && b[1] == '0' && '0' <= b[2] && b[2] <= '9' {\n\t\t\treturn 0, b, syntaxError(b, \"invalid leading character '0' in integer\")\n\t\t}\n\n\t\tfor _, d := range b[1:] {\n\t\t\tif !(d >= '0' && d <= '9') {\n\t\t\t\tif count == 0 {\n\t\t\t\t\tb, err := inputError(b, t)\n\t\t\t\t\treturn 0, b, err\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif value < lim {\n\t\t\t\treturn 0, b, unmarshalOverflow(b, t)\n\t\t\t}\n\n\t\t\tvalue *= 10\n\t\t\tx := int64(d - '0')\n\n\t\t\tif value < (max + x) {\n\t\t\t\treturn 0, b, unmarshalOverflow(b, t)\n\t\t\t}\n\n\t\t\tvalue -= x\n\t\t\tcount++\n\t\t}\n\n\t\tcount++\n\t} else {\n\t\tconst max = math.MaxInt64\n\t\tconst lim = max / 10\n\n\t\tif len(b) > 1 && b[0] == '0' && '0' <= b[1] && b[1] <= '9' {\n\t\t\treturn 0, b, syntaxError(b, \"invalid leading character '0' in integer\")\n\t\t}\n\n\t\tfor _, d := range b {\n\t\t\tif !(d >= '0' && d <= '9') {\n\t\t\t\tif count == 0 {\n\t\t\t\t\tb, err := inputError(b, t)\n\t\t\t\t\treturn 0, b, err\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tx := int64(d - '0')\n\n\t\t\tif value > lim {\n\t\t\t\treturn 0, b, unmarshalOverflow(b, t)\n\t\t\t}\n\n\t\t\tif value *= 10; value > (max - x) {\n\t\t\t\treturn 0, b, unmarshalOverflow(b, t)\n\t\t\t}\n\n\t\t\tvalue += x\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count < len(b) {\n\t\tswitch b[count] {\n\t\tcase '.', 'e', 'E': // was this actually a float?\n\t\t\tv, r, err := parseNumber(b)\n\t\t\tif err != nil {\n\t\t\t\tv, r = b[:count+1], b[count+1:]\n\t\t\t}\n\t\t\treturn 0, r, unmarshalTypeError(v, t)\n\t\t}\n\t}\n\n\treturn value, b[count:], nil\n}", "func MustInteger(name, help string) *Integer {\n\treturn std.MustInteger(name, help)\n}", "func parseInt(s string) (string, int, bool) {\n\ts = strings.TrimSpace(s)\n\tindex := 0\n\tnum := 0\n\tneg := false\n\tif s[0] == '-' {\n\t\tneg = true\n\t\tindex++\n\t}\n\tfor ; s[index] >= '0' && s[index] <= '9'; index++ {\n\t\tnum *= 10\n\t\tnum += int(s[index] - '0')\n\t}\n\tif neg {\n\t\tnum *= -1\n\t}\n\t// Did s start with a number?\n\tif index == 0 || (index == 1 && neg) {\n\t\treturn s, 0, false\n\t}\n\treturn s[index:], num, true\n}", "func TestCheckBinaryExprStringGtrInt(t *testing.T) {\n\tenv := MakeSimpleEnv()\n\n\texpectCheckError(t, `\"abc\" > 4`, env,\n\t\t`cannot convert \"abc\" to type int`,\n\t\t`invalid operation: \"abc\" > 4 (mismatched types string and int)`,\n\t)\n\n}", "func parseNullableInt(content []byte, aggErr *AggregateError) *int {\n if len(content) == 0 {\n return nil\n }\n result := parseInt(content, aggErr)\n return &result\n}", "func ParseToInt(data string) (int64, error) {\n\treturn strconv.ParseInt(data, 0, 64)\n}", "func GetIntFromConstant(ctx sessionctx.Context, value Expression) (int, bool, error) {\n\ttrace_util_0.Count(_util_00000, 201)\n\tstr, isNull, err := GetStringFromConstant(ctx, value)\n\tif err != nil || isNull {\n\t\ttrace_util_0.Count(_util_00000, 204)\n\t\treturn 0, true, err\n\t}\n\ttrace_util_0.Count(_util_00000, 202)\n\tintNum, err := strconv.Atoi(str)\n\tif err != nil {\n\t\ttrace_util_0.Count(_util_00000, 205)\n\t\treturn 0, true, nil\n\t}\n\ttrace_util_0.Count(_util_00000, 203)\n\treturn intNum, false, nil\n}", "func ArgInt(s, p string) int {\n\tre := regexp.MustCompile(p)\n\tx := re.FindAllString(s, -1)\n\tnumRE := regexp.MustCompile(\"[0-9]+\")\n\tif len(x) == 0 {\n\t\treturn 0\n\t}\n\tnumbs := numRE.FindString(x[0])\n\tres, err := strconv.Atoi(numbs)\n\tif err != nil {\n\t\treturn 666\n\t}\n\treturn res\n}", "func CheckValueErrInt(value int, err error) *wrappers.StringValue {\n\treturn CheckValueErrStr(fmt.Sprint(value), err)\n}", "func (state *State) CheckInt(index int) int64 {\n\tv, ok := toInteger(state.get(index))\n\tif !ok {\n\t\tintError(state, index)\n\t}\n\treturn int64(v)\n}", "func TestCheckBinaryExprStringLssInt(t *testing.T) {\n\tenv := MakeSimpleEnv()\n\n\texpectCheckError(t, `\"abc\" < 4`, env,\n\t\t`cannot convert \"abc\" to type int`,\n\t\t`invalid operation: \"abc\" < 4 (mismatched types string and int)`,\n\t)\n\n}", "func Intval(s string) int {\n\n\tif s == \"\" {\n\t\treturn 0\n\t}\n\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn i\n}", "func getIntArg(arg flags.SplitArgument, args []string) (int, bool, error) {\n\tvar rawVal string\n\tconsumeValue := false\n\trawVal, hasVal := arg.Value()\n\tif !hasVal {\n\t\tif len(args) == 0 {\n\t\t\treturn 0, false, fmt.Errorf(\"no value specified\")\n\t\t}\n\t\trawVal = args[0]\n\t\tconsumeValue = true\n\t}\n\tval, err := strconv.Atoi(rawVal)\n\tif err != nil {\n\t\treturn val, consumeValue, fmt.Errorf(\"expected an integer value but got '%v'\", rawVal)\n\t}\n\treturn val, consumeValue, nil\n}", "func Int(a string) int {\n\tnum, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}", "func MustParseUint(s string) uint {\n\tv, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn uint(v)\n}", "func ParseInt(b []byte) (int64, error) {\n\tvar val int64\n\n\tif len(b) == 0 {\n\t\treturn 0, errorInvalidUint64(b)\n\t}\n\n\tif b[0] == '-' {\n\t\tconst max = Int64Min\n\t\tconst lim = max / 10\n\n\t\tif b = b[1:]; len(b) == 0 {\n\t\t\treturn 0, errorInvalidUint64(b)\n\t\t}\n\n\t\tfor _, d := range b {\n\t\t\tif !(d >= '0' && d <= '9') {\n\t\t\t\treturn 0, errorInvalidInt64(b)\n\t\t\t}\n\n\t\t\tif val < lim {\n\t\t\t\treturn 0, errorOverflowInt64(b)\n\t\t\t}\n\n\t\t\tval *= 10\n\t\t\tx := int64(d - '0')\n\n\t\t\tif val < (max + x) {\n\t\t\t\treturn 0, errorOverflowInt64(b)\n\t\t\t}\n\n\t\t\tval -= x\n\t\t}\n\t} else {\n\t\tconst max = Int64Max\n\t\tconst lim = max / 10\n\n\t\tfor _, d := range b {\n\t\t\tif !(d >= '0' && d <= '9') {\n\t\t\t\treturn 0, errorInvalidInt64(b)\n\t\t\t}\n\t\t\tx := int64(d - '0')\n\n\t\t\tif val > lim {\n\t\t\t\treturn 0, errorOverflowInt64(b)\n\t\t\t}\n\n\t\t\tif val *= 10; val > (max - x) {\n\t\t\t\treturn 0, errorOverflowInt64(b)\n\t\t\t}\n\n\t\t\tval += x\n\t\t}\n\t}\n\n\treturn val, nil\n}", "func ParseQueryInt(param string, request *http.Request, params imageserver.Params) error {\n\ts := request.URL.Query().Get(param)\n\tif s == \"\" {\n\t\treturn nil\n\t}\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\treturn newParseTypeParamError(param, \"string\", err)\n\t}\n\tparams.Set(param, i)\n\treturn nil\n}", "func ParseInt(s string) (int64, error) {\n\tisNegative := strings.HasPrefix(s, \"-\")\n\tif isNegative {\n\t\ts = s[1:]\n\t}\n\tsum, err := ParseUint(s)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif isNegative {\n\t\tif sum > -math.MinInt64 {\n\t\t\treturn 0, ErrOverflow\n\t\t}\n\t\treturn -int64(sum), nil\n\t}\n\tif sum > math.MaxInt64 {\n\t\treturn 0, ErrOverflow\n\t}\n\treturn int64(sum), nil\n}", "func ParseInt(buf []byte) (int, int, error) {\n\tif len(buf) < 2 || buf[0]>>4 != 0xc {\n\t\treturn 0, 0, errors.New(\"can't parse int, invalid byte buf\")\n\t}\n\n\tvar i, n int\n\n\tswitch buf[0] {\n\tcase 0xc8:\n\t\ti = int(int8(buf[1]))\n\t\tn = 2\n\tcase 0xc9:\n\t\ti = int(int16(binary.BigEndian.Uint16(buf[1:3])))\n\t\tn = 3\n\tcase 0xca:\n\t\ti = int(int32(binary.BigEndian.Uint32(buf[1:5])))\n\t\tn = 5\n\tcase 0xcb:\n\t\ti = int(int64(binary.BigEndian.Uint64(buf[1:9])))\n\t\tn = 9\n\t}\n\n\treturn i, n, nil\n}", "func (ExprValue) Int() int { return intResult }", "func ParseInt(key string, base int, bitSize int) (int64, error) {\n\tfnParseInt := \"ParseInt\"\n\n\tval := os.Getenv(key)\n\n\tif val == \"\" {\n\t\treturn 0, notFoundError(key, fnParseInt)\n\t}\n\n\tparsedVal, err := strconv.ParseInt(val, base, bitSize)\n\n\tif err != nil {\n\t\treturn 0, &EnvError{fnParseInt, key, err}\n\t}\n\n\treturn parsedVal, err\n}", "func TestCheckBinaryExprIntEqlString(t *testing.T) {\n\tenv := MakeSimpleEnv()\n\n\texpectCheckError(t, `4 == \"abc\"`, env,\n\t\t`cannot convert \"abc\" to type int`,\n\t\t`invalid operation: 4 == \"abc\" (mismatched types int and string)`,\n\t)\n\n}", "func valid(arg string) (bool, int) {\n\tif arg == PLUS || arg == MINUS || arg == DIV || arg == TIMES || arg == MOD {\n\t\treturn true, OPER\n\t} else if arg == \"(\" || arg == \")\"{\n\t\treturn true, PAREN\n\t}\n\tvar conv int\n\tconv, _ = strconv.Atoi(arg)\n\tif conv > 0 || arg == \"0\" {\n\t\treturn true, NUM\n\t}\n\treturn false, BAD\n}", "func coerceToInt(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(errors.Wrapf(err, \"invalid number %q\", s))\n\t}\n\treturn n\n}", "func (r *memcachedScraper) parseInt(key, value string) (int64, bool) {\n\ti, err := strconv.ParseInt(value, 10, 64)\n\tif err != nil {\n\t\tr.logInvalid(\"int\", key, value)\n\t\treturn 0, false\n\t}\n\treturn i, true\n}", "func (p *Parser) parseIntegerLiteral() ast.Expression {\n\tvar r = &ast.IntegerLiteral{Token: p.cur}\n\n\ti, err := strconv.ParseInt(p.cur.Lit, 0, 64)\n\tif err != nil {\n\t\tmsg := fmt.Sprintf(\"could not parse %q as an integer\", p.cur.Lit)\n\t\tp.errors = append(p.errors, msg)\n\t\treturn nil\n\t}\n\tr.Value = i\n\treturn r\n}", "func TestCheckBinaryExprIntGeqString(t *testing.T) {\n\tenv := MakeSimpleEnv()\n\n\texpectCheckError(t, `4 >= \"abc\"`, env,\n\t\t`cannot convert \"abc\" to type int`,\n\t\t`invalid operation: 4 >= \"abc\" (mismatched types int and string)`,\n\t)\n\n}", "func ValidInt(field FormField, ctx context.Context) error {\n\t_, err := field.GetInt()\n\tif err != nil {\n\t\treturn EInvalidInteger\n\t}\n\treturn nil\n}", "func ValidatePositiveInt(parameter string) (val int, err error) {\n\n\tval, err = strconv.Atoi(parameter)\n\tif err != nil {\n\t\treturn -1, errs.ErrInvalidPositiveInteger\n\t}\n\tif val < 0 {\n\t\treturn -1, errs.ErrInvalidPositiveInteger\n\t}\n\treturn val, nil\n}", "func Int(key string, def int) int {\n\tif s := String(key, \"\"); s != \"\" {\n\t\tif d, err := strconv.Atoi(s); err == nil {\n\t\t\treturn d\n\t\t} else {\n\t\t\tLog(key, err)\n\t\t}\n\t}\n\treturn def\n}", "func (v *intChain) ValidateInt(num int) bool {\n res := true\n v.Num = num\n for _, fn := range v.chains {\n res = res && fn()\n }\n\n return res\n}" ]
[ "0.69212425", "0.6258728", "0.622956", "0.6207462", "0.6207462", "0.6166046", "0.614657", "0.6103113", "0.60874563", "0.60366434", "0.6028786", "0.60140276", "0.6012161", "0.5967202", "0.5948929", "0.59394974", "0.59371984", "0.59245354", "0.5917032", "0.58945227", "0.58396083", "0.58251244", "0.5804527", "0.57712233", "0.5755436", "0.5752686", "0.5746261", "0.5734061", "0.5726085", "0.5723277", "0.5703623", "0.5686842", "0.5676733", "0.5665879", "0.56593895", "0.56578326", "0.5643036", "0.5638489", "0.563774", "0.56170154", "0.56091094", "0.56081843", "0.55830646", "0.55797684", "0.55629253", "0.55562943", "0.5546189", "0.5536019", "0.55267185", "0.5524731", "0.55134404", "0.5502346", "0.54956245", "0.5489021", "0.54869026", "0.5486353", "0.5479058", "0.5475691", "0.5460096", "0.5447452", "0.5437741", "0.54242545", "0.5418984", "0.5414742", "0.5414297", "0.5395626", "0.53837043", "0.5380786", "0.53773874", "0.53749263", "0.53652966", "0.5360289", "0.5354793", "0.53540796", "0.53539807", "0.53522426", "0.5344407", "0.533722", "0.5333103", "0.53316426", "0.5329418", "0.532828", "0.5311547", "0.53111434", "0.53053236", "0.5294992", "0.528169", "0.52639896", "0.52568054", "0.5252141", "0.5239687", "0.5235132", "0.5223319", "0.52183735", "0.5214974", "0.5211652", "0.5201114", "0.5192648", "0.51803464", "0.5171158" ]
0.7912464
0