Documentation ¶
Index ¶
- Variables
- func NewServer(router adapter.Router, logFactory log.ObservableFactory, ...) (adapter.ClashServer, error)
- type HTTPError
- type Log
- 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) 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) 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") )
Functions ¶
func NewServer ¶
func NewServer(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) StoreSelected ¶ added in v1.1.0
type UpdateProxyRequest ¶
type UpdateProxyRequest struct {
Name string `json:"name"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.