Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeETag(r io.Reader) string
- func ComputeETagWith(r io.Reader, h hash.Hash) string
- func WriteIfNoneMatch(w http.ResponseWriter, r *http.Request) bool
- type App
- func (app *App) Close()
- func (app *App) Delete(pattern string, hf HandleFunc, opts ...RoutingOption)
- func (app *App) Get(pattern string, hf HandleFunc, opts ...RoutingOption)
- func (app *App) Group(prefix string) Router
- func (app *App) HandleFile(name string, v *FileViewer)
- func (app *App) HandleFunc(pattern string, hf HandleFunc, opts ...RoutingOption)
- func (app *App) HandlePage(pattern string, viewName string, v Viewer)
- func (app *App) Next(hf HandleFunc) HandleFunc
- func (app *App) Post(pattern string, hf HandleFunc, opts ...RoutingOption)
- func (app *App) Put(pattern string, hf HandleFunc, opts ...RoutingOption)
- func (app *App) Start()
- func (app *App) Use(middleware ...Middleware)
- type BufferPool
- type Compressor
- type Context
- func (c *Context) Accept() (types []MimeType)
- func (c *Context) AcceptLanguage() (languages []string)
- func (c *Context) Get(key string) any
- func (c *Context) Redirect(url string, statusCode ...int)
- func (c *Context) RequestReferer() string
- func (c *Context) Set(key string, value any)
- func (c *Context) View(data any, options ...string) error
- func (c *Context) WriteHeader(key string, value string)
- func (c *Context) WriteStatus(code int)
- type Decoder
- type DeflateCompressor
- type Encoder
- type FileViewer
- type GzipCompressor
- type HandleFunc
- type Handler
- type HtmlTemplate
- type HtmlViewEngine
- type HtmlViewer
- type Interceptor
- type JsonEncoding
- type JsonViewer
- type Middleware
- type MimeType
- type Option
- func WithBuildAssetURL(match func(string) bool) Option
- func WithCompressor(c ...Compressor) Option
- func WithFsys(fsys fs.FS) Option
- func WithHandlerViewers(v ...Viewer) Option
- func WithInterceptor(i Interceptor) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMux(mux *http.ServeMux) Option
- func WithTemplateFunc(name string, fn any) Option
- func WithTemplateFuncMap(fm template.FuncMap) Option
- func WithViewEngines(ve ...ViewEngine) Option
- func WithWatch() Option
- type ResponseWriter
- type Router
- type Routing
- type RoutingOption
- type RoutingOptions
- type StaticViewEngine
- type StringViewer
- type TempData
- type TextTemplate
- type TextViewEngine
- type TextViewer
- type ViewEngine
- type ViewModel
- type Viewer
- type XmlViewer
Constants ¶
const ( )
Variables ¶
var ( ErrCancelled = errors.New("xun: request_cancelled") ErrViewNotFound = errors.New("xun: view_not_found") )
var StringViewerMime = &MimeType{Type: "text", SubType: "plain"}
var XmlViewerMime = &MimeType{Type: "text", SubType: "xml"}
Functions ¶
func ComputeETag ¶ added in v1.1.3
ComputeETag returns the ETag header value for the given reader content.
The value is computed by taking the crc32 of the content and encoding it as a hexadecimal string.
func ComputeETagWith ¶ added in v1.1.3
ComputeETagWith returns the ETag header value for the given reader content using the provided hash function.
func WriteIfNoneMatch ¶ added in v1.1.3
func WriteIfNoneMatch(w http.ResponseWriter, r *http.Request) bool
Types ¶
type App ¶
App is the main struct of the framework.
It is used to register routes, middleware, and view engines.
The application instance is initialized with a new http.ServeMux, and a handler that serves files from the current working directory is registered.
The application instance is ready to be used with the standard http.Server type.
func New ¶
New allocates an App instance and loads all view engines.
All view engines are loaded from root directory of given fs.FS. If watch is true, it will watch all file changes and reload all view engines if any files are changed. If watch is false, it won't watch any file changes.
func (*App) Close ¶
func (app *App) Close()
Close safely locks the App instance, ensuring that no other goroutines can access it until the lock is released. This method should be called when the App instance is no longer needed to prevent any further operations on it.
func (*App) Delete ¶
func (app *App) Delete(pattern string, hf HandleFunc, opts ...RoutingOption)
Delete registers a route handler for the given HTTP DELETE request pattern.
func (*App) Get ¶
func (app *App) Get(pattern string, hf HandleFunc, opts ...RoutingOption)
Get registers a route handler for the given HTTP GET request pattern.
func (*App) Group ¶
Group creates a new router group with the specified prefix. It returns a Router interface that can be used to define routes within the group.
func (*App) HandleFile ¶
func (app *App) HandleFile(name string, v *FileViewer)
HandleFile registers a route handler for serving a file.
This function associates a FileViewer with a given file name and registers the route in the application's routing table. If a route with the same pattern already exists, it returns immediately without making any changes.
func (*App) HandleFunc ¶
func (app *App) HandleFunc(pattern string, hf HandleFunc, opts ...RoutingOption)
HandleFunc registers a route handler for the given HTTP request pattern.
The pattern is expected to be in the format "METHOD PATTERN", where METHOD is the HTTP method (e.g. "GET", "POST", etc.) and PATTERN is the URL path pattern.
The opts parameter is a list of RoutingOption functions that can be used to customize the route. See the RoutingOption type for more information.
func (*App) HandlePage ¶
HandlePage registers a route handler for a page view.
This function associates a Viewer with a given route pattern and registers the route in the application's routing table. If a route with the same pattern already exists, it updates the existing route with the new Viewer.
func (*App) Next ¶
func (app *App) Next(hf HandleFunc) HandleFunc
Next applies the middlewares in the app to the given HandleFunc in reverse order. It returns the final HandleFunc after all middlewares have been applied.
func (*App) Post ¶
func (app *App) Post(pattern string, hf HandleFunc, opts ...RoutingOption)
Post registers a route handler for the given HTTP POST request pattern.
func (*App) Put ¶
func (app *App) Put(pattern string, hf HandleFunc, opts ...RoutingOption)
Put registers a route handler for the given HTTP PUT request pattern.
func (*App) Start ¶
func (app *App) Start()
Start initializes and starts the application by locking the mutex, iterating through the routes, and logging the pattern and viewers for each route. It ensures thread safety by using a mutex lock.
func (*App) Use ¶
func (app *App) Use(middleware ...Middleware)
Use registers one or more Middleware functions to be executed before any route handler. Middleware functions are useful for creating reusable pieces of code that can be composed together to create complex behavior. For example, a middleware function might be used to log each request, or to check if a user is authenticated before allowing access to a page.
The order of middleware functions matters. The first middleware function that is registered will be executed first, and the last middleware function that is registered will be executed last.
Middleware functions are executed in the order they are registered.
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool is a pool of *bytes.Buffer for reuse to reduce memory alloc.
var BufPool *BufferPool
BufPool is a pool of *bytes.Buffer for reuse to reduce memory alloc.
It is used by the Viewer to render the content. The pool is created with a size of 100, but you can change it by setting the BufPool variable before creating any Viewer instances.
func NewBufferPool ¶
func NewBufferPool(size int) (bp *BufferPool)
NewBufferPool returns a new BufferPool with the given size.
The size determines how many buffers can be stored in the pool. If the pool is full and a new buffer is requested, a new buffer will be created.
func (*BufferPool) Get ¶
func (bp *BufferPool) Get() (b *bytes.Buffer)
Get retrieves a buffer from the pool or creates a new one if the pool is empty.
If a buffer is available in the pool, it is returned for reuse, reducing memory allocations. If the pool is empty, a new buffer is created and returned.
func (*BufferPool) Put ¶
func (bp *BufferPool) Put(b *bytes.Buffer)
Put returns a buffer to the pool for reuse or discards if the pool is full.
This function resets the buffer to clear any existing data before returning it to the pool. If the pool is already full, the buffer is discarded.
type Compressor ¶ added in v1.0.4
type Compressor interface {
AcceptEncoding() string
New(rw http.ResponseWriter) ResponseWriter
}
Compressor is an interface that defines methods for handling HTTP response compression. Implementations of this interface should provide the specific encoding type they support and a method to create a new ResponseWriter that applies the compression.
AcceptEncoding returns the encoding type that the compressor supports.
New takes an http.ResponseWriter and returns a ResponseWriter that applies the compression.
type Context ¶
type Context struct {
Routing Routing
App *App
Response ResponseWriter
Request *http.Request
TempData TempData
}
Context is the primary structure for handling HTTP requests. It encapsulates the request, response, routing information, and application context. It offers various methods to work with request data, manipulate responses, and manage routing.
func (*Context) Accept ¶
Accept returns a slice of strings representing the media types that the client accepts, in order of preference. The media types are normalized to lowercase and whitespace is trimmed.
func (*Context) AcceptLanguage ¶
AcceptLanguage returns a slice of strings representing the languages that the client accepts, in order of preference. The languages are normalized to lowercase and whitespace is trimmed.
func (*Context) Redirect ¶
Redirect redirects the user to the given url. It uses the given status code. If the status code is not provided, it uses http.StatusFound (302).
func (*Context) RequestReferer ¶
RequestReferer returns the referer of the request.
func (*Context) View ¶
View renders the specified data as a response to the client. It can be used to render HTML, JSON, XML, or any other type of response.
The first argument is the data to be rendered. The second argument is an optional list of viewer names. If the list is empty, the viewer associated with the current route will be used. If the list is not empty, the first viewer in the list that matches the current request will be used.
func (*Context) WriteHeader ¶
WriteHeader sets a response header.
If the value is an empty string, the header will be deleted.
func (*Context) WriteStatus ¶
WriteStatus sets the HTTP status code for the response. It is used to return error or success status codes to the client. The status code will be sent to the client only once the response body is closed. If a status code is not set, the default status code is 200 (OK).
type DeflateCompressor ¶ added in v1.0.4
type DeflateCompressor struct {
}
DeflateCompressor is a struct that provides functionality for compressing data using the DEFLATE algorithm.
func (*DeflateCompressor) AcceptEncoding ¶ added in v1.0.4
func (c *DeflateCompressor) AcceptEncoding() string
AcceptEncoding returns the encoding type that the DeflateCompressor supports. In this case, it returns the string "deflate".
func (*DeflateCompressor) New ¶ added in v1.0.4
func (c *DeflateCompressor) New(rw http.ResponseWriter) ResponseWriter
New creates a new deflateResponseWriter that wraps the provided http.ResponseWriter. It sets the "Content-Encoding" header to "deflate" and initializes a flate.Writer with the default compression level.
type FileViewer ¶
type FileViewer struct {
// contains filtered or unexported fields
}
FileViewer is a viewer that serves a file from a file system.
You can use it to serve a file from a file system, or to serve a file from a zip file.
The file system is specified by the `fsys` field, and the path is specified by the `path` field.
For example, to serve a file from the current working directory, you can use the following code:
viewer := &FileViewer{
fsys: os.DirFS("."),
path: "example.txt",
}
app.HandleFile("example.txt", viewer)
func NewFileViewer ¶ added in v1.0.7
NewFileViewer creates a new FileViewer instance.
func (*FileViewer) MimeType ¶
func (*FileViewer) MimeType() *MimeType
MimeType returns the MIME type of the file.
The MIME type is determined by the file extension of the file.
type GzipCompressor ¶ added in v1.0.4
type GzipCompressor struct {
}
GzipCompressor is a struct that provides methods for compressing and decompressing data using the Gzip algorithm.
func (*GzipCompressor) AcceptEncoding ¶ added in v1.0.4
func (c *GzipCompressor) AcceptEncoding() string
AcceptEncoding returns the encoding type that the GzipCompressor supports. In this case, it returns "gzip".
func (*GzipCompressor) New ¶ added in v1.0.4
func (c *GzipCompressor) New(rw http.ResponseWriter) ResponseWriter
New creates a new gzipResponseWriter that wraps the provided http.ResponseWriter. It sets the "Content-Encoding" header to "gzip" and returns the wrapped writer.
type HandleFunc ¶
HandleFunc defines a function type that takes a Context pointer as an argument and returns an error. It is used to handle requests within the application.
type Handler ¶
type Handler struct {
Viewers []Viewer
Pattern string // original string
Method string
Host string
}
Handler represents an HTTP handler.
type HtmlTemplate ¶
type HtmlTemplate struct {
// contains filtered or unexported fields
}
HtmlTemplate is a template that is loaded from a file system.
func NewHtmlTemplate ¶
func NewHtmlTemplate(name, path string) *HtmlTemplate
NewHtmlTemplate creates a new HtmlTemplate with the given name and path.
func (*HtmlTemplate) Execute ¶
func (t *HtmlTemplate) Execute(wr io.Writer, data any) error
Execute renders the template with the given data and writes the result to the provided writer.
If the template has a layout, it uses the layout to render the data. Otherwise, it renders the data using the template itself.
func (*HtmlTemplate) Load ¶
func (t *HtmlTemplate) Load(fsys fs.FS, templates map[string]*HtmlTemplate, fm template.FuncMap) error
Load loads the template from the given file system.
It parses the file, and determines the dependencies of the template. The dependencies are stored in the `dependencies` field.
func (*HtmlTemplate) Reload ¶
func (t *HtmlTemplate) Reload(fsys fs.FS, templates map[string]*HtmlTemplate, fm template.FuncMap) error
Reload reloads the template and all its dependents from the given file system.
It first reloads the current template and then recursively reloads all its dependents. If a dependency does not exist, it is removed from the list of dependents.
type HtmlViewEngine ¶
type HtmlViewEngine struct {
// contains filtered or unexported fields
}
HtmlViewEngine is a view engine that loads templates from a file system.
It supports 2 types of templates:
- Components: These are templates that are loaded from the "components" directory.
- Pages: These are templates that are loaded from the "layouts/views/pages/" directory.
Components are used to build up larger templates, while pages are used to render the final HTML that is sent to the client.
func (*HtmlViewEngine) FileChanged ¶
FileChanged is called when a file has been changed.
It is used to reload templates when they have been changed.
type HtmlViewer ¶
type HtmlViewer struct {
// contains filtered or unexported fields
}
HtmlViewer is a viewer that renders a html template.
It uses the `HtmlTemplate` type to render a template. The template is loaded from the file system when the viewer is created. The `Render` method renders the template with the given data and writes the result to the http.ResponseWriter.
func (*HtmlViewer) MimeType ¶
func (*HtmlViewer) MimeType() *MimeType
MimeType returns the MIME type of the HTML content.
This implementation returns "text/html".
func (*HtmlViewer) Render ¶
func (v *HtmlViewer) Render(ctx *Context, data any) error
Render renders the template with the given data and writes the result to the http.ResponseWriter.
This implementation uses the `HtmlTemplate.Execute` method to render the template. The rendered result is written to the http.ResponseWriter.
type Interceptor ¶
type Interceptor interface {
// RequestReferer returns the referer of the request.
RequestReferer(c *Context) string
// Redirect sends an HTTP redirect to the client.
Redirect(c *Context, url string, statusCode ...int) bool
}
Interceptor is an interface that provides methods to intercept requests and response.
type JsonEncoding ¶ added in v1.1.3
type JsonEncoding interface {
NewEncoder(writer io.Writer) Encoder
NewDecoder(reader io.Reader) Decoder
}
JsonEncoding is the interface that defines the methods that the standard library encoding/json package provides.
var Json JsonEncoding = &stdJsonEncoding{}
type JsonViewer ¶
type JsonViewer struct {
}
JsonViewer is a viewer that writes the given data as JSON to the http.ResponseWriter.
It sets the Content-Type header to "application/json".
func (*JsonViewer) MimeType ¶
func (*JsonViewer) MimeType() *MimeType
MimeType returns the MIME type of the JSON content.
It returns "application/json".
type Middleware ¶
type Middleware func(next HandleFunc) HandleFunc
Middleware is a function type that takes a HandleFunc as an argument and returns a HandleFunc. It is used to wrap or decorate an existing HandleFunc with additional functionality.
type MimeType ¶ added in v1.0.6
func NewMimeType ¶ added in v1.0.6
type Option ¶
type Option func(*App)
Option is a function that takes a pointer to an App and modifies it. It is used to configure an App when calling the New function.
func WithBuildAssetURL ¶ added in v1.1.4
WithBuildAssetURL adds a matcher function for identifying assets that need URL processing.
func WithCompressor ¶ added in v1.0.4
func WithCompressor(c ...Compressor) Option
WithCompressor is an option function that sets the compressors for the application. It takes a variadic parameter of Compressor type and assigns it to the app's compressors field.
Parameters:
c ...Compressor - A variadic list of Compressor instances to be used by the application.
Returns:
Option - A function that takes an App pointer and sets its compressors field.
func WithHandlerViewers ¶ added in v1.0.6
WithHandlerViewers sets the Viewer for a route handler. If not set, it will use JsonViewer.
func WithInterceptor ¶
func WithInterceptor(i Interceptor) Option
WithInterceptor returns an Option that sets the provided Interceptor to the App. This allows customization of the App's behavior by intercepting and potentially modifying requests or responses.
Parameters:
- i: An Interceptor instance to be set in the App.
Returns:
- Option: A function that takes an App pointer and sets its interceptor to the provided Interceptor.
func WithLogger ¶
WithLogger sets the logger for the App. If not set, it will use slog.Default()
func WithMux ¶
WithMux sets the http.ServeMux for the App. If not set, it will use http.DefaultServeMux.
func WithTemplateFunc ¶ added in v1.1.4
WithTemplateFunc adds a custom template function to the application's function map.
func WithTemplateFuncMap ¶ added in v1.1.4
WithTemplateFuncMap adds multiple template functions from the provided map.
func WithViewEngines ¶
func WithViewEngines(ve ...ViewEngine) Option
WithViewEngines sets the ViewEngines for the App. If not set, it will use the default ViewEngines.
type ResponseWriter ¶ added in v1.0.4
type ResponseWriter interface {
http.ResponseWriter
BodyBytesSent() int
StatusCode() int
Close()
}
ResponseWriter is an interface that extends the standard http.ResponseWriter interface with an additional Close method. It is used to write HTTP responses and perform any necessary cleanup or finalization when the response is complete.
func NewResponseWriter ¶ added in v1.1.1
func NewResponseWriter(rw http.ResponseWriter) ResponseWriter
NewResponseWriter creates a new instance of ResponseWriter that wraps the provided http.ResponseWriter. It returns a pointer to a stdResponseWriter, which implements the ResponseWriter interface.
type Router ¶
type Router interface {
Get(pattern string, h HandleFunc, opts ...RoutingOption)
Post(pattern string, h HandleFunc, opts ...RoutingOption)
Put(pattern string, h HandleFunc, opts ...RoutingOption)
Delete(pattern string, h HandleFunc, opts ...RoutingOption)
HandleFunc(pattern string, h HandleFunc, opts ...RoutingOption)
Use(middlewares ...Middleware)
}
Router is the interface that wraps the minimum set of methods required for an effective router, namely methods for adding routes for different HTTP methods, a method for adding middleware, and a method for adding the router to the main app.
type Routing ¶
type Routing struct {
Pattern string
Handle HandleFunc
Options *RoutingOptions
Viewers []Viewer
// contains filtered or unexported fields
}
Routing represents a single route in the router.
type RoutingOption ¶
type RoutingOption func(*RoutingOptions)
RoutingOption is a function that takes a pointer to RoutingOptions and modifies it. It is used to customize the behavior of the router when adding routes.
func WithMetadata ¶
func WithMetadata(key string, value any) RoutingOption
WithMetadata adds a key-value pair to the routing metadata. It creates a new map if the metadata map is nil.
func WithNavigation ¶
func WithNavigation(name, icon, access string) RoutingOption
WithNavigation adds navigation-related metadata to the routing options. It sets the name, icon, and access level for the navigation element.
func WithViewer ¶
func WithViewer(v ...Viewer) RoutingOption
WithViewer sets the viewer for the routing options.
type RoutingOptions ¶
type RoutingOptions struct {
// contains filtered or unexported fields
}
RoutingOptions holds metadata and a viewer for routing configuration.
func (*RoutingOptions) Get ¶
func (ro *RoutingOptions) Get(name string) any
Get returns the value associated with the given name from the routing metadata. If the name does not exist, it returns nil.
func (*RoutingOptions) GetInt ¶
func (ro *RoutingOptions) GetInt(name string) int
GetInt returns the value associated with the given name from the routing metadata as an integer. If the name does not exist, it returns 0.
func (*RoutingOptions) GetString ¶
func (ro *RoutingOptions) GetString(name string) string
GetString returns the value associated with the given name from the routing metadata as a string. If the name does not exist, it returns an empty string.
type StaticViewEngine ¶
type StaticViewEngine struct {
// contains filtered or unexported fields
}
StaticViewEngine is a view engine that serves static files from a file system.
func (*StaticViewEngine) FileChanged ¶
FileChanged handles file changes for the given file system and updates the application accordingly. It is called by the watcher when a file is changed.
If the file changed is a Create event and the path is in the "public" directory, it will be registered with the application.
If the file changed is a Write/Remove event and the path is in the "public" directory, nothing will be done.
func (*StaticViewEngine) Load ¶
func (ve *StaticViewEngine) Load(fsys fs.FS, app *App)
Load loads all static files from the given file system and registers them with the application.
It scans the "public" directory in the given file system and registers each file with the application. It also handles file changes for the "public" directory and updates the application accordingly.
type StringViewer ¶ added in v1.0.7
type StringViewer struct {
}
StringViewer is a viewer that writes the given data as string to the http.ResponseWriter.
It sets the Content-Type header to "text/plain".
func (*StringViewer) MimeType ¶ added in v1.0.7
func (*StringViewer) MimeType() *MimeType
MimeType returns the MIME type of the string content.
It returns "text/plain".
type TextTemplate ¶ added in v1.0.5
type TextTemplate struct {
// contains filtered or unexported fields
}
TextTemplate represents a text template that can be loaded from a file system and executed with data.
func NewTextTemplate ¶ added in v1.1.2
func NewTextTemplate(t *template.Template) *TextTemplate
func (*TextTemplate) Execute ¶ added in v1.0.5
func (t *TextTemplate) Execute(wr io.Writer, data any) error
Execute executes the template with the given data and writes the result to the given writer.
type TextViewEngine ¶ added in v1.0.5
type TextViewEngine struct {
// contains filtered or unexported fields
}
TextViewEngine is a view engine that renders text-based templates. It watches the file system for changes to text files and updates the corresponding views.
func (*TextViewEngine) FileChanged ¶ added in v1.0.5
FileChanged is called when a file in the file system has changed. It checks if the change is a file creation event in the "text/" directory, and if so, calls the handle method to update the corresponding view in the app.
type TextViewer ¶ added in v1.0.5
type TextViewer struct {
// contains filtered or unexported fields
}
TextViewer is a struct that holds an TextTemplate and is used to render text content.
func NewTextViewer ¶ added in v1.1.2
func NewTextViewer(t *TextTemplate) *TextViewer
func (*TextViewer) MimeType ¶ added in v1.0.5
func (v *TextViewer) MimeType() *MimeType
MimeType returns the MIME type for the text content rendered by the TextViewer.
func (*TextViewer) Render ¶ added in v1.0.5
func (v *TextViewer) Render(ctx *Context, data any) error
Render writes the text content rendered by the TextViewer to the provided http.ResponseWriter. It sets the Content-Type header to "text/plain; charset=utf-8" and writes the rendered content to the response. If there is an error executing the template, it is returned.
type ViewEngine ¶
type ViewEngine interface {
Load(fsys fs.FS, app *App)
FileChanged(fsys fs.FS, app *App, event fsnotify.Event) error
}
ViewEngine is the interface that wraps the minimum set of methods required for an effective view engine, namely methods for loading templates from a file system and reloading templates when the file system changes.
type Viewer ¶
Viewer is the interface that wraps the minimum set of methods required for an effective viewer.
type XmlViewer ¶ added in v1.0.6
type XmlViewer struct {
}
XmlViewer is a viewer that writes the given data as xml to the http.ResponseWriter.
It sets the Content-Type header to "application/xml".
Source Files
¶
- app.go
- buffer_pool.go
- chain.go
- compressor.go
- compressor_deflate.go
- compressor_gzip.go
- context.go
- errs.go
- etag.go
- funcmap.go
- group.go
- handler.go
- interceptor.go
- json.go
- log.go
- mime.go
- option.go
- pattern.go
- response_writer.go
- response_writer_deflate.go
- response_writer_gzip.go
- response_writer_std.go
- router.go
- routing.go
- routing_option.go
- template_html.go
- template_text.go
- viewengine.go
- viewengine_html.go
- viewengine_static.go
- viewengine_text.go
- viewer.go
- viewer_file.go
- viewer_html.go
- viewer_json.go
- viewer_string.go
- viewer_text.go
- viewer_xml.go
Directories
¶
| Path | Synopsis |
|---|---|
|
ext
|
|
|
cache
Package cache provides HTTP caching middleware for xun web applications.
|
Package cache provides HTTP caching middleware for xun web applications. |
|
cookie
Package cookie provides functions for securely setting and retrieving HTTP cookies using the SecureCookie library.
|
Package cookie provides functions for securely setting and retrieving HTTP cookies using the SecureCookie library. |
|
sse
Package sse provides a server implementation for Server-Sent Events (SSE).
|
Package sse provides a server implementation for Server-Sent Events (SSE). |