schedulerpb

package
v0.0.0-...-e7a328b Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CoroutinesAmount int = 4

Variables

View Source
var Api_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "schedulerpb.Api",
	HandlerType: (*ApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddOrder",
			Handler:    _Api_AddOrder_Handler,
		},
		{
			MethodName: "FindManyOrders",
			Handler:    _Api_FindManyOrders_Handler,
		},
		{
			MethodName: "CancelOrder",
			Handler:    _Api_CancelOrder_Handler,
		},
		{
			MethodName: "FindManyAvaliableTimeSlots",
			Handler:    _Api_FindManyAvaliableTimeSlots_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "schedulerpb.proto",
}

Api_ServiceDesc is the grpc.ServiceDesc for Api service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_schedulerpb_proto protoreflect.FileDescriptor

Functions

func GetAllTimeSlots

func GetAllTimeSlots(
	ctx context.Context,
	conns *grpc.GRPCConns,
	request *employeespb.TimeSlotsRequest,
) (*employeespb.TimeSlotsReply, error)

func RegisterApiServer

func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer)

func SplitWork

func SplitWork[T any](collection []T, workerAmount int) [][]T

Types

type AddOrderRequest

type AddOrderRequest struct {
	CustomerId *string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3,oneof" json:"customer_id,omitempty"`
	CompanyId  *string `protobuf:"bytes,2,opt,name=company_id,json=companyId,proto3,oneof" json:"company_id,omitempty"`
	ServiceId  *string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3,oneof" json:"service_id,omitempty"`
	EmployeeId *string `protobuf:"bytes,4,opt,name=employee_id,json=employeeId,proto3,oneof" json:"employee_id,omitempty"`
	StartTime  *int64  `protobuf:"varint,5,opt,name=start_time,json=startTime,proto3,oneof" json:"start_time,omitempty"`
	EndTime    *int64  `protobuf:"varint,6,opt,name=end_time,json=endTime,proto3,oneof" json:"end_time,omitempty"`
	// contains filtered or unexported fields
}

func (*AddOrderRequest) Descriptor deprecated

