current

package
v0.0.0-...-bc1b0c2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const StatusDyedKey = "STATUS_DYED_KEY"
View Source
const StatusTraceKey = "STATUS_TRACE_KEY"

Variables

This section is empty.

Functions

func AppendResponseContext

func AppendResponseContext(ctx context.Context, c map[string]string) bool

func AppendResponseStatus

func AppendResponseStatus(ctx context.Context, c map[string]string) bool

func ContextWithClientCurrent

func ContextWithClientCurrent(ctx context.Context) context.Context

ContextWithClientCurrent set ClientCurrent to the context.

func ContextWithCloneTarsCurrent

func ContextWithCloneTarsCurrent(ctx context.Context) context.Context

func ContextWithTarsCurrent

func ContextWithTarsCurrent(ctx context.Context) context.Context

ContextWithTarsCurrent set TarsCurrent

func GetClientHash

func GetClientHash(ctx context.Context) (isOk bool, hashType int, hashCode uint32, isHash bool)

GetClientHash returns the client hash info

func GetClientIPFromContext

func GetClientIPFromContext(ctx context.Context) (string, bool)

GetClientIPFromContext gets the client ip from the context.

func GetClientPortFromContext

func GetClientPortFromContext(ctx context.Context) (string, bool)

GetClientPortFromContext gets the client ip from the context.

func GetClientTimeout

func GetClientTimeout(ctx context.Context) (isOk bool, timeout int, isTimeout bool)

GetClientTimeout returns the timeout sets for the client side.

func GetDyeingKey

func GetDyeingKey(ctx context.Context) (string, bool)

GetDyeingKey gets dyeing key from the context.

func GetDyeingUser

func GetDyeingUser(ctx context.Context) (string, bool)

GetDyeingUser gets dyeing user from the context.

func GetPacketTypeFromContext

func GetPacketTypeFromContext(ctx context.Context) (int8, bool)

GetPacketTypeFromContext gets the PacketType from the context.

func GetRawConn

func GetRawConn(ctx context.Context) (net.Conn, *net.UDPAddr, bool)

GetRawConn get the raw tcp/udp connection from the context.

func GetRecvPkgTsFromContext

func GetRecvPkgTsFromContext(ctx context.Context) (int64, bool)

GetRecvPkgTsFromContext gets the recvTs from the context.

func GetReqStatusValue

func GetReqStatusValue(ctx context.Context, key string) (string, bool)

GetReqStatusValue get req status from current in context

func GetRequestContext

func GetRequestContext(ctx context.Context) (map[string]string, bool)

GetRequestContext get request context set by user.

func GetRequestStatus

func GetRequestStatus(ctx context.Context) (map[string]string, bool)

GetRequestStatus get request status set by user.

func GetResponseContext

func GetResponseContext(ctx context.Context) (map[string]string, bool)

GetResponseContext get response context set by user.

func GetResponseStatus

func GetResponseStatus(ctx context.Context) (map[string]string, bool)

GetResponseStatus get response status set by user.

func GetServerIPFromContext

func GetServerIPFromContext(ctx context.Context) (string, bool)

GetServerIPFromContext gets the server ip from the context.

func GetServerPortFromContext

func GetServerPortFromContext(ctx context.Context) (string, bool)

GetServerPortFromContext gets the server ip from the context.

func GetTarsTrace

func GetTarsTrace(ctx context.Context) (*tarstrace.Trace, bool)

GetTarsTrace get trace data from the context.

func InitTarsTrace

func InitTarsTrace(ctx context.Context, traceKey string) bool

InitTarsTrace init trace data from the trace key.

func OpenTarsTrace

func OpenTarsTrace(ctx context.Context, traceParams bool) bool

OpenTarsTrace 开启trace

func SetClientHash

func SetClientHash(ctx context.Context, hashType int, hashCode uint32) bool

SetClientHash sets the client hash code and hash type

func SetClientIPWithContext

func SetClientIPWithContext(ctx context.Context, IP string) bool

SetClientIPWithContext set Client IP to the tars current.

func SetClientPortWithContext

func SetClientPortWithContext(ctx context.Context, port string) bool

SetClientPortWithContext set client port to the tars current.

func SetClientTimeout

func SetClientTimeout(ctx context.Context, timeout int) bool

SetClientTimeout sets the client timeout

func SetDyeingKey

func SetDyeingKey(ctx context.Context, dyeingKey string) bool

SetDyeingKey set dyeing key to the tars current.

func SetDyeingUser

func SetDyeingUser(ctx context.Context, user string) bool

SetDyeingUser set dyeing user to the tars current.

func SetPacketTypeFromContext

func SetPacketTypeFromContext(ctx context.Context, cPacketType int8) bool

SetPacketTypeFromContext set PacketType to the tars current.

func SetRawConnWithContext

func SetRawConnWithContext(ctx context.Context, conn net.Conn, udpAddr *net.UDPAddr) bool

SetRawConnWithContext set tcp/udp connection to the tars current.

func SetRecvPkgTsFromContext

func SetRecvPkgTsFromContext(ctx context.Context, recvPkgTs int64) bool

SetRecvPkgTsFromContext set recv Ts to the tars current.

func SetReqStatusValue

func SetReqStatusValue(ctx context.Context, key string, value string) bool

SetReqStatusValue set req status of current of context

func SetRequestContext

func SetRequestContext(ctx context.Context, c map[string]string) bool

SetRequestContext set the request package' context .

func SetRequestStatus

func SetRequestStatus(ctx context.Context, s map[string]string) bool

SetRequestStatus set the request package' status .

func SetResponseContext

func SetResponseContext(ctx context.Context, c map[string]string) bool

SetResponseContext set the response package' context .

func SetResponseStatus

func SetResponseStatus(ctx context.Context, s map[string]string) bool

SetResponseStatus set the response package' status .

func SetServerIPWithContext

func SetServerIPWithContext(ctx context.Context, IP string) bool

SetServerIPWithContext set Server IP to the tars current.

func SetServerPortWithContext

func SetServerPortWithContext(ctx context.Context, port string) bool

SetServerPortWithContext set server port to the tars current.

func SetTarsTrace

func SetTarsTrace(ctx context.Context, trace *tarstrace.Trace) bool

SetTarsTrace set trace data to the tars current.

Types

type ClientCurrent

type ClientCurrent struct {
	// contains filtered or unexported fields
}

ClientCurrent for passing client side info for tars framework.

type Current

type Current struct {
	// contains filtered or unexported fields
}

Current contains message for the specify request. This current is used for server side.

Jump to

Keyboard shortcuts

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