_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c181400
//Validate a password against the given requirements //Returns a boolean indicating whether the password meets the requirements. //The second argument is a string explaining why it doesn't meet the requirements, //if it doesn't. It is empty if the requirements are met.
c181401
//Generate password requirements from an existing password.
c181402
//Make sure password strength requirements make sense
c181403
//Generate a password given requirements
c181404
//Generate one password that meets the given requirements
c181405
//Generate n passwords that meet the given requirements
c181406
//append digits to string
c181407
//add punctuation characters to start and end of string
c181408
// this init function is deprecated, but I'm keeping it // around just in case it proves useful in the future.
c181409
// Param defines a parameter with the specified name.
c181410
// Parse parses parameter definitions from the map.
c181411
// Unmarshal parses the JSON payload from the command // arguments and unmarshal into a value pointed to by v.
c181412
// GetDefaultHTTPClient returns a httpClient with configured timeout
c181413
// DeviceInfo returns information about a particular device
c181414
// DevicePresence returns data about presence of a data
c181415
// NotificationStatus returns status of a particular notification
c181416
// DeleteNotification deletes a created notification
c181417
// NotifyDevice sends notification data to devices
c181418
// Simple assert call for unit and functional tests
c181419
// We could use Fallocate, but some test CI systems // do not support it, like Travis-ci.org.
c181420
// AddError appends an error to a list of general errors.
c181421
// AddFieldError appends an error to a list of field specific errors.
c181422
// HasErrors returns weather FormErrors instance contains at leas one error.
c181423
// NewError initializes FormErrors with one general error.
c181424
// NewFieldError initializes FormErrors with one field error.
c181425
// ChainHandlers executes each function from the arguments with handler // from the next function to construct a chan fo callers.
c181426
// FinalHandler is a helper function to wrap the last http.Handler element // in the ChainHandlers function.
c181427
// Hash returns a part of a MD5 sum of a file.
c181428
// IsHash checks is provided string a valid hash.
c181429
// WithBaseDir sets the directory in which template files // are stored.
c181430
// WithFileFindFunc sets the function that will return the // file path on disk based on filename provided from files // defind using WithTemplateFromFile or WithTemplateFromFiles.
c181431
// WithTemplateFromFiles adds a template parsed from files.
c181432
// WithTemplatesFromFiles adds a map of templates parsed from files.
c181433
// WithTemplateFromStrings adds a template parsed from string.
c181434
// WithTemplatesFromStrings adds a map of templates parsed from strings.
c181435
// WithFunction adds a function to templates.
c181436
// WithFunctions adds function map to templates.
c181437
// WithDelims sets the delimiters used in templates.
c181438
// New creates a new instance of Templates and parses // provided files and strings.
c181439
// RespondWithStatus executes a template with provided data into buffer, // then writes the the status and body to the response writer. // A panic will be raised if the template does not exist or fails to execute.
c181440
// RespondTemplate executes a named template with provided data into buffer, // then writes the the body to the response writer. // A panic will be raised if the template does not exist or fails to execute.
c181441
// Respond executes template with provided data into buffer, // then writes the the body to the response writer. // A panic will be raised if the template does not exist or fails to execute.
c181442
// RenderTemplate executes a named template and returns the string.
c181443
// New creates a new instance of Server.
c181444
// ServeUDP serves requests over UDP connection.
c181445
// Shutdown calls h2quic.Server.Close method.
c181446
// QuicHeadersHandler should be used as a middleware to set // quic related headers to TCP server that suggest alternative svc.
c181447
// GetRequestIPs returns all possible IPs found in HTTP request.
c181448
// DomainRedirectHandler responds with redirect url based on // domain and httpsPort, othervise it executes the handler.
c181449
// New creates a new instance of Servers with applied options.
c181450
// Add adds a new server instance by a custom name and with // address to listen to.
c181451
// TCPAddr returns a TCP address of the listener that a server // with a specific name is using. If there are more servers // with the same name, the address of the first started server // is returned.
c181452
// UDPAddr returns a UDP address of the listener that a server // with a specific name is using. If there are more servers // with the same name, the address of the first started server // is returned.
c181453
// Close stops all servers, by calling Close method on each of them.
c181454
// Shutdown gracefully stops all servers, by calling Shutdown method on each of them.
c181455
// Accept accepts TCP connection, sets keep alive and checks if a client // requested an encrypted connection.
c181456
// NewStaticFilesHandler serves a file under specified filesystem if it // can be opened, otherwise it serves HTTP from a specified handler.
c181457
// ServeHTTP serves an HTTP response for a request.
c181458
// MarshalJSON implements of json.Marshaler interface. // It marshals string representations of time.Duration.
c181459
// UnmarshalJSON implements json.Unamrshaler interface. // It parses time.Duration as strings.
c181460
// MarshalYAML implements of yaml.Marshaler interface. // It marshals string representations of time.Duration.
c181461
// UnmarshalYAML implements yaml.Unamrshaler interface. // It parses time.Duration as strings.
c181462
// NewHandler returns a handler that logs HTTP requests. // It logs information about remote address, X-Forwarded-For or X-Real-Ip, // HTTP method, request URI, HTTP protocol, HTTP response status, total bytes // written to http.ResponseWriter, response duration, HTTP referrer and // HTTP client user agent.
c181463
// WithPanicResponse sets a fixed body and its content type HTTP header // that will be returned as HTTP response on panic event. // If WithPanicResponseHandler is defined, this options are ignored.
c181464
// WithPanicResponseHandler sets http.Handler that will be executed on // panic event. It is useful when the response has dynamic content. // If the content is static it is better to use WithPanicResponse option // instead. This option has a precedence upon WithPanicResponse.
c181465
// New creates a new Handler from the handler that is wrapped and // protected with recover function.
c181466
// ServeHTTP implements http.Handler interface.
c181467
// NewContextFunc creates a new function that can be used to store // and access arbitrary data by keys.
c181468
// NewMapErrorRegistry creates a new instance of MapErrorRegistry.
c181469
// AddError adds a new error with a code to the registry. // It there already is an error or handler with the same code, // ErrErrorAlreadyRegistered will be returned.
c181470
// AddMessageError adds a new Error isntance with a code and message // to the registry. // It there already is an error or handler with the same code, // ErrErrorAlreadyRegistered will be returned.
c181471
// MustAddError calls AddError and panics in case of an error.
c181472
// MustAddMessageError calls AddMessageError and panics in case of an error.
c181473
// AddHandler adds a new error handler with a code to the registry. // It there already is an error or handler with the same code, // ErrErrorAlreadyRegistered will be returned.
c181474
// MustAddHandler calls AddHandler and panics in case of an error.
c181475
// Handler returns a handler that is registered under the provided code.
c181476
// New returns a new instance of Client with default values.
c181477
// Request makes a HTTP request based on Client configuration and // arguments provided.
c181478
// JSONContext provides the same functionality as JSON with Context instance passing to http.Request.
c181479
// StreamContext provides the same functionality as Stream with Context instance passing to http.Request.
c181480
// Stream makes a HTTP request and returns request body as io.ReadCloser, // to be able to read long running responses. Returned io.ReadCloser must be // closed at the end of read. To reuse HTTP connection, make sure that the // whole data is read before closing the reader.
c181481
// JSONUnmarshal decodes data into v and returns json.SyntaxError and // json.UnmarshalTypeError formated with additional information.
c181482
// ServeTCP executes http.Server.Serve method. // If the provided listener is net.TCPListener, keep alive // will be enabled. If server is configured with TLS, // a tls.Listener will be created with provided listener.
c181483
// ServeTCP serves request on TCP listener.
c181484
// Shutdown executes grpc.Server.GracefulStop method.
c181485
// HandleMethods uses a corresponding Handler based on HTTP request method. // If Handler is not found, a method not allowed HTTP response is returned // with specified body and Content-Type header.
c181486
// NewSetHeadersHandler sets provied headers on HTTP response.
c181487
// New initializes a new instance of Server.
c181488
// HashedPath returns a URL path with hash injected into the filename.
c181489
// New creates a new instance of Handler. // The first argument is the handler that will be executed // when maintenance mode is off.
c181490
// HTMLHandler is a HTTP middleware that should be used // alongide HTML pages.
c181491
// Status returns whether the maintenance mode is enabled.
c181492
// StatusHandler can be used in JSON-encoded HTTP API // to check the status of maintenance.
c181493
// OnHandler can be used in JSON-encoded HTTP API to enable maintenance. // It returns HTTP Status Created if the maintenance is enabled. // If the maintenance is already enabled, it returns HTTP Status OK.
c181494
// OffHandler can be used in JSON-encoded HTTP API to disable maintenance.
c181495
// MarshalJSON calls json.RawMessage method of the same name. Required since // PostIRCMessageRequest is of type json.RawMessage...
c181496
// MarshalJSON calls json.RawMessage method of the same name. Required since // PostArtifactRequest is of type json.RawMessage...
c181497
// MarshalJSON calls json.RawMessage method of the same name. Required since // PostArtifactResponse is of type json.RawMessage...
c181498
// MarshalJSON calls json.RawMessage method of the same name. Required since // HookChangedMessage is of type json.RawMessage...
c181499
// MarshalJSON calls json.RawMessage method of the same name. Required since // TriggerHookRequest is of type json.RawMessage...