Documentation ¶
Index ¶
- Constants
- Variables
- func AddCommands(rootCmd *cobra.Command, logger log.Logger, homePath string, ...) error
- func NewLogger(v *viper.Viper, out io.Writer) (log.Logger, error)
- func ReadConfig(configPath string) (*viper.Viper, error)
- type CLIConfig
- type Config
- type HasCLICommands
- type HasConfig
- type Server
- type ServerModule
Constants ¶
View Source
const ( // Logging flags FlagLogLevel = "log_level" FlagLogFormat = "log_format" FlagLogNoColor = "log_no_color" FlagTrace = "trace" OutputFormatJSON = "json" )
Variables ¶
View Source
var ServerContextKey = struct{}{}
Functions ¶
func AddCommands ¶
func NewLogger ¶
NewLogger creates a the default SDK logger. It reads the log level and format from the server context.
Types ¶
type CLIConfig ¶
type CLIConfig struct { // Commands defines the main command of a module server. Commands []*cobra.Command // Queries defines the query commands of a module server. // Those commands are meant to be added in the root query command. Queries []*cobra.Command // Txs defines the tx commands of a module server. // Those commands are meant to be added in the root tx command. Txs []*cobra.Command }
CLIConfig defines the CLI configuration for a module server.
type Config ¶
type Config struct { // StartBlock indicates if the server should block or not. // If true, the server will block until the context is canceled. StartBlock bool }
Config is the config of the main server.
type HasCLICommands ¶
type HasCLICommands interface {
CLICommands() CLIConfig
}
HasCLICommands is a server module that has CLI commands.
type HasConfig ¶
type HasConfig interface {
Config() any
}
HasConfig is a server module that has a config.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(logger log.Logger, modules ...ServerModule) *Server
func (*Server) CLICommands ¶
CLICommands returns all CLI commands of all modules.
func (*Server) Configs ¶
Configs returns all configs of all server modules.
func (*Server) Start ¶
Start starts all modules concurrently.
func (*Server) Stop ¶
Stop stops all modules concurrently.
Directories ¶
Path | Synopsis |
---|---|
api
|
|
grpc/gogoreflection
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry.
|
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry. |
appmanager
module
|
|
stf
module
|
|
Package abci contains shared data between the host and plugins.
|
Package abci contains shared data between the host and plugins. |
Click to show internal directories.
Click to hide internal directories.