handlers

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers :collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Package handlers : collection of handlers (aka "HTTP middleware")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlerInstance added in v0.0.4

func NewHandlerInstance(
	handlerConfig *models.HandlerConfig,
) models.HandlerInterface

NewHandlerInstance returns a Handler instance

func ServeUI added in v0.3.10

func ServeUI(w http.ResponseWriter, r *http.Request, reqBasePath, baseFolderPath string)

ServeUI - helps serve static files for both meshery ui and provider ui

Types

type Handler added in v0.0.4

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

Handler type is the bucket for configs and http handlers

func (*Handler) AdapterPingHandler added in v0.0.6

func (h *Handler) AdapterPingHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

AdapterPingHandler is used to ping a given adapter

func (*Handler) AnonymousStatsHandler added in v0.3.7

func (h *Handler) AnonymousStatsHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

AnonymousStatsHandler updates anonymous stats for user

func (*Handler) AuthMiddleware added in v0.0.4

func (h *Handler) AuthMiddleware(next http.Handler) http.Handler

AuthMiddleware is a middleware to validate if a user is authenticated

func (*Handler) CollectStaticMetrics added in v0.0.6

func (h *Handler) CollectStaticMetrics(config *models.SubmitMetricsConfig) error

CollectStaticMetrics is used for collecting static metrics from prometheus and submitting it to SaaS

func (*Handler) EventStreamHandler added in v0.0.6

func (h *Handler) EventStreamHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

EventStreamHandler endpoint is used for streaming events to the frontend

func (*Handler) FetchResultsHandler added in v0.0.6

func (h *Handler) FetchResultsHandler(w http.ResponseWriter, req *http.Request, _ *models.Preference, user *models.User, p models.Provider)

FetchResultsHandler fetchs pages of results from SaaS and presents it to the UI

func (*Handler) FetchSmiResultsHandler added in v0.4.7

func (h *Handler) FetchSmiResultsHandler(w http.ResponseWriter, req *http.Request, _ *models.Preference, user *models.User, p models.Provider)

GetSmiResultsHandler gets the results of all the smi conformance tests

func (*Handler) GetAllAdaptersHandler added in v0.0.6

func (h *Handler) GetAllAdaptersHandler(w http.ResponseWriter, req *http.Request, provider models.Provider)

GetAllAdaptersHandler is used to fetch all the adapters

func (*Handler) GetContextsFromK8SConfig added in v0.0.6

func (h *Handler) GetContextsFromK8SConfig(w http.ResponseWriter, req *http.Request)

GetContextsFromK8SConfig returns the context list for a given k8s config

func (*Handler) GetResultHandler added in v0.3.10

func (h *Handler) GetResultHandler(w http.ResponseWriter, req *http.Request, _ *models.Preference, user *models.User, p models.Provider)

GetResultHandler gets an individual result from provider

func (*Handler) GrafanaBoardImportForPrometheusHandler added in v0.0.6

func (h *Handler) GrafanaBoardImportForPrometheusHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

GrafanaBoardImportForPrometheusHandler accepts a Grafana board json, parses it and returns the list of panels

func (*Handler) GrafanaBoardsHandler added in v0.0.6

func (h *Handler) GrafanaBoardsHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

GrafanaBoardsHandler is used for fetching Grafana boards and panels

func (*Handler) GrafanaConfigHandler added in v0.0.6

func (h *Handler) GrafanaConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

GrafanaConfigHandler is used for persisting or removing Grafana configuration

func (*Handler) GrafanaPingHandler added in v0.3.5

func (h *Handler) GrafanaPingHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

GrafanaPingHandler - used to initiate a Grafana ping

func (*Handler) GrafanaQueryHandler added in v0.0.6

func (h *Handler) GrafanaQueryHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

GrafanaQueryHandler is used for handling Grafana queries

func (*Handler) GrafanaQueryRangeHandler added in v0.0.6

func (h *Handler) GrafanaQueryRangeHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

GrafanaQueryRangeHandler is used for handling Grafana Range queries

func (*Handler) InstalledMeshesHandler added in v0.2.0

func (h *Handler) InstalledMeshesHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

InstalledMeshesHandler - scans and tries to find out the installed meshes

func (*Handler) K8SConfigHandler added in v0.0.4

func (h *Handler) K8SConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

K8SConfigHandler is used for persisting kubernetes config and context info

func (*Handler) KubernetesPingHandler added in v0.1.6

func (h *Handler) KubernetesPingHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

KubernetesPingHandler - fetches server version to simulate ping

func (*Handler) LoadTestHandler added in v0.0.4

func (h *Handler) LoadTestHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

LoadTestHandler runs the load test with the given parameters

func (*Handler) LoadTestPrefencesHandler added in v0.3.7

func (h *Handler) LoadTestPrefencesHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

LoadTestPrefencesHandler is used for persisting load test preferences

func (*Handler) LoadTestUsingSMPHandler added in v0.4.7

func (h *Handler) LoadTestUsingSMPHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

LoadTestUsingSMPHandler runs the load test with the given parameters and SMP

func (*Handler) LoginHandler added in v0.0.4

func (h *Handler) LoginHandler(w http.ResponseWriter, r *http.Request, p models.Provider, fromMiddleWare bool)

LoginHandler redirects user for auth or issues session

func (*Handler) LogoutHandler added in v0.0.4

