handlers

package
Version: v0.0.0-...-c891ed9 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Routes holds all the endpoints that neuron exposes.
	Routes = Routs{

		Route{"CreateConsul", "CREATE", "/createconsul", createconsul},
		Route{"GetRegions", "GET", "/getregions", getregions},
		Route{"GetSubnets", "GET", "/getsubnets", getsubnets},

		Route{"GetCount", "GET", "/getcount", getcount},

		Route{"CreateServer", "CREATE", "/createserver", createserver},
		Route{"CreateServerMock", "CREATE", "/createservermock", createservermock},
		Route{"GetServers", "GET", "/getservers", getservers},
		Route{"GetAllServers", "GET", "/getallservers", getallservers},
		Route{"DeleteServers", "DELETE", "/deleteservers", deleteservers},
		Route{"UpdateServers", "UPDATE", "/updateservers", updateservers},

		Route{"CreateNetwork", "CREATE", "/createnetwork", createnetwork},
		Route{"DeleteNetwork", "DELETE", "/deletenetworks", deletenetworks},
		Route{"GetAllNetworks", "GET", "/getallnetworks", getallnetworks},
		Route{"GetNetworks", "GET", "/getnetworks", getnetworks},
		Route{"UpdateNetworks", "UPDATE", "/updatenetwork", updatenetwork},

		Route{"CreateLoadBalancer", "CREATE", "/createloadbalancer", createloadbalancer},
		Route{"DeleteLoadBalancer", "DELETE", "/deleteloadbalancer", deleteloadbalancer},
		Route{"GetLoadBalancer", "GET", "/getloadbalancers", getloadbalancers},
		Route{"GetAllLoadBalancer", "GET", "/getallloadbalancers", getallloadbalancers},

		Route{"CreateImage", "CREATE", "/createimage", createimage},
		Route{"DeleteImage", "DELETE", "/deleteimage", deleteimage},
		Route{"GetImage", "GET", "/getimages", getimages},
		Route{"GetAllImage", "GET", "/getallimages", getallimages},
	}

	// UiRoutes holds all the ui endpoints that neuron supports.
	UiRoutes = UiRouts{
		UiRoute{"NeuRon", "/", neuron},
		UiRoute{"NeuRon", "/neuron", neuron},
		UiRoute{"BuildApp", "/buildapp", buildapp},
		UiRoute{"CloudView", "/cloudview", cloudview},
		UiRoute{"CloudSetting", "/cloudsettings", cloudsetting},
		UiRoute{"CIView", "/ciview", ciview},
		UiRoute{"CISetting", "/cisettings", cisetting},
		UiRoute{"SetCi", "/setci", setci},
		UiRoute{"JenkinsView", "/jenkinsview", jenkinsview},
		UiRoute{"CloudView2", "/cloudview2", cloudview2},
	}
)
View Source
var UiTemplatePath string

UiTemplatePath holds the path to folder consisting of UI gotemplates and other files to host UI.

Functions

func FillMyStruct

func FillMyStruct(s FillStructs) error

FillMyStruct helps converting map[string]interface to strut type you need.

func Nouifound

func Nouifound(w http.ResponseWriter, r *http.Request)

Nouifound will display appropriate page if UI is not configured.

Types

type CIData

type CIData struct {
	Id bson.ObjectId `bson:"_id,omitempty" json:"id"`
	//Id         int       `bson:"_id,omitempty" json:"id"`
	CiName     string    `json:"CiName" bson:"ciname"`
	CiURL      string    `json:"CiURL" bson:"ciurl"`
	CiUsername string    `json:"CiUsername" bson:"ciusername"`
	CiPassword string    `json:"CiPassword" bson:"cipassword"`
	Timestamp  time.Time `json:"Timestamp" bson:"timestamp"`
}

type Error

type Error struct {
	Error string
}

type FillStructs

type FillStructs struct {
	Data interface{} `json:"Data,omitempty"`
	Type interface{} `json:"Type,omitempty"`
}

func (*FillStructs) SetField

func (s *FillStructs) SetField(obj interface{}, name string, value interface{}) error

SetField is a method where actual converstion of map[string]interface to strut happens.

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route holds the data which will be used while setting up router (API).

type Routs

type Routs []Route

Routs implements array of Route.

type UiRoute

type UiRoute struct {
	Name        string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

UiRoute as name specifies holds the data which will be used while setting up router (API for UI).

type UiRouts

type UiRouts []UiRoute

UiRouts implements array of UiRoute.

Jump to

Keyboard shortcuts

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