api

package
v0.0.0-...-c948546 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API contains each part of the API settings.

func New

func New() (*API, error)

New parses the config file and initializes the new API.

func (*API) ServeHTTP

func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the implementation of http.Handler.

type GardenEditIn

type GardenEditIn struct {
	// UUID is the garden uuid.
	UUID string `path:"uuid" validate:"required"`

	// Name is the garden name.
	Name string `json:"name" description:"Garden name"  validate:"required,lte=50"`

	// Address is the garden address.
	Address string `json:"address" description:"Garden address" validate:"required"`

	// Size is the garden size.
	Size int `json:"size" description:"Garden size" validate:"required,gt=0"`

	// Floor is the garden floor quality.
	Floor int `json:"floor" description:"Garden floor quality" validate:"required"`

	// HasTools defined if the tools are provided.
	HasTools *bool `json:"hasTools" description:"Defines if the tools are provided" validate:"required"`

	// HasWater defines if the garden has a water access.
	HasWater *bool `json:"hasWater" description:"Defines if the garden has a water access" validate:"required"`

	// HasShed defines if the garden has a shed.
	HasShed *bool `json:"hasShed" description:"Defines if the garden has a shed" validate:"required"`
}

GardenEditIn contains informations about a player. It is used to update an existing garden.

type GardenIn

type GardenIn struct {
	// Name is the garden name.
	Name string `json:"name" description:"Garden name"  validate:"required,lte=50"`

	// Address is the garden address.
	Address string `json:"address" description:"Garden address" validate:"required"`

	// Size is the garden size.
	Size int `json:"size" description:"Garden size" validate:"required,gt=0"`

	// Floor is the garden floor quality.
	Floor int `json:"floor" description:"Garden floor quality" validate:"required"`

	// HasTools defined if the tools are provided.
	HasTools *bool `json:"hasTools" description:"Defines if the tools are provided" validate:"required"`

	// HasWater defines if the garden has a water access.
	HasWater *bool `json:"hasWater" description:"Defines if the garden has a water access" validate:"required"`

	// HasShed defines if the garden has a shed.
	HasShed *bool `json:"hasShed" description:"Defines if the garden has a shed" validate:"required"`
}

GardenIn contains informations about a player.

type Health

type Health struct {
	Status string `json:"status" description:"API health status."`
}

Health is the response sent on /unsecured/healthcheck.

type SelectorIn

type SelectorIn struct {
	// UUID is the garden uuid.
	UUID string `path:"uuid" validate:"required"`
}

SelectorIn represents the selector used to target a garden.

type UUIDOut

type UUIDOut struct {
	// UUID is the UUID returned.
	UUID uuid.UUID `json:"uuid" description:"Garden uuid"`
}

UUIDOut is a struct used to return a uuid.

Jump to

Keyboard shortcuts

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