poems

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CategoriesRequest_Status_name = map[int32]string{
		0: "PUBLISHED",
		1: "DRAFT",
	}
	CategoriesRequest_Status_value = map[string]int32{
		"PUBLISHED": 0,
		"DRAFT":     1,
	}
)

Enum value maps for CategoriesRequest_Status.

View Source
var File_poems_poems_proto protoreflect.FileDescriptor
View Source
var Poems_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Poems",
	HandlerType: (*PoemsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPoems",
			Handler:    _Poems_GetPoems_Handler,
		},
		{
			MethodName: "GetCategories",
			Handler:    _Poems_GetCategories_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "poems/poems.proto",
}

Poems_ServiceDesc is the grpc.ServiceDesc for Poems service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPoemsServer

func RegisterPoemsServer(s grpc.ServiceRegistrar, srv PoemsServer)

Types

type CategoriesRequest added in v0.2.2

type CategoriesRequest struct {
	Status CategoriesRequest_Status `protobuf:"varint,1,opt,name=status,proto3,enum=CategoriesRequest_Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*CategoriesRequest) Descriptor deprecated added in v0.2.2

func (*CategoriesRequest) Descriptor() ([]byte, []int)

Deprecated: Use CategoriesRequest.ProtoReflect.Descriptor instead.

func (*CategoriesRequest) GetStatus added in v0.2.2

func (*CategoriesRequest) ProtoMessage added in v0.2.2

func (*CategoriesRequest) ProtoMessage()

func (*CategoriesRequest) ProtoReflect added in v0.2.2

func (x *CategoriesRequest) ProtoReflect() protoreflect.Message

func (*CategoriesRequest) Reset added in v0.2.2

func (x *CategoriesRequest) Reset()

func (*CategoriesRequest) String added in v0.2.2

func (x *CategoriesRequest) String() string

type CategoriesRequest_Status added in v0.3.0

type CategoriesRequest_Status int32
const (
	CategoriesRequest_PUBLISHED CategoriesRequest_Status = 0
	CategoriesRequest_DRAFT     CategoriesRequest_Status = 1
)

func (CategoriesRequest_Status) Descriptor added in v0.3.0

func (CategoriesRequest_Status) Enum added in v0.3.0

func (CategoriesRequest_Status) EnumDescriptor deprecated added in v0.3.0

func (CategoriesRequest_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use CategoriesRequest_Status.Descriptor instead.

func (CategoriesRequest_Status) Number added in v0.3.0

func (CategoriesRequest_Status) String added in v0.3.0

func (x CategoriesRequest_Status) String() string

func (CategoriesRequest_Status) Type added in v0.3.0

type CategoriesResponse added in v0.2.2

type CategoriesResponse struct {
	Success    bool                `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Categories map[int32]*Category `` /* 162-byte string literal not displayed */
	// contains filtered or unexported fields
}

The response message containing poems content.

func (*CategoriesResponse) Descriptor deprecated added in v0.2.2

func (*CategoriesResponse) Descriptor() ([]byte, []int)

Deprecated: Use CategoriesResponse.ProtoReflect.Descriptor instead.

func (*CategoriesResponse) GetCategories added in v0.2.2

func (x *CategoriesResponse) GetCategories() map[int32]*Category

func (*CategoriesResponse) GetSuccess added in v0.2.2

func (x *CategoriesResponse) GetSuccess() bool

func (*CategoriesResponse) ProtoMessage added in v0.2.2

func (*CategoriesResponse) ProtoMessage()

func (*CategoriesResponse) ProtoReflect added in v0.2.2

func (x *CategoriesResponse) ProtoReflect() protoreflect.Message

func (*CategoriesResponse) Reset added in v0.2.2

func (x *CategoriesResponse) Reset()

func (*CategoriesResponse) String added in v0.2.2

func (x *CategoriesResponse) String() string

type Category added in v0.2.2

type Category struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Slug   string `protobuf:"bytes,2,opt,name=slug,proto3" json:"slug,omitempty"`
	UserId int64  `protobuf:"varint,3,opt,name=userId,proto3" json:"userId,omitempty"`
	// contains filtered or unexported fields
}

func (*Category) Descriptor deprecated added in v0.2.2

func (*Category) Descriptor() ([]byte, []int)

Deprecated: Use Category.ProtoReflect.Descriptor instead.

func (*Category) GetName added in v0.2.2

func (x *Category) GetName() string

func (*Category) GetSlug added in v0.2.2

