viewmodels

package
v0.0.0-...-09e84be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterModelsForCaching

func RegisterModelsForCaching()

RegisterModelsForCaching register models to be cached in Redis Cache

func SetCacheSession

func SetCacheSession(expinminute int, c *redicache.RedisSession)

SetCacheSession set session object where cache items could be added

Types

type AuthInfo

type AuthInfo struct {
	ClientID      string `json:",omitempty"`
	ClientSecret  string `json:",omitempty"`
	Scopes        string `json:",omitempty"`
	AppUserID     string `json:",omitempty"`
	RefereshToken string `json:",omitempty"`
}

AuthInfo is used to take input from user

func (*AuthInfo) ToJSON

func (a *AuthInfo) ToJSON() []byte

ToJSON marsals instance of AuthInfo to JSON

type DbUser

type DbUser struct {
	ID   int
	Name string
}

DbUser is sample database user

func (*DbUser) Cache

func (d *DbUser) Cache(m *mango.MongoSession) *dbUserCache

Cache returns mongodb collection for Dbuser

func (DbUser) GetExpiration

func (s DbUser) GetExpiration() time.Duration

GetExpiration returns expiration duration of key

func (DbUser) GetID

func (d DbUser) GetID() interface{}

GetID implements interface to qualify for MongoDb cache

func (DbUser) GetKey

func (s DbUser) GetKey(parentid1, parentid2 string) string

GetKey - parentid1 should be publishedfor::int

func (DbUser) GetMasterKey

func (s DbUser) GetMasterKey() string

GetMasterKey - returns patter for key, just for documentation

type ListItem

type ListItem struct {
	ID       int    `json:",omitempty"`
	BigID    int64  `json:",omitempty"`
	IDStr    string `json:",omitempty"`
	DataInt  int    `json:",omitempty"`
	DataStr  string `json:",omitempty"`
	DataStr2 string `json:",omitempty"`
	Checked  bool   `json:",omitempty"`
}

ListItem is used to allow get the value form common query or procedure which extract id , title etc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL