service

package
v0.0.0-...-63fb21e Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASC  = "ASC"
	DESC = "DESC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Config   config.Configuration
	Username string
	DBPool   *pgxpool.Pool
	Log      logging.Writer
}

type DynDataService

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

func NewDynDataService

func NewDynDataService(ctx context.Context, repo dynDataRepo, schemaService *DynSchemaService, fieldService *DynFieldService, cfg config.Configuration) *DynDataService

func (*DynDataService) CreateObject

func (rls *DynDataService) CreateObject(obj map[string]any, dynTabName string) error

type DynFieldService

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

func NewDynFieldService

func NewDynFieldService(ctx context.Context, dfs dynFieldRepo, dss *DynSchemaService, cfg config.Configuration) *DynFieldService

func (*DynFieldService) AddFields

func (rls *DynFieldService) AddFields(newVars []entity.NewDynamicField) error

func (*DynFieldService) FetchFieldsByIDs

func (rls *DynFieldService) FetchFieldsByIDs(fieldIDs []string) ([]entity.DynamicField, error)

func (*DynFieldService) FetchVars

func (rls *DynFieldService) FetchVars(dynTabID string) ([]entity.DynamicField, error)

func (*DynFieldService) FetchVarsByName

func (rls *DynFieldService) FetchVarsByName(dynTabName string) ([]entity.DynamicField, error)

func (*DynFieldService) RemoveVars

func (rls *DynFieldService) RemoveVars(dynTabName string, fieldIDs []string) error

type DynSchemaService

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

func NewDynSchemaService

func NewDynSchemaService(ctx context.Context, dss dynSchemaRepo, cfg config.Configuration) *DynSchemaService

func (*DynSchemaService) AddFields

func (rls *DynSchemaService) AddFields(suffix string, fields []entity.DynamicField) error

func (*DynSchemaService) CreateSchemaTable

func (rls *DynSchemaService) CreateSchemaTable(suffix string, dynTab entity.DynamicTable, vars []entity.DynamicField) error

func (*DynSchemaService) DeleteFields

func (rls *DynSchemaService) DeleteFields(suffix, dynTabName string, fields []entity.DynamicField) error

type DynTabService

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

func NewDynTabService

func NewDynTabService(ctx context.Context, u dynTabRepo, cfg config.Configuration) *DynTabService

func (*DynTabService) CreateDynamicTables

func (rls *DynTabService) CreateDynamicTables(newEntities []entity.NewDynamicTable, dss *DynSchemaService) ([]entity.DynamicTable, error)

func (*DynTabService) FetchByPagination

func (rls *DynTabService) FetchByPagination(qp params.Pagination) ([]entity.DynamicTable, params.Pagination, error)

func (*DynTabService) FetchDynamicTables

func (rls *DynTabService) FetchDynamicTables(ids []string) ([]entity.DynamicTable, error)

type Pagination

type Pagination struct {
	Limit        int
	Filter       string
	Order        string
	WhereClauses []string
	// contains filtered or unexported fields
}

func NewPagination

func NewPagination(qp params.Pagination, tableName string) Pagination

func (*Pagination) FinishPagination

func (p *Pagination) FinishPagination(ids []string) ([]string, params.Pagination)

func (*Pagination) GetCursorSQL

func (p *Pagination) GetCursorSQL() string

type RunLogService

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

func NewRunLogService

func NewRunLogService(ctx context.Context, u runLogRepo, cfg config.Configuration) *RunLogService

func (*RunLogService) CreateRunLog

func (rls *RunLogService) CreateRunLog(u entity.NewRunLog) (*entity.RunLog, error)

func (*RunLogService) CreateRunLogs

func (rls *RunLogService) CreateRunLogs(newEntities []entity.NewRunLog) error

func (*RunLogService) FetchRunLog

func (rls *RunLogService) FetchRunLog(id string) (*entity.RunLog, error)

func (*RunLogService) FetchRunLogsByRun

func (rls *RunLogService) FetchRunLogsByRun(runID string) ([]entity.RunLog, error)

func (*RunLogService) Log

func (rls *RunLogService) Log(msg, runID string) error

type RunService

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

func NewRunService

func NewRunService(ctx context.Context, repo runRepo, userID string, cfg config.Configuration) *RunService

