mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-29 00:32:14 +00:00
Spell out the package explicitly. This commit is totally textual, and does not change any logic. The swiss-army knife package may serve a kick-start in early stage development. But as the codebase growing, we might want to retire it gradually: For simple wrapping functions, just inline it on the call site. For larger pice of code, make it an independent package.
23 lines
490 B
Go
23 lines
490 B
Go
package server
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/tendermint/abci/types"
|
|
common "github.com/tendermint/go-common"
|
|
)
|
|
|
|
func NewServer(protoAddr, transport string, app types.Application) (common.Service, error) {
|
|
var s common.Service
|
|
var err error
|
|
switch transport {
|
|
case "socket":
|
|
s, err = NewSocketServer(protoAddr, app)
|
|
case "grpc":
|
|
s, err = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
|
|
default:
|
|
err = fmt.Errorf("Unknown server type %s", transport)
|
|
}
|
|
return s, err
|
|
}
|