Exemple #1
0
func NewIEpgDriver(ns string, ctx appengine.Context, logger wcg.Logger) *IEpgDriver {
	d := &IEpgDriver{
		datastore.NewDriver(ctx, "IEpg", logger),
	}
	d.Namespace(ns)
	return d
}
func NewCrawlerConfigDriver(ns string, ctx appengine.Context, logger wcg.Logger) *CrawlerConfigDriver {
	d := &CrawlerConfigDriver{
		datastore.NewDriver(ctx, "CrawlerConfig", logger),
	}
	d.Namespace(ns)
	return d
}
Exemple #3
0
func NewTvRecordDriver(ns string, ctx appengine.Context, logger wcg.Logger) *TvRecordDriver {
	d := &TvRecordDriver{
		datastore.NewDriver(ctx, "Record", logger),
	}
	d.Namespace(ns)
	return d
}
Exemple #4
0
func (appCtx *AppContext) NewDriverWithNamespace(kind string, ns string) *datastore.Driver {
	d := datastore.NewDriver(appCtx.Context, kind, appCtx.Logger)
	if appCtx.App != nil && appCtx.App.Key != "" {
		return d.Namespace(fmt.Sprintf("%s.%s", appCtx.App.Key, ns))
	} else {
		return d
	}
}
Exemple #5
0
func (appCtx *AppContext) NewDriver(kind string) *datastore.Driver {
	d := datastore.NewDriver(appCtx.Context, kind, appCtx.Logger)
	if appCtx.App != nil && appCtx.App.Key != "" {
		return d.Namespace(appCtx.App.Key)
	} else {
		return d
	}
}
Exemple #6
0
func NewApiTokenDriver(appCtx *AppContext) *ApiTokenDriver {
	// We don't use appCtx.NewDriver since ApiToken might be used in multiple context,
	return &ApiTokenDriver{datastore.NewDriver(appCtx.Context, "ApiToken", appCtx.Logger)}
}
Exemple #7
0
func NewTvChannelDriver(ns string, ctx appengine.Context, logger wcg.Logger) *TvChannelDriver {
	d := &TvChannelDriver{datastore.NewDriver(ctx, "TvChannel", logger)}
	d.Namespace(ns)
	return d
}