api

package
v0.42.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// OperationTypeKubernetesOpenAPIV2Doc is the operation type for the required OpenAPI v2 discovery document.
	//
	// This is required by the Kubernetes API Server.
	OperationTypeKubernetesOpenAPIV2Doc = "KUBERNETESOPENAPIV2DOC"

	// OperationTypeKubernetesOpenAPIV3Doc is the operation type for the required OpenAPI v3 discovery document.
	//
	// This is required by the Kubernetes API Server.
	OperationTypeKubernetesOpenAPIV3Doc = "KUBERNETESOPENAPIV3DOC"

	// OperationTypeKubernetesDiscoveryDoc is the operation type for the required Kubernetes API discovery document.
	OperationTypeKubernetesDiscoveryDoc = "KUBERNETESDISCOVERYDOC"

	// OperationTypePlanes is the operation type for the planes (all types) collection.
	OperationTypePlanes = "PLANES"
)

Variables

This section is empty.

Functions

func DefaultModules

func DefaultModules(options *ucp.Options) []modules.Initializer

DefaultModules returns a list of default modules that will be registered with the router.

func Register

func Register(ctx context.Context, router chi.Router, planeModules []modules.Initializer, options *ucp.Options) error

Register registers the routes for UCP including modules.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the hosting.Service interface for the UCP frontend API.

func NewService

func NewService(options *ucp.Options) *Service

NewService creates a server to serve UCP API requests.

func (*Service) Initialize

func (s *Service) Initialize(ctx context.Context) (*http.Server, error)

Initialize sets up the router, database provider, secret provider, status manager, AWS config, AWS clients, registers the routes, configures the default planes, and sets up the http server with the appropriate middleware. It returns an http server and an error if one occurs.

func (*Service) Name

func (s *Service) Name() string

Name gets this service name.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Run sets up a server to listen on a given address, and shuts it down when the context is done. It returns an error if the server fails to start or stops unexpectedly.

Jump to

Keyboard shortcuts

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