Documentation

Overview

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

This facility is described in detail at http://granitic.io/1.0/ref/runtime-ctl. 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 http://granitic.io/1.0/ref/runtime-ctl#builtin 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": {
	"Server":{
	  "Port": 9099,
	  "Address": "127.0.0.1"
	}
  }
}

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": {
  "Manager":{
    "Disabled": ["shutdown"]
  }
}

}

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

Index

Constants

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

Variables

This section is empty.

Functions

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.

            Types

            type RuntimeCtlFacilityBuilder

            type RuntimeCtlFacilityBuilder struct {
            }

            func (*RuntimeCtlFacilityBuilder) BuildAndRegister

            func (*RuntimeCtlFacilityBuilder) DependsOnFacilities

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

            func (*RuntimeCtlFacilityBuilder) FacilityName

            func (fb *RuntimeCtlFacilityBuilder) FacilityName() string