-
Notifications
You must be signed in to change notification settings - Fork 10
/
meta.go
30 lines (22 loc) · 811 Bytes
/
meta.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
package go_openrpc_reflect
import (
"net"
meta_schema "github.com/open-rpc/meta-schema"
)
// MetaT implements the MetaRegisterer interface.
// An application can use this struct to define an inline
// interface for an OpenRPC document.
type MetaT struct {
GetServersFn func () func (listeners []net.Listener) (*meta_schema.Servers, error)
GetInfoFn func () (info *meta_schema.InfoObject)
GetExternalDocsFn func () (exdocs *meta_schema.ExternalDocumentationObject)
}
func (m *MetaT) GetServers() func (listeners []net.Listener) (*meta_schema.Servers, error) {
return m.GetServersFn()
}
func (m *MetaT) GetInfo() func() (info *meta_schema.InfoObject) {
return m.GetInfoFn
}
func (m *MetaT) GetExternalDocs() func() (exdocs *meta_schema.ExternalDocumentationObject) {
return m.GetExternalDocsFn
}