mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
start mobile library with provision id and custom hostname.
This commit is contained in:
+9
-1
@@ -178,7 +178,15 @@ func RunMobile(appConfig *AppConfig, appCallback *AppCallback, stopCh chan struc
|
|||||||
noConfigStart = false
|
noConfigStart = false
|
||||||
homedir = appConfig.HomeDir
|
homedir = appConfig.HomeDir
|
||||||
verbose = appConfig.Verbose
|
verbose = appConfig.Verbose
|
||||||
cdUID = appConfig.CdUID
|
if appConfig.ProvisionID != "" {
|
||||||
|
cdOrg = appConfig.ProvisionID
|
||||||
|
}
|
||||||
|
if appConfig.CustomHostname != "" {
|
||||||
|
customHostname = appConfig.CustomHostname
|
||||||
|
}
|
||||||
|
if appConfig.CdUID != "" {
|
||||||
|
cdUID = appConfig.CdUID
|
||||||
|
}
|
||||||
cdUpstreamProto = appConfig.UpstreamProto
|
cdUpstreamProto = appConfig.UpstreamProto
|
||||||
logPath = appConfig.LogPath
|
logPath = appConfig.LogPath
|
||||||
run(appCallback, stopCh)
|
run(appCallback, stopCh)
|
||||||
|
|||||||
+7
-5
@@ -18,11 +18,13 @@ type AppCallback struct {
|
|||||||
|
|
||||||
// AppConfig allows overwriting ctrld cli flags from mobile platforms.
|
// AppConfig allows overwriting ctrld cli flags from mobile platforms.
|
||||||
type AppConfig struct {
|
type AppConfig struct {
|
||||||
CdUID string
|
CdUID string
|
||||||
HomeDir string
|
ProvisionID string
|
||||||
UpstreamProto string
|
CustomHostname string
|
||||||
Verbose int
|
HomeDir string
|
||||||
LogPath string
|
UpstreamProto string
|
||||||
|
Verbose int
|
||||||
|
LogPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -28,15 +28,17 @@ type AppCallback interface {
|
|||||||
// Start configures utility with config.toml from provided directory.
|
// Start configures utility with config.toml from provided directory.
|
||||||
// This function will block until Stop is called
|
// This function will block until Stop is called
|
||||||
// Check port availability prior to calling it.
|
// Check port availability prior to calling it.
|
||||||
func (c *Controller) Start(CdUID string, HomeDir string, UpstreamProto string, logLevel int, logPath string) {
|
func (c *Controller) Start(CdUID string, ProvisionID string, CustomHostname string, HomeDir string, UpstreamProto string, logLevel int, logPath string) {
|
||||||
if c.stopCh == nil {
|
if c.stopCh == nil {
|
||||||
c.stopCh = make(chan struct{})
|
c.stopCh = make(chan struct{})
|
||||||
c.Config = cli.AppConfig{
|
c.Config = cli.AppConfig{
|
||||||
CdUID: CdUID,
|
CdUID: CdUID,
|
||||||
HomeDir: HomeDir,
|
ProvisionID: ProvisionID,
|
||||||
UpstreamProto: UpstreamProto,
|
CustomHostname: CustomHostname,
|
||||||
Verbose: logLevel,
|
HomeDir: HomeDir,
|
||||||
LogPath: logPath,
|
UpstreamProto: UpstreamProto,
|
||||||
|
Verbose: logLevel,
|
||||||
|
LogPath: logPath,
|
||||||
}
|
}
|
||||||
appCallback := mapCallback(c.AppCallback)
|
appCallback := mapCallback(c.AppCallback)
|
||||||
cli.RunMobile(&c.Config, &appCallback, c.stopCh)
|
cli.RunMobile(&c.Config, &appCallback, c.stopCh)
|
||||||
|
|||||||
Reference in New Issue
Block a user