blog

package
v1.5.100 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBlogServer

func RegisterBlogServer(s *grpc.Server, srv BlogServer)

Types

type BlogClient

type BlogClient interface {
	ListAllPosts(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*PostList, error)
	GetPost(ctx context.Context, in *PostQuery, opts ...grpc.CallOption) (*Post, error)
	CreatePost(ctx context.Context, in *Post, opts ...grpc.CallOption) (*Post, error)
	DeletePost(ctx context.Context, in *PostQuery, opts ...grpc.CallOption) (*empty.Empty, error)
}

BlogClient is the client API for Blog service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewBlogClient

func NewBlogClient(cc *grpc.ClientConn) BlogClient

type BlogServer

type BlogServer interface {
	ListAllPosts(context.Context, *empty.Empty) (*PostList, error)
	GetPost(context.Context, *PostQuery) (*Post, error)
	CreatePost(context.Context, *Post) (*Post, error)
	DeletePost(context.Context, *PostQuery) (*empty.Empty, error)
}

BlogServer is the server API for Blog service.

type Post

type Post struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title                string   `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Body                 string   `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Post) Descriptor

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

func (*Post) GetBody

func (m *Post) GetBody() string

func (*Post) GetId

func (m *Post) GetId() string

func (*Post) GetTitle

func (m *Post) GetTitle() string

func (*Post) ProtoMessage

func (*Post) ProtoMessage()

func (*Post) Reset

func (m *Post) Reset()

func (*Post) String

func (m *Post) String() string

func (*Post) XXX_DiscardUnknown

func (m *Post) XXX_DiscardUnknown()

func (*Post) XXX_Marshal

func (m *Post) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Post) XXX_Merge

func (m *Post) XXX_Merge(src proto.Message)

func (*Post) XXX_Size

func (m *Post) XXX_Size() int

func (*Post) XXX_Unmarshal

func (m *Post) XXX_Unmarshal(b []byte) error

type PostList

type PostList struct {
	Posts                []*Post  `protobuf:"bytes,1,rep,name=posts,proto3" json:"posts,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PostList) Descriptor

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

func (*PostList) GetPosts

func (m *PostList) GetPosts() []*Post

func (*PostList) ProtoMessage

func (*PostList) ProtoMessage()

func (*PostList) Reset

func (m *PostList) Reset()

func (*PostList) String

func (m *PostList) String() string

func (*PostList) XXX_DiscardUnknown

func (m *PostList) XXX_DiscardUnknown()

func (*PostList) XXX_Marshal

func (m *PostList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PostList) XXX_Merge

func (m *PostList) XXX_Merge(src proto.Message)

func (*PostList) XXX_Size

func (m *PostList) XXX_Size() int

func (*PostList) XXX_Unmarshal

func (m *PostList) XXX_Unmarshal(b []byte) error

type PostQuery

type PostQuery struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PostQuery) Descriptor

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

func (*PostQuery) GetId

func (m *PostQuery) GetId() string

func (*PostQuery) ProtoMessage

func (*PostQuery) ProtoMessage()

func (*PostQuery) Reset

func (m *PostQuery) Reset()

func (*PostQuery) String

func (m *PostQuery) String() string

func (*PostQuery) XXX_DiscardUnknown

func (m *PostQuery) XXX_DiscardUnknown()

func (*PostQuery) XXX_Marshal

func (m *PostQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PostQuery) XXX_Merge

func (m *PostQuery) XXX_Merge(src proto.Message)

func (*PostQuery) XXX_Size

func (m *PostQuery) XXX_Size() int

func (*PostQuery) XXX_Unmarshal

func (m *PostQuery) XXX_Unmarshal(b []byte) error

type UnimplementedBlogServer

type UnimplementedBlogServer struct {
}

UnimplementedBlogServer can be embedded to have forward compatible implementations.

func (*UnimplementedBlogServer) CreatePost

func (*UnimplementedBlogServer) CreatePost(ctx context.Context, req *Post) (*Post, error)

func (*UnimplementedBlogServer) DeletePost

func (*UnimplementedBlogServer) DeletePost(ctx context.Context, req *PostQuery) (*empty.Empty, error)

func (*UnimplementedBlogServer) GetPost

func (*UnimplementedBlogServer) GetPost(ctx context.Context, req *PostQuery) (*Post, error)

func (*UnimplementedBlogServer) ListAllPosts

func (*UnimplementedBlogServer) ListAllPosts(ctx context.Context, req *empty.Empty) (*PostList, error)

Jump to

Keyboard shortcuts

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