services

package
v1.0.38 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityService

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

ActivityService serves the audit-trail read API (MINE-141).

func NewActivityService

func NewActivityService(store *storage.Store, log *logger.Logger) *ActivityService

type AuthService

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

func NewAuthService

func NewAuthService(store *storage.Store, authManager *auth.Manager, enforcer *rbac.Enforcer, oidcHandler *auth.OIDCHandler, log *logger.Logger) *AuthService

func (*AuthService) GetInvite

func (*AuthService) Login

func (*AuthService) Logout

func (*AuthService) Register

type BackupService

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

BackupService manages on-demand backup records (MINE-138).

func NewBackupService

func NewBackupService(store *storage.Store, dockerCli *docker.Client, pool *docker.ClientPool, s3cfg appconfig.S3Config, log *logger.Logger) *BackupService

func (*BackupService) SetEnforcer

func (s *BackupService) SetEnforcer(e *rbac.Enforcer)

SetEnforcer injects the RBAC enforcer used for per-server authorization on backup records. Kept as a setter so the constructor signature (and therefore every existing call site) stays stable.

type BlueprintService

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

BlueprintService serves server flavor seeds (MINE-143).

func NewBlueprintService

func NewBlueprintService(store *storage.Store, log *logger.Logger) *BlueprintService

type BundleInfo

type BundleInfo struct {
	ID        string
	Filename  string
	Path      string
	Size      int64
	CreatedAt time.Time
}

BundleInfo stores information about a generated bundle

type ConfigService

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

func NewConfigService

func NewConfigService(store *storage.Store, cfg *config.Config, dockerCli *docker.Client, pool *docker.ClientPool, log *logger.Logger) *ConfigService

Creates new config service

func (*ConfigService) GetGlobalSettings

Gets global settings

func (*ConfigService) GetServerConfig

Gets server config

func (*ConfigService) SyncGlobalSettingsToServers

SyncGlobalSettingsToServers propagates global defaults (like Ops and Whitelist) to all existing servers

func (*ConfigService) UpdateGlobalSettings

Updates global settings

func (*ConfigService) UpdateServerConfig

Updates server config

type FileService

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

FileService implements the File service

func NewFileService

func NewFileService(store *storage.Store, docker *docker.Client, uploadManager *upload.Manager, downloadManager *download.Manager, log *logger.Logger) *FileService

NewFileService creates a new file service

func (*FileService) CopyFile

CopyFile copies a file or directory

func (*FileService) CreateArchive

CreateArchive creates a zip archive from selected paths

func (*FileService) CreateFolder

CreateFolder creates a new directory

func (*FileService) DeleteFile

DeleteFile deletes a file or multiple files (bulk)

func (*FileService) DownloadArchive

DownloadArchive creates a zip on disk and returns a download session. The actual bytes are served via GET /api/v1/download/{session_id}.

func (*FileService) DownloadRemoteArchive

DownloadRemoteArchive downloads an archive from a remote URL (GitHub releases, S3, CDN) with progress, checksum validation, and optional auto-extraction

func (*FileService) ExtractArchive

ExtractArchive extracts an archive

func (*FileService) GetExtractionStatus

Get progress of extraction

func (*FileService) GetFile

GetFile gets a file's content

func (*FileService) GetRemoteArchiveProgress

GetRemoteArchiveProgress returns current status and bytes progress of a remote download

func (*FileService) InitFileDownload

Creates a download session for file Bytes are served via GET /api/v1/download/{session_id}.

func (*FileService) ListFiles

ListFiles lists files in a directory

func (*FileService) MoveFile

MoveFile moves a file or directory to a new location

func (*FileService) RenameFile

RenameFile renames a file

func (*FileService) SaveUploadedFile

SaveUploadedFile saves a file from a completed chunked upload session

func (*FileService) Stop

func (s *FileService) Stop()

