Documentation
¶
Index ¶
- Constants
- func CheckRootConfig(v *viper.Viper) error
- func ContainsDash(args []string) bool
- func CreatePrimeClient(v *viper.Viper) (*primeClient.Mymove, *pksigner.Store, error)
- func CreatePrimeClientWithCACStoreParam(v *viper.Viper, store *pksigner.Store) (*primeClient.Mymove, *pksigner.Store, error)
- func CreateSupportClient(v *viper.Viper) (*supportClient.Mymove, *pksigner.Store, error)
- func DecodeJSONFileToPayload(filename string, isStdin bool, payload interface{}) error
- func HandleGatewayError(err error, logger *log.Logger) error
- func ParseFlags(cmd *cobra.Command, v *viper.Viper, args []string) error
Constants ¶
const ( // FilenameFlag is the name of the file being passed in FilenameFlag string = "filename" // IDFlag is the UUID of the object being retrieved IDFlag string = "id" // SinceFlag is the datetime for the `since` filter for fetching moves SinceFlag string = "since" // ETagFlag is the etag for the mto shipment being updated ETagFlag string = "etag" // PaymentRequestIDFlag is the payment request ID PaymentRequestIDFlag string = "paymentRequestID" // CertPathFlag is the path to the certificate to use for TLS CertPathFlag string = "certpath" // KeyPathFlag is the path to the key to use for TLS KeyPathFlag string = "keypath" // HostnameFlag is the hostname to connect to HostnameFlag string = "hostname" // PortFlag is the port to connect to PortFlag string = "port" // InsecureFlag indicates that TLS verification and validation can be skipped InsecureFlag string = "insecure" // WaitFlag is how long to wait for the server to respond. The // string is parsed by https://pkg.go.dev/time#ParseDuration WaitFlag string = "wait" )
Variables ¶
This section is empty.
Functions ¶
func CheckRootConfig ¶
CheckRootConfig checks the validity of the prime api flags
func ContainsDash ¶
ContainsDash returns true if the original command included an empty dash
func CreatePrimeClient ¶
CreatePrimeClient creates the prime api client #nosec G402
func CreatePrimeClientWithCACStoreParam ¶
func CreatePrimeClientWithCACStoreParam(v *viper.Viper, store *pksigner.Store) (*primeClient.Mymove, *pksigner.Store, error)
CreatePrimeClientWithCACStoreParam creates the prime api client #nosec G402
func CreateSupportClient ¶
CreateSupportClient creates the support api client
func DecodeJSONFileToPayload ¶
DecodeJSONFileToPayload takes a filename, or stdin and decodes the file into the supplied json payload. If the filename is not supplied, the isStdin bool should be set to true to use stdin. If the file contains parameters that do not exist in the payload struct, it will fail with an error Otherwise it will populate the payload
func HandleGatewayError ¶
HandleGatewayError handles errors returned by the gateway
Types ¶
This section is empty.