Package runtimectl provides the RuntimeCtl facility which allows external runtime control of Granitic applications.

This facility is described in detail at Refer to the ctl package documentation for information on how to implement your own commands.

Enabling runtime control

Enabling the RuntimeCtl facility creates an HTTP server that allows instructions to be issued to any component in the IoC container which implements the ctl.Command interface from the grnc-ctl command line tool. See for documentation on Granitic's built-in commands.

The HTTP server that listens for commands is separate to the HTTP server created by the XmlWs and JsonWs facilities and runs on a different port. The listen port defaults to 9099 but can be changed with the following configuration:

  "RuntimeCtl": {
	  "Port": 9099,
	  "Address": ""

Note that by default the server only listens on the IPV4 localhost. To listen on all interfaces, change address to ""

Disabling individual commands

You can disable individual commands (either builtin commands or your own application commands) with configuration. For example:


"RuntimeCtl": {
    "Disabled": ["shutdown"]


Disables the shutdown command, preventing your application being stopped remotely.



View Source
const (
	All = iota
View Source
const (
	RuntimeCtlServer = instance.FrameworkPrefix + "CtlServer"


This section is empty.


func NewResumeCommand

func NewResumeCommand() *lifecycleCommand

    Create a variant of the lifecycleCommand configured as the resume command.

    func NewStartCommand

    func NewStartCommand() *lifecycleCommand

      Create a variant of the lifecycleCommand configured as the start command.

      func NewStopCommand

      func NewStopCommand() *lifecycleCommand

        Create a variant of the lifecycleCommand configured as the stop command.

        func NewSuspendCommand

        func NewSuspendCommand() *lifecycleCommand

          Create a variant of the lifecycleCommand configured as the suspend command.

          func OperateOnFramework

          func OperateOnFramework(args map[string]string) (bool, error)

          func RuntimeCtlEnabled

          func RuntimeCtlEnabled(ca *config.ConfigAccessor) bool

            RuntimeCtlEnabled checks to see if the RuntimeCtl facility is enabled in configuration.


            type RuntimeCtlFacilityBuilder

            type RuntimeCtlFacilityBuilder struct {

            func (*RuntimeCtlFacilityBuilder) BuildAndRegister

            func (*RuntimeCtlFacilityBuilder) DependsOnFacilities

            func (fb *RuntimeCtlFacilityBuilder) DependsOnFacilities() []string

            func (*RuntimeCtlFacilityBuilder) FacilityName

            func (fb *RuntimeCtlFacilityBuilder) FacilityName() string