feat(go-traefik-certmanager): initial commit

This commit is contained in:
Tom Neuber 2025-01-21 21:29:51 +01:00
parent 913eaceaa4
commit c10b760c0b
Signed by: tom
GPG key ID: F17EFE4272D89FF6
14 changed files with 835 additions and 0 deletions

View file

@ -0,0 +1,37 @@
package ingressroute
import (
"git.ar21.de/yolokube/go-traefik-certmanager/pkg/certmanager"
"k8s.io/client-go/dynamic"
)
type Client struct {
crdClient dynamic.DynamicClient
certmanager *certmanager.Client
certCleanup bool
IngressRoutes ingressRouteClient
}
type ClientOption func(*Client)
func WithCertCleanup() ClientOption {
return func(c *Client) {
c.certCleanup = true
}
}
func NewClient(crdClient dynamic.DynamicClient, cmClient *certmanager.Client, options ...ClientOption) *Client {
client := &Client{
crdClient: crdClient,
certmanager: cmClient,
}
for _, option := range options {
option(client)
}
client.IngressRoutes = ingressRouteClient{client: client}
return client
}