Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(host string, handler Function, timeout int) error

    Serve starts a remote function server. Incomming requests should be handled by the given Function. This version of Serve doesn't work with AddRoute.

    func Serve1

    func Serve1(host string, handler Function, timeout int) error

      Serve1 starts a remote function server. Incomming requests should be handled by the given Function. This version of Serve doesn't work with AddRoute.

      Types

      type Client

      type Client struct {
      	Host string
      
      	Timeout  int
      	Protocol int
      	// contains filtered or unexported fields
      }

        Client represents a the client side of a remote function (also known as a remote procedure call).

        func (*Client) Call

        func (rf *Client) Call(g *ogdl.Graph) (*ogdl.Graph, error)

        func (*Client) Close

        func (rf *Client) Close()

          Close closes the underlying connection, if open.

          func (*Client) Dial

          func (rf *Client) Dial() error

          type Function

          type Function func(net.Conn, *ogdl.Graph) *ogdl.Graph

            Function is the prototype of functions to be server by ogdlrf.Serve

            type Server

            type Server struct {
            	Host    string
            	Timeout int
            
            	Protocol int
            	// contains filtered or unexported fields
            }

              Server hold the state of the server side of a remote function.

              func (*Server) AddRoute

              func (s *Server) AddRoute(path string, f Function)

                AddRoute associates a handler function with the given path. A path in this context is the first child of the incomming request.

                func (*Server) Serve

                func (s *Server) Serve() error

                  Serve starts a remote function server. Handler functions should be set up with AddRoute.