certmanager updated
This commit is contained in:
68
cmd/certmanagerctl/servicecli.go
Normal file
68
cmd/certmanagerctl/servicecli.go
Normal file
@@ -0,0 +1,68 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
cmapi "certmanager/api/certmanagercontrol"
|
||||
"certmanager/pkg/client"
|
||||
)
|
||||
|
||||
func (util *Util) CreateServicePair(ctx context.Context) (*cmapi.CreateServicePairResult, error) {
|
||||
var err error
|
||||
res := &cmapi.CreateServicePairResult{}
|
||||
cli, err := client.NewClient(&util.access)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
params := &cmapi.CreateServicePairParams{}
|
||||
res, err = cli.CreateServicePair(ctx, params)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (util *Util) RevokeServicePair(ctx context.Context) (*cmapi.RevokeServicePairResult, error) {
|
||||
var err error
|
||||
res := &cmapi.RevokeServicePairResult{}
|
||||
cli, err := client.NewClient(&util.access)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
params := &cmapi.RevokeServicePairParams{}
|
||||
res, err = cli.RevokeServicePair(ctx, params)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (util *Util) ListServicePairs(ctx context.Context) (*cmapi.ListServicePairsResult, error) {
|
||||
var err error
|
||||
res := &cmapi.ListServicePairsResult{}
|
||||
cli, err := client.NewClient(&util.access)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
params := &cmapi.ListServicePairsParams{}
|
||||
res, err = cli.ListServicePairs(ctx, params)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (util *Util) GetServicePair(ctx context.Context) (*cmapi.GetServicePairResult, error) {
|
||||
var err error
|
||||
res := &cmapi.GetServicePairResult{}
|
||||
cli, err := client.NewClient(&util.access)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
params := &cmapi.GetServicePairParams{}
|
||||
res, err = cli.GetServicePair(ctx, params)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
Reference in New Issue
Block a user