Stop terminates the background cleanup goroutine. Safe to call more than once. Callers that construct a FileService outside the normal server startup path (notably tests) should defer this so they do not leak the goroutine.

func (*FileService) UpdateFile

UpdateFile updates a file's content

type MinecraftService

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

MinecraftService implements the Minecraft service

func NewMinecraftService

func NewMinecraftService(store *storage.Store, docker *docker.Client, log *logger.Logger) *MinecraftService

NewMinecraftService creates a new minecraft service

func (*MinecraftService) GetDockerImages

GetDockerImages gets available Docker images

func (*MinecraftService) GetMinecraftVersions

GetMinecraftVersions gets available Minecraft versions

func (*MinecraftService) GetModLoaders

GetModLoaders gets available mod loaders

type ModService

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

ModService implements the Mod service

func NewModService

func NewModService(store *storage.Store, docker *docker.Client, uploadManager *upload.Manager, log *logger.Logger) *ModService

NewModService creates a new mod service

func (*ModService) DeleteMod

DeleteMod deletes a mod

func (*ModService) GetFabricOptimizationStack

GetFabricOptimizationStack checks the status and compatibility of Lithium, FerriteCore, ModernFix, and C2ME

func (*ModService) GetMod

GetMod gets a specific mod

func (*ModService) ImportUploadedMod

ImportUploadedMod imports a mod

func (*ModService) InstallFabricOptimizationStack

InstallFabricOptimizationStack installs or updates Lithium, FerriteCore, ModernFix, and/or C2ME

func (*ModService) ListMods

ListMods lists mods for a server

func (*ModService) UpdateMod

UpdateMod updates a mod

type ModpackService

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

ModpackService implements the Modpack service

func NewModpackService

func NewModpackService(store *storage.Store, cfg *config.Config, uploadManager *upload.Manager, log *logger.Logger) *ModpackService

NewModpackService creates a new modpack service

func (*ModpackService) DeleteModpack

DeleteModpack deletes a modpack

func (*ModpackService) GetIndexerStatus

GetIndexerStatus gets indexer status

func (*ModpackService) GetModpack

GetModpack gets a specific modpack

func (*ModpackService) GetModpackBySlug

GetModpackBySlug gets a modpack by its slug

func (*ModpackService) GetModpackByURL

GetModpackByURL gets a modpack by its website URL

func (*ModpackService) GetModpackConfig

GetModpackConfig gets modpack configuration

func (*ModpackService) GetModpackFiles

GetModpackFiles gets modpack files

func (*ModpackService) GetModpackVersions

GetModpackVersions gets modpack versions

func (*ModpackService) ImportRemoteModpack

ImportRemoteModpack imports a modpack from a remote URL (e.g. GitHub release, CDN, static host)

func (*ModpackService) ImportUploadedModpack

ImportUploadedModpack imports a modpack from a completed chunked upload session

func (*ModpackService) ListFavorites

ListFavorites lists favorite modpacks

func (*ModpackService) SearchModpacks

SearchModpacks searches for modpacks

func (*ModpackService) SyncModpackFiles

SyncModpackFiles syncs modpack files

func (*ModpackService) SyncModpacks

SyncModpacks syncs modpacks

func (*ModpackService) ToggleFavorite

ToggleFavorite toggles modpack favorite status

type ModuleService

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

ModuleService implements the Module service

func NewModuleService

func NewModuleService(
	store *storage.Store,
	docker *docker.Client,
	moduleManager *module.Manager,
	proxyManager *proxy.Manager,
	authManager *auth.Manager,
	cfg *config.Config,
	logStreamer *logger.LogStreamer,
	log *logger.Logger,
) *ModuleService

NewModuleService creates a new module service

func (*ModuleService) GetAvailableAliases

GetAvailableAliases returns all available aliases for module/template configuration

func (*ModuleService) GetModule

func (*ModuleService) GetResolvedAliases

Get all aliases with resolved values for ctx

func (*ModuleService) StopModule

type NodeService

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

