app

package
v0.0.0-...-b598ae0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: GPL-3.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Base = getBasePath()

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func Reset

func Reset()

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type Decentralizer

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

func New

func New(ctx context.Context, networkStr string, privateKey bool, limitedConnection bool, profile string) (*Decentralizer, error)

func (*Decentralizer) AdvertisePeerRecord

func (d *Decentralizer) AdvertisePeerRecord() error

func (*Decentralizer) DeleteSession

func (d *Decentralizer) DeleteSession(sessionId uint64) error

func (*Decentralizer) FindByDecentralizedId

func (d *Decentralizer) FindByDecentralizedId(decentralizedId uint64) (*pb.Peer, error)

func (*Decentralizer) FindByPeerId

func (d *Decentralizer) FindByPeerId(peerId string) (p *pb.Peer, err error)

func (*Decentralizer) GetIP

func (d *Decentralizer) GetIP() net.IP

func (*Decentralizer) GetMessagingChan

func (d *Decentralizer) GetMessagingChan(channel uint32) chan *pb.RPCDirectMessage

func (*Decentralizer) GetPeerFile

func (d *Decentralizer) GetPeerFile(peerId string, name string) ([]byte, error)

Get a particular peer file from someone.

func (*Decentralizer) GetPeerFiles

func (d *Decentralizer) GetPeerFiles(peerId string) (map[string]uint64, error)

func (*Decentralizer) GetPeers

func (d *Decentralizer) GetPeers() ([]*pb.Peer, error)

func (*Decentralizer) GetPeersByDetails

func (d *Decentralizer) GetPeersByDetails(key, value string) ([]*pb.Peer, error)

func (*Decentralizer) GetPublisherFile

func (d *Decentralizer) GetPublisherFile(name string) ([]byte, error)

func (*Decentralizer) GetSession

func (d *Decentralizer) GetSession(sessionId uint64) (*pb.Session, error)

func (*Decentralizer) GetSessions

func (d *Decentralizer) GetSessions(sessionType uint64) ([]*pb.Session, error)

func (*Decentralizer) GetSessionsByDetails

func (d *Decentralizer) GetSessionsByDetails(sessionType uint64, key, value string) ([]*pb.Session, error)

func (*Decentralizer) GetSessionsByPeer

func (d *Decentralizer) GetSessionsByPeer(peerId string) ([]*pb.Session, error)

func (*Decentralizer) Health

func (d *Decentralizer) Health(WaitForMinConnections bool) (bool, int, error)

func (*Decentralizer) InsertPeer

func (d *Decentralizer) InsertPeer(pId string, details map[string]string) (*pb.Peer, error)

func (*Decentralizer) InsertSession

func (d *Decentralizer) InsertSession(session *pb.Session) (uint64, error)

func (*Decentralizer) IsEnoughPeers

func (d *Decentralizer) IsEnoughPeers() bool

func (*Decentralizer) PublishPublisherRecord

func (d *Decentralizer) PublishPublisherRecord(definition *pb.PublisherDefinition) ([]byte, error)

func (*Decentralizer) PublisherDefinition

func (d *Decentralizer) PublisherDefinition() *pb.PublisherDefinition

func (*Decentralizer) PushPublisherRecord

func (d *Decentralizer) PushPublisherRecord() error

func (*Decentralizer) ReadPublisherDefinition

func (d *Decentralizer) ReadPublisherDefinition(data []byte) error

func (*Decentralizer) ResetPublisherDefinition

func (d *Decentralizer) ResetPublisherDefinition()

func (*Decentralizer) SavePeerFile

func (d *Decentralizer) SavePeerFile(name string, data []byte) (string, error)

Save our peer file

func (*Decentralizer) SendMessage

func (d *Decentralizer) SendMessage(channel uint32, peerId string, message []byte) error

func (*Decentralizer) Stop

func (s *Decentralizer) Stop()

func (*Decentralizer) UpdatePublisherDefinition

func (d *Decentralizer) UpdatePublisherDefinition() error

func (*Decentralizer) UpsertPeer

func (d *Decentralizer) UpsertPeer(pId string, details map[string]string) (peer *pb.Peer, err error)

func (*Decentralizer) UpsertSession

func (d *Decentralizer) UpsertSession(sessionType uint64, name string, port uint32, details map[string]string) (uint64, error)

func (*Decentralizer) WaitTilEnoughPeers

func (d *Decentralizer) WaitTilEnoughPeers()

type DirectMessage

type DirectMessage struct {
	From    libp2pPeer.ID
	Message []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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