Documentation
¶
Index ¶
- Constants
- Variables
- func FirstIPV4() (ip net.IP)
- func Kill(closers ...io.Closer) (err error)
- type Action
- type Actions
- type Config
- type DataObject
- type Event
- type Node
- func (n *Node) Close() (err error)
- func (n *Node) Exit(ctx context.Context) (err error)
- func (n *Node) Login(ctx context.Context, name, listen string) (err error)
- func (n *Node) Logout(ctx context.Context, name string) (err error)
- func (n *Node) Recv(ctx context.Context, e *Event) (err error)
- func (n *Node) Send(ctx context.Context, e *Event) (err error)
- type Payload
- type RetryOpts
- type Rms
- func (r *Rms) AddMember(name string, node *Node)
- func (r *Rms) AddRoute(target, via string)
- func (r *Rms) DelMember(name string)
- func (r *Rms) DelRoute(keys ...string)
- func (r *Rms) Dispatch(targets Targets) (local bool, ups Targets, vias map[string]Targets)
- func (r *Rms) GetMember(name string) (node *Node, ok bool)
- func (r *Rms) GetRoute(target string) (via string)
- func (r *Rms) HasMember() (ok bool)
- func (r *Rms) Members() (names Set)
- func (r *Rms) Routes() (routes map[string]string)
- func (r *Rms) Targets(via string) (names []string)
- type Runner
- func (r *Runner) AddAction(name string, action Action)
- func (r *Runner) AddCallback(action Action) (name string)
- func (r *Runner) Close() (err error)
- func (r *Runner) Derour(ctx context.Context, req Payload) (rep Payload, err error)
- func (r *Runner) Handle(ctx context.Context, e *Event) (err error)
- func (r *Runner) Leader() (leader *Node)
- func (r *Runner) Login(ctx context.Context, req Payload) (rep Payload, err error)
- func (r *Runner) Logout(ctx context.Context, req Payload) (rep Payload, err error)
- func (r *Runner) Member(name string) *Node
- func (r *Runner) Members() (members Set)
- func (r *Runner) Name() string
- func (r *Runner) NodeType() string
- func (r *Runner) Ping(ctx context.Context, req Payload) (rep Payload, err error)
- func (r *Runner) RemoveAction(name string)
- func (r *Runner) Route(ctx context.Context, req Payload) (rep Payload, err error)
- func (r *Runner) Routes() (routes map[string]string)
- func (r *Runner) Self() *Node
- func (r *Runner) Wait() error
- type Set
- type Targets
Constants ¶
View Source
const ( ROOT = "root" LEAF = "leaf" BRANCH = "branch" EXIT = "" )
Variables ¶
View Source
var ( ErrorListen = errors.New("Failed to listen") ErrorDial = errors.New("Failed to dial") ErrorSock = errors.New("Failed to new socket") ErrorDecode = errors.New("Failed to decode") ErrorEncode = errors.New("Failed to encode") ErrorSend = errors.New("Failed to send") ErrorRecv = errors.New("Failed to receive") )
View Source
var (
Retry = RetryOpts{retry.LastErrorOnly(true), retry.Attempts(5)}
)
Functions ¶
Types ¶
type DataObject ¶
type DataObject []byte
func (DataObject) Clone ¶
func (d DataObject) Clone() (dup DataObject)
func (*DataObject) CodecDecodeSelf ¶
func (x *DataObject) CodecDecodeSelf(d *codec1978.Decoder)
func (DataObject) CodecEncodeSelf ¶
func (x DataObject) CodecEncodeSelf(e *codec1978.Encoder)
func (DataObject) Decode ¶
func (d DataObject) Decode(i interface{}) (err error)
func (*DataObject) Encode ¶
func (d *DataObject) Encode(i interface{}) (err error)
type Event ¶
type Event struct { Id int64 `codec:"id"` To Targets `codec:"to"` From string `codec:"from"` Action string `codec:"action"` Carrier map[string]string `codec:"carrier"` Payload Payload `codec:"payload"` Callback string `codec:"callback"` }
func (*Event) CodecDecodeSelf ¶
func (*Event) CodecEncodeSelf ¶
type Payload ¶
type Payload []DataObject
func (*Payload) CodecDecodeSelf ¶
func (Payload) CodecEncodeSelf ¶
type Rms ¶
type Rms struct { Name string // contains filtered or unexported fields }
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) AddCallback ¶
func (*Runner) RemoveAction ¶
type Targets ¶
type Targets []string
func (*Targets) CodecDecodeSelf ¶
func (Targets) CodecEncodeSelf ¶
func (Targets) Down ¶
Down - all nodes in the subtree a -> b -> c
| -> d ` -> e -> f if targets being exectured on node b, the action will be token on node b, c, d, e, and f
Click to show internal directories.
Click to hide internal directories.