runtime.go 711 B

123456789101112131415161718192021222324
  1. package runtime
  2. import (
  3. "context"
  4. "github.com/mhsanaei/3x-ui/v3/database/model"
  5. )
  6. type Runtime interface {
  7. Name() string
  8. AddInbound(ctx context.Context, ib *model.Inbound) error
  9. DelInbound(ctx context.Context, ib *model.Inbound) error
  10. UpdateInbound(ctx context.Context, oldIb, newIb *model.Inbound) error
  11. AddUser(ctx context.Context, ib *model.Inbound, userMap map[string]any) error
  12. RemoveUser(ctx context.Context, ib *model.Inbound, email string) error
  13. RestartXray(ctx context.Context) error
  14. ResetClientTraffic(ctx context.Context, ib *model.Inbound, email string) error
  15. ResetInboundClientTraffics(ctx context.Context, ib *model.Inbound) error
  16. ResetAllTraffics(ctx context.Context) error
  17. }