handlers

package
v0.0.0-...-c8397cc Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCanNotGetUser = errors.New("could not get user from context")
)

Functions

This section is empty.

Types

type Handlers

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

func New

func New(service Service, log *slog.Logger, tracer trace.Tracer) *Handlers

func (*Handlers) CreateTweet

func (h *Handlers) CreateTweet(c *gin.Context)

func (*Handlers) DeleteTweet

func (h *Handlers) DeleteTweet(c *gin.Context)

func (*Handlers) FindTweetById

func (h *Handlers) FindTweetById(c *gin.Context)

func (*Handlers) UpdateTweet

func (h *Handlers) UpdateTweet(c *gin.Context)

type Service

type Service interface {
	FindTweetById(ctx context.Context, id string) (*models.Tweet, error)
	CreateTweet(ctx context.Context, username, content string) (*models.Tweet, error)
	UpdateTweet(ctx context.Context, id, content string) (*models.Tweet, error)
	DeleteTweet(ctx context.Context, id string) (string, error)
}

Jump to

Keyboard shortcuts

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