pool

package module
v0.0.0-...-cd40079 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: BSD-3-Clause Imports: 16 Imported by: 0

README

Pool

Services and Applications

An application has a user interface, it's something that users care about. A service runs in the background. A program is either a service or application.

All programs are issued a port to communicate on. Pool will only respond to requests from that port. They are all issued their key at startup. A program should not store their key anywhere else.

Documentation

Overview

Package pool provides an instance of Pool. It is intended to be wrapped by an OS/Platform specific interface.

Package pool is a generated protocol buffer package.

It is generated from these files:

pool/program.proto

It has these top-level messages:

Program

Index

Constants

View Source
const ErrBadSetup = errors.String("Bad setup")

ErrBadSetup will be returned if the merkle forrest ccannot be read

Variables

View Source
var LogFile = prog.Root() + "pool.log"

LogFile for pool log

View Source
var Port = rnet.Port(3000)

Port that pool will run on, should be moved to config

Functions

func Dir

func Dir() string

Dir returns the directory used for pool data

func IsSetup

func IsSetup() bool

IsSetup checks if the salt file exists as an litmus for if it's setup.

func SaltFile

func SaltFile() string

SaltFile gets the location of the salt file

Types

type Pool

type Pool struct {
	Router *ipcrouter.Router
	// contains filtered or unexported fields
}

Pool coordinates all local resources for dist.ribut.us

func Open

func Open(passphrase []byte) (*Pool, error)

Open the merkle forrest and setup the pool

func (*Pool) Add

func (p *Pool) Add(prog *Program) error

Add a program

func (*Pool) AddBeacon

func (p *Pool) AddBeacon(addr *rnet.Addr, key *crypto.XchgPub)

AddBeacon to help connect to network

func (*Pool) ExitAll

func (p *Pool) ExitAll()

ExitAll sends an exit message to all service, whether they are running or not (closes stray programs from previous)

func (*Pool) GetIP

func (p *Pool) GetIP(from *rnet.Addr) *rnet.Addr

GetIP is a temporary method for testing.

func (*Pool) GetOverlayNetPort

func (p *Pool) GetOverlayNetPort() uint32

GetOverlayNetPort gets the network port

func (*Pool) GetOverlayPubKey

func (p *Pool) GetOverlayPubKey() string

GetOverlayPubKey gets the public key for the network

func (*Pool) OverlayRandomKey

func (p *Pool) OverlayRandomKey()

OverlayRandomKey tells the overlay service to use a random key

func (*Pool) OverlayStaticKey

func (p *Pool) OverlayStaticKey()

OverlayStaticKey tells the overlay service to use a static key

func (*Pool) QueryHandler

func (p *Pool) QueryHandler(q ipcrouter.Query)

QueryHandler for ipc queries to Pool service

func (*Pool) Run

func (p *Pool) Run()

Run the ipc listener and all the progams designated to start

func (*Pool) ServiceID

func (*Pool) ServiceID() uint32

ServiceID for Pool service

type Program

type Program struct {
	Name       string   `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"`
	Location   string   `protobuf:"bytes,2,opt,name=Location" json:"Location,omitempty"`
	UI         bool     `protobuf:"varint,3,opt,name=UI" json:"UI,omitempty"`
	Key        []byte   `protobuf:"bytes,4,opt,name=Key,proto3" json:"Key,omitempty"`
	Port32     uint32   `protobuf:"varint,5,opt,name=Port32" json:"Port32,omitempty"`
	Start      bool     `protobuf:"varint,6,opt,name=Start" json:"Start,omitempty"`
	Implements []string `protobuf:"bytes,7,rep,name=Implements" json:"Implements,omitempty"`
}

func (*Program) Descriptor

func (*Program) Descriptor() ([]byte, []int)

func (*Program) GetImplements

func (m *Program) GetImplements() []string

func (*Program) GetKey

func (m *Program) GetKey() []byte

func (*Program) GetLocation

func (m *Program) GetLocation() string

func (*Program) GetName

func (m *Program) GetName() string

func (*Program) GetPort32

func (m *Program) GetPort32() uint32

func (*Program) GetStart

func (m *Program) GetStart() bool

func (*Program) GetUI

func (m *Program) GetUI() bool

func (*Program) Port

func (p *Program) Port() rnet.Port

Port gets the program port

func (*Program) PortStr

func (p *Program) PortStr() string

PortStr gets the port as a string (without :)

func (*Program) ProtoMessage

func (*Program) ProtoMessage()

func (*Program) Reset

func (m *Program) Reset()

func (*Program) String

func (m *Program) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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