service

package
v0.0.0-...-6588121 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: GPL-3.0, LGPL-3.0, AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// We need to embed the ServiceProcessor, so that incoming messages
	// are correctly handled.
	*onet.ServiceProcessor
	// contains filtered or unexported fields
}

Service is our template-service

func (*Service) Clock

func (s *Service) Clock(req *template.Clock) (*template.ClockReply, error)

Clock starts a template-protocol and returns the run-time.

func (*Service) Count

func (s *Service) Count(req *template.Count) (*template.CountReply, error)

Count returns the number of instantiations of the protocol.

func (*Service) NewProtocol

func (s *Service) NewProtocol(tn *onet.TreeNodeInstance, conf *onet.GenericConfig) (onet.ProtocolInstance, error)

NewProtocol is called on all nodes of a Tree (except the root, since it is the one starting the protocol) so it's the Service that will be called to generate the PI on all others node. If you use CreateProtocolOnet, this will not be called, as the Onet will instantiate the protocol on its own. If you need more control at the instantiation of the protocol, use CreateProtocolService, and you can give some extra-configuration to your protocol in here.

func (*Service) Send

func (s *Service) Send(req *template.Transaction) (*template.TransReply, error)

Send starts a template-protocol and returns the result status.

Jump to

Keyboard shortcuts

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