Documentation ¶
Index ¶
- Variables
- func LookupUserModelColumn(field string) string
- func LookupUserModelColumns(paths []string) (cols []string)
- func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer)
- type CreateUserRequest
- type DeleteUserRequest
- type GetUserRequest
- type ListUsersRequest
- type ListUsersResponse
- func (*ListUsersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListUsersResponse) GetNextPageToken() string
- func (x *ListUsersResponse) GetUsers() []*User
- func (*ListUsersResponse) ProtoMessage()
- func (x *ListUsersResponse) ProtoReflect() protoreflect.Message
- func (x *ListUsersResponse) Reset()
- func (x *ListUsersResponse) String() string
- type UnimplementedUsersServiceServer
- func (UnimplementedUsersServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error)
- func (UnimplementedUsersServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error)
- func (UnimplementedUsersServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error)
- func (UnimplementedUsersServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
- func (UnimplementedUsersServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
- type UnsafeUsersServiceServer
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask
- func (x *UpdateUserRequest) GetUser() *User
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreateTime() *timestamppb.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetFamilyName() string
- func (x *User) GetGivenName() string
- func (x *User) GetName() string
- func (x *User) GetUpdateTime() *timestamppb.Timestamp
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (p *User) ToModel() (*UserModel, error)
- func (p *User) WithDB(db *gorm.DB) UserWithDB
- type UserGetOption
- type UserListOption
- type UserModel
- type UserWithDB
- func (c UserWithDB) Create(ctx context.Context) (*User, error)
- func (c UserWithDB) Delete(ctx context.Context) error
- func (c UserWithDB) Get(ctx context.Context, opts ...UserGetOption) (*User, error)
- func (c UserWithDB) List(ctx context.Context, opts ...UserListOption) ([]*User, error)
- func (c UserWithDB) Patch(ctx context.Context, mask *fieldmaskpb.FieldMask) error
- func (c UserWithDB) Update(ctx context.Context) (*User, error)
- type UsersServiceClient
- type UsersServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_users_proto protoreflect.FileDescriptor
var UsersService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "options.UsersService", HandlerType: (*UsersServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUser", Handler: _UsersService_GetUser_Handler, }, { MethodName: "ListUsers", Handler: _UsersService_ListUsers_Handler, }, { MethodName: "CreateUser", Handler: _UsersService_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _UsersService_UpdateUser_Handler, }, { MethodName: "DeleteUser", Handler: _UsersService_DeleteUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "users.proto", }
UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func LookupUserModelColumn ¶
func LookupUserModelColumns ¶
func RegisterUsersServiceServer ¶
func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer)
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetUser ¶
func (x *CreateUserRequest) GetUser() *User
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type DeleteUserRequest ¶
type DeleteUserRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*DeleteUserRequest) Descriptor
deprecated
func (*DeleteUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserRequest) GetName ¶
func (x *DeleteUserRequest) GetName() string
func (*DeleteUserRequest) ProtoMessage ¶
func (*DeleteUserRequest) ProtoMessage()
func (*DeleteUserRequest) ProtoReflect ¶
func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message
func (*DeleteUserRequest) Reset ¶
func (x *DeleteUserRequest) Reset()
func (*DeleteUserRequest) String ¶
func (x *DeleteUserRequest) String() string
type GetUserRequest ¶
type GetUserRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetName ¶
func (x *GetUserRequest) GetName() string
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type ListUsersRequest ¶
type ListUsersRequest struct {
// contains filtered or unexported fields
}
func (*ListUsersRequest) Descriptor
deprecated
func (*ListUsersRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.
func (*ListUsersRequest) ProtoMessage ¶
func (*ListUsersRequest) ProtoMessage()
func (*ListUsersRequest) ProtoReflect ¶
func (x *ListUsersRequest) ProtoReflect() protoreflect.Message
func (*ListUsersRequest) Reset ¶
func (x *ListUsersRequest) Reset()
func (*ListUsersRequest) String ¶
func (x *ListUsersRequest) String() string
type ListUsersResponse ¶
type ListUsersResponse struct { Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
func (*ListUsersResponse) Descriptor
deprecated
func (*ListUsersResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.
func (*ListUsersResponse) GetNextPageToken ¶
func (x *ListUsersResponse) GetNextPageToken() string
func (*ListUsersResponse) GetUsers ¶
func (x *ListUsersResponse) GetUsers() []*User
func (*ListUsersResponse) ProtoMessage ¶
func (*ListUsersResponse) ProtoMessage()
func (*ListUsersResponse) ProtoReflect ¶
func (x *ListUsersResponse) ProtoReflect() protoreflect.Message
func (*ListUsersResponse) Reset ¶
func (x *ListUsersResponse) Reset()
func (*ListUsersResponse) String ¶
func (x *ListUsersResponse) String() string
type UnimplementedUsersServiceServer ¶
type UnimplementedUsersServiceServer struct { }
UnimplementedUsersServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUsersServiceServer) CreateUser ¶
func (UnimplementedUsersServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error)
func (UnimplementedUsersServiceServer) DeleteUser ¶
func (UnimplementedUsersServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error)
func (UnimplementedUsersServiceServer) GetUser ¶
func (UnimplementedUsersServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error)
func (UnimplementedUsersServiceServer) ListUsers ¶
func (UnimplementedUsersServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
func (UnimplementedUsersServiceServer) UpdateUser ¶
func (UnimplementedUsersServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
type UnsafeUsersServiceServer ¶
type UnsafeUsersServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUsersServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UsersServiceServer will result in compilation errors.
type UpdateUserRequest ¶
type UpdateUserRequest struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetUpdateMask ¶
func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateUserRequest) GetUser ¶
func (x *UpdateUserRequest) GetUser() *User
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) ProtoReflect ¶
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
func (*UpdateUserRequest) Reset ¶
func (x *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (x *UpdateUserRequest) String() string
type User ¶
type User struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` UpdateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` GivenName string `protobuf:"bytes,4,opt,name=given_name,json=givenName,proto3" json:"given_name,omitempty"` FamilyName string `protobuf:"bytes,5,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"` Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreateTime ¶
func (x *User) GetCreateTime() *timestamppb.Timestamp
func (*User) GetFamilyName ¶
func (*User) GetGivenName ¶
func (*User) GetUpdateTime ¶
func (x *User) GetUpdateTime() *timestamppb.Timestamp
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserGetOption ¶
func WithUserGetFieldMask ¶
func WithUserGetFieldMask(mask *fieldmaskpb.FieldMask) UserGetOption
type UserListOption ¶
func WithUserListFieldMask ¶
func WithUserListFieldMask(mask *fieldmaskpb.FieldMask) UserListOption
func WithUserListFilter ¶
func WithUserListFilter(filter string) UserListOption
func WithUserListLimit ¶
func WithUserListLimit(n int) UserListOption
func WithUserListOffset ¶
func WithUserListOffset(n int) UserListOption
func WithUserListOrder ¶
func WithUserListOrder(order string) UserListOption
type UserModel ¶
type UserModel struct { Name string `gorm:"not null;unique;primaryKey;index;<-:create"` CreateTime sql.NullTime `gorm:"not null;autoCreateTime"` UpdateTime sql.NullTime `gorm:"autoUpdateTime"` GivenName string FamilyName string Email string `gorm:"not null"` }
UserModel is the GORM model for pb.User.
type UserWithDB ¶
type UserWithDB struct {
// contains filtered or unexported fields
}
func (UserWithDB) Get ¶
func (c UserWithDB) Get(ctx context.Context, opts ...UserGetOption) (*User, error)
func (UserWithDB) List ¶
func (c UserWithDB) List(ctx context.Context, opts ...UserListOption) ([]*User, error)
func (UserWithDB) Patch ¶
func (c UserWithDB) Patch(ctx context.Context, mask *fieldmaskpb.FieldMask) error
type UsersServiceClient ¶
type UsersServiceClient interface { GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
UsersServiceClient is the client API for UsersService 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 NewUsersServiceClient ¶
func NewUsersServiceClient(cc grpc.ClientConnInterface) UsersServiceClient
type UsersServiceServer ¶
type UsersServiceServer interface { GetUser(context.Context, *GetUserRequest) (*User, error) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) CreateUser(context.Context, *CreateUserRequest) (*User, error) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
UsersServiceServer is the server API for UsersService service. All implementations must embed UnimplementedUsersServiceServer for forward compatibility