Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterAlbumsServer(s grpc.ServiceRegistrar, srv AlbumsServer)
- type Album
- func (*Album) Descriptor() ([]byte, []int)deprecated
- func (x *Album) GetArtist() string
- func (x *Album) GetCover() string
- func (x *Album) GetId() int64
- func (x *Album) GetScore() int64
- func (x *Album) GetTitle() string
- func (*Album) ProtoMessage()
- func (x *Album) ProtoReflect() protoreflect.Message
- func (x *Album) Reset()
- func (x *Album) String() string
- type AlbumsClient
- type AlbumsServer
- type Albums_ReadClient
- type Albums_ReadServer
- type Identifier
- type Nil
- type Score
- type UnimplementedAlbumsServer
- func (UnimplementedAlbumsServer) Create(context.Context, *Album) (*Identifier, error)
- func (UnimplementedAlbumsServer) Decrement(context.Context, *Identifier) (*Score, error)
- func (UnimplementedAlbumsServer) Delete(context.Context, *Album) (*Nil, error)
- func (UnimplementedAlbumsServer) Increment(context.Context, *Identifier) (*Score, error)
- func (UnimplementedAlbumsServer) Read(*Nil, Albums_ReadServer) error
- func (UnimplementedAlbumsServer) Update(context.Context, *UpdateRequest) (*Nil, error)
- type UnsafeAlbumsServer
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetNewAlbum() *Album
- func (x *UpdateRequest) GetOldAlbum() *Album
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
Constants ¶
const ( Albums_Create_FullMethodName = "/album.Albums/Create" Albums_Read_FullMethodName = "/album.Albums/Read" Albums_Update_FullMethodName = "/album.Albums/Update" Albums_Delete_FullMethodName = "/album.Albums/Delete" Albums_Increment_FullMethodName = "/album.Albums/Increment" Albums_Decrement_FullMethodName = "/album.Albums/Decrement" )
Variables ¶
var Albums_ServiceDesc = grpc.ServiceDesc{ ServiceName: "album.Albums", HandlerType: (*AlbumsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _Albums_Create_Handler, }, { MethodName: "Update", Handler: _Albums_Update_Handler, }, { MethodName: "Delete", Handler: _Albums_Delete_Handler, }, { MethodName: "Increment", Handler: _Albums_Increment_Handler, }, { MethodName: "Decrement", Handler: _Albums_Decrement_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Read", Handler: _Albums_Read_Handler, ServerStreams: true, }, }, Metadata: "album.proto", }
Albums_ServiceDesc is the grpc.ServiceDesc for Albums service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_album_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAlbumsServer ¶
func RegisterAlbumsServer(s grpc.ServiceRegistrar, srv AlbumsServer)
Types ¶
type Album ¶
type Album struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Artist string `protobuf:"bytes,3,opt,name=artist,proto3" json:"artist,omitempty"` Score int64 `protobuf:"varint,4,opt,name=score,proto3" json:"score,omitempty"` Cover string `protobuf:"bytes,5,opt,name=cover,proto3" json:"cover,omitempty"` // contains filtered or unexported fields }
func (*Album) Descriptor
deprecated
func (*Album) ProtoMessage ¶
func (*Album) ProtoMessage()
func (*Album) ProtoReflect ¶
func (x *Album) ProtoReflect() protoreflect.Message
type AlbumsClient ¶
type AlbumsClient interface { Create(ctx context.Context, in *Album, opts ...grpc.CallOption) (*Identifier, error) Read(ctx context.Context, in *Nil, opts ...grpc.CallOption) (Albums_ReadClient, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Nil, error) Delete(ctx context.Context, in *Album, opts ...grpc.CallOption) (*Nil, error) Increment(ctx context.Context, in *Identifier, opts ...grpc.CallOption) (*Score, error) Decrement(ctx context.Context, in *Identifier, opts ...grpc.CallOption) (*Score, error) }
AlbumsClient is the client API for Albums 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 NewAlbumsClient ¶
func NewAlbumsClient(cc grpc.ClientConnInterface) AlbumsClient
type AlbumsServer ¶
type AlbumsServer interface { Create(context.Context, *Album) (*Identifier, error) Read(*Nil, Albums_ReadServer) error Update(context.Context, *UpdateRequest) (*Nil, error) Delete(context.Context, *Album) (*Nil, error) Increment(context.Context, *Identifier) (*Score, error) Decrement(context.Context, *Identifier) (*Score, error) // contains filtered or unexported methods }
AlbumsServer is the server API for Albums service. All implementations must embed UnimplementedAlbumsServer for forward compatibility
type Albums_ReadClient ¶
type Albums_ReadClient interface { Recv() (*Album, error) grpc.ClientStream }
type Albums_ReadServer ¶
type Albums_ReadServer interface { Send(*Album) error grpc.ServerStream }
type Identifier ¶
type Identifier struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Identifier) Descriptor
deprecated
func (*Identifier) Descriptor() ([]byte, []int)
Deprecated: Use Identifier.ProtoReflect.Descriptor instead.
func (*Identifier) GetId ¶
func (x *Identifier) GetId() int64
func (*Identifier) ProtoMessage ¶
func (*Identifier) ProtoMessage()
func (*Identifier) ProtoReflect ¶
func (x *Identifier) ProtoReflect() protoreflect.Message
func (*Identifier) Reset ¶
func (x *Identifier) Reset()
func (*Identifier) String ¶
func (x *Identifier) String() string
type Nil ¶
type Nil struct {
// contains filtered or unexported fields
}
func (*Nil) Descriptor
deprecated
func (*Nil) ProtoMessage ¶
func (*Nil) ProtoMessage()
func (*Nil) ProtoReflect ¶
func (x *Nil) ProtoReflect() protoreflect.Message
type Score ¶
type Score struct { Score int64 `protobuf:"varint,1,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*Score) Descriptor
deprecated
func (*Score) ProtoMessage ¶
func (*Score) ProtoMessage()
func (*Score) ProtoReflect ¶
func (x *Score) ProtoReflect() protoreflect.Message
type UnimplementedAlbumsServer ¶
type UnimplementedAlbumsServer struct { }
UnimplementedAlbumsServer must be embedded to have forward compatible implementations.
func (UnimplementedAlbumsServer) Create ¶
func (UnimplementedAlbumsServer) Create(context.Context, *Album) (*Identifier, error)
func (UnimplementedAlbumsServer) Decrement ¶
func (UnimplementedAlbumsServer) Decrement(context.Context, *Identifier) (*Score, error)
func (UnimplementedAlbumsServer) Increment ¶
func (UnimplementedAlbumsServer) Increment(context.Context, *Identifier) (*Score, error)
func (UnimplementedAlbumsServer) Read ¶
func (UnimplementedAlbumsServer) Read(*Nil, Albums_ReadServer) error
func (UnimplementedAlbumsServer) Update ¶
func (UnimplementedAlbumsServer) Update(context.Context, *UpdateRequest) (*Nil, error)
type UnsafeAlbumsServer ¶
type UnsafeAlbumsServer interface {
// contains filtered or unexported methods
}
UnsafeAlbumsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AlbumsServer will result in compilation errors.
type UpdateRequest ¶
type UpdateRequest struct { OldAlbum *Album `protobuf:"bytes,1,opt,name=oldAlbum,proto3" json:"oldAlbum,omitempty"` NewAlbum *Album `protobuf:"bytes,2,opt,name=newAlbum,proto3" json:"newAlbum,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetNewAlbum ¶
func (x *UpdateRequest) GetNewAlbum() *Album
func (*UpdateRequest) GetOldAlbum ¶
func (x *UpdateRequest) GetOldAlbum() *Album
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string