app

package
v0.0.0-...-8b1022e Latest Latest
Warning

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

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

Documentation

Overview

Package app implements the desktop application functionality of flashlight

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ShowUI bool
	Flags  map[string]interface{}
	// contains filtered or unexported fields
}

App is the core of the Lantern desktop application, in the form of a library.

func (*App) AddExitFunc

func (app *App) AddExitFunc(exitFunc func())

AddExitFunc adds a function to be called before the application exits.

func (*App) Exit

func (app *App) Exit(err error)

Exit tells the application to exit, optionally supplying an error that caused the exit.

func (*App) Init

func (app *App) Init()

Init initializes the App's state

func (*App) LogPanicAndExit

func (app *App) LogPanicAndExit(msg string)

LogPanicAndExit logs a panic and then exits the application.

func (*App) Run

func (app *App) Run() error

Run starts the app. It will block until the app exits.

type Settings

type Settings struct {
	DeviceID  string `json:"deviceID,omitempty"`
	UserID    int64  `json:"userID,omitempty"`
	UserToken string `json:"userToken,omitempty"`

	AutoReport  bool `json:"autoReport"`
	AutoLaunch  bool `json:"autoLaunch"`
	ProxyAll    bool `json:"proxyAll"`
	SystemProxy bool `json:"systemProxy"`

	Version      string `json:"version" yaml:"-"`
	BuildDate    string `json:"buildDate" yaml:"-"`
	RevisionDate string `json:"revisionDate" yaml:"-"`

	sync.RWMutex `json:"-" yaml:"-"`
}

Settings is a struct of all settings unique to this particular Lantern instance.

func (*Settings) GetDeviceID

func (s *Settings) GetDeviceID() string

GetDeviceID returns the unique ID of this device.

func (*Settings) GetProxyAll

func (s *Settings) GetProxyAll() bool

GetProxyAll returns whether or not to proxy all traffic.

func (*Settings) GetSystemProxy

func (s *Settings) GetSystemProxy() bool

GetSystemProxy returns whether or not to set system proxy when lantern starts

func (*Settings) GetToken

func (s *Settings) GetToken() string

GetToken returns the user token

func (*Settings) GetUserID

func (s *Settings) GetUserID() int64

GetUserID returns the user ID

func (*Settings) IsAutoReport

func (s *Settings) IsAutoReport() bool

IsAutoReport returns whether or not to auto-report debugging and analytics data.

func (*Settings) SetAutoLaunch

func (s *Settings) SetAutoLaunch(auto bool)

SetAutoLaunch sets whether or not to auto-launch Lantern on system startup.

func (*Settings) SetAutoReport

func (s *Settings) SetAutoReport(auto bool)

SetAutoReport sets whether or not to auto-report debugging and analytics data.

func (*Settings) SetDeviceID

func (s *Settings) SetDeviceID(deviceID string)

SetDeviceID sets the device ID

func (*Settings) SetProxyAll

func (s *Settings) SetProxyAll(proxyAll bool)

SetProxyAll sets whether or not to proxy all traffic.

func (*Settings) SetSystemProxy

func (s *Settings) SetSystemProxy(enable bool)

SetSystemProxy sets whether or not to set system proxy when lantern starts

func (*Settings) SetToken

func (s *Settings) SetToken(token string)

SetToken sets the user token

func (*Settings) SetUserID

func (s *Settings) SetUserID(id int64)

SetUserID sets the user ID

Jump to

Keyboard shortcuts

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