github.com/mysteriumnetwork/node@v0.0.0-20240516044423-365054f76801/ui/versionmanager/noop_version_config.go (about)

     1  /*
     2   * Copyright (C) 2021 The "MysteriumNetwork/node" Authors.
     3   *
     4   * This program is free software: you can redistribute it and/or modify
     5   * it under the terms of the GNU General Public License as published by
     6   * the Free Software Foundation, either version 3 of the License, or
     7   * (at your option) any later version.
     8   *
     9   * This program is distributed in the hope that it will be useful,
    10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12   * GNU General Public License for more details.
    13   *
    14   * You should have received a copy of the GNU General Public License
    15   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    16   */
    17  
    18  package versionmanager
    19  
    20  // NoOpVersionConfig ui version config
    21  type NoOpVersionConfig struct {
    22  }
    23  
    24  // NewNoOpVersionConfig constructor for VersionConfig
    25  func NewNoOpVersionConfig() (*NoOpVersionConfig, error) {
    26  	return &NoOpVersionConfig{}, nil
    27  }
    28  
    29  // Version returns version to be used
    30  func (vm *NoOpVersionConfig) Version() (string, error) {
    31  	return BundledVersionName, nil
    32  }
    33  
    34  func (vm *NoOpVersionConfig) exists() (bool, error) {
    35  	return true, nil
    36  }
    37  
    38  func (vm *NoOpVersionConfig) read() (nodeUIVersion, error) {
    39  	return nodeUIVersion{VersionName: ""}, nil
    40  }
    41  
    42  func (vm *NoOpVersionConfig) whichFilePath() string {
    43  	return ""
    44  }
    45  
    46  func (vm *NoOpVersionConfig) uiDistPath(versionName string) string {
    47  	return ""
    48  }
    49  
    50  // UIBuildPath build path to the assets of provided versionName
    51  func (vm *NoOpVersionConfig) UIBuildPath(versionName string) string {
    52  	return ""
    53  }
    54  
    55  func (vm *NoOpVersionConfig) uiDistFile(versionName string) string {
    56  	return ""
    57  }
    58  
    59  func (vm *NoOpVersionConfig) uiDir() string {
    60  	return ""
    61  }
    62  
    63  func (vm *NoOpVersionConfig) write(w nodeUIVersion) error {
    64  	return nil
    65  }