Documentation ¶
Overview ¶
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentIDNotifyMode ¶
type AgentIDNotifyMode uint8
AgentIDNotifyMode are flags to define for which notifications the listeners are interested.
const ( // NotifyOnConnect will signal interest for notification when the agent first connect. NotifyOnConnect AgentIDNotifyMode = 1 << iota // NotifyOnReconnect will signal interest for notification when the agent reconnects. NotifyOnReconnect )
func (AgentIDNotifyMode) Includes ¶
func (a AgentIDNotifyMode) Includes(notifyMode AgentIDNotifyMode) bool
Contains will check if a AgentIDNotifyMode includes a different AgentIDNotifyMode.
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context context for the agent ID.
func NewContext ¶
NewContext creates a new ID context to allow fetching ID in concurrent manner.
func (*Context) AgentIdentity ¶
AgentIdentity provides agent identity, blocking until connect succeeded (GUID might still be empty).
func (*Context) AgentIdnOrEmpty ¶
AgentIDOrEmpty provides agent Identity when available, empty otherwise
func (*Context) Notify ¶
func (i *Context) Notify(c chan<- struct{}, notifyMode AgentIDNotifyMode)
Notify will register a channel for receiving notifications based on the level of interest.
func (*Context) SetAgentIdentity ¶
SetAgentID sets agent id
type UpdateNotifyFn ¶
type UpdateNotifyFn func(chan<- struct{}, AgentIDNotifyMode)
UpdateNotifyFn allows to register to listen for ID update events.