NodeService handles Docker daemon node management RPCs

func NewNodeService

func NewNodeService(store *storage.Store, pool *docker.ClientPool, log *logger.Logger) *NodeService

NewNodeService creates a new NodeService instance

func (*NodeService) CreateNode

CreateNode creates a new remote node

func (*NodeService) DeleteNode

DeleteNode removes a remote node if no servers/modules are assigned to it

func (*NodeService) GetNode

GetNode retrieves a single node by ID with stats

func (*NodeService) ListNodes

ListNodes lists all nodes along with resource allocation stats

func (*NodeService) PingNode

PingNode tests connectivity to the specified Docker node

func (*NodeService) UpdateNode

UpdateNode updates an existing node's configuration

type ProxyService

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

ProxyService implements the Proxy service

func NewProxyService

func NewProxyService(store *storage.Store, dockerClient *docker.Client, pool *docker.ClientPool, proxyManager *proxy.Manager, cfg *config.Config, logStreamer *logger.LogStreamer, log *logger.Logger) *ProxyService

NewProxyService creates a new proxy service

func (*ProxyService) CreateProxyListener

CreateProxyListener creates a proxy listener

func (*ProxyService) DeleteProxyListener

DeleteProxyListener deletes a proxy listener

func (*ProxyService) GetProxyListeners

GetProxyListeners gets proxy listeners

func (*ProxyService) GetProxyRoutes

GetProxyRoutes gets proxy routes

func (*ProxyService) GetProxyStatus

GetProxyStatus gets proxy status

func (*ProxyService) GetServerRouting

GetServerRouting gets server routing configuration

func (*ProxyService) GetVelocitySecret

GetVelocitySecret retrieves or lazily auto-generates the modern forwarding secret

func (*ProxyService) RotateVelocitySecret

RotateVelocitySecret generates a new secret (or applies a custom one) and syncs to backend Paper servers

func (*ProxyService) SyncVelocitySecretToServer

SyncVelocitySecretToServer updates a specific server's config files with the active forwarding secret

func (*ProxyService) UpdateProxyConfig

UpdateProxyConfig updates proxy configuration

func (*ProxyService) UpdateProxyListener

UpdateProxyListener updates a proxy listener

func (*ProxyService) UpdateServerRouting

UpdateServerRouting updates server routing configuration

type RoleService

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

func NewRoleService

func NewRoleService(store *storage.Store, enforcer *rbac.Enforcer, log *logger.Logger) *RoleService

func (*RoleService) GetRole

func (*RoleService) ListRoles

type ServerService

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

ServerService implements the Server service

func NewServerService

func NewServerService(
	store *storage.Store,
	dockerCli *docker.Client,
	sender *command.Sender,
	config *config.Config,
	proxy *proxy.Manager,
	logStreamer *logger.LogStreamer,
	metricsCollector *metrics.Collector,
	moduleManager *module.Manager,
	bus *events.Bus,
	log *logger.Logger,
	pool *docker.ClientPool,
	placementEngine *docker.PlacementEngine,
	enforcer *rbac.Enforcer,
) *ServerService

NewServerService creates a new server service

func (*ServerService) ClearServerLogs

ClearServerLogs clears server logs

func (*ServerService) CreateServer

CreateServer creates a new server

func (*ServerService) DeleteServer

DeleteServer deletes a server

func (*ServerService) GetNextAvailablePort

GetNextAvailablePort gets the next available port

func (*ServerService) GetServer

GetServer gets a specific server

func (*ServerService) GetServerLogs

GetServerLogs gets server logs

func (*ServerService) ListServerPlayers

ListServerPlayers returns the live online roster from the metrics collector (RCON `list` / SLP sample), empty when offline (MINE-140).

func (*ServerService) ListServers

ListServers lists all servers

func (*ServerService) MigrateServer

MigrateServer moves a server instance from its current node to a target node

func (*ServerService) RecreateServer

