Documentation ¶
Overview ¶
Package post is a default implementation of blog post related interfaces declared in "github.com/ottemo/commerce/app/models/blog/post" package
Index ¶
- Constants
- func APICreateBlogPost(context api.InterfaceApplicationContext) (interface{}, error)
- func APIDeleteByID(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListPostAttributes(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListPosts(context api.InterfaceApplicationContext) (interface{}, error)
- func APIPostByID(context api.InterfaceApplicationContext) (interface{}, error)
- func APIUpdateByID(context api.InterfaceApplicationContext) (interface{}, error)
- type DefaultBlogPost
- func (it *DefaultBlogPost) Delete() error
- func (it *DefaultBlogPost) FromHashMap(input map[string]interface{}) error
- func (it *DefaultBlogPost) Get(attribute string) interface{}
- func (it *DefaultBlogPost) GetAttributesInfo() []models.StructAttributeInfo
- func (it *DefaultBlogPost) GetContent() string
- func (it *DefaultBlogPost) GetCreatedAt() time.Time
- func (it *DefaultBlogPost) GetExcerpt() string
- func (it *DefaultBlogPost) GetFeaturedImage() string
- func (it *DefaultBlogPost) GetID() string
- func (it *DefaultBlogPost) GetIdentifier() string
- func (it *DefaultBlogPost) GetImplementationName() string
- func (it *DefaultBlogPost) GetModelName() string
- func (it *DefaultBlogPost) GetTags() []interface{}
- func (it *DefaultBlogPost) GetTitle() string
- func (it *DefaultBlogPost) GetUpdatedAt() time.Time
- func (it *DefaultBlogPost) IsPublished() bool
- func (it *DefaultBlogPost) Load(id string) error
- func (it *DefaultBlogPost) New() (models.InterfaceModel, error)
- func (it *DefaultBlogPost) Save() error
- func (it *DefaultBlogPost) Set(attribute string, value interface{}) error
- func (it *DefaultBlogPost) SetContent(value string) error
- func (it *DefaultBlogPost) SetCreatedAt(value time.Time) error
- func (it *DefaultBlogPost) SetExcerpt(value string) error
- func (it *DefaultBlogPost) SetFeaturedImage(value string) error
- func (it *DefaultBlogPost) SetID(id string) error
- func (it *DefaultBlogPost) SetIdentifier(value string) error
- func (it *DefaultBlogPost) SetPublished(value bool) error
- func (it *DefaultBlogPost) SetTags(value []interface{}) error
- func (it *DefaultBlogPost) SetTitle(value string) error
- func (it *DefaultBlogPost) SetUpdatedAt(value time.Time) error
- func (it *DefaultBlogPost) ToHashMap() map[string]interface{}
Constants ¶
const ( ConstBlogPostCollectionName = "blog_post" ConstErrorModule = "blog" ConstErrorLevel = env.ConstErrorLevelActor )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func APICreateBlogPost ¶
func APICreateBlogPost(context api.InterfaceApplicationContext) (interface{}, error)
APICreateBlogPost creates blog post by provided data
func APIDeleteByID ¶
func APIDeleteByID(context api.InterfaceApplicationContext) (interface{}, error)
APIDeleteByID deletes post by id
func APIListPostAttributes ¶
func APIListPostAttributes(context api.InterfaceApplicationContext) (interface{}, error)
APIListPostAttributes returns a list of blog post attributes
func APIListPosts ¶
func APIListPosts(context api.InterfaceApplicationContext) (interface{}, error)
APIListPosts returns list of posts
func APIPostByID ¶
func APIPostByID(context api.InterfaceApplicationContext) (interface{}, error)
APIPostByID returns post by id
func APIUpdateByID ¶
func APIUpdateByID(context api.InterfaceApplicationContext) (interface{}, error)
APIUpdateByID updates post by id
Types ¶
type DefaultBlogPost ¶
type DefaultBlogPost struct {
// contains filtered or unexported fields
}
DefaultBlogPost is a default implementer of InterfaceBlogPost
func (*DefaultBlogPost) Delete ¶
func (it *DefaultBlogPost) Delete() error
Delete removes current blog post from DB
func (*DefaultBlogPost) FromHashMap ¶
func (it *DefaultBlogPost) FromHashMap(input map[string]interface{}) error
FromHashMap will populate object attributes from map[string]interface{}
func (*DefaultBlogPost) Get ¶
func (it *DefaultBlogPost) Get(attribute string) interface{}
Get returns an object attribute value or nil
func (*DefaultBlogPost) GetAttributesInfo ¶
func (it *DefaultBlogPost) GetAttributesInfo() []models.StructAttributeInfo
GetAttributesInfo returns the requested object attributes
func (*DefaultBlogPost) GetContent ¶
func (it *DefaultBlogPost) GetContent() string
GetContent : content getter
func (*DefaultBlogPost) GetCreatedAt ¶
func (it *DefaultBlogPost) GetCreatedAt() time.Time
GetCreatedAt : createdAt getter
func (*DefaultBlogPost) GetExcerpt ¶
func (it *DefaultBlogPost) GetExcerpt() string
GetExcerpt : excerpt getter
func (*DefaultBlogPost) GetFeaturedImage ¶
func (it *DefaultBlogPost) GetFeaturedImage() string
GetFeaturedImage : featuredImage getter
func (*DefaultBlogPost) GetID ¶
func (it *DefaultBlogPost) GetID() string
GetID returns current blog post id
func (*DefaultBlogPost) GetIdentifier ¶
func (it *DefaultBlogPost) GetIdentifier() string
GetIdentifier : identifier getter
func (*DefaultBlogPost) GetImplementationName ¶
func (it *DefaultBlogPost) GetImplementationName() string
GetImplementationName returns model implementation name
func (*DefaultBlogPost) GetModelName ¶
func (it *DefaultBlogPost) GetModelName() string
GetModelName returns model name
func (*DefaultBlogPost) GetTags ¶
func (it *DefaultBlogPost) GetTags() []interface{}
GetTags : tags getter
func (*DefaultBlogPost) GetTitle ¶
func (it *DefaultBlogPost) GetTitle() string
GetTitle : title getter
func (*DefaultBlogPost) GetUpdatedAt ¶
func (it *DefaultBlogPost) GetUpdatedAt() time.Time
GetUpdatedAt : updatedAt getter
func (*DefaultBlogPost) IsPublished ¶
func (it *DefaultBlogPost) IsPublished() bool
IsPublished : published getter
func (*DefaultBlogPost) Load ¶
func (it *DefaultBlogPost) Load(id string) error
Load loads blog post information from DB
func (*DefaultBlogPost) New ¶
func (it *DefaultBlogPost) New() (models.InterfaceModel, error)
New returns new instance of model implementation object
func (*DefaultBlogPost) Save ¶
func (it *DefaultBlogPost) Save() error
Save stores current blog post to DB
func (*DefaultBlogPost) Set ¶
func (it *DefaultBlogPost) Set(attribute string, value interface{}) error
Set will apply the given attribute value to the blog post or return an error
func (*DefaultBlogPost) SetContent ¶
func (it *DefaultBlogPost) SetContent(value string) error
SetContent : content setter
func (*DefaultBlogPost) SetCreatedAt ¶
func (it *DefaultBlogPost) SetCreatedAt(value time.Time) error
SetCreatedAt : createdAt setter
func (*DefaultBlogPost) SetExcerpt ¶
func (it *DefaultBlogPost) SetExcerpt(value string) error
SetExcerpt : excerpt setter
func (*DefaultBlogPost) SetFeaturedImage ¶
func (it *DefaultBlogPost) SetFeaturedImage(value string) error
SetFeaturedImage : featuredImage setter
func (*DefaultBlogPost) SetID ¶
func (it *DefaultBlogPost) SetID(id string) error
SetID sets current blog post id
func (*DefaultBlogPost) SetIdentifier ¶
func (it *DefaultBlogPost) SetIdentifier(value string) error
SetIdentifier : identifier setter
func (*DefaultBlogPost) SetPublished ¶
func (it *DefaultBlogPost) SetPublished(value bool) error
SetPublished : published setter
func (*DefaultBlogPost) SetTags ¶
func (it *DefaultBlogPost) SetTags(value []interface{}) error
SetTags : tags setter
func (*DefaultBlogPost) SetTitle ¶
func (it *DefaultBlogPost) SetTitle(value string) error
SetTitle : title setter
func (*DefaultBlogPost) SetUpdatedAt ¶
func (it *DefaultBlogPost) SetUpdatedAt(value time.Time) error
SetUpdatedAt : updatedAt setter
func (*DefaultBlogPost) ToHashMap ¶
func (it *DefaultBlogPost) ToHashMap() map[string]interface{}
ToHashMap returns a map[string]interface{}