Documentation ¶
Index ¶
- Variables
- func NewServer(ctx context.Context, 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) Name() string
- func (s *Server) RoutedConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, ...) net.Conn
- func (s *Server) RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, ...) N.PacketConn
- func (s *Server) SetMode(newMode string)
- func (s *Server) SetModeUpdateHook(hook chan<- struct{})
- func (s *Server) Start(stage adapter.StartStage) 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, 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 ¶ 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, matchOutbound adapter.Outbound) N.PacketConn
func (*Server) SetModeUpdateHook ¶ added in v1.4.0
func (s *Server) SetModeUpdateHook(hook chan<- struct{})
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.