Documentation
¶
Overview ¶
Package customresources lets hand-written code override the resource implementation produced by the auto-generated `*_resource_gen.go` files without modifying those generated files (which would be lost on the next `make resources` run).
Usage:
- Auto-generated code in `internal/byteplus/.../foo_resource_gen.go` registers itself as usual via `registry.AddResourceFactory("foo", fooResource)`.
- A hand-written file in the same package, e.g. `foo_resource.go`, calls `customresources.Register("foo", wrapFoo)` from its `init()` function.
- The provider's `Resources()` method consults this registry and replaces the auto-generated resource with the wrapped one.
The wrapper receives the inner (auto-generated) resource so it can delegate most of the framework lifecycle while customizing only the parts it needs (typically Create or Read).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.