link_api

package
v0.0.0-...-36d8597 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(
	link_rpc link_rpc.LinkServiceClient,
) chi.Router

Routes creates a REST router

Types

type Handler

type Handler struct {
	LinkServiceClient link_rpc.LinkServiceClient
}

func (*Handler) Add

func (h *Handler) Add(w http.ResponseWriter, r *http.Request)

Add ... @Summary Add link @Description Add link @ID add-link @Accept json @Produce json @Group Links @Success 200 {object} link_rpc.AddResponse @Router /links [post] @Param link body link_rpc.AddRequest true "Link"

func (*Handler) Delete

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

Delete ... @Summary Delete link @Description Delete link @ID delete-link @Accept json @Produce json @Group Links @Success 200 "" @Router /links/{hash} [delete] @Param hash path string true "Hash"

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

Get ... @Summary Get link @Description Get link @ID get-link @Accept json @Produce json @Group Links @Success 200 {object} link_rpc.GetResponse @NotFound 404 {object} link_rpc.GetResponse @Router /links/{hash} [get] @Param hash path string true "Hash"

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, r *http.Request)

List ... @Summary List links @Description List links @ID list-links @Accept json @Produce json @Group Links @Success 200 {object} link_rpc.ListResponse @Router /links [get]

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

Update ... @Summary Update link @Description Update link @ID update-link @Accept json @Produce json @Group Links @Success 200 {object} link_rpc.UpdateResponse @Router /links/:hash [put] @Param link body link_rpc.UpdateRequest true "Link"

Jump to

Keyboard shortcuts

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