lotsawa

package module
v0.0.0-...-7f806dd Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

README

lotsawa

a pluggable compiler service

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompileArgs

type CompileArgs struct {
	// The code to compile
	Code string

	// The language of the code
	Lang string
}

type CompileReply

type CompileReply struct {
	// Unique compiling ID
	Id string
	// The command line used to compile this piece of code
	Cmd string
	// Whether the code has main function and can be executed
	Error string
	// Time took to compile and run the program
	Time time.Duration
	// Compiler's standard output
	C_Output string
	// Compiler's standard error
	C_Error string
	// The program's standard error, if compiled successfully and run
	P_Output string
	// The program's standard output, if compiled successfully and run
	P_Error string
}

type CompileService

type CompileService struct {
	// contains filtered or unexported fields
}

RPC service

func NewCompileService

func NewCompileService(server *CompilerServer) *CompileService

func (*CompileService) Compile

func (c *CompileService) Compile(args *CompileArgs, reply *CompileReply) error

func (*CompileService) List

func (c *CompileService) List(args struct{}, reply *ListReply) error

type CompileServiceStub

type CompileServiceStub struct {
	// contains filtered or unexported fields
}

RPC stub for the client

func NewCompileServiceStub

func NewCompileServiceStub(net, addr string) (*CompileServiceStub, error)

func (*CompileServiceStub) Close

func (c *CompileServiceStub) Close() error

func (*CompileServiceStub) Compile

func (c *CompileServiceStub) Compile(args *CompileArgs, reply *CompileReply) error

func (*CompileServiceStub) List

func (c *CompileServiceStub) List(args struct{}, reply *ListReply) error

type Compiler

type Compiler struct {
	Name    string
	Version string
}

type CompilerServer

type CompilerServer struct {
	// contains filtered or unexported fields
}

Compiler server

func NewCompilerServer

func NewCompilerServer() *CompilerServer

func (*CompilerServer) AddCompiler

func (s *CompilerServer) AddCompiler(name string, c lang.Compiler)

manage compilers

func (*CompilerServer) DelCompiler

func (s *CompilerServer) DelCompiler(name string)

func (*CompilerServer) GetCompiler

func (s *CompilerServer) GetCompiler(name string) lang.Compiler

func (*CompilerServer) Init

func (s *CompilerServer) Init() error

func (*CompilerServer) ListCompiler

func (s *CompilerServer) ListCompiler() []string

func (*CompilerServer) Loop

func (s *CompilerServer) Loop()

func (*CompilerServer) Run

func (s *CompilerServer) Run()

func (*CompilerServer) Stop

func (s *CompilerServer) Stop()

func (*CompilerServer) Submit

func (s *CompilerServer) Submit(req *Request)

type ListReply

type ListReply struct {
	Compilers []Compiler
}

type Request

type Request struct {
	// contains filtered or unexported fields
}

Struct holds the compile request

type RpcServer

type RpcServer struct {
	// contains filtered or unexported fields
}

RPC server

func NewRpcServer

func NewRpcServer(server *Server, addr string) (*RpcServer, error)

func (*RpcServer) Init

func (s *RpcServer) Init() error

func (*RpcServer) Run

func (s *RpcServer) Run()

func (*RpcServer) Stop

func (s *RpcServer) Stop()

func (*RpcServer) Wait

func (s *RpcServer) Wait()

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string) (*Server, error)

func (*Server) Run

func (s *Server) Run()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) Wait

func (s *Server) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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