mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-16 22:37:08 -05:00
support attributes in session.Content
This commit is contained in:
parent
8de236b08c
commit
9efa8941ec
@ -67,19 +67,19 @@ type Content struct {
|
|||||||
|
|
||||||
SniffingRequest SniffingRequest
|
SniffingRequest SniffingRequest
|
||||||
|
|
||||||
attr map[string]interface{}
|
Attributes map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Content) SetAttribute(name string, value interface{}) {
|
func (c *Content) SetAttribute(name string, value interface{}) {
|
||||||
if c.attr == nil {
|
if c.Attributes == nil {
|
||||||
c.attr = make(map[string]interface{})
|
c.Attributes = make(map[string]interface{})
|
||||||
}
|
}
|
||||||
c.attr[name] = value
|
c.Attributes[name] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Content) Attribute(name string) interface{} {
|
func (c *Content) Attribute(name string) interface{} {
|
||||||
if c.attr == nil {
|
if c.Attributes == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return c.attr[name]
|
return c.Attributes[name]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user