_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c14700
train
// Extensions requests the list of active registered extensions.
{ "resource": "" }
c14701
train
// RegisterExtension registers the extension plugins with the osquery process.
{ "resource": "" }
c14702
train
// Options requests the list of bootstrap or configuration options.
{ "resource": "" }
c14703
train
// Query requests a query to be run and returns the extension response. // Consider using the QueryRow or QueryRows helpers for a more friendly // interface.
{ "resource": "" }
c14704
train
// QueryRows is a helper that executes the requested query and returns the // results. It handles checking both the transport level errors and the osquery // internal errors by returning a normal Go error type.
{ "resource": "" }
c14705
train
// QueryRow behaves similarly to QueryRows, but it returns an error if the // query does not return exactly one row.
{ "resource": "" }
c14706
train
// NewPlugin takes the distributed query functions and returns a struct // implementing the OsqueryPlugin interface. Use this to wrap the appropriate // functions into an osquery plugin.
{ "resource": "" }
c14707
train
// UnmarshalJSON marshals a json string that is convertable to an int, for // example "234" -> 234.
{ "resource": "" }
c14708
train
// UnmarshalJSON turns structurally inconsistent osquery json into a ResultsStruct.
{ "resource": "" }
c14709
train
// CreatePersonTable uses db to create a new table for Person models, and returns the result
{ "resource": "" }
c14710
train
// InsertPerson inserts person into db
{ "resource": "" }
c14711
train
// SelectPerson selects a person with the given first & last names and age. On success, writes the result into result and on failure, returns a non-nil error and makes no modifications to result
{ "resource": "" }
c14712
train
// UpdatePerson updates the person with the given first & last names and age with newPerson. Returns a non-nil error if the update failed, and nil if the update succeeded
{ "resource": "" }
c14713
train
// DeletePerson deletes the person with the given first & last names and age. Returns a non-nil error if the delete failed, and nil if the delete succeeded
{ "resource": "" }
c14714
train
// OtherHandler is a default handler to serve up // a home page.
{ "resource": "" }
c14715
train
// NewRenderRenderer returns a new RenderRenderer, where the underlying render.Render // serves templates out of dir with the given func map. it's configured in dev mode // according to the dev boolean
{ "resource": "" }
c14716
train
// Render is the interface implementation
{ "resource": "" }
c14717
train
// NewMem creates a Data implementation that stores config data in memory
{ "resource": "" }
c14718
train
// SetInt is the interface implementation
{ "resource": "" }
c14719
train
// GetInt is the interface implementation
{ "resource": "" }
c14720
train
// Save is the interface implementation. Overwrites existing keys and never returns an error
{ "resource": "" }
c14721
train
// Delete is the interface implementation. Never returns an error, even if the key didn't exist
{ "resource": "" }
c14722
train
// Get is the interface implementation. Returns ErrNotFound if no such key existed. Callers should pass a pointer to a model so that Get can write the fetched model into it
{ "resource": "" }
c14723
train
// randDishIdx returns a random index into the dishes slice, or -1 if the slice // is empty
{ "resource": "" }
c14724
train
// App is where all routes and middleware for buffalo // should be defined. This is the nerve center of your // application.
{ "resource": "" }
c14725
train
// releaseAllServers is the handler to release the lock on all servers. it's an admin-only handler
{ "resource": "" }
c14726
train
// getAllServers is the handler to get the status of all servers. it's admin-only
{ "resource": "" }
c14727
train
// Save is the interface implementation
{ "resource": "" }
c14728
train
// Delete is the interface implementation
{ "resource": "" }
c14729
train
// hdl is a handler that calls t.Execute, passing all of the query string values as data to the template
{ "resource": "" }
c14730
train
// GetConfig uses envconfig to populate and return a Config struct. Returns all envconfig errors if they occurred
{ "resource": "" }
c14731
train
// returns true if elt already exists in s
{ "resource": "" }
c14732
train
// adds elt to s unless it already exists. returns true if it was added successfully
{ "resource": "" }
c14733
train
// removes elt from s unless it doesn't exist. returns true if it was removed, false otherwise
{ "resource": "" }
c14734
train
// removeAll removes all elements from s and returns the total number of elements removed
{ "resource": "" }
c14735
train
// UnmarshalBinary is the encoding.BinaryUnmarshaler interface implementation
{ "resource": "" }
c14736
train
// Set is the Model interface implementation
{ "resource": "" }
c14737
train
// GetKey returns an http.Handler that can get a key registered by Gorilla mux // as "key" in the path. It gets the value of the key from db
{ "resource": "" }
c14738
train
// Upsert is the interface implementation
{ "resource": "" }
c14739
train
// releaseServer is the handler to release a specific server by name
{ "resource": "" }
c14740
train
// PutKey returns an http.Handler that can set a value for the key registered by Gorilla // mux as "key" in the path. It expects the value to be in the body of the PUT request
{ "resource": "" }
c14741
train
//Get method of the RedisClientWrapper type
{ "resource": "" }
c14742
train
//Set method of the RedisClientWrapper type
{ "resource": "" }
c14743
train
// looks up key in the cache. if it exists, runs its value through fn, puts the new value // back into the cache, and returns true. otherwise does nothing and returns false
{ "resource": "" }
c14744
train
// removes key from the cache if it existed and returns true. otherwise returns false
{ "resource": "" }
c14745
train
// convenience function that returns plural if i != 1, singular otherwise
{ "resource": "" }
c14746
train
// SetPeerLinkIp configures peer link's IP address
{ "resource": "" }
c14747
train
// SetPeerLinkNsToDocker sends peer link into Docker
{ "resource": "" }
c14748
train
// SetPeerLinkNsPid sends peer link into container specified by PID
{ "resource": "" }
c14749
train
// SetPeerLinkNsFd sends peer link into container specified by path
{ "resource": "" }
c14750
train
// SetPeerLinkNetInNs configures peer link's IP network in network namespace specified by PID
{ "resource": "" }
c14751
train
// generates new unused network interfaces name with given prefix
{ "resource": "" }
c14752
train
// validates MacAddress LinkOption
{ "resource": "" }
c14753
train
// validates Flags LinkOption
{ "resource": "" }
c14754
train
// NetInterfaceNameValid checks if the network interface name is valid. // It accepts interface name as a string. It returns error if invalid interface name is supplied.
{ "resource": "" }
c14755
train
// NetNsHandle returns a file descriptor handle for network namespace specified by PID. // It returns error if network namespace could not be found or if network namespace path could not be opened.
{ "resource": "" }
c14756
train
// SetNetNsToPid sets network namespace to the one specied by PID. // It returns error if the network namespace could not be set.
{ "resource": "" }
c14757
train
// BridgeFromName returns a tenus network bridge from an existing bridge of given name on the Linux host. // It returns error if the bridge of the given name cannot be found.
{ "resource": "" }
c14758
train
// NewLinkFrom creates new tenus link on Linux host from an existing interface of given name
{ "resource": "" }
c14759
train
// SetLinkNetNsPid moves the link to Network namespace specified by PID.
{ "resource": "" }
c14760
train
// SetLinkNetInNs configures network settings of the link in network namespace specified by PID.
{ "resource": "" }
c14761
train
// SetLinkNsFd sets the link's Linux namespace to the one specified by filesystem path.
{ "resource": "" }
c14762
train
// SetLinkNsToDocker sets the link's Linux namespace to a running Docker one specified by Docker name.
{ "resource": "" }
c14763
train
// RenameInterfaceByName renames an interface of given name.
{ "resource": "" }
c14764
train
// setLinkOptions validates and sets link's various options passed in as LinkOptions.
{ "resource": "" }
c14765
train
// Client executes the provided request
{ "resource": "" }
c14766
train
// Constructor for different authentication possibilities
{ "resource": "" }
c14767
train
// Sets authentication info from environment variables GREMLIN_USER and GREMLIN_PASS
{ "resource": "" }
c14768
train
// Sets authentication information from username and password
{ "resource": "" }
c14769
train
// Authenticates the connection
{ "resource": "" }
c14770
train
// Implementation of the stringer interface. Useful for exploration
{ "resource": "" }
c14771
train
// StartMockFeedbackServer spins up a simple stand-in for the Apple // feedback service that can be used for testing purposes. Doesn't // handle many errors, etc. Just for the sake of having something "live" // to hit.
{ "resource": "" }
c14772
train
// NewPushNotification creates and returns a PushNotification structure. // It also initializes the pseudo-random identifier.
{ "resource": "" }
c14773
train
// AddPayload sets the "aps" payload section of the request. It also // has a hack described within to deal with specific zero values.
{ "resource": "" }
c14774
train
// Set defines the value of a payload key.
{ "resource": "" }
c14775
train
// PayloadString returns the current payload in string format.
{ "resource": "" }
c14776
train
// ToBytes returns a byte array of the complete PushNotification // struct. This array is what should be transmitted to the APN Service.
{ "resource": "" }
c14777
train
// BareClient can be used to set the contents of your // certificate and key blocks manually.
{ "resource": "" }
c14778
train
// NewClient assumes you'll be passing in paths that // point to your certificate and key.
{ "resource": "" }
c14779
train
// Send connects to the APN service and sends your push notification. // Remember that if the submission is successful, Apple won't reply.
{ "resource": "" }
c14780
train
// ParseTime3339OrZero parses a string in RFC3339 format. If it's invalid, // the zero time value is returned instead.
{ "resource": "" }
c14781
train
// IsAnyZero returns whether the time is Go zero or Unix zero.
{ "resource": "" }
c14782
train
// ReadFile parses the provided path and returns the config file. // If path is empty, the c.Open function must be defined.
{ "resource": "" }
c14783
train
// Decodes and evaluates a json config file, watching for include cycles.
{ "resource": "" }
c14784
train
// CheckTypes parses m and returns an error if it encounters a type or value // that is not supported by this package.
{ "resource": "" }
c14785
train
// evaluateExpressions parses recursively m, populating it with the values // that are found, unless testOnly is true.
{ "resource": "" }
c14786
train
// ConfigFilePath checks if configFile is found and returns a usable path to it. // It first checks if configFile is an absolute path, or if it's found in the // current working directory. If not, it then checks if configFile is in one of // c.IncludeDirs. It returns an error if configFile is absolute and could not be ...
{ "resource": "" }
c14787
train
// cachedToken returns the token saved in cacheFile. It specifically returns // errTokenExpired if the token is expired.
{ "resource": "" }
c14788
train
// NewRefreshTokenSource returns a token source that obtains its initial token // based on the provided config and the refresh token.
{ "resource": "" }
c14789
train
// ReadBox reads the next box. // // If the previously read box was not read to completion, ReadBox consumes // the rest of its data. // // At the end, the error is io.EOF.
{ "resource": "" }
c14790
train
// ReadAndParseBox wraps the ReadBox method, ensuring that the read box is of type typ // and parses successfully. It returns the parsed box.
{ "resource": "" }
c14791
train
// byteTime returns the time required for n bytes.
{ "resource": "" }
c14792
train
// lockPortable is a portable version not using fcntl. Doesn't handle crashes as gracefully, // since it can leave stale lock files.
{ "resource": "" }
c14793
train
// Makes a simple body-less google storage request
{ "resource": "" }
c14794
train
// GetPartialObject fetches part of a Google Cloud Storage object. // This function relies on the ctx ctxutil.HTTPClient value being set to an OAuth2 // authorized and authenticated HTTP client. // If length is negative, the rest of the object is returned. // It returns ErrInvalidRange if the server replies with http.S...
{ "resource": "" }
c14795
train
// EnumerateObjects lists the objects in a bucket. // This function relies on the ctx oauth2.HTTPClient value being set to an OAuth2 // authorized and authenticated HTTP client. // If after is non-empty, listing will begin with lexically greater object names. // If limit is non-zero, the length of the list will be limi...
{ "resource": "" }
c14796
train
// uploadBinary uploads the currently-running Linux binary. // It crashes if it fails.
{ "resource": "" }
c14797
train
// findIP finds an IP address to use, or returns the empty string if none is found. // It tries to find a reserved one in the same region where the name of the reserved IP // is "NAME-ip" and the IP is not in use.
{ "resource": "" }
c14798
train
// returns nil if instance doesn't exist.
{ "resource": "" }
c14799
train
// Roll adds ch to the rolling sum.
{ "resource": "" }