webServer

package
v1.4.1-0...-3bf76e9 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigVariable

func GetConfigVariable(c *Controller, varName string, confName string) (string, error)

GetConfigVariable - returns the a string value from variable or conf, returns an error if none set

Types

type Controller

type Controller struct {
	DB   *sql.DB
	Conf *config.Config
}

Controller struct

func CreateController

func CreateController(db *sql.DB, conf *config.Config) *Controller

CreateController - returns a populated controller object

func (*Controller) Bind

func (c *Controller) Bind(w http.ResponseWriter, r *http.Request)

Bind - bins a service instance

func (*Controller) Catalog

func (c *Controller) Catalog(w http.ResponseWriter, r *http.Request)

Catalog - returns the service catalog

func (*Controller) CreateServiceInstance

func (c *Controller) CreateServiceInstance(w http.ResponseWriter, r *http.Request)

CreateServiceInstance - creates a service instance

func (*Controller) DeleteAssociatedBindings

func (c *Controller) DeleteAssociatedBindings(instanceID string) error

DeleteAssociatedBindings - deletes all binding associated with a service instance

func (*Controller) GetDashboard

func (c *Controller) GetDashboard(w http.ResponseWriter, r *http.Request)

GetDashboard - returns the dashboard

func (*Controller) GetServiceInstance

func (c *Controller) GetServiceInstance(w http.ResponseWriter, r *http.Request)

GetServiceInstance - Returns a service instance

func (*Controller) RemoveServiceInstance

func (c *Controller) RemoveServiceInstance(w http.ResponseWriter, r *http.Request)

RemoveServiceInstance - deletes a service instance

func (*Controller) UnBind

func (c *Controller) UnBind(w http.ResponseWriter, r *http.Request)

UnBind - unbinds a service instance

func (*Controller) UpdateServiceInstance

func (c *Controller) UpdateServiceInstance(w http.ResponseWriter, r *http.Request)

UpdateServiceInstance - updates a service instance

type ControllerCreator

type ControllerCreator func(db *sql.DB, conf *config.Config) *Controller

ControllerCreator - controller creation function

type DBConn

type DBConn func(driverName string, connectionString string) (*sql.DB, error)

DBConn - database opening interface

type Server

type Server struct {
	Controller *Controller
}

Server struct

func CreateServer

func CreateServer(dbConnFunc DBConn, controllerCreator ControllerCreator) (*Server, error)

CreateServer - creates a server

func (*Server) Start

func (s *Server) Start() *mux.Router

Start - starts the web server

Jump to

Keyboard shortcuts

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