mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-15 16:56:08 -05:00
34 lines
652 B
Go
34 lines
652 B
Go
package log
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"v2ray.com/core/common/serial"
|
|
)
|
|
|
|
type AccessStatus string
|
|
|
|
const (
|
|
AccessAccepted = AccessStatus("accepted")
|
|
AccessRejected = AccessStatus("rejected")
|
|
)
|
|
|
|
type AccessMessage struct {
|
|
From interface{}
|
|
To interface{}
|
|
Status AccessStatus
|
|
Reason interface{}
|
|
}
|
|
|
|
func (m *AccessMessage) String() string {
|
|
builder := strings.Builder{}
|
|
builder.WriteString(serial.ToString(m.From))
|
|
builder.WriteByte(' ')
|
|
builder.WriteString(string(m.Status))
|
|
builder.WriteByte(' ')
|
|
builder.WriteString(serial.ToString(m.To))
|
|
builder.WriteByte(' ')
|
|
builder.WriteString(serial.ToString(m.Reason))
|
|
return builder.String()
|
|
}
|