GBServerNetworkTools

package
v0.0.0-...-3040e0b Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func CheckToIgnore(filePath string) bool

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 InitSessionServer

func InitSessionServer(tlsConn *tls.Conn, UserCollection *mgo.Collection, username string) ([]byte, error)

func ReadData

func ReadData(tlsConn *tls.Conn) (metadata GBServerDatabase.FileMetadata, contents string, operation_int int, err error)

ReadData reads from the conn and returns the metadata, contents, and intended operation of the data, according to the Gopherbox file transfer scheme.

func SendData

func SendData(conn *tls.Conn, file GBServerWatch.OutputData, operation_const int) error

SendData sends the conn the metadata and contents of the file, according to the Gopherbox file transfer scheme.

func WriteContentsToConn

func WriteContentsToConn(conn *tls.Conn, content_type string, contents string) (int, error)

WriteContentsToConn writes contents to the server in block format, with the content_type header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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