Documentation ¶
Overview ¶
Package gaeemulation provides a server module that adds implementation of some https://godoc.org/go.chromium.org/luci/gae APIs to the global server context.
The implementation is based on regular Cloud APIs and works from anywhere (not necessarily from Appengine).
Usage:
func main() { modules := []module.Module{ gaeemulation.NewModuleFromFlags(), } server.Main(nil, modules, func(srv *server.Server) error { srv.Routes.GET("/", ..., func(c *router.Context) { ent := Entity{ID: "..."} err := datastore.Get(c.Context, &ent) ... }) return nil }) }
TODO(vadimsh): Currently provides datastore API only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewModule ¶
func NewModule(opts *ModuleOptions) module.Module
NewModule returns a server module that adds implementation of some https://godoc.org/go.chromium.org/luci/gae APIs to the global server context.
func NewModuleFromFlags ¶
NewModuleFromFlags is a variant of NewModule that initializes options through command line flags.
Calling this function registers flags in flag.CommandLine. They are usually parsed in server.Main(...).
Types ¶
type ModuleOptions ¶
type ModuleOptions struct{}
ModuleOptions are empty for now but exist to make the gaeemulation interface similar to interfaces of other modules.
func (*ModuleOptions) Register ¶
func (o *ModuleOptions) Register(f *flag.FlagSet)
Register registers the command line flags.