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 HeaderError
- type JSONRPCErr
- 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 ¶ added in v0.68.0
Types ¶
type APIV1Config ¶ added in v0.68.0
type APIV1Config struct {
MaximumTokenDuration vgencoding.Duration `json:"maximumTokenDuration"`
}
type APIV2Config ¶ added in v0.72.0
type APIV2Config struct {
Nodes Nodes `json:"nodes"`
}
type Config ¶ added in v0.68.0
type Config struct { LogLevel vgencoding.LogLevel `json:"logLevel"` Server ServerConfig `json:"server"` APIV1 APIV1Config `json:"apiV1"` APIV2 APIV2Config `json:"apiV2"` }
func DefaultConfig ¶ added in v0.68.0
func DefaultConfig() *Config
type HeaderError ¶ added in v0.73.0
func (HeaderError) Error ¶ added in v0.73.0
func (h HeaderError) Error() string
func (HeaderError) MarshalJSON ¶ added in v0.73.0
func (h HeaderError) MarshalJSON() ([]byte, error)
func (*HeaderError) UnmarshalJSON ¶ added in v0.73.0
func (h *HeaderError) UnmarshalJSON(data []byte) error
type JSONRPCErr ¶ added in v0.73.0
type LoggerBuilderFunc ¶ added in v0.67.0
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 ¶ added in v0.67.0
type Nodes ¶ added in v0.72.0
type Nodes struct { MaximumRetryPerRequest uint64 `json:"maximumRetryPerRequest"` MaximumRequestDuration vgencoding.Duration `json:"maximumRequestDuration"` }
type ProcessStoppedNotifier ¶ added in v0.67.0
type ProcessStoppedNotifier func()
type ResourceContext ¶ added in v0.72.0
type ServerConfig ¶ added in v0.68.0
func (ServerConfig) String ¶ added in v0.68.0
func (c ServerConfig) String() string
type Service ¶
type Service struct { *httprouter.Router // contains filtered or unexported fields }
func NewService ¶
type Starter ¶ added in v0.67.0
type Starter struct {
// contains filtered or unexported fields
}
func NewStarter ¶ added in v0.67.0
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 ¶ added in v0.67.0
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.