Documentation
¶
Index ¶
- func CloseDatabase()
- func CreateUser(newUser model.User) error
- func GetLatestPosts(size uint) ([]model.Post, error)
- func GetPost(id int64) (model.Post, error)
- func GetUser(login string) (model.User, error)
- func InitializeDatabase(config string, log debug.Logger)
- func NewPost(id int64, post model.Post) error
- func PrintUsers()
- type Access
- type AccessInterface
- type PostAccess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLatestPosts ¶
GetLatestPosts for now will return all posts in the map
func InitializeDatabase ¶
InitializeDatabase is used for strating the database connection
Types ¶
type Access ¶
type Access struct {
// contains filtered or unexported fields
}
Access is used for accessing the database from services
func (*Access) CreatePost ¶
CreatePost creates a new post
func (*Access) CreateUser ¶
CreateUser tries to create a new user
func (*Access) GetLatestPosts ¶
GetLatestPosts for now will return posts ordered by data(probably there is a more efficient way to do this)
type AccessInterface ¶
AccessInterface defines methods to access data
type PostAccess ¶
type PostAccess interface {
}
PostAccess - Maybe create separated interfaces latter
Click to show internal directories.
Click to hide internal directories.