{"modulePath":"github.com/ActiveState/cli","version":"v0.0.0-20261125184344-355e69c2df15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Constants\n\n```go\nconst (\n\t// ServiceMono is our main service for api services, \"Mono\" refers to its monolithic nature, one that we're trying to get away from\n\tServiceMono Service = \"platform\"\n\n\t// ServiceSecrets is our service that's used purely for setting and storing secrets\n\tServiceSecrets = \"secrets\"\n\n\t// ServiceHeadChef is our service that's used to kick off and track builds\n\tServiceHeadChef = \"headchef\"\n\n\t// ServiceHeadChefWS is the websocket service on headchef\n\tBuildLogStreamer = \"buildlog-streamer\"\n\n\t// ServiceInventory is our service that's used to query available inventory and dependencies\n\tServiceInventory = \"inventory\"\n\n\t// ServiceGraphQL is our service that's used as a graphql endpoint for platform requests\n\tServiceGraphQL = \"platform-graphql\"\n\n\t// ServiceMediator is our mediator service used to query build graph data\n\tServiceMediator = \"mediator\"\n\n\t// ServiceRequirementsImport is our service that processes requirements.txt files.\n\tServiceRequirementsImport = \"requirements-import\"\n\n\t// ServiceBuildPlanner is our service that processes build plans.\n\tServiceBuildPlanner = \"build-planner\"\n\n\t// ServiceVulnerabilities is Data Acquisition's Hasura service for vulnerability (CVE) information.\n\tServiceVulnerabilities = \"vulnerabilities\"\n\n\t// ServiceHasuraInventory is the Hasura service for inventory information.\n\tServiceHasuraInventory = \"hasura-inventory\"\n\n\t// ServiceUpdateInfo is the service for update info\n\tServiceUpdateInfo = \"update-info\"\n\n\t// TestingPlatform is the API host used by tests so-as not to affect production.\n\tTestingPlatform = \".testing.tld\"\n)\n```\n\n## Functions\n\n```go\nfunc ErrorCode(err interface{}) int\n```\nErrorCode tries to retrieve the code associated with an API error\n\n```go\nfunc ErrorCodeFromPayload(err interface{}) int\n```\nErrorCodeFromPayload tries to retrieve the code associated with an API error from a Message object referenced as a Payload.\n\n```go\nfunc ErrorFromPayload(err error) error\n```\n\n```go\nfunc ErrorFromPayloadTyped(err error) *rationalize.ErrAPI\n```\n\n```go\nfunc ErrorMessageFromPayload(err error) string\n```\nErrorMessageFromPayload tries to retrieve the code associated with an API error from a Message object referenced as a Payload.\n\n```go\nfunc GetPlatformURL(path string) *url.URL\n```\nGetPlatformURL returns a generic Platform URL for the given path. This is for retrieving non-service URLs (e.g. signup URL).\n\n```go\nfunc GetServiceURL(service Service) *url.URL\n```\nGetServiceURL returns the URL for the given service\n\n```go\nfunc HostOverride() string\n```\n\n```go\nfunc NewHTTPClient() *http.Client\n```\nNewHTTPClient creates a new HTTP client that will retry requests and add additional request information to the request headers\n\n```go\nfunc NewRoundTripper(transport http.RoundTripper) http.RoundTripper\n```\nNewRoundTripper creates a new instance of RoundTripper\n\n```go\nfunc SetConfig(cfg *config.Instance)\n```\n\n## Types\n\n```go\ntype RoundTripper struct {\n\t// contains filtered or unexported fields\n}\n```\nRoundTripper is an implementation of http.RoundTripper that adds additional request information\n\n```go\nfunc (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)\n```\nRoundTrip executes a single HTTP transaction, returning a Response for the provided Request.\n\n```go\nfunc (r *RoundTripper) UserAgent() string\n```\nUserAgent returns the user agent used by the State Tool\n\n```go\ntype Service string\n```\nService records available api services\n\n","path":"github.com/ActiveState/cli/pkg/platform/api","name":"api","synopsis":"","isRedistributable":true}