func (*AddOrderRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddOrderRequest.ProtoReflect.Descriptor instead.

func (*AddOrderRequest) GetCompanyId

func (x *AddOrderRequest) GetCompanyId() string

func (*AddOrderRequest) GetCustomerId

func (x *AddOrderRequest) GetCustomerId() string

func (*AddOrderRequest) GetEmployeeId

func (x *AddOrderRequest) GetEmployeeId() string

func (*AddOrderRequest) GetEndTime

func (x *AddOrderRequest) GetEndTime() int64

func (*AddOrderRequest) GetServiceId

func (x *AddOrderRequest) GetServiceId() string

func (*AddOrderRequest) GetStartTime

func (x *AddOrderRequest) GetStartTime() int64

func (*AddOrderRequest) ProtoMessage

func (*AddOrderRequest) ProtoMessage()

func (*AddOrderRequest) ProtoReflect

func (x *AddOrderRequest) ProtoReflect() protoreflect.Message

func (*AddOrderRequest) Reset

func (x *AddOrderRequest) Reset()

func (*AddOrderRequest) String

func (x *AddOrderRequest) String() string

type ApiClient

type ApiClient interface {
	AddOrder(ctx context.Context, in *AddOrderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	FindManyOrders(ctx context.Context, in *OrdersRequest, opts ...grpc.CallOption) (*OrdersReply, error)
	CancelOrder(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	FindManyAvaliableTimeSlots(ctx context.Context, in *AvaliableTimeSlotsRequest, opts ...grpc.CallOption) (*AvaliableTimeSlotsReply, error)
}

ApiClient is the client API for Api service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewApiClient

func NewApiClient(cc grpc.ClientConnInterface) ApiClient

type ApiServer

type ApiServer interface {
	AddOrder(context.Context, *AddOrderRequest) (*emptypb.Empty, error)
	FindManyOrders(context.Context, *OrdersRequest) (*OrdersReply, error)
	CancelOrder(context.Context, *CancelRequest) (*emptypb.Empty, error)
	FindManyAvaliableTimeSlots(context.Context, *AvaliableTimeSlotsRequest) (*AvaliableTimeSlotsReply, error)
	// contains filtered or unexported methods
}

ApiServer is the server API for Api service. All implementations must embed UnimplementedApiServer for forward compatibility

type AvaliableTimeSlotsReply

type AvaliableTimeSlotsReply struct {
	EmployeeTimeSlots []*EmployeeTimeSlot `protobuf:"bytes,1,rep,name=employee_time_slots,json=employeeTimeSlots,proto3" json:"employee_time_slots,omitempty"`
	// contains filtered or unexported fields
}

func GetAllAvaliableTimesSlots

func GetAllAvaliableTimesSlots(
	ctx context.Context,
	client *mongo.Client,
	conns *grpc.GRPCConns,
	request *AvaliableTimeSlotsRequest,
) (*AvaliableTimeSlotsReply, error)

func (*AvaliableTimeSlotsReply) Descriptor deprecated

func (*AvaliableTimeSlotsReply) Descriptor() ([]byte, []int)

Deprecated: Use AvaliableTimeSlotsReply.ProtoReflect.Descriptor instead.

func (*AvaliableTimeSlotsReply) GetEmployeeTimeSlots

func (x *AvaliableTimeSlotsReply) GetEmployeeTimeSlots() []*EmployeeTimeSlot

func (*AvaliableTimeSlotsReply) ProtoMessage

func (*AvaliableTimeSlotsReply) ProtoMessage()

func (*AvaliableTimeSlotsReply) ProtoReflect

func (x *AvaliableTimeSlotsReply) ProtoReflect() protoreflect.Message

func (*AvaliableTimeSlotsReply) Reset

func (x *AvaliableTimeSlotsReply) Reset()

func (*AvaliableTimeSlotsReply) String

func (x *AvaliableTimeSlotsReply) String() string

type AvaliableTimeSlotsRequest

type AvaliableTimeSlotsRequest struct {
	CompanyId       *string `protobuf:"bytes,1,opt,name=company_id,json=companyId,proto3,oneof" json:"company_id,omitempty"`
	ServiceId       *string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3,oneof" json:"service_id,omitempty"`
	ServiceDuration *int32  `protobuf:"varint,3,opt,name=service_duration,json=serviceDuration,proto3,oneof" json:"service_duration,omitempty"`
	Date            *int64  `protobuf:"varint,4,opt,name=date,proto3,oneof" json:"date,omitempty"`
	StartValue      *string `protobuf:"bytes,5,opt,name=start_value,json=startValue,proto3,oneof" json:"start_value,omitempty"`
	NPerPage        *int64  `protobuf:"varint,6,opt,name=n_per_page,json=nPerPage,proto3,oneof" json:"n_per_page,omitempty"`
	// contains filtered or unexported fields
}

func (*AvaliableTimeSlotsRequest) Descriptor deprecated

func (*AvaliableTimeSlotsRequest) Descriptor() ([]byte, []int)

Deprecated: Use AvaliableTimeSlotsRequest.ProtoReflect.Descriptor instead.

func (*AvaliableTimeSlotsRequest) GetCompanyId

func (x *AvaliableTimeSlotsRequest) GetCompanyId() string

func (*AvaliableTimeSlotsRequest) GetDate

func (x *AvaliableTimeSlotsRequest) GetDate() int64

func (*AvaliableTimeSlotsRequest) GetNPerPage

func (x *AvaliableTimeSlotsRequest) GetNPerPage() int64

func (*AvaliableTimeSlotsRequest) GetServiceDuration

func (x *AvaliableTimeSlotsRequest) GetServiceDuration() int32

func (*AvaliableTimeSlotsRequest) GetServiceId

func (x *AvaliableTimeSlotsRequest) GetServiceId() string

func (*AvaliableTimeSlotsRequest) GetStartValue

func (x *AvaliableTimeSlotsRequest) GetStartValue() string

func (*AvaliableTimeSlotsRequest) ProtoMessage

func (*AvaliableTimeSlotsRequest) ProtoMessage()

func (*AvaliableTimeSlotsRequest) ProtoReflect

func (*AvaliableTimeSlotsRequest) Reset

func (x *AvaliableTimeSlotsRequest) Reset()

func (*AvaliableTimeSlotsRequest) String

func (x *AvaliableTimeSlotsRequest) String() string

type CancelRequest

type CancelRequest struct {
	Id         *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
	CustomerId *string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3,oneof" json:"customer_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CancelRequest) Descriptor deprecated

func (*CancelRequest) Descriptor() ([]byte, []int)

Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead.

func (*CancelRequest) GetCustomerId

func (x *CancelRequest) GetCustomerId() string

func (*CancelRequest) GetId

func (x *CancelRequest) GetId() string

func (*CancelRequest) ProtoMessage

func (*CancelRequest) ProtoMessage()

func (*CancelRequest) ProtoReflect

func (x *CancelRequest) ProtoReflect() protoreflect.Message

func (*CancelRequest) Reset

func (x *CancelRequest) Reset()

func (*CancelRequest) String

func (x *CancelRequest) String() string

type EmployeeTimeSlot

type EmployeeTimeSlot struct {
	Id        *string     `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
	Name      *string     `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Surname   *string     `protobuf:"bytes,3,opt,name=surname,proto3,oneof" json:"surname,omitempty"`
	TimeSlots []*TimeSlot `protobuf:"bytes,4,rep,name=time_slots,json=timeSlots,proto3" json:"time_slots,omitempty"`
	// contains filtered or unexported fields
}

func (*EmployeeTimeSlot) Descriptor deprecated

func (*EmployeeTimeSlot) Descriptor() ([]byte, []int)

Deprecated: Use EmployeeTimeSlot.ProtoReflect.Descriptor instead.

func (*EmployeeTimeSlot) GetId

func (x *EmployeeTimeSlot) GetId() string

func (*EmployeeTimeSlot) GetName

func (x *EmployeeTimeSlot) GetName() string

func (*EmployeeTimeSlot) GetSurname

func (x *EmployeeTimeSlot) GetSurname() string

func (*EmployeeTimeSlot) GetTimeSlots

func (x *EmployeeTimeSlot) GetTimeSlots() []*TimeSlot

func (*EmployeeTimeSlot) ProtoMessage

func (*EmployeeTimeSlot) ProtoMessage()

func (*EmployeeTimeSlot) ProtoReflect

func (x *EmployeeTimeSlot) ProtoReflect() protoreflect.Message

func (*EmployeeTimeSlot) Reset

func (x *EmployeeTimeSlot) Reset()

func (*EmployeeTimeSlot) String

func (x *EmployeeTimeSlot) String() string

type Order

type Order struct {
	Id         *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
	CustomerId *string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3,oneof" json:"customer_id,omitempty"`
	CompanyId  *string `protobuf:"bytes,3,opt,name=company_id,json=companyId,proto3,oneof" json:"company_id,omitempty"`
	ServiceId  *string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3,oneof" json:"service_id,omitempty"`
	EmployeeId *string `protobuf:"bytes,5,opt,name=employee_id,json=employeeId,proto3,oneof" json:"employee_id,omitempty"`
	OrderTime  *int64  `protobuf:"varint,6,opt,name=order_time,json=orderTime,proto3,oneof" json:"order_time,omitempty"`
	IsCanceled *bool   `protobuf:"varint,7,opt,name=is_canceled,json=isCanceled,proto3,oneof" json:"is_canceled,omitempty"`
	// contains filtered or unexported fields
}

func (*Order) Descriptor deprecated

func (*Order) Descriptor() ([]byte, []int)

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetCompanyId

func (x *Order) GetCompanyId() string

func (*Order) GetCustomerId

func (x *Order) GetCustomerId() string

func (*Order) GetEmployeeId

func (x *Order) GetEmployeeId() string

func (*Order) GetId

func (x *Order) GetId() string

func (*Order) GetIsCanceled

func (x *Order) GetIsCanceled() bool

func (*Order) GetOrderTime

func (x *Order) GetOrderTime() int64

func (*Order) GetServiceId

func (x *Order) GetServiceId() string

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

func (x *Order) ProtoReflect() protoreflect.Message

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type OrdersReply

type OrdersReply struct {
	Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
	// contains filtered or unexported fields
}

func (*OrdersReply) Descriptor deprecated

func (*OrdersReply) Descriptor() ([]byte, []int)

Deprecated: Use OrdersReply.ProtoReflect.Descriptor instead.

func (*OrdersReply) GetOrders

func (x *OrdersReply) GetOrders() []*Order

func (*OrdersReply) ProtoMessage

func (*OrdersReply) ProtoMessage()

func (*OrdersReply) ProtoReflect

func (x *OrdersReply) ProtoReflect() protoreflect.Message

func (*OrdersReply) Reset

func (x *OrdersReply) Reset()

func (*OrdersReply) String

func (x *OrdersReply) String() string

type OrdersRequest

type OrdersRequest struct {
	CustomerId *string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3,oneof" json:"customer_id,omitempty"`
	CompanyId  *string `protobuf:"bytes,2,opt,name=company_id,json=companyId,proto3,oneof" json:"company_id,omitempty"`
	IsCanceled *bool   `protobuf:"varint,3,opt,name=is_canceled,json=isCanceled,proto3,oneof" json:"is_canceled,omitempty"`
	NPerPage   *int64  `protobuf:"varint,4,opt,name=n_per_page,json=nPerPage,proto3,oneof" json:"n_per_page,omitempty"`
	StartValue *string `protobuf:"bytes,5,opt,name=start_value,json=startValue,proto3,oneof" json:"start_value,omitempty"`
	StartDate  *int64  `protobuf:"varint,6,opt,name=start_date,json=startDate,proto3,oneof" json:"start_date,omitempty"`
	// contains filtered or unexported fields
}

func (*OrdersRequest) Descriptor deprecated

func (*OrdersRequest) Descriptor() ([]byte, []int)

Deprecated: Use OrdersRequest.ProtoReflect.Descriptor instead.

func (*OrdersRequest) GetCompanyId

func (x *OrdersRequest) GetCompanyId() string

func (*OrdersRequest) GetCustomerId

func (x *OrdersRequest) GetCustomerId() string

func (*OrdersRequest) GetIsCanceled

func (x *OrdersRequest) GetIsCanceled() bool

func (*OrdersRequest) GetNPerPage

func (x *OrdersRequest) GetNPerPage() int64

func (*OrdersRequest) GetStartDate

func (x *OrdersRequest) GetStartDate() int64

func (*OrdersRequest) GetStartValue

func (x *OrdersRequest) GetStartValue() string

func (*OrdersRequest) ProtoMessage

func (*OrdersRequest) ProtoMessage()

func (*OrdersRequest) ProtoReflect

func (x *OrdersRequest) ProtoReflect() protoreflect.Message

func (*OrdersRequest) Reset

func (x *OrdersRequest) Reset()

func (*OrdersRequest) String

func (x *OrdersRequest) String() string

type Server

type Server struct {
	UnimplementedApiServer
	Client *mongo.Client
	Conns  *mygrpc.GRPCConns
}

func (*Server) AddOrder

func (s *Server) AddOrder(
	ctx context.Context,
	request *AddOrderRequest,
) (*emptypb.Empty, error)

func (*Server) CancelOrder

func (s *Server) CancelOrder(
	ctx context.Context,
	request *CancelRequest,
) (*emptypb.Empty, error)

func (*Server) FindManyAvaliableTimeSlots

func (s *Server) FindManyAvaliableTimeSlots(
	ctx context.Context,
	request *AvaliableTimeSlotsRequest,
) (*AvaliableTimeSlotsReply, error)

func (*Server) FindManyOrders

func (s *Server) FindManyOrders(
	ctx context.Context,
	request *OrdersRequest,
) (*OrdersReply, error)

type TimeSlot

type TimeSlot struct {
	StartTime *int64 `protobuf:"varint,1,opt,name=start_time,json=startTime,proto3,oneof" json:"start_time,omitempty"`
	EndTime   *int64 `protobuf:"varint,2,opt,name=end_time,json=endTime,proto3,oneof" json:"end_time,omitempty"`
	// contains filtered or unexported fields
}

func (*TimeSlot) Descriptor deprecated

func (*TimeSlot) Descriptor() ([]byte, []int)

Deprecated: Use TimeSlot.ProtoReflect.Descriptor instead.

func (*TimeSlot) GetEndTime

func (x *TimeSlot) GetEndTime() int64

func (*TimeSlot) GetStartTime

func (x *TimeSlot) GetStartTime() int64

func (*TimeSlot) ProtoMessage

func (*TimeSlot) ProtoMessage()

func (*TimeSlot) ProtoReflect

func (x *TimeSlot) ProtoReflect() protoreflect.Message

func (*TimeSlot) Reset

func (x *TimeSlot) Reset()

func (*TimeSlot) String

func (x *TimeSlot) String() string

type UnimplementedApiServer

type UnimplementedApiServer struct {
}

UnimplementedApiServer must be embedded to have forward compatible implementations.

func (UnimplementedApiServer) AddOrder

func (UnimplementedApiServer) CancelOrder

func (UnimplementedApiServer) FindManyAvaliableTimeSlots

func (UnimplementedApiServer) FindManyOrders

type UnsafeApiServer

type UnsafeApiServer interface {
	// contains filtered or unexported methods
}

UnsafeApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ApiServer will result in compilation errors.

Jump to

Keyboard shortcuts

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