Documentation ¶
Index ¶
- Variables
- func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)
- func RegisterRedactedChatServer(s grpc.ServiceRegistrar, srv ChatServer, bypass redact.Bypass)
- type ChatClient
- type ChatServer
- type GetUserRequest
- func (*GetUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserRequest) GetUsername() string
- func (*GetUserRequest) ProtoMessage()
- func (x *GetUserRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserRequest) Redact()
- func (x *GetUserRequest) Reset()
- func (x *GetUserRequest) String() string
- type ListUsersResponse
- func (*ListUsersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListUsersResponse) GetUsers() []*User
- func (*ListUsersResponse) ProtoMessage()
- func (x *ListUsersResponse) ProtoReflect() protoreflect.Message
- func (x *ListUsersResponse) Redact()
- func (x *ListUsersResponse) Reset()
- func (x *ListUsersResponse) String() string
- type UnimplementedChatServer
- type UnsafeChatServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetEmail() string
- func (x *User) GetHome() *User_Location
- func (x *User) GetName() string
- func (x *User) GetPassword() string
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Redact()
- func (x *User) Reset()
- func (x *User) String() string
- type User_Location
- func (*User_Location) Descriptor() ([]byte, []int)deprecated
- func (x *User_Location) GetLat() float64
- func (x *User_Location) GetLng() float64
- func (*User_Location) ProtoMessage()
- func (x *User_Location) ProtoReflect() protoreflect.Message
- func (x *User_Location) Redact()
- func (x *User_Location) Reset()
- func (x *User_Location) String() string
Constants ¶
This section is empty.
Variables ¶
var File_examples_user_pb_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChatServer ¶
func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)
func RegisterRedactedChatServer ¶
func RegisterRedactedChatServer(s grpc.ServiceRegistrar, srv ChatServer, bypass redact.Bypass)
RegisterRedactedChatServer wraps the ChatServer with the redacted server and registers the service in GRPC
Types ¶
type ChatClient ¶
type ChatClient interface { AddUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) ListUsers(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListUsersResponse, error) }
ChatClient is the client API for Chat 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 NewChatClient ¶
func NewChatClient(cc grpc.ClientConnInterface) ChatClient
type ChatServer ¶
type ChatServer interface { AddUser(context.Context, *User) (*User, error) GetUser(context.Context, *GetUserRequest) (*User, error) ListUsers(context.Context, *empty.Empty) (*ListUsersResponse, error) // contains filtered or unexported methods }
ChatServer is the server API for Chat service. All implementations must embed UnimplementedChatServer for forward compatibility
func RedactedChatServer ¶
func RedactedChatServer(srv ChatServer, bypass redact.Bypass) ChatServer
type GetUserRequest ¶
type GetUserRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetUsername ¶
func (x *GetUserRequest) GetUsername() string
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Redact ¶
func (x *GetUserRequest) Redact()
Redact method implementation for GetUserRequest
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type ListUsersResponse ¶
type ListUsersResponse struct { Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` // contains filtered or unexported fields }
func (*ListUsersResponse) Descriptor
deprecated
func (*ListUsersResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.
func (*ListUsersResponse) GetUsers ¶
func (x *ListUsersResponse) GetUsers() []*User
func (*ListUsersResponse) ProtoMessage ¶
func (*ListUsersResponse) ProtoMessage()
func (*ListUsersResponse) ProtoReflect ¶
func (x *ListUsersResponse) ProtoReflect() protoreflect.Message
func (*ListUsersResponse) Redact ¶
func (x *ListUsersResponse) Redact()
Redact method implementation for ListUsersResponse
func (*ListUsersResponse) Reset ¶
func (x *ListUsersResponse) Reset()
func (*ListUsersResponse) String ¶
func (x *ListUsersResponse) String() string
type UnimplementedChatServer ¶
type UnimplementedChatServer struct { }
UnimplementedChatServer must be embedded to have forward compatible implementations.
func (UnimplementedChatServer) GetUser ¶
func (UnimplementedChatServer) GetUser(context.Context, *GetUserRequest) (*User, error)
func (UnimplementedChatServer) ListUsers ¶
func (UnimplementedChatServer) ListUsers(context.Context, *empty.Empty) (*ListUsersResponse, error)
type UnsafeChatServer ¶
type UnsafeChatServer interface {
// contains filtered or unexported methods
}
UnsafeChatServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChatServer will result in compilation errors.
type User ¶
type User struct { // User credentials Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // default redaction // User information Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` Home *User_Location `protobuf:"bytes,5,opt,name=home,proto3" json:"home,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetHome ¶
func (x *User) GetHome() *User_Location
func (*User) GetPassword ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type User_Location ¶
type User_Location struct { Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"` Lng float64 `protobuf:"fixed64,2,opt,name=lng,proto3" json:"lng,omitempty"` // contains filtered or unexported fields }
func (*User_Location) Descriptor
deprecated
func (*User_Location) Descriptor() ([]byte, []int)
Deprecated: Use User_Location.ProtoReflect.Descriptor instead.
func (*User_Location) GetLat ¶
func (x *User_Location) GetLat() float64
func (*User_Location) GetLng ¶
func (x *User_Location) GetLng() float64
func (*User_Location) ProtoMessage ¶
func (*User_Location) ProtoMessage()
func (*User_Location) ProtoReflect ¶
func (x *User_Location) ProtoReflect() protoreflect.Message
func (*User_Location) Redact ¶
func (x *User_Location) Redact()
Redact method implementation for User_Location
func (*User_Location) Reset ¶
func (x *User_Location) Reset()
func (*User_Location) String ¶
func (x *User_Location) String() string