Documentation ¶
Index ¶
- func Init(host string, gracePeriod time.Duration, closing chan struct{}, key string) (chan struct{}, error)
- type DataStore
- func (d *DataStore) Close()
- func (d *DataStore) CreateEvent(event *api.Event) (*api.Event, error)
- func (d *DataStore) CreatePipeline(pipeline *api.Pipeline) (*api.Pipeline, error)
- func (d *DataStore) CreatePipelineRecord(pipelineRecord *api.PipelineRecord) (*api.PipelineRecord, error)
- func (d *DataStore) CreateProject(project *api.Project) (*api.Project, error)
- func (d *DataStore) DeleteCloudByName(name string) error
- func (d *DataStore) DeleteEvent(id string) error
- func (d *DataStore) DeletePipelineByID(pipelineID string) error
- func (d *DataStore) DeletePipelineRecordByID(pipelineRecordID string) error
- func (d *DataStore) DeletePipelineRecordsByPipelineID(pipelineID string) error
- func (d *DataStore) DeletePipelinesByProjectID(projectID string) error
- func (d *DataStore) DeleteProjectByID(projectID string) error
- func (d *DataStore) FindAllClouds() ([]api.Cloud, error)
- func (d *DataStore) FindCloudByName(name string) (*api.Cloud, error)
- func (d *DataStore) FindPipelineByID(pipelineID string) (*api.Pipeline, error)
- func (d *DataStore) FindPipelineByName(projectID string, name string) (*api.Pipeline, error)
- func (d *DataStore) FindPipelineRecordByID(pipelineRecordID string) (*api.PipelineRecord, error)
- func (d *DataStore) FindPipelineRecordsByPipelineID(pipelineID string, queryParams api.QueryParams) ([]api.PipelineRecord, int, error)
- func (d *DataStore) FindPipelineRecordsByStartTime(pipelineID string, start, end time.Time) ([]api.PipelineRecord, int, error)
- func (d *DataStore) FindPipelinesByProjectID(projectID string, queryParams api.QueryParams) ([]api.Pipeline, int, error)
- func (d *DataStore) FindProjectByID(projectID string) (*api.Project, error)
- func (d *DataStore) FindProjectByName(name string) (*api.Project, error)
- func (d *DataStore) FindRecentRecordsByPipelineID(pipelineID string, filter map[string]interface{}, limit int) ([]api.PipelineRecord, int, error)
- func (d *DataStore) FindRecordsWithPaginationByPipelineID(pipelineID string, queryParams api.QueryParams) ([]api.PipelineRecord, int, error)
- func (d *DataStore) FindRotateRecords(pipelineID string, n int) ([]api.PipelineRecord, int, error)
- func (d *DataStore) GetEventByID(id string) (*api.Event, error)
- func (d *DataStore) GetEventByRecordID(id string) (*api.Event, error)
- func (d *DataStore) GetProjects(queryParams api.QueryParams) ([]api.Project, int, error)
- func (d *DataStore) InsertCloud(c *api.Cloud) error
- func (d *DataStore) NextEvent() (*api.Event, error)
- func (d *DataStore) Ping() error
- func (d *DataStore) ResetEvent(event *api.Event) error
- func (d *DataStore) UpdateEvent(event *api.Event) error
- func (d *DataStore) UpdatePipeline(pipeline *api.Pipeline) error
- func (d *DataStore) UpdatePipelineRecord(pipelineRecord *api.PipelineRecord) error
- func (d *DataStore) UpdateProject(project *api.Project) error
- func (d *DataStore) UpsertCloud(c *api.Cloud) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
DataStore is the type for mongo db store.
func (*DataStore) CreateEvent ¶
CreateEvent creates the event with the initial status `in`.
func (*DataStore) CreatePipeline ¶
CreatePipeline creates the pipeline, returns the pipeline created.
func (*DataStore) CreatePipelineRecord ¶
func (d *DataStore) CreatePipelineRecord(pipelineRecord *api.PipelineRecord) (*api.PipelineRecord, error)
CreatePipelineRecord creates the pipeline record, returns the pipeline record created.
func (*DataStore) CreateProject ¶
CreateProject creates the project, returns the project created.
func (*DataStore) DeleteCloudByName ¶
DeleteCloudByName delete a cloud in db by name
func (*DataStore) DeleteEvent ¶
func (*DataStore) DeletePipelineByID ¶
DeletePipelineByID deletes the pipeline by id.
func (*DataStore) DeletePipelineRecordByID ¶
DeletePipelineRecordByID deletes the pipeline record by id.
func (*DataStore) DeletePipelineRecordsByPipelineID ¶
DeletePipelineRecordsByPipelineID deletes all the pipeline records of one pipeline by pipeline id.
func (*DataStore) DeletePipelinesByProjectID ¶
DeletePipelinesByProjectID deletes all the pipelines in one project by project id.
func (*DataStore) DeleteProjectByID ¶
DeleteProjectByID deletes the project by id.
func (*DataStore) FindAllClouds ¶
FindAllClouds returns all clouds
func (*DataStore) FindCloudByName ¶
FindCloudByName returns a cloud in db by name
func (*DataStore) FindPipelineByID ¶
FindPipelineByID finds the pipeline by id.
func (*DataStore) FindPipelineByName ¶
FindPipelineByName finds the pipeline by name in one project. If find no pipeline or more than one pipeline, return error.
func (*DataStore) FindPipelineRecordByID ¶
func (d *DataStore) FindPipelineRecordByID(pipelineRecordID string) (*api.PipelineRecord, error)
FindPipelineRecordByID finds the pipeline record by id.
func (*DataStore) FindPipelineRecordsByPipelineID ¶
func (d *DataStore) FindPipelineRecordsByPipelineID(pipelineID string, queryParams api.QueryParams) ([]api.PipelineRecord, int, error)
FindPipelineRecordsByPipelineID finds the pipeline records by pipelineID.
func (*DataStore) FindPipelineRecordsByStartTime ¶
func (d *DataStore) FindPipelineRecordsByStartTime(pipelineID string, start, end time.Time) ([]api.PipelineRecord, int, error)
FindPipelineRecordsByStartTime finds the pipeline records by startTime.
func (*DataStore) FindPipelinesByProjectID ¶
func (d *DataStore) FindPipelinesByProjectID(projectID string, queryParams api.QueryParams) ([]api.Pipeline, int, error)
FindPipelinesByProjectID finds the pipelines by project id. Will returns all pipelines in this project.
func (*DataStore) FindProjectByID ¶
FindProjectByID finds the project by id.
func (*DataStore) FindProjectByName ¶
FindProjectByName finds the project by name. If find no project or more than one project, return error.
func (*DataStore) FindRecentRecordsByPipelineID ¶
func (d *DataStore) FindRecentRecordsByPipelineID(pipelineID string, filter map[string]interface{}, limit int) ([]api.PipelineRecord, int, error)
FindRecentRecordsByPipelineID finds a set of records with conditions by pipeline ID.
func (*DataStore) FindRecordsWithPaginationByPipelineID ¶
func (d *DataStore) FindRecordsWithPaginationByPipelineID(pipelineID string, queryParams api.QueryParams) ([]api.PipelineRecord, int, error)
FindRecordsWithPaginationByPipelineID finds a page of records with conditions by pipeline ID.
func (*DataStore) FindRotateRecords ¶
FindRotateRecords finds all records inserted earlier than other n records.
func (*DataStore) GetEventByID ¶
GetEventByID gets the event by id.
func (*DataStore) GetEventByRecordID ¶ added in v0.7.1
GetEventByRecordID gets the event by pipeline record id.
func (*DataStore) GetProjects ¶
GetProjects gets all projects. Will returns all projects.
func (*DataStore) InsertCloud ¶
InsertCloud insert a new cloud document to db
func (*DataStore) NextEvent ¶
NextEvent get the next event with conditions: * sorted by `inTime`, first in first out; * with status status `in`; * has been out more than the threshold.
func (*DataStore) UpdatePipeline ¶
UpdatePipeline updates the pipeline, please make sure the pipeline id is provided before call this method.
func (*DataStore) UpdatePipelineRecord ¶
func (d *DataStore) UpdatePipelineRecord(pipelineRecord *api.PipelineRecord) error
UpdatePipelineRecord updates the pipeline record.
func (*DataStore) UpdateProject ¶
UpdateProject updates the project, please make sure the project id is provided before call this method.