// Sets up syncthing.Server for both the local and remote server to allow for
// updating their configuration mutually.
Sets up syncthing.Server for both the local and remote server to allow for
updating their configuration mutually.
// Sets up syncthing . Server for both the local and remote server to allow for // updating their configuration mutually .
func (f *Folder) initServers(apiPort int32) error {
	localServer, err := syncthing.NewServer(
		fmt.Sprintf("localhost:%d", viper.GetInt("syncthing-port")),
		viper.GetString("apikey"))
	if err != nil {
		return err
	}
	f.localServer = localServer
	remoteServer, err := syncthing.NewServer(
		fmt.Sprintf("localhost:%d", apiPort),
		viper.GetString("apikey"))
	if err != nil {
		return err
	}
	f.remoteServer = remoteServer
	return nil
}
func ( f * Folder ) initServers ( apiPort int32 ) error { localServer , err := syncthing . NewServer ( fmt . Sprintf ( " " , viper . GetInt ( " " ) ) , viper . GetString ( " " ) ) if err != nil { return err } f . localServer = localServer remoteServer , err := syncthing . NewServer ( fmt . Sprintf ( " " , apiPort ) , viper . GetString ( " " ) ) if err != nil { return err } f . remoteServer = remoteServer return nil }
Sets up syncthing.Server for both the local and remote server to allow for
updating their configuration mutually.
Sets up syncthing . Server for both the local and remote server to allow for updating their configuration mutually .