Documentation
¶
Overview ¶
Package common contains common initialization code and utilities for the Radiance application.
Index ¶
- Constants
- Variables
- func Close(ctx context.Context) error
- func DataPath() string
- func Dev() bool
- func Init(dataDir, logDir, logLevel string) error
- func IsAndroid() bool
- func IsIOS() bool
- func IsMacOS() bool
- func IsWindows() bool
- func LogPath() string
- func Prod() bool
- func SetPathsForTesting(t *testing.T)
- type UserChangeEvent
- type UserInfo
Constants ¶
const ( Name = "lantern" // Placeholders to use in the request headers. ClientVersion = "9.0.0" Version = "9.0.1" Platform = runtime.GOOS // filenames LogFileName = "lantern.log" ConfigFileName = "config.json" ServersFileName = "servers.json" DefaultHTTPTimeout = (60 * time.Second) )
Variables ¶
var ErrNotImplemented = errors.New("not yet implemented")
ErrNotImplemented is returned by functions which have not yet been implemented. The existence of this error is temporary; this will go away when the API stabilized.
Functions ¶
func Dev ¶
func Dev() bool
Dev returns true if the application is running in development environment.
func Init ¶
Init initializes the common components of the application. This includes setting up the directories for data and logs, initializing the logger, and setting up reporting.
func Prod ¶
func Prod() bool
Prod returns true if the application is running in production environment. Treating ENV == "" as production is intentional: if RADIANCE_ENV is unset, we default to production mode to ensure the application runs with safe, non-debug settings.
func SetPathsForTesting ¶
Types ¶
type UserInfo ¶
type UserInfo interface {
DeviceID() string
LegacyID() int64
LegacyToken() string
SetData(*protos.LoginResponse) error
GetData() (*protos.LoginResponse, error)
Locale() string
SetLocale(string)
AccountType() string
}
UserInfo is an interface that defines the methods for user configuration
func NewUserConfig ¶
NewUserConfig creates a new UserInfo object
Directories
¶
| Path | Synopsis |
|---|---|
|
Package atomicfile provides functions to read and write files atomically.
|
Package atomicfile provides functions to read and write files atomically. |
|
Package env is responsible for loading radiance configuration based on a order of precedence (environment variables > configurations set at .env file).
|
Package env is responsible for loading radiance configuration based on a order of precedence (environment variables > configurations set at .env file). |