Documentation ¶
Index ¶
- func APIModuleVersions() map[string]string
- func FindTypesOf[T any]() []T
- func IterTypes(fn func(apiGroup, typename string, t any) (cont bool))
- func RegisterType(apiGroup string, t interface{}, opts ...ResolveOption)
- func Resolve(apiVersion string, typename string) (interface{}, error)
- type ResolveOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIModuleVersions ¶
APIModuleVersions returns a map of Sensu API modules that are compiled into the product.
func FindTypesOf ¶ added in v0.2.0
func FindTypesOf[T any]() []T
FindTypesOf finds resources that match a particular interface.
func IterTypes ¶ added in v0.2.0
IterTypes iterates a copy of the typemap, calling fn for each type, with the API group, type name, and type.
func RegisterType ¶
func RegisterType(apiGroup string, t interface{}, opts ...ResolveOption)
RegisterType allows modules to register API types to be resolved.
Types ¶
type ResolveOption ¶
type ResolveOption interface {
// contains filtered or unexported methods
}
ResolveOption a customization on how types are resolved
func WithAlias ¶
func WithAlias(alias ...string) ResolveOption
WithAlias Option allows a type to be resolved by names other than its type name
func WithResolveHook ¶
func WithResolveHook(fn func(interface{})) ResolveOption
WithResolveHook allows modules to preform initalization on resolved types
Click to show internal directories.
Click to hide internal directories.