Documentation ¶
Overview ¶
Package rpcsvc provides handlers for JSON-RPC 2.0.
Index ¶
- func Init(c RPCConfig)
- type API
- func (p *API) ClosePlanning(req *ClosePlanningReq, _ *struct{}) error
- func (p *API) CreatePlanning(req *CreatePlanningReq, resp *CreatePlanningResp) error
- func (p *API) GetOpenPlannings(req *GetOpenPlanningsReg, resp *GetOpenPlanningsResp) error
- func (p *API) SetActive(req *SetActiveReq, resp *struct{}) error
- func (p *API) SetExtra(req *SetExtraReq, _ *struct{}) error
- func (p *API) SetSpent(req *SetSpentReq, resp *struct{}) error
- func (p *API) SpentTime(req *SpentTimeReq, resp *SpentTimeResp) error
- func (*API) Version(args *struct{}, res *string) error
- type ClosePlanningReq
- type CreatePlanningReq
- type CreatePlanningResp
- type GetOpenPlanningsReg
- type GetOpenPlanningsResp
- type PlanningService
- type PlanningStorage
- type RPCConfig
- type SetActiveReq
- type SetExtraReq
- type SetSpentReq
- type SpentTimeReq
- type SpentTimeResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API struct for JSON-RPC 2.0
func (*API) ClosePlanning ¶
func (p *API) ClosePlanning(req *ClosePlanningReq, _ *struct{}) error
ClosePlanning close planning and registers additional info about it
func (*API) CreatePlanning ¶
func (p *API) CreatePlanning(req *CreatePlanningReq, resp *CreatePlanningResp) error
CreatePlanning creates new planning and return PlanningID
func (*API) GetOpenPlannings ¶
func (p *API) GetOpenPlannings(req *GetOpenPlanningsReg, resp *GetOpenPlanningsResp) error
GetOpenPlannings returns all open plannings for user
func (*API) SetActive ¶
func (p *API) SetActive(req *SetActiveReq, resp *struct{}) error
SetActive set active planning for user
func (*API) SetExtra ¶
func (p *API) SetExtra(req *SetExtraReq, _ *struct{}) error
SetExtra add extra time to estimation of planning
func (*API) SetSpent ¶
func (p *API) SetSpent(req *SetSpentReq, resp *struct{}) error
SetSpent add spent time for planning
func (*API) SpentTime ¶
func (p *API) SpentTime(req *SpentTimeReq, resp *SpentTimeResp) error
SpentTime returns user's spent time for period
type ClosePlanningReq ¶
type ClosePlanningReq struct { Context ctxtg.Context PlanningID entities.PlanningID Progress int Time int64 }
ClosePlanningReq is input parameter to ClosePlanning
type CreatePlanningReq ¶
type CreatePlanningReq struct { Context ctxtg.Context ProjectID entities.ProjectID TrackerID entities.TrackerID IssueID entities.IssueID IssueTitle string IssueURL string IssueEstimation int64 IssueDueDate int64 IssueDone int ActivityID entities.ActivityID Estimation int64 }
CreatePlanningReq is input argument to CreatePlanning
type CreatePlanningResp ¶
type CreatePlanningResp struct {
PlanningID entities.PlanningID
}
CreatePlanningResp is response from CreatePlanning
type GetOpenPlanningsReg ¶
GetOpenPlanningsReg is input parameter to GetOpenPlannings
type GetOpenPlanningsResp ¶
type GetOpenPlanningsResp struct {
Plannings []entities.ExtendedPlanning
}
GetOpenPlanningsResp is output from GetOpenPlannings
type PlanningService ¶
type PlanningService interface { ClosePlanning(context.Context, ctxtg.UserID, entities.PlanningReport) error SetActive(context.Context, entities.NewActivePlanning) error AddSpentTime(context.Context, entities.SpentTimeReport) error OpenedPlannings(context.Context, ctxtg.UserID) ([]entities.ExtendedPlanning, error) SpentTime(context.Context, ctxtg.UserID, int64, int64) (int, error) }
PlanningService is required dependency for API
type PlanningStorage ¶
type PlanningStorage interface { CreatePlanning(context.Context, entities.NewPlanning) (entities.PlanningID, error) AddExtraTime(context.Context, ctxtg.UserID, entities.PlannedTime) error }
PlanningStorage is required dependency for API
type RPCConfig ¶
type RPCConfig struct { TokenParser ctxtg.TokenParser PlanningService PlanningService PlanningStorage PlanningStorage }
RPCConfig is dependencies configuration for rpcsvc
type SetActiveReq ¶
type SetActiveReq struct { Context ctxtg.Context PlanningID entities.PlanningID Time int64 }
SetActiveReq is input parameter to SetActive
type SetExtraReq ¶
type SetExtraReq struct { Context ctxtg.Context PlanningID entities.PlanningID Estimation int64 Reason string }
SetExtraReq is input parameter to SetExtra
type SetSpentReq ¶
type SetSpentReq struct { Context ctxtg.Context PlanningID entities.PlanningID Spent int Time int64 }
SetSpentReq is input parameter ti SetSpent
type SpentTimeReq ¶
SpentTimeReq is input parameter to SpentTime