Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithClusterScope ¶
func WithClusterScope(apiHandler http.Handler) http.HandlerFunc
func WithWildcardListWatchGuard ¶
func WithWildcardListWatchGuard(apiHandler http.Handler) http.HandlerFunc
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server manages the configuration and kcp api-server. It allows callers to easily use kcp as a library rather than as a single binary. Using its constructor function, you can easily setup a new api-server and start it:
srv := server.NewServer(server.DefaultConfig()) srv.Run(ctx)
You may optionally provide PostStartHookFunc and PreShutdownHookFunc hooks before starting the server that should be passed to the api-server itself. These hooks have access to a restclient.Config which allows you to easily create a client.
srv.AddPostStartHook("my-hook", func(context genericapiserver.PostStartHookContext) error {
client := clientset.NewForConfigOrDie(context.LoopbackClientConfig)
})
func NewServer ¶
func NewServer(o *kcpserveroptions.CompletedOptions) (*Server, error)
NewServer creates a new instance of Server which manages the KCP api-server.
func (*Server) AddPostStartHook ¶
func (s *Server) AddPostStartHook(name string, hook genericapiserver.PostStartHookFunc)
AddPostStartHook allows you to add a PostStartHook that gets passed to the underlying genericapiserver implementation.
func (*Server) AddPreShutdownHook ¶
func (s *Server) AddPreShutdownHook(name string, hook genericapiserver.PreShutdownHookFunc)
AddPreShutdownHook allows you to add a PreShutdownHookFunc that gets passed to the underlying genericapiserver implementation.