Documentation
¶
Index ¶
- func EncodeString(s string) string
- func Exists(file string) bool
- func GetEnv() string
- func ReadFile(file string, obj interface{}) ([]byte, error)
- func ReadFileLines(file string) ([]string, error)
- func WriteFile(file string, obj interface{}) error
- type AppConfig
- type Controller
- func (controller *Controller) CreateProcessHandler(ctx *web.Context) error
- func (controller *Controller) DeleteProcessHandler(ctx *web.Context) error
- func (controller *Controller) DeleteProcessesHandler(ctx *web.Context) error
- func (controller *Controller) DoNothing(ctx *web.Context) error
- func (controller *Controller) GetProcessHandler(ctx *web.Context) error
- func (controller *Controller) GetProcessesHandler(ctx *web.Context) error
- func (controller *Controller) RegisterRoutes(w manager.IWeb) error
- func (controller *Controller) UpdateProcessHandler(ctx *web.Context) error
- func (controller *Controller) UpdateProcessStatusCheckHandler(ctx *web.Context) error
- func (controller *Controller) UpdateProcessStatusHandler(ctx *web.Context) error
- type CreateProcessRequest
- type DeleteProcessRequest
- type ErrorResponse
- type GetProcessRequest
- type IStorageDB
- type Interactor
- func (interactor *Interactor) CanExecute(idProcess string) (bool, errors.ErrorList)
- func (interactor *Interactor) CreateProcess(newProcess *Process) error
- func (interactor *Interactor) DeleteProcess(idProcess string) error
- func (interactor *Interactor) DeleteProcesses() error
- func (interactor *Interactor) GetProcess(idProcess string) (*Process, error)
- func (interactor *Interactor) GetProcesses(values map[string][]string) (ListProcess, error)
- func (interactor *Interactor) UpdateProcess(updProcess *Process) error
- func (interactor *Interactor) UpdateProcessStatus(idProcess string, status Status) errors.ErrorList
- func (interactor *Interactor) UpdateProcessStatusCheck(idProcess string, status Status) errors.ErrorList
- type ListProcess
- type Monitor
- func (monitor *Monitor) NewController(interactor *Interactor) *Controller
- func (monitor *Monitor) NewInteractor(storageDB IStorageDB) *Interactor
- func (monitor *Monitor) NewStoragePostgres(connection manager.IDB) *StoragePostgres
- func (monitor *Monitor) Reconfigure(options ...MonitorOption)
- func (m *Monitor) Start() error
- func (m *Monitor) Stop() error
- type MonitorConfig
- type MonitorOption
- type Process
- type Status
- type StoragePostgres
- func (storage *StoragePostgres) CreateProcess(newProcess *Process) error
- func (storage *StoragePostgres) DeleteProcess(idProcess string) error
- func (storage *StoragePostgres) DeleteProcesses() error
- func (storage *StoragePostgres) GetProcess(idProcess string) (*Process, error)
- func (storage *StoragePostgres) GetProcesses(values map[string][]string) (ListProcess, error)
- func (storage *StoragePostgres) UpdateProcess(updProcess *Process) error
- func (storage *StoragePostgres) UpdateProcessStatus(idProcess string, status Status) error
- type UpdateProcessRequest
- type UpdateProcessStatusRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeString ¶
func ReadFileLines ¶
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) CreateProcessHandler ¶
func (controller *Controller) CreateProcessHandler(ctx *web.Context) error
func (*Controller) DeleteProcessHandler ¶
func (controller *Controller) DeleteProcessHandler(ctx *web.Context) error
func (*Controller) DeleteProcessesHandler ¶
func (controller *Controller) DeleteProcessesHandler(ctx *web.Context) error
func (*Controller) GetProcessHandler ¶
func (controller *Controller) GetProcessHandler(ctx *web.Context) error
func (*Controller) GetProcessesHandler ¶
func (controller *Controller) GetProcessesHandler(ctx *web.Context) error
func (*Controller) RegisterRoutes ¶
func (controller *Controller) RegisterRoutes(w manager.IWeb) error
func (*Controller) UpdateProcessHandler ¶
func (controller *Controller) UpdateProcessHandler(ctx *web.Context) error
func (*Controller) UpdateProcessStatusCheckHandler ¶
func (controller *Controller) UpdateProcessStatusCheckHandler(ctx *web.Context) error
func (*Controller) UpdateProcessStatusHandler ¶
func (controller *Controller) UpdateProcessStatusHandler(ctx *web.Context) error
type CreateProcessRequest ¶
type CreateProcessRequest struct {
Body struct {
IdProcess string `json:"id_process" validate:"notzero"`
Type string `json:"type" validate:"notzero"`
Name string `json:"name" validate:"notzero"`
Description string `json:"description"`
DateFrom *types.Date `json:"date_from" validate:"special={date}"`
DateTo *types.Date `json:"date_to" validate:"special={date}"`
TimeFrom *types.Time `json:"time_from" validate:"special={time}"`
TimeTo *types.Time `json:"time_to" validate:"special={time}"`
DaysOff *types.ListDay `json:"days_off" validate:"options=monday;tuesday;wednesday;thursday;friday;saturday;sunday"`
Monitor string `json:"monitor"`
Status *Status `json:"status" validate:"options=stopped;running"`
}
}
type DeleteProcessRequest ¶
type DeleteProcessRequest struct {
IdProcess string `json:"id_process" validate:"notzero"`
}
type ErrorResponse ¶
type GetProcessRequest ¶
type GetProcessRequest struct {
IdProcess string `json:"id" validate:"notzero"`
}
type IStorageDB ¶
type IStorageDB interface {
GetProcess(idProcess string) (*Process, error)
GetProcesses(values map[string][]string) (ListProcess, error)
CreateProcess(newProcess *Process) error
UpdateProcess(updProcess *Process) error
UpdateProcessStatus(idProcess string, status Status) error
DeleteProcess(idProcess string) error
DeleteProcesses() error
}
type Interactor ¶
type Interactor struct {
// contains filtered or unexported fields
}
func (*Interactor) CanExecute ¶
func (interactor *Interactor) CanExecute(idProcess string) (bool, errors.ErrorList)
func (*Interactor) CreateProcess ¶
func (interactor *Interactor) CreateProcess(newProcess *Process) error
func (*Interactor) DeleteProcess ¶
func (interactor *Interactor) DeleteProcess(idProcess string) error
func (*Interactor) DeleteProcesses ¶
func (interactor *Interactor) DeleteProcesses() error
func (*Interactor) GetProcess ¶
func (interactor *Interactor) GetProcess(idProcess string) (*Process, error)
func (*Interactor) GetProcesses ¶
func (interactor *Interactor) GetProcesses(values map[string][]string) (ListProcess, error)
func (*Interactor) UpdateProcess ¶
func (interactor *Interactor) UpdateProcess(updProcess *Process) error
func (*Interactor) UpdateProcessStatus ¶
func (interactor *Interactor) UpdateProcessStatus(idProcess string, status Status) errors.ErrorList
func (*Interactor) UpdateProcessStatusCheck ¶
func (interactor *Interactor) UpdateProcessStatusCheck(idProcess string, status Status) errors.ErrorList
type ListProcess ¶
type ListProcess []*Process
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func (*Monitor) NewController ¶
func (monitor *Monitor) NewController(interactor *Interactor) *Controller
func (*Monitor) NewInteractor ¶
func (monitor *Monitor) NewInteractor(storageDB IStorageDB) *Interactor
func (*Monitor) NewStoragePostgres ¶
func (monitor *Monitor) NewStoragePostgres(connection manager.IDB) *StoragePostgres
func (*Monitor) Reconfigure ¶
func (monitor *Monitor) Reconfigure(options ...MonitorOption)
Reconfigure ...
type MonitorConfig ¶
type MonitorConfig struct {
Host string `json:"host"`
Db manager.DBConfig `json:"db"`
Migration *migration.MigrationConfig `json:"migration"`
Log struct {
Level string `json:"level"`
} `json:"log"`
}
MonitorConfig ...
type MonitorOption ¶
type MonitorOption func(client *Monitor)
MonitorOption ...
func WithConfiguration ¶
func WithConfiguration(config *MonitorConfig) MonitorOption
WithConfiguration ...
type Process ¶
type Process struct {
IdProcess string `json:"id_process"`
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
DateFrom *types.Date `json:"date_from"`
DateTo *types.Date `json:"date_to"`
TimeFrom *types.Time `json:"time_from"`
TimeTo *types.Time `json:"time_to"`
DaysOff *types.ListDay `json:"days_off"`
Monitor string `json:"monitor"`
Status *Status `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
type StoragePostgres ¶
type StoragePostgres struct {
// contains filtered or unexported fields
}
func (*StoragePostgres) CreateProcess ¶
func (storage *StoragePostgres) CreateProcess(newProcess *Process) error
func (*StoragePostgres) DeleteProcess ¶
func (storage *StoragePostgres) DeleteProcess(idProcess string) error
func (*StoragePostgres) DeleteProcesses ¶
func (storage *StoragePostgres) DeleteProcesses() error
func (*StoragePostgres) GetProcess ¶
func (storage *StoragePostgres) GetProcess(idProcess string) (*Process, error)
func (*StoragePostgres) GetProcesses ¶
func (storage *StoragePostgres) GetProcesses(values map[string][]string) (ListProcess, error)
func (*StoragePostgres) UpdateProcess ¶
func (storage *StoragePostgres) UpdateProcess(updProcess *Process) error
func (*StoragePostgres) UpdateProcessStatus ¶
func (storage *StoragePostgres) UpdateProcessStatus(idProcess string, status Status) error
type UpdateProcessRequest ¶
type UpdateProcessRequest struct {
IdProcess string `json:"id_process" validate:"notzero"`
Body struct {
Type string `json:"type" validate:"notzero"`
Name string `json:"name" validate:"notzero"`
Description string `json:"description"`
DateFrom *types.Date `json:"date_from" validate:"special={date}"`
DateTo *types.Date `json:"date_to" validate:"special={date}"`
TimeFrom *types.Time `json:"time_from" validate:"special={time}"`
TimeTo *types.Time `json:"time_to" validate:"special={time}"`
DaysOff *types.ListDay `json:"days_off" validate:"options=monday;tuesday;wednesday;thursday;friday;saturday;sunday"`
Monitor string `json:"monitor"`
Status *Status `json:"status" validate:"options=stopped;running"`
}
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.