post

package
v0.0.0-...-cf27a83 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

type Comment

type Comment struct {
	Author    *Author   `json:"author"`
	Created   time.Time `json:"created_on"`
	Message   string    `json:"message"`
	Moderated bool      `json:"moderated"`
}

type Post

type Post struct {
	ID      string    `json:"-"`
	Slug    string    `json:"slug"`
	Title   string    `json:"title"`
	Created time.Time `json:"created_on"`
	Author  *Author   `json:"author"`
	Message string    `json:"message"`
}

type Repository

type Repository interface {
	SearchPosts(q string, limit, offset int) ([]*Post, error)
	GetPost(slug string) (*Post, error)
	GetPostId(slug string) (string, error)
	ListComments(postID, authorID string) ([]*Comment, error)
	CountCommentsAwaitingModeration(authorID string, limit int) (int, error)
	AddPostComment(postID, authorID, message string) error
}

Jump to

Keyboard shortcuts

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