_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c11800
// oneServiceHandler takes the name of a single service and returns results for just // that service.
c11801
// serviceHandler returns the results for all the services we know about
c11802
// stateHandler simply dumps the JSON output of the whole state object. This is // useful for listeners or other clients that need a full state dump on startup.
c11803
// Send back a JSON encoded error and message
c11804
// Configure a default check for a service. The default is to return an HTTP // check on the first TCP port on the endpoint set in DEFAULT_STATUS_ENDPOINT.
c11805
// Talks to a Discoverer and returns the configured check
c11806
// Use templating to substitute in some info about the service. Important because // we won't know the actual Port that the container will bind to, for example.
c11807
// CheckForService returns a Check that has been properly configured for this // particular service.
c11808
// Watch loops over a list of services and adds checks for services we don't already // know about. It then removes any checks for services which have gone away. All // services are expected to be local to this node.
c11809
// Returns the list of services derived from the targets that were parsed // out of the config file.
c11810
// Listeners returns the list of services configured to be ChangeEvent listeners
c11811
// Causes the configuration to be parsed and loaded. There is no background // processing needed on an ongoing basis.
c11812
// Parses a JSON config file containing an array of Targets. These are // then augmented with a random hex ID and stamped with the current // UTC time as the creation time. The same hex ID is applied to the Check // and the Service to make sure that they are matched by the healthy // package later on.
c11813
// Return a defined number of random bytes as a slice
c11814
// optionsHandler sends CORS headers
c11815
// registrationHandler takes the name of a single service and returns results for just // that service. It implements the Envoy SDS API V1.
c11816
// clustersHandler returns cluster information for all Sidecar services. It // implements the Envoy CDS API V1.
c11817
// listenersHandler returns a list of listeners for all ServicePorts. It // implements the Envoy LDS API V1.
c11818
// lookupHost does a vv slow lookup of the DNS host for a service. Totally // not optimized for high throughput. You should only do this in development // scenarios.
c11819
// EnvoyServiceFromService converts a Sidecar service to an Envoy // API service for reporting to the proxy
c11820
// EnvoyClustersFromState genenerates a set of Envoy API cluster // definitions from Sidecar state
c11821
// EnvoyListenersFromState creates a set of Enovy API listener // definitions from all the ServicePorts in the Sidecar state.
c11822
// Format an Envoy service name from our service name and port
c11823
// Split an Enovy service name into our service name and port
c11824
// HttpMux returns a configured Gorilla mux to handle all the endpoints // for the Envoy API.
c11825
// NewCheck returns a properly configured default Check
c11826
// UpdateStatus take the status integer and error and applies them to the status // of the current Check.
c11827
// NewMonitor returns a properly configured default configuration of a Monitor.
c11828
// Add a Check to the list. Handles synchronization.
c11829
// MarkService takes a service and mark its Status appropriately based on the // current check we have configured.
c11830
// Run runs the main monitoring loop. The looper controls the actual run behavior.
c11831
// Return a properly regex-matched name for the service, or failing that, // the Image ID which we use to stand in for the name of the service.
c11832
// Return the value of the configured Docker label, or default to the image // name.
c11833
// UnmarshalJSON umarshall json - template of ffjson
c11834
// MarshalJSON marshal bytes to json - template
c11835
// Start kicks off the goroutine that will process incoming notifications of services
c11836
// Try to pack as many messages into the packet as we can. Note that this // assumes that no messages will be longer than the normal UDP packet size. // This means that max message length is somewhere around 1398 when taking // messaging overhead into account.
c11837
// Version attempts to extract a version from the image. Otherwise it returns // the full image name.
c11838
// Format an APIContainers struct into a more compact struct we // can ship over the wire in a broadcast.
c11839
// Figure out the correct port configuration for a service
c11840
// Return the weighted average of all statistical tests // for anomaly detection, which yields the probability that // the currently observed behavior is anomalous.
c11841
// Use essentially similar weights. However, if either the magnitude // or fence methods have high probabilities, upweight them significantly.
c11842
// Return a vector slice for the active window and reference window. // Some tests require different minimum thresholds for sizes of reference windows. // This can be specified in the minRefSize parameter. If size isn't important, use -1
c11843
// This is a function will sharply scale values between 0 and 1 such that // smaller values are weighted more towards 0. A larger base value means a // more horshoe type function.
c11844
// Calculate a Kolmogorov-Smirnov test statistic.
c11845
// A helper function for KS that rescales a vector to the desired length npoints.
c11846
// marshalValue is being used for getting the actual value of a field. // // There is support for types implementing the Marshaller interface, arbitrary structs, slices, maps and base types.
c11847
// contains check if a given key is contained in a slice of strings.
c11848
// listContains operates on two string slices and checks if one of the strings in `a` // is contained in `b`.
c11849
// Error function is provided to be used as error object.
c11850
// AsMap returns the responses as map with response id as key.
c11851
// GetByID returns the response object of the given id, nil if it does not exist.
c11852
// HasError returns true if one of the response objects has Error field != nil
c11853
// GetInt converts the rpc response to an int64 and returns it. // // If result was not an integer an error is returned.
c11854
// GetFloat converts the rpc response to float64 and returns it. // // If result was not an float64 an error is returned.
c11855
// GetBool converts the rpc response to a bool and returns it. // // If result was not a bool an error is returned.
c11856
// GetString converts the rpc response to a string and returns it. // // If result was not a string an error is returned.
c11857
// NewBatch initializes an object for constructing a set of entries to // atomically add to a replay log. Batches are identified by byte slice, which // allows the caller to safely process the same batch twice and get an // idempotent result.
c11858
// ForEach iterates through each entry in the batch and calls the provided // function with the sequence number and entry contents as arguments.
c11859
// hashSharedSecret Sha-256 hashes the shared secret and returns the first // HashPrefixSize bytes of the hash.
c11860
// Start initializes the log and must be called before any other methods.
c11861
// Stop wipes the state of the log.
c11862
// Get retrieves an entry from the log given its hash prefix. It returns the // value stored and an error if one occurs. It returns ErrLogEntryNotFound // if the entry is not in the log.
c11863
// Put stores an entry into the log given its hash prefix and an accompanying // purposefully general type. It returns ErrReplayedPacket if the provided hash // prefix already exists in the log.
c11864
// Delete deletes an entry from the log given its hash prefix.
c11865
// PutBatch stores a batch of sphinx packets into the log given their hash // prefixes and accompanying values. Returns the set of entries in the batch // that are replays and an error if one occurs.
c11866
// main implements a simple command line utility that can be used in order to // either generate a fresh mix-header or decode and fully process an existing // one given a private key.
c11867
// Encode writes the serialized version of the target HopData into the passed // io.Writer.
c11868
// Decode deserializes the encoded HopData contained int he passed io.Reader // instance to the target empty HopData instance.
c11869
// generateSharedSecrets by the given nodes pubkeys, generates the shared // secrets.
c11870
// NewOnionPacket creates a new onion packet which is capable of obliviously // routing a message through the mix-net path outline by 'paymentPath'.
c11871
// rightShift shifts the byte-slice by the given number of bytes to the right // and 0-fill the resulting gap.
c11872
// Encode serializes the raw bytes of the onion packet into the passed // io.Writer. The form encoded within the passed io.Writer is suitable for // either storing on disk, or sending over the network.
c11873
// Decode fully populates the target ForwardingMessage from the raw bytes // encoded within the io.Reader. In the case of any decoding errors, an error // will be returned. If the method success, then the new OnionPacket is ready // to be processed by an instance of SphinxNode.
c11874
// NewRouter creates a new instance of a Sphinx onion Router given the node's // currently advertised onion private key, and the target Bitcoin network.
c11875
// unwrapPacket wraps a layer of the passed onion packet using the specified // shared secret and associated data. The associated data will be used to check // the HMAC at each hop to ensure the same data is passed along with the onion // packet. This function returns the next inner onion packet layer, along with // th...
c11876
// processOnionPacket performs the primary key derivation and handling of onion // packets. The processed packets returned from this method should only be used // if the packet was not flagged as a replayed packet.
c11877
// Commit writes this transaction's batch of sphinx packets to the replay log, // performing a final check against the log for replays.
c11878
// IsEmpty returns true if the hop isn't populated.
c11879
// calcMac calculates HMAC-SHA-256 over the message using the passed secret key // as input to the HMAC.
c11880
// generateCipherStream generates a stream of cryptographic psuedo-random bytes // intended to be used to encrypt a message using a one-time-pad like // construction.
c11881
// generateSharedSecret generates the shared secret by given ephemeral key.
c11882
// generateSharedSecret generates the shared secret for a particular hop. The // shared secret is generated by taking the group element contained in the // mix-header, and performing an ECDH operation with the node's long term onion // key. We then take the _entire_ point generated by the ECDH operation, // serialize t...
c11883
// DecryptError attempts to decrypt the passed encrypted error response. The // onion failure is encrypted in backward manner, starting from the node where // error have occurred. As a result, in order to decrypt the error we need get // all shared secret and apply decryption in the reverse order.
c11884
// EncryptError is used to make data obfuscation using the generated shared // secret. // // In context of Lightning Network is either used by the nodes in order to make // initial obfuscation with the creation of the hmac or by the forwarding nodes // for backward failure obfuscation of the onion failure blob. By obfu...
c11885
// NewOnionErrorEncrypter creates new instance of the onion encrypter backed by // the passed router, with encryption to be doing using the passed // ephemeralKey.
c11886
// Encode writes the encrypter's shared secret to the provided io.Writer.
c11887
// Decode restores the encrypter's share secret from the provided io.Reader.
c11888
// Decode initializes the circuit from the byte stream.
c11889
// Encode writes converted circuit in the byte stream.
c11890
// Contains queries the contents of the replay set for membership of a // particular index.
c11891
// Merge adds the contents of the provided replay set to the receiver's set.
c11892
// Encode serializes the replay set into an io.Writer suitable for storage. The // replay set can be recovered using Decode.
c11893
// Decode reconstructs a replay set given a io.Reader. The byte // slice is assumed to be even in length, otherwise resulting in failure.
c11894
// SetHttpContext sets http client.
c11895
// SetIgnoreErrors sets ignoreErrorsRegexp.
c11896
// SetSampleRate sets sampling rate.
c11897
// SetTagsContext sets tags.
c11898
// SetUserContext sets user.
c11899
// xtob converts the the first two hex bytes of x into a byte.