Documentation ¶
Index ¶
- func NewDynamicTemplateReader(client dynamic.Interface, obj *Object) templater.TemplateReader
- func NewDynamicTemplateWriter(client dynamic.Interface, obj *Object, base map[string]interface{}) templater.TemplateWriter
- type Object
- type TemplateReader
- func (r *TemplateReader) Read() (map[string]interface{}, error)
- func (r *TemplateReader) ReadStream(on templater.OnDataStream, stopCh <-chan struct{}) error
- func (r *TemplateReader) RegisterQuery(query *templater.TemplateReaderQuery) error
- func (r *TemplateReader) ValuesFromTarget() (map[string]interface{}, error)
- type TemplateWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDynamicTemplateReader ¶
func NewDynamicTemplateReader(client dynamic.Interface, obj *Object) templater.TemplateReader
NewDynamicTemplateReader creates a new DynamicTemplateReader
func NewDynamicTemplateWriter ¶
func NewDynamicTemplateWriter( client dynamic.Interface, obj *Object, base map[string]interface{}, ) templater.TemplateWriter
NewDynamicTemplateWriter returns a dynamic TemplateWriter
Types ¶
type Object ¶
type Object struct { Group string Version string Resource string // Optional, if resource is namespacable Namespace string // Optional, if attempting to get an object by name Name string }
Object identifies a set of k8s objects, during Group-Version-Kind, and optionally a namespace and name to isolate a single object
type TemplateReader ¶
type TemplateReader struct { // The object to read from, identified by its group-version-kind Object *Object // The set of queries to execute, identified by a key and query string Queries []*templater.TemplateReaderQuery Client dynamic.Interface // contains filtered or unexported fields }
TemplateReader reads any resource registered with the k8s apiserver
func (*TemplateReader) Read ¶
func (r *TemplateReader) Read() (map[string]interface{}, error)
Read returns the resulting queried data
func (*TemplateReader) ReadStream ¶
func (r *TemplateReader) ReadStream( on templater.OnDataStream, stopCh <-chan struct{}, ) error
ReadStream listens for CRUD operations on resources and returns resulting queried data
func (*TemplateReader) RegisterQuery ¶
func (r *TemplateReader) RegisterQuery(query *templater.TemplateReaderQuery) error
RegisterQuery adds a query to the list of queries to execute
func (*TemplateReader) ValuesFromTarget ¶
func (r *TemplateReader) ValuesFromTarget() (map[string]interface{}, error)
ValuesFromTarget retrieves cluster values from the k8s apiserver
type TemplateWriter ¶
type TemplateWriter struct { // The object to read from, identified by its group-version-kind Object *Object Client dynamic.Interface // contains filtered or unexported fields }
TemplateWriter satisfies the templater.TemplateWriter interface by creating/updating dynamic k8s resources
func (*TemplateWriter) Create ¶
func (w *TemplateWriter) Create(vals map[string]interface{}) (map[string]interface{}, error)
Create creates a new dynamic resource, this must be registered with the API server
func (*TemplateWriter) Transform ¶
func (w *TemplateWriter) Transform() error
Transform merges base configuration with vals