2015-06-03 02:25:37 +02:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
2015-11-20 18:17:33 +02:00
|
|
|
"github.com/micro/go-micro/registry"
|
2015-06-03 02:25:37 +02:00
|
|
|
)
|
|
|
|
|
2015-12-01 20:41:43 +02:00
|
|
|
// Handler interface represents a Service request handler. It's generated
|
|
|
|
// by passing any type of public concrete object with methods into server.NewHandler.
|
|
|
|
// Most will pass in a struct.
|
2015-12-01 20:45:52 +02:00
|
|
|
//
|
2015-12-01 20:41:43 +02:00
|
|
|
// Example:
|
2015-12-01 20:45:52 +02:00
|
|
|
//
|
|
|
|
// type Service struct {}
|
|
|
|
//
|
|
|
|
// func (s *Service) Method(context, request, response) error {
|
|
|
|
// return nil
|
|
|
|
// }
|
2015-12-01 20:41:43 +02:00
|
|
|
//
|
2015-06-03 02:25:37 +02:00
|
|
|
type Handler interface {
|
|
|
|
Name() string
|
|
|
|
Handler() interface{}
|
|
|
|
Endpoints() []*registry.Endpoint
|
|
|
|
}
|
2015-06-12 20:52:27 +02:00
|
|
|
|
2015-12-01 20:41:43 +02:00
|
|
|
// Subscriber interface represents a subscription to a given topic using
|
|
|
|
// a specific subscriber function or object with methods.
|
2015-06-12 20:52:27 +02:00
|
|
|
type Subscriber interface {
|
|
|
|
Topic() string
|
|
|
|
Subscriber() interface{}
|
|
|
|
Endpoints() []*registry.Endpoint
|
|
|
|
}
|