1
0

runtime.go 1.1 KB

123456789101112131415161718192021222324252627282930
  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. // Per-client operations that route through the node's clients API on
  14. // Remote (instead of pushing the whole inbound) so the node applies
  15. // per-user xray API calls without a DelInbound+AddInbound cycle.
  16. UpdateUser(ctx context.Context, ib *model.Inbound, email string, payload model.Client) error
  17. DeleteUser(ctx context.Context, ib *model.Inbound, email string) error
  18. AddClient(ctx context.Context, ib *model.Inbound, client model.Client) error
  19. RestartXray(ctx context.Context) error
  20. ResetClientTraffic(ctx context.Context, ib *model.Inbound, email string) error
  21. ResetAllTraffics(ctx context.Context) error
  22. }