func (h *Handler) LogoutHandler(w http.ResponseWriter, req *http.Request, p models.Provider)

LogoutHandler destroys the session and redirects to home.

func (*Handler) MeshAdapterConfigHandler added in v0.0.6

func (h *Handler) MeshAdapterConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

MeshAdapterConfigHandler is used to persist adapter config

func (*Handler) MeshOpsHandler added in v0.0.4

func (h *Handler) MeshOpsHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

MeshOpsHandler is used to send operations to the adapters

func (*Handler) PrometheusConfigHandler added in v0.0.6

func (h *Handler) PrometheusConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

PrometheusConfigHandler is used for persisting prometheus configuration

func (*Handler) PrometheusPingHandler added in v0.3.7

func (h *Handler) PrometheusPingHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

PrometheusPingHandler - fetches server version to simulate ping

func (*Handler) PrometheusQueryHandler added in v0.0.6

func (h *Handler) PrometheusQueryHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

PrometheusQueryHandler handles prometheus queries

func (*Handler) PrometheusQueryRangeHandler added in v0.0.6

func (h *Handler) PrometheusQueryRangeHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

PrometheusQueryRangeHandler handles prometheus range queries

func (*Handler) PrometheusStaticBoardHandler added in v0.0.6

func (h *Handler) PrometheusStaticBoardHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

PrometheusStaticBoardHandler returns the static board

func (*Handler) ProviderHandler added in v0.3.10

func (h *Handler) ProviderHandler(w http.ResponseWriter, r *http.Request)

ProviderHandler - handles the choice of provider

func (*Handler) ProviderMiddleware added in v0.3.10

func (h *Handler) ProviderMiddleware(next http.Handler) http.Handler

ProviderMiddleware is a middleware to validate if a provider is set

func (*Handler) ProviderUIHandler added in v0.3.10

func (h *Handler) ProviderUIHandler(w http.ResponseWriter, r *http.Request)

ProviderUIHandler - serves providers UI

func (*Handler) ProvidersHandler added in v0.3.10

func (h *Handler) ProvidersHandler(w http.ResponseWriter, r *http.Request)

ProvidersHandler returns a list of providers

func (*Handler) SaveSelectedGrafanaBoardsHandler added in v0.0.6

func (h *Handler) SaveSelectedGrafanaBoardsHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, p models.Provider)

SaveSelectedGrafanaBoardsHandler is used to persist board and panel selection

func (*Handler) SaveSelectedPrometheusBoardsHandler added in v0.0.6

func (h *Handler) SaveSelectedPrometheusBoardsHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

SaveSelectedPrometheusBoardsHandler persists selected board and panels

func (*Handler) ScanGrafanaHandler added in v0.3.13

func (h *Handler) ScanGrafanaHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

ScanGrafanaHandler - fetches Grafana

func (*Handler) ScanPromGrafanaHandler added in v0.3.13

func (h *Handler) ScanPromGrafanaHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

ScanPromGrafanaHandler - fetches Prometheus and Grafana

func (*Handler) ScanPrometheusHandler added in v0.4.4

func (h *Handler) ScanPrometheusHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

ScanPrometheusHandler - fetches Prometheus

func (*Handler) ServerVersionHandler added in v0.3.18

func (h *Handler) ServerVersionHandler(w http.ResponseWriter, r *http.Request)

ServerVersionHandler handles the version api request for the server

func (*Handler) SessionInjectorMiddleware added in v0.2.0

func (h *Handler) SessionInjectorMiddleware(next func(http.ResponseWriter, *http.Request, *models.Preference, *models.User, models.Provider)) http.Handler

SessionInjectorMiddleware - is a middleware which injects user and session object

func (*Handler) SessionSyncHandler added in v0.0.6

func (h *Handler) SessionSyncHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

SessionSyncHandler is used to send session data to the UI for initial sync

func (*Handler) TokenHandler added in v0.3.15

func (h *Handler) TokenHandler(w http.ResponseWriter, r *http.Request, p models.Provider, fromMiddleWare bool)

TokenHandler Receives token from the actual provider

func (*Handler) UserHandler added in v0.0.4

func (h *Handler) UserHandler(w http.ResponseWriter, req *http.Request, _ *models.Preference, user *models.User, provider models.Provider)

UserHandler returns info about the logged in user

func (*Handler) UserTestPreferenceDelete added in v0.4.2

func (h *Handler) UserTestPreferenceDelete(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

UserTestPreferenceDelete deletes the PerformanceTestConfig object

func (*Handler) UserTestPreferenceGet added in v0.4.2

func (h *Handler) UserTestPreferenceGet(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

UserTestPreferenceGet gets the PerformanceTestConfig object

func (*Handler) UserTestPreferenceHandler added in v0.4.2

func (h *Handler) UserTestPreferenceHandler(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

UserTestPreferenceHandler is used for persisting load test preferences

func (*Handler) UserTestPreferenceStore added in v0.4.2

func (h *Handler) UserTestPreferenceStore(w http.ResponseWriter, req *http.Request, prefObj *models.Preference, user *models.User, provider models.Provider)

UserTestPreferenceStore is used for persisting load test preferences

type Version added in v0.3.18

type Version struct {
	Build     string `json:"build,omitempty"`
	CommitSHA string `json:"commitsha,omitempty"`
}

Version defines the Json payload structure for version api\

Jump to

Keyboard shortcuts

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