api

package
v0.0.0-...-7426b64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
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 ErrorFromPayload(err error) error

func ErrorFromPayloadTyped

func ErrorFromPayloadTyped(err error) *rationalize.ErrAPI

func ErrorMessageFromPayload

func ErrorMessageFromPayload(err error) string

ErrorMessageFromPayload tries to retrieve the code associated with an API error from a Message object referenced as a Payload.

func GetPlatformURL

func GetPlatformURL(path string) *url.URL

GetPlatformURL returns a generic Platform URL for the given path. This is for retrieving non-service URLs (e.g. signup URL).

func GetServiceURL

func GetServiceURL(service Service) *url.URL

GetServiceURL returns the URL for the given service

func NewHTTPClient

func NewHTTPClient() *http.Client

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

func (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

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

type Service

type Service string

Service records available api services

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL