server

package
v0.0.0-...-eb30ed4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetObjectName

func GetObjectName(r *http.Request, d typeinfo.Descriptor) cache.ObjectName

func LaunchApp

func LaunchApp(ctx context.Context) (app mkapi.App, exitCode int)

LaunchApp is a helper function used to parse cli args, construct, and start the MinKAPI server, embed this inside an App representing the binary process along with an application context and application cancel func.

On success, returns an initialized App which holds the minkapi Server, the App Context (which has been setup for SIGINT and SIGTERM cancellation and holds a logger), and the Cancel func which callers are expected to defer in their main routines.

On error, it will log the error to standard error and return the exitCode that callers are expected to exit the process with.

func NewDefaultInMemory

func NewDefaultInMemory(log logr.Logger, cfg mkapi.Config) (mkapi.Server, error)

NewDefaultInMemory constructs a KAPI server with default implementations of sub-components.

func NewInMemoryUsingViews

func NewInMemoryUsingViews(cfg mkapi.Config, baseView mkapi.View, sandboxViewCreateFn mkapi.CreateSandboxViewFunc) (k mkapi.Server, err error)

NewInMemoryUsingViews constructs a KAPI server with the given base view and the sandbox view creation function.

func ShutdownApp

func ShutdownApp(app *mkapi.App) (exitCode int)

Types

type InMemoryKAPI

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

InMemoryKAPI holds the in-memory stores, watch channels, and version tracking for simple implementation of mkapi.APIServer

func (*InMemoryKAPI) GetBaseView

func (k *InMemoryKAPI) GetBaseView() mkapi.View

func (*InMemoryKAPI) GetSandboxView

func (k *InMemoryKAPI) GetSandboxView(log logr.Logger, name string) (mkapi.View, error)

func (*InMemoryKAPI) Start

func (k *InMemoryKAPI) Start(ctx context.Context) error

Start begins the MinKAPI server

func (*InMemoryKAPI) Stop

func (k *InMemoryKAPI) Stop(ctx context.Context) (err error)

Stop shuts down the HTTP server and closes the base view

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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