Documentation ¶
Overview ¶
Package seo implements a set of API intended to provide SEO optimizations
Index ¶
- Constants
- func APICreateSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
- func APIDeleteSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGenerateSitemap(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGetSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGetSEOItemByID(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGetSitemap(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListSEOItems(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListSEOItemsAlt(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListSeoAttributes(context api.InterfaceApplicationContext) (interface{}, error)
- func APIUpdateSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
- func GetSEOItemCollectionModel() (seo.InterfaceSEOCollection, error)
- type DefaultSEOCollection
- func (it *DefaultSEOCollection) GetDBCollection() db.InterfaceDBCollection
- func (it *DefaultSEOCollection) GetImplementationName() string
- func (it *DefaultSEOCollection) GetModelName() string
- func (it *DefaultSEOCollection) List() ([]models.StructListItem, error)
- func (it *DefaultSEOCollection) ListAddExtraAttribute(attribute string) error
- func (it *DefaultSEOCollection) ListFilterAdd(attribute string, operator string, value interface{}) error
- func (it *DefaultSEOCollection) ListFilterReset() error
- func (it *DefaultSEOCollection) ListLimit(offset int, limit int) error
- func (it *DefaultSEOCollection) ListSEOItems() []seo.InterfaceSEOItem
- func (it *DefaultSEOCollection) New() (models.InterfaceModel, error)
- type DefaultSEOItem
- func (it *DefaultSEOItem) Delete() error
- func (it *DefaultSEOItem) FromHashMap(input map[string]interface{}) error
- func (it *DefaultSEOItem) Get(attribute string) interface{}
- func (it *DefaultSEOItem) GetAttributesInfo() []models.StructAttributeInfo
- func (it *DefaultSEOItem) GetCollection() models.InterfaceCollection
- func (it *DefaultSEOItem) GetID() string
- func (it *DefaultSEOItem) GetImplementationName() string
- func (it *DefaultSEOItem) GetMetaDescription() string
- func (it *DefaultSEOItem) GetMetaKeywords() string
- func (it *DefaultSEOItem) GetModelName() string
- func (it *DefaultSEOItem) GetRewrite() string
- func (it *DefaultSEOItem) GetTitle() string
- func (it *DefaultSEOItem) GetType() string
- func (it *DefaultSEOItem) GetURL() string
- func (it *DefaultSEOItem) Load(id string) error
- func (it *DefaultSEOItem) New() (models.InterfaceModel, error)
- func (it *DefaultSEOItem) Save() error
- func (it *DefaultSEOItem) Set(attribute string, value interface{}) error
- func (it *DefaultSEOItem) SetID(id string) error
- func (it *DefaultSEOItem) SetURL(value string) error
- func (it *DefaultSEOItem) ToHashMap() map[string]interface{}
Constants ¶
const ( ConstCollectionNameURLRewrites = "url_rewrites" ConstSitemapFilePath = "sitemap.xml" ConstSitemapExpireSec = 60 * 60 * 24 ConstErrorModule = "seo" ConstErrorLevel = env.ConstErrorLevelActor )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func APICreateSEOItem ¶
func APICreateSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
APICreateSEOItem creates a new SEO item
- "url" and "rewrite" attributes are required
func APIDeleteSEOItem ¶
func APIDeleteSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
APIDeleteSEOItem deletes specified SEO item
- SEO item id should be specified in "itemID" argument
func APIGenerateSitemap ¶
func APIGenerateSitemap(context api.InterfaceApplicationContext) (interface{}, error)
APIGenerateSitemap generates a new sitemap based on SEO records
- generates sitemap any time called (no cache used)
- result is not a JSON but "text/xml"
func APIGetSEOItem ¶
func APIGetSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
APIGetSEOItem returns SEO item for a specified url
- SEO url should be specified in "url" argument
func APIGetSEOItemByID ¶
func APIGetSEOItemByID(context api.InterfaceApplicationContext) (interface{}, error)
APIGetSEOItemByID returns SEO item for a specified id
func APIGetSitemap ¶
func APIGetSitemap(context api.InterfaceApplicationContext) (interface{}, error)
APIGetSitemap returns SEO records based sitemap (auto re-generating it if needed)
- result is not a JSON but "text/xml"
func APIListSEOItems ¶
func APIListSEOItems(context api.InterfaceApplicationContext) (interface{}, error)
APIListSEOItems returns a list registered SEO records
func APIListSEOItemsAlt ¶
func APIListSEOItemsAlt(context api.InterfaceApplicationContext) (interface{}, error)
APIListSEOItemsAlt returns a list registered SEO records
func APIListSeoAttributes ¶
func APIListSeoAttributes(context api.InterfaceApplicationContext) (interface{}, error)
APIListSeoAttributes returns a list of seo item attributes
func APIUpdateSEOItem ¶
func APIUpdateSEOItem(context api.InterfaceApplicationContext) (interface{}, error)
APIUpdateSEOItem updates existing SEO item
- SEO item id should be specified in "itemID" argument
func GetSEOItemCollectionModel ¶
func GetSEOItemCollectionModel() (seo.InterfaceSEOCollection, error)
GetSEOItemCollectionModel retrieves current InterfaceSEOCollection model implementation
Types ¶
type DefaultSEOCollection ¶
type DefaultSEOCollection struct {
// contains filtered or unexported fields
}
DefaultSEOCollection is a default implementer of InterfaceSEOCollection
func (*DefaultSEOCollection) GetDBCollection ¶
func (it *DefaultSEOCollection) GetDBCollection() db.InterfaceDBCollection
GetDBCollection returns database collection
func (*DefaultSEOCollection) GetImplementationName ¶
func (it *DefaultSEOCollection) GetImplementationName() string
GetImplementationName returns model implementation name
func (*DefaultSEOCollection) GetModelName ¶
func (it *DefaultSEOCollection) GetModelName() string
GetModelName returns model name
func (*DefaultSEOCollection) List ¶
func (it *DefaultSEOCollection) List() ([]models.StructListItem, error)
List enumerates items of model type
func (*DefaultSEOCollection) ListAddExtraAttribute ¶
func (it *DefaultSEOCollection) ListAddExtraAttribute(attribute string) error
ListAddExtraAttribute allows to obtain additional attributes from List() function
func (*DefaultSEOCollection) ListFilterAdd ¶
func (it *DefaultSEOCollection) ListFilterAdd(attribute string, operator string, value interface{}) error
ListFilterAdd adds selection filter to List() function
func (*DefaultSEOCollection) ListFilterReset ¶
func (it *DefaultSEOCollection) ListFilterReset() error
ListFilterReset clears presets made by ListFilterAdd() and ListAddExtraAttribute() functions
func (*DefaultSEOCollection) ListLimit ¶
func (it *DefaultSEOCollection) ListLimit(offset int, limit int) error
ListLimit specifies selection paging
func (*DefaultSEOCollection) ListSEOItems ¶
func (it *DefaultSEOCollection) ListSEOItems() []seo.InterfaceSEOItem
ListSEOItems returns array of SEO items in model instance form
func (*DefaultSEOCollection) New ¶
func (it *DefaultSEOCollection) New() (models.InterfaceModel, error)
New returns new instance of model implementation object
type DefaultSEOItem ¶
type DefaultSEOItem struct { URL string Rewrite string Type string Title string MetaKeywords string MetaDescription string // contains filtered or unexported fields }
DefaultSEOItem is a default implementer of InterfaceSEOItem
func (*DefaultSEOItem) Delete ¶
func (it *DefaultSEOItem) Delete() error
Delete removes current seo item from DB
func (*DefaultSEOItem) FromHashMap ¶
func (it *DefaultSEOItem) FromHashMap(input map[string]interface{}) error
FromHashMap will populate object attributes from map[string]interface{}
func (*DefaultSEOItem) Get ¶
func (it *DefaultSEOItem) Get(attribute string) interface{}
Get returns an object attribute value or nil
func (*DefaultSEOItem) GetAttributesInfo ¶
func (it *DefaultSEOItem) GetAttributesInfo() []models.StructAttributeInfo
GetAttributesInfo returns the requested object attributes
func (*DefaultSEOItem) GetCollection ¶
func (it *DefaultSEOItem) GetCollection() models.InterfaceCollection
GetCollection returns collection of current instance type
func (*DefaultSEOItem) GetID ¶
func (it *DefaultSEOItem) GetID() string
GetID returns current seo id
func (*DefaultSEOItem) GetImplementationName ¶
func (it *DefaultSEOItem) GetImplementationName() string
GetImplementationName returns model implementation name
func (*DefaultSEOItem) GetMetaDescription ¶
func (it *DefaultSEOItem) GetMetaDescription() string
GetMetaDescription returns description for the given seo
func (*DefaultSEOItem) GetMetaKeywords ¶
func (it *DefaultSEOItem) GetMetaKeywords() string
GetMetaKeywords returns keywords for the given seo
func (*DefaultSEOItem) GetModelName ¶
func (it *DefaultSEOItem) GetModelName() string
GetModelName returns model name
func (*DefaultSEOItem) GetRewrite ¶
func (it *DefaultSEOItem) GetRewrite() string
GetRewrite returns object id for the given seo
func (*DefaultSEOItem) GetTitle ¶
func (it *DefaultSEOItem) GetTitle() string
GetTitle returns title for the given seo
func (*DefaultSEOItem) GetType ¶
func (it *DefaultSEOItem) GetType() string
GetType returns object type for the given seo
func (*DefaultSEOItem) GetURL ¶
func (it *DefaultSEOItem) GetURL() string
GetURL returns url for the given seo
func (*DefaultSEOItem) Load ¶
func (it *DefaultSEOItem) Load(id string) error
Load loads seo information from DB
func (*DefaultSEOItem) New ¶
func (it *DefaultSEOItem) New() (models.InterfaceModel, error)
New returns new instance of model implementation object
func (*DefaultSEOItem) Save ¶
func (it *DefaultSEOItem) Save() error
Save stores current seo item to DB
func (*DefaultSEOItem) Set ¶
func (it *DefaultSEOItem) Set(attribute string, value interface{}) error
Set will apply the given attribute value to the seo or return an error
func (*DefaultSEOItem) SetID ¶
func (it *DefaultSEOItem) SetID(id string) error
SetID sets current seo id
func (*DefaultSEOItem) SetURL ¶
func (it *DefaultSEOItem) SetURL(value string) error
SetURL sets url for the given seo
func (*DefaultSEOItem) ToHashMap ¶
func (it *DefaultSEOItem) ToHashMap() map[string]interface{}
ToHashMap returns a map[string]interface{}