Documentation ¶
Index ¶
- Constants
- func GetUUID(c net.Conn) string
- type ConfigInput
- type Connection
- func (c *Connection) CacheAdd(key string, value *ttcache.Item, d time.Duration) error
- func (c *Connection) CacheDelete(key string)
- func (c *Connection) CacheGet(key string) (*ttcache.Item, bool)
- func (c *Connection) CacheReplace(key string, value *ttcache.Item, d time.Duration) error
- func (c *Connection) CacheReplaceIfExists(key string, value *ttcache.Item, d time.Duration) error
- func (c *Connection) Close() error
- func (c *Connection) Flush() error
- func (c *Connection) Write(p []byte) (int, error)
Constants ¶
View Source
const ( CONNECTION_STATE_NEW = iota + 1 CONNECTION_STATUS_READING CONNECTION_STATUS_READING_ERROR CONNECTION_STATUS_PARSING CONNECTION_STATUS_PARSING_ERROR CONNECTION_STATUS_PROCESSING CONNECTION_STATUS_PROCESSING_ERROR CONNECTION_STATUS_WRITING CONNECTION_STATUS_WRITING_ERROR CONNECTION_STATUS_FINISHED CONNECTION_STATUS_CRON )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigInput ¶
type ConfigInput struct { InitialConn net.Conn CurConn net.Conn UUID string Logger *logrus.Entry MaxqueryBytes int64 Config *ttutils.ConfigRoot Cache func() ttcache.ICacheCache PrometheusFire func(*ttprom.PrometheusMetric) error }
type Connection ¶
type Connection struct { // at init InitialConn net.Conn CurConn net.Conn Reader *bufio.Reader Writer *bufio.Writer Start time.Time Config *ttutils.ConfigRoot PrometheusFire func(*ttprom.PrometheusMetric) error Cache func() ttcache.ICacheCache Logger *logrus.Entry UUID string Domain string Port string SNI string LocalAddress string RemoteAddress string // misc Error error MutexFetch sync.RWMutex // at end State int ReturnCode string End time.Time }
func NewConnection ¶
func NewConnection(connConfig *ConfigInput) *Connection
func (*Connection) CacheDelete ¶
func (c *Connection) CacheDelete(key string)
func (*Connection) CacheReplace ¶
func (*Connection) CacheReplaceIfExists ¶
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Flush ¶
func (c *Connection) Flush() error
Click to show internal directories.
Click to hide internal directories.