api

package
v0.0.0-...-2d52d2e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteServerStatus = "/api/server/status"
	RouteServerSetup  = "/api/server/setup"
	RouteUserMe       = "/api/user/me"
	RouteUserLogin    = "/api/user/login"
	RouteUserLogout   = "/api/user/logout"
	RouteUserNew      = "/api/user/new"
	RouteUserList     = "/api/user/list"
	RouteUserDelete   = "/api/user/delete"
	RouteUserUpdate   = "/api/user/update"
	RouteFavicon      = "/favicon.svg"
)

Route Names

Variables

View Source
var (
	ResponseServerAlreadySetup = rooter.Response{
		StatusCode: http.StatusOK,
		Message:    "Server Is Already Setup",
		State:      false,
	}
	ResponseMissingValidSession = rooter.Response{
		StatusCode: http.StatusOK,
		Message:    "Missing Valid Session",
		State:      false,
	}
	ResponseInvalidLogin = rooter.Response{
		StatusCode: http.StatusOK,
		State:      false,
		Message:    "Invlaid Login",
	}
	ResponseRecordNotFound = rooter.Response{
		StatusCode: http.StatusOK,
		State:      false,
		Message:    "Record Not Found",
	}
)

Responses

View Source
var (
	ErrUnauthorized = errors.New("unauthorized")
)

Errors

Functions

func RegisterRoutes

func RegisterRoutes(mux *http.ServeMux, service *hub.Service)

RegisterRoutes for the API

Types

type App

type App struct {
	Service *hub.Service
}

App for the REST API

func (*App) GetRoutes

func (a *App) GetRoutes() []rooter.Route

GetRoutes gets all the routes

Jump to

Keyboard shortcuts

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