app

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIView

type APIView struct {
	AppURL string
	Handler
	framework.View
}

APIView will wrap a Handler and return CORS-compliant headers for the AppURL domain.

func (*APIView) Code

func (a *APIView) Code() int

Code will return the status code if the method is not OPTIONS.

func (*APIView) ContentLength

func (a *APIView) ContentLength() int

ContentLength will return the content length if the method is not OPTIONS.

func (*APIView) ContentType

func (a *APIView) ContentType() string

ContentType will return the content type if the method is not OPTIONS.

func (*APIView) Handle

func (a *APIView) Handle(req *http.Request) framework.View

Handle a request, don't call the inner handler if the request is of the OPTIONS method.

func (*APIView) Headers

func (a *APIView) Headers() framework.Headers

Headers add the CORS headers to the request:

"Access-Control-Allow-Origin" "Access-Control-Allow-Headers"

func (*APIView) Write

func (a *APIView) Write(r io.Writer)

Write something if the method is not OPTIONS.

type CORSFile

type CORSFile struct {
	framework.View
}

func (*CORSFile) Headers

func (a *CORSFile) Headers() framework.Headers

Headers add the CORS headers to the request:

"Access-Control-Allow-Origin" "Access-Control-Allow-Headers"

type Handler

type Handler interface {
	Handle(req *http.Request) framework.View
}

Handler is a struct that takes a request and returns a view.

type POSTHandler

type POSTHandler struct {
	Handler
}

POSTHandler contains an inner handler that it utilizes only if the request is the POST method.

func (*POSTHandler) Handle

func (p *POSTHandler) Handle(req *http.Request) framework.View

Handle will redirect to the inner handler only if the request is the POST method.

type PluginServer

type PluginServer struct {
	Packager *packaging.Packager
}

PluginServer returns the list of plugins from the MLGBASE/plugins directory.

func (*PluginServer) Handle

func (s *PluginServer) Handle(req *http.Request) framework.View

Handle the PluginServer.

type Router

type Router struct {
	// contains filtered or unexported fields
}

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(res http.ResponseWriter, req *http.Request)

type Server

type Server struct {
	Suffix  string
	Common  string
	Plugins string
	App     string
	API     string
	// Other Servers
	Dispatcher *dispatcher.Server
	Tracker    *tracker.Tracker
	// Settings Module
	Settings *models.Store

	// Logging Information
	DataDirectory  string
	AssetDirectory string
	Debug          bool

	// Melange Information
	Platform       string
	Version        string
	AppLocation    string
	ControllerPort string
}

func (*Server) APIRealtimeURL

func (p *Server) APIRealtimeURL() string

func (*Server) APIURL

func (p *Server) APIURL() string

func (*Server) AppURL

func (p *Server) AppURL() string

func (*Server) CommonURL

func (p *Server) CommonURL() string

func (*Server) HandleAPI

func (r *Server) HandleAPI(res http.ResponseWriter, req *http.Request)

HandleAPI will redirect a request through the API Layer.

func (*Server) HandleApp

func (r *Server) HandleApp(res http.ResponseWriter, req *http.Request)

func (*Server) HandleCommon

func (r *Server) HandleCommon(res http.ResponseWriter, req *http.Request)

func (*Server) HandleData

func (p *Server) HandleData(res http.ResponseWriter, req *http.Request)

func (*Server) HandlePlugins

func (r *Server) HandlePlugins(mode string, res http.ResponseWriter, req *http.Request)

func (*Server) PluginURL

func (p *Server) PluginURL() string

func (*Server) Run

func (p *Server) Run(port int) error

type ServerLists

type ServerLists struct {
	URL      string
	Packager *packaging.Packager
}

ServerLists will return the list of Trackers or Servers from getmelange.com.

func (*ServerLists) Handle

func (s *ServerLists) Handle(req *http.Request) framework.View

Handle will decodeProviders from getmelange.com then return them in JSON.

Directories

Path Synopsis
The models package defines how the Application server interacts with the local SQLITE database to store information.
The models package defines how the Application server interacts with the local SQLITE database to store information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL