mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
audit: per object send pool number, set number and servers per operation (#11233)
This commit is contained in:
@@ -30,7 +30,7 @@ const contextLogKey = contextKeyType("miniolog")
|
||||
// KeyVal - appended to ReqInfo.Tags
|
||||
type KeyVal struct {
|
||||
Key string
|
||||
Val string
|
||||
Val interface{}
|
||||
}
|
||||
|
||||
// ReqInfo stores the request info.
|
||||
@@ -62,7 +62,7 @@ func NewReqInfo(remoteHost, userAgent, deploymentID, requestID, api, bucket, obj
|
||||
}
|
||||
|
||||
// AppendTags - appends key/val to ReqInfo.tags
|
||||
func (r *ReqInfo) AppendTags(key string, val string) *ReqInfo {
|
||||
func (r *ReqInfo) AppendTags(key string, val interface{}) *ReqInfo {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -73,7 +73,7 @@ func (r *ReqInfo) AppendTags(key string, val string) *ReqInfo {
|
||||
}
|
||||
|
||||
// SetTags - sets key/val to ReqInfo.tags
|
||||
func (r *ReqInfo) SetTags(key string, val string) *ReqInfo {
|
||||
func (r *ReqInfo) SetTags(key string, val interface{}) *ReqInfo {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -105,6 +105,20 @@ func (r *ReqInfo) GetTags() []KeyVal {
|
||||
return append([]KeyVal(nil), r.tags...)
|
||||
}
|
||||
|
||||
// GetTagsMap - returns the user defined tags in a map structure
|
||||
func (r *ReqInfo) GetTagsMap() map[string]interface{} {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
r.RLock()
|
||||
defer r.RUnlock()
|
||||
m := make(map[string]interface{}, len(r.tags))
|
||||
for _, t := range r.tags {
|
||||
m[t.Key] = t.Val
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// SetReqInfo sets ReqInfo in the context.
|
||||
func SetReqInfo(ctx context.Context, req *ReqInfo) context.Context {
|
||||
if ctx == nil {
|
||||
|
||||
Reference in New Issue
Block a user