Prechádzať zdrojové kódy

update some comments

wuxiang 7 rokov pred
rodič
commit
3f19d09878

+ 2 - 2
app/dispatcher/default.go

@@ -44,12 +44,12 @@ func NewDefaultDispatcher(ctx context.Context, config *Config) (*DefaultDispatch
 	return d, nil
 }
 
-// Start implements app.Application.
+// Start implements common.Runnable.
 func (*DefaultDispatcher) Start() error {
 	return nil
 }
 
-// Close implements app.Application.
+// Close implements common.Closable.
 func (*DefaultDispatcher) Close() error { return nil }
 
 func getStatsName(u *protocol.User) string {

+ 1 - 1
app/dns/server.go

@@ -80,7 +80,7 @@ func (s *Server) Start() error {
 	return s.task.Start()
 }
 
-// Close implements common.Runnable.
+// Close implements common.Closable.
 func (s *Server) Close() error {
 	return s.task.Close()
 }

+ 3 - 3
app/log/log.go

@@ -11,7 +11,7 @@ import (
 	"v2ray.com/core/common/log"
 )
 
-// Instance is an app.Application that handles logs.
+// Instance is a log.Handler that handles logs.
 type Instance struct {
 	sync.RWMutex
 	config       *Config
@@ -91,7 +91,7 @@ func (g *Instance) startInternal() error {
 	return nil
 }
 
-// Start implements app.Application.Start().
+// Start implements common.Runnable.Start().
 func (g *Instance) Start() error {
 	if err := g.startInternal(); err != nil {
 		return err
@@ -125,7 +125,7 @@ func (g *Instance) Handle(msg log.Message) {
 	}
 }
 
-// Close implement app.Application.Close().
+// Close implements common.Closable.Close().
 func (g *Instance) Close() error {
 	newError("Logger closing").AtDebug().WriteToLog()
 

+ 2 - 2
app/policy/manager.go

@@ -43,12 +43,12 @@ func (m *Instance) ForLevel(level uint32) core.Policy {
 	return core.DefaultPolicy()
 }
 
-// Start implements app.Application.Start().
+// Start implements common.Runnable.Start().
 func (m *Instance) Start() error {
 	return nil
 }
 
-// Close implements app.Application.Close().
+// Close implements common.Closable.Close().
 func (m *Instance) Close() error {
 	return nil
 }

+ 1 - 1
app/proxyman/outbound/handler.go

@@ -133,7 +133,7 @@ func (h *Handler) Start() error {
 	return nil
 }
 
-// Close implements common.Runnable.
+// Close implements common.Closable.
 func (h *Handler) Close() error {
 	common.Close(h.mux)
 	return nil

+ 1 - 1
common/signal/task.go

@@ -50,7 +50,7 @@ func (t *PeriodicTask) Start() error {
 	return nil
 }
 
-// Close implements common.Runnable.
+// Close implements common.Closable.
 func (t *PeriodicTask) Close() error {
 	t.access.Lock()
 	defer t.access.Unlock()

+ 2 - 2
network.go

@@ -26,7 +26,7 @@ type OutboundHandler interface {
 	Dispatch(ctx context.Context, outboundRay ray.OutboundRay)
 }
 
-// InboundHandlerManager is a feature that managers InboundHandlers.
+// InboundHandlerManager is a feature that manages InboundHandlers.
 type InboundHandlerManager interface {
 	Feature
 	// GetHandlers returns an InboundHandler for the given tag.
@@ -98,7 +98,7 @@ func (m *syncInboundHandlerManager) Set(manager InboundHandlerManager) {
 // OutboundHandlerManager is a feature that manages OutboundHandlers.
 type OutboundHandlerManager interface {
 	Feature
-	// GetHandler returns an OutboundHandler will given tag.
+	// GetHandler returns an OutboundHandler for the given tag.
 	GetHandler(tag string) OutboundHandler
 	// GetDefaultHandler returns the default OutboundHandler. It is usually the first OutboundHandler specified in the configuration.
 	GetDefaultHandler() OutboundHandler

+ 1 - 1
transport/ray/connection.go

@@ -123,7 +123,7 @@ func (c *connection) SetReadDeadline(t time.Time) error {
 	return nil
 }
 
-// SetWriteDeadline implement net.Conn.SetWriteDeadline().
+// SetWriteDeadline implements net.Conn.SetWriteDeadline().
 func (c *connection) SetWriteDeadline(t time.Time) error {
 	return nil
 }

+ 2 - 2
v2ray.go

@@ -38,7 +38,7 @@ type Instance struct {
 
 // New returns a new V2Ray instance based on given configuration.
 // The instance is not started at this point.
-// To make sure V2Ray instance works properly, the config must contain one Dispatcher, one InboundHandlerManager and one OutboundHandlerManager. Other features are optional.
+// To ensure V2Ray instance works properly, the config must contain one Dispatcher, one InboundHandlerManager and one OutboundHandlerManager. Other features are optional.
 func New(config *Config) (*Instance, error) {
 	var server = &Instance{
 		id: uuid.New(),
@@ -169,7 +169,7 @@ func (s *Instance) allFeatures() []Feature {
 }
 
 // GetFeature returns a feature that was registered in this Instance. Nil if not found.
-// The returned Feature must implement common.HasType and whose type equals the given feature type.
+// The returned Feature must implement common.HasType and whose type equals to the given feature type.
 func (s *Instance) GetFeature(featureType interface{}) Feature {
 	for _, f := range s.features {
 		if hasType, ok := f.(common.HasType); ok {