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>
22 lines
360 B
Go
22 lines
360 B
Go
package client
|
|
|
|
type Kompose struct {
|
|
suppressWarnings bool
|
|
verbose bool
|
|
errorOnWarning bool
|
|
}
|
|
|
|
func NewClient(opts ...Opt) (*Kompose, error) {
|
|
k := &Kompose{
|
|
suppressWarnings: false,
|
|
verbose: false,
|
|
errorOnWarning: false,
|
|
}
|
|
for _, op := range opts {
|
|
if err := op(k); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return k, nil
|
|
}
|