Documentation
¶
Index ¶
- Constants
- func CountNumUtasksPerDay(taskTraces []TaskTrace) (map[string]int, []string)
- func CountUtaskPerProject(taskTraces []TaskTrace) map[string]int
- func DeleteAllTasks() error
- func GrpcServer()
- func QueryAllTasks() (*[]TaskTrace, error)
- func SaveTask(c <-chan TaskTrace)
- func StartMux(c chan<- TaskTrace)
- type MongoConn
- type PlotData
- type Task
- type TaskTrace
- type UTaskServer
- func (u UTaskServer) GetDailyTaskCount(req *protother.TaskRequest, strm protother.Tasks_GetDailyTaskCountServer) error
- func (u UTaskServer) GetPlot(req *protother.PlotRequest, stream protother.Tasks_GetPlotServer) error
- func (u UTaskServer) GetProjectTaskCount(req *protother.TaskRequest, stream protother.Tasks_GetProjectTaskCountServer) error
- func (u UTaskServer) GetTasks(req *protother.TaskRequest, strm protother.Tasks_GetTasksServer) error
- func (u UTaskServer) Ping(ctx context.Context, req *protother.PingRequest) (*protother.PingReply, error)
- type UTaskdb
Constants ¶
const ( URI = "mongodb://localhost:27017" Database = "tasks" Collection = "taskCollection" )
const (
ContainerName = "utaskmongo"
)
const (
GrpcPort = ":9070"
)
Variables ¶
This section is empty.
Functions ¶
func CountNumUtasksPerDay ¶
CountNumUtasksPerDay count the number of utasks registered per date in date order old -> new
func CountUtaskPerProject ¶
CountUtaskPerProject count the number of entries per project
func DeleteAllTasks ¶
func DeleteAllTasks() error
func QueryAllTasks ¶
QueryAllTasks return all task traces by first searching in db and then the file
Types ¶
type MongoConn ¶
type MongoConn struct {
// contains filtered or unexported fields
}
MongoConn db connection
func NewMongoConn ¶
NewMongoConn if container is not running, restart it or create a new one start connection with the container
func (*MongoConn) Disconnect ¶
Disconnect from db connection
func (*MongoConn) GetAllDocuments ¶
func (*MongoConn) InsertNewDocument ¶
type Task ¶
type Task struct { ProjectName string // project that the task belongs to TaskName string // Details string // additional info regarding the task }
Task contains task details that are fetched from the the socket interface and registered to the db as document
type TaskTrace ¶
type TaskTrace struct { SDate string // date for the task STime string // time stamp for the task T Task // Task details }
TaskTrace is the document that will be saved to the collection
func SortTaskList ¶
SortTaskList sort task list with project name
type UTaskServer ¶
type UTaskServer struct{}
func (UTaskServer) GetDailyTaskCount ¶
func (u UTaskServer) GetDailyTaskCount(req *protother.TaskRequest, strm protother.Tasks_GetDailyTaskCountServer) error
GetDailyTaskCount return number of tasks per day
func (UTaskServer) GetPlot ¶
func (u UTaskServer) GetPlot(req *protother.PlotRequest, stream protother.Tasks_GetPlotServer) error
func (UTaskServer) GetProjectTaskCount ¶
func (u UTaskServer) GetProjectTaskCount(req *protother.TaskRequest, stream protother.Tasks_GetProjectTaskCountServer) error
GetProjectTaskCount returns the number of utasks per project
func (UTaskServer) GetTasks ¶
func (u UTaskServer) GetTasks(req *protother.TaskRequest, strm protother.Tasks_GetTasksServer) error
GetTasks streams all tasks in db back to the client
func (UTaskServer) Ping ¶
func (u UTaskServer) Ping(ctx context.Context, req *protother.PingRequest) (*protother.PingReply, error)
type UTaskdb ¶
type UTaskdb struct { TaskFile string // file to save the tasks MongoURI string MongoDatabase string MongoCollection string }
UTaskdb contains csv file or db details for saving utasks
func (*UTaskdb) SaveTaskTrace ¶
SaveTaskTrace is the main entry point for saving cfg details to db or text file return errors if any occurs while saving the task details tries to save to both db and text