core

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: GPL-3.0 Imports: 75 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(
	ctx context.Context,
	inboundRegistry adapter.InboundRegistry,
	outboundRegistry adapter.OutboundRegistry,
	endpointRegistry adapter.EndpointRegistry,
	dnsTransportRegistry adapter.DNSTransportRegistry,
	serviceRegistry adapter.ServiceRegistry,
) context.Context

func DNSTransportRegistry

func DNSTransportRegistry() *dns.TransportRegistry

func EndpointRegistry

func EndpointRegistry() *endpoint.Registry

func InboundRegistry

func InboundRegistry() *inbound.Registry

func NewDefaultFactory

func NewDefaultFactory(
	ctx context.Context,
	formatter log.Formatter,
	writer io.Writer,
	filePath string,
) log.ObservableFactory

func NewFactory

func NewFactory(options log.Options) (log.Factory, error)

func OutboundRegistry

func OutboundRegistry() *outbound.Registry

func ServiceRegistry

func ServiceRegistry() *service.Registry

Types

type Box

type Box struct {
	// contains filtered or unexported fields
}

func NewBox

func NewBox(options Options) (*Box, error)

func (*Box) Close

func (s *Box) Close() error

func (*Box) ConnTracker

func (s *Box) ConnTracker() *ConnTracker

func (*Box) Endpoint

func (s *Box) Endpoint() adapter.EndpointManager

func (*Box) Inbound

func (s *Box) Inbound() adapter.InboundManager

func (*Box) Network

func (s *Box) Network() adapter.NetworkManager

func (*Box) Outbound

func (s *Box) Outbound() adapter.OutboundManager

func (*Box) PreStart

func (s *Box) PreStart() error

func (*Box) Router

func (s *Box) Router() adapter.Router

func (*Box) Start

func (s *Box) Start() error

func (*Box) StatsTracker

func (s *Box) StatsTracker() *StatsTracker

func (*Box) Uptime

func (s *Box) Uptime() uint32

type ConnTracker

type ConnTracker struct {
	// contains filtered or unexported fields
}

func NewConnTracker

func NewConnTracker() *ConnTracker

func (*ConnTracker) CloseConnByInbound

func (c *ConnTracker) CloseConnByInbound(inbound string) int

func (*ConnTracker) RoutedConnection

func (c *ConnTracker) RoutedConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, matchedRule adapter.Rule, matchOutbound adapter.Outbound) net.Conn

func (*ConnTracker) RoutedPacketConnection

func (c *ConnTracker) RoutedPacketConnection(ctx context.Context, conn network.PacketConn, metadata adapter.InboundContext, matchedRule adapter.Rule, matchOutbound adapter.Outbound) network.PacketConn

type ConnectionInfo

type ConnectionInfo struct {
	ID         string
	Conn       net.Conn
	PacketConn network.PacketConn
	Inbound    string
	Type       string // "tcp" or "udp"
}

type Core

type Core struct {
	// contains filtered or unexported fields
}

func NewCore

func NewCore() *Core

func (*Core) AddEndpoint

func (c *Core) AddEndpoint(config []byte) error

func (*Core) AddInbound

func (c *Core) AddInbound(config []byte) error

func (*Core) AddOutbound

func (c *Core) AddOutbound(config []byte) error

func (*Core) AddService

func (c *Core) AddService(config []byte) error

func (*Core) GetCtx

func (c *Core) GetCtx() context.Context

func (*Core) GetInstance

func (c *Core) GetInstance() *Box

func (*Core) IsRunning

func (c *Core) IsRunning() bool

func (*Core) RemoveEndpoint

func (c *Core) RemoveEndpoint(tag string) error

func (*Core) RemoveInbound

func (c *Core) RemoveInbound(tag string) error

func (*Core) RemoveOutbound

func (c *Core) RemoveOutbound(tag string) error

func (*Core) RemoveService

func (c *Core) RemoveService(tag string) error

func (*Core) Start

func (c *Core) Start(sbConfig []byte) error

func (*Core) Stop

func (c *Core) Stop() error

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

type Options

type Options struct {
	option.Options
	Context context.Context
}

type PlatformWriter

type PlatformWriter struct{}

func (PlatformWriter) DisableColors

func (p PlatformWriter) DisableColors() bool

func (PlatformWriter) WriteMessage

func (p PlatformWriter) WriteMessage(level log.Level, message string)

type StatsTracker

type StatsTracker struct {
	// contains filtered or unexported fields
}

func NewStatsTracker

func NewStatsTracker() *StatsTracker

func (*StatsTracker) GetStats

func (c *StatsTracker) GetStats() *[]model.Stats

func (*StatsTracker) RoutedConnection

func (c *StatsTracker) RoutedConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, matchedRule adapter.Rule, matchOutbound adapter.Outbound) net.Conn

func (*StatsTracker) RoutedPacketConnection

func (c *StatsTracker) RoutedPacketConnection(ctx context.Context, conn network.PacketConn, metadata adapter.InboundContext, matchedRule adapter.Rule, matchOutbound adapter.Outbound) network.PacketConn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL