luci: go.chromium.org/luci/server/gaeemulation Index | Files

package gaeemulation

import "go.chromium.org/luci/server/gaeemulation"

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

Package Files

module.go

func NewModule Uses

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 Uses

func NewModuleFromFlags() module.Module

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(...).

type ModuleOptions Uses

type ModuleOptions struct{}

ModuleOptions are empty for now but exist to make the gaeemulation interface similar to interfaces of other modules.

func (*ModuleOptions) Register Uses

func (o *ModuleOptions) Register(f *flag.FlagSet)

Register registers the command line flags.

Package gaeemulation imports 11 packages (graph) and is imported by 6 packages. Updated 2020-11-26. Refresh now. Tools for package owners.