Documentation ¶
Overview ¶
Package rpcsvc provides handlers for JSON-RPC 2.0.
Index ¶
- func Init(r TrackerClient, p ctxtg.TokenParser)
- type API
- func (r *API) CreateIssue(req *CreateIssueReq, resp *CreateIssueResp) error
- func (r *API) CreateReport(req *CreateReportReq, _ *struct{}) error
- func (r *API) GetCurrentUser(req *CurrentUserReq, resp *CurrentUserResp) error
- func (r *API) GetIssue(req *GetIssueReq, resp *GetIssueResp) error
- func (r *API) GetIssueByURL(req *GetIssueByURLReq, resp *GetIssueByURLResp) error
- func (r *API) GetProjectDetails(req *ProjectDetailsReq, resp *ProjectDetailsResp) error
- func (r *API) GetProjectIssues(req *ProjectIssuesReq, resp *ProjectIssuesResp) error
- func (r *API) GetProjects(req *ProjectsReq, resp *ProjectsResp) error
- func (r *API) GetTotalReports(req *GetReportsReq, resp *GetReportsResp) error
- func (r *API) UpdateIssueProgress(req *UpdateIssueProgressReq, _ *struct{}) error
- func (*API) Version(args *struct{}, res *string) error
- type CreateIssueReq
- type CreateIssueResp
- type CreateReportReq
- type CurrentUserReq
- type CurrentUserResp
- type GetIssueByURLReq
- type GetIssueByURLResp
- type GetIssueReq
- type GetIssueResp
- type GetReportsReq
- type GetReportsResp
- type ProjectDetailsReq
- type ProjectDetailsResp
- type ProjectIssuesReq
- type ProjectIssuesResp
- type ProjectsReq
- type ProjectsResp
- type TrackerClient
- type UpdateIssueProgressReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API JSON-RPC 2.0 struct
func (*API) CreateIssue ¶
func (r *API) CreateIssue(req *CreateIssueReq, resp *CreateIssueResp) error
CreateIssue creates issue on tracker
func (*API) CreateReport ¶
func (r *API) CreateReport(req *CreateReportReq, _ *struct{}) error
CreateReport reports time on tracker for user ID
func (*API) GetCurrentUser ¶
func (r *API) GetCurrentUser(req *CurrentUserReq, resp *CurrentUserResp) error
GetCurrentUser returns current user info
func (*API) GetIssue ¶
func (r *API) GetIssue(req *GetIssueReq, resp *GetIssueResp) error
GetIssue returns Issue by ID
func (*API) GetIssueByURL ¶
func (r *API) GetIssueByURL(req *GetIssueByURLReq, resp *GetIssueByURLResp) error
GetIssueByURL parse incoming URL and return issue and project ID
func (*API) GetProjectDetails ¶
func (r *API) GetProjectDetails(req *ProjectDetailsReq, resp *ProjectDetailsResp) error
GetProjectDetails returns full information by projectID
func (*API) GetProjectIssues ¶
func (r *API) GetProjectIssues(req *ProjectIssuesReq, resp *ProjectIssuesResp) error
GetProjectIssues returns user's issues by project ID
func (*API) GetProjects ¶
func (r *API) GetProjects(req *ProjectsReq, resp *ProjectsResp) error
GetProjects return paginated projects list for user
func (*API) GetTotalReports ¶
func (r *API) GetTotalReports(req *GetReportsReq, resp *GetReportsResp) error
GetTotalReports receive UNIX timestamp of date and aggregate reported time for user for this day
func (*API) UpdateIssueProgress ¶
func (r *API) UpdateIssueProgress(req *UpdateIssueProgressReq, _ *struct{}) error
UpdateIssueProgress updates issue progress in percents
type CreateIssueReq ¶
type CreateIssueReq struct { Context ctxtg.Context Tracker entities.Tracker Issue entities.NewIssue ProjectID entities.ProjectID }
CreateIssueReq input parameter to CreateIssue
type CreateIssueResp ¶
CreateIssueResp output parameter from CreateIssue
type CreateReportReq ¶
type CreateReportReq struct { Context ctxtg.Context Tracker entities.Tracker ProjectID entities.ProjectID Report entities.Report }
CreateReportReq input parameter from CreateReport
type CurrentUserReq ¶
CurrentUserReq input parameter to GetCurrentUser
type CurrentUserResp ¶
CurrentUserResp output parameter from GetCurrentUser
type GetIssueByURLReq ¶
type GetIssueByURLReq struct { Context ctxtg.Context Tracker entities.Tracker IssueURL entities.IssueURL }
GetIssueByURLReq input parameter to GetIssueByURL
type GetIssueByURLResp ¶
GetIssueByURLResp output parameter from GetIssueByURL
type GetIssueReq ¶
type GetIssueReq struct { Context ctxtg.Context Tracker entities.Tracker IssueID entities.IssueID ProjectID entities.ProjectID }
GetIssueReq input parameter to GetIssue
type GetIssueResp ¶
GetIssueResp output parameter from GetIssue
type GetReportsReq ¶
GetReportsReq input parameter to GetTotalReports
type GetReportsResp ¶
type GetReportsResp struct {
Total int64
}
GetReportsResp output parameter from GetTotalReports
type ProjectDetailsReq ¶
type ProjectDetailsReq struct { Context ctxtg.Context Tracker entities.Tracker ProjectID entities.ProjectID }
ProjectDetailsReq input parameter to GetProjectDetails
type ProjectDetailsResp ¶
ProjectDetailsResp output parameter from GetProjectDetails
type ProjectIssuesReq ¶
type ProjectIssuesReq struct { Context ctxtg.Context Tracker entities.Tracker ProjectID entities.ProjectID entities.Pagination }
ProjectIssuesReq input parameter to GetProjectIssues
type ProjectIssuesResp ¶
ProjectIssuesResp output parameter from GetProjectIssues
type ProjectsReq ¶
ProjectsReq input parameter to GetProjects
type ProjectsResp ¶
ProjectsResp output parameter from GetProjects
type TrackerClient ¶
type TrackerClient interface { Project(context.Context, entities.Tracker, entities.ProjectID) (*entities.Project, error) //Projects return project list and total amount of projects Projects(context.Context, entities.Tracker, entities.Pagination) ([]entities.Project, int64, error) //ProjectIssues return issues assigned to user and total amount ProjectIssues(context.Context, entities.Tracker, entities.ProjectID, entities.Pagination) ([]entities.Issue, int64, error) UserInfo(context.Context, entities.Tracker) (*entities.User, error) Issue(context.Context, entities.Tracker, entities.ProjectID, entities.IssueID) (*entities.Issue, error) IssueByURL(context.Context, entities.Tracker, entities.IssueURL) (*entities.Issue, error) CreateIssue(context.Context, entities.Tracker, entities.NewIssue, entities.ProjectID) (*entities.Issue, error) UpdateIssueProgress(context.Context, entities.Tracker, entities.ProjectID, entities.IssueID, entities.Progress) error //TotalReports receive date as UNIX timestamp (seconds) and return total reported time at this day in seconds TotalReports(ctx context.Context, t entities.Tracker, date int64) (int64, error) CreateReport(context.Context, entities.Tracker, entities.ProjectID, entities.Report) error }
TrackerClient required interface for new tracker