cmdb

package
v3.6.5-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Routes = api.Routes{

	api.Route{
		Name:        `CMDB Authenticator`,
		Path:        `/api/v3/cmdb/authenticate/{host}`,
		Method:      `GET`,
		HandlerFunc: SetAuthToken,
		Protected:   false,
	},

	api.Route{
		Name:        `CMDB Event Logger`,
		Path:        `/api/v3/cmdb/event/create/{host}`,
		Method:      `POST`,
		HandlerFunc: CreateEvent,
		Protected:   false,
	},

	api.Route{
		Name:        `CMDB Health Check`,
		Path:        `/api/v3/cmdb/health/check`,
		Method:      `GET`,
		HandlerFunc: CheckHealth,
		Protected:   false,
	},

	api.Route{
		Name:        `CMDB Concurrency Check`,
		Path:        `/api/v3/cmdb/concurrency/check/{id}`,
		Method:      `GET`,
		HandlerFunc: CheckConcurrency,
		Protected:   false,
	},
}

Routes is a collection of HTTP verb/path-to-handler-function mappings.

Functions

func CheckConcurrency

func CheckConcurrency(w http.ResponseWriter, r *http.Request)

CheckConcurrency allows tests against the server connection limit. It accepts an arbitrary connection ID from the client (presumably a counter), logs the connection information to the system log, and sleeps for 60 seconeds before returning an HTTP StatusOK to the client.

func CheckHealth

func CheckHealth(w http.ResponseWriter, r *http.Request)

CheckHealth returns the health of the server.

func CreateEvent

func CreateEvent(w http.ResponseWriter, r *http.Request)

CreateEvent writes an event to the datastore event log.

func Init

func Init(as service.AuthSvc, sl, el log.MLogger)

Init initializes the package variables required for operation.

func SetAuthToken

func SetAuthToken(w http.ResponseWriter, r *http.Request)

SetauthToken authenticates client using basic authentication and issues a token for API authentication if successful.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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