NewRemoteSandbox 创建远程沙箱
(config *RemoteSandboxConfig)
| 141 | |
| 142 | // NewRemoteSandbox 创建远程沙箱 |
| 143 | func NewRemoteSandbox(config *RemoteSandboxConfig) (*RemoteSandbox, error) { |
| 144 | client := NewRemoteClient(&RemoteClientConfig{ |
| 145 | BaseURL: config.BaseURL, |
| 146 | APIKey: config.APIKey, |
| 147 | APISecret: config.APISecret, |
| 148 | Timeout: config.Timeout, |
| 149 | }) |
| 150 | |
| 151 | rs := &RemoteSandbox{ |
| 152 | config: config, |
| 153 | client: client, |
| 154 | workDir: config.WorkDir, |
| 155 | properties: config.Properties, |
| 156 | } |
| 157 | |
| 158 | rs.fs = &RemoteFS{ |
| 159 | sandbox: rs, |
| 160 | workDir: config.WorkDir, |
| 161 | } |
| 162 | |
| 163 | return rs, nil |
| 164 | } |
| 165 | |
| 166 | // Kind 返回沙箱类型 |
| 167 | func (rs *RemoteSandbox) Kind() string { |
no test coverage detected