service

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	ClientID string `json:"client_id"`
	jwt.RegisteredClaims
}

Claims represents JWT token claims

type MetricCollector

type MetricCollector struct {
	UserSchedLastRunAtMetric *prometheus.Desc
	NrQueuedMetric           *prometheus.Desc
	NrScheduledMetric        *prometheus.Desc
	NrRunningMetric          *prometheus.Desc
	NrOnlineCPUsMetric       *prometheus.Desc
	NrUserDispatchesMetric   *prometheus.Desc
	NrKernelDispatchesMetric *prometheus.Desc
	NrCancelDispatchesMetric *prometheus.Desc
	NrBounceDispatchesMetric *prometheus.Desc
	NrFailedDispatchesMetric *prometheus.Desc
	NrSchedCongestedMetric   *prometheus.Desc
	// contains filtered or unexported fields
}

MetricCollector

func NewMetricCollector

func NewMetricCollector(machineID string) *MetricCollector

// NewMetricCollector creates a new MetricCollector for a specific game server.

func (*MetricCollector) Collect

func (collector *MetricCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (*MetricCollector) Describe

func (collector *MetricCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics

func (*MetricCollector) UpdateMetrics

func (collector *MetricCollector) UpdateMetrics(newMetricSet *domain.MetricSet)

type Params

type Params struct {
	fx.In
	TokenConfig config.TokenConfig
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(params Params) (Service, error)

func (*Service) FindPodInfoFrom

func (svc *Service) FindPodInfoFrom(ctx context.Context, rootDir string) (map[string]*domain.PodInfo, error)

FindPodInfoFrom scans the given rootDir (e.g., /proc) to find pod information

func (*Service) GetAllPodInfos

func (svc *Service) GetAllPodInfos(ctx context.Context) (map[string]*domain.PodInfo, error)

GetAllPodInfos retrieves all pod information by scanning the /proc filesystem

func (*Service) ListAllSchedulingIntents

func (svc *Service) ListAllSchedulingIntents(ctx context.Context) ([]*domain.SchedulingIntents, error)

ListAllSchedulingIntents retrieves all stored scheduling intents

func (*Service) ProcessIntents

func (svc *Service) ProcessIntents(ctx context.Context, intents []*domain.Intent) error

ProcessIntents processes a list of scheduling intents and updates the internal map

func (*Service) UpdateMetrics

func (svc *Service) UpdateMetrics(ctx context.Context, newMetricSet *domain.MetricSet)

func (*Service) VerifyAndGenerateToken

func (svc *Service) VerifyAndGenerateToken(ctx context.Context, clientID string, publicKey string) (string, int64, error)

VerifyAndGenerateToken verifies the provided public key and generates a JWT token if valid

func (*Service) VerifyPublicKey

func (svc *Service) VerifyPublicKey(publicKeyPEM string) error

verifyPublicKey verifies if the provided public key matches our private key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL