lib

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const BLACK = "\033[40m  \033[0m"
View Source
const DIR_MASK = 0770
View Source
const WHITE = "\033[47m  \033[0m"

Variables

This section is empty.

Functions

func CompressFile added in v0.0.3

func CompressFile(source, target string) error

func CompressedFilePath added in v0.0.3

func CompressedFilePath() string

func ConfigFile

func ConfigFile() string

func ConfigFileSQLITE

func ConfigFileSQLITE() string

func ConfigFileServerEndPoint added in v0.0.3

func ConfigFileServerEndPoint(settings SettingsShare) string

func ConfigFolder

func ConfigFolder() string

func ConfigServerEndPoint

func ConfigServerEndPoint(settings SettingsShare) string

func CreateConfigFile

func CreateConfigFile(outputFile string, settings SettingsShare) error

func CreateTable

func CreateTable() error

func FileServerGET added in v0.0.3

func FileServerGET(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func GenerateQR added in v0.0.3

func GenerateQR(uuid, input string) (string, error)

func GetLocalIps

func GetLocalIps(port int, uuid string) []string

func GetPublicIps

func GetPublicIps(port int, uuid string) []string

func GetServerIps added in v0.0.3

func GetServerIps(upnpOpened bool, port int, uuid string) []string

func InitDB

func InitDB(settings_params SettingsShare) error

func InitSettings

func InitSettings(configFile string, settings *SettingsShare) error

func OpenDatabase

func OpenDatabase() (*sql.DB, error)

func OpenUpnpPort

func OpenUpnpPort(port int) bool

func RandomFreePort

func RandomFreePort() (int, error)

func RemoveServer

func RemoveServer(uuid string) error

func RunFileServer added in v0.0.3

func RunFileServer(settings SettingsShare)

func StoreServer

func StoreServer(server Server) error

func TempFilename added in v0.0.3

func TempFilename(prefix string, extension string) string

func UserHomeDir

func UserHomeDir(runtime_goos string) string

Types

type FileServerDaemon added in v0.0.3

type FileServerDaemon struct {
	Port int
	Host string
}

type Server

type Server struct {
	UUID      string    `json:"uuid"`
	Path      string    `json:"path"`
	Source    string    `json:"source"`
	CreatedAt time.Time `json:"created_at"`
	ListIps   []string  `json:"list_ips"`
	Flags     []string  `json:"flags"`
}

func FindServer added in v0.0.3

func FindServer(uuid string) (Server, error)

func ListServers

func ListServers() ([]Server, error)

func SearchServerByPath added in v0.0.3

func SearchServerByPath(path string) (Server, error)

func SearchServerByUUID added in v0.0.3

func SearchServerByUUID(uuid string) (Server, error)

type SettingsShare

type SettingsShare struct {
	ShareDaemon      ShareDaemon
	FileServerDaemon FileServerDaemon
	Mode             string
}

func NewSettings

func NewSettings() SettingsShare

type ShareDaemon added in v0.0.3

type ShareDaemon struct {
	Port               int
	Host               string
	EnableUpnp         bool
	DatabaseFilePath   string
	CompressedFilePath string
}

Jump to

Keyboard shortcuts

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