Documentation
¶
Index ¶
- Variables
- type AbstractResourceFactory
- type Factory
- type ResourceDto
- type ResourceService
- type ResourceServiceImpl
- func (impl *ResourceServiceImpl) CreateResource(resource ResourceDto) (ResourceDto, error)
- func (impl *ResourceServiceImpl) DeleteResource(id int) error
- func (impl *ResourceServiceImpl) FindAllResources() ([]ResourceDto, error)
- func (impl *ResourceServiceImpl) GetMetaInfo(id int) (map[string]interface{}, error)
- func (impl *ResourceServiceImpl) GetResource(id int) (ResourceDto, error)
- func (impl *ResourceServiceImpl) TestConnection(resource ResourceDto) (bool, error)
- func (impl *ResourceServiceImpl) UpdateResource(resource ResourceDto) (ResourceDto, error)
- func (impl *ResourceServiceImpl) ValidateResourceOptions(resourceType string, options map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( REST_RESOURCE = "restapi" MYSQL_RESOURCE = "mysql" MARIADB_RESOURCE = "mariadb" TIDB_RESOURCE = "tidb" POSTGRES_RESOURCE = "postgresql" REDIS_RESOURCE = "redis" MONGODB_RESOURCE = "mongodb" ELASTICSEARCH_RESOURCE = "elasticsearch" S3_RESOURCE = "s3" SMTP_RESOURCE = "smtp" SUPABASEDB_RESOURCE = "supabasedb" FIREBASE_RESOURCE = "firebase" CLICKHOUSE_RESOURCE = "clickhouse" GRAPHQL_RESOURCE = "graphql" )
Functions ¶
This section is empty.
Types ¶
type AbstractResourceFactory ¶
type AbstractResourceFactory interface {
Build() common.DataConnector
}
type Factory ¶
type Factory struct {
Type string
}
func (*Factory) Generate ¶
func (f *Factory) Generate() common.DataConnector
type ResourceDto ¶
type ResourceDto struct {
ID int `json:"resourceId"`
Name string `json:"resourceName" validate:"required"`
Type string `` /* 149-byte string literal not displayed */
Options map[string]interface{} `json:"content" validate:"required"`
CreatedAt time.Time `json:"createdAt,omitempty"`
CreatedBy int `json:"createdBy,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
UpdatedBy int `json:"updatedBy,omitempty"`
}
func (*ResourceDto) ConstructByMap ¶
func (resourced *ResourceDto) ConstructByMap(data interface{})
type ResourceService ¶
type ResourceService interface {
CreateResource(resource ResourceDto) (ResourceDto, error)
DeleteResource(id int) error
UpdateResource(resource ResourceDto) (ResourceDto, error)
GetResource(id int) (ResourceDto, error)
FindAllResources() ([]ResourceDto, error)
TestConnection(resource ResourceDto) (bool, error)
ValidateResourceOptions(resourceType string, options map[string]interface{}) error
GetMetaInfo(id int) (map[string]interface{}, error)
}
type ResourceServiceImpl ¶
type ResourceServiceImpl struct {
// contains filtered or unexported fields
}
func NewResourceServiceImpl ¶
func NewResourceServiceImpl(logger *zap.SugaredLogger, resourceRepository repository.ResourceRepository) *ResourceServiceImpl
func (*ResourceServiceImpl) CreateResource ¶
func (impl *ResourceServiceImpl) CreateResource(resource ResourceDto) (ResourceDto, error)
func (*ResourceServiceImpl) DeleteResource ¶
func (impl *ResourceServiceImpl) DeleteResource(id int) error
func (*ResourceServiceImpl) FindAllResources ¶
func (impl *ResourceServiceImpl) FindAllResources() ([]ResourceDto, error)
func (*ResourceServiceImpl) GetMetaInfo ¶
func (impl *ResourceServiceImpl) GetMetaInfo(id int) (map[string]interface{}, error)
func (*ResourceServiceImpl) GetResource ¶
func (impl *ResourceServiceImpl) GetResource(id int) (ResourceDto, error)
func (*ResourceServiceImpl) TestConnection ¶
func (impl *ResourceServiceImpl) TestConnection(resource ResourceDto) (bool, error)
func (*ResourceServiceImpl) UpdateResource ¶
func (impl *ResourceServiceImpl) UpdateResource(resource ResourceDto) (ResourceDto, error)
func (*ResourceServiceImpl) ValidateResourceOptions ¶
func (impl *ResourceServiceImpl) ValidateResourceOptions(resourceType string, options map[string]interface{}) error
Click to show internal directories.
Click to hide internal directories.