module

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package module implements reading and processing of GAE module YAMLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Name    string // e.g. "default"
	Runtime string // e.g. "go113"
	// contains filtered or unexported fields
}

Module is a loaded mutable module's YAML.

func ReadYAML

func ReadYAML(path string) (*Module, error)

ReadYAML loads the module's YAML in memory.

func (*Module) DumpYAML

func (m *Module) DumpYAML() ([]byte, error)

DumpYAML returns a pretty-printed module's YAML.

func (*Module) Process

func (m *Module) Process(appID string, vars map[string]string) (stringset.Set, error)

Process renders and normalizes module's YAML.

It throws away all legacy and unsupported fields and renders configuration variables. Roughly matches what luci-py's gae.py tool does.

For variables substitution it uses very non-standard luci-py's extension. Variables can be defined in the YAML via `luci_gae_vars` field, like so:

luci_gae_vars:
  example-app-id-dev:
    AUTH_SERVICE_HOST: auth-service-dev.appspot.com
  example-app-id-prod:
    AUTH_SERVICE_HOST: auth-service-prod.appspot.com

And then they can appear in the YAML as e.g. `${AUTH_SERVICE_HOST}`.

We use what's in the YAML as a baseline (for compatibility with existing manifests), but additionally allow overriding such vars via CLI flags of `gaedeploy` (supplied here via `vars`).

For the python counterpart, see https://chromium.googlesource.com/infra/luci/luci-py/+/9963ccd99c7/appengine/components/tool_support/gae_sdk_utils.py#221

On success returns a set of variable names that were encountered in the YAML.

Jump to

Keyboard shortcuts

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