http

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler actually handle http requests. It use a router to map uri to HandlerFunc

func NewHandler

func NewHandler(api api.Api, configPath string, corsEnable bool) *Handler

NewHandler create a Handler using defined routes. It takes a client as argument in order to be pass to the handler and be accessible to the HandlerFunc Typically in a CRUD API, the client manage connections to a storage system.

func (*Handler) Create

func (h *Handler) Create(c *gin.Context)

Create handle the namespace creation.

func (*Handler) Delete

func (h *Handler) Delete(c *gin.Context)

Delete handle the namespace deletion.

func (*Handler) DeleteResource added in v0.5.3

func (h *Handler) DeleteResource(c *gin.Context)

Delete handle the namespace deletion.

func (*Handler) Engine

func (h *Handler) Engine() *gin.Engine

Engine returns the defined router for the Handler

func (*Handler) Get

func (h *Handler) Get(c *gin.Context)

Get return an inventory for a given namespace passed has query parameters.

func (*Handler) GetDefaults

func (h *Handler) GetDefaults(c *gin.Context)

GetDefaults return default for an inventory $ curl -xGET defaults/

func (*Handler) GetStatus added in v0.1.3

func (h *Handler) GetStatus(c *gin.Context)

GetStatus returns the namespace status (ready or not) for a given namespace

func (*Handler) GetStatuses added in v0.1.3

func (h *Handler) GetStatuses(c *gin.Context)

GetStatuses returns an array of namespaces and their associated status

func (*Handler) HealthCheck added in v1.1.0

func (h *Handler) HealthCheck(c *gin.Context)

func (*Handler) List

func (h *Handler) List(c *gin.Context)

List returns the list of existing inventories.

func (*Handler) ListServices

func (h *Handler) ListServices(c *gin.Context)

ListServices returns the list of exposed services (NodePort and ingress configuration) of a given inventory

func (*Handler) Reset added in v0.2.1

func (h *Handler) Reset(c *gin.Context)

Reset reset a inventory to default and apply changes into kubernetes

func (*Handler) Update

func (h *Handler) Update(c *gin.Context)

Update will update inventory for a given namespace

func (*Handler) Version added in v0.4.3

func (h *Handler) Version(c *gin.Context)

type Server

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

Server represents a http server that handle request

func NewServer

func NewServer(h *Handler) *Server

NewServer return a http server with a given handler

func (*Server) Serve

func (s *Server) Serve(port int)

Serve launch the webserver

Jump to

Keyboard shortcuts

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