service

package
v0.2.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ListAllowedRoleName

func ListAllowedRoleName() []string

ListAllowedRoleName lists names of all allowed roles

func ValidateRole

func ValidateRole(r Role) bool

Types

type Role

type Role string

Role defines the user role

const (
	Manager           Role = "Manager"
	AIResearcher      Role = "AI Researcher"
	AIEngineer        Role = "AI Engineer"
	DataEngineer      Role = "Data Engineer"
	DataScientist     Role = "Data Scientist"
	AnalyticsEngineer Role = "Analytics Engineer"
	Hobbyist          Role = "Hobbyist"
)

Define roles

func (Role) GetName

func (r Role) GetName() string

GetName gets the name of a role

type Service

type Service interface {
	ListRole() []string
	ListUser(pageSize int, pageToken string) ([]datamodel.User, string, int, error)
	CreateUser(user *datamodel.User) (*datamodel.User, error)
	GetUser(uid uuid.UUID) (*datamodel.User, error)
	GetUserByID(id string) (*datamodel.User, error)
	UpdateUser(uid uuid.UUID, user *datamodel.User) (*datamodel.User, error)
	DeleteUser(uid uuid.UUID) error
	DeleteUserByID(id string) error
}

Service interface

func NewService

func NewService(r repository.Repository) Service

NewService initiates a service instance

Jump to

Keyboard shortcuts

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