rest

package
v0.0.0-...-3be0946 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID       int    `json:"id"`
	Hostname string `json:"hostname"`
	Tags     []Tag  `json:"tags"`
}

type Handler

type Handler interface {
	RegisterRoutes(*chi.Mux)
}

func NewHandler

func NewHandler(db *ent.Client) Handler

type Responder

type Responder interface {
	OK() *Response
	BadRequest() *Response
	Unauthorized() *Response
	Forbidden() *Response
	NotFound() *Response
	Conflict() *Response
	InternalServerError() *Response
	NotImplemented() *Response
}

func NewResponder

func NewResponder(w http.ResponseWriter, r *http.Request) Responder

type Response

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

func (*Response) Data

func (t *Response) Data(data any)

func (*Response) Err

func (t *Response) Err(err error) *Response

func (*Response) Msg

func (t *Response) Msg(message string)

type Tag

type Tag struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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