_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c12100
train
// IsEmpty returns true if there is no item in the queue to be processed. // Please note that this state is extremely volatile unless IsClosed // returned true.
{ "resource": "" }
c12101
train
// RegisterWithDepth to register a plugin to the TypeRegistry by passing an uninitialized object.
{ "resource": "" }
c12102
train
// GetTypeOf returns only the type asscociated with the given name. // If the name is not registered, nil is returned. // The type returned will be a pointer type.
{ "resource": "" }
c12103
train
// IsTypeRegistered returns true if a type is registered to this registry. // Note that GetTypeOf can do the same thing by checking for nil but also // returns the type, so in many cases you will want to call this function.
{ "resource": "" }
c12104
train
// GetRegistered returns the names of all registered types for a given package
{ "resource": "" }
c12105
train
// Colorize returns a colored string with the given colors.
{ "resource": "" }
c12106
train
// Colorizef returns a colored, formatted string with the given colors.
{ "resource": "" }
c12107
train
// NewMutex creates a new mutex with the given spin priority used during Lock.
{ "resource": "" }
c12108
train
// TryLock tries to acquire a lock and returns true if it succeeds. This // function does not block.
{ "resource": "" }
c12109
train
// Write Drops all messages
{ "resource": "" }
c12110
train
// NextPowerOf2U16 returns the next power of 2 for a given 16bit number
{ "resource": "" }
c12111
train
// NextPowerOf2U32 returns the next power of 2 for a given 32bit number
{ "resource": "" }
c12112
train
// NextPowerOf2U64 returns the next power of 2 for a given 64bit number
{ "resource": "" }
c12113
train
// NewStackWithGrowSize allows to pass a custom grow size to the stack. // SpinPriorityMedium is used to initialize the spinner.
{ "resource": "" }
c12114
train
// NewStackWithSpinner allows to pass a custom spinner to the stack. // The given size will also be used as grow size.
{ "resource": "" }
c12115
train
// NewStackWithSpinnerAndGrowSize allows to fully configure the new stack.
{ "resource": "" }
c12116
train
// Len returns the number of elements on the stack. // Please note that this value can be highly unreliable in multithreaded // environments as this is only a snapshot of the state at calltime.
{ "resource": "" }
c12117
train
// Pop retrieves the topmost element from the stack. // A LimitError is returned when the stack is empty.
{ "resource": "" }
c12118
train
// Push adds an element to the top of the stack. // When the stack's capacity is reached the storage grows as defined during // construction. If the stack reaches 2^31 elements it is considered full // and will return an LimitError.
{ "resource": "" }
c12119
train
// ItoLen returns the length of an unsingned integer when converted to a string
{ "resource": "" }
c12120
train
// Itob writes an unsigned integer to the start of a given byte buffer.
{ "resource": "" }
c12121
train
// Itobe writes an unsigned integer to the end of a given byte buffer.
{ "resource": "" }
c12122
train
// Btoi is a fast byte buffer to unsigned int parser that reads until the first // non-number character is found. It returns the number value as well as the // length of the number string encountered. // If a number could not be parsed the returned length will be 0
{ "resource": "" }
c12123
train
// IndexN returns the nth occurrences of sep in s or -1 if there is no nth // occurrence of sep.
{ "resource": "" }
c12124
train
// LastIndexN returns the nth occurrence of sep in s or -1 if there is no nth // occurrence of sep. Searching is going from the end of the string to the start.
{ "resource": "" }
c12125
train
// IsInt returns true if the given string can be converted to an integer. // The string must contain no whitespaces.
{ "resource": "" }
c12126
train
// IsJSON returns true if the given byte slice contains valid JSON data. // You can access the results by utilizing the RawMessage returned.
{ "resource": "" }
c12127
train
// NewByteRef creates an unsafe byte slice reference to the given string. // The referenced data is not guaranteed to stay valid if no reference to the // original string is held anymore. The returned ByteRef does not count as // reference. // Writing to the returned ByteRef will result in a segfault.
{ "resource": "" }
c12128
train
// NewStringRef creates a unsafe string reference to to the given byte slice. // The referenced data is not guaranteed to stay valid if no reference to the // original byte slice is held anymore. The returned StringRef does not count as // reference. // Changing the size of the underlying byte slice will result in a se...
{ "resource": "" }
c12129
train
// JoinStringers works like strings.Join but takes an array of fmt.Stringer.
{ "resource": "" }
c12130
train
// GetNumBase scans the given string for its numeric base. If num starts with // '0x' base 16 is assumed. Just '0' assumes base 8.
{ "resource": "" }
c12131
train
// AtoI64 converts a numeric string to an int64, using GetNumBase to detect // the numeric base for conversion.
{ "resource": "" }
c12132
train
// AtoU64 converts a numeric string to an uint64, using GetNumBase to detect // the numeric base for conversion.
{ "resource": "" }
c12133
train
// Serialize to JSON. Will err if there are unmarshalable key values
{ "resource": "" }
c12134
train
// Serialize using gob
{ "resource": "" }
c12135
train
// ping does an internal ping against a server to check if it is alive.
{ "resource": "" }
c12136
train
// save stores the session in redis.
{ "resource": "" }
c12137
train
// load reads the session from redis. // returns true if there is a sessoin data in DB
{ "resource": "" }
c12138
train
// delete removes keys from redis if MaxAge<0
{ "resource": "" }
c12139
train
// Load is same as sync.Map Load
{ "resource": "" }
c12140
train
// Load is same as sync.Map Store
{ "resource": "" }
c12141
train
// Go starts a new goroutine and tracks its lifecycle. // Panic will be recovered and logged automatically, except for StopSignal
{ "resource": "" }
c12142
train
// StopAndWait cancel all goroutines started by this executor and wait. // Wait can be cancelled by the context passed in.
{ "resource": "" }
c12143
train
// AppendMeasure is a formatting routine to append the InflxDB line protocol // representation of a measure to a memory buffer.
{ "resource": "" }
c12144
train
// NewEngine creates and returns a new engine configured with prefix, handler, // and tags.
{ "resource": "" }
c12145
train
// Register adds handler to eng.
{ "resource": "" }
c12146
train
// WithPrefix returns a copy of the engine with prefix appended to eng's current // prefix and tags set to the merge of eng's current tags and those passed as // argument. Both eng and the returned engine share the same handler.
{ "resource": "" }
c12147
train
// Clock returns a new clock identified by name and tags.
{ "resource": "" }
c12148
train
// ClockAt returns a new clock identified by name and tags with a specified // start time.
{ "resource": "" }
c12149
train
// ReportAt reports a set of metrics for a given time. The metrics must be of // type struct, pointer to struct, or a slice or array to one of those. See // MakeMeasures for details about how to make struct types exposing metrics.
{ "resource": "" }
c12150
train
// WithPrefix returns a copy of the engine with prefix appended to default // engine's current prefix and tags set to the merge of eng's current tags and // those passed as argument. Both the default engine and the returned engine // share the same handler.
{ "resource": "" }
c12151
train
// IncrAt increments by one the counter identified by name and tags.
{ "resource": "" }
c12152
train
// ObserveAt reports value for the histogram identified by name and tags.
{ "resource": "" }
c12153
train
// ReportAt is a helper function that delegates to DefaultEngine.
{ "resource": "" }
c12154
train
// AppendMeasure is a formatting routine to append the dogstatsd protocol // representation of a measure to a memory buffer.
{ "resource": "" }
c12155
train
// statusCode behaves like strconv.Itoa but uses a lookup table to avoid having // to do a dynamic memory allocation to convert common http status codes to a // string representation.
{ "resource": "" }
c12156
train
// This function builds a string of column-separated float representations of // the given list of buckets, which is then split by calls to nextLe to generate // the values of the "le" label for each bucket of a histogram. // // The intent is to keep the number of dynamic memory allocations constant // instead of incre...
{ "resource": "" }
c12157
train
// HandleMeasures satisfies the Handler interface.
{ "resource": "" }
c12158
train
// Flush satisfies the Flusher interface.
{ "resource": "" }
c12159
train
// ServeSearch calls f, satisfies the SearchHandler interface.
{ "resource": "" }
c12160
train
// MakeField constructs and returns a new Field from name, value, and ftype.
{ "resource": "" }
c12161
train
// NewTransport wraps t to produce metrics on the default engine for every request // sent and every response received.
{ "resource": "" }
c12162
train
// NewTransportWith wraps t to produce metrics on eng for every request sent and // every response received.
{ "resource": "" }
c12163
train
// RequestWithTags returns a shallow copy of req with its context changed with this provided tags // so the they can be used later during the RoundTrip in the metrics recording. // The provided ctx must be non-nil.
{ "resource": "" }
c12164
train
// RoundTrip implements http.RoundTripper
{ "resource": "" }
c12165
train
// ServeQuery calls f, satisfies the QueryHandler interface.
{ "resource": "" }
c12166
train
// Col constructs a new Column value from a text and column type.
{ "resource": "" }
c12167
train
// AscCol constructs a ne Column value from a text a column type, which is // configured as a sorted column in ascending order.
{ "resource": "" }
c12168
train
// DescCol constructs a ne Column value from a text a column type, which is // configured as a sorted column in descending order.
{ "resource": "" }
c12169
train
// Set sets a set of buckets to the given list of sorted values.
{ "resource": "" }
c12170
train
// NewProcMetricsWith collects metrics on the process identified by pid and // reports them to eng.
{ "resource": "" }
c12171
train
// NewHandler returns a new http.Handler that implements the // simple-json-datasource API.
{ "resource": "" }
c12172
train
// NewClient creates and returns a new veneur client publishing metrics to the // server running at addr.
{ "resource": "" }
c12173
train
// NewClientGlobal creates a client that sends all metrics to the Global Veneur Aggregator
{ "resource": "" }
c12174
train
// NewClientWith creates and returns a new veneur client configured with the // given config.
{ "resource": "" }
c12175
train
// NewHandler wraps h to produce metrics on the default engine for every request // received and every response sent.
{ "resource": "" }
c12176
train
// NewHandlerWith wraps h to produce metrics on eng for every request received // and every response sent.
{ "resource": "" }
c12177
train
// ListenAndServe starts a new dogstatsd server, listening for UDP datagrams on // addr and forwarding the metrics to handler.
{ "resource": "" }
c12178
train
// Serve runs a dogstatsd server, listening for datagrams on conn and forwarding // the metrics to handler.
{ "resource": "" }
c12179
train
// M allows for creating a tag list from a map.
{ "resource": "" }
c12180
train
// TagsAreSorted returns true if the given list of tags is sorted by tag name, // false otherwise.
{ "resource": "" }
c12181
train
// SortTags sorts the slice of tags.
{ "resource": "" }
c12182
train
// NewClientWith creates and returns a new datadog client configured with the // given config.
{ "resource": "" }
c12183
train
// ServeAnnotations calls f, satisfies the AnnotationsHandler interface.
{ "resource": "" }
c12184
train
// HandleMeasures calls f, satisfies the Handler interface.
{ "resource": "" }
c12185
train
// MultiHandler constructs a handler which dispatches measures to all given // handlers.
{ "resource": "" }
c12186
train
// NewHandlerWith returns a Handler object that warps hdl and produces // metrics on eng.
{ "resource": "" }
c12187
train
// ServeHTTP satisfies the http.Handler interface.
{ "resource": "" }
c12188
train
// NewClientWith creates and returns a new InfluxDB client configured with the // given config.
{ "resource": "" }
c12189
train
// CreateDB creates a database named db in the InfluxDB server that the client // was configured to send metrics to.
{ "resource": "" }
c12190
train
// StopAt reports the time difference between now and the time the clock was created at. // // The metric produced by this method call will have a "stamp" tag set to // "total".
{ "resource": "" }
c12191
train
// NewDelayStatsWith collects metrics on the process identified by pid and // reports them to eng.
{ "resource": "" }
c12192
train
// NewGoMetricsWith creates a new collector for the Go unrtime that producers // metrics on eng.
{ "resource": "" }
c12193
train
// NewConn returns a net.Conn object that wraps c and produces metrics on the // default engine.
{ "resource": "" }
c12194
train
// NewConn returns a net.Conn object that wraps c and produces metrics on eng.
{ "resource": "" }
c12195
train
// List returns a slice that contains all of the products in the project.
{ "resource": "" }
c12196
train
// Dist builds the distribution for the specified product using the "godelw dist" command and returns the path to the // created distribution artifact.
{ "resource": "" }
c12197
train
// MustNewPluginInfo returns the result of calling NewInfo with the provided parameters. Panics if the call to // NewPluginInfo returns an error, so this function should only be used when the inputs are static and known to be valid.
{ "resource": "" }
c12198
train
// String returns a string representation of the form "GOOS-GOARCH".
{ "resource": "" }
c12199
train
// ConfigNotSupported verifies that the provided bytes represent empty YAML. If the YAML is non-empty, return an error.
{ "resource": "" }