Documentation
¶
Index ¶
- Variables
- func GetClientManager(ctx context.Context) (context.Context, *kclient.Manager)
- func GetConfigOrDie(ctx context.Context) (context.Context, *rest.Config)
- func GetLoggingConfig(ctx context.Context) (*logging.Config, error)
- func SetupLoggerOrDie(ctx context.Context, component string) (*zap.SugaredLogger, zap.AtomicLevel)
- func WatchLoggingConfigOrDie(ctx context.Context, cmw *cminformer.InformedWatcher, ...)
- func WithScheme(scheme *runtime.Scheme) ctrlcluster.Option
- type AddToRestContainer
- type AppBuilder
- func (a *AppBuilder) APIDocs() *AppBuilder
- func (a *AppBuilder) Container(container *restful.Container) *AppBuilder
- func (a *AppBuilder) Controllers(ctors ...controllers.SetupChecker) *AppBuilder
- func (a *AppBuilder) Filters(filters ...restful.FilterFunction) *AppBuilder
- func (a *AppBuilder) Log() *AppBuilder
- func (a *AppBuilder) MultiClusterClient(client multicluster.Interface) *AppBuilder
- func (a *AppBuilder) Plugins(plugins ...client.Interface) *AppBuilder
- func (a *AppBuilder) Profiling() *AppBuilder
- func (a *AppBuilder) RESTClient(client *resty.Client) *AppBuilder
- func (a *AppBuilder) Run() error
- func (a *AppBuilder) Scheme(scheme *runtime.Scheme) *AppBuilder
- func (a *AppBuilder) Tracing(cfg *config.Config) *AppBuilder
- func (a *AppBuilder) Webhooks(objs ...runtime.Object) *AppBuilder
- func (a *AppBuilder) Webservices(webServices ...WebService) *AppBuilder
- type Controller
- type WebService
- type WebhookRegisterSetup
- type WebhookSetup
Constants ¶
This section is empty.
Variables ¶
var ( DefaultTimeout = kclient.DefaultTimeout DefaultQPS = kclient.DefaultQPS DefaultBurst = kclient.DefaultBurst )
Functions ¶
func GetClientManager ¶
func SetupLoggerOrDie ¶
func SetupLoggerOrDie(ctx context.Context, component string) (*zap.SugaredLogger, zap.AtomicLevel)
SetupLoggerOrDie sets up the logger using the config from the given context and returns a logger and atomic level, or dies by calling log.Fatalf.
func WatchLoggingConfigOrDie ¶
func WatchLoggingConfigOrDie(ctx context.Context, cmw *cminformer.InformedWatcher, logger *zap.SugaredLogger, lvlMGR *klogging.LevelManager)
WatchLoggingConfigOrDie establishes a watch of the logging config or dies by calling log.Fatalw. Note, if the config does not exist, it will be defaulted and this method will not die.
func WithScheme ¶
func WithScheme(scheme *runtime.Scheme) ctrlcluster.Option
WithScheme adds a scheme to cluster.Options
Types ¶
type AddToRestContainer ¶
type AddToRestContainer func(ws *restful.WebService)
type AppBuilder ¶
type AppBuilder struct {
// Basic options
Name string
Context context.Context
Config *rest.Config
sync.Once
// Log related options
Logger *zap.SugaredLogger
ZapConfig *zap.Config
LevelManager *klogging.LevelManager
//Controllers
Manager ctrl.Manager
// ConfigWatch
ConfigMapWatcher *cminformer.InformedWatcher
// Profiling
ProfilingServer *http.Server
// client manager
ClientManager *kclient.Manager
// contains filtered or unexported fields
}
AppBuilder builds an app using multiple configuration options
func (*AppBuilder) APIDocs ¶
func (a *AppBuilder) APIDocs() *AppBuilder
APIDocs adds api docs to the server
func (*AppBuilder) Container ¶
func (a *AppBuilder) Container(container *restful.Container) *AppBuilder
Container adds a containers
func (*AppBuilder) Controllers ¶
func (a *AppBuilder) Controllers(ctors ...controllers.SetupChecker) *AppBuilder
Controllers adds controllers to the app, will start a manager under the hood
func (*AppBuilder) Filters ¶
func (a *AppBuilder) Filters(filters ...restful.FilterFunction) *AppBuilder
Filters customize filters to this app
func (*AppBuilder) Log ¶
func (a *AppBuilder) Log() *AppBuilder
Log adds logging and logger to the app
func (*AppBuilder) MultiClusterClient ¶
func (a *AppBuilder) MultiClusterClient(client multicluster.Interface) *AppBuilder
MultiClusterClient injects a multi cluster client into the context
func (*AppBuilder) Plugins ¶
func (a *AppBuilder) Plugins(plugins ...client.Interface) *AppBuilder
Plugins adds plugins to this app
func (*AppBuilder) Profiling ¶
func (a *AppBuilder) Profiling() *AppBuilder
Profiling enables profiling http server
func (*AppBuilder) RESTClient ¶
func (a *AppBuilder) RESTClient(client *resty.Client) *AppBuilder
RESTClient injects a RESTClient
func (*AppBuilder) Scheme ¶
func (a *AppBuilder) Scheme(scheme *runtime.Scheme) *AppBuilder
Scheme provides a scheme to the app
func (*AppBuilder) Tracing ¶
func (a *AppBuilder) Tracing(cfg *config.Config) *AppBuilder
Tracing adds tracing capabilities to this app TODO: change this configuration to use a configmap watcher and turn on/off on the fly
func (*AppBuilder) Webhooks ¶
func (a *AppBuilder) Webhooks(objs ...runtime.Object) *AppBuilder
Webhooks adds webhook setup for objects in app
func (*AppBuilder) Webservices ¶
func (a *AppBuilder) Webservices(webServices ...WebService) *AppBuilder
type Controller ¶
type Controller interface {
Name() string
Setup(context.Context, manager.Manager, *zap.SugaredLogger) error
}
Controller is a basic interface that every reconciler should implement to create a new controller and startup in the controller manager
type WebService ¶
type WebService interface {
Name() string
Setup(ctx context.Context, add AddToRestContainer, logger *zap.SugaredLogger) error
}
type WebhookRegisterSetup ¶
type WebhookRegisterSetup interface {
GetLoggerName() string
SetupRegisterWithManager(context.Context, ctrl.Manager)
}
WebhookRegisterSetup method to inject and setup webhook register using the object
type WebhookSetup ¶
WebhookSetup method to inject and setup webhooks using the object