services

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres 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) error
}

type Redis

type Redis interface {
}

type Services

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

func New

func New(pg Postgres, rdb Redis,
	tracer trace.Tracer) *Services

func (*Services) CreateTweet

func (s *Services) CreateTweet(ctx context.Context, username, content string) (*models.Tweet, error)

func (*Services) DeleteTweet

func (s *Services) DeleteTweet(ctx context.Context, id string) (string, error)

func (*Services) FindTweetById

func (s *Services) FindTweetById(ctx context.Context, id string) (*models.Tweet, error)

func (*Services) UpdateTweet

func (s *Services) UpdateTweet(ctx context.Context, id, content string) (*models.Tweet, error)

Jump to

Keyboard shortcuts

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