feat(go-traefik-certmanager): initial commit
This commit is contained in:
parent
913eaceaa4
commit
c10b760c0b
14 changed files with 835 additions and 0 deletions
37
pkg/ingressroute/client.go
Normal file
37
pkg/ingressroute/client.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue