api

package
v0.0.0-...-ca3d767 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: BSD-3-Clause Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"

	// ServiceUpdateInfo is the service for update info
	ServiceUpdateInfo = "update-info"

	// 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 HostOverride

func HostOverride() string

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

func SetConfig

func SetConfig(cfg *config.Instance)

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