Package callerid stores/retrives CallerIDs (immediate CallerID and effective CallerID) to/from the Context
EffectiveCallerIDFromContext returns the EffectiveCallerID(vtrpcpb.CallerID) stored in the Context, if any
GetComponent returns the running process of the effective caller. It can for instance return hostname:port of the servlet initiating the database call, or the container engine ID used by the servlet.
GetPrincipal returns the effective user identifier, which is usually filled in with whoever made the request to the appserver, if the request came from an automated job or another system component. If the request comes directly from the Internet, or if the Vitess client takes action on its own accord, it is okay for this method to return empty string.
GetSubcomponent returns a component inside the process of effective caller, which is responsible for generating this request. Suggested values are a servlet name or an API endpoint name.
GetUsername returns the immediate caller of VTGate
ImmediateCallerIDFromContext returns the ImmediateCallerID(querypb.VTGateCallerID) stored in the Context, if any
NewContext adds the provided EffectiveCallerID(vtrpcpb.CallerID) and ImmediateCallerID(querypb.VTGateCallerID) into the Context
NewEffectiveCallerID creates a new vtrpcpb.CallerID with principal, component and subComponent
NewImmediateCallerID creates a querypb.VTGateCallerID initialized with username