Documentation ¶
Index ¶
- Variables
- func NewServer(ctx context.Context, router adapter.Router, logFactory log.ObservableFactory, ...) (adapter.ClashServer, error)
- type HTTPError
- type Log
- type Memory
- type PatchScriptRequest
- type Rule
- type Server
- func (s *Server) CacheFile() adapter.ClashCacheFile
- func (s *Server) Close() error
- func (s *Server) HistoryStorage() *urltest.HistoryStorage
- func (s *Server) Mode() string
- func (s *Server) ModeList() []string
- func (s *Server) PreStart() error
- func (s *Server) RoutedConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, ...) (net.Conn, adapter.Tracker)
- func (s *Server) RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, ...) (N.PacketConn, adapter.Tracker)
- func (s *Server) SetMode(newMode string)
- func (s *Server) SetModeUpdateHook(hook chan<- struct{})
- func (s *Server) Start() error
- func (s *Server) StoreFakeIP() bool
- func (s *Server) StoreSelected() bool
- func (s *Server) TrafficManager() *trafficontrol.Manager
- type Traffic
- type UpdateProxyRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CtxKeyProxyName = contextKey("proxy name") CtxKeyProviderName = contextKey("provider name") CtxKeyProxy = contextKey("proxy") CtxKeyProvider = contextKey("provider") )
View Source
var ( ErrBadRequest = newError("Body invalid") ErrForbidden = newError("Forbidden") ErrNotFound = newError("Resource not found") ErrRequestTimeout = newError("Timeout") )
Functions ¶
func NewServer ¶
func NewServer(ctx context.Context, router adapter.Router, logFactory log.ObservableFactory, options option.ClashAPIOptions) (adapter.ClashServer, error)
Types ¶
type HTTPError ¶
type HTTPError struct {
Message string `json:"message"`
}
HTTPError is custom HTTP error for API
type PatchScriptRequest ¶
type PatchScriptRequest struct {
Script string `json:"script"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CacheFile ¶ added in v1.1.0
func (s *Server) CacheFile() adapter.ClashCacheFile
func (*Server) HistoryStorage ¶ added in v1.1.0
func (s *Server) HistoryStorage() *urltest.HistoryStorage
func (*Server) RoutedConnection ¶
func (*Server) RoutedPacketConnection ¶
func (s *Server) RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, matchedRule adapter.Rule) (N.PacketConn, adapter.Tracker)
func (*Server) SetModeUpdateHook ¶ added in v1.4.0
func (s *Server) SetModeUpdateHook(hook chan<- struct{})
func (*Server) StoreFakeIP ¶ added in v1.3.0
func (*Server) StoreSelected ¶ added in v1.1.0
func (*Server) TrafficManager ¶ added in v1.3.3
func (s *Server) TrafficManager() *trafficontrol.Manager
type UpdateProxyRequest ¶
type UpdateProxyRequest struct {
Name string `json:"name"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.