Help us shape the future of Go! Take the 2026 Go Developer Survey

groups

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

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")
	ErrInvalidUserID       = errors.New("invalid user id")
	ErrStreamInterrupted   = errors.New("stream interrupted")
	ErrUnauthorizedStream  = errors.New("unauthorized stream access")
)

Functions

This section is empty.

Types

type AuthorizerInterface

type AuthorizerInterface interface {
	DeleteGroup(context.Context, string) error
}

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

	StreamGroupsForUser(context.Context, string, string, func(*types.Group) error) error
	StreamUsersInGroup(context.Context, string, string, func(string) error) error
}

type GrpcServer

type GrpcServer struct {
	v0_groups.UnimplementedAuthzGroupsServiceServer
	// contains filtered or unexported fields
}

func (*GrpcServer) AddUserToGroups

func (*GrpcServer) AddUsersToGroup

func (*GrpcServer) CreateGroup

func (*GrpcServer) GetGroup

func (*GrpcServer) ListGroups

func (*GrpcServer) ListUserGroups

func (*GrpcServer) ListUsersInGroup

func (*GrpcServer) RemoveGroup

func (*GrpcServer) UpdateGroup

type MappingGrpcServer added in v1.4.0

type MappingGrpcServer struct {
	pb.UnimplementedGroupsMappingServiceServer
	// contains filtered or unexported fields
}

func NewMappingGrpcServer added in v1.4.0

func (*MappingGrpcServer) GetGroupsForUser added in v1.4.0

func (*MappingGrpcServer) GetUsersInGroup added in v1.4.0

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) AddUsersToGroup

func (s *Service) AddUsersToGroup(ctx context.Context, groupID string, userIDs []string) error

func (*Service) CreateGroup

func (s *Service) CreateGroup(ctx context.Context, group *types.Group) (*types.Group, error)

func (*Service) DeleteGroup

func (s *Service) DeleteGroup(ctx context.Context, id string) error

func (*Service) GetGroup

func (s *Service) GetGroup(ctx context.Context, id string) (*types.Group, error)

func (*Service) GetGroupsForUser

func (s *Service) GetGroupsForUser(ctx context.Context, userID string) ([]*types.Group, error)

func (*Service) ListGroups

func (s *Service) ListGroups(ctx context.Context) ([]*types.Group, error)

func (*Service) ListUsersInGroup

func (s *Service) ListUsersInGroup(ctx context.Context, groupID string) ([]string, error)

func (*Service) RemoveUsersFromGroup

func (s *Service) RemoveUsersFromGroup(ctx context.Context, groupID string, users []string) error

func (*Service) StreamGroupsForUser added in v1.4.0

func (s *Service) StreamGroupsForUser(ctx context.Context, tenantID, userID string, fn func(*types.Group) error) error

func (*Service) StreamUsersInGroup added in v1.4.0

func (s *Service) StreamUsersInGroup(ctx context.Context, tenantID, groupID string, fn func(string) error) error

func (*Service) UpdateGroup

func (s *Service) UpdateGroup(ctx context.Context, id string, group *types.Group) (*types.Group, error)

func (*Service) UpdateGroupsForUser

func (s *Service) UpdateGroupsForUser(ctx context.Context, userID string, groupIDs []string) error

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

	StreamGroupsForUser(context.Context, string, string, func(*types.Group) error) error
	StreamUsersInGroup(context.Context, string, string, func(string) error) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL