_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c167800
validation
// CookieBytes returns cookie for the given key.
{ "resource": "" }
c167801
validation
// Cookie fills cookie for the given cookie.Key. // // Returns false if cookie with the given cookie.Key is missing.
{ "resource": "" }
c167802
validation
// Read reads request header from r. // // io.EOF is returned if r is closed before reading the first header byte.
{ "resource": "" }
c167803
validation
// Header returns response header representation. // // The returned value is valid until the next call to ResponseHeader methods.
{ "resource": "" }
c167804
validation
// AppendBytes appends response header representation to dst and returns // the extended dst.
{ "resource": "" }
c167805
validation
// Write writes request header to w.
{ "resource": "" }
c167806
validation
// WriteTo writes request header to w. // // WriteTo implements io.WriterTo interface.
{ "resource": "" }
c167807
validation
// Header returns request header representation. // // The returned representation is valid until the next call to RequestHeader methods.
{ "resource": "" }
c167808
validation
// AppendBytes appends request header representation to dst and returns // the extended dst.
{ "resource": "" }
c167809
validation
// ServeFileUncompressed returns HTTP response containing file contents // from the given path. // // Directory contents is returned if path points to directory. // // ServeFile may be used for saving network traffic when serving files // with good compression ratio. // // See also RequestCtx.SendFile.
{ "resource": "" }
c167810
validation
// NewRequestHandler returns new request handler with the given FS settings. // // The returned handler caches requested file handles // for FS.CacheDuration. // Make sure your program has enough 'max open files' limit aka // 'ulimit -n' if FS.Root folder contains many files. // // Do not create multiple request handle...
{ "resource": "" }
c167811
validation
// FileLastModified returns last modified time for the file.
{ "resource": "" }
c167812
validation
// CopyTo copies src cookie to c.
{ "resource": "" }
c167813
validation
// SetPath sets cookie path.
{ "resource": "" }
c167814
validation
// SetPathBytes sets cookie path.
{ "resource": "" }
c167815
validation
// SetDomain sets cookie domain.
{ "resource": "" }
c167816
validation
// SetDomainBytes sets cookie domain.
{ "resource": "" }
c167817
validation
// Expire returns cookie expiration time. // // CookieExpireUnlimited is returned if cookie doesn't expire
{ "resource": "" }
c167818
validation
// SetValue sets cookie value.
{ "resource": "" }
c167819
validation
// SetValueBytes sets cookie value.
{ "resource": "" }
c167820
validation
// SetKey sets cookie name.
{ "resource": "" }
c167821
validation
// SetKeyBytes sets cookie name.
{ "resource": "" }
c167822
validation
// Reset clears the cookie.
{ "resource": "" }
c167823
validation
// AppendBytes appends cookie representation to dst and returns // the extended dst.
{ "resource": "" }
c167824
validation
// Cookie returns cookie representation. // // The returned value is valid until the next call to Cookie methods.
{ "resource": "" }
c167825
validation
// WriteTo writes cookie representation to w. // // WriteTo implements io.WriterTo interface.
{ "resource": "" }
c167826
validation
// Parse parses Set-Cookie header.
{ "resource": "" }
c167827
validation
// ParseBytes parses Set-Cookie header.
{ "resource": "" }
c167828
validation
// For Response we can not use the above function as response cookies // already contain the key= in the value.
{ "resource": "" }
c167829
validation
// AcquireTimer returns a time.Timer from the pool and updates it to // send the current time on its channel after at least timeout. // // The returned Timer may be returned to the pool with ReleaseTimer // when no longer needed. This allows reducing GC load.
{ "resource": "" }
c167830
validation
// Accept implements net.Listener's Accept. // // It is safe calling Accept from concurrently running goroutines. // // Accept returns new connection per each Dial call.
{ "resource": "" }
c167831
validation
// Close implements net.Listener's Close.
{ "resource": "" }
c167832
validation
// FileServer conveniently sets up a http.FileServer handler to serve // static files from a http.FileSystem.
{ "resource": "" }
c167833
validation
// Reset a routing context to its initial state.
{ "resource": "" }
c167834
validation
// URLParam returns the corresponding URL parameter value from the request // routing context.
{ "resource": "" }
c167835
validation
// URLParam returns the url parameter from a http.Request object.
{ "resource": "" }
c167836
validation
// URLParamFromCtx returns the url parameter from a http.Request Context.
{ "resource": "" }
c167837
validation
// Add will append a URL parameter to the end of the route param
{ "resource": "" }
c167838
validation
// ServerBaseContext wraps an http.Handler to set the request context to the // `baseCtx`.
{ "resource": "" }
c167839
validation
// GetHead automatically route undefined HEAD requests to GET handlers.
{ "resource": "" }
c167840
validation
// Ping returns pong
{ "resource": "" }
c167841
validation
// StripSlashes is a middleware that will match request paths with a trailing // slash, strip it from the path and continue routing through the mux, if a route // matches, then it will serve the handler.
{ "resource": "" }
c167842
validation
// AllowContentType enforces a whitelist of request Content-Types otherwise responds // with a 415 Unsupported Media Type status.
{ "resource": "" }
c167843
validation
// HandlerFunc builds and returns a http.Handler from the chain of middlewares, // with `h http.Handler` as the final handler.
{ "resource": "" }
c167844
validation
// chain builds a http.Handler composed of an inline middleware stack and endpoint // handler in the order they are passed.
{ "resource": "" }
c167845
validation
// NewMux returns a newly initialized Mux object that implements the Router // interface.
{ "resource": "" }
c167846
validation
// ServeHTTP is the single method of the http.Handler interface that makes // Mux interoperable with the standard library. It uses a sync.Pool to get and // reuse routing contexts for each request.
{ "resource": "" }
c167847
validation
// Use appends a middleware handler to the Mux middleware stack. // // The middleware stack for any Mux will execute before searching for a matching // route to a specific handler, which provides opportunity to respond early, // change the course of the request execution, or set request-scoped values for // the next ht...
{ "resource": "" }
c167848
validation
// Handle adds the route `pattern` that matches any http method to // execute the `handler` http.Handler.
{ "resource": "" }
c167849
validation
// HandleFunc adds the route `pattern` that matches any http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167850
validation
// Method adds the route `pattern` that matches `method` http method to // execute the `handler` http.Handler.
{ "resource": "" }
c167851
validation
// MethodFunc adds the route `pattern` that matches `method` http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167852
validation
// Connect adds the route `pattern` that matches a CONNECT http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167853
validation
// Delete adds the route `pattern` that matches a DELETE http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167854
validation
// Get adds the route `pattern` that matches a GET http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167855
validation
// Head adds the route `pattern` that matches a HEAD http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167856
validation
// Options adds the route `pattern` that matches a OPTIONS http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167857
validation
// Patch adds the route `pattern` that matches a PATCH http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167858
validation
// Post adds the route `pattern` that matches a POST http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167859
validation
// Put adds the route `pattern` that matches a PUT http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167860
validation
// Trace adds the route `pattern` that matches a TRACE http method to // execute the `handlerFn` http.HandlerFunc.
{ "resource": "" }
c167861
validation
// NotFound sets a custom http.HandlerFunc for routing paths that could // not be found. The default 404 handler is `http.NotFound`.
{ "resource": "" }
c167862
validation
// MethodNotAllowed sets a custom http.HandlerFunc for routing paths where the // method is unresolved. The default handler returns a 405 with an empty body.
{ "resource": "" }
c167863
validation
// With adds inline middlewares for an endpoint handler.
{ "resource": "" }
c167864
validation
// NotFoundHandler returns the default Mux 404 responder whenever a route // cannot be found.
{ "resource": "" }
c167865
validation
// MethodNotAllowedHandler returns the default Mux 405 responder whenever // a method cannot be resolved for a route.
{ "resource": "" }
c167866
validation
// handle registers a http.Handler in the routing tree for a particular http method // and routing pattern.
{ "resource": "" }
c167867
validation
// routeHTTP routes a http.Request through the Mux routing tree to serve // the matching handler for a particular http method.
{ "resource": "" }
c167868
validation
// Recursively update data on child routers.
{ "resource": "" }
c167869
validation
// methodNotAllowedHandler is a helper function to respond with a 405, // method not allowed.
{ "resource": "" }
c167870
validation
// RequestLogger returns a logger handler using a custom LogFormatter.
{ "resource": "" }
c167871
validation
// GetLogEntry returns the in-context LogEntry for a request.
{ "resource": "" }
c167872
validation
// WithLogEntry sets the in-context LogEntry for a request.
{ "resource": "" }
c167873
validation
// NewLogEntry creates a new LogEntry for the request.
{ "resource": "" }
c167874
validation
// Check the content encoding against a list of acceptable values.
{ "resource": "" }
c167875
validation
// Split a string in two parts, cleaning any whitespace.
{ "resource": "" }
c167876
validation
// addChild appends the new `child` node to the tree using the `pattern` as the trie key. // For a URL router like chi's, we split the static, param, regexp and wildcard segments // into different nodes. In addition, addChild will recursively call itself until every // pattern segment is added to the url pattern tree a...
{ "resource": "" }
c167877
validation
// Recursive edge traversal by checking all nodeTyp groups along the way. // It's like searching through a multi-dimensional radix trie.
{ "resource": "" }
c167878
validation
// ArticleCtx middleware is used to load an Article object from // the URL parameters passed through as the request. In case // the Article could not be found, we stop here and return a 404.
{ "resource": "" }
c167879
validation
// SearchArticles searches the Articles data for a matching article. // It's just a stub, but you get the idea.
{ "resource": "" }
c167880
validation
// CreateArticle persists the posted Article and returns it // back to the client as an acknowledgement.
{ "resource": "" }
c167881
validation
// GetArticle returns the specific Article. You'll notice it just // fetches the Article right off the context, as its understood that // if we made it this far, the Article must be on the context. In case // its not due to a bug, then it will panic, and our Recoverer will save us.
{ "resource": "" }
c167882
validation
// UpdateArticle updates an existing Article in our persistent store.
{ "resource": "" }
c167883
validation
// DeleteArticle removes an existing Article from our persistent store.
{ "resource": "" }
c167884
validation
// A completely separate router for administrator routes
{ "resource": "" }
c167885
validation
// AdminOnly middleware restricts access to just administrators.
{ "resource": "" }
c167886
validation
// paginate is a stub, but very possible to implement middleware logic // to handle the request params for handling a paginated request.
{ "resource": "" }
c167887
validation
// This is entirely optional, but I wanted to demonstrate how you could easily // add your own logic to the render.Respond method.
{ "resource": "" }
c167888
validation
// NewCompressor creates a new Compressor that will handle encoding responses. // // The level should be one of the ones defined in the flate package. // The types are the content types that are allowed to be compressed.
{ "resource": "" }
c167889
validation
// Handler returns a new middleware that will compress the response based on the // current Compressor.
{ "resource": "" }
c167890
validation
// selectEncoder returns the encoder, the name of the encoder, and a closer function.
{ "resource": "" }
c167891
validation
// DefaultCompress is a middleware that compresses response // body of predefined content types to a data format based // on Accept-Encoding request header. It uses a default // compression level. // DEPRECATED
{ "resource": "" }
c167892
validation
// Throttle is a middleware that limits number of currently processed requests // at a time.
{ "resource": "" }
c167893
validation
// ThrottleBacklog is a middleware that limits number of currently processed // requests at a time and provides a backlog for holding a finite number of // pending requests.
{ "resource": "" }
c167894
validation
// ServeHTTP is the primary throttler request handler
{ "resource": "" }
c167895
validation
// NewWrapResponseWriter wraps an http.ResponseWriter, returning a proxy that allows you to // hook into various parts of the response process.
{ "resource": "" }
c167896
validation
// Routes creates a REST router for the todos resource
{ "resource": "" }
c167897
validation
// NewAWSProvider initializes a new AWS Route53 based Provider.
{ "resource": "" }
c167898
validation
// newChanges returns a collection of Changes based on the given records and action.
{ "resource": "" }
c167899
validation
// suitableZones returns all suitable private zones and the most suitable public zone // for a given hostname and a set of zones.
{ "resource": "" }