link

package
v0.0.0-...-e3c39ba Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(log logger.Logger, linkServiceClient link_rpc.LinkServiceClient) Controller

NewController - create new link controller

func (c *Controller) AddLink(w http.ResponseWriter, r *http.Request)

AddLink - add link

func (c *Controller) DeleteLink(w http.ResponseWriter, r *http.Request, hash string)

DeleteLink - delete link

func (c *Controller) GetLink(w http.ResponseWriter, r *http.Request, hash string)

GetLink - get link by hash

func (c *Controller) GetLinks(w http.ResponseWriter, r *http.Request, params api.GetLinksParams)

GetLinks - get links

func (c *Controller) UpdateLinks(w http.ResponseWriter, r *http.Request)

UpdateLinks - update link

type ErrorDetail

type ErrorDetail struct {
	Code string `json:"code"`
	Desc string `json:"desc"`
}

ErrorDetail represents a structured error message

type ErrorResponse

type ErrorResponse struct {
	Messages []ErrorDetail `json:"messages"`
}

ErrorResponse is used to send a detailed error response

func ErrMessages

func ErrMessages(err error) *ErrorResponse

ErrMessages creates an ErrorResponse from a given error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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