...

Package srv

import "github.com/linkerd/linkerd2/web/srv"
Overview
Index

Overview ▾

func NewServer

func NewServer(
    addr string,
    grafanaAddr string,
    grafanaExternalAddr string,
    grafanaPrefix string,
    jaegerAddr string,
    templateDir string,
    staticDir string,
    uuid string,
    version string,
    controllerNamespace string,
    clusterDomain string,
    reload bool,
    reHost *regexp.Regexp,
    apiClient vizPb.ApiClient,
    k8sAPI *k8s.KubernetesAPI,
    hc healthChecker,
) *http.Server

NewServer returns an initialized `http.Server`, configured to listen on an address, render templates, and serve static assets, for a given Linkerd control plane.

type Server

Server encapsulates the Linkerd control plane's web dashboard server.

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

func FakeServer

func FakeServer() Server

FakeServer provides a mock of a Server in `/web/srv`.

func (*Server) RenderTemplate

func (s *Server) RenderTemplate(w http.ResponseWriter, templateFile, templateName string, args interface{}) error

RenderTemplate writes a rendered template into a buffer, given an HTTP request and template information.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

this is called by the HTTP server to actually respond to a request