rest

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Email    = NewParam("email")
	Username = NewParam("username")
	Token    = NewParam("token")
	Id       = NewParam("id")
	UserId   = NewParam("user-id")
	JwtId    = NewParam("jwt-id")
)

Param values

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Name   string
	Params []Param
}

Endpoint is the REST endpoint

func NewEndpoint

func NewEndpoint(name string, params ...Param) *Endpoint

NewEndpoint creates a new Endpoint

func (Endpoint) String

func (r Endpoint) String() string

String returns the string representation of the Endpoint

type Method

type Method int

Method is the type of REST request method

const (
	GET Method = iota
	POST
	PUT
	PATCH
	DELETE
	INVALID
)

Method values

func GetMethod

func GetMethod(method string) Method

GetMethod returns the Method from the string

type Param

type Param struct {
	Name string
}

Param is the type of REST request parameter

func NewParam

func NewParam(name string) Param

NewParam creates a new Param

func (Param) String

func (r Param) String() string

String returns the string representation of the Param

Jump to

Keyboard shortcuts

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