endpoints

package
v0.0.0-...-d60a78d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MinDuration

func MinDuration(candidates ...*duration.Duration) (exp time.Duration)

MinDuration selects the smallest duration that is > 0 from a set of duration.Duration protobufs.

If none of the supplied Durations are > 0, 0 will be returned.

func WithServices

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

WithServices installs the supplied Services instance into a Context.

Types

type ProdService

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

ProdService is an instance-global configuration for production Coordinator services. A zero-value struct should be used.

It can be installed via middleware using its Base method. This also fulfills the publisher ClientFactory interface.

func (*ProdService) Base

func (svc *ProdService) Base(c *router.Context, next router.Handler)

Base is Middleware used by Coordinator services.

It installs a production Services instance into the Context.

func (*ProdService) Client

func (svc *ProdService) Client(c context.Context) (*vkit.PublisherClient, error)

Client creates or returns a new or existing pubsub client. If the client is reused, the client context might be from a previous request on the same instance.

func (*ProdService) RecreateClient

func (svc *ProdService) RecreateClient()

RecreateClient removes the attached pubsub client so that the next Client calls returns a new client.

type ProjectBoundMessage

type ProjectBoundMessage interface {
	// GetMessageProject returns the Project to which this message is bound.
	GetMessageProject() string
}

ProjectBoundMessage describes an object that is bound to a Project namespace.

This is intended to be implemented by project-bound protobufs.

type Services

type Services interface {
	coordinator.ConfigProvider

	// ArchivalPublisher returns an ArchivalPublisher instance.
	ArchivalPublisher(context.Context) (coordinator.ArchivalPublisher, 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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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