api completeness (#1460)
This commit is contained in:
parent
7b7a859a03
commit
20c95d94cd
15
api/api.go
15
api/api.go
@ -10,19 +10,22 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Api interface {
|
type Api interface {
|
||||||
|
// Initialise options
|
||||||
|
Init(...Option) error
|
||||||
|
// Get the options
|
||||||
|
Options() Options
|
||||||
// Register a http handler
|
// Register a http handler
|
||||||
Register(*Endpoint) error
|
Register(*Endpoint) error
|
||||||
// Register a route
|
// Register a route
|
||||||
Deregister(*Endpoint) error
|
Deregister(*Endpoint) error
|
||||||
// Init initialises the command line.
|
// Implemenation of api
|
||||||
// It also parses further options.
|
|
||||||
//Init(...Option) error
|
|
||||||
// Options
|
|
||||||
//Options() Options
|
|
||||||
// String
|
|
||||||
String() string
|
String() string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Options struct {}
|
||||||
|
|
||||||
|
type Option func(*Options) error
|
||||||
|
|
||||||
// Endpoint is a mapping between an RPC method and HTTP endpoint
|
// Endpoint is a mapping between an RPC method and HTTP endpoint
|
||||||
type Endpoint struct {
|
type Endpoint struct {
|
||||||
// RPC Method e.g. Greeter.Hello
|
// RPC Method e.g. Greeter.Hello
|
||||||
|
Loading…
Reference in New Issue
Block a user