luci: go.chromium.org/luci/logdog/server/service Index | Files | Directories

package service

import "go.chromium.org/luci/logdog/server/service"

Index

Package Files

rt.go service.go

Variables

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,
    }
)

type Service Uses

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

    // ServiceID is the cloud project ID specified via -service-id flag.
    //
    // This is synonymous with the cloud "project ID" and the AppEngine "app ID".
    ServiceID string

    // ServiceConfig is services.cfg at the moment the process started.
    ServiceConfig *svcconfig.Config

    // Coordinator is the cached Coordinator client.
    Coordinator logdog.ServicesClient
    // contains filtered or unexported fields
}

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

func (*Service) GSClient Uses

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

GSClient returns an authenticated Google Storage client instance.

func (*Service) IntermediateStorage Uses

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) PubSubSubscriberClient Uses

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 Uses

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) SetShutdownFunc Uses

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

SetShutdownFunc sets the service shutdown function.

Directories

PathSynopsis
configPackage config implements common LogDog daemon configuration.

Package service imports 40 packages (graph). Updated 2020-07-08. Refresh now. Tools for package owners.