action

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	REST_ACTION          = "restapi"
	MYSQL_ACTION         = "mysql"
	MARIADB_ACTION       = "mariadb"
	TIDB_ACTION          = "tidb"
	TRANSFORMER_ACTION   = "transformer"
	POSTGRESQL_ACTION    = "postgresql"
	REDIS_ACTION         = "redis"
	MONGODB_ACTION       = "mongodb"
	ELASTICSEARCH_ACTION = "elasticsearch"
	S3_ACTION            = "s3"
	SMTP_ACTION          = "smtp"
	SUPABASEDB_ACTION    = "supabasedb"
	FIREBASE_ACTION      = "firebase"
	CLICKHOUSE_ACTION    = "clickhouse"
	GRAPHQL_ACTION       = "graphql"
	MSSQL_ACTION         = "mssql"
	HUGGINGFACE_ACTION   = "huggingface"
)

Functions

This section is empty.

Types

type AbstractActionFactory

type AbstractActionFactory interface {
	Build() common.DataConnector
}

type ActionDto

type ActionDto struct {
	ID          int                    `json:"actionId"`
	App         int                    `json:"-"`
	Version     int                    `json:"-"`
	Resource    int                    `json:"resourceId,omitempty"`
	DisplayName string                 `json:"displayName" validate:"required"`
	Type        string                 `` /* 177-byte string literal not displayed */
	Template    map[string]interface{} `json:"content" validate:"required"`
	Transformer map[string]interface{} `json:"transformer" validate:"required"`
	TriggerMode string                 `json:"triggerMode" validate:"oneof=manually automate"`
	CreatedAt   time.Time              `json:"createdAt,omitempty"`
	CreatedBy   int                    `json:"createdBy,omitempty"`
	UpdatedAt   time.Time              `json:"updatedAt,omitempty"`
	UpdatedBy   int                    `json:"updatedBy,omitempty"`
}

type ActionService

type ActionService interface {
	CreateAction(action ActionDto) (ActionDto, error)
	DeleteAction(id int) error
	UpdateAction(action ActionDto) (ActionDto, error)
	GetAction(id int) (ActionDto, error)
	FindActionsByAppVersion(app, version int) ([]ActionDto, error)
	RunAction(action ActionDto) (interface{}, error)
	ValidateActionOptions(actionType string, options map[string]interface{}) error
}

type ActionServiceImpl

type ActionServiceImpl struct {
	// contains filtered or unexported fields
}

func NewActionServiceImpl

func NewActionServiceImpl(logger *zap.SugaredLogger, appRepository repository.AppRepository,
	actionRepository repository.ActionRepository, resourceRepository repository.ResourceRepository) *ActionServiceImpl

func (*ActionServiceImpl) CreateAction

func (impl *ActionServiceImpl) CreateAction(action ActionDto) (ActionDto, error)

func (*ActionServiceImpl) DeleteAction

func (impl *ActionServiceImpl) DeleteAction(id int) error

func (*ActionServiceImpl) FindActionsByAppVersion

func (impl *ActionServiceImpl) FindActionsByAppVersion(app, version int) ([]ActionDto, error)

func (*ActionServiceImpl) GetAction

func (impl *ActionServiceImpl) GetAction(id int) (ActionDto, error)

func (*ActionServiceImpl) RunAction

func (impl *ActionServiceImpl) RunAction(action ActionDto) (interface{}, error)

func (*ActionServiceImpl) UpdateAction

func (impl *ActionServiceImpl) UpdateAction(action ActionDto) (ActionDto, error)

func (*ActionServiceImpl) ValidateActionOptions

func (impl *ActionServiceImpl) ValidateActionOptions(actionType string, options map[string]interface{}) error

type Factory

type Factory struct {
	Type string
}

func (*Factory) Build

func (f *Factory) Build() common.DataConnector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL