api

package
v0.0.0-...-8c51ab3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONAPI

func JSONAPI(c echo.Context, code int, data interface{}) error

JSONAPI serializes jsonapi responses and set the proper content type

func JSONAPIPaginated

func JSONAPIPaginated(c echo.Context, code int, data interface{}, link *jsonapi.Link) error

JSONAPIPaginated serializes jsonapi responses and set the proper content type along with pagination Links

func Server

func Server()

Server is the main entry point for the API

Types

type BackendRoute

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

func (*BackendRoute) AddZone

func (r *BackendRoute) AddZone(c echo.Context) (err error)

AddZone adds a zone to a backend

func (*BackendRoute) Create

func (r *BackendRoute) Create(c echo.Context) (err error)

Create creates a new backend

func (*BackendRoute) Delete

func (r *BackendRoute) Delete(c echo.Context) (err error)

Delete deletes a backend

func (*BackendRoute) Get

func (r *BackendRoute) Get(c echo.Context) (err error)

Get gets a backend

func (*BackendRoute) GetZones

func (r *BackendRoute) GetZones(c echo.Context) (err error)

GetZones gets all zones for a backend

func (*BackendRoute) List

func (r *BackendRoute) List(c echo.Context) (err error)

List lists all backends

func (*BackendRoute) Register

func (r *BackendRoute) Register(e *echo.Echo)

Register registers the routes for the backend

func (*BackendRoute) RemoveZone

func (r *BackendRoute) RemoveZone(c echo.Context) (err error)

RemoveZone removes a zone from a backend

func (*BackendRoute) Update

func (r *BackendRoute) Update(c echo.Context) (err error)

Update updates a backend

func (*BackendRoute) UpdateZones

func (r *BackendRoute) UpdateZones(c echo.Context) (err error)

UpdateZones updates zones for a backend

type Include

type Include struct {
	Fields []string
}

type Page

type Page struct {
	Size   int
	Number int
}

type Query

type Query struct {
	Includes map[string]*Include
	Filters  map[string][]string
	Sort     []string
	Page     *Page
}

func ParseQuery

func ParseQuery(c echo.Context) (*Query, error)

ParseQuery parses a query string into a Query struct

func (*Query) BuildQuery

func (q *Query) BuildQuery() (query string)

type RecordRoute

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

func (*RecordRoute) Create

func (r *RecordRoute) Create(c echo.Context) (err error)

Create creates a new record

func (*RecordRoute) Delete

func (r *RecordRoute) Delete(c echo.Context) (err error)

Delete deletes a backend

func (*RecordRoute) Get

func (r *RecordRoute) Get(c echo.Context) (err error)

Get gets a record

func (*RecordRoute) GetZone

func (r *RecordRoute) GetZone(c echo.Context) (err error)

GetZone gets the zone of a record

func (*RecordRoute) List

func (r *RecordRoute) List(c echo.Context) (err error)

List lists all records

func (*RecordRoute) Register

func (r *RecordRoute) Register(e *echo.Echo)

Register registers the routes

func (*RecordRoute) Update

func (r *RecordRoute) Update(c echo.Context) (err error)

Update updates a record

func (*RecordRoute) UpdateZone

func (r *RecordRoute) UpdateZone(c echo.Context) (err error)

UpdateZone updates the zone of a record

type ZoneRoute

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

func (*ZoneRoute) AddBackend

func (r *ZoneRoute) AddBackend(c echo.Context) (err error)

AddBackend adds a zone to a backend

func (*ZoneRoute) Create

func (r *ZoneRoute) Create(c echo.Context) (err error)

Create creates a new zone

func (*ZoneRoute) Delete

func (r *ZoneRoute) Delete(c echo.Context) (err error)

Delete deletes a zone

func (*ZoneRoute) Get

func (r *ZoneRoute) Get(c echo.Context) (err error)

Get gets a zone

func (*ZoneRoute) GetBackends

func (r *ZoneRoute) GetBackends(c echo.Context) (err error)

GetBackends gets a zone's backends

func (*ZoneRoute) List

func (r *ZoneRoute) List(c echo.Context) (err error)

List lists all zones

func (*ZoneRoute) Register

func (r *ZoneRoute) Register(e *echo.Echo)

Register registers the routes

func (*ZoneRoute) RemoveBackend

func (r *ZoneRoute) RemoveBackend(c echo.Context) (err error)

RemoveBackend removes a backend from a zone

func (*ZoneRoute) Update

func (r *ZoneRoute) Update(c echo.Context) (err error)

Update updates a zone

func (*ZoneRoute) UpdateBackends

func (r *ZoneRoute) UpdateBackends(c echo.Context) (err error)

UpdateBackends updates backends for a zone

Jump to

Keyboard shortcuts

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