rpcsvc

package
v0.0.0-...-c3a74cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package rpcsvc provides handlers for JSON-RPC 2.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(r TrackerClient, p ctxtg.TokenParser)

Init registers JSON-RPC handlers

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

func (*API) Version

func (*API) Version(args *struct{}, res *string) error

Version return current service narada version

type CreateIssueReq

type CreateIssueReq struct {
	Context   ctxtg.Context
	Tracker   entities.Tracker
	Issue     entities.NewIssue
	ProjectID entities.ProjectID
}

CreateIssueReq input parameter to CreateIssue

type CreateIssueResp

type CreateIssueResp struct {
	Issue entities.Issue
}

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

type CurrentUserReq struct {
	Context ctxtg.Context
	Tracker entities.Tracker
}

CurrentUserReq input parameter to GetCurrentUser

type CurrentUserResp

type CurrentUserResp struct {
	User entities.User
}

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

type GetIssueByURLResp struct {
	Issue     entities.Issue
	ProjectID entities.ProjectID
}

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

type GetIssueResp struct {
	Issue entities.Issue
}

GetIssueResp output parameter from GetIssue

type GetReportsReq

type GetReportsReq struct {
	Context ctxtg.Context
	Tracker entities.Tracker
	Date    int64
}

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

type ProjectDetailsResp struct {
	Project entities.Project
}

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

type ProjectIssuesResp struct {
	Issues []entities.Issue
	Amount int64
}

ProjectIssuesResp output parameter from GetProjectIssues

type ProjectsReq

type ProjectsReq struct {
	Context ctxtg.Context
	Tracker entities.Tracker
	entities.Pagination
}

ProjectsReq input parameter to GetProjects

type ProjectsResp

type ProjectsResp struct {
	Projects []entities.Project
	Amount   int64
}

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

type UpdateIssueProgressReq

type UpdateIssueProgressReq struct {
	Context   ctxtg.Context
	Tracker   entities.Tracker
	IssueID   entities.IssueID
	ProjectID entities.ProjectID
	Progress  entities.Progress
}

UpdateIssueProgressReq input parameter to UpdateIssueReq

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL