func()

in local-container-endpoints/handlers/metadata_handler.go [125:139]


func (service *MetadataService) handleRequest(requestType int, w http.ResponseWriter, identifier string, callerIP string) error {
	switch requestType {
	case requestTypeTaskMetadata:
		return service.taskMetadataResponse(w, identifier, callerIP)
	case requestTypeTaskStats:
		return service.taskStatsResponse(w, identifier, callerIP)
	case requestTypeContainerStats:
		return service.containerStatsResponse(w, identifier, callerIP)
	case requestTypeContainerMetadata:
		return service.containerMetadataResponse(w, identifier, callerIP)
	}

	// This should never run, but explicitly returning an error here helps make it easy to find bugs
	return fmt.Errorf("There's a bug in this code: Invalid request type %d", requestType)
}