utils

package
v0.0.0-...-3220a8e Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDashes

func AddDashes(str string) string

AddDashes ...

Types

type IRequestHandler

type IRequestHandler interface {
	ServeRequest(grqAgent *grq.SuperAgent) (response *http.Response, body string, errors []error)
}

IRequestHandler ...

type JSONAPIError

type JSONAPIError struct {
	ID     string `json:"id,omitempty"`
	Status string `json:"status,omitempty"`
	Code   string `json:"code,omitempty"`
	Title  string `json:"title,omitempty"`
	Detail string `json:"detail,omitempty"`
	Source string `json:"source,omitempty"`
}

JSONAPIError ==> replaces the type from the old gson api package This can be improved, but prevents us from having to refactor many lines

type Renderable

type Renderable interface {
	Errors() []JSONAPIError
}

Renderable objects can contain a list of errors to be returned with the response

type RequestHandler

type RequestHandler struct {
}

RequestHandler ...

func (*RequestHandler) ServeRequest

func (reqestHandler *RequestHandler) ServeRequest(grqAgent *grq.SuperAgent) (response *http.Response, body string, errors []error)

ServeRequest ...

type ServiceResult

type ServiceResult struct {
	ID string `json:"id,omitempty" jsonapi:"-"`
	// contains filtered or unexported fields
}

ServiceResult wraps a result from the model to be rendered in the controller

func (ServiceResult) Errors

func (r ServiceResult) Errors() []JSONAPIError

Errors ...

Jump to

Keyboard shortcuts

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