client

package
v0.0.0-...-a149260 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Form_FindByID_FullMethodName              = "/api.Form/FindByID"
	Form_FindByTeacherUsername_FullMethodName = "/api.Form/FindByTeacherUsername"
)

Variables

View Source
var Form_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.Form",
	HandlerType: (*FormServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FindByID",
			Handler:    _Form_FindByID_Handler,
		},
		{
			MethodName: "FindByTeacherUsername",
			Handler:    _Form_FindByTeacherUsername_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "form.proto",
}

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

Functions

func RegisterFormServer

func RegisterFormServer(s grpc.ServiceRegistrar, srv FormServer)

Types

type AnswerDTO

type AnswerDTO struct {
	Id        string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Text      string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	IsCorrect bool   `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3" json:"is_correct,omitempty"`
	// contains filtered or unexported fields
}

func (*AnswerDTO) Descriptor deprecated

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

Deprecated: Use AnswerDTO.ProtoReflect.Descriptor instead.

func (*AnswerDTO) GetId

func (x *AnswerDTO) GetId() string

func (*AnswerDTO) GetIsCorrect

func (x *AnswerDTO) GetIsCorrect() bool

func (*AnswerDTO) GetText

func (x *AnswerDTO) GetText() string

func (*AnswerDTO) ProtoMessage

func (*AnswerDTO) ProtoMessage()

func (*AnswerDTO) ProtoReflect

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

func (*AnswerDTO) Reset

func (x *AnswerDTO) Reset()

func (*AnswerDTO) String

func (x *AnswerDTO) String() string

func (*AnswerDTO) Validate

func (m *AnswerDTO) Validate() error

Validate checks the field values on AnswerDTO with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AnswerDTO) ValidateAll

func (m *AnswerDTO) ValidateAll() error

ValidateAll checks the field values on AnswerDTO with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AnswerDTOMultiError, or nil if none found.

type AnswerDTOMultiError

type AnswerDTOMultiError []error

AnswerDTOMultiError is an error wrapping multiple validation errors returned by AnswerDTO.ValidateAll() if the designated constraints aren't met.

func (AnswerDTOMultiError) AllErrors

func (m AnswerDTOMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AnswerDTOMultiError) Error

func (m AnswerDTOMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AnswerDTOValidationError

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

AnswerDTOValidationError is the validation error returned by AnswerDTO.Validate if the designated constraints aren't met.

func (AnswerDTOValidationError) Cause

func (e AnswerDTOValidationError) Cause() error

Cause function returns cause value.

func (AnswerDTOValidationError) Error

func (e AnswerDTOValidationError) Error() string

Error satisfies the builtin error interface

func (AnswerDTOValidationError) ErrorName

func (e AnswerDTOValidationError) ErrorName() string

ErrorName returns error name.

func (AnswerDTOValidationError) Field

func (e AnswerDTOValidationError) Field() string

Field function returns field value.

func (AnswerDTOValidationError) Key

Key function returns key value.

func (AnswerDTOValidationError) Reason

func (e AnswerDTOValidationError) Reason() string

Reason function returns reason value.

type FormClient

type FormClient interface {
	FindByID(ctx context.Context, in *FormFindByIDRequest, opts ...grpc.CallOption) (*FormFindByIDResponse, error)
	FindByTeacherUsername(ctx context.Context, in *FormFindByTeacherUsernameRequest, opts ...grpc.CallOption) (*FormFindByTeacherUsernameResponse, error)
}

FormClient is the client API for Form 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 NewFormClient

func NewFormClient(cc grpc.ClientConnInterface) FormClient

type FormDTO

type FormDTO struct {
	Id               string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name             string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	TeacherUsername  string                 `protobuf:"bytes,3,opt,name=teacher_username,json=teacherUsername,proto3" json:"teacher_username,omitempty"`
	Description      string                 `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	TestingBeginDate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=testing_begin_date,json=testingBeginDate,proto3" json:"testing_begin_date,omitempty"`
	TestingEndDate   *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=testing_end_date,json=testingEndDate,proto3" json:"testing_end_date,omitempty"`
	CreatedAt        *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	Questions        []*QuestionDTO         `protobuf:"bytes,8,rep,name=questions,proto3" json:"questions,omitempty"`
	// contains filtered or unexported fields
}

func (*FormDTO) Descriptor deprecated

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

Deprecated: Use FormDTO.ProtoReflect.Descriptor instead.

func (*FormDTO) GetCreatedAt

func (x *FormDTO) GetCreatedAt() *timestamppb.Timestamp

func (*FormDTO) GetDescription

func (x *FormDTO) GetDescription() string

func (*FormDTO) GetId

func (x *FormDTO) GetId() string

func (*FormDTO) GetName

func (x *FormDTO) GetName() string

func (*FormDTO) GetQuestions

func (x *FormDTO) GetQuestions() []*QuestionDTO

func (*FormDTO) GetTeacherUsername

func (x *FormDTO) GetTeacherUsername() string

func (*FormDTO) GetTestingBeginDate

func (x *FormDTO) GetTestingBeginDate() *timestamppb.Timestamp

func (*FormDTO) GetTestingEndDate

func (x *FormDTO) GetTestingEndDate() *timestamppb.Timestamp

func (*FormDTO) ProtoMessage

func (*FormDTO) ProtoMessage()

func (*FormDTO) ProtoReflect

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

func (*FormDTO) Reset

func (x *FormDTO) Reset()

func (*FormDTO) String

func (x *FormDTO) String() string

func (*FormDTO) Validate

func (m *FormDTO) Validate() error

Validate checks the field values on FormDTO with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FormDTO) ValidateAll

func (m *FormDTO) ValidateAll() error

ValidateAll checks the field values on FormDTO with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FormDTOMultiError, or nil if none found.

type FormDTOMultiError

type FormDTOMultiError []error

FormDTOMultiError is an error wrapping multiple validation errors returned by FormDTO.ValidateAll() if the designated constraints aren't met.

func (FormDTOMultiError) AllErrors

func (m FormDTOMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FormDTOMultiError) Error

func (m FormDTOMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FormDTOValidationError

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

FormDTOValidationError is the validation error returned by FormDTO.Validate if the designated constraints aren't met.

func (FormDTOValidationError) Cause

func (e FormDTOValidationError) Cause() error

Cause function returns cause value.

func (FormDTOValidationError) Error

func (e FormDTOValidationError) Error() string

Error satisfies the builtin error interface

func (FormDTOValidationError) ErrorName

func (e FormDTOValidationError) ErrorName() string

ErrorName returns error name.

func (FormDTOValidationError) Field

func (e FormDTOValidationError) Field() string

Field function returns field value.

func (FormDTOValidationError) Key

func (e FormDTOValidationError) Key() bool

Key function returns key value.

func (FormDTOValidationError) Reason

func (e FormDTOValidationError) Reason() string

Reason function returns reason value.

type FormFindByIDRequest

type FormFindByIDRequest struct {
	FormId string `protobuf:"bytes,1,opt,name=form_id,json=formId,proto3" json:"form_id,omitempty"`
	// contains filtered or unexported fields
}

func (*FormFindByIDRequest) Descriptor deprecated

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

Deprecated: Use FormFindByIDRequest.ProtoReflect.Descriptor instead.

func (*FormFindByIDRequest) GetFormId

func (x *FormFindByIDRequest) GetFormId() string

func (*FormFindByIDRequest) ProtoMessage

func (*FormFindByIDRequest) ProtoMessage()

func (*FormFindByIDRequest) ProtoReflect

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

func (*FormFindByIDRequest) Reset

func (x *FormFindByIDRequest) Reset()

func (*FormFindByIDRequest) String

func (x *FormFindByIDRequest) String() string

func (*FormFindByIDRequest) Validate

func (m *FormFindByIDRequest) Validate() error

Validate checks the field values on FormFindByIDRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FormFindByIDRequest) ValidateAll

func (m *FormFindByIDRequest) ValidateAll() error

ValidateAll checks the field values on FormFindByIDRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FormFindByIDRequestMultiError, or nil if none found.

type FormFindByIDRequestMultiError

type FormFindByIDRequestMultiError []error

FormFindByIDRequestMultiError is an error wrapping multiple validation errors returned by FormFindByIDRequest.ValidateAll() if the designated constraints aren't met.

func (FormFindByIDRequestMultiError) AllErrors

func (m FormFindByIDRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FormFindByIDRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type FormFindByIDRequestValidationError

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

FormFindByIDRequestValidationError is the validation error returned by FormFindByIDRequest.Validate if the designated constraints aren't met.

func (FormFindByIDRequestValidationError) Cause

Cause function returns cause value.

func (FormFindByIDRequestValidationError) Error

Error satisfies the builtin error interface

func (FormFindByIDRequestValidationError) ErrorName

ErrorName returns error name.

func (FormFindByIDRequestValidationError) Field

Field function returns field value.

func (FormFindByIDRequestValidationError) Key

Key function returns key value.

func (FormFindByIDRequestValidationError) Reason

Reason function returns reason value.

type FormFindByIDResponse

type FormFindByIDResponse struct {
	Form *FormDTO `protobuf:"bytes,1,opt,name=form,proto3" json:"form,omitempty"`
	// contains filtered or unexported fields
}

func (*FormFindByIDResponse) Descriptor deprecated

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

Deprecated: Use FormFindByIDResponse.ProtoReflect.Descriptor instead.

func (*FormFindByIDResponse) GetForm

func (x *FormFindByIDResponse) GetForm() *FormDTO

func (*FormFindByIDResponse) ProtoMessage

func (*FormFindByIDResponse) ProtoMessage()

func (*FormFindByIDResponse) ProtoReflect

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

func (*FormFindByIDResponse) Reset

func (x *FormFindByIDResponse) Reset()

func (*FormFindByIDResponse) String

func (x *FormFindByIDResponse) String() string

func (*FormFindByIDResponse) Validate

func (m *FormFindByIDResponse) Validate() error

Validate checks the field values on FormFindByIDResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FormFindByIDResponse) ValidateAll

func (m *FormFindByIDResponse) ValidateAll() error

ValidateAll checks the field values on FormFindByIDResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FormFindByIDResponseMultiError, or nil if none found.

type FormFindByIDResponseMultiError

type FormFindByIDResponseMultiError []error

FormFindByIDResponseMultiError is an error wrapping multiple validation errors returned by FormFindByIDResponse.ValidateAll() if the designated constraints aren't met.

func (FormFindByIDResponseMultiError) AllErrors

func (m FormFindByIDResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FormFindByIDResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type FormFindByIDResponseValidationError

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

FormFindByIDResponseValidationError is the validation error returned by FormFindByIDResponse.Validate if the designated constraints aren't met.

func (FormFindByIDResponseValidationError) Cause

Cause function returns cause value.

func (FormFindByIDResponseValidationError) Error

Error satisfies the builtin error interface

func (FormFindByIDResponseValidationError) ErrorName

ErrorName returns error name.

func (FormFindByIDResponseValidationError) Field

Field function returns field value.

func (FormFindByIDResponseValidationError) Key

Key function returns key value.

func (FormFindByIDResponseValidationError) Reason

Reason function returns reason value.

type FormFindByTeacherUsernameRequest

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

func (*FormFindByTeacherUsernameRequest) Descriptor deprecated

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

Deprecated: Use FormFindByTeacherUsernameRequest.ProtoReflect.Descriptor instead.

func (*FormFindByTeacherUsernameRequest) ProtoMessage

func (*FormFindByTeacherUsernameRequest) ProtoMessage()

func (*FormFindByTeacherUsernameRequest) ProtoReflect

func (*FormFindByTeacherUsernameRequest) Reset

func (*FormFindByTeacherUsernameRequest) String

func (*FormFindByTeacherUsernameRequest) Validate

Validate checks the field values on FormFindByTeacherUsernameRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FormFindByTeacherUsernameRequest) ValidateAll

func (m *FormFindByTeacherUsernameRequest) ValidateAll() error

ValidateAll checks the field values on FormFindByTeacherUsernameRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FormFindByTeacherUsernameRequestMultiError, or nil if none found.

type FormFindByTeacherUsernameRequestMultiError

type FormFindByTeacherUsernameRequestMultiError []error

FormFindByTeacherUsernameRequestMultiError is an error wrapping multiple validation errors returned by FormFindByTeacherUsernameRequest.ValidateAll() if the designated constraints aren't met.

func (FormFindByTeacherUsernameRequestMultiError) AllErrors

AllErrors returns a list of validation violation errors.

func (FormFindByTeacherUsernameRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type FormFindByTeacherUsernameRequestValidationError

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

FormFindByTeacherUsernameRequestValidationError is the validation error returned by FormFindByTeacherUsernameRequest.Validate if the designated constraints aren't met.

func (FormFindByTeacherUsernameRequestValidationError) Cause

Cause function returns cause value.

func (FormFindByTeacherUsernameRequestValidationError) Error

Error satisfies the builtin error interface

func (FormFindByTeacherUsernameRequestValidationError) ErrorName

ErrorName returns error name.

func (FormFindByTeacherUsernameRequestValidationError) Field

Field function returns field value.

func (FormFindByTeacherUsernameRequestValidationError) Key

Key function returns key value.

func (FormFindByTeacherUsernameRequestValidationError) Reason

Reason function returns reason value.

type FormFindByTeacherUsernameResponse

type FormFindByTeacherUsernameResponse struct {
	FoundForms []*FormDTO `protobuf:"bytes,1,rep,name=found_forms,json=foundForms,proto3" json:"found_forms,omitempty"`
	// contains filtered or unexported fields
}

func (*FormFindByTeacherUsernameResponse) Descriptor deprecated

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

Deprecated: Use FormFindByTeacherUsernameResponse.ProtoReflect.Descriptor instead.

func (*FormFindByTeacherUsernameResponse) GetFoundForms

func (x *FormFindByTeacherUsernameResponse) GetFoundForms() []*FormDTO

func (*FormFindByTeacherUsernameResponse) ProtoMessage

func (*FormFindByTeacherUsernameResponse) ProtoMessage()

func (*FormFindByTeacherUsernameResponse) ProtoReflect

func (*FormFindByTeacherUsernameResponse) Reset

func (*FormFindByTeacherUsernameResponse) String

func (*FormFindByTeacherUsernameResponse) Validate

Validate checks the field values on FormFindByTeacherUsernameResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FormFindByTeacherUsernameResponse) ValidateAll

func (m *FormFindByTeacherUsernameResponse) ValidateAll() error

ValidateAll checks the field values on FormFindByTeacherUsernameResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FormFindByTeacherUsernameResponseMultiError, or nil if none found.

type FormFindByTeacherUsernameResponseMultiError

type FormFindByTeacherUsernameResponseMultiError []error

FormFindByTeacherUsernameResponseMultiError is an error wrapping multiple validation errors returned by FormFindByTeacherUsernameResponse.ValidateAll() if the designated constraints aren't met.

func (FormFindByTeacherUsernameResponseMultiError) AllErrors

AllErrors returns a list of validation violation errors.

func (FormFindByTeacherUsernameResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type FormFindByTeacherUsernameResponseValidationError

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

FormFindByTeacherUsernameResponseValidationError is the validation error returned by FormFindByTeacherUsernameResponse.Validate if the designated constraints aren't met.

func (FormFindByTeacherUsernameResponseValidationError) Cause

Cause function returns cause value.

func (FormFindByTeacherUsernameResponseValidationError) Error

Error satisfies the builtin error interface

func (FormFindByTeacherUsernameResponseValidationError) ErrorName

ErrorName returns error name.

func (FormFindByTeacherUsernameResponseValidationError) Field

Field function returns field value.

func (FormFindByTeacherUsernameResponseValidationError) Key

Key function returns key value.

func (FormFindByTeacherUsernameResponseValidationError) Reason

Reason function returns reason value.

type FormServer

type FormServer interface {
	FindByID(context.Context, *FormFindByIDRequest) (*FormFindByIDResponse, error)
	FindByTeacherUsername(context.Context, *FormFindByTeacherUsernameRequest) (*FormFindByTeacherUsernameResponse, error)
	// contains filtered or unexported methods
}

FormServer is the server API for Form service. All implementations must embed UnimplementedFormServer for forward compatibility.

type QuestionDTO

type QuestionDTO struct {
	Id      string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Text    string       `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Answers []*AnswerDTO `protobuf:"bytes,3,rep,name=answers,proto3" json:"answers,omitempty"`
	// contains filtered or unexported fields
}

func (*QuestionDTO) Descriptor deprecated

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

Deprecated: Use QuestionDTO.ProtoReflect.Descriptor instead.

func (*QuestionDTO) GetAnswers

func (x *QuestionDTO) GetAnswers() []*AnswerDTO

func (*QuestionDTO) GetId

func (x *QuestionDTO) GetId() string

func (*QuestionDTO) GetText

func (x *QuestionDTO) GetText() string

func (*QuestionDTO) ProtoMessage

func (*QuestionDTO) ProtoMessage()

func (*QuestionDTO) ProtoReflect

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

func (*QuestionDTO) Reset

func (x *QuestionDTO) Reset()

func (*QuestionDTO) String

func (x *QuestionDTO) String() string

func (*QuestionDTO) Validate

func (m *QuestionDTO) Validate() error

Validate checks the field values on QuestionDTO with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*QuestionDTO) ValidateAll

func (m *QuestionDTO) ValidateAll() error

ValidateAll checks the field values on QuestionDTO with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in QuestionDTOMultiError, or nil if none found.

type QuestionDTOMultiError

type QuestionDTOMultiError []error

QuestionDTOMultiError is an error wrapping multiple validation errors returned by QuestionDTO.ValidateAll() if the designated constraints aren't met.

func (QuestionDTOMultiError) AllErrors

func (m QuestionDTOMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (QuestionDTOMultiError) Error

func (m QuestionDTOMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type QuestionDTOValidationError

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

QuestionDTOValidationError is the validation error returned by QuestionDTO.Validate if the designated constraints aren't met.

func (QuestionDTOValidationError) Cause

Cause function returns cause value.

func (QuestionDTOValidationError) Error

Error satisfies the builtin error interface

func (QuestionDTOValidationError) ErrorName

func (e QuestionDTOValidationError) ErrorName() string

ErrorName returns error name.

func (QuestionDTOValidationError) Field

Field function returns field value.

func (QuestionDTOValidationError) Key

Key function returns key value.

func (QuestionDTOValidationError) Reason

Reason function returns reason value.

type UnimplementedFormServer

type UnimplementedFormServer struct{}

UnimplementedFormServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedFormServer) FindByID

type UnsafeFormServer

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

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

Jump to

Keyboard shortcuts

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