Documentation ¶
Index ¶
- func GetDBContextFromCmd(cmd *cobra.Command) (*gorm.DB, error)
- func GrpcOpts(listenAddress string, httpConfig *config.HTTPConfig, db *gorm.DB) googleGrpc.ServerOption
- func HTTPConfigsPreRunHandler(cmd *cobra.Command, home string) error
- func InterceptConfigsPreRunHandler(cmd *cobra.Command, home string) error
- func NewDB(cfg *config.Config) (*gorm.DB, error)
- func Run(ctx context.Context, serverCtx *Context, db *gorm.DB) (err error)
- func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error
- func Start(ctx *Context, cmd *cobra.Command) (err error)
- func WaitForQuitSignals() int
- type Context
- type ErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GrpcOpts ¶
func GrpcOpts(listenAddress string, httpConfig *config.HTTPConfig, db *gorm.DB) googleGrpc.ServerOption
func SetCmdServerContext ¶
SetCmdServerContext sets a command's Context value to the provided argument.
func WaitForQuitSignals ¶
func WaitForQuitSignals() int
Types ¶
type Context ¶
type Context struct { // Viper *viper.Viper Config *config.Config BitcoinConfig *config.BitcoinConfig HTTPConfig *config.HTTPConfig }
server context
func GetServerContextFromCmd ¶
GetServerContextFromCmd returns a Context from a command or an empty Context if it has not been set.
func NewContext ¶
func NewContext(cfg *config.Config, btcCfg *config.BitcoinConfig) *Context
func NewDefaultContext ¶
func NewDefaultContext() *Context
func NewHTTPContext ¶
func NewHTTPContext(httpCfg *config.HTTPConfig, bitcoinCfg *config.BitcoinConfig) *Context
Click to show internal directories.
Click to hide internal directories.