<commit_before>package server

// Server is an interface that all servers must implement
// so that we can register endpoints, and serve requests
type Server interface {
	Init(*Config)
	Run()
	Close()
	NotifyConnected() chan bool

	Name() string
	Description() string

	RegisterEndpoint(endpoint *Endpoint)
	DeregisterEndpoint(pattern string)
}

// DefaultServer stores a default implementation, for simple usage
var DefaultServer Server = NewAMQPServer()

// Init our DefaultServer with a Config
func Init(c *Config) {
	DefaultServer.Init(c)
}

// RegisterEndpoint with the DefaultServer
func RegisterEndpoint(endpoint *Endpoint) {
	DefaultServer.RegisterEndpoint(endpoint)
}

// Run the DefaultServer
func Run() {
	DefaultServer.Run()
}

// Close the DefaultServer
func Close() {
	DefaultServer.Close()
}

// NotifyConnected delegates to DefaultServer
func NotifyConnected() chan bool {
	return DefaultServer.NotifyConnected()
}

// Config defines the config a server needs to start up, and serve requests
type Config struct {
	Name        string
	Description string
}<commit_msg>Change Init to return the server so it can be chained<commit_after>package server

// Server is an interface that all servers must implement
// so that we can register endpoints, and serve requests
type Server interface {
	Init(*Config)
	Run()
	Close()
	NotifyConnected() chan bool

	Name() string
	Description() string

	RegisterEndpoint(endpoint *Endpoint)
	DeregisterEndpoint(pattern string)

	RegisterAuthenticationProvider(auth.AuthenticationProvider)
}

// DefaultServer stores a default implementation, for simple usage
var DefaultServer Server = NewAMQPServer()

// Init our DefaultServer with a Config
func Init(c *Config) Server {
	DefaultServer.Init(c)
	return DefaultServer
}

// RegisterEndpoint with the DefaultServer
func RegisterEndpoint(endpoint *Endpoint) {
	DefaultServer.RegisterEndpoint(endpoint)
}

// Run the DefaultServer
func Run() {
	DefaultServer.Run()
}

// Close the DefaultServer
func Close() {
	DefaultServer.Close()
}

// NotifyConnected delegates to DefaultServer
func NotifyConnected() chan bool {
	return DefaultServer.NotifyConnected()
}

// Config defines the config a server needs to start up, and serve requests
type Config struct {
	Name        string
	Description string
}
{'fraction_non_alphanumeric': 0.07625272331154684, 'fraction_numerical': 0.0, 'mean_word_length': 4.842239185750636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5853605', 'n_tokens_mistral': 614, 'n_tokens_neox': 597, 'n_words': 232}