prism

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PeerPort      int
	ReflectorPort int

	DhtAddress   string
	DhtSeedNodes []string

	ClusterPort     int
	ClusterSeedAddr string

	// limit the range of hashes to announce. useful for testing
	HashRange *bits.Range

	DB    *db.SQL
	Blobs store.BlobStore
}

func DefaultConf

func DefaultConf() *Config

DefaultConf returns a default config

type Prism

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

Prism is the root instance of the application and houses the DHT, Peer Server, Reflector Server, and Cluster.

func New

func New(conf *Config) *Prism

New returns an initialized Prism instance

func (*Prism) AnnounceRange

func (p *Prism) AnnounceRange(n, total int)

AnnounceRange announces the `n`th interval of hashes, out of a total of `total` intervals

func (*Prism) Shutdown

func (p *Prism) Shutdown()

Shutdown gracefully shuts down the different prism components before exiting.

func (*Prism) Start

func (p *Prism) Start() error

Start starts the components of the application.

Jump to

Keyboard shortcuts

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