Documentation ¶
Index ¶
- Variables
- func NewCachedOVirtClient(name string) *cachedOVirtClient
- func NewClientService(cfg *rest.Config, watchedCreds SecretsToWatch) *clientService
- type CachedOVirtClient
- type ClientService
- type CreateOVirtClientFunc
- type CredentialUpdatable
- type Credentials
- type KLogr
- func (g *KLogr) Debugf(format string, args ...interface{})
- func (g *KLogr) Errorf(format string, args ...interface{})
- func (g *KLogr) Infof(format string, args ...interface{})
- func (g *KLogr) Warningf(format string, args ...interface{})
- func (g *KLogr) WithContext(ctx context.Context) ovirtclientlog.Logger
- func (g *KLogr) WithVDebug(level int) *KLogr
- func (g *KLogr) WithVInfo(level int) *KLogr
- func (g *KLogr) WithVWarning(level int) *KLogr
- type SecretsToWatch
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateNewOVirtClient = func(creds *Credentials, logger *KLogr) (ovirtclient.Client, error) { if creds == nil { return nil, fmt.Errorf("credentials are emtpy") } tls := ovirtclient.TLS() if creds.Insecure { tls.Insecure() } else { if creds.CAFile != "" { tls.CACertsFromFile(creds.CAFile) } if creds.CABundle != "" { tls.CACertsFromMemory([]byte(creds.CABundle)) } tls.CACertsFromSystem() } return ovirtclient.NewWithVerify( creds.URL, creds.Username, creds.Password, tls, logger, nil, nil, ) }
Functions ¶
func NewCachedOVirtClient ¶
func NewCachedOVirtClient(name string) *cachedOVirtClient
func NewClientService ¶
func NewClientService( cfg *rest.Config, watchedCreds SecretsToWatch, ) *clientService
Types ¶
type CachedOVirtClient ¶
type CachedOVirtClient interface { Get() (ovirtclient.Client, error) WithCreateFunc(CreateOVirtClientFunc) }
type ClientService ¶
type ClientService interface { Run(context.Context) Shutdown(timeout time.Duration) NewCachedClient(name string) CachedOVirtClient AddListener(CredentialUpdatable) ClientService AddListeners(updatables ...CredentialUpdatable) ClientService }
type CreateOVirtClientFunc ¶
type CreateOVirtClientFunc func(creds *Credentials, logger *KLogr) (ovirtclient.Client, error)
type CredentialUpdatable ¶
type CredentialUpdatable interface {
SetCredentials(*Credentials)
}
type Credentials ¶
type Credentials struct { URL string Username string Password string CAFile string Insecure bool CABundle string }
func FromK8sSecret ¶
func FromK8sSecret(secret *apicorev1.Secret) (*Credentials, error)
type KLogr ¶
func (*KLogr) WithContext ¶
func (g *KLogr) WithContext(ctx context.Context) ovirtclientlog.Logger
func (*KLogr) WithVDebug ¶
func (*KLogr) WithVWarning ¶
type SecretsToWatch ¶
Click to show internal directories.
Click to hide internal directories.