func (s *configService) Create(tx interface{}, namespace string, config *specV1.Configuration) (*specV1.Configuration, error) {
	return s.config.CreateConfig(tx, namespace, config)
}
Create Create a config
package service
import (
	"strings"
	"time"
	specV1 "github.com/baetyl/baetyl-go/v2/spec/v1"
	"github.com/baetyl/baetyl-cloud/v2/common"
	"github.com/baetyl/baetyl-cloud/v2/config"
	"github.com/baetyl/baetyl-cloud/v2/models"
	"github.com/baetyl/baetyl-cloud/v2/plugin"
)
type ConfigService interface {
	Get(namespace, name, version string) (*specV1.Configuration, error)
	List(namespace string, listOptions *models.ListOptions) (*models.ConfigurationList, error)
	Create(tx interface{}, namespace string, config *specV1.Configuration) (*specV1.Configuration, error)
	Update(tx interface{}, namespace string, config *specV1.Configuration) (*specV1.Configuration, error)
	Upsert(tx interface{}, namespace string, config *specV1.Configuration) (*specV1.Configuration, error)
	Delete(tx interface{}, namespace, name string) error
}
type configService struct {
	config plugin.Configuration
}
func NewConfigService(config *config.CloudConfig) (ConfigService, error) {
	cfg, err := plugin.GetPlugin(config.Plugin.Resource)
	if err != nil {
		return nil, err
	}
	return &configService{
		config: cfg.(plugin.Configuration),
	}, nil
}
func (s *configService) Get(namespace, name, version string) (*specV1.Configuration, error) {
	res, err := s.config.GetConfig(nil, namespace, name, version)
	if err != nil && strings.Contains(err.Error(), "not found") {
		return nil, common.Error(common.ErrResourceNotFound, common.Field("type", "config"),
			common.Field("name", name))
	}
	return res, err
}
func (s *configService) List(namespace string, listOptions *models.ListOptions) (*models.ConfigurationList, error) {
	return s.config.ListConfig(namespace, listOptions)
}