service

package
v0.0.0-...-35d8de9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidConfig is an error that is returned when the supplied
	// configuration is invalid.
	ErrInvalidConfig = errors.New("invalid configuration")

	// CoordinatorScopes is the set of OAuth2 scopes to use for the Coordinator
	// client.
	CoordinatorScopes = []string{
		commonAuth.OAuthScopeEmail,
	}
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// Name is the name of this service. It is used for logging, metrics, and
	// user agent string generation.
	//
	// If empty, a service name will be inferred from the command-line arguments.
	Name string

	// DefaultAuthOptions provide default values for authentication related
	// options (most notably SecretsDir: a directory with token cache).
	DefaultAuthOptions commonAuth.Options

	// Flags is the set of flags that will be used by the Service.
	Flags flag.FlagSet
	// contains filtered or unexported fields
}

Service is a base class full of common LogDog service application parameters.

func (*Service) Coordinator

func (s *Service) Coordinator() logdog.ServicesClient

Coordinator returns the cached Coordinator client.

func (*Service) GSClient

func (s *Service) GSClient(c context.Context, project string) (gs.Client, error)

GSClient returns an authenticated Google Storage client instance.

func (*Service) IntermediateStorage

func (s *Service) IntermediateStorage(c context.Context, rw bool) (storage.Storage, error)

IntermediateStorage instantiates the configured intermediate Storage instance.

If "rw" is true, Read/Write access will be requested. Otherwise, read-only access will be requested.

func (*Service) ProjectConfig

func (s *Service) ProjectConfig(c context.Context, project string) (*svcconfig.ProjectConfig, error)

ProjectConfig returns the current service's project configuration for project.

func (*Service) ProjectConfigPath

func (s *Service) ProjectConfigPath(project string) (cfglib.Set, string)

ProjectConfigPath returns the ConfigSet and path to the current service's project configuration for project.

func (*Service) PubSubSubscriberClient

func (s *Service) PubSubSubscriberClient(c context.Context, projectID string) (*pubsub.Client, error)

PubSubSubscriberClient returns a Pub/Sub client instance that is authenticated with Pub/Sub subscriber scopes.

func (*Service) Run

func (s *Service) Run(c context.Context, f func(context.Context) error)

Run performs service-wide initialization and invokes the specified run function.

func (*Service) ServiceConfig

func (s *Service) ServiceConfig() *svcconfig.Config

ServiceConfig returns the configuration data for the current service.

func (*Service) ServiceConfigPath

func (s *Service) ServiceConfigPath() (cfglib.Set, string)

ServiceConfigPath returns the ConfigSet and path to the current service's configuration.

func (*Service) ServiceID

func (s *Service) ServiceID() string

ServiceID returns the service ID.

This is synonymous with the cloud "project ID" and the AppEngine "app ID".

func (*Service) SetShutdownFunc

func (s *Service) SetShutdownFunc(f func())

SetShutdownFunc sets the service shutdown function.

Directories

Path Synopsis
Package config implements common LogDog daemon configuration.
Package config implements common LogDog daemon configuration.

Jump to

Keyboard shortcuts

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