add server plugins feature and add zookeeper/etcd/consul registries

This commit is contained in:
smallnest
2017-10-17 16:49:07 +08:00
parent 81380d019b
commit 402c9578fd
16 changed files with 781 additions and 14 deletions

18
errors/error.go Normal file
View File

@@ -0,0 +1,18 @@
package errors
import "fmt"
// MultiError holds multiple errors
type MultiError struct {
Errors []error
}
// Error returns the message of the actual error
func (e *MultiError) Error() string {
return fmt.Sprintf("%v", e.Errors)
}
// NewMultiError creates and returns an Error with error splice
func NewMultiError(errors []error) *MultiError {
return &MultiError{Errors: errors}
}