Documentation
¶
Overview ¶
Package usecase provides business logic.
Package usecase provides business logic.
Package usecase provides business logic.
Package usecase provides business logic.
Package usecase provides business logic.
Package usecase provides business logic.
Package usecase provides business logic.
Index ¶
- func SetWorkspaceUseCase(uc *WorkspaceUseCase)
- type GUIConfigRepo
- type GUIConfigUseCase
- type GrpcClient
- type GrpcUseCase
- type WorkspaceRepo
- type WorkspaceUseCase
- func (uc *WorkspaceUseCase) CreateFolder(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) CreateServer(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) Delete(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) DeleteFolder(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) Expand(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) Get(payload interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) GetBreadcrumb(id int64) ([]string, error)
- func (uc *WorkspaceUseCase) GetState() *entity.GUIResponse
- func (uc *WorkspaceUseCase) Sorting(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) UpdateFolder(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) UpdateQuery(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) UpdateServer(payload map[string]interface{}) *entity.GUIResponse
- func (uc *WorkspaceUseCase) UpdateServerRequest(payload map[string]interface{}) *entity.GUIResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetWorkspaceUseCase ¶
func SetWorkspaceUseCase(uc *WorkspaceUseCase)
SetWorkspaceUseCase sets WorkspaceUseCase instance
Types ¶
type GUIConfigRepo ¶
type GUIConfigRepo interface {
Get() (*entity.GUIConfig, error)
Update(in *entity.GUIConfig) (*entity.GUIConfig, error)
}
GUIConfigRepo is the common interface implemented GUIConfigRepository methods
type GUIConfigUseCase ¶
type GUIConfigUseCase struct {
// contains filtered or unexported fields
}
GUIConfigUseCase object capable of interacting with GUIConfigUseCase
func NewGUIConfigUseCase ¶
func NewGUIConfigUseCase(ctx context.Context, wg *sync.WaitGroup, log *logger.Zerolog, guiConfigRepo GUIConfigRepo) *GUIConfigUseCase
NewGUIConfigUseCase creates a new GUIConfigUseCase
func (*GUIConfigUseCase) Get ¶
func (uc *GUIConfigUseCase) Get() (*entity.GUIConfig, error)
Get reads and returns current GUIConfig from database
func (*GUIConfigUseCase) Set ¶
func (uc *GUIConfigUseCase) Set(cfg *entity.GUIConfig)
Set writes GUIConfig to database
func (*GUIConfigUseCase) Stop ¶
func (uc *GUIConfigUseCase) Stop()
Stop stops GUIConfigUseCase and writes current GUIConfig to database
type GrpcClient ¶
type GrpcClient interface {
Connect(addr string, opts ...grpc.ClientOpt) error
AddProtobuf(path ...string)
AddImport(path ...string)
LoadFromProtobuf() ([]*entity.Service, []*entity.ProtobufError, *entity.ProtobufError)
LoadFromReflection() ([]*entity.Service, error)
Query(method *entity.Method, data map[string]interface{}, metadata []string) (*entity.QueryResponse, error)
CancelQuery()
Close()
}
GrpcClient is an interface for working with the gRPC client
type GrpcUseCase ¶
type GrpcUseCase struct {
// contains filtered or unexported fields
}
GrpcUseCase object capable of interacting with GrpcUseCase
func NewGrpcUseCase ¶
func NewGrpcUseCase(ctx context.Context, log *logger.Zerolog, client GrpcClient, workspaceRepo WorkspaceRepo) *GrpcUseCase
NewGrpcUseCase creates a new GrpcUseCase
func (*GrpcUseCase) CancelQuery ¶
func (uc *GrpcUseCase) CancelQuery()
CancelQuery aborting a running request
func (*GrpcUseCase) LoadServer ¶
func (uc *GrpcUseCase) LoadServer(payload map[string]interface{}) *entity.GUIResponse
LoadServer reads the server description from the database and returns it to the GUI
func (*GrpcUseCase) Query ¶
func (uc *GrpcUseCase) Query(payload map[string]interface{}) *entity.GUIResponse
Query executes a gRPC request
type WorkspaceRepo ¶
type WorkspaceRepo interface {
Get() ([]*entity.Workspace, error)
GetByID(id int64) (*entity.Workspace, error)
Create(in *entity.Workspace) (*entity.Workspace, error)
Update(in *entity.Workspace) (*entity.Workspace, error)
Delete(id int64) error
}
WorkspaceRepo is the common interface implemented WorkspaceRepository methods
type WorkspaceUseCase ¶
type WorkspaceUseCase struct {
// contains filtered or unexported fields
}
WorkspaceUseCase object capable of interacting with WorkspaceUseCase
func NewWorkspaceUseCase ¶
func NewWorkspaceUseCase(ctx context.Context, log *logger.Zerolog, workspaceRepo WorkspaceRepo, startupWorkspaceID *int64) *WorkspaceUseCase
NewWorkspaceUseCase creates a new WorkspaceUseCase
func (*WorkspaceUseCase) CreateFolder ¶
func (uc *WorkspaceUseCase) CreateFolder(payload map[string]interface{}) *entity.GUIResponse
CreateFolder creates folder on workspace
func (*WorkspaceUseCase) CreateServer ¶
func (uc *WorkspaceUseCase) CreateServer(payload map[string]interface{}) *entity.GUIResponse
CreateServer creates server on workspace
func (*WorkspaceUseCase) Delete ¶
func (uc *WorkspaceUseCase) Delete(payload map[string]interface{}) *entity.GUIResponse
Delete deletes workspace item
func (*WorkspaceUseCase) DeleteFolder ¶
func (uc *WorkspaceUseCase) DeleteFolder(payload map[string]interface{}) *entity.GUIResponse
DeleteFolder deletes folder on workspace
func (*WorkspaceUseCase) Expand ¶
func (uc *WorkspaceUseCase) Expand(payload map[string]interface{}) *entity.GUIResponse
Expand stores expand/collapse status on database
func (*WorkspaceUseCase) Get ¶
func (uc *WorkspaceUseCase) Get(payload interface{}) *entity.GUIResponse
Get returns workspace tree
func (*WorkspaceUseCase) GetBreadcrumb ¶
func (uc *WorkspaceUseCase) GetBreadcrumb(id int64) ([]string, error)
GetBreadcrumb returns the breadcrumbs
func (*WorkspaceUseCase) GetState ¶
func (uc *WorkspaceUseCase) GetState() *entity.GUIResponse
GetState returns count of folders/servers/queries
func (*WorkspaceUseCase) Sorting ¶
func (uc *WorkspaceUseCase) Sorting(payload map[string]interface{}) *entity.GUIResponse
Sorting gets the sorted workspace tree and stores it in the database
func (*WorkspaceUseCase) UpdateFolder ¶
func (uc *WorkspaceUseCase) UpdateFolder(payload map[string]interface{}) *entity.GUIResponse
UpdateFolder updates folder on workspace
func (*WorkspaceUseCase) UpdateQuery ¶
func (uc *WorkspaceUseCase) UpdateQuery(payload map[string]interface{}) *entity.GUIResponse
UpdateQuery updates query on workspace
func (*WorkspaceUseCase) UpdateServer ¶
func (uc *WorkspaceUseCase) UpdateServer(payload map[string]interface{}) *entity.GUIResponse
UpdateServer updates server on workspace
func (*WorkspaceUseCase) UpdateServerRequest ¶
func (uc *WorkspaceUseCase) UpdateServerRequest(payload map[string]interface{}) *entity.GUIResponse
UpdateServerRequest updates current request params