Back to godoc.org
github.com/luci/luci-go / server / gaeemulation

Package gaeemulation

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package gaeemulation provides a server module that adds implementation of some https://godoc.org/go.chromium.org/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

func NewModule

func NewModule(opts *ModuleOptions) module.Module

NewModule returns a server module that adds implementation of some https://godoc.org/go.chromium.org/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(...).

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier