proto

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 6 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 DispatchCommandRequest

type DispatchCommandRequest 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        int32    `json:"-"`
}

DispatchCommandRequest is passed when dispatching

func (*DispatchCommandRequest) Descriptor

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

func (*DispatchCommandRequest) GetName

func (m *DispatchCommandRequest) GetName() string

func (*DispatchCommandRequest) GetPayload

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

func (*DispatchCommandRequest) ProtoMessage

func (*DispatchCommandRequest) ProtoMessage()

func (*DispatchCommandRequest) Reset

func (m *DispatchCommandRequest) Reset()

func (*DispatchCommandRequest) String

func (m *DispatchCommandRequest) String() string

func (*DispatchCommandRequest) XXX_DiscardUnknown

func (m *DispatchCommandRequest) XXX_DiscardUnknown()

func (*DispatchCommandRequest) XXX_Marshal

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

func (*DispatchCommandRequest) XXX_Merge

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

func (*DispatchCommandRequest) XXX_Size

func (m *DispatchCommandRequest) XXX_Size() int

func (*DispatchCommandRequest) XXX_Unmarshal

func (m *DispatchCommandRequest) 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        int32    `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                 int32    `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Limit                int32    `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `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() int32

func (*ListUserRequest) GetPage

func (m *ListUserRequest) GetPage() int32

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                 int32    `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
	Limit                int32    `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	Total                int32    `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ListUserResponse list of all users

func (*ListUserResponse) Descriptor

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

func (*ListUserResponse) GetLimit

func (m *ListUserResponse) GetLimit() int32

func (*ListUserResponse) GetPage

func (m *ListUserResponse) GetPage() int32

func (*ListUserResponse) GetTotal

func (m *ListUserResponse) GetTotal() int32

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 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        int32    `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 {
	DispatchCommand(ctx context.Context, in *DispatchCommandRequest, opts ...grpc.CallOption) (*empty.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.

func NewUserServiceClient

func NewUserServiceClient(cc *grpc.ClientConn) UserServiceClient

type UserServiceServer

type UserServiceServer interface {
	DispatchCommand(context.Context, *DispatchCommandRequest) (*empty.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