mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
move location of handler
This commit is contained in:
@ -1,37 +1,5 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/registry"
|
||||
)
|
||||
|
||||
// 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.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// type Service struct {}
|
||||
//
|
||||
// func (s *Service) Method(context, request, response) error {
|
||||
// return nil
|
||||
// }
|
||||
//
|
||||
type Handler interface {
|
||||
Name() string
|
||||
Handler() interface{}
|
||||
Endpoints() []*registry.Endpoint
|
||||
Options() HandlerOptions
|
||||
}
|
||||
|
||||
// Subscriber interface represents a subscription to a given topic using
|
||||
// a specific subscriber function or object with methods.
|
||||
type Subscriber interface {
|
||||
Topic() string
|
||||
Subscriber() interface{}
|
||||
Endpoints() []*registry.Endpoint
|
||||
Options() SubscriberOptions
|
||||
}
|
||||
|
||||
type HandlerOptions struct {
|
||||
Internal bool
|
||||
Metadata map[string]map[string]string
|
||||
|
Reference in New Issue
Block a user