Documentation
¶
Index ¶
- Variables
- type Info
- type Manager
- func (m *Manager) ApplyGlobalSettings() error
- func (m *Manager) CancelDeletion(id string) error
- func (m *Manager) Close()
- func (m *Manager) ConfirmDeletion(id string) (resultErr error)
- func (m *Manager) ControlPlaneGetenv() func(string) string
- func (m *Manager) Copy(target, source string) error
- func (m *Manager) Create(name string) (Info, error)
- func (m *Manager) Delete(id string, all bool) error
- func (m *Manager) Enable(id string, enabled bool) error
- func (m *Manager) Engine(id string) (*llm.Engine, error)
- func (m *Manager) GlobalConfig() *instanceconfig.Store
- func (m *Manager) ImportMemories(id string, data backup.Memories) (memory.ImportResult, error)
- func (m *Manager) ImportSettings(id string, data backup.Settings) error
- func (m *Manager) InstancePart(id, part string) (data []byte, mediaType, fileName string, err error)
- func (m *Manager) InstanceZIP(id string) ([]byte, error)
- func (m *Manager) List() ([]Info, int)
- func (m *Manager) PrepareDeletion(id string) error
- func (m *Manager) Rename(id, name string) error
- func (m *Manager) RestoreInstanceZIP(name string, archive []byte) (result Info, resultErr error)
- func (m *Manager) SecurityController() *security.Controller
- func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Manager) SetGlobalApplyHook(hook func() error)
- func (m *Manager) SettingsWriteHandler(next http.Handler) http.Handler
- type Runtime
Constants ¶
This section is empty.
Variables ¶
var ErrBusy = errors.New("实例正忙")
var ErrClosing = errors.New("Control Plane 正在关闭")
var ErrDeleting = errors.New("实例正在删除,请重试删除操作")
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 ¶
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 ¶
NewDatabaseWithDB adopts an already connected database for a control plane.
func (*Manager) ApplyGlobalSettings ¶
ApplyGlobalSettings refreshes control-plane dependencies and every instance runtime after a committed global setting change. Pending deletions stay paused.
func (*Manager) CancelDeletion ¶
func (*Manager) ConfirmDeletion ¶
func (*Manager) ControlPlaneGetenv ¶
ControlPlaneGetenv returns the configuration getter used for control plane authorization.
func (*Manager) GlobalConfig ¶
func (m *Manager) GlobalConfig() *instanceconfig.Store
GlobalConfig returns the global configuration store.
func (*Manager) ImportMemories ¶
func (*Manager) ImportSettings ¶
func (*Manager) InstancePart ¶
func (*Manager) PrepareDeletion ¶
func (*Manager) RestoreInstanceZIP ¶
func (*Manager) SecurityController ¶
func (m *Manager) SecurityController() *security.Controller
SecurityController returns the single controller shared by every runtime.
func (*Manager) SetGlobalApplyHook ¶
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()