Files
elmprodvpn/selective-vpn-api/app/transport_backends_runtime_unsupported.go

43 lines
1.3 KiB
Go

package app
import (
"fmt"
"strings"
)
func (b transportUnsupportedRuntimeBackend) Action(_ TransportClient, action string) transportBackendActionResult {
return transportBackendActionResult{
OK: false,
Code: "TRANSPORT_BACKEND_RUNTIME_MODE_UNSUPPORTED",
Message: fmt.Sprintf("runtime_mode %q is not supported yet for action %q", b.mode, strings.TrimSpace(action)),
ExitCode: -1,
}
}
func (b transportUnsupportedRuntimeBackend) Health(_ TransportClient) transportBackendHealthResult {
return transportBackendHealthResult{
OK: false,
Code: "TRANSPORT_BACKEND_RUNTIME_MODE_UNSUPPORTED",
Message: fmt.Sprintf("runtime_mode %q is not supported yet", b.mode),
Status: TransportClientDegraded,
Retryable: false,
}
}
func (b transportUnsupportedRuntimeBackend) Provision(_ TransportClient) transportBackendActionResult {
return transportBackendActionResult{
OK: false,
Code: "TRANSPORT_BACKEND_RUNTIME_MODE_UNSUPPORTED",
Message: fmt.Sprintf("runtime_mode %q is not supported yet for provision", b.mode),
ExitCode: -1,
}
}
func (b transportUnsupportedRuntimeBackend) Cleanup(_ TransportClient) transportBackendActionResult {
return transportBackendActionResult{
OK: true,
ExitCode: 0,
Message: fmt.Sprintf("cleanup skipped for unsupported runtime_mode %q", b.mode),
}
}