Documentation
¶
Index ¶
- Constants
- Variables
- type AuthorizerInterface
- type DatabaseInterface
- type GrpcServer
- func (g *GrpcServer) AddUserToGroups(ctx context.Context, req *v0_groups.AddUserToGroupsReq) (*v0_groups.AddUserToGroupsResp, error)
- func (g *GrpcServer) AddUsersToGroup(ctx context.Context, req *v0_groups.AddUsersToGroupReq) (*v0_groups.AddUsersToGroupResp, error)
- func (g *GrpcServer) CreateGroup(ctx context.Context, req *v0_groups.CreateGroupReq) (*v0_groups.CreateGroupResp, error)
- func (g *GrpcServer) GetGroup(ctx context.Context, req *v0_groups.GetGroupReq) (*v0_groups.GetGroupResp, error)
- func (g *GrpcServer) ListGroups(ctx context.Context, req *v0_groups.ListGroupsReq) (*v0_groups.ListGroupsResp, error)
- func (g *GrpcServer) ListUserGroups(ctx context.Context, req *v0_groups.ListUserGroupsReq) (*v0_groups.ListUserGroupsResp, error)
- func (g *GrpcServer) ListUsersInGroup(ctx context.Context, req *v0_groups.ListUsersInGroupReq) (*v0_groups.ListUsersInGroupResp, error)
- func (g *GrpcServer) RemoveGroup(ctx context.Context, req *v0_groups.RemoveGroupReq) (*v0_groups.RemoveGroupResp, error)
- func (g *GrpcServer) RemoveUserFromGroup(ctx context.Context, req *v0_groups.RemoveUserFromGroupReq) (*v0_groups.RemoveUserFromGroupResp, error)
- func (g *GrpcServer) UpdateGroup(ctx context.Context, req *v0_groups.UpdateGroupReq) (*v0_groups.UpdateGroupResp, error)
- type Service
- func (s *Service) AddUsersToGroup(ctx context.Context, groupID string, userIDs []string) error
- func (s *Service) CreateGroup(ctx context.Context, group *types.Group) (*types.Group, error)
- func (s *Service) DeleteGroup(ctx context.Context, id string) error
- func (s *Service) GetGroup(ctx context.Context, id string) (*types.Group, error)
- func (s *Service) GetGroupsForUser(ctx context.Context, userID string) ([]*types.Group, error)
- func (s *Service) ListGroups(ctx context.Context) ([]*types.Group, error)
- func (s *Service) ListUsersInGroup(ctx context.Context, groupID string) ([]string, error)
- func (s *Service) RemoveUsersFromGroup(ctx context.Context, groupID string, users []string) error
- func (s *Service) UpdateGroup(ctx context.Context, id string, group *types.Group) (*types.Group, error)
- func (s *Service) UpdateGroupsForUser(ctx context.Context, userID string, groupIDs []string) error
- type ServiceInterface
- type Storage
- func (m *Storage) AddUsersToGroup(ctx context.Context, groupID string, userIDs []string) error
- func (m *Storage) CreateGroup(ctx context.Context, group *types.Group) (*types.Group, error)
- func (m *Storage) DeleteGroup(ctx context.Context, id string) error
- func (m *Storage) GetGroup(ctx context.Context, id string) (*types.Group, error)
- func (m *Storage) GetGroupsForUser(ctx context.Context, userID string) ([]*types.Group, error)
- func (m *Storage) ListGroups(ctx context.Context) ([]*types.Group, error)
- func (m *Storage) ListUsersInGroup(ctx context.Context, groupID string) ([]string, error)
- func (m *Storage) RemoveUsersFromGroup(ctx context.Context, groupID string, userIDs []string) error
- func (m *Storage) UpdateGroup(ctx context.Context, id string, group *types.Group) (*types.Group, error)
- func (m *Storage) UpdateGroupsForUser(ctx context.Context, userID string, groupIDs []string) error
Constants ¶
View Source
const DefaultTenantID = "default"
Variables ¶
View Source
var ( ErrGroupNotFound = errors.New("group not found") ErrInvalidGroupName = errors.New("invalid group name") ErrDuplicateGroup = errors.New("group already exists") ErrInvalidGroupType = errors.New("invalid group type") ErrInvalidTenant = errors.New("invalid tenant") ErrInternalServerError = errors.New("internal server error") ErrUserAlreadyInGroup = errors.New("user already in group") ErrInvalidGroupID = errors.New("invalid group id") )
Functions ¶
This section is empty.
Types ¶
type AuthorizerInterface ¶
type DatabaseInterface ¶
type DatabaseInterface interface {
ListGroups(context.Context) ([]*types.Group, error)
CreateGroup(context.Context, *types.Group) (*types.Group, error)
GetGroup(context.Context, string) (*types.Group, error)
UpdateGroup(context.Context, string, *types.Group) (*types.Group, error)
DeleteGroup(context.Context, string) error
AddUsersToGroup(context.Context, string, []string) error
ListUsersInGroup(context.Context, string) ([]string, error)
RemoveUsersFromGroup(context.Context, string, []string) error
GetGroupsForUser(context.Context, string) ([]*types.Group, error)
UpdateGroupsForUser(context.Context, string, []string) error
}
type GrpcServer ¶
type GrpcServer struct {
v0_groups.UnimplementedAuthzGroupsServiceServer
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer(svc ServiceInterface, tracer tracing.TracingInterface, monitor monitoring.MonitorInterface, logger logging.LoggerInterface) *GrpcServer
func (*GrpcServer) AddUserToGroups ¶
func (g *GrpcServer) AddUserToGroups(ctx context.Context, req *v0_groups.AddUserToGroupsReq) (*v0_groups.AddUserToGroupsResp, error)
func (*GrpcServer) AddUsersToGroup ¶
func (g *GrpcServer) AddUsersToGroup(ctx context.Context, req *v0_groups.AddUsersToGroupReq) (*v0_groups.AddUsersToGroupResp, error)
func (*GrpcServer) CreateGroup ¶
func (g *GrpcServer) CreateGroup(ctx context.Context, req *v0_groups.CreateGroupReq) (*v0_groups.CreateGroupResp, error)
func (*GrpcServer) GetGroup ¶
func (g *GrpcServer) GetGroup(ctx context.Context, req *v0_groups.GetGroupReq) (*v0_groups.GetGroupResp, error)
func (*GrpcServer) ListGroups ¶
func (g *GrpcServer) ListGroups(ctx context.Context, req *v0_groups.ListGroupsReq) (*v0_groups.ListGroupsResp, error)
func (*GrpcServer) ListUserGroups ¶
func (g *GrpcServer) ListUserGroups(ctx context.Context, req *v0_groups.ListUserGroupsReq) (*v0_groups.ListUserGroupsResp, error)
func (*GrpcServer) ListUsersInGroup ¶
func (g *GrpcServer) ListUsersInGroup(ctx context.Context, req *v0_groups.ListUsersInGroupReq) (*v0_groups.ListUsersInGroupResp, error)
func (*GrpcServer) RemoveGroup ¶
func (g *GrpcServer) RemoveGroup(ctx context.Context, req *v0_groups.RemoveGroupReq) (*v0_groups.RemoveGroupResp, error)
func (*GrpcServer) RemoveUserFromGroup ¶
func (g *GrpcServer) RemoveUserFromGroup(ctx context.Context, req *v0_groups.RemoveUserFromGroupReq) (*v0_groups.RemoveUserFromGroupResp, error)
func (*GrpcServer) UpdateGroup ¶
func (g *GrpcServer) UpdateGroup(ctx context.Context, req *v0_groups.UpdateGroupReq) (*v0_groups.UpdateGroupResp, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( db DatabaseInterface, authz AuthorizerInterface, tracer tracing.TracingInterface, monitor monitoring.MonitorInterface, logger logging.LoggerInterface, ) *Service
func (*Service) AddUsersToGroup ¶
func (*Service) CreateGroup ¶
func (*Service) GetGroupsForUser ¶
func (*Service) ListGroups ¶
func (*Service) ListUsersInGroup ¶
func (*Service) RemoveUsersFromGroup ¶
func (*Service) UpdateGroup ¶
type ServiceInterface ¶
type ServiceInterface interface {
ListGroups(context.Context) ([]*types.Group, error)
CreateGroup(context.Context, *types.Group) (*types.Group, error)
GetGroup(context.Context, string) (*types.Group, error)
UpdateGroup(context.Context, string, *types.Group) (*types.Group, error)
DeleteGroup(context.Context, string) error
AddUsersToGroup(context.Context, string, []string) error
ListUsersInGroup(context.Context, string) ([]string, error)
RemoveUsersFromGroup(context.Context, string, []string) error
GetGroupsForUser(context.Context, string) ([]*types.Group, error)
UpdateGroupsForUser(context.Context, string, []string) error
}
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage() *Storage
func (*Storage) AddUsersToGroup ¶
func (*Storage) CreateGroup ¶
func (*Storage) GetGroupsForUser ¶
func (*Storage) ListGroups ¶
func (*Storage) ListUsersInGroup ¶
func (*Storage) RemoveUsersFromGroup ¶
func (*Storage) UpdateGroup ¶
Click to show internal directories.
Click to hide internal directories.