services_proto

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostService_GetPost_FullMethodName     = "/github.ayonli.ngrpc.services.PostService/GetPost"
	PostService_SearchPosts_FullMethodName = "/github.ayonli.ngrpc.services.PostService/SearchPosts"
)
View Source
const (
	UserService_GetUser_FullMethodName    = "/github.ayonli.ngrpc.services.UserService/GetUser"
	UserService_GetUsers_FullMethodName   = "/github.ayonli.ngrpc.services.UserService/GetUsers"
	UserService_GetMyPosts_FullMethodName = "/github.ayonli.ngrpc.services.UserService/GetMyPosts"
)

Variables

View Source
var (
	Gender_name = map[int32]string{
		0: "UNKNOWN",
		1: "MALE",
		2: "FEMALE",
	}
	Gender_value = map[string]int32{
		"UNKNOWN": 0,
		"MALE":    1,
		"FEMALE":  2,
	}
)

Enum value maps for Gender.

View Source
var File_github_ayonli_ngrpc_services_PostService_proto protoreflect.FileDescriptor
View Source
var File_github_ayonli_ngrpc_services_UserService_proto protoreflect.FileDescriptor
View Source
var File_github_ayonli_ngrpc_services_struct_proto protoreflect.FileDescriptor
View Source
var PostService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "github.ayonli.ngrpc.services.PostService",
	HandlerType: (*PostServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPost",
			Handler:    _PostService_GetPost_Handler,
		},
		{
			MethodName: "SearchPosts",
			Handler:    _PostService_SearchPosts_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github/ayonli/ngrpc/services/PostService.proto",
}

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

View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "github.ayonli.ngrpc.services.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUser",
			Handler:    _UserService_GetUser_Handler,
		},
		{
			MethodName: "GetUsers",
			Handler:    _UserService_GetUsers_Handler,
		},
		{
			MethodName: "GetMyPosts",
			Handler:    _UserService_GetMyPosts_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github/ayonli/ngrpc/services/UserService.proto",
}

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

Functions

func RegisterPostServiceServer

func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer)

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type Gender

type Gender int32
const (
	Gender_UNKNOWN Gender = 0
	Gender_MALE    Gender = 1
	Gender_FEMALE  Gender = 2
)

func (Gender) Descriptor

func (Gender) Descriptor() protoreflect.EnumDescriptor

func (Gender) Enum

func (x Gender) Enum() *Gender

func (Gender) EnumDescriptor deprecated

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

Deprecated: Use Gender.Descriptor instead.

func (Gender) Number

func (x Gender) Number() protoreflect.EnumNumber

func (Gender) String

func (x Gender) String() string

func (Gender) Type

func (Gender) Type() protoreflect.EnumType

type Post

type Post struct {
	Id          int32   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Title       string  `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Description *string `protobuf:"bytes,3,opt,name=description,proto3,oneof" json:"description,omitempty"`
	Content     string  `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	Author      *User   `protobuf:"bytes,5,opt,name=author,proto3,oneof" json:"author,omitempty"`
	// contains filtered or unexported fields
}

func (*Post) Descriptor deprecated

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

Deprecated: Use Post.ProtoReflect.Descriptor instead.

func (*Post) GetAuthor

func (x *Post) GetAuthor() *User

func (*Post) GetContent

func (x *Post) GetContent() string

func (*Post) GetDescription

func (x *Post) GetDescription() string

func (*Post) GetId

func (x *Post) GetId() int32

func (*Post) GetTitle

func (x *Post) GetTitle() string

func (*Post) ProtoMessage

func (*Post) ProtoMessage()

func (*Post) ProtoReflect

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

func (*Post) Reset

func (x *Post) Reset()

func (*Post) String

func (x *Post) String() string

type PostQuery

type PostQuery struct {
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*PostQuery) Descriptor deprecated

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

Deprecated: Use PostQuery.ProtoReflect.Descriptor instead.

func (*PostQuery) GetId

func (x *PostQuery) GetId() int32

func (*PostQuery) ProtoMessage

func (*PostQuery) ProtoMessage()

func (*PostQuery) ProtoReflect

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

func (*PostQuery) Reset

func (x *PostQuery) Reset()

func (*PostQuery) String

func (x *PostQuery) String() string

type PostSearchResult

type PostSearchResult struct {
	Posts []*Post `protobuf:"bytes,1,rep,name=posts,proto3" json:"posts,omitempty"`
	// contains filtered or unexported fields
}

func (*PostSearchResult) Descriptor deprecated

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

Deprecated: Use PostSearchResult.ProtoReflect.Descriptor instead.

func (*PostSearchResult) GetPosts

func (x *PostSearchResult) GetPosts() []*Post

func (*PostSearchResult) ProtoMessage

func (*PostSearchResult) ProtoMessage()

func (*PostSearchResult) ProtoReflect

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

func (*PostSearchResult) Reset

func (x *PostSearchResult) Reset()

func (*PostSearchResult) String

func (x *PostSearchResult) String() string

type PostServiceClient

type PostServiceClient interface {
	GetPost(ctx context.Context, in *PostQuery, opts ...grpc.CallOption) (*Post, error)
	SearchPosts(ctx context.Context, in *PostsQuery, opts ...grpc.CallOption) (*PostSearchResult, error)
}

PostServiceClient is the client API for PostService 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.

