Documentation ¶
Index ¶
- func New(c *config.Config) (api.Server, error)
- func NewFromBytes(bs []byte) (api.Server, error)
- func NewFromFile(fn string) (api.Server, error)
- type Endpoint
- type Server
- func (s *Server) Endpoint(host, certfile, keyfile string, tls bool)
- func (s *Server) HttpServer(host string) *http.Server
- func (s *Server) NewLuaState(w http.ResponseWriter, r *http.Request) *lua.LState
- func (s *Server) OnInit(f func(L *lua.LState) error)
- func (s *Server) Route(path string) *mux.Route
- func (s *Server) Run() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromBytes ¶
NewFromBytes builds a Server from the given byte slice. Contents should be YAML.
Types ¶
type Server ¶
type Server struct { Config *config.Config Router *mux.Router Endpoints []Endpoint HttpServers map[string]*http.Server InitFuncs []func(L *lua.LState) error RootState *lua.LState }
Root handler, delegates to an internal mux.
func (*Server) NewLuaState ¶
func (s *Server) NewLuaState(w http.ResponseWriter, r *http.Request) *lua.LState
Click to show internal directories.
Click to hide internal directories.