focus

package
v3.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package focus provides a gRPC service for raising the application.

Index

Constants

View Source
const (
	Host = "127.0.0.1"
)

Variables

This section is empty.

Functions

func TryRaise

func TryRaise(settingsPath string) bool

TryRaise tries to raise the application by dialing the focus service. It returns true if the service is running and the application was told to raise.

func TryVersion

func TryVersion(settingsPath string) (*semver.Version, bool)

TryVersion tries to determine the version of the running application instance. It returns the version and true if the version could be determined.

Types

type Service

type Service struct {
	proto.UnimplementedFocusServer
	// contains filtered or unexported fields
}

Service is a gRPC service that can be used to raise the application.

func NewService

func NewService(locator service.Locator, version *semver.Version, panicHandler async.PanicHandler) (*Service, error)

NewService creates a new focus service. It listens on the local host and port 1042 (by default).

func (*Service) Close

func (service *Service) Close()

Close closes the service.

func (*Service) GetRaiseCh

func (service *Service) GetRaiseCh() <-chan struct{}

GetRaiseCh returns a channel on which events are sent when the application should be raised.

func (*Service) Raise

func (service *Service) Raise(_ context.Context, reason *wrapperspb.StringValue) (*emptypb.Empty, error)

Raise implements the gRPC FocusService interface; it raises the application.

func (*Service) Version

func (service *Service) Version(context.Context, *emptypb.Empty) (*proto.VersionResponse, error)

Version implements the gRPC FocusService interface; it returns the version of the service.

Directories

Path Synopsis
Package proto provides the gRPC definition of the focus service.
Package proto provides the gRPC definition of the focus service.

Jump to

Keyboard shortcuts

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