Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-chi/chi
/ types & classes
Types & classes
60 in github.com/go-chi/chi
⨍
Functions
435
◇
Types & classes
60
↓ 1 callers
FuncType
Handler
func(w http.ResponseWriter, r *http.Request) error
_examples/custom-handler/main.go:10
↓ 1 callers
TypeAlias
Middlewares
Middlewares type is a slice of standard middleware handlers with methods to compose middleware chains and http.Handler's.
chi.go:138
↓ 1 callers
TypeAlias
methodTyp
tree.go:18
↓ 1 callers
TypeAlias
nodeTyp
tree.go:88
Struct
Article
Article is runtime object, that's not meant to be sent via REST.
_examples/versions/data/article.go:4
Struct
Article
Article presented in API version 2.
_examples/versions/presenter/v2/article.go:11
Struct
Article
Article presented in API version 2.
_examples/versions/presenter/v3/article.go:12
Struct
Article
Article presented in API version 1.
_examples/versions/presenter/v1/article.go:10
Struct
Article
Article data model. I suggest looking at https://upper.io for an easy and powerful data persistence adapter.
_examples/rest/main.go:447
Struct
ArticleRequest
ArticleRequest is the request payload for Article data model. NOTE: It's good practice to have well defined request and response payloads so you can
_examples/rest/main.go:319
Struct
ArticleResponse
ArticleResponse is the response payload for the Article data model. See NOTE above in ArticleRequest as well. In the ArticleResponse object, first a
_examples/rest/main.go:350
Struct
ChainHandler
ChainHandler is a http.Handler with support for handler composition and execution.
chain.go:24
Struct
Compressor
Compressor represents a set of encoding configurations.
middleware/compress.go:51
Struct
Context
Context is the default routing context set on the root node of a request context to track route patterns, URL parameters and an optional routing path.
context.go:45
Struct
DefaultLogFormatter
DefaultLogFormatter is a simple logger that implements a LogFormatter.
middleware/logger.go:92
FuncType
EncoderFunc
An EncoderFunc is a function that wraps the provided io.Writer with a streaming compression algorithm and returns it. In case of failure, the functio
middleware/compress.go:265
Struct
ErrResponse
NOTE: as a thought, the request and response payloads for an Article could be the same payload type, perhaps will do an example with it as well. type
_examples/rest/main.go:401
Struct
HeaderRoute
middleware/route_headers.go:110
TypeAlias
HeaderRouter
middleware/route_headers.go:46
Interface
LogEntry
LogEntry records the final log when a request completes. See defaultLogEntry for an example implementation.
middleware/logger.go:69
Interface
LogFormatter
LogFormatter initiates the beginning of a new LogEntry per request. See DefaultLogFormatter for an example implementation.
middleware/logger.go:63
Interface
LoggerInterface
LoggerInterface accepts printing to stdlib logger or compatible logger.
middleware/logger.go:87
Struct
Mux
Mux is a simple HTTP route multiplexer that parses a request path, records any URL params, and executes an end handler. It implements the http.Handler
mux.go:21
Struct
Pattern
middleware/route_headers.go:129
Struct
Route
Route describes the details of a routing handler. Handlers map key is an HTTP method
tree.go:872
Struct
RouteParams
RouteParams is a structure to track URL routing parameters efficiently.
context.go:147
Interface
Router
Router consisting of the core routing methods used by chi's Mux, using only the standard net/http.
chi.go:66
Interface
Routes
Routes interface adds two methods for router traversal, which is also used by the `docgen` subpackage to generation documentation for Routers.
chi.go:119
Struct
ThrottleOpts
ThrottleOpts represents a set of throttling options.
middleware/throttle.go:20
Struct
User
-- Data model objects and persistence mocks: -- User data model
_examples/rest/main.go:440
Struct
UserPayload
-- Request and Response payloads for the REST api. The payloads embed the data model objects an In a real-world project, it would make sense to put
_examples/rest/main.go:290
FuncType
WalkFunc
WalkFunc is the type of the function called for each method and route visited by Walk.
tree.go:879
Interface
WrapResponseWriter
WrapResponseWriter is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response process.
middleware/wrap_writer.go:48
Struct
basicWriter
basicWriter wraps a http.ResponseWriter that implements the minimal http.ResponseWriter interface.
middleware/wrap_writer.go:73
Interface
compressFlusher
middleware/compress.go:345
Struct
compressResponseWriter
middleware/compress.go:273
Struct
contextKey
contextKey is a value for use with context.WithValue. It's used as a pointer so it fits in an interface{} without allocation. This technique for defin
context.go:160
Struct
contextKey
contextKey is a value for use with context.WithValue. It's used as a pointer so it fits in an interface{} without allocation. This technique for defin
middleware/middleware.go:17
Struct
ctxKey
mux_test.go:2068
TypeAlias
ctxKeyRequestID
Key to use when setting the request ID.
middleware/request_id.go:18
Struct
defaultLogEntry
middleware/logger.go:133
Struct
endpoint
tree.go:128
TypeAlias
endpoints
endpoints is a mapping of http method constants to handlers for a given route.
tree.go:126
Struct
flushHijackWriter
flushHijackWriter ...
middleware/wrap_writer.go:168
Struct
flushWriter
flushWriter ...
middleware/wrap_writer.go:143
Struct
hijackWriter
hijackWriter ...
middleware/wrap_writer.go:156
Struct
http2FancyWriter
http2FancyWriter is a HTTP2 writer that additionally satisfies http.Flusher, and io.ReaderFrom. It exists for the common case of wrapping the http.Res
middleware/wrap_writer.go:235
Struct
httpFancyWriter
httpFancyWriter is a HTTP writer that additionally satisfies http.Flusher, http.Hijacker, and io.ReaderFrom. It exists for the common case of wrapping
middleware/wrap_writer.go:190
Interface
ioResetterWriter
Interface for types that allow resetting io.Writers.
middleware/compress.go:268
Struct
node
tree.go:97
TypeAlias
nodes
tree.go:831
Struct
prettyStack
middleware/recoverer.go:73
Struct
readerFromRecorder
readerFromRecorder is a ResponseRecorder that also satisfies io.ReaderFrom, mirroring the real net/http response writer (which implements ReadFrom and
middleware/wrap_writer_test.go:17
Struct
result
middleware/throttle_test.go:222
Struct
testLoggerWriter
middleware/logger_test.go:13
Struct
testPrintLogger
middleware/recoverer_test.go:15
Struct
throttler
throttler limits number of currently processed requests at a time.
middleware/throttle.go:137
Struct
todosResource
_examples/todos-resource/todos.go:9
Struct
token
token represents a request that is being processed.
middleware/throttle.go:134
Struct
usersResource
_examples/todos-resource/users.go:9