Documentation
¶
Index ¶
- func GetObjectName(r *http.Request, d typeinfo.Descriptor) cache.ObjectName
- func LaunchApp(ctx context.Context) (app mkapi.App, exitCode int)
- func NewDefaultInMemory(log logr.Logger, cfg mkapi.Config) (mkapi.Server, error)
- func NewInMemoryUsingViews(cfg mkapi.Config, baseView mkapi.View, ...) (k mkapi.Server, err error)
- func ShutdownApp(app *mkapi.App) (exitCode int)
- type InMemoryKAPI
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 ¶
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 ¶
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 ¶
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