Documentation ¶
Overview ¶
Package proto provides helper functions related to protocol buffers
Index ¶
- Variables
- func CoreAccount(account *Account) (*goapi.Account, error)
- func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer)
- type Account
- func (*Account) Descriptor() ([]byte, []int)deprecated
- func (x *Account) GetCreatedTime() *timestamppb.Timestamp
- func (x *Account) GetEmail() string
- func (x *Account) GetFirstName() string
- func (x *Account) GetGender() string
- func (x *Account) GetId() string
- func (x *Account) GetLastName() string
- func (x *Account) GetPassHash() string
- func (x *Account) GetUpdatedTime() *timestamppb.Timestamp
- func (*Account) ProtoMessage()
- func (x *Account) ProtoReflect() protoreflect.Message
- func (x *Account) Reset()
- func (x *Account) String() string
- type AccountID
- type AccountsClient
- type AccountsServer
- type AddAccountMessage
- func (*AddAccountMessage) Descriptor() ([]byte, []int)deprecated
- func (x *AddAccountMessage) GetEmail() string
- func (x *AddAccountMessage) GetFirstName() string
- func (x *AddAccountMessage) GetGender() string
- func (x *AddAccountMessage) GetLastName() string
- func (x *AddAccountMessage) GetPassword() string
- func (*AddAccountMessage) ProtoMessage()
- func (x *AddAccountMessage) ProtoReflect() protoreflect.Message
- func (x *AddAccountMessage) Reset()
- func (x *AddAccountMessage) String() string
- func (a *AddAccountMessage) ToCoreAccount() *goapi.Account
- type Model
- func (*Model) Descriptor() ([]byte, []int)deprecated
- func (x *Model) GetCreatedTime() *timestamppb.Timestamp
- func (x *Model) GetId() string
- func (x *Model) GetUpdatedTime() *timestamppb.Timestamp
- func (*Model) ProtoMessage()
- func (x *Model) ProtoReflect() protoreflect.Message
- func (x *Model) Reset()
- func (x *Model) String() string
- type UnimplementedAccountsServer
- type UnsafeAccountsServer
Constants ¶
This section is empty.
Variables ¶
var Accounts_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Accounts", HandlerType: (*AccountsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AddAccount", Handler: _Accounts_AddAccount_Handler, }, { MethodName: "FetchAccount", Handler: _Accounts_FetchAccount_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "internal/proto/goapi.proto", }
Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_internal_proto_goapi_proto protoreflect.FileDescriptor
Functions ¶
func CoreAccount ¶
CoreAccount converts a proto account struct to goapi.Account
func RegisterAccountsServer ¶
func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer)
Types ¶
type Account ¶
type Account struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreatedTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"` FirstName string `protobuf:"bytes,4,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` LastName string `protobuf:"bytes,5,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` Gender string `protobuf:"bytes,7,opt,name=gender,proto3" json:"gender,omitempty"` PassHash string `protobuf:"bytes,8,opt,name=pass_hash,json=passHash,proto3" json:"pass_hash,omitempty"` Email string `protobuf:"bytes,9,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*Account) Descriptor
deprecated
func (*Account) GetCreatedTime ¶
func (x *Account) GetCreatedTime() *timestamppb.Timestamp
func (*Account) GetFirstName ¶
func (*Account) GetLastName ¶
func (*Account) GetPassHash ¶
func (*Account) GetUpdatedTime ¶
func (x *Account) GetUpdatedTime() *timestamppb.Timestamp
func (*Account) ProtoMessage ¶
func (*Account) ProtoMessage()
func (*Account) ProtoReflect ¶
func (x *Account) ProtoReflect() protoreflect.Message
type AccountID ¶
type AccountID struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*AccountID) Descriptor
deprecated
func (*AccountID) ProtoMessage ¶
func (*AccountID) ProtoMessage()
func (*AccountID) ProtoReflect ¶
func (x *AccountID) ProtoReflect() protoreflect.Message
type AccountsClient ¶
type AccountsClient interface { AddAccount(ctx context.Context, in *AddAccountMessage, opts ...grpc.CallOption) (*Account, error) FetchAccount(ctx context.Context, in *AccountID, opts ...grpc.CallOption) (*Account, error) }
AccountsClient is the client API for Accounts 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 NewAccountsClient ¶
func NewAccountsClient(cc grpc.ClientConnInterface) AccountsClient
type AccountsServer ¶
type AccountsServer interface { AddAccount(context.Context, *AddAccountMessage) (*Account, error) FetchAccount(context.Context, *AccountID) (*Account, error) // contains filtered or unexported methods }
AccountsServer is the server API for Accounts service. All implementations must embed UnimplementedAccountsServer for forward compatibility
type AddAccountMessage ¶
type AddAccountMessage struct { FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` LastName string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` Gender string `protobuf:"bytes,4,opt,name=gender,proto3" json:"gender,omitempty"` Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*AddAccountMessage) Descriptor
deprecated
func (*AddAccountMessage) Descriptor() ([]byte, []int)
Deprecated: Use AddAccountMessage.ProtoReflect.Descriptor instead.
func (*AddAccountMessage) GetEmail ¶
func (x *AddAccountMessage) GetEmail() string
func (*AddAccountMessage) GetFirstName ¶
func (x *AddAccountMessage) GetFirstName() string
func (*AddAccountMessage) GetGender ¶
func (x *AddAccountMessage) GetGender() string
func (*AddAccountMessage) GetLastName ¶
func (x *AddAccountMessage) GetLastName() string
func (*AddAccountMessage) GetPassword ¶
func (x *AddAccountMessage) GetPassword() string
func (*AddAccountMessage) ProtoMessage ¶
func (*AddAccountMessage) ProtoMessage()
func (*AddAccountMessage) ProtoReflect ¶
func (x *AddAccountMessage) ProtoReflect() protoreflect.Message
func (*AddAccountMessage) Reset ¶
func (x *AddAccountMessage) Reset()
func (*AddAccountMessage) String ¶
func (x *AddAccountMessage) String() string
func (*AddAccountMessage) ToCoreAccount ¶
func (a *AddAccountMessage) ToCoreAccount() *goapi.Account
ToCoreAccount converts AddAccountMessage to goapim.Account
type Model ¶
type Model struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreatedTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"` // contains filtered or unexported fields }
func (*Model) Descriptor
deprecated
func (*Model) GetCreatedTime ¶
func (x *Model) GetCreatedTime() *timestamppb.Timestamp
func (*Model) GetUpdatedTime ¶
func (x *Model) GetUpdatedTime() *timestamppb.Timestamp
func (*Model) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) ProtoReflect ¶
func (x *Model) ProtoReflect() protoreflect.Message
type UnimplementedAccountsServer ¶
type UnimplementedAccountsServer struct { }
UnimplementedAccountsServer must be embedded to have forward compatible implementations.
func (UnimplementedAccountsServer) AddAccount ¶
func (UnimplementedAccountsServer) AddAccount(context.Context, *AddAccountMessage) (*Account, error)
func (UnimplementedAccountsServer) FetchAccount ¶
type UnsafeAccountsServer ¶
type UnsafeAccountsServer interface {
// contains filtered or unexported methods
}
UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AccountsServer will result in compilation errors.