Files
certmanager/cmd/certmanagerctl/servicecli.go
Олег Бородин c7b9532377 certmanager updated
2024-08-06 18:33:12 +02:00

69 lines
1.6 KiB
Go

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
}