This commit is contained in:
Darien Raymond
2018-12-03 22:44:42 +01:00
parent 05f8de1b8f
commit 28fa84ce69
11 changed files with 60 additions and 0 deletions
+8
View File
@@ -6,6 +6,8 @@ import (
)
// Client is a V2Ray feature for querying DNS information.
//
// v2ray:api:stable
type Client interface {
features.Feature
@@ -14,16 +16,22 @@ type Client interface {
}
// IPv4Lookup is an optional feature for querying IPv4 addresses only.
//
// v2ray:api:beta
type IPv4Lookup interface {
LookupIPv4(domain string) ([]net.IP, error)
}
// IPv6Lookup is an optional feature for querying IPv6 addresses only.
//
// v2ray:api:beta
type IPv6Lookup interface {
LookupIPv6(domain string) ([]net.IP, error)
}
// ClientType returns the type of Client interface. Can be used for implementing common.HasType.
//
// v2ray:api:beta
func ClientType() interface{} {
return (*Client)(nil)
}
+6
View File
@@ -9,6 +9,8 @@ import (
)
// Handler is the interface for handlers that process inbound connections.
//
// v2ray:api:stable
type Handler interface {
common.Runnable
// The tag of this handler.
@@ -19,6 +21,8 @@ type Handler interface {
}
// Manager is a feature that manages InboundHandlers.
//
// v2ray:api:stable
type Manager interface {
features.Feature
// GetHandlers returns an InboundHandler for the given tag.
@@ -31,6 +35,8 @@ type Manager interface {
}
// ManagerType returns the type of Manager interface. Can be used for implementing common.HasType.
//
// v2ray:api:stable
func ManagerType() interface{} {
return (*Manager)(nil)
}
+6
View File
@@ -9,6 +9,8 @@ import (
)
// Handler is the interface for handlers that process outbound connections.
//
// v2ray:api:stable
type Handler interface {
common.Runnable
Tag() string
@@ -20,6 +22,8 @@ type HandlerSelector interface {
}
// Manager is a feature that manages outbound.Handlers.
//
// v2ray:api:stable
type Manager interface {
features.Feature
// GetHandler returns an outbound.Handler for the given tag.
@@ -34,6 +38,8 @@ type Manager interface {
}
// ManagerType returns the type of Manager interface. Can be used to implement common.HasType.
//
// v2ray:api:stable
func ManagerType() interface{} {
return (*Manager)(nil)
}
+4
View File
@@ -57,6 +57,8 @@ type Session struct {
}
// Manager is a feature that provides Policy for the given user by its id or level.
//
// v2ray:api:stable
type Manager interface {
features.Feature
@@ -68,6 +70,8 @@ type Manager interface {
}
// ManagerType returns the type of Manager interface. Can be used to implement common.HasType.
//
// v2ray:api:stable
func ManagerType() interface{} {
return (*Manager)(nil)
}
+4
View File
@@ -10,6 +10,8 @@ import (
// Dispatcher is a feature that dispatches inbound requests to outbound handlers based on rules.
// Dispatcher is required to be registered in a V2Ray instance to make V2Ray function properly.
//
// v2ray:api:stable
type Dispatcher interface {
features.Feature
@@ -18,6 +20,8 @@ type Dispatcher interface {
}
// DispatcherType returns the type of Dispatcher interface. Can be used to implement common.HasType.
//
// v2ray:api:stable
func DispatcherType() interface{} {
return (*Dispatcher)(nil)
}
+4
View File
@@ -8,6 +8,8 @@ import (
)
// Router is a feature to choose an outbound tag for the given request.
//
// v2ray:api:stable
type Router interface {
features.Feature
@@ -16,6 +18,8 @@ type Router interface {
}
// RouterType return the type of Router interface. Can be used to implement common.HasType.
//
// v2ray:api:stable
func RouterType() interface{} {
return (*Router)(nil)
}
+6
View File
@@ -5,6 +5,8 @@ package stats
import "v2ray.com/core/features"
// Counter is the interface for stats counters.
//
// v2ray:api:stable
type Counter interface {
// Value is the current value of the counter.
Value() int64
@@ -15,6 +17,8 @@ type Counter interface {
}
// Manager is the interface for stats manager.
//
// v2ray:api:stable
type Manager interface {
features.Feature
@@ -35,6 +39,8 @@ func GetOrRegisterCounter(m Manager, name string) (Counter, error) {
}
// ManagerType returns the type of Manager interface. Can be used to implement common.HasType.
//
// v2ray:api:stable
func ManagerType() interface{} {
return (*Manager)(nil)
}