v1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrainerService_IsHourAvailable_FullMethodName          = "/trainer.TrainerService/IsHourAvailable"
	TrainerService_ScheduleTraining_FullMethodName         = "/trainer.TrainerService/ScheduleTraining"
	TrainerService_CancelTraining_FullMethodName           = "/trainer.TrainerService/CancelTraining"
	TrainerService_GetTrainerAvailableHours_FullMethodName = "/trainer.TrainerService/GetTrainerAvailableHours"
	TrainerService_MakeHourAvailable_FullMethodName        = "/trainer.TrainerService/MakeHourAvailable"
	TrainerService_MakeHourUnavailable_FullMethodName      = "/trainer.TrainerService/MakeHourUnavailable"
)
View Source
const OperationTrainerServiceGetTrainerAvailableHours = "/trainer.TrainerService/GetTrainerAvailableHours"
View Source
const OperationTrainerServiceMakeHourAvailable = "/trainer.TrainerService/MakeHourAvailable"
View Source
const OperationTrainerServiceMakeHourUnavailable = "/trainer.TrainerService/MakeHourUnavailable"

Variables

View Source
var (
	TrainerErrorReason_name = map[int32]string{
		0: "USER_NOT_FOUND",
		1: "USER_AUTH_FAIL",
		2: "INCORRECT_INPUT",
		3: "QUERY_FAIL",
		4: "CANCEL_TRAINING_FAIL",
		5: "UPDATE_AVAILABILITY_FAIL",
	}
	TrainerErrorReason_value = map[string]int32{
		"USER_NOT_FOUND":           0,
		"USER_AUTH_FAIL":           1,
		"INCORRECT_INPUT":          2,
		"QUERY_FAIL":               3,
		"CANCEL_TRAINING_FAIL":     4,
		"UPDATE_AVAILABILITY_FAIL": 5,
	}
)

Enum value maps for TrainerErrorReason.

View Source
var File_trainer_v1_error_reason_proto protoreflect.FileDescriptor
View Source
var File_trainer_v1_trainer_proto protoreflect.FileDescriptor
View Source
var TrainerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "trainer.TrainerService",
	HandlerType: (*TrainerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "IsHourAvailable",
			Handler:    _TrainerService_IsHourAvailable_Handler,
		},
		{
			MethodName: "ScheduleTraining",
			Handler:    _TrainerService_ScheduleTraining_Handler,
		},
		{
			MethodName: "CancelTraining",
			Handler:    _TrainerService_CancelTraining_Handler,
		},
		{
			MethodName: "GetTrainerAvailableHours",
			Handler:    _TrainerService_GetTrainerAvailableHours_Handler,
		},
		{
			MethodName: "MakeHourAvailable",
			Handler:    _TrainerService_MakeHourAvailable_Handler,
		},
		{
			MethodName: "MakeHourUnavailable",
			Handler:    _TrainerService_MakeHourUnavailable_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "trainer/v1/trainer.proto",
}

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

Functions

func ErrorCancelTrainingFail

func ErrorCancelTrainingFail(format string, args ...interface{}) *errors.Error

func ErrorIncorrectInput

func ErrorIncorrectInput(format string, args ...interface{}) *errors.Error

func ErrorQueryFail

func ErrorQueryFail(format string, args ...interface{}) *errors.Error

func ErrorUpdateAvailabilityFail

func ErrorUpdateAvailabilityFail(format string, args ...interface{}) *errors.Error

func ErrorUserAuthFail

func ErrorUserAuthFail(format string, args ...interface{}) *errors.Error

func ErrorUserNotFound

func ErrorUserNotFound(format string, args ...interface{}) *errors.Error

func IsCancelTrainingFail

func IsCancelTrainingFail(err error) bool

func IsIncorrectInput

func IsIncorrectInput(err error) bool

func IsQueryFail

func IsQueryFail(err error) bool

func IsUpdateAvailabilityFail

func IsUpdateAvailabilityFail(err error) bool

func IsUserAuthFail

func IsUserAuthFail(err error) bool

func IsUserNotFound

func IsUserNotFound(err error) bool

func RegisterTrainerServiceHTTPServer

func RegisterTrainerServiceHTTPServer(s *http.Server, srv TrainerServiceHTTPServer)

func RegisterTrainerServiceServer

