Documentation ¶
Overview ¶
Package channel is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterChannelServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterChannelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChannelServiceClient) error
- func RegisterChannelServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterChannelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChannelServiceServer) error
- func RegisterChannelServiceServer(s grpc.ServiceRegistrar, srv ChannelServiceServer)
- type Channel
- func (*Channel) Descriptor() ([]byte, []int)deprecated
- func (x *Channel) GetBitrate() uint32
- func (x *Channel) GetCreatedAt() *timestamppb.Timestamp
- func (x *Channel) GetId() string
- func (x *Channel) GetName() string
- func (x *Channel) GetNsfw() bool
- func (x *Channel) GetTopic() string
- func (x *Channel) GetType() ChannelType
- func (x *Channel) GetUpdatedAt() *timestamppb.Timestamp
- func (*Channel) ProtoMessage()
- func (x *Channel) ProtoReflect() protoreflect.Message
- func (x *Channel) Reset()
- func (x *Channel) String() string
- type ChannelServiceClient
- type ChannelServiceServer
- type ChannelType
- func (ChannelType) Descriptor() protoreflect.EnumDescriptor
- func (x ChannelType) Enum() *ChannelType
- func (ChannelType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ChannelType) Number() protoreflect.EnumNumber
- func (x ChannelType) String() string
- func (ChannelType) Type() protoreflect.EnumType
- type CreateChannelRequest
- func (*CreateChannelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateChannelRequest) GetBitrate() uint32
- func (x *CreateChannelRequest) GetName() string
- func (x *CreateChannelRequest) GetNsfw() bool
- func (x *CreateChannelRequest) GetTopic() string
- func (x *CreateChannelRequest) GetType() ChannelType
- func (*CreateChannelRequest) ProtoMessage()
- func (x *CreateChannelRequest) ProtoReflect() protoreflect.Message
- func (x *CreateChannelRequest) Reset()
- func (x *CreateChannelRequest) String() string
- type CreateChannelResponse
- func (*CreateChannelResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateChannelResponse) GetChannel() *Channel
- func (x *CreateChannelResponse) GetStatus() *status.Status
- func (*CreateChannelResponse) ProtoMessage()
- func (x *CreateChannelResponse) ProtoReflect() protoreflect.Message
- func (x *CreateChannelResponse) Reset()
- func (x *CreateChannelResponse) String() string
- type DeleteChannelRequest
- func (*DeleteChannelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteChannelRequest) GetId() string
- func (*DeleteChannelRequest) ProtoMessage()
- func (x *DeleteChannelRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteChannelRequest) Reset()
- func (x *DeleteChannelRequest) String() string
- type ListChannelsRequest
- type ListChannelsResponse
- func (*ListChannelsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListChannelsResponse) GetChannels() []*Channel
- func (*ListChannelsResponse) ProtoMessage()
- func (x *ListChannelsResponse) ProtoReflect() protoreflect.Message
- func (x *ListChannelsResponse) Reset()
- func (x *ListChannelsResponse) String() string
- type UnimplementedChannelServiceServer
- func (UnimplementedChannelServiceServer) CreateChannel(context.Context, *CreateChannelRequest) (*Channel, error)
- func (UnimplementedChannelServiceServer) DeleteChannel(context.Context, *DeleteChannelRequest) (*emptypb.Empty, error)
- func (UnimplementedChannelServiceServer) ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error)
- func (UnimplementedChannelServiceServer) UpdateChannel(context.Context, *UpdateChannelRequest) (*Channel, error)
- type UnsafeChannelServiceServer
- type UpdateChannelRequest
- func (*UpdateChannelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateChannelRequest) GetBitrate() uint32
- func (x *UpdateChannelRequest) GetId() string
- func (x *UpdateChannelRequest) GetName() string
- func (x *UpdateChannelRequest) GetNsfw() bool
- func (x *UpdateChannelRequest) GetTopic() string
- func (*UpdateChannelRequest) ProtoMessage()
- func (x *UpdateChannelRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateChannelRequest) Reset()
- func (x *UpdateChannelRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ChannelType_name = map[int32]string{ 0: "CHANNEL_TYPE_UNSPECIFIED", 1: "CHANNEL_TYPE_VOICE", 2: "CHANNEL_TYPE_TEXT", } ChannelType_value = map[string]int32{ "CHANNEL_TYPE_UNSPECIFIED": 0, "CHANNEL_TYPE_VOICE": 1, "CHANNEL_TYPE_TEXT": 2, } )
Enum value maps for ChannelType.
var ChannelService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grumblechat.server.v1.ChannelService", HandlerType: (*ChannelServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListChannels", Handler: _ChannelService_ListChannels_Handler, }, { MethodName: "CreateChannel", Handler: _ChannelService_CreateChannel_Handler, }, { MethodName: "UpdateChannel", Handler: _ChannelService_UpdateChannel_Handler, }, { MethodName: "DeleteChannel", Handler: _ChannelService_DeleteChannel_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "channel/channel.proto", }
ChannelService_ServiceDesc is the grpc.ServiceDesc for ChannelService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_channel_channel_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChannelServiceHandler ¶
func RegisterChannelServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterChannelServiceHandler registers the http handlers for service ChannelService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterChannelServiceHandlerClient ¶
func RegisterChannelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChannelServiceClient) error
RegisterChannelServiceHandlerClient registers the http handlers for service ChannelService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChannelServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChannelServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChannelServiceClient" to call the correct interceptors.
func RegisterChannelServiceHandlerFromEndpoint ¶
func RegisterChannelServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterChannelServiceHandlerFromEndpoint is same as RegisterChannelServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterChannelServiceHandlerServer ¶
func RegisterChannelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChannelServiceServer) error
RegisterChannelServiceHandlerServer registers the http handlers for service ChannelService to "mux". UnaryRPC :call ChannelServiceServer 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 RegisterChannelServiceHandlerFromEndpoint instead.
func RegisterChannelServiceServer ¶
func RegisterChannelServiceServer(s grpc.ServiceRegistrar, srv ChannelServiceServer)
Types ¶
type Channel ¶
type Channel 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"` Nsfw bool `protobuf:"varint,3,opt,name=nsfw,proto3" json:"nsfw,omitempty"` Topic string `protobuf:"bytes,4,opt,name=topic,proto3" json:"topic,omitempty"` Bitrate uint32 `protobuf:"varint,5,opt,name=bitrate,proto3" json:"bitrate,omitempty"` Type ChannelType `protobuf:"varint,6,opt,name=type,proto3,enum=grumblechat.server.v1.ChannelType" json:"type,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*Channel) Descriptor
deprecated
func (*Channel) GetBitrate ¶
func (*Channel) GetCreatedAt ¶
func (x *Channel) GetCreatedAt() *timestamppb.Timestamp
func (*Channel) GetType ¶
func (x *Channel) GetType() ChannelType
func (*Channel) GetUpdatedAt ¶
func (x *Channel) GetUpdatedAt() *timestamppb.Timestamp
func (*Channel) ProtoMessage ¶
func (*Channel) ProtoMessage()
func (*Channel) ProtoReflect ¶
func (x *Channel) ProtoReflect() protoreflect.Message
type ChannelServiceClient ¶
type ChannelServiceClient interface { // lists channels. ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) // creates a new message and returns it. CreateChannel(ctx context.Context, in *CreateChannelRequest, opts ...grpc.CallOption) (*Channel, error) // updates a channel. Returns INVALID_ARGUMENT if the ID is unknown. UpdateChannel(ctx context.Context, in *UpdateChannelRequest, opts ...grpc.CallOption) (*Channel, error) // deletes a channel. DeleteChannel(ctx context.Context, in *DeleteChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
ChannelServiceClient is the client API for ChannelService 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 NewChannelServiceClient ¶
func NewChannelServiceClient(cc grpc.ClientConnInterface) ChannelServiceClient
type ChannelServiceServer ¶
type ChannelServiceServer interface { // lists channels. ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) // creates a new message and returns it. CreateChannel(context.Context, *CreateChannelRequest) (*Channel, error) // updates a channel. Returns INVALID_ARGUMENT if the ID is unknown. UpdateChannel(context.Context, *UpdateChannelRequest) (*Channel, error) // deletes a channel. DeleteChannel(context.Context, *DeleteChannelRequest) (*emptypb.Empty, error) }
ChannelServiceServer is the server API for ChannelService service. All implementations should embed UnimplementedChannelServiceServer for forward compatibility
type ChannelType ¶
type ChannelType int32
Channel object
const ( ChannelType_CHANNEL_TYPE_UNSPECIFIED ChannelType = 0 ChannelType_CHANNEL_TYPE_VOICE ChannelType = 1 ChannelType_CHANNEL_TYPE_TEXT ChannelType = 2 )
func (ChannelType) Descriptor ¶
func (ChannelType) Descriptor() protoreflect.EnumDescriptor
func (ChannelType) Enum ¶
func (x ChannelType) Enum() *ChannelType
func (ChannelType) EnumDescriptor
deprecated
func (ChannelType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ChannelType.Descriptor instead.
func (ChannelType) Number ¶
func (x ChannelType) Number() protoreflect.EnumNumber
func (ChannelType) String ¶
func (x ChannelType) String() string
func (ChannelType) Type ¶
func (ChannelType) Type() protoreflect.EnumType
type CreateChannelRequest ¶
type CreateChannelRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Nsfw bool `protobuf:"varint,2,opt,name=nsfw,proto3" json:"nsfw,omitempty"` Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` Bitrate uint32 `protobuf:"varint,4,opt,name=bitrate,proto3" json:"bitrate,omitempty"` Type ChannelType `protobuf:"varint,5,opt,name=type,proto3,enum=grumblechat.server.v1.ChannelType" json:"type,omitempty"` // contains filtered or unexported fields }
Create Channel
func (*CreateChannelRequest) Descriptor
deprecated
func (*CreateChannelRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateChannelRequest.ProtoReflect.Descriptor instead.
func (*CreateChannelRequest) GetBitrate ¶
func (x *CreateChannelRequest) GetBitrate() uint32
func (*CreateChannelRequest) GetName ¶
func (x *CreateChannelRequest) GetName() string
func (*CreateChannelRequest) GetNsfw ¶
func (x *CreateChannelRequest) GetNsfw() bool
func (*CreateChannelRequest) GetTopic ¶
func (x *CreateChannelRequest) GetTopic() string
func (*CreateChannelRequest) GetType ¶
func (x *CreateChannelRequest) GetType() ChannelType
func (*CreateChannelRequest) ProtoMessage ¶
func (*CreateChannelRequest) ProtoMessage()
func (*CreateChannelRequest) ProtoReflect ¶
func (x *CreateChannelRequest) ProtoReflect() protoreflect.Message
func (*CreateChannelRequest) Reset ¶
func (x *CreateChannelRequest) Reset()
func (*CreateChannelRequest) String ¶
func (x *CreateChannelRequest) String() string
type CreateChannelResponse ¶
type CreateChannelResponse struct { Channel *Channel `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*CreateChannelResponse) Descriptor
deprecated
func (*CreateChannelResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateChannelResponse.ProtoReflect.Descriptor instead.
func (*CreateChannelResponse) GetChannel ¶
func (x *CreateChannelResponse) GetChannel() *Channel
func (*CreateChannelResponse) GetStatus ¶
func (x *CreateChannelResponse) GetStatus() *status.Status
func (*CreateChannelResponse) ProtoMessage ¶
func (*CreateChannelResponse) ProtoMessage()
func (*CreateChannelResponse) ProtoReflect ¶
func (x *CreateChannelResponse) ProtoReflect() protoreflect.Message
func (*CreateChannelResponse) Reset ¶
func (x *CreateChannelResponse) Reset()
func (*CreateChannelResponse) String ¶
func (x *CreateChannelResponse) String() string
type DeleteChannelRequest ¶
type DeleteChannelRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
Delete Channel
func (*DeleteChannelRequest) Descriptor
deprecated
func (*DeleteChannelRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteChannelRequest.ProtoReflect.Descriptor instead.
func (*DeleteChannelRequest) GetId ¶
func (x *DeleteChannelRequest) GetId() string
func (*DeleteChannelRequest) ProtoMessage ¶
func (*DeleteChannelRequest) ProtoMessage()
func (*DeleteChannelRequest) ProtoReflect ¶
func (x *DeleteChannelRequest) ProtoReflect() protoreflect.Message
func (*DeleteChannelRequest) Reset ¶
func (x *DeleteChannelRequest) Reset()
func (*DeleteChannelRequest) String ¶
func (x *DeleteChannelRequest) String() string
type ListChannelsRequest ¶
type ListChannelsRequest struct {
// contains filtered or unexported fields
}
List Channels.
func (*ListChannelsRequest) Descriptor
deprecated
func (*ListChannelsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListChannelsRequest.ProtoReflect.Descriptor instead.
func (*ListChannelsRequest) ProtoMessage ¶
func (*ListChannelsRequest) ProtoMessage()
func (*ListChannelsRequest) ProtoReflect ¶
func (x *ListChannelsRequest) ProtoReflect() protoreflect.Message
func (*ListChannelsRequest) Reset ¶
func (x *ListChannelsRequest) Reset()
func (*ListChannelsRequest) String ¶
func (x *ListChannelsRequest) String() string
type ListChannelsResponse ¶
type ListChannelsResponse struct { Channels []*Channel `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` // contains filtered or unexported fields }
func (*ListChannelsResponse) Descriptor
deprecated
func (*ListChannelsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListChannelsResponse.ProtoReflect.Descriptor instead.
func (*ListChannelsResponse) GetChannels ¶
func (x *ListChannelsResponse) GetChannels() []*Channel
func (*ListChannelsResponse) ProtoMessage ¶
func (*ListChannelsResponse) ProtoMessage()
func (*ListChannelsResponse) ProtoReflect ¶
func (x *ListChannelsResponse) ProtoReflect() protoreflect.Message
func (*ListChannelsResponse) Reset ¶
func (x *ListChannelsResponse) Reset()
func (*ListChannelsResponse) String ¶
func (x *ListChannelsResponse) String() string
type UnimplementedChannelServiceServer ¶
type UnimplementedChannelServiceServer struct { }
UnimplementedChannelServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedChannelServiceServer) CreateChannel ¶
func (UnimplementedChannelServiceServer) CreateChannel(context.Context, *CreateChannelRequest) (*Channel, error)
func (UnimplementedChannelServiceServer) DeleteChannel ¶
func (UnimplementedChannelServiceServer) DeleteChannel(context.Context, *DeleteChannelRequest) (*emptypb.Empty, error)
func (UnimplementedChannelServiceServer) ListChannels ¶
func (UnimplementedChannelServiceServer) ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error)
func (UnimplementedChannelServiceServer) UpdateChannel ¶
func (UnimplementedChannelServiceServer) UpdateChannel(context.Context, *UpdateChannelRequest) (*Channel, error)
type UnsafeChannelServiceServer ¶
type UnsafeChannelServiceServer interface {
// contains filtered or unexported methods
}
UnsafeChannelServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChannelServiceServer will result in compilation errors.
type UpdateChannelRequest ¶
type UpdateChannelRequest 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"` Nsfw bool `protobuf:"varint,3,opt,name=nsfw,proto3" json:"nsfw,omitempty"` Topic string `protobuf:"bytes,4,opt,name=topic,proto3" json:"topic,omitempty"` Bitrate uint32 `protobuf:"varint,5,opt,name=bitrate,proto3" json:"bitrate,omitempty"` // contains filtered or unexported fields }
Update Channel
func (*UpdateChannelRequest) Descriptor
deprecated
func (*UpdateChannelRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateChannelRequest.ProtoReflect.Descriptor instead.
func (*UpdateChannelRequest) GetBitrate ¶
func (x *UpdateChannelRequest) GetBitrate() uint32
func (*UpdateChannelRequest) GetId ¶
func (x *UpdateChannelRequest) GetId() string
func (*UpdateChannelRequest) GetName ¶
func (x *UpdateChannelRequest) GetName() string
func (*UpdateChannelRequest) GetNsfw ¶
func (x *UpdateChannelRequest) GetNsfw() bool
func (*UpdateChannelRequest) GetTopic ¶
func (x *UpdateChannelRequest) GetTopic() string
func (*UpdateChannelRequest) ProtoMessage ¶
func (*UpdateChannelRequest) ProtoMessage()
func (*UpdateChannelRequest) ProtoReflect ¶
func (x *UpdateChannelRequest) ProtoReflect() protoreflect.Message
func (*UpdateChannelRequest) Reset ¶
func (x *UpdateChannelRequest) Reset()
func (*UpdateChannelRequest) String ¶
func (x *UpdateChannelRequest) String() string