httpapi

package
v0.0.0-...-283e58d Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package httpapi provides mechanisms, like handlers, to implement an HTTP API for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleGetIP

func HandleGetIP(ctx *gin.Context)

HandleGetIP is a gin HTTP handler that gather's the source IP from an incoming HTTP request and returns it in the response body.

Types

type ServerController

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

ServerController is an HTTP API controller for server resources.

func NewServerController

func NewServerController(repository *srvrepo.ServerRepository) *ServerController

NewServerController constructs a new Controller for controlling server resources.

func (*ServerController) HandleList

func (c *ServerController) HandleList(ctx *gin.Context)

HandleList is a gin HTTP handler that returns a list of the registered servers in the response body.

func (*ServerController) HandleRegister

func (c *ServerController) HandleRegister(ctx *gin.Context)

HandleRegister is a gin HTTP handler that allows servers to register themselves in the repository. This call will also dial back to the port being registered and confirm that the port is accessible.

func (*ServerController) HandleRemove

func (c *ServerController) HandleRemove(ctx *gin.Context)

HandleRemove is a gin HTTP handler that allows servers to remove themselves from the repository.

func (*ServerController) HandleUpdate

func (c *ServerController) HandleUpdate(ctx *gin.Context)

HandleRegister is a gin HTTP handler that allows servers to update their registration to keep things fresh

Jump to

Keyboard shortcuts

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