runtime

package
v0.0.0-...-251c84f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func GetCacheInstance

func GetCacheInstance() *Cache

func (*Cache) AddDownloadedResource

func (c *Cache) AddDownloadedResource(resourceName string, resourceSize int64)

func (*Cache) AddOnlineNode

func (c *Cache) AddOnlineNode(p peer.AddrInfo)

func (*Cache) GetContext

func (c *Cache) GetContext() context.Context

func (*Cache) GetHost

func (c *Cache) GetHost() host.Host

func (*Cache) GetOnlineNodes

func (c *Cache) GetOnlineNodes() []peer.AddrInfo

func (*Cache) GetOthersSharedResourcesInfosFilterByResourceName

func (c *Cache) GetOthersSharedResourcesInfosFilterByResourceName(resourceName string) OtherSharedFileInfo

func (*Cache) GetOthersSharedResourcesPeerIDList

func (c *Cache) GetOthersSharedResourcesPeerIDList() map[string]OtherSharedFileInfo

func (*Cache) GetOurSharedDirectory

func (c *Cache) GetOurSharedDirectory() string

func (*Cache) GetSharedResourcesFromCache

func (c *Cache) GetSharedResourcesFromCache() []FileInfo

func (*Cache) InitCache

func (c *Cache) InitCache(ourSharedDirectory string, ctx context.Context, peerHost host.Host) error

func (*Cache) ReadSharedResourcesIntoCache

func (c *Cache) ReadSharedResourcesIntoCache() error

func (*Cache) RemoveOfflineNode

func (c *Cache) RemoveOfflineNode(offlineNodeID string)

func (*Cache) RemoveOfflineNodes

func (c *Cache) RemoveOfflineNodes(offlineNodesID []string)

func (*Cache) UpdateOthersSharedResources

func (c *Cache) UpdateOthersSharedResources(resources []FileInfo, peerID string)

type FileInfo

type FileInfo struct {
	FileName string
	FileSize int64
}

type OtherSharedFileInfo

type OtherSharedFileInfo struct {
	SharedFileInfo FileInfo
	SharedPeers    []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL