Documentation ¶
Index ¶
- Variables
- type Command
- type GenericAPIServer
- type OpenAPIDefinition
- type Server
- func (r *Server) Build(ctx context.Context) (*Command, error)
- func (r *Server) Execute(ctx context.Context) error
- func (r *Server) WithConfigFns(fns ...func(config *server.RecommendedConfig) *server.RecommendedConfig) *Server
- func (r *Server) WithEtcdPath(etcdPath string) *Server
- func (r *Server) WithFlagFns(fns ...func(set *pflag.FlagSet) *pflag.FlagSet) *Server
- func (a *Server) WithLocalDebugExtension(ctx context.Context) *Server
- func (r *Server) WithOpenAPIDefinitions(name, version string, defs openapicommon.GetOpenAPIDefinitions) *Server
- func (r *Server) WithOptionsFns(fns ...func(*ServerOptions) *ServerOptions) *Server
- func (a *Server) WithResource(ctx context.Context, obj resource.Object) *Server
- func (r *Server) WithResourceAndHandler(ctx context.Context, obj resource.Object, sp rest.ResourceHandlerProvider) *Server
- func (r *Server) WithServerFns(fns ...func(server *GenericAPIServer) *GenericAPIServer) *Server
- func (r *Server) WithServerName(serverName string) *Server
- func (r *Server) WithoutEtcd() *Server
- type ServerOptions
- type Storage
Constants ¶
This section is empty.
Variables ¶
var APIServer = &Server{ storageProvider: map[schema.GroupResource]*singletonProvider{}, }
APIServer builds an apiserver to server Kubernetes resources and sub resources.
Functions ¶
This section is empty.
Types ¶
type GenericAPIServer ¶
type GenericAPIServer = server.GenericAPIServer
GenericAPIServer is an alias for pkgserver.GenericAPIServer
type OpenAPIDefinition ¶
type OpenAPIDefinition = common.OpenAPIDefinition
OpenAPIDefinition is an alias for common.OpenAPIDefinition
type Server ¶
Server builds a new apiserver for a single API group
func (*Server) WithConfigFns ¶
func (r *Server) WithConfigFns(fns ...func(config *server.RecommendedConfig) *server.RecommendedConfig) *Server
WithConfigFns sets functions to customize the RecommendedConfig
func (*Server) WithEtcdPath ¶
func (*Server) WithFlagFns ¶
WithFlagFns sets functions to customize the flags for the compiled binary.
func (*Server) WithLocalDebugExtension ¶
WithLocalDebugExtension adds an optional local-debug mode to the apiserver so that it can be tested locally without involving a complete kubernetes cluster. A flag named "--standalone-debug-mode" will also be added the binary which forcily requires "--bind-address" to be "127.0.0.1" in order to avoid security issues.
func (*Server) WithOpenAPIDefinitions ¶
func (r *Server) WithOpenAPIDefinitions( name, version string, defs openapicommon.GetOpenAPIDefinitions) *Server
func (*Server) WithOptionsFns ¶
func (r *Server) WithOptionsFns(fns ...func(*ServerOptions) *ServerOptions) *Server
WithOptionsFns sets functions to customize the ServerOptions used to create the apiserver
func (*Server) WithResource ¶
WithResource registers the resource with the apiserver.
If no versions of this GroupResource have already been registered, a new default handler will be registered. If the object implements rest.Getter, rest.Updater or rest.Creator then the provided object itself will be used as the rest handler for the resource type.
If no versions of this GroupResource have already been registered and the object does NOT implement the rest interfaces, then a new etcd backed storage will be created for the object and used as the handler. The storage will use a DefaultStrategy, which delegates functions to the object if the object implements interfaces defined in the rest package. Otherwise it will provide a default behavior.
WithResource will automatically register the "status" subresource if the object implements the resource.StatusGetSetter interface.
WithResource will automatically register version-specific defaulting for this GroupVersionResource if the object implements the resource.Defaulter interface.
WithResource automatically adds the object and its list type to the known types. If the object also declares itself as the storage version, the object and its list type will be added as storage versions to the SchemeBuilder as well. The storage version is the version accepted by the handler.
If another version of the object's GroupResource has already been registered, then the resource will use the handler already registered for that version of the GroupResource. Objects for this version will be converted to the object version which the handler accepts before the handler is invoked.
func (*Server) WithResourceAndHandler ¶
func (r *Server) WithResourceAndHandler(ctx context.Context, obj resource.Object, sp rest.ResourceHandlerProvider) *Server
WithResourceAndHandler registers a request handler for the resource rather than the default etcd backed storage.
Note: WithResourceAndHandler should never be called after the GroupResource has already been registered with another version.
Note: WithResourceAndHandler will NOT register the "status" subresource for the resource object.
func (*Server) WithServerFns ¶
func (r *Server) WithServerFns(fns ...func(server *GenericAPIServer) *GenericAPIServer) *Server
WithServerFns sets functions to customize the GenericAPIServer
func (*Server) WithServerName ¶
func (*Server) WithoutEtcd ¶
WithoutEtcd removes etcd related settings from apiserver.
type ServerOptions ¶
type ServerOptions = apiserverbuilder.ServerOptions
ServerOptions is an alias for apiserverbuilder.ServerOptions
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
resourcerest
Package resourcerest defines interfaces for resource REST implementations.
|
Package resourcerest defines interfaces for resource REST implementations. |
resourcestrategy
Package resourcestrategy defines interfaces for customizing how resources are converted and stored.
|
Package resourcestrategy defines interfaces for customizing how resources are converted and stored. |