current

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: BSD-3-Clause Imports: 3 Imported by: 80

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ContextWithClientCurrent added in v1.1.2

func ContextWithClientCurrent(ctx context.Context) context.Context

ContextWithClientCurrent set ClientCurrent to the context.

func ContextWithTarsCurrent

func ContextWithTarsCurrent(ctx context.Context) context.Context

ContextWithTarsCurrent set TarsCurrent

func GetClientHash added in v1.1.2

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 added in v1.1.2

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

GetClientTimeout returns the timeout sets for the client side.

func GetDyeingKey added in v1.1.2

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

GetDyeingKey gets dyeing key from the context.

func GetDyeingUser added in v1.1.2

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

GetDyeingUser gets dyeing user from the context.

func GetPacketTypeFromContext added in v1.1.2

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

GetPacketTypeFromContext gets the PacketType from the context.

func GetRawConn added in v1.3.2

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

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

func GetRecvPkgTsFromContext added in v1.1.2

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

GetRecvPkgTsFromContext gets the recvTs from the context.

func GetReqStatusValue added in v1.1.2

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 added in v1.1.2

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

GetServerIPFromContext gets the server ip from the context.

func GetServerPortFromContext added in v1.1.2

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

GetServerPortFromContext gets the server ip from the context.

func GetTarsTrace added in v1.4.0

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

GetTarsTrace get trace data from the context.

func InitTarsTrace added in v1.4.0

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

InitTarsTrace init trace data from the trace key.

func OpenTarsTrace added in v1.4.0

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

OpenTarsTrace 开启trace

func SetClientHash added in v1.1.2

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 added in v1.1.2

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

SetClientTimeout sets the client timeout

func SetDyeingKey added in v1.1.2

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

SetDyeingKey set dyeing key to the tars current.

func SetDyeingUser added in v1.1.2

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

SetDyeingUser set dyeing user to the tars current.

func SetPacketTypeFromContext added in v1.1.2

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

SetPacketTypeFromContext set PacketType to the tars current.

func SetRawConnWithContext added in v1.3.2

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

SetRawConnWithContext set tcp/udp connection to the tars current.

func SetRecvPkgTsFromContext added in v1.1.2

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

SetRecvPkgTsFromContext set recv Ts to the tars current.

func SetReqStatusValue added in v1.1.2

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 added in v1.1.2

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

SetServerIPWithContext set Server IP to the tars current.

func SetServerPortWithContext added in v1.1.2

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

SetServerPortWithContext set server port to the tars current.

func SetTarsTrace added in v1.4.0

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

SetTarsTrace set trace data to the tars current.

Types

type ClientCurrent added in v1.1.2

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