tcfs

package module
v0.0.0-...-e6821ff Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 11 Imported by: 1

README

TCFS-GO

TCFS, a Lightweight Network File System.

Tcfs-go is the tcfs server writen in Golang.

How to use?

  • Server(assume IP address is 192.168.0.100):
go get github.com/hmgle/tcfs-go/tcfsd
tcfsd -dir .
# can use absolute path:
# tcfsd -dir "/tmp"
# tcfsd -dir "c:" # Windows
  • Client:
sudo apt-get install libfuse-dev
git clone https://github.com/tcfs/tcfs.git
cd tcfs
mkdir mountpoint
make
# 192.168.0.100 is the server IP address
./tcfs --server 192.168.0.100 mountpoint
ls -shal mountpoint
# access mountpoint
# ...
# unmount tcfs
fusermount -u mountpoint
# or sudo umount mountpoint

Protocol

TCFS protocol

Documentation

Index

Constants

View Source
const (
	GETATTR  uint32 = 0x01
	READLINK uint32 = 0x02
	GETDIR   uint32 = 0x03
	MKNOD    uint32 = 0x04
	MKDIR    uint32 = 0x05
	SYMLINK  uint32 = 0x06
	UNLINK   uint32 = 0x07
	RMDIR    uint32 = 0x08
	RENAME   uint32 = 0x09
	CHMOD    uint32 = 0x0A
	CHOWN    uint32 = 0x0B
	TRUNCATE uint32 = 0x0C
	UTIME    uint32 = 0x0D
	OPEN     uint32 = 0x0E
	READ     uint32 = 0x0F
	WRITE    uint32 = 0x10
	READDIR  uint32 = 0x11
	RELEASE  uint32 = 0x12
	CREATE   uint32 = 0x13
)

Variables

This section is empty.

Functions

func HandleConn

func HandleConn(tConn *TcfsConn)

Types

type Cipher

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

func NewCipher

func NewCipher(cryptoMethod string, secret []byte) *Cipher

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(dst, src []byte)

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(dst, src []byte)

type TcfsConn

type TcfsConn struct {
	RootDir    string
	Conn       net.Conn
	Buf        []byte
	OpenedFile map[uintptr]*os.File

	Cipher *Cipher
}

func (*TcfsConn) Close

func (c *TcfsConn) Close()

func (*TcfsConn) Read

func (c *TcfsConn) Read(b []byte) (int, error)

func (*TcfsConn) Write

func (c *TcfsConn) Write(b []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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