cmd

package
v0.0.0-...-f646b7f Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : cat.go # Created : 2019-01-30 10:27:15 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : cd.go # Created : 2019-01-30 11:06:02 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : copy.go # Created : 2019-01-30 16:08:09 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : download.go # Created : 2019-01-30 10:04:31 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : helper.go # Created : 2019-01-30 10:09:12 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : ls.go # Created : 2019-01-30 10:25:21 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : mkdir.go # Created : 2019-01-30 13:16:59 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : move.go # Created : 2019-01-30 15:15:24 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : pwd.go # Created : 2019-01-30 13:14:01 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : remove.go # Created : 2019-01-30 14:40:09 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : root.go # Created : 2019-01-30 10:05:09 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : scan.go # Created : 2019-01-30 10:14:21 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : touch.go # Created : 2019-01-30 15:23:43 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : save.go # Created : 2019-01-30 10:04:20 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : vim.go # Created : 2019-01-30 14:11:31 # Describe : # # ====================================================

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidParamNum 参数数量错误
	ErrInvalidParamNum = errors.New("invalidate param nums")

	// PWD 当前位置
	PWD = "/"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     int32
	Ca       string
	Cert     string
	Key      string
	Username string
	Password string
}

type Root

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

Root 获取etcd的客户端

func NewRoot

func NewRoot(cfg Config) (*Root, error)

NewRoot 根据输入参数获取etcd客户端

func (*Root) Cat

func (r *Root) Cat(path string) error

Cat 获取文件内容

func (*Root) ChangeDir

func (r *Root) ChangeDir(path string) error

ChangeDir 更换工作目录

func (*Root) CleanCache

func (r *Root) CleanCache()

func (*Root) Close

func (r *Root) Close() error

Close 关闭连接

func (*Root) Copy

func (r *Root) Copy(dist, src string) error

Copy 拷贝文件

func (*Root) DoScan

func (r *Root) DoScan(bs []string) error

DoScan 扫描输入内容,并调用对应的函数

func (*Root) Download

func (r *Root) Download(etcdP, saveP string) error

Download 将etcd中的数据下载到本地文件夹

func (*Root) List

func (r *Root) List(fp string) error

List 列出当前路径或者指定路径fp下所有的文件

func (*Root) Mkdir

func (r *Root) Mkdir(path string) error

Mkdir 创建文件夹

func (*Root) Move

func (r *Root) Move(dist, src string) error

Move 源地址,目标地址

func (*Root) Pwd

func (r *Root) Pwd() error

Pwd 返回当前路径

func (*Root) Remove

func (r *Root) Remove(paths ...string) error

Remove 删除一个文件 如果是文件夹需要在路径最后加上"/""

func (*Root) Touch

func (r *Root) Touch(path string) error

Touch 创建一个文件

func (*Root) Upload

func (r *Root) Upload(etcdP, fileP string) error

Upload 将本地文件以二进制的形式保存到etcd

func (*Root) Vim

func (r *Root) Vim(path string) error

Vim 使用vim修改etcd中的数据

Jump to

Keyboard shortcuts

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