Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClientFactory = func(config *tls.Config) *http.Client { transport := http.DefaultTransport.(*http.Transport).Clone() transport.TLSClientConfig = config return &http.Client{ Transport: transport, } }
This is the default Client factory it returns a zero-value client.
Functions ¶
func GeneratorFactory ¶
func GeneratorFactory(factory HTTPClientFactory) generators.GeneratorFactory
GeneratorFactory is a function for creating per-reconciliation generators for the APIClientGenerator.
Types ¶
type APIClientGenerator ¶
type APIClientGenerator struct { ClientFactory HTTPClientFactory Client client.Reader logr.Logger }
APIClientGenerator generates from an API endpoint.
func NewGenerator ¶
func NewGenerator(l logr.Logger, c client.Reader, clientFactory HTTPClientFactory) *APIClientGenerator
NewGenerator creates and returns a new API client generator.
func (*APIClientGenerator) Generate ¶
func (g *APIClientGenerator) Generate(ctx context.Context, sg *templatesv1.GitOpsSetGenerator, gsg *templatesv1.GitOpsSet) ([]map[string]any, error)
Generate makes an HTTP request using the APIClient definition and returns the result converted to a slice of maps.
func (*APIClientGenerator) Interval ¶
func (g *APIClientGenerator) Interval(sg *templatesv1.GitOpsSetGenerator) time.Duration
Interval is an implementation of the Generator interface.
The APIClientGenerator requires to poll regularly as there's nothing to drive watches.
Click to show internal directories.
Click to hide internal directories.