inmemory

package
v0.0.0-...-f59f382 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryStore

type InMemoryStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewInMemoryStore

func NewInMemoryStore() *InMemoryStore

func (*InMemoryStore) CreateComment

func (s *InMemoryStore) CreateComment(comment *models.Comment) (*models.Comment, error)

func (*InMemoryStore) CreatePost

func (s *InMemoryStore) CreatePost(post *models.Post) (*models.Post, error)

func (*InMemoryStore) GetComments

func (s *InMemoryStore) GetComments(postID uint, limit *int, offset *int) ([]models.Comment, error)

func (*InMemoryStore) GetPostById

func (s *InMemoryStore) GetPostById(id uint) (*models.Post, error)

func (*InMemoryStore) GetPosts

func (s *InMemoryStore) GetPosts() ([]*models.Post, error)

Jump to

Keyboard shortcuts

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