gaeemulation

package
v0.0.0-...-4a11b79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL