callerid

package
v0.19.8 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 33

Documentation

Overview

Package callerid stores/retrieves CallerIDs (immediate CallerID and effective CallerID) to/from the Context

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EffectiveCallerIDFromContext

func EffectiveCallerIDFromContext(ctx context.Context) *vtrpcpb.CallerID

EffectiveCallerIDFromContext returns the EffectiveCallerID(vtrpcpb.CallerID) stored in the Context, if any

func GetComponent

func GetComponent(ef *vtrpcpb.CallerID) string

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.

func GetPrincipal

func GetPrincipal(ef *vtrpcpb.CallerID) string

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.

func GetSubcomponent

func GetSubcomponent(ef *vtrpcpb.CallerID) 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.

func GetUsername

func GetUsername(im *querypb.VTGateCallerID) string

GetUsername returns the immediate caller of VTGate

func ImmediateCallerIDFromContext

func ImmediateCallerIDFromContext(ctx context.Context) *querypb.VTGateCallerID

ImmediateCallerIDFromContext returns the ImmediateCallerID(querypb.VTGateCallerID) stored in the Context, if any

func NewContext

NewContext adds the provided EffectiveCallerID(vtrpcpb.CallerID) and ImmediateCallerID(querypb.VTGateCallerID) into the Context

func NewEffectiveCallerID

func NewEffectiveCallerID(principal string, component string, subComponent string) *vtrpcpb.CallerID

NewEffectiveCallerID creates a new vtrpcpb.CallerID with principal, component and subComponent

func NewImmediateCallerID

func NewImmediateCallerID(username string) *querypb.VTGateCallerID

NewImmediateCallerID creates a querypb.VTGateCallerID initialized with username

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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