Documentation ¶
Overview ¶
Copyright 2021 The Gong2 Authors Licensed under the GNU Lesser General Public License v3; you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func DirectExec(command string, arg ...string) (txt string, err error)
- type Host
- type IFileManage
- type IRemoteManage
- type LANG
- type LocalManage
- func (localManage *LocalManage) Dir(relativePath string) (dirs []string, err error)
- func (localManage *LocalManage) ExecFile(command string, filePath string, arg ...string) (txt string, err error)
- func (localManage *LocalManage) ExecTagFile(command string, tag string, filePath string) (txt string, err error)
- func (localManage *LocalManage) GetRootPath() string
- func (localManage *LocalManage) Read(filePath string) (bytes []byte, err error)
- func (localManage *LocalManage) ReadString(filePath string) (str string, err error)
- func (localManage *LocalManage) ReadYaml(filePath string) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var LangExector *langExector
Functions ¶
Types ¶
type IFileManage ¶
type IFileManage interface { GetRootPath() string Dir(relativePath string) ([]string, error) Read(filePath string) ([]byte, error) ReadString(filePath string) (string, error) ExecFile(command string, filepath string, arg ...string) (string, error) ExecTagFile(command string, tag string, filePath string) (string, error) }
func NewLocalManage ¶
func NewLocalManage(rootPath string) (IFileManage, error)
type IRemoteManage ¶
type LocalManage ¶
type LocalManage struct {
// contains filtered or unexported fields
}
*
- localmanager is used to manage local directory.
- localmanage must bind program's root path.
- all it's operation should be limited under this directory
- such as exec file, so file exector take relative path as parameters
func (*LocalManage) Dir ¶
func (localManage *LocalManage) Dir(relativePath string) (dirs []string, err error)
func (*LocalManage) ExecFile ¶
func (localManage *LocalManage) ExecFile(command string, filePath string, arg ...string) (txt string, err error)
*
- execut file under filepath *
func (*LocalManage) ExecTagFile ¶
func (localManage *LocalManage) ExecTagFile(command string, tag string, filePath string) (txt string, err error)
*
- execute file with tag
- such as: cmd /c filename
func (*LocalManage) GetRootPath ¶
func (localManage *LocalManage) GetRootPath() string
func (*LocalManage) Read ¶
func (localManage *LocalManage) Read(filePath string) (bytes []byte, err error)
func (*LocalManage) ReadString ¶
func (localManage *LocalManage) ReadString(filePath string) (str string, err error)
Click to show internal directories.
Click to hide internal directories.