func (*RunService) CreateRun

func (ts *RunService) CreateRun(newEntity entity.NewRun, runLogService *RunLogService) error

func (*RunService) FetchByPagination

func (ts *RunService) FetchByPagination(qp params.Pagination) ([]*entity.Run, params.Pagination, error)

func (*RunService) FetchRunByRequestID

func (ts *RunService) FetchRunByRequestID(requestID string) (*entity.Run, error)

func (*RunService) FetchRunByWorkflow

func (ts *RunService) FetchRunByWorkflow(id string) ([]*entity.Run, error)

func (*RunService) FetchRuns

func (ts *RunService) FetchRuns(ids []string) ([]*entity.Run, error)

type TokenService

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

func NewTokenService

func NewTokenService(ctx context.Context, u tokenRepo, cfg config.Configuration) *TokenService

func (*TokenService) CreateToken

func (ts *TokenService) CreateToken(u entity.NewToken) (*entity.Token, error)

func (*TokenService) DeleteTokenByValue

func (ts *TokenService) DeleteTokenByValue(v string) error

func (*TokenService) ListTokens

func (ts *TokenService) ListTokens() ([]*entity.Token, error)

func (*TokenService) ListUserToken

func (ts *TokenService) ListUserToken(username string) ([]*entity.Token, error)

func (*TokenService) ReadToken

func (ts *TokenService) ReadToken(id string) (*entity.Token, error)

func (*TokenService) ReadTokenByValue

func (ts *TokenService) ReadTokenByValue(v string) (*entity.Token, error)

type UserService

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

func NewUserService

func NewUserService(ctx context.Context, u userRepo, cfg config.Configuration) *UserService

func (*UserService) CreateUser

func (us *UserService) CreateUser(u entity.NewUser) (*entity.User, error)

func (*UserService) DeleteUser

func (us *UserService) DeleteUser(id string) error

func (*UserService) EnsureAdmin

func (us *UserService) EnsureAdmin(password string) (string, error)

func (*UserService) FetchByPagination

func (us *UserService) FetchByPagination(qp params.Pagination) ([]*entity.User, params.Pagination, error)

func (*UserService) FetchUser

func (us *UserService) FetchUser(id string) (*entity.User, error)

func (*UserService) FetchUsers

func (us *UserService) FetchUsers(ids []string) ([]*entity.User, error)

func (*UserService) Login

func (us *UserService) Login(login entity.Login, ts *TokenService) (*entity.Token, error)

func (*UserService) ValidateToken

func (us *UserService) ValidateToken(token string, ts *TokenService) (*entity.User, error)

type WorkflowEngineService

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

func NewWorkflowEngineService

func NewWorkflowEngineService(ctx context.Context, cfg config.Configuration, objService *DynDataService) *WorkflowEngineService

func (*WorkflowEngineService) Execute

type WorkflowService

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

func NewWorkflowService

func NewWorkflowService(ctx context.Context, u workflowRepo, logger logging.Writer, cfg config.Configuration) *WorkflowService

func (*WorkflowService) CreateWorkflows

func (ws *WorkflowService) CreateWorkflows(newWorkflows []*entity.NewWorkflow) ([]entity.Workflow, error)

func (*WorkflowService) DeleteWorkflow

func (ws *WorkflowService) DeleteWorkflow(id string) error

func (*WorkflowService) Execute

func (ws *WorkflowService) Execute(workflowID string, workflowExecutionService *WorkflowEngineService, runService *RunService, runLogService *RunLogService) error

func (*WorkflowService) ExportToGit

func (ws *WorkflowService) ExportToGit(localPath, gitToken string) error

func (*WorkflowService) FetchByPagination

func (ws *WorkflowService) FetchByPagination(qp params.Pagination) ([]entity.Workflow, params.Pagination, error)

func (*WorkflowService) FetchWorkflows

func (ws *WorkflowService) FetchWorkflows(ids []string) ([]entity.Workflow, error)

func (*WorkflowService) ImportFromFiles

func (ws *WorkflowService) ImportFromFiles(localPath string) error

func (*WorkflowService) Update

func (ws *WorkflowService) Update(id string, updateEntity entity.UpdateWorkflow) (*entity.Workflow, error)

Jump to

Keyboard shortcuts

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