Documentation ¶
Overview ¶
Package view provides most common-use ghost.View implementations for developers.
Index ¶
- Variables
- func AsJson(v interface{}) (view ghost.View, err error)
- func FromFile(f *os.File) (v ghost.View, err error)
- type Binary
- type GenericView
- func (gv *GenericView) AddHeader(name, value string) *GenericView
- func (gv *GenericView) BeforeSendHeader(h http.Header)
- func (gv *GenericView) Body() io.Reader
- func (gv *GenericView) BodySize(size int64) *GenericView
- func (gv *GenericView) CacheDisable() *GenericView
- func (gv *GenericView) CachePrivate(age time.Duration) *GenericView
- func (gv *GenericView) CachePublic(age time.Duration) *GenericView
- func (gv *GenericView) Download(mode string, filename string) *GenericView
- func (gv *GenericView) MediaType(t string) *GenericView
- func (gv *GenericView) Status() int
- type Html
- type Json
- type Text
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoContent ghost.View = statusView(http.StatusNoContent) NotModified ghost.View = statusView(http.StatusNotModified) )
Functions ¶
Types ¶
type GenericView ¶
type GenericView struct {
// contains filtered or unexported fields
}
func Generic ¶
func Generic(status int, body io.Reader) *GenericView
Generic returns a GenericView, which has a lot of methods to setup the response headers.
func (*GenericView) AddHeader ¶
func (gv *GenericView) AddHeader(name, value string) *GenericView
func (*GenericView) BeforeSendHeader ¶ added in v0.0.2
func (gv *GenericView) BeforeSendHeader(h http.Header)
func (*GenericView) Body ¶
func (gv *GenericView) Body() io.Reader
func (*GenericView) BodySize ¶ added in v0.0.2
func (gv *GenericView) BodySize(size int64) *GenericView
func (*GenericView) CacheDisable ¶ added in v0.0.2
func (gv *GenericView) CacheDisable() *GenericView
func (*GenericView) CachePrivate ¶ added in v0.0.2
func (gv *GenericView) CachePrivate(age time.Duration) *GenericView
func (*GenericView) CachePublic ¶ added in v0.0.2
func (gv *GenericView) CachePublic(age time.Duration) *GenericView
func (*GenericView) Download ¶ added in v0.0.2
func (gv *GenericView) Download(mode string, filename string) *GenericView
func (*GenericView) MediaType ¶ added in v0.0.2
func (gv *GenericView) MediaType(t string) *GenericView
func (*GenericView) Status ¶
func (gv *GenericView) Status() int
Click to show internal directories.
Click to hide internal directories.