info

package
v2.16.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package info implements the info map that is used to distribute key–value pair between debugd instances.

Index

Constants

This section is empty.

Variables

View Source
var ErrInfoAlreadySet = errors.New("info already set")

ErrInfoAlreadySet is returned if the info map has already been set.

Functions

This section is empty.

Types

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map is a thread-safe map of info, with triggers that are run when the map is set.

func NewMap

func NewMap() *Map

NewMap creates a new Map object.

func (*Map) Get

func (i *Map) Get(key string) (string, bool, error)

Get returns the value of the info with the given key.

func (*Map) GetCopy

func (i *Map) GetCopy() (map[string]string, error)

GetCopy returns a copy of the info map.

func (*Map) GetProto

func (i *Map) GetProto() ([]*servicepb.Info, error)

GetProto returns the info map as a slice of info proto.

func (*Map) Received added in v2.6.0

func (i *Map) Received() bool

Received returns true if the info map has been set.

func (*Map) RegisterOnReceiveTrigger

func (i *Map) RegisterOnReceiveTrigger(f func(*Map))

RegisterOnReceiveTrigger registers a function that is called when the info map is set. The function mustn't block or be long-running.

func (*Map) SetProto

func (i *Map) SetProto(infos []*servicepb.Info) error

SetProto sets the info map to the given infos proto slice. It returns an error if the info map has already been set. Registered triggers are run after the info map is set.

Jump to

Keyboard shortcuts

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