Documentation ¶
Index ¶
- Variables
- func InitialiseService(store Store, overwrite bool) error
- func IsInitialised(store Store) (bool, error)
- func UpdateConfig(store Store, cfg *Config) error
- type APIV1Config
- type APIV2Config
- type Config
- type LoggerBuilderFunc
- type NetworkStore
- type Nodes
- type ProcessStoppedNotifier
- type ResourceContext
- type ServerConfig
- type Service
- type Starter
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLogLevelValue = errors.New("the service log level is invalid") ErrInvalidMaximumTokenDuration = errors.New("the maximum token duration is invalid") ErrInvalidMaximumNodeRequestDuration = errors.New("the maximum request duration is invalid") ErrServerHostUnset = errors.New("the service host is unset") ErrServerPortUnset = errors.New("the service port is unset") )
View Source
var ErrCannotStartMultipleServiceAtTheSameTime = errors.New("cannot start multiple service at the same time")
Functions ¶
func InitialiseService ¶
func IsInitialised ¶
func UpdateConfig ¶
Types ¶
type APIV1Config ¶
type APIV1Config struct {
MaximumTokenDuration vgencoding.Duration `json:"maximumTokenDuration"`
}
type APIV2Config ¶
type APIV2Config struct {
Nodes Nodes `json:"nodes"`
}
type Config ¶
type Config struct { LogLevel vgencoding.LogLevel `json:"logLevel"` Server ServerConfig `json:"server"` APIV1 APIV1Config `json:"apiV1"` APIV2 APIV2Config `json:"apiV2"` }
func DefaultConfig ¶
func DefaultConfig() *Config
type LoggerBuilderFunc ¶
LoggerBuilderFunc is used to build a logger. It returns the built logger and a zap.AtomicLevel to allow the caller to dynamically change the log level.
type NetworkStore ¶
type Nodes ¶
type Nodes struct { MaximumRetryPerRequest uint64 `json:"maximumRetryPerRequest"` MaximumRequestDuration vgencoding.Duration `json:"maximumRequestDuration"` }
type ProcessStoppedNotifier ¶
type ProcessStoppedNotifier func()
type ResourceContext ¶
type ServerConfig ¶
func (ServerConfig) String ¶
func (c ServerConfig) String() string
type Service ¶
type Service struct { *httprouter.Router // contains filtered or unexported fields }
func NewService ¶
type Starter ¶
type Starter struct {
// contains filtered or unexported fields
}
func NewStarter ¶
func NewStarter(walletStore api.WalletStore, netStore api.NetworkStore, svcStore Store, connectionsManager *connections.Manager, policy servicev1.Policy, interactor api.Interactor, loggerBuilderFunc LoggerBuilderFunc) *Starter
func (*Starter) Start ¶
func (s *Starter) Start(jobRunner *vgjob.Runner, network string, noVersionCheck bool) (_ *ResourceContext, err error)
Start builds the components the service relies on and start it.
Why build certain components only at start up, and not during the build phase? ¶
This is because some components are relying on editable configuration. So, the service must be able to be restarted with an updated configuration. Building these components up front would prevent that. This is particularly true for desktop applications that can edit the configuration and start the service in the same process.
Directories ¶
Path | Synopsis |
---|---|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
store
|
|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
connections/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.