Destroys and recreates a server container from scratch - brute force reset

func (*ServerService) RestartServer

RestartServer restarts a server

func (*ServerService) SendCommand

SendCommand sends a command to a server

func (*ServerService) SetClientPool

func (s *ServerService) SetClientPool(pool *docker.ClientPool)

SetClientPool sets the client pool on the service

func (*ServerService) SetPlacementEngine

func (s *ServerService) SetPlacementEngine(engine *docker.PlacementEngine)

SetPlacementEngine sets the placement engine on the service

func (*ServerService) StartServer

StartServer starts a server

func (*ServerService) StopServer

StopServer stops a server

func (*ServerService) UpdateServer

UpdateServer updates a server

func (*ServerService) UploadToMCLogs

Reads the server's latest.log and uploads it to mclo.gs

type SubuserService

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

SubuserService manages per-server grants (MINE-139).

func NewSubuserService

func NewSubuserService(store *storage.Store, log *logger.Logger) *SubuserService

func (*SubuserService) SetSubuser

type SupportService

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

SupportService implements the Support service

func NewSupportService

func NewSupportService(store *storage.Store, docker *docker.Client, config *config.Config, log *logger.Logger) *SupportService

NewSupportService creates a new support service

func (*SupportService) DownloadSupportBundle

DownloadSupportBundle downloads a support bundle

func (*SupportService) GenerateSupportBundle

GenerateSupportBundle generates a support bundle

func (*SupportService) GetApplicationLogs

GetApplicationLogs returns the application log file content

func (*SupportService) UploadSupportBundle

UploadSupportBundle generates and uploads a support bundle to the support server

type TaskService

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

TaskService implements the Task service

func NewTaskService

func NewTaskService(store *storage.Store, sched *scheduler.Scheduler, log *logger.Logger) *TaskService

NewTaskService creates a new task service

func (*TaskService) CancelExecution

CancelExecution cancels a running execution

func (*TaskService) CreateTask

CreateTask creates a new scheduled task

func (*TaskService) DeleteTask

DeleteTask deletes a task

func (*TaskService) GetSchedulerStatus

GetSchedulerStatus gets the scheduler status

func (*TaskService) GetTask

GetTask gets a specific task

func (*TaskService) GetTaskExecution

GetTaskExecution gets a specific execution

func (*TaskService) ListServerExecutions

ListServerExecutions gets execution history for a server

func (*TaskService) ListTaskExecutions

ListTaskExecutions gets execution history for a task

func (*TaskService) ListTasks

ListTasks lists all tasks for a server

func (*TaskService) ToggleTask

ToggleTask toggles task enabled/disabled status

func (*TaskService) TriggerTask

TriggerTask manually triggers a task execution

func (*TaskService) UpdateTask

UpdateTask updates an existing task

type UploadService

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

UploadService implements the Upload service

func NewUploadService

func NewUploadService(manager *upload.Manager, cfg *config.Config, log *logger.Logger) *UploadService

NewUploadService creates a new upload service

func (*UploadService) CancelUpload

CancelUpload cancels an upload session and cleans up

func (*UploadService) GetManager

func (s *UploadService) GetManager() *upload.Manager

GetManager returns the upload manager (for use by other services)

func (*UploadService) GetUploadStatus

GetUploadStatus returns the status of an upload session

func (*UploadService) InitUpload

InitUpload creates a new upload session

func (*UploadService) UploadChunk

UploadChunk uploads a single chunk

type UploadUserInfo

type UploadUserInfo struct {
	DiscordUsername  string
	Email            string
	GithubUsername   string
	IssueDescription string
	StepsToReproduce string
}

UploadUserInfo contains user-provided contact and issue information

type UserService

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

func NewUserService

func NewUserService(store *storage.Store, authManager *auth.Manager, log *logger.Logger) *UserService

func (*UserService) GetUser

func (*UserService) ListUsers

Jump to

Keyboard shortcuts

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