rest

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rest provides the REST API to create highly-available iSCSI targets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(code int, w http.ResponseWriter, format string, a ...interface{}) (n int, err error)

Errorf takes a StatusCode, a ResponseWriter and a format string. It sets up the REST response and writes it to the ResponseWriter It also sets the according error code.

func ListenAndServe

func ListenAndServe(addr string, controllers []string)

ListenAndServe is the entry point for the REST API

func MustError

func MustError(code int, w http.ResponseWriter, format string, a ...interface{})

Types

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

Error is the type that is returned in case of an error.

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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