handler

package
v0.0.0-...-9e60c09 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointDeletePolicy = "/projects/{project}/policies/{policy}"
	EndpointDeleteRule   = "/projects/{project}/policies/{policy}/rules/{priority}"
)
View Source
const (
	EndpointGetPolicy             = "/projects/{project}/policies/{policy}"
	EndpointGetPolicies           = "/projects/{project}/policies"
	EndpointGetRule               = "/projects/{project}/policies/{policy}/rules/{priority}"
	EndpointGetPreConfiguredRules = "/projects/{project}/preConfiguredRules"
	EndpointGetBackendServices    = "/projects/{project}/backendServices"
)
View Source
const (
	EndpointIsAlive = "/internal/isalive"
	EndpointIsReady = "/internal/isready"
)
View Source
const (
	EndpointUpdatePolicy = "/projects/{project}/policies/{policy}"
	EndpointUpdateRule   = "/projects/{project}/policies/{policy}/rules/{priority}"
)
View Source
const (
	EndpointCreatePolicy     = "/projects/{project}/policies"
	EndpointCreateRule       = "/projects/{project}/policies/{policy}/rules"
	EndpointSetPolicyBackend = "/projects/{project}/policies/{policy}/backendServices/{backend}"
)

Variables

This section is empty.

Functions

func ErrorType

func ErrorType(err error, code int) bool

func HttpError

func HttpError(w http.ResponseWriter, message string, status int)

func SetupHttpRouter

func SetupHttpRouter(h *Handler) *mux.Router

Types

type Handler

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

func NewHandler

func NewHandler(ctx context.Context, cfg *config.Config, securityClient *google.SecurityClient, serviceClient *google.ServiceClient, log *logrus.Entry) *Handler

func (*Handler) CreatePolicy

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

func (*Handler) CreateRule

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

func (*Handler) DeletePolicy

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

func (*Handler) DeleteRule

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

func (*Handler) GetBackendServices

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

func (*Handler) GetPolicies

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

func (*Handler) GetPolicy

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

func (*Handler) GetPreConfiguredRules

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

func (*Handler) GetRule

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

func (*Handler) HttpError

func (h *Handler) HttpError(err error, w http.ResponseWriter, projectID, resource string)

func (*Handler) SetPolicyBackend

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

func (*Handler) UpdatePolicy

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

func (*Handler) UpdateRule

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

Jump to

Keyboard shortcuts

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