Пример #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
}
Пример #2
0
func NewCrawlerConfigDriver(ns string, ctx appengine.Context, logger wcg.Logger) *CrawlerConfigDriver {
	d := &CrawlerConfigDriver{
		datastore.NewDriver(ctx, "CrawlerConfig", logger),
	}
	d.Namespace(ns)
	return d
}
Пример #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
}
Пример #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
	}
}
Пример #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
	}
}
Пример #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)}
}
Пример #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
}