endpoint.go 650 B

12345678910111213141516171819202122232425262728
  1. package adapter
  2. import (
  3. "context"
  4. "github.com/sagernet/sing-box/log"
  5. "github.com/sagernet/sing-box/option"
  6. )
  7. type Endpoint interface {
  8. Lifecycle
  9. Type() string
  10. Tag() string
  11. Outbound
  12. }
  13. type EndpointRegistry interface {
  14. option.EndpointOptionsRegistry
  15. Create(ctx context.Context, router Router, logger log.ContextLogger, tag string, endpointType string, options any) (Endpoint, error)
  16. }
  17. type EndpointManager interface {
  18. Lifecycle
  19. Endpoints() []Endpoint
  20. Get(tag string) (Endpoint, bool)
  21. Remove(tag string) error
  22. Create(ctx context.Context, router Router, logger log.ContextLogger, tag string, endpointType string, options any) error
  23. }