From 3f19d09878ccb660eb93140729c85422be659293 Mon Sep 17 00:00:00 2001 From: wuxiang Date: Tue, 3 Apr 2018 17:11:54 +0800 Subject: [PATCH] update some comments --- app/dispatcher/default.go | 4 ++-- app/dns/server.go | 2 +- app/log/log.go | 6 +++--- app/policy/manager.go | 4 ++-- app/proxyman/outbound/handler.go | 2 +- common/signal/task.go | 2 +- network.go | 4 ++-- transport/ray/connection.go | 2 +- v2ray.go | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 865a643b4..6354ce3f1 100644 --- a/app/dispatcher/default.go +++ b/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 { diff --git a/app/dns/server.go b/app/dns/server.go index 8f5c3cd54..5fbec9b91 100644 --- a/app/dns/server.go +++ b/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() } diff --git a/app/log/log.go b/app/log/log.go index d5205d104..5471fb35f 100644 --- a/app/log/log.go +++ b/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() diff --git a/app/policy/manager.go b/app/policy/manager.go index 20e785154..68ed4e9d7 100644 --- a/app/policy/manager.go +++ b/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 } diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index 3bc57ea08..f511b590f 100644 --- a/app/proxyman/outbound/handler.go +++ b/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 diff --git a/common/signal/task.go b/common/signal/task.go index a9a886fb9..36e0a1f4e 100644 --- a/common/signal/task.go +++ b/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() diff --git a/network.go b/network.go index 3e36624b0..e6a0046cb 100644 --- a/network.go +++ b/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 diff --git a/transport/ray/connection.go b/transport/ray/connection.go index 2bc4d39b9..18d98a52d 100644 --- a/transport/ray/connection.go +++ b/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 } diff --git a/v2ray.go b/v2ray.go index 28af89a63..33bc831ab 100755 --- a/v2ray.go +++ b/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 {