mirror of
https://gitcode.com/JianFeeeee/webui4frpc.git
synced 2026-09-20 08:57:55 +00:00
feat(M6): localOnly forward option (loopback→LAN rewrite for cluster, local direct), canvas diff-based create/revoke commands, revoke task semantics, topology derived canvas on sync nodes, LAN addr helper
This commit is contained in:
@ -15,6 +15,8 @@ type AppHandler struct {
|
||||
LoadFn func() (memPct, netPct float64)
|
||||
// ClaimFn creates the forward on this node (persist + spawn worker).
|
||||
ClaimFn func(ctx context.Context, tk *Task) error
|
||||
// RevokeFn cancels the forward on this node (stop worker + drop from store).
|
||||
RevokeFn func(ctx context.Context, tk *Task) error
|
||||
}
|
||||
|
||||
// RuntimeLoad implements Handler.
|
||||
@ -34,6 +36,14 @@ func (a *AppHandler) Claim(ctx context.Context, tk *Task) error {
|
||||
return a.ClaimFn(ctx, tk)
|
||||
}
|
||||
|
||||
// Revoke implements Handler.
|
||||
func (a *AppHandler) Revoke(ctx context.Context, tk *Task) error {
|
||||
if a.RevokeFn == nil {
|
||||
return nil
|
||||
}
|
||||
return a.RevokeFn(ctx, tk)
|
||||
}
|
||||
|
||||
// SampleMemLoad returns a cheap memory-usage percentage (0..100).
|
||||
func SampleMemLoad() float64 {
|
||||
var m runtime.MemStats
|
||||
|
||||
Reference in New Issue
Block a user