_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c30300
train
// NewStaticUpstreams parses the configuration input and sets up // static upstreams for the proxy middleware.
{ "resource": "" }
c30301
train
// WebservicesInit read pfconfig webservices configuration
{ "resource": "" }
c30302
train
// addDetectionMechanismsToList add all detection mechanisms in a list
{ "resource": "" }
c30303
train
// newUser creates a new User for the given email address // with a new private key. This function does NOT save the // user to disk or register it via ACME. If you want to use // a user account that might already exist, call getUser // instead. It does NOT prompt the user.
{ "resource": "" }
c30304
train
// getUser loads the user with the given email from disk // using the provided storage. If the user does not exist, // it will create a new one, but it does NOT save new // users to the disk or register them via ACME. It does // NOT prompt the user.
{ "resource": "" }
c30305
train
// saveUser persists a user's key and account registration // to the file system. It does NOT register the user via ACME // or prompt the user. You must also pass in the storage // wherein the user should be saved. It should be the storage // for the CA with which user has an account.
{ "resource": "" }
c30306
train
// promptUserAgreement prompts the user to agree to the agreement // at agreementURL via stdin. If the agreement has changed, then pass // true as the second argument. If this is the user's first time // agreeing, pass false. It returns whether the user agreed or not.
{ "resource": "" }
c30307
train
// NewSocket will always return a new Socket. // err if nothing is listening to it, it will attempt to reconnect on the next Write.
{ "resource": "" }
c30308
train
// Close the socket and flush the remaining frames.
{ "resource": "" }
c30309
train
// DialTimeout connects to the fcgi responder at the specified network address, using default net.Dialer. // See func net.Dial for a description of the network and address parameters.
{ "resource": "" }
c30310
train
// Returns the index at which to find the request for the UUID // Returns -1 if the UUID is unknown
{ "resource": "" }
c30311
train
// connectDB connect to the database
{ "resource": "" }
c30312
train
// initiaLease fetch the database to remove already assigned ip addresses
{ "resource": "" }
c30313
train
// ExcludeIP remove IP from the pool
{ "resource": "" }
c30314
train
// Assign static IP address to a mac address and remove it from the pool
{ "resource": "" }
c30315
train
// GetCertificate gets a certificate to satisfy clientHello. In getting // the certificate, it abides the rules and settings defined in the // Config that matches clientHello.ServerName. It first checks the in- // memory cache, then, if the config enables "OnDemand", it accesses // disk, then accesses the network if it...
{ "resource": "" }
c30316
train
// checkLimitsForObtainingNewCerts checks to see if name can be issued right // now according to mitigating factors we keep track of and preferences the // user has set. If a non-nil error is returned, do not issue a new certificate // for name.
{ "resource": "" }
c30317
train
// obtainOnDemandCertificate obtains a certificate for name for the given // name. If another goroutine has already started obtaining a cert for // name, it will wait and use what the other goroutine obtained. // // This function is safe for use by multiple concurrent goroutines.
{ "resource": "" }
c30318
train
// handshakeMaintenance performs a check on cert for expiration and OCSP // validity. // // This function is safe for use by multiple concurrent goroutines.
{ "resource": "" }
c30319
train
// renewDynamicCertificate renews the certificate for name using cfg. It returns the // certificate to use and an error, if any. currentCert may be returned even if an // error occurs, since we perform renewals before they expire and it may still be // usable. name should already be lower-cased before calling this func...
{ "resource": "" }
c30320
train
// NewRawClient creates a new RawClient using the specified network interface. // // Note that raw sockets typically require elevated user privileges, such as // the 'root' user on Linux, or the 'SET_CAP_RAW' capability. // // For this reason, it is typically recommended to use the regular Client type // instead, which...
{ "resource": "" }
c30321
train
// sendDHCP create a udp packet and stores it in an // Ethernet frame, and sends the frame over a raw socket to attempt to wake // a machine.
{ "resource": "" }
c30322
train
// setupEdns0Opt will retrieve the EDNS0 OPT or create it if it does not exist
{ "resource": "" }
c30323
train
// Rewrite will alter the request EDNS0 local options
{ "resource": "" }
c30324
train
// newEdns0Rule creates an EDNS0 rule of the appropriate type based on the args
{ "resource": "" }
c30325
train
// newEdns0VariableRule creates an EDNS0 rule that handles variable substitution
{ "resource": "" }
c30326
train
// ruleData returns the data specified by the variable
{ "resource": "" }
c30327
train
// fillEcsData sets the subnet data into the ecs option
{ "resource": "" }
c30328
train
// Rewrite will alter the request EDNS0 subnet option
{ "resource": "" }
c30329
train
// Setup the pfsso middleware // Also loads the pfconfig resources and registers them in the pool
{ "resource": "" }
c30330
train
// Build the PfssoHandler which will initialize the cache and instantiate the router along with its routes
{ "resource": "" }
c30331
train
// Validate that all the required fields are there in the request
{ "resource": "" }
c30332
train
// Spawn an async SSO request for a specific firewall
{ "resource": "" }
c30333
train
// Add the info in the request to the log context
{ "resource": "" }
c30334
train
// Handle an update action for pfsso // If the firewall has cached updates enabled, it will handle it here // The cache is in-memory so that means that a restart of the process will clear the cached updates cache
{ "resource": "" }
c30335
train
// Handle an SSO stop
{ "resource": "" }
c30336
train
// a takes a slice of net.IPs and returns a slice of A RRs.
{ "resource": "" }
c30337
train
// NewFileStorage is a StorageConstructor function that creates a new // Storage instance backed by the local disk. The resulting Storage // instance is guaranteed to be non-nil if there is no error.
{ "resource": "" }
c30338
train
// site returns the path to the folder containing assets for domain.
{ "resource": "" }
c30339
train
// user gets the account folder for the user with email
{ "resource": "" }
c30340
train
// emailUsername returns the username portion of an email address (part before // '@') or the original input if it can't find the "@" symbol.
{ "resource": "" }
c30341
train
// userRegFile gets the path to the registration file for the user with the // given email address.
{ "resource": "" }
c30342
train
// readFile abstracts a simple ioutil.ReadFile, making sure to return an // ErrNotExist instance when the file is not found.
{ "resource": "" }
c30343
train
// SiteExists implements Storage.SiteExists by checking for the presence of // cert and key files.
{ "resource": "" }
c30344
train
// LoadSite implements Storage.LoadSite by loading it from disk. If it is not // present, an instance of ErrNotExist is returned.
{ "resource": "" }
c30345
train
// StoreSite implements Storage.StoreSite by writing it to disk. The base // directories needed for the file are automatically created as needed.
{ "resource": "" }
c30346
train
// DeleteSite implements Storage.DeleteSite by deleting just the cert from // disk. If it is not present, an instance of ErrNotExist is returned.
{ "resource": "" }
c30347
train
// LoadUser implements Storage.LoadUser by loading it from disk. If it is not // present, an instance of ErrNotExist is returned.
{ "resource": "" }
c30348
train
// StoreUser implements Storage.StoreUser by writing it to disk. The base // directories needed for the file are automatically created as needed.
{ "resource": "" }
c30349
train
// TryLock attempts to get a lock for name, otherwise it returns // a Waiter value to wait until the other process is finished.
{ "resource": "" }
c30350
train
// Unlock unlocks name.
{ "resource": "" }
c30351
train
// MostRecentUserEmail implements Storage.MostRecentUserEmail by finding the // most recently written sub directory in the users' directory. It is named // after the email address. This corresponds to the most recent call to // StoreUser.
{ "resource": "" }
c30352
train
// Setup the pfipset middleware // Also loads the pfconfig resources and registers them in the pool
{ "resource": "" }
c30353
train
// resourceExists returns true if the file specified at // root + path exists; false otherwise.
{ "resource": "" }
c30354
train
// Refresh the FirewallsContainer struct // Will first check if the IDs have changed in pfconfig and reload if they did // Then it will check if all the IDs in pfconfig are loaded and valid and reload otherwise
{ "resource": "" }
c30355
train
// Get the pfconfig socket path depending on whether or not we're in testing // Since the environment is not bound to change at runtime, the socket path is computed once and cached in pfconfigSocketPathCache // If the socket should be re-computed, empty out pfconfigSocketPathCache and run this function
{ "resource": "" }
c30356
train
// Get the payload to send to pfconfig based on the Query attributes // Also sets the payload attribute at the same time
{ "resource": "" }
c30357
train
// Get a string identifier of the query
{ "resource": "" }
c30358
train
// Connect to the pfconfig socket // If it fails to connect, it will try it every second up to the time defined in SocketTimeout // After SocketTimeout is reached, this will panic
{ "resource": "" }
c30359
train
// Fetch data from the pfconfig socket for a string payload // Returns the bytes received from the socket
{ "resource": "" }
c30360
train
// Lookup the pfconfig metadata for a specific field // If there is a non-zero value in the field, it will be taken // Otherwise it will take the value in the val tag of the field
{ "resource": "" }
c30361
train
// Decode the struct from bytes given an encoding // For now only JSON is supported
{ "resource": "" }
c30362
train
// Decode an array of bytes representing a json string into interface // Panics if there is an error decoding the JSON data
{ "resource": "" }
c30363
train
// Fetch and decode from the socket but only if the PfconfigObject is not valid anymore
{ "resource": "" }
c30364
train
// Fetch the keys of a namespace
{ "resource": "" }
c30365
train
// Fetch and decode a namespace from pfconfig given a pfconfig compatible struct // This will fetch the json representation from pfconfig and decode it into o // o must be a pointer to the struct as this should be used by reference
{ "resource": "" }
c30366
train
// AAAA returns AAAA records from Backend or an error.
{ "resource": "" }
c30367
train
// MX returns MX records from the Backend. If the Target is not a name but an IP address, a name is created on the fly.
{ "resource": "" }
c30368
train
// CNAME returns CNAME records from the backend or an error.
{ "resource": "" }
c30369
train
// BackendError writes an error response to the client.
{ "resource": "" }
c30370
train
// hostnameToIP converts the hostname back to an ip, based on the template // returns nil if there is no IP found.
{ "resource": "" }
c30371
train
// ipToHostname converts an IP to an DNS compatible hostname and injects it into the template.domain.
{ "resource": "" }
c30372
train
// Ok returns the global health status of all plugin configured in this server.
{ "resource": "" }
c30373
train
// SetOk sets the global health status of all plugin configured in this server.
{ "resource": "" }
c30374
train
// poll polls all healthers and sets the global state.
{ "resource": "" }
c30375
train
// NewLookupWithOption process creates a simple round robin forward with potentially forced proto for upstream.
{ "resource": "" }
c30376
train
// Lookup will use name and type to forge a new message and will send that upstream. It will // set any EDNS0 options correctly so that downstream will be able to process the reply.
{ "resource": "" }
c30377
train
// Forward forward the request in state as-is. Unlike Lookup that adds EDNS0 suffix to the message.
{ "resource": "" }
c30378
train
// Write ignores the call if the response should be redirected to an internal // location.
{ "resource": "" }
c30379
train
// Set sets key to value in the replacements map.
{ "resource": "" }
c30380
train
// Create a new Pool with a 1 second refresh timeout and initialize the lock
{ "resource": "" }
c30381
train
// Acquire a read lock on the pool // All the goroutines that use resources from the pool should call this and release it when they are done // Long running processes should aim to retain this lock for the smallest time possible since Refresh will need a RW lock to refresh the resources // This lock can be acquired mul...
{ "resource": "" }
c30382
train
// Unlock the read lock
{ "resource": "" }
c30383
train
// Add a refreshable resource to the pool // Requires the RW lock and will not timeout like Refresh does
{ "resource": "" }
c30384
train
// Add a struct to the pool // Requires the RW lock and will not timeout like Refresh does
{ "resource": "" }
c30385
train
// Refresh all the refreshables of the pool
{ "resource": "" }
c30386
train
// Refresh a struct // If this struct is a PfconfigObject, it will be sent directly to FetchDecodeSocketCache // Otherwise, the struct fields and sub-fields will be analyzed to find all the PfconfigObjects and these will be sent to FetchDecodeSocketCache
{ "resource": "" }
c30387
train
// Refresh all the structs of the pool
{ "resource": "" }
c30388
train
// Attempts to obtain a RW lock with the timeout set in RefreshLockTimeout // Even if the timeout gets reached, the lock will still be acquired when available but it will be immediately released // This is done by sending a message twice in the timeoutChan, one will be caught by the main waiting goroutine, the other on...
{ "resource": "" }
c30389
train
// Refresh all the structs and resources of the pool using the RW lock // An attempt to get the RW lock will be done for up to RefreshLockTimeout
{ "resource": "" }
c30390
train
// Match satisfies httpserver.Config. // // Though ComplexRule embeds a RequestMatcher, additional // checks are needed which requires a custom implementation.
{ "resource": "" }
c30391
train
// Typify classifies a message, it returns the Type.
{ "resource": "" }
c30392
train
// HasListenerWithAddress returns whether this package is // tracking a server using a listener with the address // addr.
{ "resource": "" }
c30393
train
// ValidateAndExecuteDirectives will load the server blocks from cdyfile // by parsing it, then execute the directives configured by it and store // the resulting server blocks into inst. If justValidate is true, parse // callbacks will not be executed between directives, since the purpose // is only to check the input...
{ "resource": "" }
c30394
train
// TransferIn retrieves the zone from the masters, parses it and sets it live.
{ "resource": "" }
c30395
train
// NewResponseRecorder makes and returns a new responseRecorder, // which captures the HTTP Status code from the ResponseWriter // and also the length of the response body written through it. // Because a status is not set unless WriteHeader is called // explicitly, this constructor initializes with a status code // of...
{ "resource": "" }
c30396
train
// Flush implements http.Flusher. It simply wraps the underlying // ResponseWriter's Flush method if there is one, or does nothing.
{ "resource": "" }
c30397
train
// setup configures a new Markdown middleware instance.
{ "resource": "" }
c30398
train
// HostQualifies returns true if the hostname alone // appears eligible for automatic HTTPS. For example, // localhost, empty hostname, and IP addresses are // not eligible because we cannot obtain certificates // for those names.
{ "resource": "" }
c30399
train
// saveCertResource saves the certificate resource to disk. This // includes the certificate file itself, the private key, and the // metadata file.
{ "resource": "" }