Documentation
¶
Index ¶
- Constants
- Variables
- func CheckToIgnore(filePath string) bool
- func ClientReceiveSessionInformation(tlsConn *tls.Conn, keyfile_path string) (key []byte, last_accessed int64, err error)
- func GetValueFromContentsBlock(tlsConn *tls.Conn) (contents_type string, contents string, n int, err error)
- func SendDataEncrypted(tlsConn *tls.Conn, file GBClientWatch.OutputData, operation_const int, ...) error
- func SendMetadata(conn *tls.Conn, file GBClientWatch.OutputData, operation_const int, ...) error
- func WriteContentsToConn(conn *tls.Conn, content_type string, contents string) (int, error)
- type FileMetadata
Constants ¶
View Source
const ( FILE_ADDED_CONST = iota FILE_MODIFIED_CONST FILE_DELETED_CONST ERR_CONST EOF_CONST PING_CONST DISCONNECT_CONST PING = "." // Sent when pinging the server. )
Variables ¶
View Source
var ( // Files_to_ignore_mac lists that files with the following substrings should be ignored. Files_to_ignore_mac []string = []string{".DS_Store", ".sb-", ".function.m.swp", ".localized"} )
Functions ¶
func CheckToIgnore ¶
CheckToIgnore checks if the given file should be sent to the Gopherbox filesystem. Currently only works with Mac files that should be ignored.
func GetValueFromContentsBlock ¶
func GetValueFromContentsBlock(tlsConn *tls.Conn) (contents_type string, contents string, n int, err error)
GetValueFromContentsBlock returns the contents type in the header, as well as the contents contained within.
func SendDataEncrypted ¶
func SendDataEncrypted(tlsConn *tls.Conn, file GBClientWatch.OutputData, operation_const int, private_key []byte) error
SendData sends the conn the metadata and encrypted contents of the file, according to the Gopherbox file transfer scheme.
func SendMetadata ¶
func SendMetadata(conn *tls.Conn, file GBClientWatch.OutputData, operation_const int, truncated bool) error
SendMetadata sends the file metadata to the connection, with a truncated or non-truncated path.
Types ¶
type FileMetadata ¶
type FileMetadata struct {
Path string `bson: "path"`
Is_dir bool `bson: "is_dir"`
Modification_time int64 `bson: "modification_time"`
Size int64 `bson: "size"`
}
FileMetadata stores the metadata for each file.
func ReadDataEncrypted ¶
Click to show internal directories.
Click to hide internal directories.