api

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsHandled bool

IsHandled - setups protection for the mutex

Functions

func AbortTransitionID

func AbortTransitionID(w http.ResponseWriter, req *http.Request)

AbortTransitionID - abort transition by transitionID

func CreateRouterAndHandler

func CreateRouterAndHandler()

CreateRouterAndHandler - Create a singleton for setting up routing for the UnitTests

func CreateTransition

func CreateTransition(w http.ResponseWriter, req *http.Request)

CreateTransition - creates a transition and will trigger a 'transition' flow

func GetHealth

func GetHealth(w http.ResponseWriter, req *http.Request)

GetHealth - Returns various health information

func GetLiveness

func GetLiveness(w http.ResponseWriter, req *http.Request)

Returns the microservice liveness indicator. Any response means we're live.

func GetPowerCap

func GetPowerCap(w http.ResponseWriter, req *http.Request)

GetPowerCap - Get PowerCap tasks array

func GetPowerCapQuery

func GetPowerCapQuery(w http.ResponseWriter, req *http.Request)

GetPowerCapQuery - Get PowerCap information by ID

func GetPowerStatus

func GetPowerStatus(w http.ResponseWriter, req *http.Request)

GetPowerStatus - Returns the power status of the hardware

func GetReadiness

func GetReadiness(w http.ResponseWriter, req *http.Request)

Readiness - Returns the microservice readiness indicator

func GetTransitions

func GetTransitions(w http.ResponseWriter, req *http.Request)

GetTransitions - returns all transitions

func GetUUIDFromVars

func GetUUIDFromVars(key string, r *http.Request) (passback model.Passback)

GetUUIDFromVars - attempts to retrieve a UUID from an http.Request URL returns a passback

func Index

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

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger - used for logging what methods were invoked and how long they took to complete

func NewRouter

func NewRouter() *mux.Router

NewRouter - create a new mux Router; and initializes it with the routes

func PatchPowerCap

func PatchPowerCap(w http.ResponseWriter, req *http.Request)

PatchPowerCap - Patch power-cap values

func SnapshotPowerCap

func SnapshotPowerCap(w http.ResponseWriter, req *http.Request)

SnapshotPowerCap - creates a power cap snapshot for an array of xnames

func WriteHeaders

func WriteHeaders(w http.ResponseWriter, pb model.Passback)

WriteHeaders - writes JSON to the open http connection along with headers

func WriteHeadersWithLocation

func WriteHeadersWithLocation(w http.ResponseWriter, pb model.Passback, location string)

func WriteJSON

func WriteJSON(w http.ResponseWriter, i interface{})

WriteJSON - writes JSON to the open http connection

Types

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route - struct containing name,method, pattern and handlerFunction to invoke.

type Routes

type Routes []Route

Routes - a collection of Route

Jump to

Keyboard shortcuts

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