diff --git a/capability.go b/capability.go deleted file mode 100644 index 7b291f38..00000000 --- a/capability.go +++ /dev/null @@ -1,36 +0,0 @@ -package core - -type Capability byte - -const ( - TCPConnection = Capability(0x01) - UDPConnection = Capability(0x02) -) - -type Capabilities interface { - HasCapability(cap Capability) bool - AddCapability(cap Capability) -} - -type listCapabilities struct { - data []Capability -} - -func NewCapabilities() Capabilities { - return &listCapabilities{ - data: make([]Capability, 0, 16), - } -} - -func (c *listCapabilities) HasCapability(cap Capability) bool { - for _, v := range c.data { - if v == cap { - return true - } - } - return false -} - -func (c *listCapabilities) AddCapability(cap Capability) { - c.data = append(c.data, cap) -} diff --git a/capability_test.go b/capability_test.go deleted file mode 100644 index 100daeb7..00000000 --- a/capability_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "testing" - - "github.com/v2ray/v2ray-core/testing/unit" -) - -func TestCapabilities(t *testing.T) { - assert := unit.Assert(t) - - caps := NewCapabilities() - assert.Bool(caps.HasCapability(TCPConnection)).IsFalse() - - caps.AddCapability(TCPConnection) - assert.Bool(caps.HasCapability(TCPConnection)).IsTrue() - - caps.AddCapability(UDPConnection) - assert.Bool(caps.HasCapability(TCPConnection)).IsTrue() - assert.Bool(caps.HasCapability(UDPConnection)).IsTrue() -}