role

package
v0.0.0-...-b394ddd Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(api *operations.TutorAPI, db *ent.Client)

Init creates role entries in database and sets role route handlers.

Types

type Service

type Service struct {
	Role *ent.RoleClient
}

Service holds an ent role client.

func (*Service) AddRole

func (r *Service) AddRole(ctx context.Context, user *user.Service, id uuid.UUID, name string) ([]*ent.Role, error)

AddRole returns user roles or an error.

func (*Service) ListRole

func (r *Service) ListRole(ctx context.Context) ([]*ent.Role, error)

ListRole returns a role array or an error.

func (*Service) ReadRoleByName

func (r *Service) ReadRoleByName(ctx context.Context, name string) (*ent.Role, error)

ReadRoleByName returns a role or an error.

func (*Service) RemoveRole

func (r *Service) RemoveRole(ctx context.Context, user *user.Service, id uuid.UUID, name string) error

RemoveRole returns an error.

Jump to

Keyboard shortcuts

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