good morning!!!!

Skip to content
Snippets Groups Projects
handler.go 546 B
Newer Older
Garet Halliday's avatar
Garet Halliday committed
package gat

import (
	"gfx.cafe/gfx/pggat/lib/fed"
	"gfx.cafe/gfx/pggat/lib/gat/metrics"
)

// Handler handles the Conn
type Handler interface {
	// Handle will attempt to handle the Conn. Return io.EOF for normal disconnection or nil to continue to the next
	// handle. The error will be relayed to the client so there is no need to send it yourself.
	Handle(conn *fed.Conn) error
}

type CancellableHandler interface {
	Handler

Garet Halliday's avatar
Garet Halliday committed
	Cancel(key fed.BackendKey)
Garet Halliday's avatar
Garet Halliday committed
}

type MetricsHandler interface {
	Handler

	ReadMetrics(metrics *metrics.Handler)
}