service

package
v0.3.4-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 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, int64, 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