anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
Deserialize reads a DestReply from the buffer and returns the remaining buffer.
func (f *DestReply) Deserialize(buffer []byte, err *error) []byte { if *err != nil { return nil } if len(buffer) != 4 { *err = errDeserialize return nil } return buffer }
KhanhTNG SetReceived returns the state to issued
func (cp *CustomerOrder) SetReceived() { cp.state = RECEIVED // Add some new value //cp.Owner = '' cp.ReceivedDate = time.Now() }
New create a new format marshaler/unmarshaler from name.
func New(name string) (Format, error) { if name == "" { return nil, NewErrFormatNameIsEmpty() } if synonym, ok := synonyms[name]; ok { name = synonym } switch name { case JSON: return NewJSON(), nil case YAML: return NewYAML(), nil case TOML: return NewTOML(), nil case HEX: return NewHEX(), nil ...
plateHoles2D returns 4 holes to attach the plate to the gear stack.
func plateHoles2D() (sdf.SDF2, error) { d := 17.0 h, err := sdf.Circle2D(1.2) if err != nil { return nil, err } s0 := sdf.Transform2D(h, sdf.Translate2d(v2.Vec{d, d})) s1 := sdf.Transform2D(h, sdf.Translate2d(v2.Vec{-d, -d})) s2 := sdf.Transform2D(h, sdf.Translate2d(v2.Vec{-d, d})) s3 := sdf.Transform2D(h, sd...
SetCollections sets one or more collections.
func (m *MongoDB) SetCollections(names ...string) error { if m.db == nil { return fmt.Errorf("database is not configured yet") } for _, name := range names { m.coll[name] = m.db.Collection(name) } return nil }
InsertOffset inserts a new offset associated with the given source application key sk. ak is the 'owner' application key. It returns false if the row already exists.
func (driver) InsertOffset( ctx context.Context, tx *sql.Tx, ak, sk string, n uint64, ) (_ bool, err error) { defer sqlx.Recover(&err) return sqlx.TryExecRow( ctx, tx, `INSERT INTO stream_offset SET app_key = ?, source_app_key = ?, next_offset = ? ON DUPLICATE KEY UPDATE app_key = app_key`, /...
UnmarshalYAML satisfies the yaml.Unmarshaler interface. This is done to maintain backward compatibility of accepting a plain string value for java_package_prefix.
func (e *ExternalJavaPackagePrefixConfigV1) UnmarshalYAML(unmarshal func(interface{}) error) error { return e.unmarshalWith(unmarshal) }
VisitTerminal is called when a terminal node is visited.
func (s *BaseBrainfuckListener) VisitTerminal(node antlr.TerminalNode) {}
Insert is a function for inserting a record
func (s *Stock) Insert(stockModel model.Model) *errors.Error { stockModelObj, ok := stockModel.(*model.Stock) if false == ok { return errors.Wrap(fmt.Errorf("Failed asserting to *model.Stock"), 0) } foundModel, _ := s.FindByID(stockModel.GetID()) if foundModel != nil { return errors.Wrap(fmt.Errorf("cannot ins...
GetFieldDeserializers the deserialization information for the current model
func (m *ManagementTemplateStepTenantSummary) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() res["assignedTenantsCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be145220...
Storage Policy Based Management (SPBM) profile name.
func (o FioSpecVolumeVolumeSourceVsphereVolumePtrOutput) StoragePolicyName() pulumi.StringPtrOutput { return o.ApplyT(func(v *FioSpecVolumeVolumeSourceVsphereVolume) *string { if v == nil { return nil } return v.StoragePolicyName }).(pulumi.StringPtrOutput) }
extraHeaders may be nil waitForContinue may be nil
func write(req *http.Request, w io.Writer, usingProxy bool, extraHeaders http.Header, waitForContinue func() bool) (err error) { trace := httptrace.ContextClientTrace(req.Context()) if trace != nil && trace.WroteRequest != nil { defer func() { trace.WroteRequest(httptrace.WroteRequestInfo{ Err: err, }) ...
GetTriggers indicates an expected call of GetTriggers.
func (mr *ClientMockRecorder) GetTriggers(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTriggers", reflect.TypeOf((*Client)(nil).GetTriggers), arg0, arg1) }
AbsRect makes a rectangle centered at x,y within a container
func AbsRect(cont *fyne.Container, x, y, w, h int, color color.RGBA) { fx, fy, fw, fh := float32(x), float32(y), float32(w), float32(h) r := &canvas.Rectangle{FillColor: color} r.Move(fyne.Position{X: fx - (fw / 2), Y: fy - (fh / 2)}) r.Resize(fyne.Size{Width: fw, Height: fh}) cont.AddObject(r) }
ConfigFromEndpointConfig returns identity config implementation of given endpoint config and backend
func ConfigFromEndpointConfig(endpointConfig fab.EndpointConfig, coreBackend ...core.ConfigBackend) (msp.IdentityConfig, error) { //create identity config config := &IdentityConfig{endpointConfig: endpointConfig, backend: lookup.New(coreBackend...), caMatchers: make(map[int]*regexp.Regexp)} //compile CA mat...
Running shows the state of execution
func (o Iperf3StatusPtrOutput) Running() pulumi.BoolPtrOutput { return o.ApplyT(func(v *Iperf3Status) *bool { if v == nil { return nil } return &v.Running }).(pulumi.BoolPtrOutput) }
DeleteRemoteBranch deletes the remote branch in the given given directory Faked out
func (g *GitLocal) DeleteRemoteBranch(dir string, remoteName string, branch string) error { return g.GitFake.DeleteRemoteBranch(dir, remoteName, branch) }
this schedule a task that itself produces a promise, and returns a promise wrapping the produced promise
func scheduleAndUnwrap(scheduler scheduler, do func(ctx context.Context) (dependency, error)) promise { completionSource := &completionSource{ done: make(chan struct{}), } scheduler.schedule(func(ctx context.Context) error { p, err := do(ctx) if err != nil { completionSource.err = err close(completionSou...
GetColumnProjectCard of a specific issue or PR for a specific column in a board/project This method requires the URL of the issue/pr to compare the issue with the content_url field of the card. See
func (c *client) GetColumnProjectCard(org string, columnID int, issueURL string) (*ProjectCard, error) { cards, err := c.GetColumnProjectCards(org, columnID) if err != nil { return nil, err } for _, card := range cards { if card.ContentURL == issueURL { return &card, nil } } return nil, nil }
The syntax is command:comma,separated,args
func processCommand(id int, message string, gv *GameVariables) error { var err error = nil // preallocate the update group var u UpdateGroup u.TileUpdates = make([]Tile, 0, 16) u.WeaponHits = make([]HitInfo, 0, 1) u.TargetUpdates = make([]Target, 0, 1) i := strings.Index(message, ":") if i < 0 { return error...
Validate implementation of ozzovalidation Validate interface
func (code Code) Validate() error { if _, ok := ByCodeStr(string(code)); !ok { return fmt.Errorf("'%s' is not valid ISO-4217 code", code) } return nil }
DeliveryRuleActionGenerator returns a generator of DeliveryRuleAction instances for property testing.
func DeliveryRuleActionGenerator() gopter.Gen { if deliveryRuleActionGenerator != nil { return deliveryRuleActionGenerator } generators := make(map[string]gopter.Gen) AddRelatedPropertyGeneratorsForDeliveryRuleAction(generators) // handle OneOf by choosing only one field to instantiate var gens []gopter.Gen ...
Call dynamically executes a method in the provider associated with a component resource.
func (p *googleCloudProvider) Call(_ context.Context, _ *rpc.CallRequest) (*rpc.CallResponse, error) { return nil, status.Error(codes.Unimplemented, "Call is not yet implemented") }
VolumeName is the humanreadable name of the StorageOS volume. Volume names are only unique within a namespace.
func (o IopingSpecVolumeVolumeSourceStorageosOutput) VolumeName() pulumi.StringPtrOutput { return o.ApplyT(func(v IopingSpecVolumeVolumeSourceStorageos) *string { return v.VolumeName }).(pulumi.StringPtrOutput) }
FrameworkMessage is called when the framework sends some message to the executor
func (k *KubernetesExecutor) FrameworkMessage(driver bindings.ExecutorDriver, message string) { if k.isDone() { return } if !k.isConnected() { log.Warningf("Ignore framework message because the executor is disconnected\n") return } log.Infof("Receives message from framework %v\n", message) //TODO(jdef) mas...
SetFollowerIds gets a reference to the given string and assigns it to the FollowerIds field.
func (o *InlineResponse200115) SetFollowerIds(v string) { o.FollowerIds = &v }
InternalAPI gets a URL base to send HTTP requests to.
func (c *Context) InternalAPI() *url.URL { return c.internalAPI }
Compute inputs a number in a given position
func (op *Op3) Compute(pc *Computer, input int64) (int64, bool, error) { if err := checkMemoryRange(pc, op.ArgLen); err != nil { return 0, false, err } pc.Memory[pc.Memory[pc.ptr+1]] = input pc.ptr += op.ArgLen + 1 return 0, false, nil }
OK, nothing special here
func Hash(data []byte) [blake2b.Size]byte { return blake2b.Sum512(data) }
HistoryLoad loads history from a file.
func (l *Linenoise) HistoryLoad(fname string) { info, err := os.Stat(fname) if err != nil { return } if !info.Mode().IsRegular() { log.Printf("%s is not a regular file\n", fname) return } f, err := os.Open(fname) if err != nil { log.Printf("%s error on open %s\n", fname, err) return } b := bufio.NewR...
get parameter as int
func (f *linkFrame) GetParamInt(k string) (i int64, err error) { v, ok := f.param[k] if ok { switch v.(type) { case int64: i = v.(int64) break default: err = errors.New("param value "+k+" not int") } } else { err = errors.New("params don't have "+k) } return }
Deprecated: Use GetGatewayMiningHealthRequest.ProtoReflect.Descriptor instead.
func (*GetGatewayMiningHealthRequest) Descriptor() ([]byte, []int) { return file_wallet_proto_rawDescGZIP(), []int{5} }
Json uses ReadConfig to read configuration from an inmemory JSON string.
func Json(data string) ViperBuilder { return ReadConfig("json", strings.NewReader(data)) }
ruleCheck implements a simple rule checker. It checks the rule for a key and a value. The value is returned by a get function. a rule is a string formatted with following syntax and meaning: ':' or '=' True if key has value equal to . ':' is kept for compatibility but is obsolete. '!=' True if key has a value NOT equal...
func ruleCheck(get func(string) (string, bool), rule []string) (found bool, err error) { return }
CLUBELOCATIONADDRESSEqualFold applies the EqualFold predicate on the "CLUBE_LOCATION_ADDRESS" field.
func CLUBELOCATIONADDRESSEqualFold(v string) predicate.Location { return predicate.Location(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldCLUBELOCATIONADDRESS), v)) }) }
log writes the log message
func (ui *UI) log(message string, isError bool) error { if isError { message = decorate(message, "red") } else { message = decorate(message, "green") } return ui.writeContent(LOG_PANEL, message) }
GetTestStrategy returns the used test strategy
func (a GetSLITriggeredAdapter) GetTestStrategy() string { return "" }
SetLastReportedDateTime sets the lastReportedDateTime property value. Last modified date time of an intent report
func (m *DeviceManagementIntentDeviceState) SetLastReportedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { err := m.GetBackingStore().Set("lastReportedDateTime", value) if err != nil { panic(err) } }
Mutex must be locked before calling write
func (c *cache) write(key string, val interface{}) { c.Fields[key] = val }
ByteCeilToGib Convert Byte to Gib
func ByteCeilToGib(nByte int64) int { if nByte <= 0 { return 0 } res := nByte / Gib if res*Gib < nByte { res += 1 } return int(res) }
GetProviderString will return an identifying string for itself
func (u *UnknownProvider) GetProviderString() string { return "unknown" }
NewGetDevicesAircubesIDNetworkNotFound creates a GetDevicesAircubesIDNetworkNotFound with default headers values
func NewGetDevicesAircubesIDNetworkNotFound() *GetDevicesAircubesIDNetworkNotFound { return &GetDevicesAircubesIDNetworkNotFound{} }
Remaining returns the number of unread bytes left
func (r *Reader) Remaining() int { return len(r.buf) }
regenerateKeyHandleResponse handles the RegenerateKey response.
func (client *RedisClient) regenerateKeyHandleResponse(resp *http.Response) (RedisRegenerateKeyResponse, error) { result := RedisRegenerateKeyResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RedisAccessKeys); err != nil { return RedisRegenerateKeyResponse{}, runtime.NewResponseError(err, ...
NewDiskManifestLoader creates a new manifest loader for the given paths and kind.
func NewDiskManifestLoader[T kubernetesManifest](paths ...string) DiskManifestLoader[T] { var zero T return DiskManifestLoader[T]{ paths: paths, kind: zero.Kind(), } }
getWaitTime returns the wait time to sleep for. This is the same as webapp reconnection logic.
func getWaitTime(failCount int) time.Duration { waitTime := minWebsocketReconnectDuration if failCount > maxWebsocketFails { waitTime *= time.Duration(failCount) * time.Duration(failCount) if waitTime > maxWebsocketReconnectDuration { waitTime = maxWebsocketReconnectDuration } } return waitTime }
WriteResponse to the client
func (o *PutUserSubscriptionsOwnerRepoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses rw.WriteHeader(403) }
GetAllJoinPoolAndStakeAsset returns all JoinPoolAndStakeAsset
func (k Keeper) GetAllJoinPoolAndStakeAsset(ctx sdk.Context) (list []types.JoinPoolAndStakeAsset) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.JoinPoolAndStakeAssetKey)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next...
QueryDepositAddress returns the deposit address for a specified currency
func (h *HUOBI) QueryDepositAddress(ctx context.Context, cryptocurrency currency.Code) ([]DepositAddress, error) { resp := struct { DepositAddress []DepositAddress `json:"data"` }{} vals := url.Values{} vals.Set("currency", cryptocurrency.Lower().String()) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.Re...
PodScheduling contains options to determine which node the pod should be scheduled on
func (o Iperf3SpecServerConfigurationPtrOutput) PodScheduling() Iperf3SpecServerConfigurationPodSchedulingPtrOutput { return o.ApplyT(func(v *Iperf3SpecServerConfiguration) *Iperf3SpecServerConfigurationPodScheduling { if v == nil { return nil } return v.PodScheduling }).(Iperf3SpecServerConfigurationPodSche...
expandStoredInfoTypeLargeCustomDictionarySlice expands the contents of StoredInfoTypeLargeCustomDictionary into a JSON request object.
func expandStoredInfoTypeLargeCustomDictionarySlice(c *Client, f []StoredInfoTypeLargeCustomDictionary, res *StoredInfoType) ([]map[string]interface{}, error) { if f == nil { return nil, nil } items := []map[string]interface{}{} for _, item := range f { i, err := expandStoredInfoTypeLargeCustomDictionary(c, &i...
/ V2UpdateClusterInstallConfig Override values in the install config.
func (a *Client) V2UpdateClusterInstallConfig(ctx context.Context, params *V2UpdateClusterInstallConfigParams) (*V2UpdateClusterInstallConfigCreated, error) { result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "v2UpdateClusterInstallConfig", Method: "PATCH", PathPattern:...
Helper method to count/check arguments
func (sc gloomList) countArgs() (int, error) { // Extract all "arg characters" in the list args := []int{} for _, arg := range sc.Elems { if v, ok := arg.(argument); ok { args = append(args, int(v)) } } // Early exit for no-args case if len(args) == 0 { return 0, nil } // Sort the argument numbers in...
/ The constructor returns a NewObjectValues with the an operand cast to a Function as the FunctionConstructor.
func (this *ObjectValues) Constructor() FunctionConstructor { return func(operands ...Expression) Function { return NewObjectValues(operands[0]) } }
SetObjectType sets field value
func (o *WorkflowWorkflowDefinitionAllOf) SetObjectType(v string) { o.ObjectType = v }
MultiCloser implements io.Close, it sequentially calls Close() on each object
func MultiCloser(closers ...io.Closer) io.Closer { return &multiCloser{ closers: closers, } }
Parse returns a map from statement name to parse.Tree, created by parsing the statements described in the argument string. The toplevel statement will be given the specified name. If an error occurs, parsing stops and an empty map is returned with the error.
func Parse(name, text string) (*Tree, error) { t := New(name) t.text = text return t.Parse(text) }
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeBackupDelete.
func (in *VolumeBackupDelete) DeepCopy() *VolumeBackupDelete { if in == nil { return nil } out := new(VolumeBackupDelete) in.DeepCopyInto(out) return out }
expandStoredInfoTypeLargeCustomDictionary expands an instance of StoredInfoTypeLargeCustomDictionary into a JSON request object.
func expandStoredInfoTypeLargeCustomDictionary(c *Client, f *StoredInfoTypeLargeCustomDictionary, res *StoredInfoType) (map[string]interface{}, error) { if dcl.IsEmptyValueIndirect(f) { return nil, nil } m := make(map[string]interface{}) if v, err := expandStoredInfoTypeLargeCustomDictionaryOutputPath(c, f.Outpu...
Context for current client instance
func (c *RedisClient) Context() context.Context { return c.ctx }
OrderFills is a free data retrieval call binding the contract method 0x19774d43. Solidity: function orderFills( address, bytes32) constant returns(uint256)
func (_EtherDelta *EtherDeltaSession) OrderFills(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { return _EtherDelta.Contract.OrderFills(&_EtherDelta.CallOpts, arg0, arg1) }
Put inserts a record
func (cb *cachedBatch) Put(namespace string, key, value []byte, errorFormat string, errorArgs ...interface{}) { cb.lock.Lock() defer cb.lock.Unlock() h := cb.hash(namespace, key) cb.Write(h, value) cb.batch(Put, namespace, key, value, errorFormat, errorArgs) }
This functions accepts a byte array containing a JSON
func ParseUser(jsonBuffer []byte) (models.User, error) { var user models.User // Unmarshal the json into it. this will use the struct tag err := json.Unmarshal(jsonBuffer, &user) // the array is now filled with users return user, err }
parseClientCfgFile parses config yaml file to global config varaible
func parseClientCfgFile(filePath string) (*WorkerNodeConfig, error) { dat, err := ioutil.ReadFile(filePath) if err != nil { return nil, trace.Wrap(err) } var cfg WorkerNodeConfig err = yaml.Unmarshal(dat, &cfg) if err != nil { return nil, trace.Wrap(err) } cfg.SilenceTimeout = cfg.SilenceTimeout * time.Se...
RequestHeaders extracts saved headers from context. saveHeaders middleware required for operation.
func RequestHeaders(ctx context.Context) http.Header { return ctx.Value(headersKey).(http.Header) }
Messages return the message channel for this consumer
func (c *consumerImpl) Messages() <-chan messaging.Message { return c.msgChan }
EncryptWithPrivateKey will encrypt the data using a given private key
func EncryptWithPrivateKey(privateKey *bsvec.PrivateKey, data string) (string, error) { // Encrypt using bsvec encryptedData, err := bsvec.Encrypt(privateKey.PubKey(), []byte(data)) if err != nil { return "", err } // Return the hex encoded value return hex.EncodeToString(encryptedData), nil }
Type gets the type of this polymorphic type
func (m *sdt) Type() string { return "SDT" }
GetEmailRequested returns value of EmailRequested conditional field.
func (i *Invoice) GetEmailRequested() (value bool) { if i == nil { return } return i.Flags.Has(3) }
SetCreateByUser sets the "create_by_user" field.
func (m *OrgUnitMutation) SetCreateByUser(i int) { m.create_by = &i }
MaxAllCPU selects the MAX of all metrics under 'cpu' per hour for N random hosts Queries: cpumaxall1 cpumaxall8
func (d *Devops) MaxAllCPU(qi query.Query, nHosts int) { interval := d.Interval.MustRandWindow(devops.MaxAllDuration) selectClauses := d.getSelectAggClauses("max", devops.GetAllCPUMetrics()) hosts, err := d.GetRandomHosts(nHosts) panicIfErr(err) sql := fmt.Sprintf(` SELECT hour(timestamp) AS hour, %s FR...
DataDir returns the place where saves, mods and others are located.
func (f *Factorio) DataDir() string { return f.datadir }
If true, enables [Malware Protection]( as data source for the detector. Defaults to `true`.
func (o DetectorDatasourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesPtrOutput) Enable() pulumi.BoolPtrOutput { return o.ApplyT(func(v *DetectorDatasourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumes) *bool { if v == nil { return nil } return &v.Enable }).(pulumi.BoolPtrOutput) }
Hook up gocheck into the "go test" runner.
func Test(t *testing.T) { TestingT(t) }
Deprecated: Use CreateTestRequest.ProtoReflect.Descriptor instead.
func (*CreateTestRequest) Descriptor() ([]byte, []int) { return file_yandex_cloud_loadtesting_agent_v1_test_service_proto_rawDescGZIP(), []int{1} }
The label key that the selector applies to.
func (o IopingSpecPodConfigPodSchedulingAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFieldsOutput) Key() pulumi.StringOutput { return o.ApplyT(func(v IopingSpecPodConfigPodSchedulingAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields...
/ DBConn Function which opens a new connection with db
func DBConn() (db *sql.DB) { dbDriver := "mysql" dbUser := "root" dbPass := "vrajupaj" dbName := "example" db, err := sql.Open(dbDriver, dbUser+":"+dbPass+"@/"+dbName) if err != nil { panic(err.Error()) } else { log.Println("Connection was opened correctly") } return db }
New instantiates a Service object.
func New(untypedConfig *any.Any, logger *zap.Logger, scope tally.Scope) (module.Module, error) { config := &configv1.Config{} if err := untypedConfig.UnmarshalTo(config); err != nil { return nil, err } store, ok := service.Registry[experimentstore.Name] if !ok { return nil, errors.New("could not find experime...
createPV creates a PersistentVolume.
func (ls *LocalStorage) createPV(ctx context.Context, apiObject *api.ArangoLocalStorage, clients []provisioner.API, clientsOffset int, volSize int64, claim v1.PersistentVolumeClaim, deploymentName, role string) error { log := ls.deps.Log // Try clients for clientIdx := 0; clientIdx < len(clients); clientIdx++ { cl...
Login tries to log in
func (u *UnknownProvider) Login(ctx context.Context) (string, error) { return "", errors.New("Cannot log in using unknown provider") }
updates a subset of a buffer object's data store
func NamedBufferSubData(buffer uint32, offset int, size int, data unsafe.Pointer) { C.glowNamedBufferSubData(gpNamedBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data) }
removeIfFile will inspect the uri, and if the uri is a file scheme, it will atempt to remove the specified file. This is primarily used after launching the initial containers. If they're from the local filesystem, we'll remove them to keep memory usage down on the tmpfs root.
func removeIfFile(uri string) { u, err := url.Parse(uri) if err != nil { return } if u.Scheme != "file" { return } os.Remove(u.Path) }
NewGetLolAcsV2RecentlyPlayedChampionsCurrentSummonerParamsWithContext creates a new GetLolAcsV2RecentlyPlayedChampionsCurrentSummonerParams object with the default values initialized, and the ability to set a context for a request
func NewGetLolAcsV2RecentlyPlayedChampionsCurrentSummonerParamsWithContext(ctx context.Context) *GetLolAcsV2RecentlyPlayedChampionsCurrentSummonerParams { var () return &GetLolAcsV2RecentlyPlayedChampionsCurrentSummonerParams{ Context: ctx, } }
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (m *DrugMutation) AddedField(name string) (ent.Value, bool) { return nil, false }
clearLog clears the log message.
func (ui *UI) clearLog() error { return ui.writeContent(LOG_PANEL, "") }
NewGetDeviceHealthParams creates a new GetDeviceHealthParams object with the default values initialized.
func NewGetDeviceHealthParams() *GetDeviceHealthParams { var () return &GetDeviceHealthParams{ timeout: cr.DefaultTimeout, } }
GetNamespaceCustomerManagedKey gets an existing NamespaceCustomerManagedKey resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func GetNamespaceCustomerManagedKey(ctx *pulumi.Context, name string, id pulumi.IDInput, state *NamespaceCustomerManagedKeyState, opts ...pulumi.ResourceOption) (*NamespaceCustomerManagedKey, error) { var resource NamespaceCustomerManagedKey err := ctx.ReadResource("azure:eventhub/namespaceCustomerManagedKey:Namespa...
Specify the value of a uniform variable for a specified program object
func ProgramUniform3iv(program uint32, location int32, count int32, value *int32) { C.glowProgramUniform3iv(gpProgramUniform3iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) }
handleMessage should be called for all MESSAGE messages received for this consumer.
func (c *Consumer) handleMessage(f frame.Frame) error { m := Message{ Topic: c.topic, consumerID: c.consumerID, Msg: f.BaseCmd.GetMessage(), Meta: f.Metadata, Payload: f.Payload, } select { case c.queue <- m: return nil default: // Add messageId to overflow buffer, avoiding dup...
Gets the current Vizier if there is one in kubeconfig, even if it isn't healthy. Gets the first healthy Vizier otherwise. This is intentionally different from other px commands, since debug commands may run on an unhealthy Vizier.
func getVizier(cloudAddr string) (uuid.UUID, error) { id, err := vizier.GetCurrentVizier(cloudAddr) if err != nil || id == uuid.Nil { id, err = vizier.FirstHealthyVizier(cloudAddr) } return id, err }
TimeZoneCurrentTime handles /tz Slack Slash Command
func TimeZoneCurrentTime(w http.ResponseWriter, r *http.Request) { // Verify Slack Request with Signing Secret, and Timeout check if ok := verifySlackSignature(r, []byte(slackSigningSecret)); ok == false { w.WriteHeader(http.StatusInternalServerError) log.Println("failed on VerifyRequest()") return } // Par...
FindOne User by ID.
func (ps *UserService) FindOne(loggedInUser string, id string) (user, error) { dummy, err := ps.repository.FindOne(id) if err != nil { panic(err) } return dummy, nil }
AddMetricType optionally adds a metric.type corresponding to an OpenCensus custom metric to the Filter
func (f *Filter) AddMetricType(t string) { const ( metricPath = "custom.googleapis.com/opencensus" metricType = "metric.type" ) if strings.Contains(f.String(), metricType) { glog.Fatalf("Stackdriver filters may only contain one '%s'", metricType) } f.add(fmt.Sprintf("%s=\"%s/%s\"", metricType, metricPath, t)...
Copy deep copy of this node and children
func (n Node) Copy() *Node { newNode := n if newNode.ChildNode != nil { n.ChildNode = newNode.ChildNode.Copy() } return &newNode }
NodeID returns NodeID in []byte if the type of IE matches.
func (i *IE) NodeID() ([]byte, error) { if len(i.Payload) < 1 { return nil, io.ErrUnexpectedEOF } switch i.Type { case FullyQualifiedCSID: switch (i.Payload[0] >> 4) & 0x0f { case nodeIDIPv4, nodeIDOther: if len(i.Payload) < 6 { return nil, io.ErrUnexpectedEOF } return i.Payload[1:5], nil case...
Host Caching mode: None, Read Only, Read Write.
func (o IopingSpecVolumeVolumeSourceAzureDiskOutput) CachingMode() pulumi.StringPtrOutput { return o.ApplyT(func(v IopingSpecVolumeVolumeSourceAzureDisk) *string { return v.CachingMode }).(pulumi.StringPtrOutput) }
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
func (in *KeyVaultReference_STATUS_ARM) DeepCopyInto(out *KeyVaultReference_STATUS_ARM) { *out = *in if in.Id != nil { in, out := &in.Id, &out.Id *out = new(string) **out = **in } if in.Url != nil { in, out := &in.Url, &out.Url *out = new(string) **out = **in } }
CreateStatus creates or updates the status of a commit. See
func (c *client) CreateStatus(org, repo, SHA string, s Status) error { return c.CreateStatusWithContext(context.Background(), org, repo, SHA, s) }
AddIndependentPropertyGeneratorsForDeliveryRuleRequestUriCondition_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDeliveryRuleRequestUriCondition_STATUS(gens map[string]gopter.Gen) { gens["Name"] = gen.PtrOf(gen.AlphaString()) }
copy from kubectl addResourceList adds the resources in newList to list
func addResourceList(list, new v1.ResourceList) { for name, quantity := range new { if value, ok := list[name]; !ok { list[name] = quantity.DeepCopy() } else { value.Add(quantity) list[name] = value } } }