Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-chi/chi
/ types & classes
Types & classes
57 in github.com/go-chi/chi
⨍
Functions
372
◇
Types & classes
57
↓ 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:134
↓ 1 callers
TypeAlias
methodTyp
tree.go:16
↓ 1 callers
TypeAlias
nodeTyp
tree.go:77
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:47
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:256
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:109
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:128
Struct
Route
Route describes the details of a routing handler. Handlers map key is an HTTP method
tree.go:843
Struct
RouteParams
RouteParams is a structure to track URL routing parameters efficiently.
context.go:143
Interface
Router
Router consisting of the core routing methods used by chi's Mux, using only the standard net/http.
chi.go:67
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:850
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:49
Struct
basicWriter
basicWriter wraps a http.ResponseWriter that implements the minimal http.ResponseWriter interface.
middleware/wrap_writer.go:74
Interface
compressFlusher
middleware/compress.go:339
Struct
compressResponseWriter
middleware/compress.go:264
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:156
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:1875
TypeAlias
ctxKeyRequestID
Key to use when setting the request ID.
middleware/request_id.go:18
Struct
defaultLogEntry
middleware/logger.go:127
Struct
endpoint
tree.go:117
TypeAlias
endpoints
endpoints is a mapping of http method constants to handlers for a given route.
tree.go:115
Struct
flushHijackWriter
flushHijackWriter ...
middleware/wrap_writer.go:165
Struct
flushWriter
flushWriter ...
middleware/wrap_writer.go:140
Struct
hijackWriter
hijackWriter ...
middleware/wrap_writer.go:153
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:228
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:187
Interface
ioResetterWriter
Interface for types that allow resetting io.Writers.
middleware/compress.go:259
Struct
node
tree.go:86
TypeAlias
nodes
tree.go:802
Struct
prettyStack
middleware/recoverer.go:66
Struct
testLoggerWriter
middleware/logger_test.go:13
Struct
throttler
throttler limits number of currently processed requests at a time.
middleware/throttle.go:119
Struct
todosResource
_examples/todos-resource/todos.go:9
Struct
token
token represents a request that is being processed.
middleware/throttle.go:116
Struct
usersResource
_examples/todos-resource/users.go:9