func NewBasicPluginManager(storageDir string, log logger.Logger) (*BasicPluginManager, error) {
	return &BasicPluginManager{
		Logger:     log.NewLogger("pluginmanager"),
		storageDir: storageDir,
		versions:   map[string][]string{},
	}, nil
}
NewBasicPluginManager is used to create basic PluginManager
package pluginmanager
import (
	"context"
	"errors"
	"io/fs"
	"os"
	"strings"
	"sync"
	"github.com/storyicon/powerproto/pkg/consts"
	"github.com/storyicon/powerproto/pkg/util"
	"github.com/storyicon/powerproto/pkg/util/logger"
)
type PluginManager interface {
	GetPluginLatestVersion(ctx context.Context, path string) (string, error)
	ListPluginVersions(ctx context.Context, path string) ([]string, error)
	IsPluginInstalled(ctx context.Context, path string, version string) (bool, string, error)
	InstallPlugin(ctx context.Context, path string, version string) (local string, err error)
	GetPathForPlugin(ctx context.Context, path string, version string) (local string, err error)
	GetGitRepoLatestVersion(ctx context.Context, uri string) (string, error)
	InstallGitRepo(ctx context.Context, uri string, commitId string) (local string, err error)
	IsGitRepoInstalled(ctx context.Context, uri string, commitId string) (bool, string, error)
	GitRepoPath(ctx context.Context, commitId string) (string, error)
	GetProtocLatestVersion(ctx context.Context) (string, error)
	ListProtocVersions(ctx context.Context) ([]string, error)
	IsProtocInstalled(ctx context.Context, version string) (bool, string, error)
	InstallProtoc(ctx context.Context, version string) (local string, err error)
	IncludePath(ctx context.Context) (string, error)
	GetPathForProtoc(ctx context.Context, version string) (string, error)
}
type Config struct {
	StorageDir string `json:"storage"`
}
func NewConfig() *Config {
	return &Config{
		StorageDir: consts.GetHomeDir(),
	}
}
func NewPluginManager(cfg *Config, log logger.Logger) (PluginManager, error) {
	return NewBasicPluginManager(cfg.StorageDir, log)
}
type BasicPluginManager struct {
	logger.Logger
	storageDir   string
	versions     map[string][]string
	versionsLock sync.RWMutex
}