package
4.1.0+incompatible
Repository: https://github.com/open-horizon/anax.git
Documentation: pkg.go.dev
# Functions
Add the given org to the id if the id does not already contain an org.
AddSlash prepends "/" to the id if it is not the empty string and returns it.
ConfirmRemove prompts the user to confirm they want to run the destructive cmd.
No description provided by the author
create an exchange context based on the user Id and password.
display a data structure as json format.
ExchangeDelete deletes a resource via the exchange api.
ExchangeGet runs a GET to the specified service api and fills in the specified json structure.
ExchangePutPost runs a PUT, POST or PATCH to the exchange api to create of update a resource.
ExpandEnv is equivalent to os.ExpandEnv(), except prints a warning when an env var is not defined.
ExpandMapping is used in ExpandEnv() to print a warning if the env var is not defined.
No description provided by the author
Returns the agbot url.
Get the anax configuration from the given configuration file.
No description provided by the author
get the default private or public key file name.
GetDockerAuth finds the docker credentials for this registry in ~/.docker/config.json.
get a value keyed by key in a file.
find correct credentials to use.
Find correct credentials to use.
GetExchangeUrl returns the exchange url from the env var or anax api.
Get exchange url from /etc/default/horizon file.
GetExchangeUrlLocation returns a string with the filename or envvar that GetExchangeUrl is getting the exchange url from.
GetExchangeUrlFromAnax returns a string with the file or envvar that GetExchangeUrlFromAnax is getting the exchange url from.
GetHorizonUrlBase returns the base part of the horizon api url (which can be overridden by env var HORIZON_URL).
Common function for getting an HTTP client connection object.
get the http retry count and interval from the env variables.
GetIcpCertPath gets the path of the certificate for the exchange and CSS (collectively referred to as the management hub).
GetMMSUrl returns the exchange url from the env var or anax api.
Get mms url from /etc/default/horizon file.
This function is used in the service publish command to pull the docker image.
GetRespBodyAsString converts an http response body to a string.
GetSdoSvcUrl returns the url of the Horizon mgmt hub SDO owner service from env var or anax overwrite file.
get default keys if needed and verify them.
create the exchange context with the given user credentail.
HorizonDelete runs a DELETE on the anax api.
HorizonGet runs a GET on the anax api and fills in the specified structure with the json.
HorizonPutPost runs a PUT or POST to the anax api to create or update a resource.
invoke rest api call with retry.
No description provided by the author
MarshalIndent calls json.MarshalIndent and handles any errors.
No description provided by the author
create an http client factory to be used for the exchange calls.
OrgAndCreds prepends the org to creds (separated by /) unless creds already has an org prepended.
PullDockerImage pulls the image from the docker registry.
PushDockerImage pushes the image to its docker registry, outputting progress to stdout.
ReadFile reads from a file or stdin, and returns it as a byte array.
ReadJsonFile reads json from a file or stdin, eliminates comments, substitutes env vars, and returns it.
ReadStdin reads from stdin, and returns it as a byte array.
RequiredWithDefaultEnvVar returns the specified flag ptr if it has a non-blank value, or the env var value.
Run a command with optional stdin and args, and return stdout, stderr.
set env variable ARCH if it is not set.
todo: this function should be removed because it was for WIoTP keys that shouldn't have the org prepended.
SplitIdToken splits an id:token or user:pw and return the parts.
TrimOrg returns id with the leading "<org>/" removed, if it was there.
TrustIcpCert adds the icp cert file to be trusted in calls made by the given http client.
Unmarshal simply calls json.Unmarshal and handles any errors.
No description provided by the author
Gets default keys if not set, verify key files exist.
No description provided by the author
WithDefaultEnvVar returns the specified flag ptr if it has a non-blank value, or the env var value.
# Constants
Anax API HTTP Codes.
No description provided by the author
No description provided by the author
anax configuration files.
EXEC_CMD_ERROR = 6.
we actually don't have control over the usage exit code that kingpin returns, so use the same code for input errors we catch ourselves.
default keys will be prepended with $HOME.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
http request body types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
stores the verbose messages before the GlobalOptions.Verbose is set.
# Structs
Holds the cmd line flags that were set so other pkgs can access.
No description provided by the author