mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
- Removed `FileStore` in favor of the new `FileTokenStore`. - Centralized auth JSON handling and token operations through `FileTokenStore`. - Updated all components to utilize `FileTokenStore` for consistent storage operations. - Introduced `SetBaseDir` and directory locking mechanisms for flexible configurations. - Enhanced metadata management, including path resolution and deep JSON comparisons.
14 lines
457 B
Go
14 lines
457 B
Go
package auth
|
|
|
|
import "context"
|
|
|
|
// Store abstracts persistence of Auth state across restarts.
|
|
type Store interface {
|
|
// List returns all auth records stored in the backend.
|
|
List(ctx context.Context) ([]*Auth, error)
|
|
// SaveAuth persists the provided auth record, replacing any existing one with same ID.
|
|
SaveAuth(ctx context.Context, auth *Auth) error
|
|
// Delete removes the auth record identified by id.
|
|
Delete(ctx context.Context, id string) error
|
|
}
|