Documentation
¶
Index ¶
- Constants
- func ErrorCode(err interface{}) int
- func ErrorCodeFromPayload(err interface{}) int
- func ErrorFromPayload(err error) error
- func ErrorFromPayloadTyped(err error) *rationalize.ErrAPI
- func ErrorMessageFromPayload(err error) string
- func GetPlatformURL(path string) *url.URL
- func GetServiceURL(service Service) *url.URL
- func NewHTTPClient() *http.Client
- func NewRoundTripper(transport http.RoundTripper) http.RoundTripper
- type RoundTripper
- type Service
Constants ¶
const ( // ServiceMono is our main service for api services, "Mono" refers to its monolithic nature, one that we're trying to get away from ServiceMono Service = "platform" // ServiceSecrets is our service that's used purely for setting and storing secrets ServiceSecrets = "secrets" // ServiceHeadChef is our service that's used to kick off and track builds ServiceHeadChef = "headchef" // ServiceHeadChefWS is the websocket service on headchef BuildLogStreamer = "buildlog-streamer" // ServiceInventory is our service that's used to query available inventory and dependencies ServiceInventory = "inventory" // ServiceGraphQL is our service that's used as a graphql endpoint for platform requests ServiceGraphQL = "platform-graphql" // ServiceMediator is our mediator service used to query build graph data ServiceMediator = "mediator" // ServiceRequirementsImport is our service that processes requirements.txt files. ServiceRequirementsImport = "requirements-import" // ServiceBuildPlanner is our service that processes build plans. ServiceBuildPlanner = "build-planner" // ServiceVulnerabilities is Data Acquisition's Hasura service for vulnerability (CVE) information. ServiceVulnerabilities = "vulnerabilities" // ServiceHasuraInventory is the Hasura service for inventory information. ServiceHasuraInventory = "hasura-inventory" // TestingPlatform is the API host used by tests so-as not to affect production. TestingPlatform = ".testing.tld" )
Variables ¶
This section is empty.
Functions ¶
func ErrorCode ¶
func ErrorCode(err interface{}) int
ErrorCode tries to retrieve the code associated with an API error
func ErrorCodeFromPayload ¶
func ErrorCodeFromPayload(err interface{}) int
ErrorCodeFromPayload tries to retrieve the code associated with an API error from a Message object referenced as a Payload.
func ErrorFromPayload ¶
func ErrorFromPayloadTyped ¶
func ErrorFromPayloadTyped(err error) *rationalize.ErrAPI
func ErrorMessageFromPayload ¶
ErrorMessageFromPayload tries to retrieve the code associated with an API error from a Message object referenced as a Payload.
func GetPlatformURL ¶
GetPlatformURL returns a generic Platform URL for the given path. This is for retrieving non-service URLs (e.g. signup URL).
func GetServiceURL ¶
GetServiceURL returns the URL for the given service
func NewHTTPClient ¶
NewHTTPClient creates a new HTTP client that will retry requests and add additional request information to the request headers
func NewRoundTripper ¶
func NewRoundTripper(transport http.RoundTripper) http.RoundTripper
NewRoundTripper creates a new instance of RoundTripper
Types ¶
type RoundTripper ¶
type RoundTripper struct {
// contains filtered or unexported fields
}
RoundTripper is an implementation of http.RoundTripper that adds additional request information
func (*RoundTripper) RoundTrip ¶
RoundTrip executes a single HTTP transaction, returning a Response for the provided Request.
func (*RoundTripper) UserAgent ¶
func (r *RoundTripper) UserAgent() string
UserAgent returns the user agent used by the State Tool