package ants

//Handler 请求处理器
type Handler func(params []byte) interface{}

//RouterInterface 路由器接口
type RouterInterface interface {
	AddPreMiddle(handler ...func(path string, params []byte) error)
	GetPreMiddle() []func(path string, params []byte) error
	AddAfterMiddle(handler ...func(path string, rs interface{}) interface{})
	GetAfterMiddle() []func(path string, rs interface{}) interface{}
	AddRouter(path string, router Handler)
	AddGroup(path string) RouterInterface
	RouteMatch(path string) (interface{}, bool)
}

//LeaderCheckInterface 仲裁engine接口
type LeaderCheckInterface interface {
	LeaderCheck() bool
	Leader() string
}

//ClientPool 链接池接口
type ClientPool interface {
	RecycleConn(client *ClientConn) bool
}

type LogerInterface interface {
	SetLevel(level int)
	GetLevel() int
	Trace(args ...interface{})
	Tracef(template string, args ...interface{})
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(template string, args ...interface{})
	Panic(args ...interface{})
	Panicf(template string, args ...interface{})
}
