Documentation
¶
Index ¶
- func InternalError(err error) error
- type AgentRepository
- type AgentService
- func (s *AgentService) GetTask(ctx context.Context, _ *emptypb.Empty) (*calculatorv1.GetTaskResponse, error)
- func (s *AgentService) Register(srv *grpc.Server)
- func (s *AgentService) RegisterGRPCGateway(ctx context.Context, mux *runtime.ServeMux, clientOpts []grpc.DialOption) error
- func (s *AgentService) SubmitTaskResult(ctx context.Context, req *calculatorv1.SubmitTaskResultRequest) (*emptypb.Empty, error)
- type Calculator
- type CalculatorRepository
- type CalculatorService
- func (s *CalculatorService) Calculate(ctx context.Context, req *calculatorv1.CalculateRequest) (*calculatorv1.CalculateResponse, error)
- func (s *CalculatorService) GetExpression(ctx context.Context, req *calculatorv1.GetExpressionRequest) (*calculatorv1.GetExpressionResponse, error)
- func (s *CalculatorService) ListExpressions(ctx context.Context, _ *emptypb.Empty) (*calculatorv1.ListExpressionsResponse, error)
- func (s *CalculatorService) Register(srv *grpc.Server)
- func (s *CalculatorService) RegisterGRPCGateway(ctx context.Context, mux *runtime.ServeMux, clientOpts []grpc.DialOption) error
- type InternalRepository
- type InternalService
- func (s *InternalService) ListExpressionTasks(ctx context.Context, req *calculatorv1.ListExpressionTasksRequest) (*calculatorv1.ListExpressionTasksResponse, error)
- func (s *InternalService) Register(srv *grpc.Server)
- func (s *InternalService) RegisterGRPCGateway(ctx context.Context, mux *runtime.ServeMux, clientOpts []grpc.DialOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InternalError ¶
Types ¶
type AgentRepository ¶
type AgentService ¶
type AgentService struct { calculatorv1.UnimplementedAgentServiceServer // contains filtered or unexported fields }
func NewAgentService ¶
func NewAgentService(conf *config.Config, log *slog.Logger, repo AgentRepository) *AgentService
func (*AgentService) GetTask ¶
func (s *AgentService) GetTask(ctx context.Context, _ *emptypb.Empty) (*calculatorv1.GetTaskResponse, error)
func (*AgentService) Register ¶
func (s *AgentService) Register(srv *grpc.Server)
func (*AgentService) RegisterGRPCGateway ¶
func (s *AgentService) RegisterGRPCGateway(ctx context.Context, mux *runtime.ServeMux, clientOpts []grpc.DialOption) error
func (*AgentService) SubmitTaskResult ¶
func (s *AgentService) SubmitTaskResult(ctx context.Context, req *calculatorv1.SubmitTaskResultRequest) (*emptypb.Empty, error)
type Calculator ¶
type CalculatorRepository ¶
type CalculatorRepository interface { CreateExpression(context.Context, models.CreateExpressionCmd, []models.CreateExpressionTaskCmd) (string, error) ListExpressions(context.Context) ([]models.Expression, error) GetExpression(context.Context, string) (models.Expression, error) }
type CalculatorService ¶
type CalculatorService struct { calculatorv1.UnimplementedCalculatorServiceServer // contains filtered or unexported fields }
func NewCalculatorService ¶
func NewCalculatorService(conf *config.Config, log *slog.Logger, calc Calculator, repo CalculatorRepository) *CalculatorService
func (*CalculatorService) Calculate ¶
func (s *CalculatorService) Calculate( ctx context.Context, req *calculatorv1.CalculateRequest, ) (*calculatorv1.CalculateResponse, error)
func (*CalculatorService) GetExpression ¶
func (s *CalculatorService) GetExpression( ctx context.Context, req *calculatorv1.GetExpressionRequest, ) (*calculatorv1.GetExpressionResponse, error)
func (*CalculatorService) ListExpressions ¶
func (s *CalculatorService) ListExpressions(ctx context.Context, _ *emptypb.Empty) (*calculatorv1.ListExpressionsResponse, error)
func (*CalculatorService) Register ¶
func (s *CalculatorService) Register(srv *grpc.Server)
func (*CalculatorService) RegisterGRPCGateway ¶
func (s *CalculatorService) RegisterGRPCGateway(ctx context.Context, mux *runtime.ServeMux, clientOpts []grpc.DialOption) error
type InternalRepository ¶
type InternalService ¶
type InternalService struct { calculatorv1.UnimplementedInternalServiceServer // contains filtered or unexported fields }
func NewInternalService ¶
func NewInternalService(conf *config.Config, log *slog.Logger, repo InternalRepository) *InternalService
func (*InternalService) ListExpressionTasks ¶
func (s *InternalService) ListExpressionTasks( ctx context.Context, req *calculatorv1.ListExpressionTasksRequest, ) (*calculatorv1.ListExpressionTasksResponse, error)
func (*InternalService) Register ¶
func (s *InternalService) Register(srv *grpc.Server)
func (*InternalService) RegisterGRPCGateway ¶
func (s *InternalService) RegisterGRPCGateway(ctx context.Context, mux *runtime.ServeMux, clientOpts []grpc.DialOption) error
Click to show internal directories.
Click to hide internal directories.