Documentation
¶
Index ¶
- Constants
- type ShowcaseCategories
- type ShowcaseCategoryWeight
- type ShowcaseEngine
- func (instance *ShowcaseEngine) Categories() *ShowcaseCategories
- func (instance *ShowcaseEngine) Delete(key string) (interface{}, error)
- func (instance *ShowcaseEngine) Get(key string) (interface{}, error)
- func (instance *ShowcaseEngine) Put(payload interface{}, timestamp int64, category string) (interface{}, error)
- func (instance *ShowcaseEngine) Query(sessionId string, limit int) []interface{}
- func (instance *ShowcaseEngine) Reset()
- func (instance *ShowcaseEngine) ResetSession(sessionId string)
- func (instance *ShowcaseEngine) SetAutoResetSession(value bool)
- func (instance *ShowcaseEngine) SetCategoryWeight(category string, inTime bool, weight int) map[string]ShowcaseCategoryWeight
- func (instance *ShowcaseEngine) SetRoot(value string)
- func (instance *ShowcaseEngine) SetSessionCategoryWeight(sessionId, category string, inTime bool, weight int) map[string]ShowcaseCategoryWeight
- func (instance *ShowcaseEngine) Update(key string, payload interface{}) (interface{}, error)
Constants ¶
View Source
const ( COLL_SHOWCASE_CONTENTS = "dbal_showcase_contents" COLL_SHOWCASE_SESSIONS = "dbal_showcase_sessions" COLL_SHOWCASE_SESSIONS_CACHE = "dbal_showcase_sessions_cache" // params used in session FLD_DBKEY = "_key" FLD_SESSION_ID = "session_id" // each user has a session id FLD_TIMESTAMP = "timestamp" FLD_PAYLOAD = "payload" FLD_KEY = "key" FLD_CATEGORY = "category" FLD_CATEGORY_WEIGHT_IN = "category_weight_in" FLD_CATEGORY_WEIGHT_OUT = "category_weight_out" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShowcaseCategories ¶
type ShowcaseCategories struct {
// contains filtered or unexported fields
}
func NewShowcaseCategories ¶
func NewShowcaseCategories(root string) *ShowcaseCategories
func (*ShowcaseCategories) Clear ¶
func (instance *ShowcaseCategories) Clear()
func (*ShowcaseCategories) Get ¶
func (instance *ShowcaseCategories) Get(name string) ShowcaseCategoryWeight
func (*ShowcaseCategories) SetWeight ¶
func (instance *ShowcaseCategories) SetWeight(category string, inTime bool, weight int) ShowcaseCategoryWeight
type ShowcaseCategoryWeight ¶
type ShowcaseCategoryWeight struct {
WeightInDate int `json:"weight_in_date"`
WeightOutDate int `json:"weight_out_date"`
}
func GetCategoryWeight ¶
func GetCategoryWeight(data map[string]ShowcaseCategoryWeight, name string) ShowcaseCategoryWeight
type ShowcaseEngine ¶
type ShowcaseEngine struct {
// contains filtered or unexported fields
}
func NewShowcaseEngine ¶
func NewShowcaseEngine(config *gg_dbal_commons.SemanticConfigDb) (*ShowcaseEngine, error)
func (*ShowcaseEngine) Categories ¶
func (instance *ShowcaseEngine) Categories() *ShowcaseCategories
func (*ShowcaseEngine) Delete ¶
func (instance *ShowcaseEngine) Delete(key string) (interface{}, error)
Delete remove a payload
func (*ShowcaseEngine) Get ¶
func (instance *ShowcaseEngine) Get(key string) (interface{}, error)
Get return single entity by key
func (*ShowcaseEngine) Put ¶
func (instance *ShowcaseEngine) Put(payload interface{}, timestamp int64, category string) (interface{}, error)
Put put data into storage
func (*ShowcaseEngine) Query ¶
func (instance *ShowcaseEngine) Query(sessionId string, limit int) []interface{}
Query get results as array of db documents with a payload
func (*ShowcaseEngine) ResetSession ¶
func (instance *ShowcaseEngine) ResetSession(sessionId string)
ResetSession reset user session cache
func (*ShowcaseEngine) SetAutoResetSession ¶
func (instance *ShowcaseEngine) SetAutoResetSession(value bool)
SetAutoResetSession set custom autoResetSession param
func (*ShowcaseEngine) SetCategoryWeight ¶
func (instance *ShowcaseEngine) SetCategoryWeight(category string, inTime bool, weight int) map[string]ShowcaseCategoryWeight
SetCategoryWeight set a custom global Category Weight
func (*ShowcaseEngine) SetRoot ¶
func (instance *ShowcaseEngine) SetRoot(value string)
SetRoot set custom working root (default is "./_workspace/dbal/showcase/")
func (*ShowcaseEngine) SetSessionCategoryWeight ¶
func (instance *ShowcaseEngine) SetSessionCategoryWeight(sessionId, category string, inTime bool, weight int) map[string]ShowcaseCategoryWeight
SetSessionCategoryWeight change weight just for one user session
func (*ShowcaseEngine) Update ¶
func (instance *ShowcaseEngine) Update(key string, payload interface{}) (interface{}, error)
Update update a payload
Click to show internal directories.
Click to hide internal directories.