mirror of
https://github.com/remnawave/migrate.git
synced 2026-05-13 12:16:40 +00:00
- Created modular source panel interface for extensibility - Renamed arguments from marzban-* to panel-* - Added panel-type argument with support for "marzban" and "marzneshin" - Implemented Marzneshin panel support with unique proxy extraction logic - Restructured models to support different panel types - Updated README with new options and instructions - Renamed app to "remnawave-migrate" to reflect universal nature This refactoring makes the migration tool more flexible and allows easier addition of new panel types in the future. Co-authored-by: Yury Kastov <kastov@gog.sh>
24 lines
479 B
Go
24 lines
479 B
Go
package source
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"remnawave-migrate/models"
|
|
)
|
|
|
|
type SourcePanel interface {
|
|
Login(username, password string) error
|
|
|
|
GetUsers(offset, limit int) (*models.UsersResponse, error)
|
|
}
|
|
|
|
func Factory(panelType, baseURL string) (SourcePanel, error) {
|
|
switch panelType {
|
|
case "marzban":
|
|
return NewMarzbanPanel(baseURL), nil
|
|
case "marzneshin":
|
|
return NewMarzneshinPanel(baseURL), nil
|
|
default:
|
|
return nil, fmt.Errorf("unsupported panel type: %s", panelType)
|
|
}
|
|
}
|