Documentation ¶
Index ¶
- Variables
- func Get(cl *client.Client, url string) (*json.RawMessage, error)
- func NewRelayStatus(cl *client.Client, scurl texturl.URL, cfg *relayentryext.T) (rs relayStatus, err error)
- func SubmitST(cl *client.Client, url string, st *sharetoken.T) error
- func SubmitSTFromFile(cl *client.Client, url, shares string) error
- func Withdraw(cl *client.Client, url string, destination string, amount int64) (*json.RawMessage, error)
- type Controller
- func (c *Controller) Contracts() (l []string)
- func (c *Controller) Disable(contractId string) error
- func (c *Controller) Disenroll(contractId string) error
- func (c *Controller) DisenrollAll() (err error)
- func (c *Controller) Enroll(contractId string) error
- func (c *Controller) EnrollAll() (err error)
- func (c *Controller) Load(scfg *relaycfg.C) (err error)
- func (c *Controller) NetCap() (m map[string]uint64)
- func (c *Controller) NewConn(contractId string) (ctx context.Context, err error)
- func (c *Controller) Reload(scfg *relaycfg.C) (err error)
- func (c *Controller) SCS() (m map[string]string)
- func (c *Controller) Start() error
- func (c *Controller) StartWithList(contractIds ...string) error
- func (c *Controller) Started() bool
- func (c *Controller) Status() (m map[string]RelayStatus)
- func (c *Controller) Stop() error
- type RelayFlags
- type RelayStatus
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotStarted = errors.New("controller not started") ErrAlreadyStarted = errors.New("controller already started") ErrContractNotFound = errors.New("relay contract not found") ErrContractNotAvailable = errors.New("relay contract not available") ErrDisenroll = errors.New("disenrollment patially failed, couldn't disenroll the following contracts") )
Functions ¶
func NewRelayStatus ¶ added in v0.5.1
Types ¶
type Controller ¶ added in v0.5.1
type Controller struct {
// contains filtered or unexported fields
}
Controller is the serverlib relay handler Interaction with the relays is always done through the controller
func NewController ¶ added in v0.5.1
func NewController(cl *client.Client, callback chan *status.T) *Controller
Create new controller instance
func (*Controller) Contracts ¶ added in v0.5.1
func (c *Controller) Contracts() (l []string)
Returns current contractIds
func (*Controller) Disable ¶ added in v0.5.1
func (c *Controller) Disable(contractId string) error
Disenroll relay by contractId
func (*Controller) Disenroll ¶ added in v0.5.1
func (c *Controller) Disenroll(contractId string) error
Disenroll relay by contractId
func (*Controller) DisenrollAll ¶ added in v0.5.1
func (c *Controller) DisenrollAll() (err error)
Disenroll all the relays
func (*Controller) Enroll ¶ added in v0.5.1
func (c *Controller) Enroll(contractId string) error
Enroll relay by contractId
func (*Controller) EnrollAll ¶ added in v0.5.1
func (c *Controller) EnrollAll() (err error)
Enroll all the relays
func (*Controller) Load ¶ added in v0.5.1
func (c *Controller) Load(scfg *relaycfg.C) (err error)
Load current relays configuration
func (*Controller) NetCap ¶ added in v0.6.0
func (c *Controller) NetCap() (m map[string]uint64)
Returns current relays Netcaps, by contractId
func (*Controller) NewConn ¶ added in v0.5.1
func (c *Controller) NewConn(contractId string) (ctx context.Context, err error)
Returns if a new connection should be accepted Relays accept new connections meanwhile they're enrolled
func (*Controller) Reload ¶ added in v0.5.1
func (c *Controller) Reload(scfg *relaycfg.C) (err error)
Reload current relays configuration
func (*Controller) SCS ¶ added in v0.5.1
func (c *Controller) SCS() (m map[string]string)
Returns current relays SC, by contractId
func (*Controller) Start ¶ added in v0.5.1
func (c *Controller) Start() error
Controller starter Enrolls relays and starts heartbeat goroutine
func (*Controller) StartWithList ¶ added in v0.5.1
func (c *Controller) StartWithList(contractIds ...string) error
Controller starter, with custom list Enrolls relays and starts heartbeat goroutine
func (*Controller) Started ¶ added in v0.5.1
func (c *Controller) Started() bool
Returns current Controller status
func (*Controller) Status ¶ added in v0.5.1
func (c *Controller) Status() (m map[string]RelayStatus)
Returns current relays status, by contractId
type RelayFlags ¶ added in v0.5.1
type RelayStatus ¶ added in v0.5.1
type RelayStatus struct { Addr *texturl.URL Role string Flags RelayFlags }
RelayStatus minified version of relayStatus