forked from utrack/clay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handlers.go
33 lines (27 loc) · 805 Bytes
/
handlers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package transport
import (
"net/http"
"github.com/utrack/clay/v2/transport/swagger"
"google.golang.org/grpc"
)
// Service is a registerable collection of endpoints.
// These functions should be autogenerated by protoc-gen-goclay.
type Service interface {
GetDescription() ServiceDesc
}
// ServiceDesc is a description of an endpoints' collection.
// These functions should be autogenerated by protoc-gen-goclay.
type ServiceDesc interface {
RegisterGRPC(*grpc.Server)
RegisterHTTP(Router)
SwaggerDef(options ...swagger.Option) []byte
}
// Router routes HTTP requests around.
type Router interface {
http.Handler
Handle(pattern string, h http.Handler)
}
// ConfigurableServiceDesc is implemented by configurable ServiceDescs.
type ConfigurableServiceDesc interface {
Apply(...DescOption)
}