luci: go.chromium.org/luci/logdog/appengine/coordinator/flex Index | Files | Directories

package flex

import "go.chromium.org/luci/logdog/appengine/coordinator/flex"

Index

Package Files

context.go services.go storage_cache.go

func WithServices Uses

func WithServices(c context.Context, s Services) context.Context

WithServices installs the supplied Services instance into a Context.

type GlobalServices Uses

type GlobalServices struct {
    // LUCIConfigProvider satisfies the ConfigProvider interface requirement.
    coordinator.LUCIConfigProvider

    // Signer is the signer instance to use.
    Signer gaesigner.Signer
    // contains filtered or unexported fields
}

GlobalServices is an application singleton that stores cross-request service structures.

It is applied to each Flex HTTP request using its Base() middleware method.

func NewGlobalServices Uses

func NewGlobalServices(c context.Context) (*GlobalServices, error)

NewGlobalServices instantiates a new GlobalServices instance.

The Context passed to GlobalServices should be a global Context not a request-specific Context, with required services installed: - auth - luci_config

func (*GlobalServices) Base Uses

func (gsvc *GlobalServices) Base(c *router.Context, next router.Handler)

Base is Middleware used by Coordinator Flex services.

It installs a production Services instance into the Context.

func (*GlobalServices) Close Uses

func (gsvc *GlobalServices) Close() error

Close closes the GlobalServices instance, releasing any retained resources.

type Services Uses

type Services interface {
    coordinator.ConfigProvider

    // Storage returns a Storage instance for the supplied log stream.
    //
    // The caller must close the returned instance if successful.
    StorageForStream(context.Context, *coordinator.LogStreamState) (coordinator.SigningStorage, error)
}

Services is a set of support services used by AppEngine Classic Coordinator endpoints.

Each instance is valid for a single request, but can be re-used throughout that request. This is advised, as the Services instance may optionally cache values.

Services methods are goroutine-safe.

func GetServices Uses

func GetServices(c context.Context) Services

GetServices gets the Services instance installed in the supplied Context.

If no Services has been installed, it will panic.

type StorageCache Uses

type StorageCache struct {
    // contains filtered or unexported fields
}

StorageCache implements a generic storage.Cache for Storage instances.

This uses the process cache for the underlying cache.

func (*StorageCache) Get Uses

func (sc *StorageCache) Get(c context.Context, key storage.CacheKey) ([]byte, bool)

Get implements storage.Cache.

func (*StorageCache) Put Uses

func (sc *StorageCache) Put(c context.Context, key storage.CacheKey, data []byte, exp time.Duration)

Put implements storage.Cache.

Directories

PathSynopsis
logs

Package flex imports 22 packages (graph) and is imported by 4 packages. Updated 2018-08-19. Refresh now. Tools for package owners.