api

package
v0.0.0-...-cdc5add Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = log.Logger

Functions

func BuildHeap

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

HeapBuild godoc @Summary Build a Heap from an int array. @Description Builds heap from int array, returns original array and built array @Accept json @Produce json @Param data body HeapApiRequest true "Input todo struct" @Success 200 {object} HeapApiResponse @Router /heap/build [post]

func CheckError

func CheckError(err error)

func CheckHttpError

func CheckHttpError(w *http.ResponseWriter, err error)

func Get

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

About godoc @Summary Fetches Information About me. @Description Fetches Information About me. @Produce json @Success 200 {object} nosql.Info @Router /about [get]

func GetBirthDate

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

About godoc @Summary Fetches my birthday. @Description Fetches my birthday. @Produce json @Success 200 {object} int @Router /about/birthday [get]

func GetName

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

About godoc @Summary Fetches my name. @Description Fetches my name. @Produce json @Success 200 {object} nosql.Name_t @Router /about/name [get]

func GetRequestFromBody

func GetRequestFromBody(r *http.Request) ([]byte, error)

func HeapSort

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

HeapSort godoc @Summary Sort an int array using Heap Sort Algorithm @Description Sorts an unsorted int array, returns unordered and ordered array. @Accept json @Produce json @Param data body HeapApiRequest true "Input todo struct" @Success 200 {object} HeapSortApiResponse @Router /heap/sort [post]

func SetupResponse

func SetupResponse(w *http.ResponseWriter)

func WriteJsonToResponse

func WriteJsonToResponse(w http.ResponseWriter, body interface{})

Types

type HeapApiRequest

type HeapApiRequest struct {
	Array []int
}

type HeapApiResponse

type HeapApiResponse struct {
	Array     []int
	BuiltHeap []int
}

type HeapSortApiResponse

type HeapSortApiResponse struct {
	UnorderedArray []int
	OrderedArray   []int
}

Jump to

Keyboard shortcuts

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