_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c164300
train
// Used to collect all subscriptions.
{ "resource": "" }
c164301
train
// validateTrustedOperators will check that we do not have conflicts with // assigned trusted keys and trusted operators. If operators are defined we // will expand the trusted keys in options.
{ "resource": "" }
c164302
train
// Source reports the location of a configuration error.
{ "resource": "" }
c164303
train
// Error reports the location and reason from a configuration error.
{ "resource": "" }
c164304
train
// Error reports that an unknown field was in the configuration.
{ "resource": "" }
c164305
train
// Error reports a configuration warning.
{ "resource": "" }
c164306
train
// Error returns the collection of errors separated by new lines, // warnings appear first then hard errors.
{ "resource": "" }
c164307
train
// Sampling function to keep pcpu relevant.
{ "resource": "" }
c164308
train
// internalSendLoop will be responsible for serializing all messages that // a server wants to send.
{ "resource": "" }
c164309
train
// Will send a shutdown message.
{ "resource": "" }
c164310
train
// This will queue up a message to be sent. // Assumes lock is held on entry.
{ "resource": "" }
c164311
train
// Locked version of checking if events system running. Also checks server.
{ "resource": "" }
c164312
train
// EventsEnabled will report if the server has internal events enabled via // a defined system account.
{ "resource": "" }
c164313
train
// eventsEnabled will report if events are enabled. // Lock should be held.
{ "resource": "" }
c164314
train
// Generate a route stat for our statz update.
{ "resource": "" }
c164315
train
// Actual send method for statz updates. // Lock should be held.
{ "resource": "" }
c164316
train
// This will setup our system wide tracking subs. // For now we will setup one wildcard subscription to // monitor all accounts for changes in number of connections. // We can make this on a per account tracking basis if needed. // Tradeoff is subscription and interest graph events vs connect and // disconnect events, ...
{ "resource": "" }
c164317
train
// accountClaimUpdate will receive claim updates for accounts.
{ "resource": "" }
c164318
train
// processRemoteServerShutdown will update any affected accounts. // Will update the remote count for clients. // Lock assume held.
{ "resource": "" }
c164319
train
// remoteServerShutdownEvent is called when we get an event from another server shutting down.
{ "resource": "" }
c164320
train
// updateRemoteServer is called when we have an update from a remote server. // This allows us to track remote servers, respond to shutdown messages properly, // make sure that messages are ordered, and allow us to prune dead servers. // Lock should be held upon entry.
{ "resource": "" }
c164321
train
// shutdownEventing will clean up all eventing state.
{ "resource": "" }
c164322
train
// Request for our local connection count.
{ "resource": "" }
c164323
train
// leafNodeConnected is an event we will receive when a leaf node for a given account // connects.
{ "resource": "" }
c164324
train
// statszReq is a request for us to respond with current statz.
{ "resource": "" }
c164325
train
// remoteConnsUpdate gets called when we receive a remote update from another server.
{ "resource": "" }
c164326
train
// Setup tracking for this account. This allows us to track globally // account activity. // Lock should be held on entry.
{ "resource": "" }
c164327
train
// Event on leaf node connect. // Lock should NOT be held on entry.
{ "resource": "" }
c164328
train
// sendAccConnsUpdate is called to send out our information on the // account's local connections. // Lock should be held on entry.
{ "resource": "" }
c164329
train
// accConnsUpdate is called whenever there is a change to the account's // number of active connections, or during a heartbeat.
{ "resource": "" }
c164330
train
// accountConnectEvent will send an account client connect event if there is interest. // This is a billing event.
{ "resource": "" }
c164331
train
// accountDisconnectEvent will send an account client disconnect event if there is interest. // This is a billing event.
{ "resource": "" }
c164332
train
// Create an internal subscription. No support for queue groups atm.
{ "resource": "" }
c164333
train
// Helper to grab name for a client.
{ "resource": "" }
c164334
train
// Helper to grab account name for a client.
{ "resource": "" }
c164335
train
// Helper to clear timers.
{ "resource": "" }
c164336
train
// Helper function to wrap functions with common test // to lock server and return if events not enabled.
{ "resource": "" }
c164337
train
// GetSysLoggerTag generates the tag name for use in syslog statements. If // the executable is linked, the name of the link will be used as the tag, // otherwise, the name of the executable is used. "gnatsd" is the default // for the NATS server.
{ "resource": "" }
c164338
train
// NewSysLogger creates a new system logger
{ "resource": "" }
c164339
train
// NewRemoteSysLogger creates a new remote system logger
{ "resource": "" }
c164340
train
// ProcessSignal sends the given signal command to the given process. If pidStr // is empty, this will send the signal to the single running instance of // gnatsd. If multiple instances are running, it returns an error. This returns // an error if the given process is not running or the command is invalid.
{ "resource": "" }
c164341
train
// resolvePids returns the pids for all running gnatsd processes.
{ "resource": "" }
c164342
train
// lexTop consumes elements at the top level of data structure.
{ "resource": "" }
c164343
train
// lexTopValueEnd is entered whenever a top-level value has been consumed. // It must see only whitespace, and will turn back to lexTop upon a new line. // If it sees EOF, it will quit the lexer successfully.
{ "resource": "" }
c164344
train
// keyCheckKeyword will check for reserved keywords as the key value when the key is // separated with a space.
{ "resource": "" }
c164345
train
// lexIncludeStart will consume the whitespace til the start of the value.
{ "resource": "" }
c164346
train
// lexIncludeQuotedString consumes the inner contents of a string. It assumes that the // beginning '"' has already been consumed and ignored. It will not interpret any // internal contents.
{ "resource": "" }
c164347
train
// lexIncludeDubQuotedString consumes the inner contents of a string. It assumes that the // beginning '"' has already been consumed and ignored. It will not interpret any // internal contents.
{ "resource": "" }
c164348
train
// lexIncludeString consumes the inner contents of a raw string.
{ "resource": "" }
c164349
train
// lexInclude will consume the include value.
{ "resource": "" }
c164350
train
// lexArrayValueEnd consumes the cruft between values of an array. Namely, // it ignores whitespace and expects either a ',' or a ']'.
{ "resource": "" }
c164351
train
// lexMapValue consumes one value in a map. It assumes that '{' or ',' // have already been consumed. All whitespace and new lines are ignored. // Map values can be separated by ',' or simple NLs.
{ "resource": "" }
c164352
train
// lexMapValueEnd consumes the cruft between values of a map. Namely, // it ignores whitespace and expects either a ',' or a '}'.
{ "resource": "" }
c164353
train
// lexMapEnd finishes the lexing of a map. It assumes that a '}' has // just been consumed.
{ "resource": "" }
c164354
train
// Checks if the unquoted string was actually a boolean
{ "resource": "" }
c164355
train
// lexString consumes the inner contents of a raw string.
{ "resource": "" }
c164356
train
// lexDateAfterYear consumes a full Zulu Datetime in ISO8601 format. // It assumes that "YYYY-" has already been consumed.
{ "resource": "" }
c164357
train
// lexNumber consumes a negative integer or a float after seeing the first digit.
{ "resource": "" }
c164358
train
// lexCommentStart begins the lexing of a comment. It will emit // itemCommentStart and consume no characters, passing control to lexComment.
{ "resource": "" }
c164359
train
// lexSkip ignores all slurped input and moves on to the next state.
{ "resource": "" }
c164360
train
// Tests to see if we have a number suffix
{ "resource": "" }
c164361
train
// This will spin up go routines to solicit the remote leaf node connections.
{ "resource": "" }
c164362
train
// Ensure that leafnode is properly configured.
{ "resource": "" }
c164363
train
// Creates a leafNodeCfg object that wraps the RemoteLeafOpts.
{ "resource": "" }
c164364
train
// Will pick an URL from the list of available URLs.
{ "resource": "" }
c164365
train
// Returns the current URL
{ "resource": "" }
c164366
train
// Makes a deep copy of the LeafNode Info structure. // The server lock is held on entry.
{ "resource": "" }
c164367
train
// Adds a LeafNode URL that we get when a route connects to the Info structure. // Regenerates the JSON byte array so that it can be sent to LeafNode connections. // Returns a boolean indicating if the URL was added or not. // Server lock is held on entry
{ "resource": "" }
c164368
train
// Removes a LeafNode URL of the route that is disconnecting from the Info structure. // Regenerates the JSON byte array so that it can be sent to LeafNode connections. // Returns a boolean indicating if the URL was removed or not. // Server lock is held on entry.
{ "resource": "" }
c164369
train
// Sends an async INFO protocol so that the connected servers can update // their list of LeafNode urls.
{ "resource": "" }
c164370
train
// When getting a leaf node INFO protocol, use the provided // array of urls to update the list of possible endpoints.
{ "resource": "" }
c164371
train
// Similar to setInfoHostPortAndGenerateJSON, but for leafNodeInfo.
{ "resource": "" }
c164372
train
// processLeafNodeConnect will process the inbound connect args. // Once we are here we are bound to an account, so can send any interest that // we would have to the other side.
{ "resource": "" }
c164373
train
// Snapshot the current subscriptions from the sublist into our smap which // we will keep updated from now on.
{ "resource": "" }
c164374
train
// updateInterestForAccountOnGateway called from gateway code when processing RS+ and RS-.
{ "resource": "" }
c164375
train
// updateLeafNodes will make sure to update the smap for the subscription. Will // also forward to all leaf nodes as needed.
{ "resource": "" }
c164376
train
// This will make an update to our internal smap and determine if we should send out // and interest update to the remote side.
{ "resource": "" }
c164377
train
// Send the subscription interest change to the other side. // Lock should be held.
{ "resource": "" }
c164378
train
// Helper function to build the key.
{ "resource": "" }
c164379
train
// Send all subscriptions for this account that include local // and all subscriptions besides our own.
{ "resource": "" }
c164380
train
// processLeafSub will process an inbound sub request for the remote leaf node.
{ "resource": "" }
c164381
train
// processLeafUnsub will process an inbound unsub request for the remote leaf node.
{ "resource": "" }
c164382
train
// processInboundLeafMsg is called to process an inbound msg from a leaf node.
{ "resource": "" }
c164383
train
// This functional will take a larger buffer and break it into // chunks that are protocol correct. Reason being is that we are // doing this in the first place to get things in smaller sizes // out the door but we may allow someone to get in between us as // we do. // NOTE - currently this does not process MSG protos.
{ "resource": "" }
c164384
train
// clone performs a deep copy of the User struct, returning a new clone with // all values copied.
{ "resource": "" }
c164385
train
// clone performs a deep copy of the NkeyUser struct, returning a new clone with // all values copied.
{ "resource": "" }
c164386
train
// clone will clone an individual subject permission.
{ "resource": "" }
c164387
train
// clone performs a deep copy of the Permissions struct, returning a new clone // with all values copied.
{ "resource": "" }
c164388
train
// checkAuthforWarnings will look for insecure settings and log concerns. // Lock is assumed held.
{ "resource": "" }
c164389
train
// If opts.Users or opts.Nkeys have definitions without an account // defined assign them to the default global account. // Lock should be held.
{ "resource": "" }
c164390
train
// configureAuthorization will do any setup needed for authorization. // Lock is assumed held.
{ "resource": "" }
c164391
train
// checkAuthentication will check based on client type and // return boolean indicating if client is authorized.
{ "resource": "" }
c164392
train
// isLeafNodeAuthorized will check for auth for an inbound leaf node connection.
{ "resource": "" }
c164393
train
// ConfigureLogger configures and sets the logger for the server.
{ "resource": "" }
c164394
train
// SetLogger sets the logger of the server
{ "resource": "" }
c164395
train
// ReOpenLogFile if the logger is a file based logger, close and re-open the file. // This allows for file rotation by 'mv'ing the file then signaling // the process to trigger this function.
{ "resource": "" }
c164396
train
// Fills in the ConnInfo from the client. // client should be locked.
{ "resource": "" }
c164397
train
// Assume lock is held
{ "resource": "" }
c164398
train
// HandleConnz process HTTP requests for connection information.
{ "resource": "" }
c164399
train
// Routez returns a Routez struct containing inormation about routes.
{ "resource": "" }