service

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(params Params) (domain.Service, error)

Types

type Params

type Params struct {
	fx.In
	Repo          domain.Repository
	KeyConfig     config.KeyConfig
	AccountConfig config.AccountConfig
	K8SAdapter    domain.K8SAdapter
	DMAdapter     domain.DecisionMakerAdapter
}

type Service

type Service struct {
	K8SAdapter domain.K8SAdapter
	DMAdapter  domain.DecisionMakerAdapter
	Repo       domain.Repository
	// contains filtered or unexported fields
}

func (*Service) ChangePassword

func (svc *Service) ChangePassword(ctx context.Context, userClaims *domain.Claims, oldPassword, newPassword string) error

func (*Service) CheckDMIntents added in v1.2.0

func (svc *Service) CheckDMIntents(ctx context.Context) error

CheckDMIntents is kept for backwards compatibility. It delegates to ReconcileIntents.

func (*Service) CreateAdminUserIfNotExists

func (svc *Service) CreateAdminUserIfNotExists(ctx context.Context, username, password string) error

func (*Service) CreateNewUser

func (svc *Service) CreateNewUser(ctx context.Context, operator *domain.Claims, username, password string) error

func (*Service) CreateRole

func (svc *Service) CreateRole(ctx context.Context, operator *domain.Claims, role *domain.Role) error

func (*Service) CreateScheduleStrategy

func (svc *Service) CreateScheduleStrategy(ctx context.Context, operator *domain.Claims, strategy *domain.ScheduleStrategy) error

func (*Service) CreateUser

func (svc *Service) CreateUser(ctx context.Context, operator domain.Claims, user *domain.User) error

func (*Service) DeleteRole

func (svc *Service) DeleteRole(ctx context.Context, operator *domain.Claims, roleID string) error

func (*Service) DeleteScheduleIntents added in v1.1.0

func (svc *Service) DeleteScheduleIntents(ctx context.Context, operator *domain.Claims, intentIDs []string) error

func (*Service) DeleteScheduleStrategy added in v1.1.0

func (svc *Service) DeleteScheduleStrategy(ctx context.Context, operator *domain.Claims, strategyID string) error

func (*Service) DeleteUser

func (svc *Service) DeleteUser(ctx context.Context, operator domain.Claims, userID bson.ObjectID) error

func (*Service) GetPodPIDMapping added in v1.2.0

func (svc *Service) GetPodPIDMapping(ctx context.Context, nodeID string) (*domain.PodPIDMappingResponse, error)

func (Service) ListAuditLogs

func (svc Service) ListAuditLogs(ctx context.Context, opt *domain.QueryAuditLogOptions) error

func (*Service) ListNodes added in v1.2.0

func (svc *Service) ListNodes(ctx context.Context) ([]*domain.Node, error)

ListNodes returns all nodes in the Kubernetes cluster

func (*Service) ListScheduleIntents

func (svc *Service) ListScheduleIntents(ctx context.Context, filterOpts *domain.QueryIntentOptions) error

func (*Service) ListScheduleStrategies

func (svc *Service) ListScheduleStrategies(ctx context.Context, filterOpts *domain.QueryStrategyOptions) error

func (*Service) Login

func (svc *Service) Login(ctx context.Context, username, password string) (string, error)

func (Service) QueryPermissions

func (svc Service) QueryPermissions(ctx context.Context, opt *domain.QueryPermissionOptions) error

func (*Service) QueryRoles

func (svc *Service) QueryRoles(ctx context.Context, opt *domain.QueryRoleOptions) error

func (*Service) QueryUsers

func (svc *Service) QueryUsers(ctx context.Context, opt *domain.QueryUserOptions) error

func (*Service) ReconcileIntents added in v1.2.1

func (svc *Service) ReconcileIntents(ctx context.Context) error

ReconcileIntents performs a full reconciliation of scheduling intents. It handles three scenarios:

  1. Manager restart: re-sends all intents from DB to DM pods
  2. Decision Maker restart: detects Merkle root mismatch and re-sends intents
  3. Pod restart: detects stale intents (pods that no longer exist) and refreshes them

func (*Service) ResetPassword

func (svc *Service) ResetPassword(ctx context.Context, operator *domain.Claims, id, newPassword string) error

func (*Service) UpdateRole

func (svc *Service) UpdateRole(ctx context.Context, operator *domain.Claims, roleID string, opt domain.UpdateRoleOptions) error

func (*Service) UpdateUser

func (svc *Service) UpdateUser(ctx context.Context, operator domain.Claims, user *domain.User) error

func (*Service) UpdateUserPermissions

func (svc *Service) UpdateUserPermissions(ctx context.Context, operator *domain.Claims, id string, opt domain.UpdateUserPermissionsOptions) error

func (*Service) VerifyJWTToken

func (svc *Service) VerifyJWTToken(ctx context.Context, tokenString string, permissionKey domain.PermissionKey) (domain.Claims, domain.RolePolicy, error)

Jump to

Keyboard shortcuts

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