Documentation ¶
Index ¶
- func Module() fx.Option
- func NewErrorDetails(e error) *statusv1.ErrorDetails
- func NewStatus(d proto.Message, e error) *statusv1.Status
- type KeyMap
- type Registry
- func (reg *Registry) Delete(path string)
- func (reg *Registry) Delim() string
- func (reg *Registry) Exists(path string) bool
- func (reg *Registry) Get(path string) *statusv1.GroupStatus
- func (reg *Registry) GetAllFlat() (map[string]*statusv1.GroupStatus, error)
- func (reg *Registry) GetGroupStatus(ctx context.Context, req *statusv1.GroupStatusRequest) (*statusv1.GroupStatus, error)
- func (reg *Registry) GetGroups(ctx context.Context, req *emptypb.Empty) (*statusv1.Groups, error)
- func (reg *Registry) Keys() []string
- func (reg *Registry) Push(path string, status *statusv1.Status) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Module ¶
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. This recursively fills the cause field from the provided error.
Types ¶
type Registry ¶
type Registry struct { statusv1.UnimplementedStatusServiceServer // contains filtered or unexported fields }
Registry holds results.
func NewRegistry ¶
NewRegistry returns a new instance of Registry. Delim is the delimiter to use when specifying key paths, e.g., . For "parent.child.key" or / for "parent/child/key".
func (*Registry) Delete ¶
Delete removes all nested values from a given path. Clears all keys/values if no path is specified. Every empty, key on the path, is recursively deleted.
func (*Registry) Get ¶
func (reg *Registry) Get(path string) *statusv1.GroupStatus
Get returns the map[string]*Results of a given key path in the Registry. If the key path does not exist, nil is returned.
func (*Registry) GetAllFlat ¶
func (reg *Registry) GetAllFlat() (map[string]*statusv1.GroupStatus, error)
GetAllFlat returns entire flattened map[string]*Results in the Registry.
func (*Registry) GetGroupStatus ¶
func (reg *Registry) GetGroupStatus(ctx context.Context, req *statusv1.GroupStatusRequest) (*statusv1.GroupStatus, error)
GetGroupStatus returns the group status for the requested group in the Registry.