Documentation
¶
Index ¶
- Constants
- Variables
- func AddBlogCommand(url string) *weos.Command
- func GetFeedLink(baseUrl string, body io.Reader) string
- func Initialize(application weos.Application) error
- type AddBlogRequest
- type Author
- type AuthorCreatedPayload
- type Blog
- type BlogCreatedPayload
- type BlogRepository
- type BlogService
- type Post
- type PostCreatedPayload
- type Receiver
Constants ¶
View Source
const AUTHOR_CREATED = "blog.author_created"
View Source
const BLOG_ADDED = "blog.added"
View Source
const BLOG_UPDATED = "blog.updated"
View Source
const POST_CREATED = "blog.post_created"
Variables ¶
View Source
var GenerateID = func() string { return ksuid.New().String() }
Functions ¶
func AddBlogCommand ¶
func Initialize ¶
func Initialize(application weos.Application) error
Types ¶
type AddBlogRequest ¶
type AddBlogRequest struct {
Url string `json:"url"`
}
type AuthorCreatedPayload ¶
type Blog ¶
type Blog struct { weos.AggregateRoot Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` FeedURL string `json:"feedUrl,omitempty"` Authors []*Author `json:"authors,omitempty"` Posts []*Post `json:"posts,omitempty"` }
func (*Blog) Validate ¶
func (b *Blog) Validate(blog *AddBlogRequest) error
type BlogCreatedPayload ¶
type BlogCreatedPayload struct {
Blog
}
type BlogRepository ¶
type BlogRepository interface { weos.Repository GetByID(id string) *Blog }
type BlogService ¶
type BlogService struct {
// contains filtered or unexported fields
}
func NewBlogService ¶
func NewBlogService(client *http.Client, eventRepository weos.EventRepository) *BlogService
Create new repository service
func (*BlogService) AddBlog ¶
func (b *BlogService) AddBlog(blogRequest *AddBlogRequest) (*Blog, error)
Add a new blog to the aggregator.
type PostCreatedPayload ¶
Click to show internal directories.
Click to hide internal directories.