Documentation ¶
Index ¶
- Constants
- Variables
- type ArticleStore
- func (as *ArticleStore) CreateArticle(a *app.Article) error
- func (as *ArticleStore) DeleteArticle(id int) error
- func (as *ArticleStore) GetArticle(slug string) (*app.Article, error)
- func (as *ArticleStore) ListArticles(f *app.ArticleListFilter) ([]*app.Article, error)
- func (as *ArticleStore) UpdateArticle(a *app.Article) error
- type ProfilesStore
- type UserStore
Constants ¶
View Source
const ( TestPassword = "test" // Encoded hash for "test". Created with `./hashpass test` TestPasswordHash = "" /* 140-byte string literal not displayed */ )
Variables ¶
View Source
var ( ArticleValid = app.Article{ Id: 1, Title: "Title", Description: "Description", Body: "Body", Author: Author, Created: time.Date(2020, 1, 2, 3, 4, 5, 0, time.UTC), Updated: time.Date(2020, 1, 2, 3, 4, 5, 0, time.UTC), } ArticleUpdated = app.Article{ Id: 2, Title: "Other title", Description: "Other description", Body: "Other body", Author: Author, Created: time.Date(2019, 1, 2, 3, 4, 5, 0, time.UTC), Updated: time.Date(2019, 1, 2, 3, 4, 5, 0, time.UTC), } Author = app.Profile{ Id: 1, Name: "author", Bio: "bio", } )
View Source
var ( Profile1 = app.Profile{ Id: 1, Name: "test", Bio: "test bio", } Profile2 = app.Profile{ Id: 2, Name: "new", Bio: "new bio", } )
View Source
var ( UserValid = app.User{ Id: 1, Email: "test@example.com", Name: "test", PasswordHash: TestPasswordHash, } UserUpdatedUsername = app.User{ Id: 2, Email: "updated@example.com", Name: "updated", PasswordHash: TestPasswordHash, } UserInvalid = app.User{ Id: 3, Email: "invalid_hash@example.com", Name: "invalid_hash", PasswordHash: "xxx", } )
Functions ¶
This section is empty.
Types ¶
type ArticleStore ¶
ArticleStore is a fake implementation of article.Store as Go map
func NewArticleStore ¶
func NewArticleStore() *ArticleStore
func (*ArticleStore) CreateArticle ¶
func (as *ArticleStore) CreateArticle(a *app.Article) error
func (*ArticleStore) DeleteArticle ¶
func (as *ArticleStore) DeleteArticle(id int) error
func (*ArticleStore) GetArticle ¶
func (as *ArticleStore) GetArticle(slug string) (*app.Article, error)
func (*ArticleStore) ListArticles ¶
func (as *ArticleStore) ListArticles(f *app.ArticleListFilter) ([]*app.Article, error)
func (*ArticleStore) UpdateArticle ¶
func (as *ArticleStore) UpdateArticle(a *app.Article) error
type ProfilesStore ¶
type ProfilesStore struct {
// contains filtered or unexported fields
}
ProfilesStore is a fake implementation of profiles.Store as Go map
func NewProfilesStore ¶
func NewProfilesStore() *ProfilesStore
func (*ProfilesStore) GetProfile ¶
type UserStore ¶
UserStore is a fake implementation of user.Store as Go map
func NewUserStore ¶
func NewUserStore() *UserStore
Click to show internal directories.
Click to hide internal directories.