proto

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 8 Imported by: 0

README

proto

Package proto contains protocol buffer code to populate

Generating client and server code

To generate the gRPC client and server interfaces from *.proto service definition. Use the protocol buffer compiler protoc with a special gRPC Go plugin. For more info read

From this directory run:

$ make build

Running this command generates the following files in this directory:

  • *.pb.go

This contains:

All the protocol buffer code to populate, serialize, and retrieve our request and response message types An interface type (or stub) for clients to call with the methods defined in the services. An interface type for servers to implement, also with the methods defined in the services.


Package proto contains protocol buffer code to populate

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterUserServiceServer

func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)

Types

type DispatchUserCommandRequest

type DispatchUserCommandRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Payload              []byte   `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int64    `json:"-"`
}

DispatchUserCommandRequest is passed when dispatching

func (*DispatchUserCommandRequest) Descriptor

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

func (*DispatchUserCommandRequest) GetName

func (m *DispatchUserCommandRequest) GetName() string

func (*DispatchUserCommandRequest) GetPayload

func (m *DispatchUserCommandRequest) GetPayload() []byte

func (*DispatchUserCommandRequest) ProtoMessage

func (*DispatchUserCommandRequest) ProtoMessage()

func (*DispatchUserCommandRequest) Reset

func (m *DispatchUserCommandRequest) Reset()

func (*DispatchUserCommandRequest) String

func (m *DispatchUserCommandRequest) String() string

func (*DispatchUserCommandRequest) XXX_DiscardUnknown

func (m *DispatchUserCommandRequest) XXX_DiscardUnknown()

func (*DispatchUserCommandRequest) XXX_Marshal

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

func (*DispatchUserCommandRequest) XXX_Merge

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

func (*DispatchUserCommandRequest) XXX_Size

func (m *DispatchUserCommandRequest) XXX_Size() int

func (*DispatchUserCommandRequest) XXX_Unmarshal

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

type GetUserRequest

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

GetUserRequest is a request data to read user

func (*GetUserRequest) Descriptor

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

func (*GetUserRequest) GetId

func (m *GetUserRequest) GetId() string

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) Reset

func (m *GetUserRequest) Reset()

func (*GetUserRequest) String

func (m *GetUserRequest) String() string

func (*GetUserRequest) XXX_DiscardUnknown

func (m *GetUserRequest) XXX_DiscardUnknown()

func (*GetUserRequest) XXX_Marshal

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

func (*GetUserRequest) XXX_Merge

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

func (*GetUserRequest) XXX_Size

func (m *GetUserRequest) XXX_Size() int

func (*GetUserRequest) XXX_Unmarshal

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

type ListUserRequest

type ListUserRequest struct {
	Page                 int64    `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Limit                int64    `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int64    `json:"-"`
}

ListUserRequest is a request data to read all user for a given page

func (*ListUserRequest) Descriptor

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

func (*ListUserRequest) GetLimit

func (m *ListUserRequest) GetLimit() int64

func (*ListUserRequest) GetPage

func (m *ListUserRequest) GetPage() int64

func (*ListUserRequest) ProtoMessage

func (*ListUserRequest) ProtoMessage()

func (*ListUserRequest) Reset

func (m *ListUserRequest) Reset()

func (*ListUserRequest) String

func (m *ListUserRequest) String() string

func (*ListUserRequest) XXX_DiscardUnknown

func (m *ListUserRequest) XXX_DiscardUnknown()

func (*ListUserRequest) XXX_Marshal

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

func (*ListUserRequest) XXX_Merge

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

func (*ListUserRequest) XXX_Size

func (m *ListUserRequest) XXX_Size() int

func (*ListUserRequest) XXX_Unmarshal

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

type ListUserResponse

type ListUserResponse struct {
	Users                []*User  `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	Page                 int64    `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
	Limit                int64    `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	Total                int64    `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int64    `json:"-"`
}

ListUserResponse list of all users

func (*ListUserResponse) Descriptor

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

func (*ListUserResponse) GetLimit

func (m *ListUserResponse) GetLimit() int64

func (*ListUserResponse) GetPage

func (m *ListUserResponse) GetPage() int64

func (*ListUserResponse) GetTotal

func (m *ListUserResponse) GetTotal() int64

func (*ListUserResponse) GetUsers

func (m *ListUserResponse) GetUsers() []*User

func (*ListUserResponse) ProtoMessage

func (*ListUserResponse) ProtoMessage()

func (*ListUserResponse) Reset

func (m *ListUserResponse) Reset()

func (*ListUserResponse) String

func (m *ListUserResponse) String() string

func (*ListUserResponse) XXX_DiscardUnknown

func (m *ListUserResponse) XXX_DiscardUnknown()

func (*ListUserResponse) XXX_Marshal

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

func (*ListUserResponse) XXX_Merge

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

func (*ListUserResponse) XXX_Size

func (m *ListUserResponse) XXX_Size() int

func (*ListUserResponse) XXX_Unmarshal

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

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedUserServiceServer) DispatchUserCommand

func (*UnimplementedUserServiceServer) GetUser

func (*UnimplementedUserServiceServer) ListUsers

type User

type User struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Email                string   `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	FacebookId           string   `protobuf:"bytes,3,opt,name=facebookId,proto3" json:"facebookId,omitempty"`
	GoogleId             string   `protobuf:"bytes,4,opt,name=googleId,proto3" json:"googleId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int64    `json:"-"`
}

User object

func (*User) Descriptor

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

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetFacebookId

func (m *User) GetFacebookId() string

func (*User) GetGoogleId

func (m *User) GetGoogleId() string

func (*User) GetId

func (m *User) GetId() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

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

func (*User) XXX_Merge

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

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

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

type UserServiceClient

type UserServiceClient interface {
	DispatchUserCommand(ctx context.Context, in *DispatchUserCommandRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
	ListUsers(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserResponse, error)
}

UserServiceClient is the client API for UserService service.

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

type UserServiceServer

type UserServiceServer interface {
	DispatchUserCommand(context.Context, *DispatchUserCommandRequest) (*emptypb.Empty, error)
	GetUser(context.Context, *GetUserRequest) (*User, error)
	ListUsers(context.Context, *ListUserRequest) (*ListUserResponse, error)
}

UserServiceServer is the server API for UserService service.

Jump to

Keyboard shortcuts

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