Documentation ¶
Index ¶
Constants ¶
View Source
const ( ServiceIdIpReplacementPrefix = "<<<" ServiceIdIpReplacementSuffix = ">>>" )
Variables ¶
This section is empty.
Functions ¶
func EncodeServiceIdForIpReplacement ¶
Used to encode a service ID to a string that can be embedded in commands, and which the API container will replace
with the IP address of the service at runtime
Types ¶
type V0BulkCommands ¶
type V0BulkCommands struct {
Commands []V0SerializableCommand `json:"commands"`
}
type V0CommandType ¶
type V0CommandType string
const ( // vvvvvvvvvvvvvvvvvvvv Update the visitor whenever you add an enum value!!! vvvvvvvvvvvvvvvvvvvvvvvvvvv LoadModuleCommandType V0CommandType = "LOAD_MODULE" ExecuteModuleCommandType V0CommandType = "EXECUTE_MODULE" RegisterServiceCommandType V0CommandType = "REGISTER_SERVICE" StartServiceCommandType V0CommandType = "START_SERVICE" RemoveServiceCommandType V0CommandType = "REMOVE_SERVICE" RepartitionCommandType V0CommandType = "REPARTITION" ExecCommandCommandType V0CommandType = "EXEC_COMMAND" WaitForHttpGetEndpointAvailabilityCommandType V0CommandType = "WAIT_FOR_HTTP_GET_ENDPOINT_AVAILABILITY" WaitForHttpPostEndpointAvailabilityCommandType V0CommandType = "WAIT_FOR_HTTP_POST_ENDPOINT_AVAILABILITY" ExecuteBulkCommandsCommandType V0CommandType = "EXECUTE_BULK_COMMANDS" GetServicesCommandType V0CommandType = "GET_SERVICES" GetModulesCommandType V0CommandType = "GET_MODULES" )
func (V0CommandType) AcceptVisitor ¶
func (commandType V0CommandType) AcceptVisitor(visitor V0CommandTypeVisitor) error
type V0CommandTypeVisitor ¶
type V0CommandTypeVisitor interface { VisitLoadModule() error VisitExecuteModule() error VisitRegisterService() error VisitStartService() error VisitRemoveService() error VisitRepartition() error VisitExecCommand() error VisitWaitForHttpGetEndpointAvailability() error VisitWaitForHttpPostEndpointAvailability() error VisitExecuteBulkCommands() error VisitGetServices() error VisitGetModules() error }
We provide a visitor interface here so that:
- all enum cases can be exhaustively handled
- any changes in the enum will result in a compile break
type V0SerializableCommand ¶
type V0SerializableCommand struct { Type V0CommandType `json:"type"` // The only allowed objects here are from the bindings generated from the .proto file ArgsPtr proto.Message `json:"args"` }
Used for serializing
func (*V0SerializableCommand) UnmarshalJSON ¶
func (cmd *V0SerializableCommand) UnmarshalJSON(bytes []byte) error
A V0SerializableCommand knows how to deserialize itself, thanks to the "type" tag
Click to show internal directories.
Click to hide internal directories.