instance

package
v0.0.0-...-eabf389 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MPL-2.0 Imports: 61 Imported by: 0 modules, 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

View Source
var ErrBusy = errors.New("实例正忙")
View Source
var ErrClosing = errors.New("Control Plane 正在关闭")
View Source
var ErrDeleting = errors.New("实例正在删除,请重试删除操作")
View Source
var ErrNameExists = errors.New("实例名称已存在")

Functions

This section is empty.

Types

type Info

type Info struct {
	ID                string    `json:"id"`
	Name              string    `json:"name"`
	CreatedAt         time.Time `json:"created_at"`
	Enabled           bool      `json:"enabled"`
	Error             string    `json:"error,omitempty"`
	RestartRequired   bool      `json:"restart_required,omitempty"`
	Deleting          bool      `json:"deleting,omitempty"`
	CredentialTargets []string  `json:"credential_targets,omitempty"`
}

type Manager

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

func NewDatabase

func NewDatabase(root string) (*Manager, error)

NewDatabase starts the control plane with SQL as its only runtime state source. Legacy JSON, dotenv and dialogue YAML files are never read.

func NewDatabaseWithDB

func NewDatabaseWithDB(root string, db *storage.DB) (*Manager, error)

NewDatabaseWithDB adopts an already connected database for a control plane.

func (*Manager) ApplyGlobalSettings

func (m *Manager) ApplyGlobalSettings() error

ApplyGlobalSettings refreshes control-plane dependencies and every instance runtime after a committed global setting change. Pending deletions stay paused.

func (*Manager) CancelDeletion

func (m *Manager) CancelDeletion(id string) error

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) ConfirmDeletion

func (m *Manager) ConfirmDeletion(id string) (resultErr error)

func (*Manager) ControlPlaneGetenv

func (m *Manager) ControlPlaneGetenv() func(string) string

ControlPlaneGetenv returns the configuration getter used for control plane authorization.

func (*Manager) Copy

func (m *Manager) Copy(target, source string) error

func (*Manager) Create

func (m *Manager) Create(name string) (Info, error)

func (*Manager) Delete

func (m *Manager) Delete(id string, all bool) error

func (*Manager) Enable

func (m *Manager) Enable(id string, enabled bool) error

func (*Manager) Engine

func (m *Manager) Engine(id string) (*llm.Engine, error)

Engine returns an instance engine by its canonical registry ID.

func (*Manager) GlobalConfig

func (m *Manager) GlobalConfig() *instanceconfig.Store

GlobalConfig returns the global configuration store.

func (*Manager) ImportMemories

func (m *Manager) ImportMemories(id string, data backup.Memories) (memory.ImportResult, error)

func (*Manager) ImportSettings

func (m *Manager) ImportSettings(id string, data backup.Settings) error

func (*Manager) InstancePart

func (m *Manager) InstancePart(id, part string) (data []byte, mediaType, fileName string, err error)

func (*Manager) InstanceZIP

func (m *Manager) InstanceZIP(id string) ([]byte, error)

func (*Manager) List

func (m *Manager) List() ([]Info, int)

func (*Manager) PrepareDeletion

func (m *Manager) PrepareDeletion(id string) error

func (*Manager) Rename

func (m *Manager) Rename(id, name string) error

func (*Manager) RestoreInstanceZIP

func (m *Manager) RestoreInstanceZIP(name string, archive []byte) (result Info, resultErr error)

func (*Manager) SecurityController

func (m *Manager) SecurityController() *security.Controller

SecurityController returns the single controller shared by every runtime.

func (*Manager) ServeHTTP

func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Manager) SetGlobalApplyHook

func (m *Manager) SetGlobalApplyHook(hook func() error)

func (*Manager) SettingsWriteHandler

func (m *Manager) SettingsWriteHandler(next http.Handler) http.Handler

SettingsWriteHandler serializes other global setting writers with draft commit, runtime application and rollback. Reads do not need this lock.

type Runtime

type Runtime struct {
	Scope   *runtimescope.Scope
	Engine  *llm.Engine
	Handler http.Handler
	Onebot  *onebot.Adapter
	// contains filtered or unexported fields
}

func (*Runtime) StartBackground

func (r *Runtime) StartBackground()

StartBackground starts activation-owned workers only after the runtime is published. Building disabled or rollback candidates never initiates a dial.

func (*Runtime) StartEmbeddings

func (r *Runtime) StartEmbeddings()

func (*Runtime) Stop

func (r *Runtime) Stop()

Jump to

Keyboard shortcuts

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