Documentation
¶
Index ¶
- Variables
- func DownloadDeliveryMode(cfg config.MCP) string
- func FormatLogLine(line LogLine, ansi bool) string
- type AccountView
- type AccountsInput
- type AliasView
- type AliasesInput
- type AssetInput
- type AssetResult
- type AssetView
- type AssetsInput
- type AuthReader
- type CallDetails
- type CancelInput
- type CloseInput
- type CommitUploadInput
- type ConfigReader
- type ConnectionInput
- type ConnectionView
- type Connector
- func (c Connector) Dial(ctx context.Context, r ResolvedTarget) (*ssh.Client, error)
- func (c Connector) DialUpload(ctx context.Context, r ResolvedTarget) (*ssh.Client, error)
- func (c Connector) OpenDownloadSFTP(ctx context.Context, r ResolvedTarget) (DownloadSFTP, error)
- func (c Connector) OpenUploadSFTP(ctx context.Context, r ResolvedTarget) (UploadSFTP, error)
- func (c Connector) Resolve(ctx context.Context, in Target) (ResolvedTarget, error)
- func (c Connector) Validate(ctx context.Context, r ResolvedTarget) error
- type DownloadIDInput
- type DownloadInput
- type DownloadLink
- type DownloadProgress
- type DownloadRemote
- type DownloadRename
- type DownloadResult
- type DownloadSFTP
- type DownloadView
- type DownloadedFile
- type DownloadsPageInput
- type Engine
- func (e *Engine) CancelDownload(_ context.Context, in DownloadIDInput) (DownloadView, error)
- func (e *Engine) CancelExecution(ctx context.Context, in CancelInput) (ExecutionView, error)
- func (e *Engine) CancelUpload(_ context.Context, in UploadIDInput) (UploadView, error)
- func (e *Engine) CancelUploadSource(_ context.Context, in UploadSourceInput) (UploadSourceView, error)
- func (e *Engine) CloseConnection(ctx context.Context, in CloseInput) (ConnectionView, error)
- func (e *Engine) CommitUpload(ctx context.Context, in CommitUploadInput) (UploadView, error)
- func (e *Engine) ConnectionsPage(ctx context.Context, in PageInput) (Page[ConnectionView], error)
- func (e *Engine) DownloadFiles(ctx context.Context, in DownloadInput) (DownloadView, error)
- func (e *Engine) DownloadsPage(_ context.Context, in DownloadsPageInput) (Page[DownloadView], error)
- func (e *Engine) Execute(ctx context.Context, in ExecuteInput) (ExecutionView, error)
- func (e *Engine) ExecutionsPage(ctx context.Context, in ExecutionsPageInput) (Page[ExecutionView], error)
- func (e *Engine) GetConnection(_ context.Context, in ConnectionInput) (ConnectionView, error)
- func (e *Engine) GetDownload(ctx context.Context, in GetDownloadInput) (DownloadView, error)
- func (e *Engine) GetExecution(ctx context.Context, in GetExecutionInput) (ExecutionView, error)
- func (e *Engine) GetUpload(ctx context.Context, in GetUploadInput) (UploadView, error)
- func (e *Engine) GetUploadSource(_ context.Context, in UploadSourceInput) (UploadSourceView, error)
- func (e *Engine) Limits() map[string]int64
- func (e *Engine) ListConnections(_ context.Context, _ struct{}) ([]ConnectionView, error)
- func (e *Engine) ListExecutions(_ context.Context, in ListExecutionsInput) ([]ExecutionView, error)
- func (e *Engine) Open(ctx context.Context, in OpenInput) (OpenResult, error)
- func (e *Engine) PrepareUpload(ctx context.Context, in PrepareUploadInput) (UploadSourceView, error)
- func (e *Engine) RecordCall(name string, err error, details ...CallDetails)
- func (e *Engine) RequestEpoch() uint64
- func (e *Engine) Retire()
- func (e *Engine) Shutdown(ctx context.Context) error
- func (e *Engine) Stats() EngineStats
- func (e *Engine) UploadFiles(ctx context.Context, in UploadInput) (UploadView, error)
- func (e *Engine) UploadsPage(_ context.Context, in UploadsPageInput) (Page[UploadView], error)
- type EngineOptions
- type EngineStats
- type ExecuteInput
- type ExecutionView
- type ExecutionsPageInput
- type Fault
- type GetDownloadInput
- type GetExecutionInput
- type GetUploadInput
- type HandlerFactory
- type History
- type IdentitySource
- type Instance
- type Limits
- type ListExecutionsInput
- type LogLine
- type LogPage
- type OpenInput
- type OpenResult
- type OutputChunk
- type OutputView
- type Page
- type PageInput
- type PrepareUploadInput
- type ProfilePageInput
- type ProfileView
- type ProtocolView
- type Queries
- func (q *Queries) GetAsset(ctx context.Context, input AssetInput) (AssetResult, error)
- func (q *Queries) ListAccounts(ctx context.Context, input AccountsInput) (Page[AccountView], error)
- func (q *Queries) ListAliases(ctx context.Context, input AliasesInput) (Page[AliasView], error)
- func (q *Queries) ListAssets(ctx context.Context, input AssetsInput) (Page[AssetView], error)
- func (q *Queries) ListOrganizations(ctx context.Context, input ProfilePageInput) (Page[jumpserver.Organization], error)
- func (q *Queries) ListProfiles(ctx context.Context, input PageInput) (Page[ProfileView], error)
- type QueryError
- type ResolutionHint
- type ResolvedTarget
- type ResourceReader
- type Runtime
- func (r *Runtime) CloseConnection(ctx context.Context, input CloseInput) (ConnectionView, error)
- func (r *Runtime) Connections(ctx context.Context) ([]ConnectionView, error)
- func (r *Runtime) History() *History
- func (r *Runtime) Restart(ctx context.Context) (Status, error)
- func (r *Runtime) Start(ctx context.Context) (Status, error)
- func (r *Runtime) Status(ctx context.Context) (Status, error)
- func (r *Runtime) Stop(ctx context.Context) error
- func (r *Runtime) Wait(ctx context.Context) error
- type Settings
- func (s Settings) AcquireInstance(ctx context.Context) (func() error, error)
- func (s Settings) Config() (config.MCP, error)
- func (s Settings) GenerateToken(ctx context.Context) (string, error)
- func (s Settings) SaveConfig(ctx context.Context, value config.MCP) error
- func (s Settings) TokenConfigured() (bool, error)
- func (s Settings) UpdateConfig(ctx context.Context, change func(*config.MCP) error) (config.MCP, error)
- type Status
- type Target
- type UploadEntry
- type UploadIDInput
- type UploadInput
- type UploadProgress
- type UploadRemote
- type UploadResult
- type UploadSFTP
- type UploadSourceInput
- type UploadSourceView
- type UploadView
- type UploadedFile
- type UploadsPageInput
Constants ¶
This section is empty.
Variables ¶
var ErrRunning = errors.New("MCP 实例正在运行或管理操作忙碌,请先停止服务后重试")
Functions ¶
func DownloadDeliveryMode ¶
交付规则取自本次运行配置,不根据单个请求的来源猜测调用方文件系统。
func FormatLogLine ¶
FormatLogLine 的 ANSI 编号与 GUI 色板语义相同。外部终端决定实际颜色。
Types ¶
type AccountView ¶
type AccountsInput ¶
type AliasView ¶
type AliasView struct {
Name string `json:"name"`
Profile string `json:"profile"`
Organization string `json:"organization"`
AssetReference string `json:"asset_reference"`
AccountReference string `json:"account_reference"`
AssetID string `json:"asset_id,omitempty"`
AccountID string `json:"account_id,omitempty"`
ResolutionStatus string `json:"resolution_status"`
}
type AliasesInput ¶
type AssetInput ¶
type AssetResult ¶
type AssetResult struct {
Profile string `json:"profile"`
Organization string `json:"organization"`
Asset AssetView `json:"asset"`
Accounts []AccountView `json:"accounts"`
Protocols []ProtocolView `json:"protocols"`
}
type AssetsInput ¶
type CallDetails ¶
type CallDetails struct {
Summary, Conditions string
ConnectionID, ExecutionID string
Duration time.Duration
}
CallDetails 只接受调用摘要和经过白名单筛选的条件,不持有原始请求或响应。
type CancelInput ¶
type CloseInput ¶
type CommitUploadInput ¶
type ConfigReader ¶
type ConnectionInput ¶
type ConnectionInput struct {
ConnectionID string `json:"connection_id"`
}
type ConnectionView ¶
type ConnectionView struct {
ID string `json:"connection_id"`
Target ResolvedTarget `json:"target"`
Status string `json:"status"`
TransportGeneration uint64 `json:"transport_generation"`
TransportConnected bool `json:"transport_connected"`
CreatedAt time.Time `json:"created_at"`
LastUsedAt time.Time `json:"last_used_at"`
ActiveExecutionID string `json:"active_execution_id,omitempty"`
ClosedAt *time.Time `json:"closed_at,omitempty"`
CloseReason string `json:"close_reason,omitempty"`
LastError *Fault `json:"last_error,omitempty"`
ExecCapability string `json:"exec_capability"`
RemoteDeadlineCapability string `json:"remote_deadline_capability"`
LastDisconnectReason string `json:"last_disconnect_reason,omitempty"`
RetryAfterMS int64 `json:"retry_after_ms"`
RecentUnknownExecutionIDs []string `json:"recent_unknown_execution_ids"`
}
type Connector ¶
type Connector struct {
Config ConfigReader
Auth IdentitySource
Queries *Queries
Connect connect.Service
KnownHosts string
Timeout time.Duration
}
Connector 读取默认选择并将唯一目标固定为 ID;不修改配置,不发起交互登录或主机信任弹窗。
func (Connector) DialUpload ¶
func (Connector) OpenDownloadSFTP ¶
func (c Connector) OpenDownloadSFTP(ctx context.Context, r ResolvedTarget) (DownloadSFTP, error)
func (Connector) OpenUploadSFTP ¶
func (c Connector) OpenUploadSFTP(ctx context.Context, r ResolvedTarget) (UploadSFTP, error)
type DownloadIDInput ¶
type DownloadIDInput struct {
DownloadID string `json:"download_id"`
}
type DownloadInput ¶
type DownloadInput struct {
Target Target `json:"target,omitempty"`
ConnectionID string `json:"connection_id,omitempty"`
RequestKey string `json:"request_key"`
RemotePaths []string `json:"remote_paths"`
LocalDirectory string `json:"local_directory,omitempty"`
TimeoutMS int `json:"timeout_ms,omitempty"`
WaitMS *int `json:"wait_ms,omitempty"`
}
type DownloadLink ¶
type DownloadLink struct {
URL string `json:"url,omitempty"`
FileName string `json:"file_name"`
Format string `json:"format"`
Size int64 `json:"size"`
ExpiresAt time.Time `json:"expires_at"`
RequiresExtraction bool `json:"requires_extraction"`
RestoreName string `json:"restore_name"`
Artifact downloadcache.Artifact `json:"-"`
Available bool `json:"available"`
}
type DownloadProgress ¶
type DownloadProgress struct {
Phase string `json:"phase"`
Protocol string `json:"protocol,omitempty"`
TransferredBytes int64 `json:"transferred_bytes"`
TransferBytes int64 `json:"transfer_bytes"`
Published *DownloadResult `json:"-"`
}
type DownloadRemote ¶
type DownloadRemote interface {
Open(string) (io.ReadCloser, error)
Close() error
}
type DownloadRename ¶
type DownloadRename struct {
Source string `json:"source"`
ArchivePath string `json:"archive_path"`
}
ArchivePath 是准备包中的相对位置;只有同名独立来源被改名时返回对应关系。
type DownloadResult ¶
type DownloadResult struct {
Delivery string `json:"delivery,omitempty"`
Link *DownloadLink `json:"link,omitempty"`
Instructions string `json:"instructions,omitempty"`
RenamedEntries []DownloadRename `json:"renamed_entries,omitempty"`
Directory string `json:"directory,omitempty"`
Files []DownloadedFile `json:"files,omitempty"`
Warnings []string `json:"warnings,omitempty"`
RemoteArtifacts []string `json:"remote_artifacts,omitempty"`
}
type DownloadSFTP ¶
type DownloadSFTP struct {
Client DownloadRemote
Root *string
Account string
}
type DownloadView ¶
type DownloadView struct {
ID string `json:"download_id"`
Target ResolvedTarget `json:"target"`
Status string `json:"status"`
DownloadProgress
DownloadResult
FilesReady bool `json:"files_ready"`
RemoteMayContinue bool `json:"remote_may_continue"`
AcceptedAt time.Time `json:"accepted_at"`
DeadlineAt time.Time `json:"deadline_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Error *Fault `json:"error,omitempty"`
}
type DownloadedFile ¶
type DownloadsPageInput ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine 归属于一次服务实例;HTTP 请求结束不取消它拥有的工作。
func NewEngine ¶
func NewEngine(opts EngineOptions) *Engine
func (*Engine) CancelDownload ¶
func (e *Engine) CancelDownload(_ context.Context, in DownloadIDInput) (DownloadView, error)
func (*Engine) CancelExecution ¶
func (e *Engine) CancelExecution(ctx context.Context, in CancelInput) (ExecutionView, error)
func (*Engine) CancelUpload ¶
func (e *Engine) CancelUpload(_ context.Context, in UploadIDInput) (UploadView, error)
func (*Engine) CancelUploadSource ¶
func (e *Engine) CancelUploadSource(_ context.Context, in UploadSourceInput) (UploadSourceView, error)
func (*Engine) CloseConnection ¶
func (e *Engine) CloseConnection(ctx context.Context, in CloseInput) (ConnectionView, error)
func (*Engine) CommitUpload ¶
func (e *Engine) CommitUpload(ctx context.Context, in CommitUploadInput) (UploadView, error)
func (*Engine) ConnectionsPage ¶
func (*Engine) DownloadFiles ¶
func (e *Engine) DownloadFiles(ctx context.Context, in DownloadInput) (DownloadView, error)
func (*Engine) DownloadsPage ¶
func (e *Engine) DownloadsPage(_ context.Context, in DownloadsPageInput) (Page[DownloadView], error)
func (*Engine) Execute ¶
func (e *Engine) Execute(ctx context.Context, in ExecuteInput) (ExecutionView, error)
func (*Engine) ExecutionsPage ¶
func (e *Engine) ExecutionsPage(ctx context.Context, in ExecutionsPageInput) (Page[ExecutionView], error)
func (*Engine) GetConnection ¶
func (e *Engine) GetConnection(_ context.Context, in ConnectionInput) (ConnectionView, error)
func (*Engine) GetDownload ¶
func (e *Engine) GetDownload(ctx context.Context, in GetDownloadInput) (DownloadView, error)
func (*Engine) GetExecution ¶
func (e *Engine) GetExecution(ctx context.Context, in GetExecutionInput) (ExecutionView, error)
func (*Engine) GetUpload ¶
func (e *Engine) GetUpload(ctx context.Context, in GetUploadInput) (UploadView, error)
func (*Engine) GetUploadSource ¶
func (e *Engine) GetUploadSource(_ context.Context, in UploadSourceInput) (UploadSourceView, error)
func (*Engine) ListConnections ¶
func (e *Engine) ListConnections(_ context.Context, _ struct{}) ([]ConnectionView, error)
func (*Engine) ListExecutions ¶
func (e *Engine) ListExecutions(_ context.Context, in ListExecutionsInput) ([]ExecutionView, error)
func (*Engine) PrepareUpload ¶
func (e *Engine) PrepareUpload(ctx context.Context, in PrepareUploadInput) (UploadSourceView, error)
func (*Engine) RecordCall ¶
func (e *Engine) RecordCall(name string, err error, details ...CallDetails)
func (*Engine) RequestEpoch ¶
func (*Engine) Retire ¶
func (e *Engine) Retire()
Retire 在宿主停止实例后解除仓库到旧 Engine 的引用。历史只保留单条操作, 不因一条日志而保留整个旧实例的索引、连接池和上下文;在途清理仍持有自己的 Engine。
func (*Engine) Stats ¶
func (e *Engine) Stats() EngineStats
func (*Engine) UploadFiles ¶
func (e *Engine) UploadFiles(ctx context.Context, in UploadInput) (UploadView, error)
func (*Engine) UploadsPage ¶
func (e *Engine) UploadsPage(_ context.Context, in UploadsPageInput) (Page[UploadView], error)
type EngineOptions ¶
type EngineOptions struct {
History *History
Instance string
Resolve func(context.Context, Target) (ResolvedTarget, error)
Validate func(context.Context, ResolvedTarget) error
Dial func(context.Context, ResolvedTarget) (*ssh.Client, error)
OpenSFTP func(context.Context, ResolvedTarget) (DownloadSFTP, error)
Download func(context.Context, ResolvedTarget, DownloadInput, func(DownloadProgress)) (DownloadResult, error)
DialUpload func(context.Context, ResolvedTarget) (*ssh.Client, error)
OpenUploadSFTP func(context.Context, ResolvedTarget) (UploadSFTP, error)
Upload func(context.Context, ResolvedTarget, UploadInput, func(UploadProgress)) (UploadResult, error)
UploadCache *uploadcache.Store
DeliveryMode string
DownloadCache *downloadcache.Store
Limits Limits
Now func() time.Time
MaintenanceInterval time.Duration
}
type EngineStats ¶
type EngineStats struct {
Connections int `json:"connections"`
SSHConnections int `json:"ssh_connections"`
Connecting int `json:"connecting"`
Executions int `json:"executions"`
Downloads int `json:"downloads"`
UnknownDownloads int `json:"unknown_downloads"`
DownloadTransportSlots int `json:"download_transport_slots"`
Uploads int `json:"uploads"`
UnknownUploads int `json:"unknown_uploads"`
UploadTransportSlots int `json:"upload_transport_slots"`
UploadSources int `json:"upload_sources"`
UploadReceiving int `json:"upload_receiving"`
UnknownExecutions int `json:"unknown_executions"`
Draining bool `json:"draining"`
}
type ExecuteInput ¶
type ExecuteInput struct {
ConnectionID string `json:"connection_id"`
RequestKey string `json:"request_key"`
Command string `json:"command"`
Cwd string `json:"cwd"`
Env map[string]string `json:"env,omitempty"`
TimeoutMS int `json:"timeout_ms,omitempty"`
TimeoutStrategy string `json:"timeout_strategy,omitempty"`
WaitMS *int `json:"wait_ms,omitempty"`
}
type ExecutionView ¶
type ExecutionView struct {
ID string `json:"execution_id"`
ConnectionID string `json:"connection_id"`
Target ResolvedTarget `json:"target"`
TransportGeneration uint64 `json:"transport_generation"`
ConnectAttempts int `json:"connect_attempts"`
Reconnected bool `json:"reconnected"`
Status string `json:"status"`
DispatchState string `json:"dispatch_state"`
RemoteState string `json:"remote_state"`
RemoteMayContinue bool `json:"remote_may_continue"`
TerminationScope string `json:"termination_scope"`
AcceptedAt time.Time `json:"accepted_at"`
PrepareDeadlineAt time.Time `json:"prepare_deadline_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
ExitCode *int `json:"exit_code"`
ExitSignal string `json:"exit_signal,omitempty"`
Error *Fault `json:"error,omitempty"`
Reason string `json:"reason,omitempty"`
TimeoutMS int `json:"timeout_ms"`
TimeoutStrategy string `json:"timeout_strategy"`
CancelRequested bool `json:"cancel_requested"`
CancelConfirmed bool `json:"cancel_confirmed"`
CancelError *Fault `json:"cancel_error,omitempty"`
Output OutputView `json:"output"`
}
type ExecutionsPageInput ¶
type ExecutionsPageInput struct {
PageInput
ListExecutionsInput
}
type Fault ¶
type Fault struct {
Code string `json:"code"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
Resolution *ResolutionHint `json:"resolution,omitempty"`
}
Fault 只携带适合向 Agent 返回的信息,不透传凭据或上游原始响应。
type GetDownloadInput ¶
type GetExecutionInput ¶
type GetUploadInput ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
History 是宿主内共享的操作仓库。Engine 索引和输出链表只引用这里的对象; 所有实例共用同一把锁,回收时无需持有两个 Engine 锁或调用外部订阅者。
func NewHistory ¶
type IdentitySource ¶
type ListExecutionsInput ¶
type LogLine ¶
type LogLine struct {
Sequence uint64 `json:"sequence"`
Time time.Time `json:"time"`
Instance string `json:"instance"`
Severity string `json:"severity"`
Detail int `json:"detail"`
ConnectionID string `json:"connectionID,omitempty"`
ExecutionID string `json:"executionID,omitempty"`
Event string `json:"event"`
Text string `json:"text"`
}
type OpenResult ¶
type OpenResult struct {
Status string `json:"status"`
Connection *ConnectionView `json:"connection,omitempty"`
Reused bool `json:"reused"`
Error *Fault `json:"error,omitempty"`
}
type OutputChunk ¶
type OutputView ¶
type OutputView struct {
Chunks []OutputChunk `json:"chunks"`
NextCursor uint64 `json:"next_cursor"`
EarliestCursor uint64 `json:"earliest_cursor"`
HasMore bool `json:"has_more"`
Gap bool `json:"output_gap"`
Truncated bool `json:"output_truncated"`
Incomplete bool `json:"output_incomplete"`
DroppedBytes int64 `json:"dropped_bytes"`
}
type PrepareUploadInput ¶
type PrepareUploadInput struct {
Target Target `json:"target,omitempty"`
ConnectionID string `json:"connection_id,omitempty"`
RequestKey string `json:"request_key"`
RemoteDirectory string `json:"remote_directory"`
Format string `json:"format"`
Size int64 `json:"size"`
Entries []UploadEntry `json:"entries"`
}
type ProfilePageInput ¶
type ProfileView ¶
type ProtocolView ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func NewQueries ¶
func NewQueries(instance string, config ConfigReader, auth AuthReader, resources ResourceReader) *Queries
func (*Queries) GetAsset ¶
func (q *Queries) GetAsset(ctx context.Context, input AssetInput) (AssetResult, error)
func (*Queries) ListAccounts ¶
func (q *Queries) ListAccounts(ctx context.Context, input AccountsInput) (Page[AccountView], error)
func (*Queries) ListAliases ¶
func (*Queries) ListAssets ¶
func (*Queries) ListOrganizations ¶
func (q *Queries) ListOrganizations(ctx context.Context, input ProfilePageInput) (Page[jumpserver.Organization], error)
func (*Queries) ListProfiles ¶
type QueryError ¶
func (*QueryError) Error ¶
func (e *QueryError) Error() string
type ResolutionHint ¶
type ResolutionHint struct {
Profile string `json:"profile,omitempty"`
Organization string `json:"organization,omitempty"`
AssetID string `json:"asset_id,omitempty"`
NextTool string `json:"next_tool"`
Assets []AssetView `json:"assets,omitempty"`
Accounts []AccountView `json:"accounts,omitempty"`
Truncated bool `json:"truncated,omitempty"`
}
ResolutionHint 只提供当前解析范围和有界公开候选,不携带上游响应或凭据。
type ResolvedTarget ¶
type ResourceReader ¶
type ResourceReader interface {
ListOrganizations(context.Context, string) ([]jumpserver.Organization, error)
ListAssets(context.Context, string, string, string, int, int) (jumpserver.AssetPage, error)
GetAssetByID(context.Context, string, string, string) (jumpserver.AssetDetail, error)
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime 的生存期属于宿主进程,不属于启动请求或 MCP 协议会话。
func NewRuntime ¶
func NewRuntime(settings Settings, host string, handler HandlerFactory) *Runtime
func (*Runtime) CloseConnection ¶
func (r *Runtime) CloseConnection(ctx context.Context, input CloseInput) (ConnectionView, error)
func (*Runtime) Connections ¶
func (r *Runtime) Connections(ctx context.Context) ([]ConnectionView, error)
type Settings ¶
type Settings struct {
Store config.Store
// 仅兼容旧开发版的独立 Token 文件;显式保存后以 config.toml 为准。
Credentials credential.Backend
Locker filelock.Locker
}
func (Settings) AcquireInstance ¶
AcquireInstance 约束服务生存期,同一应用数据目录只允许一个宿主监听。
func (Settings) GenerateToken ¶
GenerateToken 只生成草稿,不写配置或独立凭据,也不要求服务停止。
func (Settings) SaveConfig ¶
SaveConfig 一次原子写入完整配置;运行中的服务继续使用启动快照。
func (Settings) TokenConfigured ¶
type Status ¶
type Status struct {
State string `json:"state"`
Instance *Instance `json:"instance"`
Config config.MCP `json:"config"`
TokenConfigured bool `json:"tokenConfigured"`
RestartRequired bool `json:"restartRequired"`
Error string `json:"error"`
Counts *EngineStats `json:"counts,omitempty"`
StopWarning string `json:"stopWarning,omitempty"`
}
type Target ¶
type Target struct {
Profile string `json:"profile,omitempty" jsonschema:"省略时使用当前 Profile,只读取不修改配置"`
Name string `` /* 138-byte string literal not displayed */
Organization string `json:"organization,omitempty"`
AssetID string `json:"asset_id,omitempty"`
AccountID string `json:"account_id,omitempty"`
Alias string `json:"alias,omitempty"`
}
type UploadEntry ¶
type UploadIDInput ¶
type UploadIDInput struct {
UploadID string `json:"upload_id"`
}
type UploadInput ¶
type UploadInput struct {
Target Target `json:"target,omitempty"`
ConnectionID string `json:"connection_id,omitempty"`
RequestKey string `json:"request_key"`
Source string `json:"source"`
LocalPaths []string `json:"local_paths"`
RemoteDirectory string `json:"remote_directory"`
TimeoutMS int `json:"timeout_ms,omitempty"`
WaitMS *int `json:"wait_ms,omitempty"`
// contains filtered or unexported fields
}
type UploadProgress ¶
type UploadProgress struct {
Phase string `json:"phase"`
Protocol string `json:"protocol,omitempty"`
TransferredBytes int64 `json:"transferred_bytes"`
TransferBytes int64 `json:"transfer_bytes"`
Published *UploadResult `json:"-"`
}
type UploadRemote ¶
type UploadResult ¶
type UploadResult struct {
Directory string `json:"directory,omitempty"`
Files []UploadedFile `json:"files,omitempty"`
Warnings []string `json:"warnings,omitempty"`
RemoteArtifacts []string `json:"remote_artifacts,omitempty"`
}
type UploadSFTP ¶
type UploadSFTP struct {
Client UploadRemote
Root *string
Account string
}
type UploadSourceInput ¶
type UploadSourceInput struct {
SourceID string `json:"source_id"`
}
type UploadSourceView ¶
type UploadSourceView struct {
uploadcache.View
Target ResolvedTarget `json:"target"`
RemoteDirectory string `json:"remote_directory,omitempty"`
Format string `json:"format,omitempty"`
EntryCount int `json:"entry_count"`
URL string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
}
type UploadView ¶
type UploadView struct {
ID string `json:"upload_id"`
Target ResolvedTarget `json:"target"`
Status string `json:"status"`
Source string `json:"source"`
SourceID string `json:"source_id,omitempty"`
HTTPSourceRequired bool `json:"http_source_required,omitempty"`
UploadProgress
UploadResult
FilesReady bool `json:"files_ready"`
RemoteMayContinue bool `json:"remote_may_continue"`
AcceptedAt time.Time `json:"accepted_at"`
DeadlineAt time.Time `json:"deadline_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Error *Fault `json:"error,omitempty"`
}
type UploadedFile ¶
type UploadsPageInput ¶
Source Files
¶
- aliases.go
- cancel.go
- close.go
- connector.go
- control.go
- download_delivery.go
- download_local.go
- download_publish.go
- download_remote.go
- download_transfer.go
- downloads.go
- executions.go
- history.go
- inspection.go
- output.go
- pagination.go
- pool.go
- queries.go
- reconnect.go
- requests.go
- runtime.go
- settings.go
- target_resolution.go
- upload_local.go
- upload_remote.go
- upload_sources.go
- upload_transfer.go
- uploads.go
- watchdog.go