anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
Port number to connect to at the server host
func (o PgbenchSpecPostgresOutput) Port() pulumi.IntOutput { return o.ApplyT(func(v PgbenchSpecPostgres) int { return v.Port }).(pulumi.IntOutput) }
Closed returns a channel that is closed when the multiplexer is closed (due to either internal failure or a manual call to Close).
func (m *Multiplexer) Closed() <-chan struct{} { return m.closed }
Timeout per request to WooCommerce API
func (o *Basic) Timeout() int { if 0 == o.Options.Timeout { return timeout } return o.Options.Timeout }
Structs wrapping struct: cel.EvalDetails export cel_EvalDetails_CTor
func cel_EvalDetails_CTor() CGoHandle { return CGoHandle(handleFromPtr_cel_EvalDetails(&cel.EvalDetails{})) }
SetIncludedFields adds the includedFields to the list n s groups params
func (o *ListNSGroupsParams) SetIncludedFields(includedFields *string) { o.IncludedFields = includedFields }
UnmarshalSDTSlice unmarshals polymorphic slices of SDT
func UnmarshalSDTSlice(reader io.Reader, consumer runtime.Consumer) ([]SDT, error) { var elements []json.RawMessage if err := consumer.Consume(reader, &elements); err != nil { return nil, err } var result []SDT for _, element := range elements { obj, err := unmarshalSDT(element, consumer) if err != nil { ...
String returns the string representation
func (s ListGlobalTablesInput) String() string { return awsutil.Prettify(s) }
IsURL if the given string is an url
func IsURL(url string, strict bool) bool { if strict { return urlStrictReg.MatchString(url) } return urlReg.MatchString(url) }
OldDiagnosisDate returns the old DiagnosisDate value of the Diagnosis. If the Diagnosis object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.
func (m *DiagnosisMutation) OldDiagnosisDate(ctx context.Context) (v string, err error) { if !m.op.Is(OpUpdateOne) { return v, fmt.Errorf("OldDiagnosisDate is allowed only on UpdateOne operations") } if m.id == nil || m.oldValue == nil { return v, fmt.Errorf("OldDiagnosisDate requires an ID field in the mutation...
If true, enables Kubernetes audit logs as a data source for [Kubernetes protection]( Defaults to `true`.
func (o DetectorDatasourcesKubernetesAuditLogsOutput) Enable() pulumi.BoolOutput { return o.ApplyT(func(v DetectorDatasourcesKubernetesAuditLogs) bool { return v.Enable }).(pulumi.BoolOutput) }
AccountLevelsAddr is a free data retrieval call binding the contract method 0xf3412942. Solidity: function accountLevelsAddr() constant returns(address)
func (_EtherDelta *EtherDeltaSession) AccountLevelsAddr() (common.Address, error) { return _EtherDelta.Contract.AccountLevelsAddr(&_EtherDelta.CallOpts) }
ignore secret and id since those are set by the server
func assertEqualWebhook(t *testing.T, a, b *linkedca.Webhook) { assert.Equal(t, a.Name, b.Name) assert.Equal(t, a.Url, b.Url) assert.Equal(t, a.Kind, b.Kind) assert.Equal(t, a.CertType, b.CertType) assert.Equal(t, a.DisableTlsClientAuth, b.DisableTlsClientAuth) assert.Equal(t, a.GetAuth(), b.GetAuth()) }
SetSuggestedTipAmounts sets value of SuggestedTipAmounts conditional field.
func (i *Invoice) SetSuggestedTipAmounts(value []int64) { i.Flags.Set(8) i.SuggestedTipAmounts = value }
AddIndependentPropertyGeneratorsForDeepCreatedOriginGroup is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDeepCreatedOriginGroup(gens map[string]gopter.Gen) { gens["Name"] = gen.PtrOf(gen.AlphaString()) gens["TrafficRestorationTimeToHealedOrNewEndpointsInMinutes"] = gen.PtrOf(gen.Int()) }
HasName returns a boolean if a field has been set.
func (o *ResourceProperties) HasName() bool { if o != nil && o.Name != nil { return true } return false }
Equal returns true if both Connection Information have the same existing type and the values corresponding to this type are identical.
func (c ConnInfo) Equal(conn ConnInfo) bool { if c.Type == conn.Type { switch c.Type { case TCP: return c.TCPAddr.IP.Equal(conn.TCPAddr.IP) && c.TCPAddr.Port == conn.TCPAddr.Port && c.TCPAddr.Zone == conn.TCPAddr.Zone default: log.Warn("Not supported network address type") } } return false }
/ AmsiApiService MEC011 Application Termination notification for self termination Terminates itself.
func (a *AmsiApiService) Mec011AppTerminationPOST(ctx context.Context, body AppTerminationNotification) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte ) // create path and map variables localVar...
backup steps back one rune. Can only be called once per call of next.
func (l *lexer) backup() { l.pos -= l.width }
FromJsonString It is highly NOT recommended to use this function because it has no param check, nor strict type check
func (r *DescribeCustomerInfoResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) }
Handler creates http.Handler with routing matching OpenAPI spec.
func Handler(si ServerInterface) http.Handler { return HandlerFromMux(si, chi.NewRouter()) }
RunJSONSerializationTestForDeliveryRule_STATUS runs a test to see if a specific instance of DeliveryRule_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForDeliveryRule_STATUS(subject DeliveryRule_STATUS) string { // Serialize to JSON bin, err := json.Marshal(subject) if err != nil { return err.Error() } // Deserialize back into memory var actual DeliveryRule_STATUS err = json.Unmarshal(bin, &actual) if err != nil { return err....
SetBackingStore sets the backingStore property value. Stores model information.
func (m *GovernancePolicy) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() { m.backingStore = value }
The providerassigned unique ID for this managed resource.
func (o GetGroupResultOutput) Id() pulumi.StringOutput { return o.ApplyT(func(v GetGroupResult) string { return v.Id }).(pulumi.StringOutput) }
NewParser create a new parser instance.
func NewParser(dir string) *Parser { return &Parser{ dir: dir, } }
The host address of the ScaleIO API Gateway.
func (o FioSpecVolumeVolumeSourceScaleIOPtrOutput) Gateway() pulumi.StringPtrOutput { return o.ApplyT(func(v *FioSpecVolumeVolumeSourceScaleIO) *string { if v == nil { return nil } return &v.Gateway }).(pulumi.StringPtrOutput) }
indicate modifications to a range of a mapped buffer
func FlushMappedBufferRange(target uint32, offset int, length int) { C.glowFlushMappedBufferRange(gpFlushMappedBufferRange, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(length)) }
inputs should only contain one element, which is a JSON in string format.
func simpleEC(this js.Value, inputs []js.Value) interface{} { var suite = suites.MustFind("Ed25519") var args map[string]interface{} json.Unmarshal([]byte(inputs[0].String()), &args) scalar := suite.Scalar() scalarB, _ := base64.StdEncoding.DecodeString(args["scalar"].(string)) scalar.UnmarshalBinary(scalarB) va...
Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
func (o IopingSpecVolumeVolumeSourceAzureDiskPtrOutput) Kind() pulumi.StringPtrOutput { return o.ApplyT(func(v *IopingSpecVolumeVolumeSourceAzureDisk) *string { if v == nil { return nil } return v.Kind }).(pulumi.StringPtrOutput) }
GetName returns the device name / model.
func (d *cudaDevice) GetName() (string, error) { name, r := cuda.Device(*d).GetName() if r != cuda.SUCCESS { return "", fmt.Errorf("failed to get device name: %v", r) } return name, nil }
WithHTTPClient adds the HTTPClient to the list n s groups params
func (o *ListNSGroupsParams) WithHTTPClient(client *http.Client) *ListNSGroupsParams { o.SetHTTPClient(client) return o }
HasVmId returns a boolean if a field has been set.
func (o *CreateRouteRequest) HasVmId() bool { if o != nil && o.VmId != nil { return true } return false }
Two's complement abs for ints to avoid conversion. Courtesy of
func abs(n int) int { y := n >> 31 return (n ^ y) - y }
InspectSubnet returns information about the Subnet from AWS
func (s stack) InspectSubnet(id string) (_ *abstract.Subnet, xerr fail.Error) { nullAS := abstract.NewSubnet() if s.IsNull() { return nil, fail.InvalidInstanceError() } if id == "" { return nullAS, fail.InvalidParameterError("id", "cannot be empty string") } defer debug.NewTracer(nil, tracing.ShouldTrace("st...
Retain filters inplace slice of HelpAppUpdateClass.
func (s HelpAppUpdateClassArray) Retain(keep func(x HelpAppUpdateClass) bool) HelpAppUpdateClassArray { n := 0 for _, x := range s { if keep(x) { s[n] = x n++ } } s = s[:n] return s }
disconnect old addresses and close all
func CloseClients(clients []Client) { for _, client := range clients { if nil != client { _ = client.Close() } } }
ChannelProvider mocks base method
func (m *MockClient) ChannelProvider() fab.ChannelProvider { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ChannelProvider") ret0, _ := ret[0].(fab.ChannelProvider) return ret0 }
WithOffsetConsumerOption lets you set the kafka offset to read from
func WithOffsetConsumerOption(offset int64) ConsumerOption { return func(c *Consumer) { switch offset { case LastOffset: c.config.StartOffset = LastOffset case FirstOffset: c.config.StartOffset = FirstOffset default: c.config.StartOffset = FirstOffset } } }
DeliveryRuleServerPortCondition_STATUSGenerator returns a generator of DeliveryRuleServerPortCondition_STATUS instances for property testing. We first initialize deliveryRuleServerPortCondition_STATUSGenerator with a simplified generator based on the fields with primitive types then replacing it with a more complex one...
func DeliveryRuleServerPortCondition_STATUSGenerator() gopter.Gen { if deliveryRuleServerPortCondition_STATUSGenerator != nil { return deliveryRuleServerPortCondition_STATUSGenerator } generators := make(map[string]gopter.Gen) AddIndependentPropertyGeneratorsForDeliveryRuleServerPortCondition_STATUS(generators) ...
HasSubdivisionCode returns a boolean if a field has been set.
func (o *Workloadv1Location) HasSubdivisionCode() bool { if o != nil && o.SubdivisionCode != nil { return true } return false }
SetContext adds the context to the public remove trusted device v4 params
func (o *PublicRemoveTrustedDeviceV4Params) SetContext(ctx context.Context) { o.Context = ctx }
NewOutgoingPacket Creates a new packet instance intended for sending formatted data to the client.
func NewOutgoingPacket(opcode byte) *Packet { return &Packet{opcode, []byte{opcode}, false, 0, 0, 0} }
AMPBoilerplate removes and tags in , keeping only the ampcustom style tag. It then inserts the ampboilerplate.
func AMPBoilerplate(e *Context) error { // Remove <style> and <noscript> tags keeping only the amp-runtime and // amp-custom style tag. amp-runtime may be removed later by the // AMPRuntimeCSS transformer. for n := e.DOM.HeadNode; n != nil && n.DataAtom != atom.Body; n = htmlnode.Next(n) { sw...
Read returns gets a snapshot of all current stats
func (s *Stats) Read(ctx context.Context, req *stats.ReadRequest, rsp *stats.ReadResponse) error { if req.Service == nil { s.RLock() rsp.Stats = s.snapshots s.RUnlock() return nil } filter := func(a, b string) bool { if len(b) == 0 { return true } return a == b } s.RLock() for _, s := range s.s...
Update updates views along with given todos.
func (app *Application) Update(todos []todo.Todo) { app.table.Update(todos) }
DeleteIssueAttachment deletes an issue attachment
func (c *Client) DeleteIssueAttachment(issueIDOrKey string, attachmentID int) (*Attachment, error) { return c.DeleteIssueAttachmentContext(context.Background(), issueIDOrKey, attachmentID) }
BoolDefault returns the user's value as bool. a string which is "1" or "t" or "T" or "TRUE" or "true" or "True" or "0" or "f" or "F" or "FALSE" or "false" or "False". Any other value returns an error. If not found returns "def" and a nonnil error.
func (e Entry) BoolDefault(def bool) (bool, error) { v := e.ValueRaw if v == nil { return def, errFindParse.Format("bool", e.Key) } if vBoolean, ok := v.(bool); ok { return vBoolean, nil } if vString, ok := v.(string); ok { b, err := strconv.ParseBool(vString) if err != nil { return def, err } re...
HOST1 ID: Qma91H212PWtAFcioW7h9eKiosJtwHsb9x3RmjqRWTwciZ HOST2 ID: QmbazrBU4HthhnQWcUTiJLnj5ihbFHXsAkGAG6QfmrqJDs
func TestInit(t *testing.T) { os.RemoveAll(dataDir) defer os.RemoveAll(dataDir) protocol.ClearEventHandler() var err error q := queue.New("test") msgCh := initMockBlockchain(q) p1, p2 := initEnv(t, q) _ = p1 client := q.Client() //client用来模拟blockchain模块向p2p模块发消息,host1接收topic为p2pA的消息,host2接收topic为p2pB的消息 //向h...
SimpleRemoveDuplicates Removes Duplicates from the array
func SimpleRemoveDuplicates(arr []int) []int { //.. pocket := make([]int, 0) pocket = append(pocket, arr...) for index, num := range pocket { if contains(pocket, num) == true { fmt.Println("pocket: ", pocket) fmt.Println("pocket[index]: ", pocket[index:]) pocket = pocket[index:] } } // for _, item ...
dataSourceMetadataToHypercat converts a DataSourceMetadata instance to json for registering a data source
func (csc *CoreStoreClient) dataSourceMetadataToHypercat(metadata DataSourceMetadata, endPoint string) ([]byte, error) { if metadata.Description == "" || metadata.ContentType == "" || metadata.Vendor == "" || metadata.DataSourceType == "" || metadata.DataSourceID == "" || metadata.StoreType == "" { retur...
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
func (in *DnsDomainStatus) DeepCopyInto(out *DnsDomainStatus) { *out = *in if in.InstanceStatuses != nil { in, out := &in.InstanceStatuses, &out.InstanceStatuses *out = make(map[string]InstanceStatus, len(*in)) for key, val := range *in { (*out)[key] = val } } return }
The scheduler will prefer to schedule pods to nodes that satisfy the antiaffinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling r...
func (o DrillSpecPodConfigPodSchedulingAffinityPodAntiAffinityPtrOutput) PreferredDuringSchedulingIgnoredDuringExecution() DrillSpecPodConfigPodSchedulingAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionArrayOutput { return o.ApplyT(func(v *DrillSpecPodConfigPodSchedulingAffinityPodAntiAffinity) [...
DrawSnakeRect draws the snake shape using rectangles
func DrawSnakeRect(win *pixelgl.Window, imd *imdraw.IMDraw, gameCFG *game.Config, s *snake.Type) { imd.Clear() imd.Color = colornames.Purple positions := []pixel.Vec{s.GetHeadPos()} positions = append(positions, s.GetPositionPoints()...) positions = append(positions, s.GetTailPos()) for _, pos := range positions ...
Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. Solidity: function deposit() returns()
func (_EtherDelta *EtherDeltaTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { return _EtherDelta.contract.Transact(opts, "deposit") }
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (m *JobHistoryMutation) ID() (id int, exists bool) { if m.id == nil { return } return *m.id, true }
Helper function that returns the NumericDate time value used by the spec
func EpochNow() int64 { return time.Now().UTC().Unix() }
TaskName returns the name of the shell task.
func (s *ShellTask) TaskName() string { return s.name }
BoolX is like Bool, but panics if an error occurs.
func (ougb *OrgUnitGroupBy) BoolX(ctx context.Context) bool { v, err := ougb.Bool(ctx) if err != nil { panic(err) } return v }
define an array of vertex data
func VertexPointer(size int32, xtype uint32, stride int32, pointer unsafe.Pointer) { C.glowVertexPointer(gpVertexPointer, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer) }
CLUBELOCATIONADDRESSGT applies the GT predicate on the "CLUBE_LOCATION_ADDRESS" field.
func CLUBELOCATIONADDRESSGT(v string) predicate.Location { return predicate.Location(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldCLUBELOCATIONADDRESS), v)) }) }
SetHTTPClient adds the HTTPClient to the serve build types in project params
func (o *ServeBuildTypesInProjectParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client }
C returns the streaming data channel.
func (e *binaryExprEvaluator) C() <-chan map[string]interface{} { return e.c }
BeforeUnmarshalYAML implement yaml Initiator
func (t *FileType) BeforeUnmarshalYAML() (err error) { t.MaxLength = 2147483647 return }
NewRouter returns new instance of Router type
func NewRouter(interval string, agent *map[string]string, csvFile string) *cron.Cron { lr := new(regression.Regression) lr.SetObserved("Get throughput") lr.SetVar(0, "CPU usage") lr.SetVar(1, "Memory usage") timeConfig := "@every " + interval // It works on this format - http://golang.org/pkg/time/#ParseDuration ...
tokenize converts expression context to tokens
func (e *Exp) tokenize() []string { siz := len(e.context) tokens := make([]string, 0, 1) for i := 0; i < siz; i++ { ch := e.context[i] switch { case e.isSpace(ch): continue case ch == '(': tokens = append(tokens, "(") case ch == ')': tokens = append(tokens, ")") default: isOperator, op := e....
GetTicket mocks base method.
func (m *Client) GetTicket(arg0 context.Context, arg1 int64) (zendesk.Ticket, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTicket", arg0, arg1) ret0, _ := ret[0].(zendesk.Ticket) ret1, _ := ret[1].(error) return ret0, ret1 }
Deprecated: Use Trigger_OperationTrigger.ProtoReflect.Descriptor instead.
func (*Trigger_OperationTrigger) Descriptor() ([]byte, []int) { return file_chain_proto_rawDescGZIP(), []int{19, 0} }
matchExpressions is a list of label selector requirements. The requirements are ANDed.
func (o IopingSpecPodConfigPodSchedulingAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorOutput) MatchExpressions() IopingSpecPodConfigPodSchedulingAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressionsArrayOutput { re...
Pins returns all available AnalogPins
func (f *Firmata) SnapshotAnalogPins() (pins []*Pin, err error) { err = f.WaitLoop(func() error { pins = ClonePins_l(f.AnalogPins) return nil }) return }
Deprecated: Use GetWithdrawalRequest.ProtoReflect.Descriptor instead.
func (*GetWithdrawalRequest) Descriptor() ([]byte, []int) { return file_services_temporal_service_proto_rawDescGZIP(), []int{1} }
invalidate the content of a buffer object's data store
func InvalidateBufferData(buffer uint32) { C.glowInvalidateBufferData(gpInvalidateBufferData, (C.GLuint)(buffer)) }
UninstallOperator uninstalls the RHMI operator by deleting the CSV. If the subscription is not found, it doesn't do anything, as the operator might not be run through OLM
func UninstallOperator(ctx context.Context, client k8sclient.Client, installation *integreatlyv1alpha1.RHMI) error { // Get the operator subscription subscription, err := GetSubscription(ctx, client, installation) if err != nil { return err } // If the subscription is not found, finish: the operator might have ...
Expect uses reflect.DeepEqual to evaluate the equality of two values unless the objects both satisfy the Equaler interface
func Expect(t *testing.T, v, m interface{}) { vt, vok := v.(Equaler) mt, mok := m.(Equaler) var state bool if vok && mok { state = vt.Equal(mt) } else { state = reflect.DeepEqual(v, m) } if state { flux.FatalFailed(t, "Value %+v and %+v are not a match", v, m) return } flux.LogPassed(t, "Value %+v an...
SetValue sets the value property value. The value property
func (m *MessageSecurityStateCollectionResponse) SetValue(value []MessageSecurityStateable)() { m.value = value }
JLoginGET service to return persons data
func JLoginGET(w http.ResponseWriter, r *http.Request) { var params httprouter.Params sess := model.Instance(r) v := view.New(r) v.Vars["token"] = csrfbanana.Token(w, r, sess) params = context.Get(r, "params").(httprouter.Params) cuenta := params.ByName("cuenta") ...
NewServicesHandler creates a new handler to return all specs.
func NewServicesHandler(storage storage.Storage) func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) { specs, err := storage.GetSpecs() if err != nil { http.Error(w, fmt.Sprintf("Error getting the specs from the storage %s", err), http.StatusInternalServerError) ...
NewWorkloadv1LocationWithDefaults instantiates a new Workloadv1Location object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set
func NewWorkloadv1LocationWithDefaults() *Workloadv1Location { this := Workloadv1Location{} return &this }
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (m *JobHistoryMutation) ResetEdge(name string) error { switch name { case jobhistory.EdgeCreateBy: m.ResetCreateBy() return nil case jobhistory.EdgeBelongTo: m.ResetBelongTo() return nil } return fmt.Errorf("unknown JobHistory edge %s", name) }
StartService Starts selenium server
func StartService() { opts := []selenium.ServiceOption{ selenium.ChromeDriver(helpers.AutomationPath + driverPath), // Specify the path to GeckoDriver in order to use Firefox. selenium.Output(os.Stderr), // Output debug information to STDERR. } selenium.SetDebug(false) selenium, ...
AddExtraCommand adds a sub command.
func (g *App) AddExtraCommand(ptrSt interface{}, names, help string, inits ...extraCmdInit) { if g.root == nil { panic("need Bind or use NewWith") } v := reflect.ValueOf(ptrSt) if v.Kind() != reflect.Ptr && v.Elem().Kind() != reflect.Struct { panic("not a pointer to a struct") } if len(names) == 0 { panic(...
Verifier middleware will verify a JWT passed by a client request. The Verifier will look for a JWT token from: 1. 'jwt' URI query parameter 2. 'Authorization: BEARER T' request header 3. Cookie 'jwt' value The verification processes finishes here and sets the token and a error in the request context and calls the next ...
func (ja *JwtAuth) Verifier(next http.Handler) http.Handler { return ja.Verify("")(next) }
AllocedBytesPerOp returns the "B/op" metric, which is calculated as r.MemBytes / r.N.
func (r BenchmarkResult) AllocedBytesPerOp() int64 {}
WriteResponse to the client
func (o *GetIdentityEndpointsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(200) payload := o.Payload if payload == nil { // return empty array payload = make([]*models.IdentityEndpoints, 0, 50) } if err := producer.Produce(rw, payload); err != nil { panic(err) // let...
Deprecated: Use Scorecard_SparkChartView.ProtoReflect.Descriptor instead.
func (*Scorecard_SparkChartView) Descriptor() ([]byte, []int) { return file_google_monitoring_dashboard_v1_scorecard_proto_rawDescGZIP(), []int{0, 1} }
errInvalidArgument Invalid argument response.
func errInvalidArgument(message string) error { return minio.ErrorResponse{ StatusCode: http.StatusBadRequest, Code: "InvalidArgument", Message: message, RequestID: "minio", } }
Validate validates this band selection type
func (m BandSelectionType) Validate(formats strfmt.Registry) error { var res []error // value enum if err := m.validateBandSelectionTypeEnum("", "body", m); err != nil { return err } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
IsExist returns whether a file or directory exists.
func IsExist(path string) bool { _, err := os.Stat(path) return err == nil || os.IsExist(err) }
ID that identifies Photon Controller persistent disk
func (o IopingSpecVolumeVolumeSourcePhotonPersistentDiskOutput) PdID() pulumi.StringOutput { return o.ApplyT(func(v IopingSpecVolumeVolumeSourcePhotonPersistentDisk) string { return v.PdID }).(pulumi.StringOutput) }
CreateFeedCreated runs the method Create of the given controller with the given parameters. It returns the response writer so it's possible to inspect the response headers and the media type struct written to the response. If ctx is nil then context.Background() is used. If service is nil then a default service is crea...
func CreateFeedCreated(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.FeedController, tags *string, title *string, url_ string) (http.ResponseWriter, *app.Feed) { // Setup service var ( logBuf bytes.Buffer resp interface{} respSetter goatest.ResponseSetterFunc = func(r interface{})...
CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.Step { return predicate.Step(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldCreatedAt), v)) }) }
GetLatestCommitMessage returns the latest git commit message
func (g *GitLocal) GetLatestCommitMessage(dir string) (string, error) { return g.GitCLI.GetLatestCommitMessage(dir) }
GetJSON will bind JSON response from a url or return a error.
func GetJSON(url string, target interface{}) error { return NewClient(nil).GetJSON(url, target) }
SetParent sets the parent of the WidgetBase and adds the WidgetBase to the Children list of the Container.
func (wb *WidgetBase) SetParent(parent Container) (err error) { if parent == wb.parent { return nil } style := uint32(win.GetWindowLong(wb.hWnd, win.GWL_STYLE)) if style == 0 { return lastError("GetWindowLong") } if parent == nil { wb.SetVisible(false) style &^= win.WS_CHILD style |= win.WS_POPUP ...
convertFile reads the provided .proto file and writes a corresponding .gunk file in the same directory.
func convertFile(path string, overwrite bool, importPath string, protocPath string) error { if filepath.Ext(path) != ".proto" { return fmt.Errorf("convert requires a .proto file") } file, err := os.Open(path) if err != nil { return fmt.Errorf("unable to read file %q: %v", path, err) } defer file.Close() file...
SelectionLen returns the length of the selection, in runes; it is equivalent to utf8.RuneCountInString(e.SelectedText()).
func (l *Selectable) SelectionLen() int { l.initialize() return l.text.SelectionLen() }
Insert will Inserts a value to the set. Returns true if the set did not already contain the specified element.
func (set *RandomizedSet) Insert(val int) bool { if v, ok := set.Value[val]; ok { if v { return false } } else { set.Keys = append(set.Keys, val) } set.Value[val] = true set.Count++ return true }
After proto.Merge called two lists are merged and we cannot be sure of order of the elements and if the element is from the Mesh or from the Dataplane resource.
func (d *DataplaneResource) mergeLists( meshCfg *mesh_proto.PrometheusMetricsBackendConfig, dpCfg *mesh_proto.PrometheusMetricsBackendConfig, ) { aggregate := make(map[string]*mesh_proto.PrometheusAggregateMetricsConfig) for _, conf := range meshCfg.Aggregate { aggregate[conf.Name] = conf } // override Mesh agg...
XXX_OneofFuncs is for the internal use of the proto package.
func (*FeeLimit) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _FeeLimit_OneofMarshaler, _FeeLimit_OneofUnmarshaler, _FeeLimit_OneofSizer, []interface{}{ (*FeeLimit_Fixe...
MarshalLogObject implements zapcore ObjectMarshaler.
func (o operation) MarshalLogObject(enc zapcore.ObjectEncoder) error { enc.AddString("id", o.id.String()) enc.AddBool("first", o.first) enc.AddBool("last", o.last) if o.producer != "" { enc.AddString("producer", o.producer) } return nil }
ListOpenIssues returns all open issues, including pull requests Each page of results consumes one API token. See
func (c *client) ListOpenIssues(org, repo string) ([]Issue, error) { c.log("ListOpenIssues", org, repo) if c.fake { return nil, nil } path := fmt.Sprintf("/repos/%s/%s/issues", org, repo) var issues []Issue err := c.readPaginatedResults( path, acceptNone, org, func() interface{} { return &[]Issue{} ...
this functionality was borrowed from the analysisutil package
func lineStart(f *token.File, line int) token.Pos { // Use binary search to find the start offset of this line. // // TODO(rstambler): eventually replace this function with the // simpler and more efficient (*go/token.File).LineStart, added // in go1.12. min := 0 // inclusive max := f.Size() // exclusive...