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

package callinfo

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

Package callinfo stores custom values into the Context (related to the RPC source)


Package Files

callinfo.go plugin_grpc.go plugin_mysql.go

func GRPCCallInfo Uses

func GRPCCallInfo(ctx context.Context) context.Context

GRPCCallInfo returns an augmented context with a CallInfo structure, only for gRPC contexts.

func HTMLFromContext Uses

func HTMLFromContext(ctx context.Context) template.HTML

HTMLFromContext returns that value of HTML() from the context, or "" if we're not able to recover one

func MysqlCallInfo Uses

func MysqlCallInfo(ctx context.Context, c *mysql.Conn) context.Context

MysqlCallInfo returns an augmented context with a CallInfo structure, only for Mysql contexts.

func NewContext Uses

func NewContext(ctx context.Context, ci CallInfo) context.Context

NewContext adds the provided CallInfo to the context

type CallInfo Uses

type CallInfo interface {
    // RemoteAddr is the remote address information for this rpc call.
    RemoteAddr() string

    // Username is associated with this rpc call, if any.
    Username() string

    // Text is a text version of this connection, as specifically as possible.
    Text() string

    // HTML represents this rpc call connection in a web-friendly way.
    HTML() template.HTML

CallInfo is the extra data stored in the Context

func FromContext Uses

func FromContext(ctx context.Context) (CallInfo, bool)

FromContext returns the CallInfo value stored in ctx, if any.



Package callinfo imports 6 packages (graph) and is imported by 9 packages. Updated 2019-06-13. Refresh now. Tools for package owners.