forked from LaconicNetwork/kompose
* fix: support host port and protocol in functional tests * feat: add kompose client with options Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * test: add options unit tests Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * feat: add partial convert options Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * feat: finish convert process Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * test: finish unit tests of the kompose client Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * remove unecessary changes Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * feat: add generate network policies to client Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> * update go mod Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com> --------- Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
26 lines
428 B
Go
26 lines
428 B
Go
package client
|
|
|
|
// Opt is a configuration option to initialize a client
|
|
type Opt func(*Kompose) error
|
|
|
|
func WithSuppressWarnings() Opt {
|
|
return func(k *Kompose) error {
|
|
k.suppressWarnings = true
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func WithVerboseOutput() Opt {
|
|
return func(k *Kompose) error {
|
|
k.verbose = true
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func WithErrorOnWarning() Opt {
|
|
return func(k *Kompose) error {
|
|
k.errorOnWarning = true
|
|
return nil
|
|
}
|
|
}
|