package resources

import "github.com/purpleidea/mgmt/etcd/client/resources"

Index

Functions

func GetResources

func GetResources(ctx context.Context, client interfaces.Client, hostnameFilter, kindFilter []string) ([]engine.Res, error)

GetResources collects all of the resources which match a filter from etcd. If the kindfilter or hostnameFilter is empty, then it assumes no filtering... TODO: Expand this with a more powerful filter based on what we eventually support in our collect DSL. Ideally a server side filter like WithFilter() could do this if the pattern was $NS/exported/$kind/$hostname/$uid = $data.

func SetResources

func SetResources(ctx context.Context, client interfaces.Client, hostname string, resourceList []engine.Res) error

SetResources exports all of the resources which we pass in to etcd.

func WatchResources

func WatchResources(ctx context.Context, client interfaces.Client) (chan error, error)

WatchResources returns a channel that outputs events when exported resources change. TODO: Filter our watch (on the server side if possible) based on the collection prefixes and filters that we care about...

Source Files

resources.go

Version
v0.0.0-20250322185616-c50a578426f1 (latest)
Published
Mar 22, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
4 days ago

Tools for package owners.