Ejemplo n.º 1
0
// Register a AddServiceWeb implementation with the given webrpc ServeMux.
// If mux is nil, the default webrpc.ServeMux is used.
func RegisterAddServiceWeb(this AddServiceWeb, mux webrpc.ServeMux) error {
	if mux == nil {
		mux = webrpc.DefaultServeMux
	}
	if err := mux.Handle("/AddService/Add", func(c *webrpc.Call) error {
		in, out := new(AddMessage), new(SumMessage)
		if err := c.ReadRequest(in); err != nil {
			return err
		}
		if err := this.Add(c.Request, in, out); err != nil {
			return err
		}
		return c.WriteResponse(out)
	}); err != nil {
		return err
	}
	return nil
}
Ejemplo n.º 2
0
// Register a WhoamiServiceWeb implementation with the given webrpc ServeMux.
// If mux is nil, the default webrpc.ServeMux is used.
func RegisterWhoamiServiceWeb(this WhoamiServiceWeb, mux webrpc.ServeMux) error {
	if mux == nil {
		mux = webrpc.DefaultServeMux
	}
	if err := mux.Handle("/WhoamiService/Whoami", func(c *webrpc.Call) error {
		in, out := new(Empty), new(YouAre)
		if err := c.ReadRequest(in); err != nil {
			return err
		}
		if err := this.Whoami(c.Request, in, out); err != nil {
			return err
		}
		return c.WriteResponse(out)
	}); err != nil {
		return err
	}
	return nil
}
Ejemplo n.º 3
0
// Register a OffloadServiceWeb implementation with the given webrpc ServeMux.
// If mux is nil, the default webrpc.ServeMux is used.
func RegisterOffloadServiceWeb(this OffloadServiceWeb, mux webrpc.ServeMux) error {
	if mux == nil {
		mux = webrpc.DefaultServeMux
	}
	if err := mux.Handle("/OffloadService/Compute", func(c *webrpc.Call) error {
		in, out := new(DataSet), new(ResultSet)
		if err := c.ReadRequest(in); err != nil {
			return err
		}
		if err := this.Compute(c.Request, in, out); err != nil {
			return err
		}
		return c.WriteResponse(out)
	}); err != nil {
		return err
	}
	return nil
}
Ejemplo n.º 4
0
// Register a EchoServiceWeb implementation with the given webrpc ServeMux.
// If mux is nil, the default webrpc.ServeMux is used.
func RegisterEchoServiceWeb(this EchoServiceWeb, mux webrpc.ServeMux) error {
	if mux == nil {
		mux = webrpc.DefaultServeMux
	}
	if err := mux.Handle("/EchoService/Echo", func(c *webrpc.Call) error {
		in, out := new(Payload), new(Payload)
		if err := c.ReadRequest(in); err != nil {
			return err
		}
		if err := this.Echo(c.Request, in, out); err != nil {
			return err
		}
		return c.WriteResponse(out)
	}); err != nil {
		return err
	}
	return nil
}
Ejemplo n.º 5
0
// Register a ConcatServiceWeb implementation with the given webrpc ServeMux.
// If mux is nil, the default webrpc.ServeMux is used.
func RegisterConcatServiceWeb(this ConcatServiceWeb, mux webrpc.ServeMux) error {
	if mux == nil {
		mux = webrpc.DefaultServeMux
	}
	if err := mux.Handle("/ConcatService/Concat", func(c *webrpc.Call) error {
		in, out := new(Args), new(Return)
		if err := c.ReadRequest(in); err != nil {
			return err
		}
		if err := this.Concat(c.Request, in, out); err != nil {
			return err
		}
		return c.WriteResponse(out)
	}); err != nil {
		return err
	}
	return nil
}