Documentation ¶
Overview ¶
Package chat_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterChatV1Handler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterChatV1HandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChatV1Client) error
- func RegisterChatV1HandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterChatV1HandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChatV1Server) error
- func RegisterChatV1Server(s grpc.ServiceRegistrar, srv ChatV1Server)
- type ChatV1Client
- type ChatV1Server
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetUsernames() []string
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- func (m *CreateRequest) Validate() error
- func (m *CreateRequest) ValidateAll() error
- type CreateRequestMultiError
- type CreateRequestValidationError
- func (e CreateRequestValidationError) Cause() error
- func (e CreateRequestValidationError) Error() string
- func (e CreateRequestValidationError) ErrorName() string
- func (e CreateRequestValidationError) Field() string
- func (e CreateRequestValidationError) Key() bool
- func (e CreateRequestValidationError) Reason() string
- type CreateResponse
- func (*CreateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateResponse) GetId() int64
- func (*CreateResponse) ProtoMessage()
- func (x *CreateResponse) ProtoReflect() protoreflect.Message
- func (x *CreateResponse) Reset()
- func (x *CreateResponse) String() string
- func (m *CreateResponse) Validate() error
- func (m *CreateResponse) ValidateAll() error
- type CreateResponseMultiError
- type CreateResponseValidationError
- func (e CreateResponseValidationError) Cause() error
- func (e CreateResponseValidationError) Error() string
- func (e CreateResponseValidationError) ErrorName() string
- func (e CreateResponseValidationError) Field() string
- func (e CreateResponseValidationError) Key() bool
- func (e CreateResponseValidationError) Reason() string
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRequest) GetId() int64
- func (*DeleteRequest) ProtoMessage()
- func (x *DeleteRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRequest) Reset()
- func (x *DeleteRequest) String() string
- func (m *DeleteRequest) Validate() error
- func (m *DeleteRequest) ValidateAll() error
- type DeleteRequestMultiError
- type DeleteRequestValidationError
- func (e DeleteRequestValidationError) Cause() error
- func (e DeleteRequestValidationError) Error() string
- func (e DeleteRequestValidationError) ErrorName() string
- func (e DeleteRequestValidationError) Field() string
- func (e DeleteRequestValidationError) Key() bool
- func (e DeleteRequestValidationError) Reason() string
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetFrom() string
- func (x *Message) GetText() string
- func (x *Message) GetTimestamp() *timestamp.Timestamp
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- func (m *Message) Validate() error
- func (m *Message) ValidateAll() error
- type MessageMultiError
- type MessageValidationError
- type SendMessageRequest
- func (*SendMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageRequest) GetMessage() *Message
- func (*SendMessageRequest) ProtoMessage()
- func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageRequest) Reset()
- func (x *SendMessageRequest) String() string
- func (m *SendMessageRequest) Validate() error
- func (m *SendMessageRequest) ValidateAll() error
- type SendMessageRequestMultiError
- type SendMessageRequestValidationError
- func (e SendMessageRequestValidationError) Cause() error
- func (e SendMessageRequestValidationError) Error() string
- func (e SendMessageRequestValidationError) ErrorName() string
- func (e SendMessageRequestValidationError) Field() string
- func (e SendMessageRequestValidationError) Key() bool
- func (e SendMessageRequestValidationError) Reason() string
- type UnimplementedChatV1Server
- type UnsafeChatV1Server
Constants ¶
This section is empty.
Variables ¶
var ChatV1_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chat_v1.ChatV1", HandlerType: (*ChatV1Server)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _ChatV1_Create_Handler, }, { MethodName: "Delete", Handler: _ChatV1_Delete_Handler, }, { MethodName: "SendMessage", Handler: _ChatV1_SendMessage_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "chat.proto", }
ChatV1_ServiceDesc is the grpc.ServiceDesc for ChatV1 service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_chat_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChatV1Handler ¶
RegisterChatV1Handler registers the http handlers for service ChatV1 to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterChatV1HandlerClient ¶
func RegisterChatV1HandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChatV1Client) error
RegisterChatV1HandlerClient registers the http handlers for service ChatV1 to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChatV1Client". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChatV1Client" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChatV1Client" to call the correct interceptors.
func RegisterChatV1HandlerFromEndpoint ¶
func RegisterChatV1HandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterChatV1HandlerFromEndpoint is same as RegisterChatV1Handler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterChatV1HandlerServer ¶
func RegisterChatV1HandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChatV1Server) error
RegisterChatV1HandlerServer registers the http handlers for service ChatV1 to "mux". UnaryRPC :call ChatV1Server directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChatV1HandlerFromEndpoint instead.
func RegisterChatV1Server ¶
func RegisterChatV1Server(s grpc.ServiceRegistrar, srv ChatV1Server)
Types ¶
type ChatV1Client ¶
type ChatV1Client interface { // Создает новый чат для указываемых собеседников Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) // Удаляет чат по id Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error) // Отправляет в чат сообщение от указанного пользователя SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
ChatV1Client is the client API for ChatV1 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 NewChatV1Client ¶
func NewChatV1Client(cc grpc.ClientConnInterface) ChatV1Client
type ChatV1Server ¶
type ChatV1Server interface { // Создает новый чат для указываемых собеседников Create(context.Context, *CreateRequest) (*CreateResponse, error) // Удаляет чат по id Delete(context.Context, *DeleteRequest) (*empty.Empty, error) // Отправляет в чат сообщение от указанного пользователя SendMessage(context.Context, *SendMessageRequest) (*empty.Empty, error) // contains filtered or unexported methods }
ChatV1Server is the server API for ChatV1 service. All implementations must embed UnimplementedChatV1Server for forward compatibility
type CreateRequest ¶
type CreateRequest struct { // Участники чата Usernames []string `protobuf:"bytes,1,rep,name=usernames,proto3" json:"usernames,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetUsernames ¶
func (x *CreateRequest) GetUsernames() []string
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
func (*CreateRequest) Validate ¶
func (m *CreateRequest) Validate() error
Validate checks the field values on CreateRequest 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 (*CreateRequest) ValidateAll ¶
func (m *CreateRequest) ValidateAll() error
ValidateAll checks the field values on CreateRequest 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 CreateRequestMultiError, or nil if none found.
type CreateRequestMultiError ¶
type CreateRequestMultiError []error
CreateRequestMultiError is an error wrapping multiple validation errors returned by CreateRequest.ValidateAll() if the designated constraints aren't met.
func (CreateRequestMultiError) AllErrors ¶
func (m CreateRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateRequestMultiError) Error ¶
func (m CreateRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateRequestValidationError ¶
type CreateRequestValidationError struct {
// contains filtered or unexported fields
}
CreateRequestValidationError is the validation error returned by CreateRequest.Validate if the designated constraints aren't met.
func (CreateRequestValidationError) Cause ¶
func (e CreateRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateRequestValidationError) Error ¶
func (e CreateRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateRequestValidationError) ErrorName ¶
func (e CreateRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateRequestValidationError) Field ¶
func (e CreateRequestValidationError) Field() string
Field function returns field value.
func (CreateRequestValidationError) Key ¶
func (e CreateRequestValidationError) Key() bool
Key function returns key value.
func (CreateRequestValidationError) Reason ¶
func (e CreateRequestValidationError) Reason() string
Reason function returns reason value.
type CreateResponse ¶
type CreateResponse struct { // Идентификатор созданного чата Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateResponse) Descriptor
deprecated
func (*CreateResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.
func (*CreateResponse) GetId ¶
func (x *CreateResponse) GetId() int64
func (*CreateResponse) ProtoMessage ¶
func (*CreateResponse) ProtoMessage()
func (*CreateResponse) ProtoReflect ¶
func (x *CreateResponse) ProtoReflect() protoreflect.Message
func (*CreateResponse) Reset ¶
func (x *CreateResponse) Reset()
func (*CreateResponse) String ¶
func (x *CreateResponse) String() string
func (*CreateResponse) Validate ¶
func (m *CreateResponse) Validate() error
Validate checks the field values on CreateResponse 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 (*CreateResponse) ValidateAll ¶
func (m *CreateResponse) ValidateAll() error
ValidateAll checks the field values on CreateResponse 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 CreateResponseMultiError, or nil if none found.
type CreateResponseMultiError ¶
type CreateResponseMultiError []error
CreateResponseMultiError is an error wrapping multiple validation errors returned by CreateResponse.ValidateAll() if the designated constraints aren't met.
func (CreateResponseMultiError) AllErrors ¶
func (m CreateResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateResponseMultiError) Error ¶
func (m CreateResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateResponseValidationError ¶
type CreateResponseValidationError struct {
// contains filtered or unexported fields
}
CreateResponseValidationError is the validation error returned by CreateResponse.Validate if the designated constraints aren't met.
func (CreateResponseValidationError) Cause ¶
func (e CreateResponseValidationError) Cause() error
Cause function returns cause value.
func (CreateResponseValidationError) Error ¶
func (e CreateResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CreateResponseValidationError) ErrorName ¶
func (e CreateResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CreateResponseValidationError) Field ¶
func (e CreateResponseValidationError) Field() string
Field function returns field value.
func (CreateResponseValidationError) Key ¶
func (e CreateResponseValidationError) Key() bool
Key function returns key value.
func (CreateResponseValidationError) Reason ¶
func (e CreateResponseValidationError) Reason() string
Reason function returns reason value.
type DeleteRequest ¶
type DeleteRequest struct { // Идентификатор удаляемого чата Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetId ¶
func (x *DeleteRequest) GetId() int64
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
func (*DeleteRequest) Validate ¶
func (m *DeleteRequest) Validate() error
Validate checks the field values on DeleteRequest 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 (*DeleteRequest) ValidateAll ¶
func (m *DeleteRequest) ValidateAll() error
ValidateAll checks the field values on DeleteRequest 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 DeleteRequestMultiError, or nil if none found.
type DeleteRequestMultiError ¶
type DeleteRequestMultiError []error
DeleteRequestMultiError is an error wrapping multiple validation errors returned by DeleteRequest.ValidateAll() if the designated constraints aren't met.
func (DeleteRequestMultiError) AllErrors ¶
func (m DeleteRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (DeleteRequestMultiError) Error ¶
func (m DeleteRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type DeleteRequestValidationError ¶
type DeleteRequestValidationError struct {
// contains filtered or unexported fields
}
DeleteRequestValidationError is the validation error returned by DeleteRequest.Validate if the designated constraints aren't met.
func (DeleteRequestValidationError) Cause ¶
func (e DeleteRequestValidationError) Cause() error
Cause function returns cause value.
func (DeleteRequestValidationError) Error ¶
func (e DeleteRequestValidationError) Error() string
Error satisfies the builtin error interface
func (DeleteRequestValidationError) ErrorName ¶
func (e DeleteRequestValidationError) ErrorName() string
ErrorName returns error name.
func (DeleteRequestValidationError) Field ¶
func (e DeleteRequestValidationError) Field() string
Field function returns field value.
func (DeleteRequestValidationError) Key ¶
func (e DeleteRequestValidationError) Key() bool
Key function returns key value.
func (DeleteRequestValidationError) Reason ¶
func (e DeleteRequestValidationError) Reason() string
Reason function returns reason value.
type Message ¶
type Message struct { // Отправитель From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // Текст сообщения Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // Время отправления сообщения Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetTimestamp ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
func (*Message) Validate ¶
Validate checks the field values on Message 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 (*Message) ValidateAll ¶
ValidateAll checks the field values on Message 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 MessageMultiError, or nil if none found.
type MessageMultiError ¶
type MessageMultiError []error
MessageMultiError is an error wrapping multiple validation errors returned by Message.ValidateAll() if the designated constraints aren't met.
func (MessageMultiError) AllErrors ¶
func (m MessageMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (MessageMultiError) Error ¶
func (m MessageMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type MessageValidationError ¶
type MessageValidationError struct {
// contains filtered or unexported fields
}
MessageValidationError is the validation error returned by Message.Validate if the designated constraints aren't met.
func (MessageValidationError) Cause ¶
func (e MessageValidationError) Cause() error
Cause function returns cause value.
func (MessageValidationError) Error ¶
func (e MessageValidationError) Error() string
Error satisfies the builtin error interface
func (MessageValidationError) ErrorName ¶
func (e MessageValidationError) ErrorName() string
ErrorName returns error name.
func (MessageValidationError) Field ¶
func (e MessageValidationError) Field() string
Field function returns field value.
func (MessageValidationError) Key ¶
func (e MessageValidationError) Key() bool
Key function returns key value.
func (MessageValidationError) Reason ¶
func (e MessageValidationError) Reason() string
Reason function returns reason value.
type SendMessageRequest ¶
type SendMessageRequest struct { Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SendMessageRequest) Descriptor
deprecated
func (*SendMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead.
func (*SendMessageRequest) GetMessage ¶
func (x *SendMessageRequest) GetMessage() *Message
func (*SendMessageRequest) ProtoMessage ¶
func (*SendMessageRequest) ProtoMessage()
func (*SendMessageRequest) ProtoReflect ¶
func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
func (*SendMessageRequest) Reset ¶
func (x *SendMessageRequest) Reset()
func (*SendMessageRequest) String ¶
func (x *SendMessageRequest) String() string
func (*SendMessageRequest) Validate ¶
func (m *SendMessageRequest) Validate() error
Validate checks the field values on SendMessageRequest 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 (*SendMessageRequest) ValidateAll ¶
func (m *SendMessageRequest) ValidateAll() error
ValidateAll checks the field values on SendMessageRequest 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 SendMessageRequestMultiError, or nil if none found.
type SendMessageRequestMultiError ¶
type SendMessageRequestMultiError []error
SendMessageRequestMultiError is an error wrapping multiple validation errors returned by SendMessageRequest.ValidateAll() if the designated constraints aren't met.
func (SendMessageRequestMultiError) AllErrors ¶
func (m SendMessageRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SendMessageRequestMultiError) Error ¶
func (m SendMessageRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SendMessageRequestValidationError ¶
type SendMessageRequestValidationError struct {
// contains filtered or unexported fields
}
SendMessageRequestValidationError is the validation error returned by SendMessageRequest.Validate if the designated constraints aren't met.
func (SendMessageRequestValidationError) Cause ¶
func (e SendMessageRequestValidationError) Cause() error
Cause function returns cause value.
func (SendMessageRequestValidationError) Error ¶
func (e SendMessageRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SendMessageRequestValidationError) ErrorName ¶
func (e SendMessageRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SendMessageRequestValidationError) Field ¶
func (e SendMessageRequestValidationError) Field() string
Field function returns field value.
func (SendMessageRequestValidationError) Key ¶
func (e SendMessageRequestValidationError) Key() bool
Key function returns key value.
func (SendMessageRequestValidationError) Reason ¶
func (e SendMessageRequestValidationError) Reason() string
Reason function returns reason value.
type UnimplementedChatV1Server ¶
type UnimplementedChatV1Server struct { }
UnimplementedChatV1Server must be embedded to have forward compatible implementations.
func (UnimplementedChatV1Server) Create ¶
func (UnimplementedChatV1Server) Create(context.Context, *CreateRequest) (*CreateResponse, error)
func (UnimplementedChatV1Server) Delete ¶
func (UnimplementedChatV1Server) Delete(context.Context, *DeleteRequest) (*empty.Empty, error)
func (UnimplementedChatV1Server) SendMessage ¶
func (UnimplementedChatV1Server) SendMessage(context.Context, *SendMessageRequest) (*empty.Empty, error)
type UnsafeChatV1Server ¶
type UnsafeChatV1Server interface {
// contains filtered or unexported methods
}
UnsafeChatV1Server may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChatV1Server will result in compilation errors.