Documentation ¶
Overview ¶
Package ostent is the library part of ostent cmd.
Index ¶
- Constants
- Variables
- func AddAssetPathContextFunc(path string) func(http.Handler) http.Handler
- func AddExporter(header, text string)
- func ContextParam(r *http.Request, pname string) (string, error)
- func Distrib() (string, error)
- func Fetch(keys *params.FetchKeys) error
- func FetchExtract(jdata *gabs.Container, keys []string) (*gabs.Container, interface{})
- func HandleFunc(hf http.HandlerFunc) httprouter.Handle
- func HandleThen(then func(http.Handler) http.Handler) func(http.HandlerFunc) httprouter.Handle
- func LogHandler(logRequests bool, h http.Handler) http.Handler
- func ParamsFunc(then func(http.Handler) http.Handler) func(http.HandlerFunc) httprouter.Handle
- func ServerHandler(logRequests bool, h http.Handler) http.Handler
- func UpdateLoop()
- type IndexData
- type SSE
- type ServeAssets
- type ServeIndex
- type ServeSSE
- type ServeWS
- type StaticData
- type UpgradeInfo
Constants ¶
View Source
const ( CAssetPath contextID = iota CRouterParams )
Variables ¶
View Source
var OstentUpgrade = new(UpgradeInfo)
Functions ¶
func AddAssetPathContextFunc ¶
func AddExporter ¶ added in v0.7.0
func AddExporter(header, text string)
func ContextParam ¶ added in v0.7.0
ContextParam is to retrieve pname param from context params.
func FetchExtract ¶ added in v0.6.1
func HandleFunc ¶ added in v0.6.2
func HandleFunc(hf http.HandlerFunc) httprouter.Handle
HandleFunc wraps hf into handle.
func HandleThen ¶ added in v0.6.2
func HandleThen(then func(http.Handler) http.Handler) func(http.HandlerFunc) httprouter.Handle
HandleThen wraps then(hf) into handle.
func ParamsFunc ¶ added in v0.6.2
func ParamsFunc(then func(http.Handler) http.Handler) func(http.HandlerFunc) httprouter.Handle
ParamsFunc wraps then(hf) into handle with context setting by handleParamSetContext.
func ServerHandler ¶ added in v0.6.2
Types ¶
type IndexData ¶
type IndexData map[string]interface{}
IndexData is a data map for templates and marshalling. Keys (even abbrevs eg CPU) intentionally start with lowercase.
type SSE ¶
type SSE struct { Writer http.ResponseWriter // points to the writer Params *params.Params SentHeaders bool Errord bool }
type ServeAssets ¶
type ServeAssets struct { Logger logger ReadFunc func(string) ([]byte, error) InfoFunc func(string) (os.FileInfo, error) AltModTimeFunc func() time.Time // may be nil }
func (ServeAssets) Serve ¶
func (sa ServeAssets) Serve(w http.ResponseWriter, r *http.Request)
Serve does http.ServeContent with asset content and info.
type ServeIndex ¶
type ServeIndex struct { ServeWS StaticData IndexTemplate *templateutil.LazyTemplate }
func NewServeIndex ¶
func NewServeIndex(sw ServeWS, template *templateutil.LazyTemplate, sd StaticData) ServeIndex
func (ServeIndex) Index ¶
func (si ServeIndex) Index(w http.ResponseWriter, r *http.Request)
Index renders index page.
type ServeSSE ¶
type ServeSSE struct {
// contains filtered or unexported fields
}
func NewServeSSE ¶
type ServeWS ¶
type ServeWS struct { ServeSSE // contains filtered or unexported fields }
func NewServeWS ¶
type StaticData ¶ added in v0.7.0
type UpgradeInfo ¶ added in v0.6.1
func (*UpgradeInfo) Get ¶ added in v0.6.1
func (ui *UpgradeInfo) Get() string
func (*UpgradeInfo) Set ¶ added in v0.6.1
func (ui *UpgradeInfo) Set(lv string)
Click to show internal directories.
Click to hide internal directories.