Documentation
¶
Index ¶
- Variables
- func GetContext(r *http.Request) *serverContext
- func Init() error
- func Register(r Receiver) error
- func Run() error
- func Start() error
- func Stop() error
- type Context
- type Headers
- type Receiver
- type Request
- type RpcReceiver
- type RpcServer
- func (s *RpcServer) Address() string
- func (s *RpcServer) Init() error
- func (s *RpcServer) NewNamedReceiver(name string, handler interface{}) Receiver
- func (s *RpcServer) NewReceiver(handler interface{}) Receiver
- func (s *RpcServer) Register(r Receiver) error
- func (s *RpcServer) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *RpcServer) Start() error
- func (s *RpcServer) Stop() error
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HealthPath = "/_status/health" RpcPath = "/_rpc" )
View Source
var ( Address string Name string Id string DefaultServer Server )
Functions ¶
func GetContext ¶
Types ¶
type Context ¶
type Context interface { Request() Request // the request made to the server Headers() Headers // the response headers NewRequest(string, string, interface{}) client.Request // a new scoped client request NewProtoRequest(string, string, interface{}) client.Request // a new scoped client request NewJsonRequest(string, string, interface{}) client.Request // a new scoped client request }
A server context interface
type Receiver ¶
type Receiver interface { Name() string Handler() interface{} }
func NewNamedReceiver ¶
func NewReceiver ¶
func NewReceiver(handler interface{}) Receiver
type RpcReceiver ¶
type RpcReceiver struct {
// contains filtered or unexported fields
}
func NewNamedRpcReceiver ¶
func NewNamedRpcReceiver(name string, handler interface{}) *RpcReceiver
func NewRpcReceiver ¶
func NewRpcReceiver(handler interface{}) *RpcReceiver
func (*RpcReceiver) Handler ¶
func (r *RpcReceiver) Handler() interface{}
func (*RpcReceiver) Name ¶
func (r *RpcReceiver) Name() string
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
func NewRpcServer ¶
func (*RpcServer) NewNamedReceiver ¶
func (*RpcServer) NewReceiver ¶
Click to show internal directories.
Click to hide internal directories.