1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-17 13:05:24 +00:00

update some comments

This commit is contained in:
wuxiang 2018-04-03 17:11:54 +08:00
parent 6287285c8a
commit 3f19d09878
9 changed files with 15 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -38,7 +38,7 @@ type Instance struct {
// New returns a new V2Ray instance based on given configuration. // New returns a new V2Ray instance based on given configuration.
// The instance is not started at this point. // 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) { func New(config *Config) (*Instance, error) {
var server = &Instance{ var server = &Instance{
id: uuid.New(), 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. // 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 { func (s *Instance) GetFeature(featureType interface{}) Feature {
for _, f := range s.features { for _, f := range s.features {
if hasType, ok := f.(common.HasType); ok { if hasType, ok := f.(common.HasType); ok {