func RegisterTrainerServiceServer(s grpc.ServiceRegistrar, srv TrainerServiceServer)

Types

type GetTrainerAvailableHoursRequest

type GetTrainerAvailableHoursRequest struct {
	DateFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=date_from,json=dateFrom,proto3" json:"date_from,omitempty"`
	DateTo   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=date_to,json=dateTo,proto3" json:"date_to,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTrainerAvailableHoursRequest) Descriptor deprecated

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

Deprecated: Use GetTrainerAvailableHoursRequest.ProtoReflect.Descriptor instead.

func (*GetTrainerAvailableHoursRequest) GetDateFrom

func (*GetTrainerAvailableHoursRequest) GetDateTo

func (*GetTrainerAvailableHoursRequest) ProtoMessage

func (*GetTrainerAvailableHoursRequest) ProtoMessage()

func (*GetTrainerAvailableHoursRequest) ProtoReflect

func (*GetTrainerAvailableHoursRequest) Reset

func (*GetTrainerAvailableHoursRequest) String

type GetTrainerAvailableHoursRespone

type GetTrainerAvailableHoursRespone struct {
	Dates []*GetTrainerAvailableHoursRespone_Date `protobuf:"bytes,1,rep,name=dates,proto3" json:"dates,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTrainerAvailableHoursRespone) Descriptor deprecated

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

Deprecated: Use GetTrainerAvailableHoursRespone.ProtoReflect.Descriptor instead.

func (*GetTrainerAvailableHoursRespone) GetDates

func (*GetTrainerAvailableHoursRespone) ProtoMessage

func (*GetTrainerAvailableHoursRespone) ProtoMessage()

func (*GetTrainerAvailableHoursRespone) ProtoReflect

func (*GetTrainerAvailableHoursRespone) Reset

func (*GetTrainerAvailableHoursRespone) String

type GetTrainerAvailableHoursRespone_Date

type GetTrainerAvailableHoursRespone_Date struct {
	Date         *timestamppb.Timestamp                  `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"`
	HasFreeHours bool                                    `protobuf:"varint,2,opt,name=Has_free_hours,json=HasFreeHours,proto3" json:"Has_free_hours,omitempty"`
	Hours        []*GetTrainerAvailableHoursRespone_Hour `protobuf:"bytes,3,rep,name=hours,proto3" json:"hours,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTrainerAvailableHoursRespone_Date) Descriptor deprecated

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

Deprecated: Use GetTrainerAvailableHoursRespone_Date.ProtoReflect.Descriptor instead.

func (*GetTrainerAvailableHoursRespone_Date) GetDate

func (*GetTrainerAvailableHoursRespone_Date) GetHasFreeHours

func (x *GetTrainerAvailableHoursRespone_Date) GetHasFreeHours() bool

func (*GetTrainerAvailableHoursRespone_Date) GetHours

func (*GetTrainerAvailableHoursRespone_Date) ProtoMessage

func (*GetTrainerAvailableHoursRespone_Date) ProtoMessage()

func (*GetTrainerAvailableHoursRespone_Date) ProtoReflect

func (*GetTrainerAvailableHoursRespone_Date) Reset

func (*GetTrainerAvailableHoursRespone_Date) String

type GetTrainerAvailableHoursRespone_Hour

type GetTrainerAvailableHoursRespone_Hour struct {
	Available            bool                   `protobuf:"varint,1,opt,name=available,proto3" json:"available,omitempty"`
	HasTrainingScheduled bool                   `protobuf:"varint,2,opt,name=has_training_scheduled,json=hasTrainingScheduled,proto3" json:"has_training_scheduled,omitempty"`
	Hour                 *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=hour,proto3" json:"hour,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTrainerAvailableHoursRespone_Hour) Descriptor deprecated

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

Deprecated: Use GetTrainerAvailableHoursRespone_Hour.ProtoReflect.Descriptor instead.

func (*GetTrainerAvailableHoursRespone_Hour) GetAvailable

func (x *GetTrainerAvailableHoursRespone_Hour) GetAvailable() bool

func (*GetTrainerAvailableHoursRespone_Hour) GetHasTrainingScheduled

func (x *GetTrainerAvailableHoursRespone_Hour) GetHasTrainingScheduled() bool

func (*GetTrainerAvailableHoursRespone_Hour) GetHour

func (*GetTrainerAvailableHoursRespone_Hour) ProtoMessage

func (*GetTrainerAvailableHoursRespone_Hour) ProtoMessage()

func (*GetTrainerAvailableHoursRespone_Hour) ProtoReflect

func (*GetTrainerAvailableHoursRespone_Hour) Reset

func (*GetTrainerAvailableHoursRespone_Hour) String

type IsHourAvailableRequest

type IsHourAvailableRequest struct {
	Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*IsHourAvailableRequest) Descriptor deprecated

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

Deprecated: Use IsHourAvailableRequest.ProtoReflect.Descriptor instead.

func (*IsHourAvailableRequest) GetTime

func (*IsHourAvailableRequest) ProtoMessage

func (*IsHourAvailableRequest) ProtoMessage()

func (*IsHourAvailableRequest) ProtoReflect

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

func (*IsHourAvailableRequest) Reset

func (x *IsHourAvailableRequest) Reset()

func (*IsHourAvailableRequest) String

func (x *IsHourAvailableRequest) String() string

type IsHourAvailableResponse

type IsHourAvailableResponse struct {
	IsAvailable bool `protobuf:"varint,1,opt,name=is_available,json=isAvailable,proto3" json:"is_available,omitempty"`
	// contains filtered or unexported fields
}

func (*IsHourAvailableResponse) Descriptor deprecated

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

Deprecated: Use IsHourAvailableResponse.ProtoReflect.Descriptor instead.

func (*IsHourAvailableResponse) GetIsAvailable

func (x *IsHourAvailableResponse) GetIsAvailable() bool

func (*IsHourAvailableResponse) ProtoMessage

func (*IsHourAvailableResponse) ProtoMessage()

func (*IsHourAvailableResponse) ProtoReflect

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

func (*IsHourAvailableResponse) Reset

func (x *IsHourAvailableResponse) Reset()

func (*IsHourAvailableResponse) String

func (x *IsHourAvailableResponse) String() string

type MakeHourAvailableRequest

type MakeHourAvailableRequest struct {
	Time []*timestamppb.Timestamp `protobuf:"bytes,1,rep,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*MakeHourAvailableRequest) Descriptor deprecated

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

Deprecated: Use MakeHourAvailableRequest.ProtoReflect.Descriptor instead.

func (*MakeHourAvailableRequest) GetTime

func (*MakeHourAvailableRequest) ProtoMessage

func (*MakeHourAvailableRequest) ProtoMessage()

func (*MakeHourAvailableRequest) ProtoReflect

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

func (*MakeHourAvailableRequest) Reset

func (x *MakeHourAvailableRequest) Reset()

func (*MakeHourAvailableRequest) String

func (x *MakeHourAvailableRequest) String() string

type MakeHourUnavailableRequest

type MakeHourUnavailableRequest struct {
	Time []*timestamppb.Timestamp `protobuf:"bytes,1,rep,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*MakeHourUnavailableRequest) Descriptor deprecated

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

Deprecated: Use MakeHourUnavailableRequest.ProtoReflect.Descriptor instead.

func (*MakeHourUnavailableRequest) GetTime

func (*MakeHourUnavailableRequest) ProtoMessage

func (*MakeHourUnavailableRequest) ProtoMessage()

func (*MakeHourUnavailableRequest) ProtoReflect

func (*MakeHourUnavailableRequest) Reset

func (x *MakeHourUnavailableRequest) Reset()

func (*MakeHourUnavailableRequest) String

func (x *MakeHourUnavailableRequest) String() string

type TrainerErrorReason

type TrainerErrorReason int32
const (
	TrainerErrorReason_USER_NOT_FOUND           TrainerErrorReason = 0
	TrainerErrorReason_USER_AUTH_FAIL           TrainerErrorReason = 1
	TrainerErrorReason_INCORRECT_INPUT          TrainerErrorReason = 2
	TrainerErrorReason_QUERY_FAIL               TrainerErrorReason = 3
	TrainerErrorReason_CANCEL_TRAINING_FAIL     TrainerErrorReason = 4
	TrainerErrorReason_UPDATE_AVAILABILITY_FAIL TrainerErrorReason = 5
)

func (TrainerErrorReason) Descriptor

func (TrainerErrorReason) Enum

func (TrainerErrorReason) EnumDescriptor deprecated

func (TrainerErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use TrainerErrorReason.Descriptor instead.

func (TrainerErrorReason) Number

func (TrainerErrorReason) String

func (x TrainerErrorReason) String() string

func (TrainerErrorReason) Type

type TrainerServiceClient

type TrainerServiceClient interface {
	IsHourAvailable(ctx context.Context, in *IsHourAvailableRequest, opts ...grpc.CallOption) (*IsHourAvailableResponse, error)
	ScheduleTraining(ctx context.Context, in *UpdateHourRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	CancelTraining(ctx context.Context, in *UpdateHourRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetTrainerAvailableHours(ctx context.Context, in *GetTrainerAvailableHoursRequest, opts ...grpc.CallOption) (*GetTrainerAvailableHoursRespone, error)
	MakeHourAvailable(ctx context.Context, in *MakeHourAvailableRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	MakeHourUnavailable(ctx context.Context, in *MakeHourUnavailableRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

TrainerServiceClient is the client API for TrainerService 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.

type TrainerServiceHTTPClient

type TrainerServiceHTTPClient interface {
	GetTrainerAvailableHours(ctx context.Context, req *GetTrainerAvailableHoursRequest, opts ...http.CallOption) (rsp *GetTrainerAvailableHoursRespone, err error)
	MakeHourAvailable(ctx context.Context, req *MakeHourAvailableRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
	MakeHourUnavailable(ctx context.Context, req *MakeHourUnavailableRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
}

func NewTrainerServiceHTTPClient

func NewTrainerServiceHTTPClient(client *http.Client) TrainerServiceHTTPClient

type TrainerServiceHTTPClientImpl

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

func (*TrainerServiceHTTPClientImpl) GetTrainerAvailableHours

func (*TrainerServiceHTTPClientImpl) MakeHourAvailable

func (*TrainerServiceHTTPClientImpl) MakeHourUnavailable

type TrainerServiceHTTPServer

type TrainerServiceHTTPServer interface {
	GetTrainerAvailableHours(context.Context, *GetTrainerAvailableHoursRequest) (*GetTrainerAvailableHoursRespone, error)
	MakeHourAvailable(context.Context, *MakeHourAvailableRequest) (*emptypb.Empty, error)
	MakeHourUnavailable(context.Context, *MakeHourUnavailableRequest) (*emptypb.Empty, error)
}

type TrainerServiceServer

type TrainerServiceServer interface {
	IsHourAvailable(context.Context, *IsHourAvailableRequest) (*IsHourAvailableResponse, error)
	ScheduleTraining(context.Context, *UpdateHourRequest) (*emptypb.Empty, error)
	CancelTraining(context.Context, *UpdateHourRequest) (*emptypb.Empty, error)
	GetTrainerAvailableHours(context.Context, *GetTrainerAvailableHoursRequest) (*GetTrainerAvailableHoursRespone, error)
	MakeHourAvailable(context.Context, *MakeHourAvailableRequest) (*emptypb.Empty, error)
	MakeHourUnavailable(context.Context, *MakeHourUnavailableRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

TrainerServiceServer is the server API for TrainerService service. All implementations must embed UnimplementedTrainerServiceServer for forward compatibility

type UnimplementedTrainerServiceServer

type UnimplementedTrainerServiceServer struct {
}

UnimplementedTrainerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTrainerServiceServer) CancelTraining

func (UnimplementedTrainerServiceServer) IsHourAvailable

func (UnimplementedTrainerServiceServer) MakeHourAvailable

func (UnimplementedTrainerServiceServer) MakeHourUnavailable

func (UnimplementedTrainerServiceServer) ScheduleTraining

type UnsafeTrainerServiceServer

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

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

type UpdateHourRequest

type UpdateHourRequest struct {
	Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateHourRequest) Descriptor deprecated

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

Deprecated: Use UpdateHourRequest.ProtoReflect.Descriptor instead.

func (*UpdateHourRequest) GetTime

func (x *UpdateHourRequest) GetTime() *timestamppb.Timestamp

func (*UpdateHourRequest) ProtoMessage

func (*UpdateHourRequest) ProtoMessage()

func (*UpdateHourRequest) ProtoReflect

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

func (*UpdateHourRequest) Reset

func (x *UpdateHourRequest) Reset()

func (*UpdateHourRequest) String

func (x *UpdateHourRequest) String() string

Jump to

Keyboard shortcuts

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