server

package
v0.0.0-...-caf4afc Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(taskRPC *TaskRPC) *Server

func (*Server) RunServer

func (srv *Server) RunServer(port int)

RunServer @title Task Store @version 1.0 @description Task store - accepts commands and exposes JSON-RPC API @termsOfService http://swagger.io/terms/ @contact.name Alex @contact.email abondar24@yahoo.com @license.name MIT @host localhost:8081 @BasePath /

type TaskRPC

type TaskRPC struct {
	// contains filtered or unexported fields
}

func NewTaskRPC

func NewTaskRPC(taskService service.TaskService) *TaskRPC

func (*TaskRPC) GetTask

func (tr *TaskRPC) GetTask(r *http.Request, id *string, response *data.Task) error

GetTask @Summary Get tasks @Description fetch task by id,status or history. By id or status data.task is returned @Tags tasks @Accept json @Produce json @Param rpcRequest body rpc.TaskRPCRequest true "RPC Request" @Param rpcRequest body rpc.TaskRPCRequest true "RPC Request for status" @Success 200 {object} data.Task @Success 200 {object} data.TaskHistory @BadRequest 400 @Router /rpc [post]

func (*TaskRPC) GetTaskHistory

func (tr *TaskRPC) GetTaskHistory(r *http.Request, id *string, response *data.TaskHistory) error

func (*TaskRPC) GetTasksByStatus

func (tr *TaskRPC) GetTasksByStatus(r *http.Request, args *rpc.StatusArgs, response *[]*data.Task) error

Jump to

Keyboard shortcuts

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