memory

package
v0.0.0-...-88b2b22 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	ID      uint   `json:"id"`
	Content string `json:"content"`
}

Post defines the properties of a Post to be listed

type Storage

type Storage struct {
	Posts []Post
}

Storage Memory keeps data in memory

func (*Storage) AddPost

func (s *Storage) AddPost(u adding.Post) error

AddPost saves the given Post to the repository

func (*Storage) GetAllPosts

func (s *Storage) GetAllPosts() ([]listing.Post, error)

GetAllPosts returns all Posts from the storage

Jump to

Keyboard shortcuts

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