github.com/status-im/status-go@v1.1.0/protocol/communities/manager_archive_nop.go (about)

     1  //go:build disable_torrent
     2  // +build disable_torrent
     3  
     4  package communities
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/status-im/status-go/eth-node/types"
    10  	"github.com/status-im/status-go/params"
    11  	"github.com/status-im/status-go/protocol/transport"
    12  )
    13  
    14  type ArchiveManagerNop struct {
    15  	*ArchiveFileManagerNop
    16  }
    17  
    18  // NewArchiveManager this function is only built and called when the "disable_torrent" build tag is set
    19  // In this case this version of NewArchiveManager will return the mobile "nil" ArchiveManagerNop ensuring that the
    20  // build command will not import or build the torrent deps for the mobile OS.
    21  // NOTE: It is intentional that this file contains the identical function name as in "manager_archive.go"
    22  func NewArchiveManager(amc *ArchiveManagerConfig) *ArchiveManagerNop {
    23  	return &ArchiveManagerNop{
    24  		&ArchiveFileManagerNop{},
    25  	}
    26  }
    27  
    28  func (tmm *ArchiveManagerNop) SetOnline(online bool) {}
    29  
    30  func (tmm *ArchiveManagerNop) SetTorrentConfig(*params.TorrentConfig) {}
    31  
    32  func (tmm *ArchiveManagerNop) StartTorrentClient() error {
    33  	return nil
    34  }
    35  
    36  func (tmm *ArchiveManagerNop) Stop() error {
    37  	return nil
    38  }
    39  
    40  func (tmm *ArchiveManagerNop) IsReady() bool {
    41  	return false
    42  }
    43  
    44  func (tmm *ArchiveManagerNop) GetCommunityChatsFilters(communityID types.HexBytes) ([]*transport.Filter, error) {
    45  	return nil, nil
    46  }
    47  
    48  func (tmm *ArchiveManagerNop) GetCommunityChatsTopics(communityID types.HexBytes) ([]types.TopicType, error) {
    49  	return nil, nil
    50  }
    51  
    52  func (tmm *ArchiveManagerNop) GetHistoryArchivePartitionStartTimestamp(communityID types.HexBytes) (uint64, error) {
    53  	return 0, nil
    54  }
    55  
    56  func (tmm *ArchiveManagerNop) CreateAndSeedHistoryArchive(communityID types.HexBytes, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) error {
    57  	return nil
    58  }
    59  
    60  func (tmm *ArchiveManagerNop) StartHistoryArchiveTasksInterval(community *Community, interval time.Duration) {
    61  }
    62  
    63  func (tmm *ArchiveManagerNop) StopHistoryArchiveTasksInterval(communityID types.HexBytes) {}
    64  
    65  func (tmm *ArchiveManagerNop) SeedHistoryArchiveTorrent(communityID types.HexBytes) error {
    66  	return nil
    67  }
    68  
    69  func (tmm *ArchiveManagerNop) UnseedHistoryArchiveTorrent(communityID types.HexBytes) {}
    70  
    71  func (tmm *ArchiveManagerNop) IsSeedingHistoryArchiveTorrent(communityID types.HexBytes) bool {
    72  	return false
    73  }
    74  
    75  func (tmm *ArchiveManagerNop) GetHistoryArchiveDownloadTask(communityID string) *HistoryArchiveDownloadTask {
    76  	return nil
    77  }
    78  
    79  func (tmm *ArchiveManagerNop) AddHistoryArchiveDownloadTask(communityID string, task *HistoryArchiveDownloadTask) {
    80  }
    81  
    82  func (tmm *ArchiveManagerNop) DownloadHistoryArchivesByMagnetlink(communityID types.HexBytes, magnetlink string, cancelTask chan struct{}) (*HistoryArchiveDownloadTaskInfo, error) {
    83  	return nil, nil
    84  }
    85  
    86  func (tmm *ArchiveManagerNop) TorrentFileExists(communityID string) bool {
    87  	return false
    88  }