Documentation
¶
Index ¶
- Variables
- type Claims
- type Params
- type Service
- func (svc *Service) FindCurrentUsingSchedulingStrategiesWithPID(ctx context.Context) ([]*domain.SchedulingStrategy, bool, error)
- func (svc *Service) FindPodInfoFrom(ctx context.Context, rootDir string) ([]*domain.PodInfo, error)
- func (svc *Service) FindSchedulingStrategiesWithPID(ctx context.Context, rootDir string, ...) ([]*domain.SchedulingStrategy, bool, error)
- func (svc *Service) GetAllPodInfos(ctx context.Context) ([]*domain.PodInfo, error)
- func (svc *Service) GetBSSMetrics(ctx context.Context) (*domain.BssData, error)
- func (svc *Service) GetStrategyCacheStats() map[string]any
- func (svc *Service) SaveBSSMetrics(ctx context.Context, bssMetrics *domain.BssData) error
- func (svc *Service) SaveSchedulingStrategy(ctx context.Context, strategy []*domain.SchedulingStrategy) error
- func (svc *Service) VerifyAndGenerateToken(ctx context.Context, publicKey string) (string, error)
- func (svc *Service) VerifyPublicKey(publicKeyPEM string) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoBssData = errors.New("no BSS metrics data available")
)
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
ClientID string `json:"client_id"`
jwt.RegisteredClaims
}
Claims represents JWT token claims
type Params ¶
type Params struct {
K8sAdapter kubernetes.K8sAdapter
StrategyCache *cache.StrategyCache
JWTPrivateKey *rsa.PrivateKey
Config *config.Config
}
Params holds the parameters for creating a new Service
type Service ¶
type Service struct {
kubernetes.K8sAdapter
*cache.StrategyCache
// contains filtered or unexported fields
}
Service represents the main service structure
func NewService ¶
NewService creates a new Service instance
func (*Service) FindCurrentUsingSchedulingStrategiesWithPID ¶
func (svc *Service) FindCurrentUsingSchedulingStrategiesWithPID(ctx context.Context) ([]*domain.SchedulingStrategy, bool, error)
FindCurrentUsingSchedulingStrategies finds the current scheduling strategies being used
func (*Service) FindPodInfoFrom ¶
FindPodInfoFrom scans the given rootDir (e.g., /proc) to find pod information
func (*Service) FindSchedulingStrategiesWithPID ¶
func (svc *Service) FindSchedulingStrategiesWithPID(ctx context.Context, rootDir string, usingStrategies []*domain.SchedulingStrategy) ([]*domain.SchedulingStrategy, bool, error)
FindSchedulingStrategiesWithPID finds scheduling strategies with associated PIDs
func (*Service) GetAllPodInfos ¶
GetAllPodInfos retrieves all pod information by scanning the /proc filesystem
func (*Service) GetBSSMetrics ¶
GetBSSMetrics retrieves the latest BSS metrics data
func (*Service) GetStrategyCacheStats ¶
GetStrategyCacheStats returns statistics about the strategy cache
func (*Service) SaveBSSMetrics ¶
SaveBSSMetrics saves the provided BSS metrics data
func (*Service) SaveSchedulingStrategy ¶
func (svc *Service) SaveSchedulingStrategy(ctx context.Context, strategy []*domain.SchedulingStrategy) error
SaveSchedulingStrategy saves the provided scheduling strategies and invalidates the cache
func (*Service) VerifyAndGenerateToken ¶
VerifyAndGenerateToken verifies the provided public key and generates a JWT token if valid
func (*Service) VerifyPublicKey ¶
verifyPublicKey verifies if the provided public key matches our private key