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) 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) Start() error
- func (s *Server) StoreFakeIP() bool
- func (s *Server) StoreSelected() bool
- 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") ErrServerError = newError("Server error") )
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 ¶
func (s *Server) CacheFile() adapter.ClashCacheFile
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) StoreFakeIP ¶
func (*Server) StoreSelected ¶
type UpdateProxyRequest ¶
type UpdateProxyRequest struct {
Name string `json:"name"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.