fix(client): Add reason to unregistration to skip persistence

This commit is contained in:
hkfires
2025-09-18 20:58:43 +08:00
parent 8f0a345e2a
commit d9f8129a32
5 changed files with 70 additions and 15 deletions

View File

@@ -61,3 +61,15 @@ type Client interface {
// SetUnavailable sets the client to unavailable.
SetUnavailable()
}
// UnregisterReason describes the context for unregistering a client instance.
type UnregisterReason string
const (
// UnregisterReasonReload indicates a full reload is replacing the client.
UnregisterReasonReload UnregisterReason = "reload"
// UnregisterReasonShutdown indicates the service is shutting down.
UnregisterReasonShutdown UnregisterReason = "shutdown"
// UnregisterReasonAuthFileRemoved indicates the underlying auth file was deleted.
UnregisterReasonAuthFileRemoved UnregisterReason = "auth-file-removed"
)