Documentation ¶
Index ¶
- Variables
- func InitializeRequestIdGenerator(c core.Context, config *settings.Config) error
- type DefaultRequestIdGenerator
- func (r *DefaultRequestIdGenerator) GenerateRequestId(clientIpAddr string, clientPort uint16) string
- func (r *DefaultRequestIdGenerator) GetCurrentInstanceUniqId() uint16
- func (r *DefaultRequestIdGenerator) GetCurrentServerUniqId() uint16
- func (r *DefaultRequestIdGenerator) ParseRequestIdInfo(requestId string) (*RequestIdInfo, error)
- type RequestIdContainer
- type RequestIdGenerator
- type RequestIdInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Container = &RequestIdContainer{}
)
Initialize a request id container singleton instance
Functions ¶
Types ¶
type DefaultRequestIdGenerator ¶
type DefaultRequestIdGenerator struct {
// contains filtered or unexported fields
}
DefaultRequestIdGenerator represents default request id generator
func NewDefaultRequestIdGenerator ¶
func NewDefaultRequestIdGenerator(c core.Context, config *settings.Config) (*DefaultRequestIdGenerator, error)
NewDefaultRequestIdGenerator returns a new default request id generator
func (*DefaultRequestIdGenerator) GenerateRequestId ¶
func (r *DefaultRequestIdGenerator) GenerateRequestId(clientIpAddr string, clientPort uint16) string
GenerateRequestId returns a new request id
func (*DefaultRequestIdGenerator) GetCurrentInstanceUniqId ¶
func (r *DefaultRequestIdGenerator) GetCurrentInstanceUniqId() uint16
GetCurrentInstanceUniqId returns current application instance unique id
func (*DefaultRequestIdGenerator) GetCurrentServerUniqId ¶
func (r *DefaultRequestIdGenerator) GetCurrentServerUniqId() uint16
GetCurrentServerUniqId returns current server unique id
func (*DefaultRequestIdGenerator) ParseRequestIdInfo ¶
func (r *DefaultRequestIdGenerator) ParseRequestIdInfo(requestId string) (*RequestIdInfo, error)
ParseRequestIdInfo returns a info struct which contains all information in request id
type RequestIdContainer ¶
type RequestIdContainer struct {
Current RequestIdGenerator
}
RequestIdContainer contains the current request id generator
func (*RequestIdContainer) GenerateRequestId ¶
func (u *RequestIdContainer) GenerateRequestId(clientIpAddr string, clientPort uint16) string
GenerateRequestId returns a new request id by the current request id generator
Click to show internal directories.
Click to hide internal directories.