type PostServiceServer

type PostServiceServer interface {
	GetPost(context.Context, *PostQuery) (*Post, error)
	SearchPosts(context.Context, *PostsQuery) (*PostSearchResult, error)
	// contains filtered or unexported methods
}

PostServiceServer is the server API for PostService service. All implementations must embed UnimplementedPostServiceServer for forward compatibility

type PostsQuery

type PostsQuery struct {
	Author  *string `protobuf:"bytes,1,opt,name=author,proto3,oneof" json:"author,omitempty"`
	Keyword *string `protobuf:"bytes,2,opt,name=keyword,proto3,oneof" json:"keyword,omitempty"`
	// contains filtered or unexported fields
}

func (*PostsQuery) Descriptor deprecated

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

Deprecated: Use PostsQuery.ProtoReflect.Descriptor instead.

func (*PostsQuery) GetAuthor

func (x *PostsQuery) GetAuthor() string

func (*PostsQuery) GetKeyword

func (x *PostsQuery) GetKeyword() string

func (*PostsQuery) ProtoMessage

func (*PostsQuery) ProtoMessage()

func (*PostsQuery) ProtoReflect

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

func (*PostsQuery) Reset

func (x *PostsQuery) Reset()

func (*PostsQuery) String

func (x *PostsQuery) String() string

type UnimplementedPostServiceServer

type UnimplementedPostServiceServer struct {
}

UnimplementedPostServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPostServiceServer) GetPost

func (UnimplementedPostServiceServer) SearchPosts

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) GetMyPosts

func (UnimplementedUserServiceServer) GetUser

func (UnimplementedUserServiceServer) GetUsers

type UnsafePostServiceServer

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

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

type UnsafeUserServiceServer

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

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

type User

type User 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"`
	Gender Gender `protobuf:"varint,3,opt,name=gender,proto3,enum=github.ayonli.ngrpc.services.Gender" json:"gender,omitempty"`
	Age    int32  `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"`
	Email  string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAge

func (x *User) GetAge() int32

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetGender

func (x *User) GetGender() Gender

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserQuery

type UserQuery struct {
	Id    *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
	Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*UserQuery) Descriptor deprecated

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

Deprecated: Use UserQuery.ProtoReflect.Descriptor instead.

func (*UserQuery) GetEmail

func (x *UserQuery) GetEmail() string

func (*UserQuery) GetId

func (x *UserQuery) GetId() string

func (*UserQuery) ProtoMessage

func (*UserQuery) ProtoMessage()

func (*UserQuery) ProtoReflect

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

func (*UserQuery) Reset

func (x *UserQuery) Reset()

func (*UserQuery) String

func (x *UserQuery) String() string

type UserQueryResult

type UserQueryResult struct {
	Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*UserQueryResult) Descriptor deprecated

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

Deprecated: Use UserQueryResult.ProtoReflect.Descriptor instead.

func (*UserQueryResult) GetUsers

func (x *UserQueryResult) GetUsers() []*User

func (*UserQueryResult) ProtoMessage

func (*UserQueryResult) ProtoMessage()

func (*UserQueryResult) ProtoReflect

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

func (*UserQueryResult) Reset

func (x *UserQueryResult) Reset()

func (*UserQueryResult) String

func (x *UserQueryResult) String() string

type UserServiceClient

type UserServiceClient interface {
	GetUser(ctx context.Context, in *UserQuery, opts ...grpc.CallOption) (*User, error)
	GetUsers(ctx context.Context, in *UsersQuery, opts ...grpc.CallOption) (*UserQueryResult, error)
	GetMyPosts(ctx context.Context, in *UserQuery, opts ...grpc.CallOption) (*PostSearchResult, error)
}

UserServiceClient is the client API for UserService 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.

type UserServiceServer

type UserServiceServer interface {
	GetUser(context.Context, *UserQuery) (*User, error)
	GetUsers(context.Context, *UsersQuery) (*UserQueryResult, error)
	GetMyPosts(context.Context, *UserQuery) (*PostSearchResult, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

type UsersQuery

type UsersQuery struct {
	Gender *Gender `protobuf:"varint,1,opt,name=gender,proto3,enum=github.ayonli.ngrpc.services.Gender,oneof" json:"gender,omitempty"`
	MinAge *int32  `protobuf:"varint,2,opt,name=minAge,proto3,oneof" json:"minAge,omitempty"`
	MaxAge *int32  `protobuf:"varint,3,opt,name=maxAge,proto3,oneof" json:"maxAge,omitempty"`
	// contains filtered or unexported fields
}

func (*UsersQuery) Descriptor deprecated

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

Deprecated: Use UsersQuery.ProtoReflect.Descriptor instead.

func (*UsersQuery) GetGender

func (x *UsersQuery) GetGender() Gender

func (*UsersQuery) GetMaxAge

func (x *UsersQuery) GetMaxAge() int32

func (*UsersQuery) GetMinAge

func (x *UsersQuery) GetMinAge() int32

func (*UsersQuery) ProtoMessage

func (*UsersQuery) ProtoMessage()

func (*UsersQuery) ProtoReflect

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

func (*UsersQuery) Reset

func (x *UsersQuery) Reset()

func (*UsersQuery) String

func (x *UsersQuery) String() string

Jump to

Keyboard shortcuts

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