mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-10 08:43:09 +00:00
rewrite error lib
This commit is contained in:
65 files changed
+251
-132
No files matched your search
@@ -1,11 +1,11 @@
|
||||
package impl
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"v2ray.com/core/app"
|
||||
"v2ray.com/core/app/proxyman"
|
||||
"v2ray.com/core/app/router"
|
||||
"v2ray.com/core/common/alloc"
|
||||
"v2ray.com/core/common/errors"
|
||||
"v2ray.com/core/common/log"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
"v2ray.com/core/proxy"
|
||||
|
||||
+1
-1
@@ -1,13 +1,13 @@
|
||||
package dns
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"v2ray.com/core/app"
|
||||
"v2ray.com/core/app/dispatcher"
|
||||
"v2ray.com/core/common/errors"
|
||||
"v2ray.com/core/common/loader"
|
||||
"v2ray.com/core/common/log"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
|
||||
+1
-1
@@ -1,13 +1,13 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"v2ray.com/core/app"
|
||||
"v2ray.com/core/app/proxyman"
|
||||
"v2ray.com/core/common/errors"
|
||||
v2io "v2ray.com/core/common/io"
|
||||
"v2ray.com/core/common/log"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
|
||||
"v2ray.com/core/common/errors"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
"v2ray.com/core/proxy"
|
||||
)
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"v2ray.com/core/app"
|
||||
"v2ray.com/core/app/dns"
|
||||
"v2ray.com/core/common/errors"
|
||||
"v2ray.com/core/common/loader"
|
||||
"v2ray.com/core/common/log"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/errors"
|
||||
)
|
||||
|
||||
type ID int
|
||||
@@ -94,7 +93,7 @@ func (v *spaceImpl) BindApp(id ID, application Application) {
|
||||
func (v *spaceImpl) BindFromConfig(name string, config interface{}) error {
|
||||
factory, found := applicationFactoryCache[name]
|
||||
if !found {
|
||||
return errors.New("Space: app not registered: " + name)
|
||||
return errors.New("Space: app not registered: ", name)
|
||||
}
|
||||
app, err := factory.Create(v, config)
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package v2ray.core.app.web;
|
||||
option go_package = "web";
|
||||
option java_package = "com.v2ray.core.app.web";
|
||||
option java_outer_classname = "ConfigProto";
|
||||
|
||||
import "v2ray.com/core/common/loader/type.proto";
|
||||
|
||||
message FileServer {
|
||||
message Entry {
|
||||
oneof FileOrDir {
|
||||
string File = 1;
|
||||
string Directory = 2;
|
||||
}
|
||||
string path = 3;
|
||||
}
|
||||
|
||||
repeated Entry entry = 1;
|
||||
}
|
||||
|
||||
message Server {
|
||||
repeated string domain = 1;
|
||||
v2ray.core.common.loader.TypedSettings settings = 2;
|
||||
}
|
||||
|
||||
message Config {
|
||||
repeated Server server = 1;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
package web
|
||||
@@ -0,0 +1,15 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"v2ray.com/core/app"
|
||||
"v2ray.com/core/common"
|
||||
)
|
||||
|
||||
const (
|
||||
APP_ID = app.ID(8)
|
||||
)
|
||||
|
||||
type Server interface {
|
||||
common.Releasable
|
||||
Handle()
|
||||
}
|
||||
Reference in new issue
Block a user