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) 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) 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) HistoryStorage ¶
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 ¶
func (s *Server) SetModeUpdateHook(hook chan<- struct{})
func (*Server) TrafficManager ¶
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.