Documentation ¶
Overview ¶
This package implements vulcan controller and is based on Robert Krimen's Otto javascript magnificent interpreter.
Index ¶
Constants ¶
View Source
const SKIP_CONTEXT_CACHE = false
View Source
const SKIP_FILE_CACHE = false
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextPool ¶
type ContextPool struct {
// contains filtered or unexported fields
}
TODO(pquerna): Remove once Go 1.3 is out <https://code.google.com/p/go/issues/detail?id=4720>
func NewContextPool ¶
func NewContextPool(ctrl *JsController) *ContextPool
func (*ContextPool) Get ¶
func (p *ContextPool) Get() (*JsContext, error)
func (*ContextPool) New ¶
func (p *ContextPool) New() (*JsContext, error)
func (*ContextPool) Put ¶
func (p *ContextPool) Put(jsc *JsContext)
type FileGetter ¶
type FileGetter struct {
// contains filtered or unexported fields
}
func NewFileGetter ¶
func NewFileGetter(path string) *FileGetter
func (*FileGetter) GetCode ¶
func (fg *FileGetter) GetCode() (string, error)
func (*FileGetter) GetHash ¶
func (fg *FileGetter) GetHash() (string, error)
type JsContext ¶
type JsContext struct {
// contains filtered or unexported fields
}
func NewJsContext ¶
func NewJsContext() *JsContext
type JsController ¶
type JsController struct { // Discovery service interface, Zookeeper or Etcd can hide behind // the simple interface. DiscoveryService discovery.Service // Code getter is responsible for fetching the request from file, // hardcoded string or discovery service. CodeGetter CodeGetter // Client allows controlller to issue concurrent get requests // within the javascript handler. Client client.Client // contains filtered or unexported fields }
func (*JsController) ConvertError ¶
func (*JsController) GetInstructions ¶
func (ctrl *JsController) GetInstructions(req *http.Request) (interface{}, error)
type ResponseWriter ¶
func NewResponseWriter ¶
func NewResponseWriter() *ResponseWriter
func (*ResponseWriter) Header ¶
func (w *ResponseWriter) Header() http.Header
func (*ResponseWriter) ToReply ¶
func (w *ResponseWriter) ToReply() map[string]interface{}
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(code int)
type StringGetter ¶
type StringGetter struct {
// contains filtered or unexported fields
}
func NewStringGetter ¶
func NewStringGetter(code string) *StringGetter
func (*StringGetter) GetCode ¶
func (sg *StringGetter) GetCode() (string, error)
func (*StringGetter) GetHash ¶
func (sg *StringGetter) GetHash() (string, error)
Click to show internal directories.
Click to hide internal directories.