api

package
v0.35.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 37 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"
)
View Source
const (
	DefaultPlanesConfig = "DEFAULT_PLANES_CONFIG"
)

Variables

This section is empty.

Functions

func DefaultModules

func DefaultModules(options modules.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 modules.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 ServiceOptions) *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, storage 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.

type ServiceOptions

type ServiceOptions struct {
	// Config is the bootstrap configuration loaded from config file.
	Config *hostoptions.UCPConfig

	ProviderName            string
	Address                 string
	PathBase                string
	Configure               func(chi.Router)
	TLSCertDir              string
	DefaultPlanesConfigFile string
	StorageProviderOptions  dataprovider.StorageProviderOptions
	SecretProviderOptions   secretprovider.SecretProviderOptions
	QueueProviderOptions    queueprovider.QueueProviderOptions
	InitialPlanes           []rest.Plane
	Identity                hostoptions.Identity
	UCPConnection           sdk.Connection
	Location                string

	// Modules is a list of modules that will be registered with the router.
	Modules []modules.Initializer
}

Jump to

Keyboard shortcuts

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