func (x *Category) GetSlug() string

func (*Category) GetUserId added in v0.5.5

func (x *Category) GetUserId() int64

func (*Category) ProtoMessage added in v0.2.2

func (*Category) ProtoMessage()

func (*Category) ProtoReflect added in v0.2.2

func (x *Category) ProtoReflect() protoreflect.Message

func (*Category) Reset added in v0.2.2

func (x *Category) Reset()

func (*Category) String added in v0.2.2

func (x *Category) String() string

type Poem

type Poem struct {
	Title  string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Text   string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	UserId int64  `protobuf:"varint,3,opt,name=userId,proto3" json:"userId,omitempty"`
	// contains filtered or unexported fields
}

func (*Poem) Descriptor deprecated

func (*Poem) Descriptor() ([]byte, []int)

Deprecated: Use Poem.ProtoReflect.Descriptor instead.

func (*Poem) GetText

func (x *Poem) GetText() string

func (*Poem) GetTitle

func (x *Poem) GetTitle() string

func (*Poem) GetUserId added in v0.5.5

func (x *Poem) GetUserId() int64

func (*Poem) ProtoMessage

func (*Poem) ProtoMessage()

func (*Poem) ProtoReflect

func (x *Poem) ProtoReflect() protoreflect.Message

func (*Poem) Reset

func (x *Poem) Reset()

func (*Poem) String

func (x *Poem) String() string

type PoemsClient

type PoemsClient interface {
	// Get poems list from one category
	GetPoems(ctx context.Context, in *PoemsRequest, opts ...grpc.CallOption) (*PoemsResponse, error)
	// Get categories list
	GetCategories(ctx context.Context, in *CategoriesRequest, opts ...grpc.CallOption) (*CategoriesResponse, error)
}

PoemsClient is the client API for Poems 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 NewPoemsClient

func NewPoemsClient(cc grpc.ClientConnInterface) PoemsClient

type PoemsRequest

type PoemsRequest struct {
	Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"`
	// contains filtered or unexported fields
}

The request message containing the category.

func (*PoemsRequest) Descriptor deprecated

func (*PoemsRequest) Descriptor() ([]byte, []int)

Deprecated: Use PoemsRequest.ProtoReflect.Descriptor instead.

func (*PoemsRequest) GetCategory

func (x *PoemsRequest) GetCategory() string

func (*PoemsRequest) ProtoMessage

func (*PoemsRequest) ProtoMessage()

func (*PoemsRequest) ProtoReflect

func (x *PoemsRequest) ProtoReflect() protoreflect.Message

func (*PoemsRequest) Reset

func (x *PoemsRequest) Reset()

func (*PoemsRequest) String

func (x *PoemsRequest) String() string

type PoemsResponse

type PoemsResponse struct {
	Success bool            `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Poems   map[int32]*Poem `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

The response message containing poems content.

func (*PoemsResponse) Descriptor deprecated

func (*PoemsResponse) Descriptor() ([]byte, []int)

Deprecated: Use PoemsResponse.ProtoReflect.Descriptor instead.

func (*PoemsResponse) GetPoems

func (x *PoemsResponse) GetPoems() map[int32]*Poem

func (*PoemsResponse) GetSuccess

func (x *PoemsResponse) GetSuccess() bool

func (*PoemsResponse) ProtoMessage

func (*PoemsResponse) ProtoMessage()

func (*PoemsResponse) ProtoReflect

func (x *PoemsResponse) ProtoReflect() protoreflect.Message

func (*PoemsResponse) Reset

func (x *PoemsResponse) Reset()

func (*PoemsResponse) String

func (x *PoemsResponse) String() string

type PoemsServer

type PoemsServer interface {
	// Get poems list from one category
	GetPoems(context.Context, *PoemsRequest) (*PoemsResponse, error)
	// Get categories list
	GetCategories(context.Context, *CategoriesRequest) (*CategoriesResponse, error)
	// contains filtered or unexported methods
}

PoemsServer is the server API for Poems service. All implementations must embed UnimplementedPoemsServer for forward compatibility

type UnimplementedPoemsServer

type UnimplementedPoemsServer struct {
}

UnimplementedPoemsServer must be embedded to have forward compatible implementations.

func (UnimplementedPoemsServer) GetCategories added in v0.2.2

func (UnimplementedPoemsServer) GetPoems

type UnsafePoemsServer

type UnsafePoemsServer interface {
	// contains filtered or unexported methods
}

UnsafePoemsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PoemsServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL