rpcsvc

package
v0.0.0-...-46b8622 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 10 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(c RPCConfig)

Init setups and registers JSON-RPC handlers

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

func (*API) Version

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

Version returns current project narada version

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

type GetOpenPlanningsReg struct {
	Context ctxtg.Context
}

GetOpenPlanningsReg is input parameter to GetOpenPlannings

type GetOpenPlanningsResp

type GetOpenPlanningsResp struct {
	Plannings []entities.ExtendedPlanning
}

GetOpenPlanningsResp is output from GetOpenPlannings

type PlanningService

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

type SpentTimeReq struct {
	Context ctxtg.Context
	From    int64
	To      int64
}

SpentTimeReq is input parameter to SpentTime

type SpentTimeResp

type SpentTimeResp struct {
	Spent int
}

SpentTimeResp is output from SpentTime

Jump to

Keyboard shortcuts

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