Documentation
¶
Index ¶
- type Repository
- type Server
- func (s *Server) CreateUser(ctx context.Context, req *usersservicepb.CreateUserRequest) (*usersservicepb.CreateUserResponse, error)
- func (s *Server) GetUser(ctx context.Context, req *usersservicepb.GetUserRequest) (*usersservicepb.GetUserResponse, error)
- func (s *Server) ListUsers(ctx context.Context, req *usersservicepb.ListUsersRequest) (res *usersservicepb.ListUsersResponse, err error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface {
GetUser(ctx context.Context, id string) (repo.User, error)
CreateUser(ctx context.Context, name string) (repo.User, error)
ListUsers(ctx context.Context, names []string, order *repo.SortOrder) ([]repo.User, error)
}
Repository allows storing and fetching of users and deployments.
type Server ¶
type Server struct {
Repo Repository
Admin *User
Logger *logrus.Logger
}
Server implements the gRPC server interface
func (*Server) CreateUser ¶
func (s *Server) CreateUser(ctx context.Context, req *usersservicepb.CreateUserRequest) (*usersservicepb.CreateUserResponse, error)
CreateUser creates a new user in the database.
func (*Server) GetUser ¶
func (s *Server) GetUser(ctx context.Context, req *usersservicepb.GetUserRequest) (*usersservicepb.GetUserResponse, error)
GetUser returns the user corresponding to the ID, if found.
func (*Server) ListUsers ¶
func (s *Server) ListUsers(ctx context.Context, req *usersservicepb.ListUsersRequest) (res *usersservicepb.ListUsersResponse, err error)
ListUsers returns all the users matching the filters.
Click to show internal directories.
Click to hide internal directories.