Documentation ¶
Overview ¶
Package context "Every package should have a package comment, a block comment preceding the package clause. For multi-file packages, the package comment only needs to be present in one file, and any one will do. The package comment should introduce the package and provide information relevant to the package as a whole. It will appear first on the godoc page and should set up the detailed documentation that follows."
Index ¶
- func DeleteMulti(ctx context.Context, ekx []string) error
- type Context
- type Contexts
- func AddMulti(ctx context.Context, cx []*Context) (Contexts, error)
- func AddMultiAndGetNextLimited(ctx context.Context, crsrAsString string, cx []*Context) (Contexts, string, error)
- func GetNextLimited(ctx context.Context, crsrAsString string, lim int) (Contexts, string, error)
- func UpdateMulti(ctx context.Context, cx []*Context) (Contexts, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { ID string `datastore:"-"` Value string `datastore:"-" json:"value"` ValuesBS []byte `json:"-"` Values map[string]string `datastore:"-" json:"values"` Created time.Time `json:"created"` LastModified time.Time `json:"lastModified"` PageIDs []string `datastore:"-" json:"pageIDs"` }
Context is the struct to store application contexts for pages with different languages. And returns only the requested language as Value. datastore: ",noindex" causes json naming problems !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Key's "StringID" is a fraction of the context's english value([en-US]). Useful for some cases like user's isAdmin() check.
type Contexts ¶
Contexts is map[string]*Context.
func AddMulti ¶
AddMulti creates and puts corresponding PageContexts and then puts newly created Contexts. Also, returns new Contexts and an error.
func AddMultiAndGetNextLimited ¶
func AddMultiAndGetNextLimited(ctx context.Context, crsrAsString string, cx []*Context) ( Contexts, string, error)
AddMultiAndGetNextLimited is a transaction which puts the posted entities first and then gets entities from the reseted cursor by the given limit. Finally returnes received entities with posted entities added to them as a map.
func GetNextLimited ¶
GetNextLimited returns limited entitities within an order after the given cursor. If limit is 0 or greater than 40, default limit will be used.