model

package
v0.0.0-...-cc73b8b Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Message string `json:"message,omitempty"`
	Code    int    `json:"status,omitempty"`
}

ApiError is the model for request errors, containing a `status` (http status code) and a message

func (ApiError) Handle

func (err ApiError) Handle(c echo.Context) error

Handle will serve a JSON for this error, given a request context

type ApiResponse

type ApiResponse struct {
	Message string `json:"message,omitempty"`
}

ApiResponse is the model for request resposne messages it contains only a simple message that can be transformed to JSON

func (ApiResponse) Handle

func (err ApiResponse) Handle(c echo.Context) error

Handle will serve a JSON for this response, given a request context

type Employee

type Employee struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Title  string `json:"title"`
	Leader string `json:"leader"`
}

Employee is the public representation of a tree.Node

func (*Employee) CreateNode

func (employee *Employee) CreateNode() *tree.Node

CreateNode generates a *tree.Node given input from the API

Jump to

Keyboard shortcuts

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