focus

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: GPL-3.0 Imports: 9 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"

Host is the local host to listen on.

Variables

View Source
var Port = 1042 // nolint:gochecknoglobals

Port is the port to listen on.

Functions

func TryRaise

func TryRaise() 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() (*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(version *semver.Version) (*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, *emptypb.Empty) (*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