service

package
v0.0.0-...-13a942c Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalError

func InternalError(err error) error

Types

type AgentRepository

type AgentRepository interface {
	GetPendingTask(context.Context) (models.Task, error)
	FinishTask(context.Context, models.FinishTaskCmd) error
}

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 (*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

type Calculator

type Calculator interface {
	Parse(string) ([]calctypes.Token, error)
	Schedule([]calctypes.Token) []calctypes.Task
}

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 (*CalculatorService) GetExpression

func (*CalculatorService) ListExpressions

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 InternalRepository interface {
	ListExpressionTasks(context.Context, string) ([]models.Task, error)
}

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) 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

Jump to

Keyboard shortcuts

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