func New(options ...Option) *Operator {
	op := &Operator{
		updates:        make(chan Resource),
		retries:        make(chan string),
		stop:           make(chan struct{}),
		retrySchedules: make(map[string]retrySchedule),
	}
	for _, option := range options {
		option(op)
	}
	if op.resource.Resource == "" {
		panic("skop: no resource configured")
	}
	if op.config == nil {
		panic("skop: no config configured")
	}
	if op.reconciler == nil {
		panic("skop: no reconciler configured")
	}
	if op.logger == nil {
		op.logger = log.NewLogfmtLogger(log.StdlibWriter{})
	}
	return op
}
// New constructs a new operator with the provided options.
New constructs a new operator with the provided options.
// New constructs a new operator with the provided options .
func New(options ...Option) *Operator {
	op := &Operator{
		updates:        make(chan Resource),
		retries:        make(chan string),
		stop:           make(chan struct{}),
		retrySchedules: make(map[string]retrySchedule),
	}
	for _, option := range options {
		option(op)
	}
	if op.resource.Resource == "" {
		panic("skop: no resource configured")
	}
	if op.config == nil {
		panic("skop: no config configured")
	}
	if op.reconciler == nil {
		panic("skop: no reconciler configured")
	}
	if op.logger == nil {
		op.logger = log.NewLogfmtLogger(log.StdlibWriter{})
	}
	return op
}
func New ( options ... Option ) * Operator { op := & Operator { updates : make ( chan Resource ) , retries : make ( chan string ) , stop : make ( chan struct { } ) , retrySchedules : make ( map [ string ] retrySchedule ) , } for _ , option := range options { option ( op ) } if op . resource . Resource == " " { panic ( " " ) } if op . config == nil { panic ( " " ) } if op . reconciler == nil { panic ( " " ) } if op . logger == nil { op . logger = log . NewLogfmtLogger ( log . StdlibWriter { } ) } return op }
New constructs a new operator with the provided options.
New constructs a new operator with the provided options .