go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/callerid Index | Files | Directories

package callerid

import "gopkg.in/src-d/go-vitess.v1/vt/callerid"

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

Index

Package Files

callerid.go

func EffectiveCallerIDFromContext Uses

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

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

func GetComponent Uses

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 Uses

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 Uses

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 Uses

func GetUsername(im *querypb.VTGateCallerID) string

GetUsername returns the immediate caller of VTGate

func ImmediateCallerIDFromContext Uses

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

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

func NewContext Uses

func NewContext(ctx context.Context, ef *vtrpcpb.CallerID, im *querypb.VTGateCallerID) context.Context

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

func NewEffectiveCallerID Uses

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

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

func NewImmediateCallerID Uses

func NewImmediateCallerID(username string) *querypb.VTGateCallerID

NewImmediateCallerID creates a querypb.VTGateCallerID initialized with username

Directories

PathSynopsis
testsuite

Package callerid imports 3 packages (graph) and is imported by 22 packages. Updated 2019-06-13. Refresh now. Tools for package owners.