nodes

package
v0.0.0-...-b77fa13 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MasterNode

type MasterNode struct {
	pb.UnimplementedMasterServer
	// contains filtered or unexported fields
}

MasterNode is a master node

func NewMasterNode

func NewMasterNode(nodeInfo map[string]NodeInfo, certFile, keyFile string) *MasterNode

NewMasterNode creates a new master node

func (*MasterNode) GetInput

func (m *MasterNode) GetInput(ctx context.Context, in *empty.Empty) (*pb.ValueMessage, error)

GetInput handles request to get input from master node

func (*MasterNode) SendOutput

func (m *MasterNode) SendOutput(ctx context.Context, in *pb.ValueMessage) (*empty.Empty, error)

SendOutput handles request to send output to master node

func (*MasterNode) Start

func (m *MasterNode) Start()

Start starts master node server

type NodeInfo

type NodeInfo struct {
	Type string `json:"type"`
}

NodeInfo contains information about nodes

type ProgramNode

type ProgramNode struct {
	pb.UnimplementedProgramServer
	// contains filtered or unexported fields
}

ProgramNode is a program node that interprets TIS-100 asm

func NewProgramNode

func NewProgramNode(masterURI string, certFile, keyFile string) *ProgramNode

NewProgramNode creates a new program node

func (*ProgramNode) Load

func (p *ProgramNode) Load(ctx context.Context, in *pb.LoadMessage) (*empty.Empty, error)

Load handles request to reset node and load asm program

func (*ProgramNode) LoadProgram

func (p *ProgramNode) LoadProgram(s string) error

LoadProgram loads program onto node

func (*ProgramNode) Pause

func (p *ProgramNode) Pause(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

Pause handles request to pause asm execution

func (*ProgramNode) Reset

func (p *ProgramNode) Reset(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

Reset handles request to reset asm execution and registers

func (*ProgramNode) Run

func (p *ProgramNode) Run(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

Run handles request to start asm execution

func (*ProgramNode) Send

func (p *ProgramNode) Send(ctx context.Context, in *pb.SendMessage) (*empty.Empty, error)

Send handles request for sending value to node

func (*ProgramNode) Start

func (p *ProgramNode) Start()

Start starts program loop and server

type StackNode

type StackNode struct {
	pb.UnimplementedStackServer
	// contains filtered or unexported fields
}

StackNode is a stack node

func NewStackNode

func NewStackNode(certFile, keyFile string) *StackNode

NewStackNode creates a new stack node

func (*StackNode) Pause

func (s *StackNode) Pause(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

Pause handles request to pause stack node

func (*StackNode) Pop

func (s *StackNode) Pop(ctx context.Context, in *empty.Empty) (*pb.ValueMessage, error)

Pop handles request to pop and output value from stack node

func (*StackNode) Push

func (s *StackNode) Push(ctx context.Context, in *pb.ValueMessage) (*empty.Empty, error)

Push handles request to push incoming value onto stack node

func (*StackNode) Reset

func (s *StackNode) Reset(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

Reset handles request to reset stack node

func (*StackNode) Run

func (s *StackNode) Run(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

Run handles request to run stack node

func (*StackNode) Start

func (s *StackNode) Start()

Start starts stack node

Jump to

Keyboard shortcuts

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