gae: go.chromium.org/gae/service/module Index | Files

package module

import "go.chromium.org/gae/service/module"

Index

Package Files

context.go interface.go

func AddFilters Uses

func AddFilters(c context.Context, filts ...Filter) context.Context

AddFilters adds RawInterface filters to the context.

func DefaultVersion Uses

func DefaultVersion(c context.Context, module string) (string, error)

DefaultVersion returns the name of the default version for the specified module.

If module is the empty string, it means the default.

func List Uses

func List(c context.Context) ([]string, error)

List lists the names of modules belonging to this application.

func NumInstances Uses

func NumInstances(c context.Context, module, version string) (int, error)

NumInstances returns the number of instances servicing the specified module/version.

If module or version is the empty string, it means the default.

func Set Uses

func Set(c context.Context, gi RawInterface) context.Context

Set sets the current RawInterface object in the context. Useful for testing with a quick mock. This is just a shorthand SetFactory invocation to set a factory which always returns the same object.

func SetFactory Uses

func SetFactory(c context.Context, gif Factory) context.Context

SetFactory sets the function to produce RawInterface instances, as returned by the Get method.

func SetNumInstances Uses

func SetNumInstances(c context.Context, module, version string, instances int) error

SetNumInstances sets the number of instances of a given module/version.

If module or version is the empty string, it means the default.

func Start Uses

func Start(c context.Context, module, version string) error

Start starts the specified module/version.

If module or version is the empty string, it means the default.

func Stop Uses

func Stop(c context.Context, module, version string) error

Stop stops the specified module/version.

If module or version is the empty string, it means the default.

func Versions Uses

func Versions(c context.Context, module string) ([]string, error)

Versions returns the names of versions for the specified module.

If module is the empty string, it means the default.

type Factory Uses

type Factory func(context.Context) RawInterface

Factory is the function signature for factory methods compatible with SetFactory.

type Filter Uses

type Filter func(context.Context, RawInterface) RawInterface

Filter is the function signature for a filter module implementation. It gets the current module implementation, and returns a new module implementation backed by the one passed in.

type RawInterface Uses

type RawInterface interface {
    List() ([]string, error)
    NumInstances(module, version string) (int, error)
    SetNumInstances(module, version string, instances int) error
    Versions(module string) ([]string, error)
    DefaultVersion(module string) (string, error)
    Start(module, version string) error
    Stop(module, version string) error
}

RawInterface is the interface for all of the package methods which normally would be in the 'module' package.

func Raw Uses

func Raw(c context.Context) RawInterface

Raw gets the RawInterface implementation from context.

Package module imports 1 packages (graph) and is imported by 18 packages. Updated 2018-08-15. Refresh now. Tools for package owners.