postgres

package
v0.0.0-...-4ee07f5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migration

func Migration(rolesTableNamePrefix, entityTableName, entityIDColumnName string) (*migrate.MemoryMigrationSource, error)

Migration of Auth service.

Types

type Repository

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

func NewRepository

func NewRepository(db postgres.Database, tableNamePrefix, entityTableName, entityIDColumnName string) Repository

NewRepository instantiates a PostgreSQL implementation of Roles repository.

func (*Repository) AddRoles

func (repo *Repository) AddRoles(ctx context.Context, rps []roles.RoleProvision) ([]roles.Role, error)

func (*Repository) RemoveMemberFromAllRoles

func (repo *Repository) RemoveMemberFromAllRoles(ctx context.Context, memberID string) (err error)

func (*Repository) RemoveRoles

func (repo *Repository) RemoveRoles(ctx context.Context, roleIDs []string) error

func (*Repository) RetrieveAllRoles

func (repo *Repository) RetrieveAllRoles(ctx context.Context, entityID string, limit, offset uint64) (roles.RolePage, error)

func (*Repository) RetrieveEntitiesRolesActionsMembers

func (repo *Repository) RetrieveEntitiesRolesActionsMembers(ctx context.Context, entityIDs []string) ([]roles.EntityActionRole, []roles.EntityMemberRole, error)

func (*Repository) RetrieveRole

func (repo *Repository) RetrieveRole(ctx context.Context, roleID string) (roles.Role, error)

func (*Repository) RetrieveRoleByEntityIDAndName

func (repo *Repository) RetrieveRoleByEntityIDAndName(ctx context.Context, entityID, roleName string) (roles.Role, error)

func (*Repository) RoleAddActions

func (repo *Repository) RoleAddActions(ctx context.Context, role roles.Role, actions []string) (caps []string, err error)

func (*Repository) RoleAddMembers

func (repo *Repository) RoleAddMembers(ctx context.Context, role roles.Role, members []string) ([]string, error)

func (*Repository) RoleCheckActionsExists

func (repo *Repository) RoleCheckActionsExists(ctx context.Context, roleID string, actions []string) (bool, error)

func (*Repository) RoleCheckMembersExists

func (repo *Repository) RoleCheckMembersExists(ctx context.Context, roleID string, members []string) (bool, error)

func (*Repository) RoleListActions

func (repo *Repository) RoleListActions(ctx context.Context, roleID string) ([]string, error)

func (*Repository) RoleListMembers

func (repo *Repository) RoleListMembers(ctx context.Context, roleID string, limit, offset uint64) (roles.MembersPage, error)

func (*Repository) RoleRemoveActions

func (repo *Repository) RoleRemoveActions(ctx context.Context, role roles.Role, actions []string) (err error)

func (*Repository) RoleRemoveAllActions

func (repo *Repository) RoleRemoveAllActions(ctx context.Context, role roles.Role) error

func (*Repository) RoleRemoveAllMembers

func (repo *Repository) RoleRemoveAllMembers(ctx context.Context, role roles.Role) (err error)

func (*Repository) RoleRemoveMembers

func (repo *Repository) RoleRemoveMembers(ctx context.Context, role roles.Role, members []string) (err error)

func (*Repository) UpdateRole

func (repo *Repository) UpdateRole(ctx context.Context, role roles.Role) (roles.Role, error)

Update only role name, don't update ID

Jump to

Keyboard shortcuts

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