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 CreateChatRequest
- func (*CreateChatRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateChatRequest) GetUsernames() []string
- func (*CreateChatRequest) ProtoMessage()
- func (x *CreateChatRequest) ProtoReflect() protoreflect.Message
- func (x *CreateChatRequest) Reset()
- func (x *CreateChatRequest) String() string
- func (m *CreateChatRequest) Validate() error
- func (m *CreateChatRequest) ValidateAll() error
- type CreateChatRequestMultiError
- type CreateChatRequestValidationError
- func (e CreateChatRequestValidationError) Cause() error
- func (e CreateChatRequestValidationError) Error() string
- func (e CreateChatRequestValidationError) ErrorName() string
- func (e CreateChatRequestValidationError) Field() string
- func (e CreateChatRequestValidationError) Key() bool
- func (e CreateChatRequestValidationError) Reason() string
- type CreateChatResponse
- func (*CreateChatResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateChatResponse) GetId() int64
- func (*CreateChatResponse) ProtoMessage()
- func (x *CreateChatResponse) ProtoReflect() protoreflect.Message
- func (x *CreateChatResponse) Reset()
- func (x *CreateChatResponse) String() string
- func (m *CreateChatResponse) Validate() error
- func (m *CreateChatResponse) ValidateAll() error
- type CreateChatResponseMultiError
- type CreateChatResponseValidationError
- func (e CreateChatResponseValidationError) Cause() error
- func (e CreateChatResponseValidationError) Error() string
- func (e CreateChatResponseValidationError) ErrorName() string
- func (e CreateChatResponseValidationError) Field() string
- func (e CreateChatResponseValidationError) Key() bool
- func (e CreateChatResponseValidationError) Reason() string
- type CreateMessageRequest
- func (*CreateMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateMessageRequest) GetChatId() int64
- func (x *CreateMessageRequest) GetFrom() string
- func (x *CreateMessageRequest) GetText() string
- func (x *CreateMessageRequest) GetTimestamp() *timestamppb.Timestamp
- func (*CreateMessageRequest) ProtoMessage()
- func (x *CreateMessageRequest) ProtoReflect() protoreflect.Message
- func (x *CreateMessageRequest) Reset()
- func (x *CreateMessageRequest) String() string
- func (m *CreateMessageRequest) Validate() error
- func (m *CreateMessageRequest) ValidateAll() error
- type CreateMessageRequestMultiError
- type CreateMessageRequestValidationError
- func (e CreateMessageRequestValidationError) Cause() error
- func (e CreateMessageRequestValidationError) Error() string
- func (e CreateMessageRequestValidationError) ErrorName() string
- func (e CreateMessageRequestValidationError) Field() string
- func (e CreateMessageRequestValidationError) Key() bool
- func (e CreateMessageRequestValidationError) 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 UnimplementedChatV1Server
- func (UnimplementedChatV1Server) CreateChat(context.Context, *CreateChatRequest) (*CreateChatResponse, error)
- func (UnimplementedChatV1Server) CreateMessage(context.Context, *CreateMessageRequest) (*emptypb.Empty, error)
- func (UnimplementedChatV1Server) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
- type UnsafeChatV1Server
Constants ¶
This section is empty.
Variables ¶
var ChatV1_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chat_v1.ChatV1", HandlerType: (*ChatV1Server)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateChat", Handler: _ChatV1_CreateChat_Handler, }, { MethodName: "Delete", Handler: _ChatV1_Delete_Handler, }, { MethodName: "CreateMessage", Handler: _ChatV1_CreateMessage_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. This client ignores the HTTP middlewares.
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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterChatV1Server ¶
func RegisterChatV1Server(s grpc.ServiceRegistrar, srv ChatV1Server)
Types ¶
type ChatV1Client ¶
type ChatV1Client interface { CreateChat(ctx context.Context, in *CreateChatRequest, opts ...grpc.CallOption) (*CreateChatResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) CreateMessage(ctx context.Context, in *CreateMessageRequest, opts ...grpc.CallOption) (*emptypb.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 { CreateChat(context.Context, *CreateChatRequest) (*CreateChatResponse, error) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) CreateMessage(context.Context, *CreateMessageRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
ChatV1Server is the server API for ChatV1 service. All implementations must embed UnimplementedChatV1Server for forward compatibility
type CreateChatRequest ¶
type CreateChatRequest struct { Usernames []string `protobuf:"bytes,1,rep,name=usernames,proto3" json:"usernames,omitempty"` // contains filtered or unexported fields }
func (*CreateChatRequest) Descriptor
deprecated
func (*CreateChatRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateChatRequest.ProtoReflect.Descriptor instead.
func (*CreateChatRequest) GetUsernames ¶
func (x *CreateChatRequest) GetUsernames() []string
func (*CreateChatRequest) ProtoMessage ¶
func (*CreateChatRequest) ProtoMessage()
func (*CreateChatRequest) ProtoReflect ¶
func (x *CreateChatRequest) ProtoReflect() protoreflect.Message
func (*CreateChatRequest) Reset ¶
func (x *CreateChatRequest) Reset()
func (*CreateChatRequest) String ¶
func (x *CreateChatRequest) String() string
func (*CreateChatRequest) Validate ¶
func (m *CreateChatRequest) Validate() error
Validate checks the field values on CreateChatRequest 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 (*CreateChatRequest) ValidateAll ¶
func (m *CreateChatRequest) ValidateAll() error
ValidateAll checks the field values on CreateChatRequest 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 CreateChatRequestMultiError, or nil if none found.
type CreateChatRequestMultiError ¶
type CreateChatRequestMultiError []error
CreateChatRequestMultiError is an error wrapping multiple validation errors returned by CreateChatRequest.ValidateAll() if the designated constraints aren't met.
func (CreateChatRequestMultiError) AllErrors ¶
func (m CreateChatRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateChatRequestMultiError) Error ¶
func (m CreateChatRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateChatRequestValidationError ¶
type CreateChatRequestValidationError struct {
// contains filtered or unexported fields
}
CreateChatRequestValidationError is the validation error returned by CreateChatRequest.Validate if the designated constraints aren't met.
func (CreateChatRequestValidationError) Cause ¶
func (e CreateChatRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateChatRequestValidationError) Error ¶
func (e CreateChatRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateChatRequestValidationError) ErrorName ¶
func (e CreateChatRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateChatRequestValidationError) Field ¶
func (e CreateChatRequestValidationError) Field() string
Field function returns field value.
func (CreateChatRequestValidationError) Key ¶
func (e CreateChatRequestValidationError) Key() bool
Key function returns key value.
func (CreateChatRequestValidationError) Reason ¶
func (e CreateChatRequestValidationError) Reason() string
Reason function returns reason value.
type CreateChatResponse ¶
type CreateChatResponse struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateChatResponse) Descriptor
deprecated
func (*CreateChatResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateChatResponse.ProtoReflect.Descriptor instead.
func (*CreateChatResponse) GetId ¶
func (x *CreateChatResponse) GetId() int64
func (*CreateChatResponse) ProtoMessage ¶
func (*CreateChatResponse) ProtoMessage()
func (*CreateChatResponse) ProtoReflect ¶
func (x *CreateChatResponse) ProtoReflect() protoreflect.Message
func (*CreateChatResponse) Reset ¶
func (x *CreateChatResponse) Reset()
func (*CreateChatResponse) String ¶
func (x *CreateChatResponse) String() string
func (*CreateChatResponse) Validate ¶
func (m *CreateChatResponse) Validate() error
Validate checks the field values on CreateChatResponse 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 (*CreateChatResponse) ValidateAll ¶
func (m *CreateChatResponse) ValidateAll() error
ValidateAll checks the field values on CreateChatResponse 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 CreateChatResponseMultiError, or nil if none found.
type CreateChatResponseMultiError ¶
type CreateChatResponseMultiError []error
CreateChatResponseMultiError is an error wrapping multiple validation errors returned by CreateChatResponse.ValidateAll() if the designated constraints aren't met.
func (CreateChatResponseMultiError) AllErrors ¶
func (m CreateChatResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateChatResponseMultiError) Error ¶
func (m CreateChatResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateChatResponseValidationError ¶
type CreateChatResponseValidationError struct {
// contains filtered or unexported fields
}
CreateChatResponseValidationError is the validation error returned by CreateChatResponse.Validate if the designated constraints aren't met.
func (CreateChatResponseValidationError) Cause ¶
func (e CreateChatResponseValidationError) Cause() error
Cause function returns cause value.
func (CreateChatResponseValidationError) Error ¶
func (e CreateChatResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CreateChatResponseValidationError) ErrorName ¶
func (e CreateChatResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CreateChatResponseValidationError) Field ¶
func (e CreateChatResponseValidationError) Field() string
Field function returns field value.
func (CreateChatResponseValidationError) Key ¶
func (e CreateChatResponseValidationError) Key() bool
Key function returns key value.
func (CreateChatResponseValidationError) Reason ¶
func (e CreateChatResponseValidationError) Reason() string
Reason function returns reason value.
type CreateMessageRequest ¶
type CreateMessageRequest struct { ChatId int64 `protobuf:"varint,1,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*CreateMessageRequest) Descriptor
deprecated
func (*CreateMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateMessageRequest.ProtoReflect.Descriptor instead.
func (*CreateMessageRequest) GetChatId ¶
func (x *CreateMessageRequest) GetChatId() int64
func (*CreateMessageRequest) GetFrom ¶
func (x *CreateMessageRequest) GetFrom() string
func (*CreateMessageRequest) GetText ¶
func (x *CreateMessageRequest) GetText() string
func (*CreateMessageRequest) GetTimestamp ¶
func (x *CreateMessageRequest) GetTimestamp() *timestamppb.Timestamp
func (*CreateMessageRequest) ProtoMessage ¶
func (*CreateMessageRequest) ProtoMessage()
func (*CreateMessageRequest) ProtoReflect ¶
func (x *CreateMessageRequest) ProtoReflect() protoreflect.Message
func (*CreateMessageRequest) Reset ¶
func (x *CreateMessageRequest) Reset()
func (*CreateMessageRequest) String ¶
func (x *CreateMessageRequest) String() string
func (*CreateMessageRequest) Validate ¶
func (m *CreateMessageRequest) Validate() error
Validate checks the field values on CreateMessageRequest 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 (*CreateMessageRequest) ValidateAll ¶
func (m *CreateMessageRequest) ValidateAll() error
ValidateAll checks the field values on CreateMessageRequest 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 CreateMessageRequestMultiError, or nil if none found.
type CreateMessageRequestMultiError ¶
type CreateMessageRequestMultiError []error
CreateMessageRequestMultiError is an error wrapping multiple validation errors returned by CreateMessageRequest.ValidateAll() if the designated constraints aren't met.
func (CreateMessageRequestMultiError) AllErrors ¶
func (m CreateMessageRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateMessageRequestMultiError) Error ¶
func (m CreateMessageRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateMessageRequestValidationError ¶
type CreateMessageRequestValidationError struct {
// contains filtered or unexported fields
}
CreateMessageRequestValidationError is the validation error returned by CreateMessageRequest.Validate if the designated constraints aren't met.
func (CreateMessageRequestValidationError) Cause ¶
func (e CreateMessageRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateMessageRequestValidationError) Error ¶
func (e CreateMessageRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateMessageRequestValidationError) ErrorName ¶
func (e CreateMessageRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateMessageRequestValidationError) Field ¶
func (e CreateMessageRequestValidationError) Field() string
Field function returns field value.
func (CreateMessageRequestValidationError) Key ¶
func (e CreateMessageRequestValidationError) Key() bool
Key function returns key value.
func (CreateMessageRequestValidationError) Reason ¶
func (e CreateMessageRequestValidationError) 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 UnimplementedChatV1Server ¶
type UnimplementedChatV1Server struct { }
UnimplementedChatV1Server must be embedded to have forward compatible implementations.
func (UnimplementedChatV1Server) CreateChat ¶
func (UnimplementedChatV1Server) CreateChat(context.Context, *CreateChatRequest) (*CreateChatResponse, error)
func (UnimplementedChatV1Server) CreateMessage ¶
func (UnimplementedChatV1Server) CreateMessage(context.Context, *CreateMessageRequest) (*emptypb.Empty, error)
func (UnimplementedChatV1Server) Delete ¶
func (UnimplementedChatV1Server) Delete(context.Context, *DeleteRequest) (*emptypb.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.