status

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module is a fx module that provides a status Registry and registers status service handlers as grpc-gateway handlers.

func NewErrorDetails

func NewErrorDetails(e error) *statusv1.ErrorDetails

NewErrorDetails is a helper function to create a new instance of ErrorDetails.

func NewStatus

func NewStatus(d proto.Message, e error) *statusv1.Status

NewStatus creates a new instance of Status to be pushed into status registry. Use this function for creating status instead of by hand. It can either have a detail message or a detail error but not both. This is enforced by first checking for detail message to not be nil.

func RegisterStatusService

func RegisterStatusService(server *grpc.Server, reg Registry)

RegisterStatusService registers the StatusService implementation with the provided grpc server.

Types

type Registry

type Registry interface {
	GetStatus() *statusv1.Status
	SetStatus(*statusv1.Status)
	SetGroupStatus(*statusv1.GroupStatus)
	GetGroupStatus() *statusv1.GroupStatus
	Child(key string) Registry
	ChildIfExists(key string) Registry
	Parent() Registry
	Root() Registry
	Detach()
	Key() string
	HasError() bool
	GetLogger() *log.Logger
}

Registry .

func NewRegistry

func NewRegistry(logger *log.Logger) Registry

NewRegistry creates a new Registry.

type StatusService

type StatusService struct {
	statusv1.UnimplementedStatusServiceServer
	// contains filtered or unexported fields
}

StatusService is the implementation of the statusv1.StatusServiceServer interface.

func (*StatusService) GetGroupStatus

GetGroupStatus returns the group status for the requested group in the Registry.

Jump to

Keyboard shortcuts

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