api

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(listenAddress, version string) (*http.Server, error)

func WriteErrorJSON

func WriteErrorJSON(statusCode int, msg string, w http.ResponseWriter)

func WriteJSON

func WriteJSON(statusCode int, data interface{}, w http.ResponseWriter)

func WriteSuccessJSON

func WriteSuccessJSON(statusCode int, msg string, w http.ResponseWriter)

Types

type API

type API struct {
	Version       string
	ListenAddress string
	// contains filtered or unexported fields
}

type ResponseJSON

type ResponseJSON struct {
	Status  int               `json:"status"`
	Message string            `json:"message"`
	Values  map[string]string `json:"values,omitempty"`
	Errors  string            `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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