|
@@ -34,17 +34,19 @@ func CreateVariables(p *Project) error {
|
|
|
).Params(
|
|
|
G.Id("ctx").Qual(IRIS_CTX, "Context"),
|
|
|
).Id(` *`).Qual(API_URL, "Filter").Id(`{
|
|
|
- var session `).Qual(MONGO, "SessionContext").Id(`
|
|
|
+ var (
|
|
|
+ options = &api.Filter{
|
|
|
+ DB:`).Id(dbid).Id(`,
|
|
|
+ Collection:`).Id(collectionid).Id(`,
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
if ctx != nil {
|
|
|
- session = api.GetSessionContext(ctx)
|
|
|
+ options.Context = ctx
|
|
|
+ options.SessionContext = api.GetSessionContext(ctx)
|
|
|
}
|
|
|
|
|
|
- return &api.Filter{
|
|
|
- DB:`).Id(dbid).Id(`,
|
|
|
- Collection:`).Id(collectionid).Id(`,
|
|
|
- SessionContext: session,
|
|
|
- }
|
|
|
+ return options
|
|
|
}
|
|
|
`).Line())
|
|
|
|