Documentation
¶
Index ¶
- func Max(x, y int) int
- func Min(x, y int) int
- func New(port *string, apiConfig string)
- type API
- type Author
- type Blog
- type Category
- type CategoryList
- type GORMProjection
- func (p *GORMProjection) GetAuthors(page int, limit int, query string, sortOptions map[string]string, ...) ([]*Author, int64, error)
- func (p *GORMProjection) GetBlogByID(id string) (*Blog, error)
- func (p *GORMProjection) GetBlogByURL(url string) (*Blog, error)
- func (p *GORMProjection) GetBlogs() ([]*Blog, error)
- func (p *GORMProjection) GetCategories(page int, limit int, sortOptions map[string]string, ...) ([]*Category, int64, error)
- func (p *GORMProjection) GetEventHandler() weos.EventHandler
- func (p *GORMProjection) GetPosts(page int, limit int, query string, sortOptions map[string]string, ...) ([]*Post, int64, error)
- func (p *GORMProjection) Migrate(ctx context.Context) error
- func (p *GORMProjection) Persist(entities []weos.Entity) error
- func (p *GORMProjection) Remove(entities []weos.Entity) error
- type Post
- type PostList
- type Projection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
weoscontroller.API
Application weos.Application
Log weos.Log
DB *sql.DB
Client *http.Client
// contains filtered or unexported fields
}
func (*API) GetCategories ¶
Get list of categories
func (*API) Initialize ¶
type Blog ¶
type Blog struct {
gorm.Model
ID string `gorm:"primarykey"`
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"`
}
type CategoryList ¶
type GORMProjection ¶
type GORMProjection struct {
// contains filtered or unexported fields
}
func NewProjection ¶
func NewProjection(application weos.Application) (*GORMProjection, error)
func (*GORMProjection) GetAuthors ¶
func (p *GORMProjection) GetAuthors(page int, limit int, query string, sortOptions map[string]string, filterOptions map[string]interface{}) ([]*Author, int64, error)
GetAuthors get all the authors in the aggregator
func (*GORMProjection) GetBlogByID ¶
func (p *GORMProjection) GetBlogByID(id string) (*Blog, error)
func (*GORMProjection) GetBlogByURL ¶
func (p *GORMProjection) GetBlogByURL(url string) (*Blog, error)
func (*GORMProjection) GetBlogs ¶
func (p *GORMProjection) GetBlogs() ([]*Blog, error)
func (*GORMProjection) GetCategories ¶
func (*GORMProjection) GetEventHandler ¶
func (p *GORMProjection) GetEventHandler() weos.EventHandler
func (*GORMProjection) GetPosts ¶
func (p *GORMProjection) GetPosts(page int, limit int, query string, sortOptions map[string]string, filterOptions map[string]interface{}) ([]*Post, int64, error)
GetPosts get all the posts in the aggregator
type Post ¶
type Post struct {
gorm.Model
ID string `gorm:"primarykey"`
Title string `json:"title"`
Description string `json:"description"`
Content string `json:"content"`
BlogID string `json:"blogId"`
Blog *Blog `json:"blog"`
Link string `json:"link"`
Categories []*Category `json:"categories,omitempty" gorm:"many2many:post_categories;"`
Published string `json:"published"`
PublishDate time.Time
Views int `json:"views"`
}
type Projection ¶
type Projection interface {
weos.Projection
GetBlogByID(id string) (*Blog, error)
GetBlogByURL(url string) (*Blog, error)
GetPosts(page int, limit int, query string, sortOptions map[string]string, filterOptions map[string]interface{}) ([]*Post, int64, error)
GetCategories(page int, limit int, sortOptions map[string]string, filterOptions map[string]interface{}) ([]*Category, int64, error)
}
Click to show internal directories.
Click to hide internal directories.