Documentation ¶
Index ¶
- Constants
- func ContextWithClientCurrent(ctx context.Context) context.Context
- func ContextWithTarsCurrent(ctx context.Context) context.Context
- func GetClientHash(ctx context.Context) (isOk bool, hashType int, hashCode uint32, isHash bool)
- func GetClientIPFromContext(ctx context.Context) (string, bool)
- func GetClientPortFromContext(ctx context.Context) (string, bool)
- func GetClientTimeout(ctx context.Context) (isOk bool, timeout int, isTimeout bool)
- func GetDyeingKey(ctx context.Context) (string, bool)
- func GetDyeingUser(ctx context.Context) (string, bool)
- func GetPacketTypeFromContext(ctx context.Context) (int8, bool)
- func GetRecvPkgTsFromContext(ctx context.Context) (int64, bool)
- func GetReqStatusValue(ctx context.Context, key string) (string, bool)
- func GetRequestContext(ctx context.Context) (map[string]string, bool)
- func GetRequestStatus(ctx context.Context) (map[string]string, bool)
- func GetResponseContext(ctx context.Context) (map[string]string, bool)
- func GetResponseStatus(ctx context.Context) (map[string]string, bool)
- func GetServerIPFromContext(ctx context.Context) (string, bool)
- func GetServerPortFromContext(ctx context.Context) (string, bool)
- func SetClientHash(ctx context.Context, hashType int, hashCode uint32) bool
- func SetClientIPWithContext(ctx context.Context, IP string) bool
- func SetClientPortWithContext(ctx context.Context, port string) bool
- func SetClientTimeout(ctx context.Context, timeout int) bool
- func SetDyeingKey(ctx context.Context, dyeingKey string) bool
- func SetDyeingUser(ctx context.Context, user string) bool
- func SetPacketTypeFromContext(ctx context.Context, cPacketType int8) bool
- func SetRecvPkgTsFromContext(ctx context.Context, recvPkgTs int64) bool
- func SetReqStatusValue(ctx context.Context, key string, value string) bool
- func SetRequestContext(ctx context.Context, c map[string]string) bool
- func SetRequestStatus(ctx context.Context, s map[string]string) bool
- func SetResponseContext(ctx context.Context, c map[string]string) bool
- func SetResponseStatus(ctx context.Context, s map[string]string) bool
- func SetServerIPWithContext(ctx context.Context, IP string) bool
- func SetServerPortWithContext(ctx context.Context, port string) bool
- type ClientCurrent
- type Current
Constants ¶
const STATUS_DYED_KEY = "STATUS_DYED_KEY"
Variables ¶
This section is empty.
Functions ¶
func ContextWithClientCurrent ¶ added in v1.1.2
ContextWithClientCurrent set ClientCurrent to the context.
func ContextWithTarsCurrent ¶
ContextWithTarsCurrent set TarsCurrent
func GetClientHash ¶ added in v1.1.2
GetClientHash returns the client hash info
func GetClientIPFromContext ¶
GetClientIPFromContext gets the client ip from the context.
func GetClientPortFromContext ¶
GetClientPortFromContext gets the client ip from the context.
func GetClientTimeout ¶ added in v1.1.2
GetClientTimeout returns the timeout sets for the client side.
func GetDyeingKey ¶ added in v1.1.2
GetDyeingKey gets dyeing key from the context.
func GetDyeingUser ¶ added in v1.1.2
GetDyeingUser gets dyeing user from the context.
func GetPacketTypeFromContext ¶ added in v1.1.2
GetPacketTypeFromContext gets the PacketType from the context.
func GetRecvPkgTsFromContext ¶ added in v1.1.2
GetRecvTsFromContext gets the recvTs from the context.
func GetReqStatusValue ¶ added in v1.1.2
GetReqStatusValue get req status from current in context
func GetRequestContext ¶
GetRequestContext get request context set by user.
func GetRequestStatus ¶
GetRequestStatus get request status set by user.
func GetResponseContext ¶
GetResponseContext get response context set by user.
func GetResponseStatus ¶
GetResponseStatus get response status set by user.
func GetServerIPFromContext ¶ added in v1.1.2
GetServerIPFromContext gets the server ip from the context.
func GetServerPortFromContext ¶ added in v1.1.2
GetServerPortFromContext gets the server ip from the context.
func SetClientHash ¶ added in v1.1.2
SetClientHash sets the client hash code and hash type
func SetClientIPWithContext ¶
SetClientIPWithContext set Client IP to the tars current.
func SetClientPortWithContext ¶
SetClientPortWithContext set client port to the tars current.
func SetClientTimeout ¶ added in v1.1.2
SetClientTimeout sets the client timeout
func SetDyeingKey ¶ added in v1.1.2
SetDyeingKey set dyeing key to the tars current.
func SetDyeingUser ¶ added in v1.1.2
SetDyeingUser set dyeing user to the tars current.
func SetPacketTypeFromContext ¶ added in v1.1.2
SetPacketTypeFromContext set PacketType to the tars current.
func SetRecvPkgTsFromContext ¶ added in v1.1.2
SetRecvTsFromContext set recv Ts to the tars current.
func SetReqStatusValue ¶ added in v1.1.2
SetReqStatusValue set req status of current of context
func SetRequestContext ¶
SetRequestContext set the request package' context .
func SetRequestStatus ¶
SetRequestStatus set the request package' status .
func SetResponseContext ¶
SetResponseContext set the response package' context .
func SetResponseStatus ¶
SetResponseStatus set the response package' status .
func SetServerIPWithContext ¶ added in v1.1.2
SetServerIPWithContext set Server IP 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.