Documentation ¶
Overview ¶
Package users is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterUsersMgmtHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUsersMgmtHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersMgmtClient) error
- func RegisterUsersMgmtHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUsersMgmtServer(s *grpc.Server, srv UsersMgmtServer)
- type UsersMgmtClient
- type UsersMgmtServer
- type UsersMgmtServerMock
- func (m *UsersMgmtServerMock) CreateUser(ctx context.Context, req *request.CreateUser) (*response.User, error)
- func (m *UsersMgmtServerMock) DeleteUser(ctx context.Context, req *request.Email) (*response.DeleteUserResp, error)
- func (m *UsersMgmtServerMock) DeleteUserByUsername(ctx context.Context, req *request.Username) (*response.DeleteUserResp, error)
- func (m *UsersMgmtServerMock) GetUser(ctx context.Context, req *request.Email) (*response.User, error)
- func (m *UsersMgmtServerMock) GetUserByUsername(ctx context.Context, req *request.Username) (*response.User, error)
- func (m *UsersMgmtServerMock) GetUsers(ctx context.Context, req *request.GetUsersReq) (*response.Users, error)
- func (m *UsersMgmtServerMock) Reset()
- func (m *UsersMgmtServerMock) UpdateSelf(ctx context.Context, req *request.UpdateSelf) (*response.User, error)
- func (m *UsersMgmtServerMock) UpdateUser(ctx context.Context, req *request.UpdateUser) (*response.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterUsersMgmtHandler ¶
func RegisterUsersMgmtHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterUsersMgmtHandler registers the http handlers for service UsersMgmt to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUsersMgmtHandlerClient ¶
func RegisterUsersMgmtHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersMgmtClient) error
RegisterUsersMgmtHandlerClient registers the http handlers for service UsersMgmt to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersMgmtClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersMgmtClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UsersMgmtClient" to call the correct interceptors.
func RegisterUsersMgmtHandlerFromEndpoint ¶
func RegisterUsersMgmtHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUsersMgmtHandlerFromEndpoint is same as RegisterUsersMgmtHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUsersMgmtServer ¶
func RegisterUsersMgmtServer(s *grpc.Server, srv UsersMgmtServer)
Types ¶
type UsersMgmtClient ¶
type UsersMgmtClient interface { GetUsers(ctx context.Context, in *request.GetUsersReq, opts ...grpc.CallOption) (*response.Users, error) GetUserByUsername(ctx context.Context, in *request.Username, opts ...grpc.CallOption) (*response.User, error) CreateUser(ctx context.Context, in *request.CreateUser, opts ...grpc.CallOption) (*response.User, error) DeleteUserByUsername(ctx context.Context, in *request.Username, opts ...grpc.CallOption) (*response.DeleteUserResp, error) UpdateUser(ctx context.Context, in *request.UpdateUser, opts ...grpc.CallOption) (*response.User, error) UpdateSelf(ctx context.Context, in *request.UpdateSelf, opts ...grpc.CallOption) (*response.User, error) // deprecated API GetUser(ctx context.Context, in *request.Email, opts ...grpc.CallOption) (*response.User, error) DeleteUser(ctx context.Context, in *request.Email, opts ...grpc.CallOption) (*response.DeleteUserResp, error) }
UsersMgmtClient is the client API for UsersMgmt service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUsersMgmtClient ¶
func NewUsersMgmtClient(cc *grpc.ClientConn) UsersMgmtClient
type UsersMgmtServer ¶
type UsersMgmtServer interface { GetUsers(context.Context, *request.GetUsersReq) (*response.Users, error) GetUserByUsername(context.Context, *request.Username) (*response.User, error) CreateUser(context.Context, *request.CreateUser) (*response.User, error) DeleteUserByUsername(context.Context, *request.Username) (*response.DeleteUserResp, error) UpdateUser(context.Context, *request.UpdateUser) (*response.User, error) UpdateSelf(context.Context, *request.UpdateSelf) (*response.User, error) // deprecated API GetUser(context.Context, *request.Email) (*response.User, error) DeleteUser(context.Context, *request.Email) (*response.DeleteUserResp, error) }
UsersMgmtServer is the server API for UsersMgmt service.
type UsersMgmtServerMock ¶
type UsersMgmtServerMock struct { GetUsersFunc func(context.Context, *request.GetUsersReq) (*response.Users, error) GetUserByUsernameFunc func(context.Context, *request.Username) (*response.User, error) CreateUserFunc func(context.Context, *request.CreateUser) (*response.User, error) DeleteUserByUsernameFunc func(context.Context, *request.Username) (*response.DeleteUserResp, error) UpdateUserFunc func(context.Context, *request.UpdateUser) (*response.User, error) UpdateSelfFunc func(context.Context, *request.UpdateSelf) (*response.User, error) GetUserFunc func(context.Context, *request.Email) (*response.User, error) DeleteUserFunc func(context.Context, *request.Email) (*response.DeleteUserResp, error) // contains filtered or unexported fields }
UsersMgmtServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns
func NewUsersMgmtServerMock ¶
func NewUsersMgmtServerMock() *UsersMgmtServerMock
NewUsersMgmtServerMock gives you a fresh instance of UsersMgmtServerMock.
func NewUsersMgmtServerMockWithoutValidation ¶
func NewUsersMgmtServerMockWithoutValidation() *UsersMgmtServerMock
NewUsersMgmtServerMockWithoutValidation gives you a fresh instance of UsersMgmtServerMock which does not attempt to validate requests before passing them to their respective '*Func'.
func (*UsersMgmtServerMock) CreateUser ¶
func (m *UsersMgmtServerMock) CreateUser(ctx context.Context, req *request.CreateUser) (*response.User, error)
func (*UsersMgmtServerMock) DeleteUser ¶
func (m *UsersMgmtServerMock) DeleteUser(ctx context.Context, req *request.Email) (*response.DeleteUserResp, error)
func (*UsersMgmtServerMock) DeleteUserByUsername ¶
func (m *UsersMgmtServerMock) DeleteUserByUsername(ctx context.Context, req *request.Username) (*response.DeleteUserResp, error)
func (*UsersMgmtServerMock) GetUserByUsername ¶
func (*UsersMgmtServerMock) GetUsers ¶
func (m *UsersMgmtServerMock) GetUsers(ctx context.Context, req *request.GetUsersReq) (*response.Users, error)
func (*UsersMgmtServerMock) Reset ¶
func (m *UsersMgmtServerMock) Reset()
Reset resets all overridden functions
func (*UsersMgmtServerMock) UpdateSelf ¶
func (m *UsersMgmtServerMock) UpdateSelf(ctx context.Context, req *request.UpdateSelf) (*response.User, error)
func (*UsersMgmtServerMock) UpdateUser ¶
func (m *UsersMgmtServerMock) UpdateUser(ctx context.Context, req *request.UpdateUser) (*response.User, error)