lib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() string

func ConfigFileSQLITE

func ConfigFileSQLITE() string

func ConfigFolder

func ConfigFolder() string

func ConfigServerEndPoint

func ConfigServerEndPoint(settings SettingsShare) string

func CreateConfigFile

func CreateConfigFile(outputFile string, settings SettingsShare) error

func CreateHandler

func CreateHandler(filePathParam string) http.Handler

func CreateTable

func CreateTable() error

func GetLocalIps

func GetLocalIps(port int) []string

func GetPublicIps

func GetPublicIps(port int) []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

func RemoveServer

func RemoveServer(uuid string) error

func ServerDaemon

func ServerDaemon(port int, handler http.Handler)

func ServerDaemon2

func ServerDaemon2(port int, srv *graceful.Server)

func StartServer

func StartServer(server *Server)

func StoreServer

func StoreServer(server Server) error

func UserHomeDir

func UserHomeDir() string

Types

type Daemon

type Daemon struct {
	Port             int
	Host             string
	EnableUpnp       bool
	DatabaseFilePath string
}

type Server

type Server struct {
	UUID      string    `json:"uuid"`
	Path      string    `json:"path"`
	Port      int       `json:"port"`
	CreatedAt time.Time `json:"created_at"`
	ListIps   []string  `json:"list_ips"`
	Srv       *graceful.Server
}

func ListServers

func ListServers() ([]Server, error)

type SettingsShare

type SettingsShare struct {
	Daemon Daemon
	Mode   string
}

func NewSettings

func NewSettings() SettingsShare

Jump to

Keyboard shortcuts

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