Documentation ¶
Index ¶
- type Builder
- func (b *Builder) WithAttachment(filename string) *Builder
- func (b *Builder) WithBody(body interface{}) *Builder
- func (b *Builder) WithCaching(etag string, duration time.Duration, callback func(*Builder))
- func (b *Builder) WithHeader(key, value string) *Builder
- func (b *Builder) WithStatus(statusCode int) *Builder
- func (b *Builder) WithoutCompression() *Builder
- func (b *Builder) Write()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder generates HTTP responses.
func New ¶
func New(w http.ResponseWriter, r *http.Request) *Builder
New creates a new response builder.
func (*Builder) WithAttachment ¶
WithAttachment forces the document to be downloaded by the web browser.
func (*Builder) WithCaching ¶
WithCaching adds caching headers to the response.
func (*Builder) WithHeader ¶
WithHeader adds the given HTTP header to the response.
func (*Builder) WithStatus ¶
WithStatus uses the given status code to build the response.
func (*Builder) WithoutCompression ¶
WithoutCompression disables HTTP compression.
Click to show internal directories.
Click to hide internal directories.