Documentation ¶
Index ¶
- func Contains[T comparable](array []T, predicate func(T) bool) bool
- func InStdInNotEmpty() (bool, error)
- func NewConfig(request *ConfigRequest) *config.Config
- func NewConfigFromProtoConfigRequest(request *proto.ConfigRequest) *config.Config
- func NewConfigResponseFromConfig(cfg *config.Config) *proto.ConfigResponse
- type AgentRequest
- type ConfigRequest
- type ConfigService
- type JobRequest
- type Lbot
- func (l *Lbot) AgentHeartBeat(id primitive.ObjectID, name string) error
- func (l *Lbot) AreWorkloadsFinished(command *database.Command) (bool, error)
- func (l *Lbot) Cancel() error
- func (l *Lbot) Client() (err error)
- func (l *Lbot) Close() (err error)
- func (l *Lbot) GenerateWorkload(command *database.Command) ([]*database.Workload, error)
- func (l *Lbot) GetNextUnFinishedCommand() (*database.Command, error)
- func (l *Lbot) HandleCommand()
- func (l *Lbot) HandleWorkload()
- func (l *Lbot) InitAgent(id primitive.ObjectID, name string) error
- func (l *Lbot) IsMasterAgent(agentId primitive.ObjectID) (bool, error)
- func (l *Lbot) Run() (err error)
- func (l *Lbot) SaveWorkloads(ws []*database.Workload) error
- func (l *Lbot) SetCommandState(command *database.Command, state database.CommandState) error
- func (l *Lbot) SetConfig(config *config.Config)
- func (l *Lbot) SetWorkloadState(workload *database.Workload, state database.WorkloadState) error
- func (l *Lbot) StartWorkload(workload *database.Workload)
- func (l *Lbot) UpdateRunningAgents() error
- type Orchiestrator
- func (o *Orchiestrator) Install(ctx context.Context, request *resourcemanager.InstallRequest) (*resourcemanager.InstallResponse, error)
- func (o *Orchiestrator) List(ctx context.Context, request *resourcemanager.ListRequest) (*resourcemanager.ListResponse, error)
- func (o *Orchiestrator) UnInstall(ctx context.Context, request *resourcemanager.UnInstallRequest) (*resourcemanager.UnInstallResponse, error)
- func (o *Orchiestrator) Upgrade(ctx context.Context, request *resourcemanager.UpgradeRequest) (*resourcemanager.UpgradeResponse, error)
- type ProgressProcess
- type SchemaRequest
- type StartProcess
- type StoppingProcess
- type WatchingProcess
- type WatchingRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](array []T, predicate func(T) bool) bool
func InStdInNotEmpty ¶
func NewConfig ¶
func NewConfig(request *ConfigRequest) *config.Config
func NewConfigFromProtoConfigRequest ¶
func NewConfigFromProtoConfigRequest(request *proto.ConfigRequest) *config.Config
func NewConfigResponseFromConfig ¶
func NewConfigResponseFromConfig(cfg *config.Config) *proto.ConfigResponse
Types ¶
type AgentRequest ¶
type AgentRequest struct { Name string `json:"name,omitempty"` Port string `json:"port,omitempty"` MetricsExportUrl string `json:"metrics_export_url,omitempty"` MetricsExportIntervalSeconds uint64 `json:"metrics_export_interval_seconds,omitempty"` MetricsExportPort string `json:"metrics_export_port,omitempty"` }
todo: change or even remove, yes, remove - there will be multiple agents, and agent will be configred from commandline todo: move agentn-name nad add new config flage - custom metrics label or similar purpose is to export metrics with cluster name
type ConfigRequest ¶
type ConfigRequest struct { ConnectionString string `json:"connection_string"` Agent *AgentRequest `json:"agent,omitempty"` Jobs []*JobRequest `json:"jobs,omitempty"` Schemas []*SchemaRequest `json:"schemas,omitempty"` Debug bool `json:"debug,omitempty"` }
todo: should be pointers
func ParseConfigFile ¶
func ParseConfigFile(configFile string) (*ConfigRequest, error)
func ParseStdInConfig ¶
func ParseStdInConfig() (*ConfigRequest, error)
func (*ConfigRequest) Validate ¶
func (c *ConfigRequest) Validate() error
func (*ConfigRequest) Values ¶
func (c *ConfigRequest) Values() (string, error)
type ConfigService ¶
type ConfigService struct { proto.UnimplementedConfigServiceServer // contains filtered or unexported fields }
func NewConfigService ¶
func NewConfigService(ctx context.Context, lbot *Lbot) *ConfigService
func (*ConfigService) GetConfig ¶
func (c *ConfigService) GetConfig(ctx context.Context, empty *emptypb.Empty) (*proto.ConfigResponse, error)
func (*ConfigService) SetConfig ¶
func (c *ConfigService) SetConfig(ctx context.Context, request *proto.ConfigRequest) (*proto.ConfigResponse, error)
type JobRequest ¶
type JobRequest struct { Name string `json:"name,omitempty"` Database string `json:"database,omitempty"` Collection string `json:"collection,omitempty"` Type string `json:"type,omitempty"` Schema string `json:"schema,omitempty"` Connections uint64 `json:"connections,omitempty"` Pace uint64 `json:"pace,omitempty"` DataSize uint64 `json:"data_size,omitempty"` BatchSize uint64 `json:"batch_size,omitempty"` Duration time.Duration `json:"duration,omitempty"` Operations uint64 `json:"operations,omitempty"` Timeout time.Duration `json:"timeout,omitempty"` Filter map[string]interface{} `json:"filter,omitempty"` }
func (*JobRequest) UnmarshalJSON ¶
func (c *JobRequest) UnmarshalJSON(data []byte) (err error)
func (*JobRequest) Validate ¶
func (job *JobRequest) Validate() error
type Lbot ¶
func (*Lbot) AgentHeartBeat ¶
func (*Lbot) AreWorkloadsFinished ¶
func (*Lbot) GenerateWorkload ¶
func (*Lbot) GetNextUnFinishedCommand ¶
func (*Lbot) HandleCommand ¶
func (l *Lbot) HandleCommand()
func (*Lbot) HandleWorkload ¶
func (l *Lbot) HandleWorkload()
func (*Lbot) SetCommandState ¶
func (*Lbot) SetWorkloadState ¶
func (*Lbot) StartWorkload ¶
func (*Lbot) UpdateRunningAgents ¶
depricated, to be removed
type Orchiestrator ¶
type Orchiestrator struct {
// contains filtered or unexported fields
}
func NewOrchiestrator ¶
func NewOrchiestrator(ctx context.Context) *Orchiestrator
func (*Orchiestrator) Install ¶
func (o *Orchiestrator) Install(ctx context.Context, request *resourcemanager.InstallRequest) (*resourcemanager.InstallResponse, error)
func (*Orchiestrator) List ¶
func (o *Orchiestrator) List(ctx context.Context, request *resourcemanager.ListRequest) (*resourcemanager.ListResponse, error)
func (*Orchiestrator) UnInstall ¶
func (o *Orchiestrator) UnInstall(ctx context.Context, request *resourcemanager.UnInstallRequest) (*resourcemanager.UnInstallResponse, error)
func (*Orchiestrator) Upgrade ¶
func (o *Orchiestrator) Upgrade(ctx context.Context, request *resourcemanager.UpgradeRequest) (*resourcemanager.UpgradeResponse, error)
type ProgressProcess ¶
type ProgressProcess struct { proto.UnimplementedProgressProcessServer // contains filtered or unexported fields }
func NewProgressProcess ¶
func NewProgressProcess(ctx context.Context, lbot *Lbot) *ProgressProcess
func (*ProgressProcess) Run ¶
func (p *ProgressProcess) Run(request *proto.ProgressRequest, srv proto.ProgressProcess_RunServer) error
type SchemaRequest ¶
type StartProcess ¶
type StartProcess struct { proto.UnimplementedStartProcessServer // contains filtered or unexported fields }
func NewStartProcess ¶
func NewStartProcess(ctx context.Context, lbot *Lbot) *StartProcess
func (*StartProcess) Run ¶
func (c *StartProcess) Run(ctx context.Context, request *proto.StartRequest) (*proto.StartResponse, error)
func (*StartProcess) RunWithProgress ¶
func (c *StartProcess) RunWithProgress(request *proto.StartWithProgressRequest, srv proto.StartProcess_RunWithProgressServer) error
type StoppingProcess ¶
type StoppingProcess struct { proto.UnimplementedStopProcessServer // contains filtered or unexported fields }
func NewStoppingProcess ¶
func NewStoppingProcess(ctx context.Context, lbot *Lbot) *StoppingProcess
func (*StoppingProcess) Run ¶
func (c *StoppingProcess) Run(ctx context.Context, request *proto.StopRequest) (*proto.StopResponse, error)
type WatchingProcess ¶
type WatchingProcess struct { proto.UnimplementedWatchProcessServer // contains filtered or unexported fields }
func NewWatchingProcess ¶
func NewWatchingProcess(ctx context.Context, lbot *Lbot) *WatchingProcess
func (*WatchingProcess) Run ¶
func (w *WatchingProcess) Run(request *proto.WatchRequest, srv proto.WatchProcess_RunServer) error
type WatchingRequest ¶
type WatchingRequest struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.