models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Next     string `json:"next"`
	Previous string `json:"previous"`
	URI      string `json:"uri"`
}

Collection is the model for returning a Collection of objects in the API

type Widget

type Widget struct {
	ID           string    `json:"id"`
	SerialNumber string    `json:"serial_number"`
	Description  string    `json:"description"`
	CreatedOn    time.Time `json:"created_on"`
	UpdatedOn    time.Time `json:"updated_on"`
}

Widget represent simple Widget for the example

type WidgetCollection

type WidgetCollection struct {
	Collection
	Items []*Widget `json:"items"`
}

WidgetCollection is a paginated collection of Widget models

type WidgetPatch

type WidgetPatch struct {
	Description string `json:"description"`
}

WidgetPatch is the allowed input for a Widget (PATCH)

func (*WidgetPatch) Valid

func (req *WidgetPatch) Valid() errors.TracerError

Valid indicates if the request is complete

type WidgetRequest

type WidgetRequest struct {
	SerialNumber string `json:"serial_number"`
	Description  string `json:"description"`
}

WidgetRequest is the allowed input for a Widget (POST, PUT)

func (*WidgetRequest) Valid

func (req *WidgetRequest) Valid() errors.TracerError

Valid indicates if the request is complete

Jump to

Keyboard shortcuts

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