Documentation ¶
Index ¶
- type DBClient
- func (c *DBClient) Connect() error
- func (c *DBClient) Disconnect() error
- func (c *DBClient) GetExecutions() ([]Execution, error)
- func (c *DBClient) GetExecutionsByID(id string) ([]Execution, error)
- func (c *DBClient) GetPipeline(id string) (Pipeline, error)
- func (c *DBClient) GetPipelines() ([]Pipeline, error)
- func (c *DBClient) GetPipelinesByDay(day int) ([]Pipeline, error)
- func (c *DBClient) InsertExecution(e Execution) error
- func (c *DBClient) InsertPipeline(p Pipeline) error
- type Execution
- type Pipeline
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBClient ¶
type DBClient struct {
// contains filtered or unexported fields
}
DBClient represents a mongodb client instance.
func (*DBClient) Disconnect ¶
Disconnect makes the database disconnection.
func (*DBClient) GetExecutions ¶
GetExecutions returns all executions in the database.
func (*DBClient) GetExecutionsByID ¶
GetExecutionsByID returns all executions of a pipeline.
func (*DBClient) GetPipeline ¶
GetPipeline returns a pipeline from database by id.
func (*DBClient) GetPipelines ¶
GetPipelines returns all pipelines in the database.
func (*DBClient) GetPipelinesByDay ¶
GetPipelinesByDay returns all pipelines that have the start-day equal the param.
func (*DBClient) InsertExecution ¶
InsertExecution inserts the result of a pipeline execution in the database.
func (*DBClient) InsertPipeline ¶
InsertPipeline inserts a pipeline in the database.
type Execution ¶
type Execution struct { PipelineResult executor.PipelineResult `bson:"pipeline-result, omitempty" json:"pipeline-result"` // Represents the results for a pipeline execution. ID string `bson:"id, omitempty" json:"id"` // Initials entity like 'trt13'. Entity string `bson:"entity, omitempty" json:"entity"` // Entity from which the pipeline extracts data like 'Tribunal Regional do Trabalho 13° Região'. }
Execution represents the information about a result of a pipeline execution.
type Pipeline ¶
type Pipeline struct { Pipeline executor.Pipeline `bson:"pipeline, omitempty" json:"pipeline"` // Represents the sequence of stages for data release. ID string `bson:"id, omitempty" json:"id"` // Initials entity like 'trt13'. Entity string `bson:"entity, omitempty" json:"entity"` // Entity from which the pipeline extracts data like 'Tribunal Regional do Trabalho 13° Região'. City string `bson:"city, omitempty" json:"city"` // City of the entity from which the pipeline extracts data. FU string `bson:"fu, omitempty" json:"fu"` // Federation unit of the entity from which the pipeline extracts data. Repo string `bson:"repo, omitempty" json:"repo"` // Central pipeline repository. Using the import pattern in golang like 'github.com/dadosjusbr/coletores/trt13'. Frequency int `bson:"frequency, omitempty" json:"frequency"` // Frequency of the pipeline execution in days. Values must be between 1 and 30. To be executed monthly it must be filled with '30'. StartDay int `bson:"start-day, omitempty" json:"start-day"` // Day of the month for the pipeline execution. Values must be between 1 and 30. LimitMonthBackward int `bson:"limit-month-backward, omitempty" json:"limit-month-backward"` // The limit month to which the pipeline must be executed in its historical execution. LimitYearBackward int `bson:"limit-year-backward, omitempty" json:"limit-year-backward"` // The limit year until which the pipeline must be executed in its historical execution. UpdateDate time.Time `bson:"update-date, omitempty" json:"update-date"` // Last time the pipeline register has been updated. }
Pipeline represents the information needed for frequent data collection operation.