Documentation
¶
Index ¶
- Variables
- type MenuRepository
- func (r *MenuRepository) CreateMenu(ctx context.Context, menu *entity.Menu) (*entity.Menu, error)
- func (r *MenuRepository) CreateMenuItem(ctx context.Context, menuItem *entity.MenuItem) (*entity.MenuItem, error)
- func (r *MenuRepository) DeleteMenu(ctx context.Context, menuUUID *uuid.UUID) error
- func (r *MenuRepository) DeleteMenuItem(ctx context.Context, menuItemUUID *uuid.UUID) error
- func (r *MenuRepository) GetAllMenus(ctx context.Context) ([]entity.Menu, error)
- func (r *MenuRepository) GetMenu(ctx context.Context, menuUUID *uuid.UUID) (*entity.Menu, error)
- func (r *MenuRepository) GetMenuByName(ctx context.Context, name string) (*entity.Menu, error)
- func (r *MenuRepository) GetMenuItem(ctx context.Context, menuItemUUID *uuid.UUID) (*entity.MenuItem, error)
- func (r *MenuRepository) GetMenuItemByShortName(ctx context.Context, menuUUID *uuid.UUID, shortName string) (*entity.MenuItem, error)
- func (r *MenuRepository) UpdateMenu(ctx context.Context, menuUUID *uuid.UUID, menu *entity.Menu) (*entity.Menu, error)
- type OrderRepository
- func (r *OrderRepository) CreateOrder(ctx context.Context, order *entity.Order) (*entity.Order, error)
- func (r *OrderRepository) CreateOrderItem(ctx context.Context, orderUUID *uuid.UUID, orderItem *entity.OrderItem) (*entity.OrderItem, error)
- func (r *OrderRepository) DeleteOrder(ctx context.Context, orderUUID *uuid.UUID) error
- func (r *OrderRepository) DeleteOrderItem(ctx context.Context, orderItemUUID *uuid.UUID) error
- func (r *OrderRepository) GetActiveOrderByMenu(ctx context.Context, menuUUID *uuid.UUID) (*entity.Order, error)
- func (r *OrderRepository) GetActiveOrderByMenuName(ctx context.Context, menuName string) (*entity.Order, error)
- func (r *OrderRepository) GetAllOrderItems(ctx context.Context, orderUUID *uuid.UUID) ([]entity.OrderItem, error)
- func (r *OrderRepository) GetAllOrderItemsForOrderAndUser(ctx context.Context, orderUUID, userUUID *uuid.UUID) ([]entity.OrderItem, error)
- func (r *OrderRepository) GetAllOrders(ctx context.Context) ([]entity.Order, error)
- func (r *OrderRepository) GetOrder(ctx context.Context, uuid *uuid.UUID) (*entity.Order, error)
- func (r *OrderRepository) GetOrderItem(ctx context.Context, uuid *uuid.UUID) (*entity.OrderItem, error)
- func (r *OrderRepository) UpdateOrder(ctx context.Context, orderUUID, currentUser *uuid.UUID, order *entity.Order) (*entity.Order, error)
- func (r *OrderRepository) UpdateOrderItem(ctx context.Context, orderItemUUID, userUUID *uuid.UUID, ...) (*entity.OrderItem, error)
- type UserRepository
- func (r *UserRepository) CreateMatrixUser(ctx context.Context, matrixUser *entity.MatrixUser) (*entity.MatrixUser, error)
- func (r *UserRepository) CreatePasswordUser(ctx context.Context, passwordUser *entity.PasswordUser) (*entity.PasswordUser, error)
- func (r *UserRepository) CreateSSHUser(ctx context.Context, sshUser *entity.SSHUser) (*entity.SSHUser, error)
- func (r *UserRepository) CreateUser(ctx context.Context, user *entity.User) (*entity.User, error)
- func (r *UserRepository) DeleteMatrixUser(ctx context.Context, userUUID *uuid.UUID) error
- func (r *UserRepository) DeletePasswordUser(ctx context.Context, userUUID *uuid.UUID) error
- func (r *UserRepository) DeleteSSHUser(ctx context.Context, userUUID *uuid.UUID) error
- func (r *UserRepository) DeleteUser(ctx context.Context, userUUID *uuid.UUID) error
- func (r *UserRepository) FindPasswordUser(ctx context.Context, username string) (*entity.PasswordUser, error)
- func (r *UserRepository) GetAllMatrixUsers(ctx context.Context) ([]entity.MatrixUser, error)
- func (r *UserRepository) GetAllPasswordUsers(ctx context.Context) ([]entity.PasswordUser, error)
- func (r *UserRepository) GetAllSSHUsers(ctx context.Context) ([]entity.SSHUser, error)
- func (r *UserRepository) GetAllUsers(ctx context.Context) ([]entity.User, error)
- func (r *UserRepository) GetMatrixUser(ctx context.Context, matrixUserUUID *uuid.UUID) (*entity.MatrixUser, error)
- func (r *UserRepository) GetMatrixUserByUsername(ctx context.Context, username string) (*entity.MatrixUser, error)
- func (r *UserRepository) GetPasswordUser(ctx context.Context, passwordUserUUID *uuid.UUID) (*entity.PasswordUser, error)
- func (r *UserRepository) GetSSHUser(ctx context.Context, sshUserUUID *uuid.UUID) (*entity.SSHUser, error)
- func (r *UserRepository) GetSSHUserByPublicKey(ctx context.Context, publicKey string) (*entity.SSHUser, error)
- func (r *UserRepository) GetUser(ctx context.Context, userUUID *uuid.UUID) (*entity.User, error)
- func (r *UserRepository) GetUserByName(ctx context.Context, name string) (*entity.User, error)
- func (r *UserRepository) RegisterMatrixUser(ctx context.Context, username string) (*entity.User, error)
- func (r *UserRepository) SetPublicKey(ctx context.Context, userUUID *uuid.UUID, publicKey string) error
- func (r *UserRepository) UpdateMatrixUser(ctx context.Context, matrixUserUUID *uuid.UUID, matrixUser *entity.MatrixUser) (*entity.MatrixUser, error)
- func (r *UserRepository) UpdatePasswordUser(ctx context.Context, passwordUserUUID *uuid.UUID, ...) (*entity.PasswordUser, error)
- func (r *UserRepository) UpdateSSHUser(ctx context.Context, sshUserUUID *uuid.UUID, sshUser *entity.SSHUser) (*entity.SSHUser, error)
- func (r *UserRepository) UpdateUser(ctx context.Context, userUUID *uuid.UUID, user *entity.User) (*entity.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCannotGetAllMenus = errors.New("could not get all menus from db") ErrGettingMenu = errors.New("failed to get menu") ErrMenuNotFound = errors.New("menu not found") ErrGettingMenuItem = errors.New("failed to get menu item") ErrMenuItemNotFound = errors.New("menu item not found") ErrCreatingMenu = errors.New("could not create menu") ErrUpdatingMenu = errors.New("could not update menu") ErrCreatingMenuItem = errors.New("could not create menu item") ErrDeletingMenuItem = errors.New("could not delete menu item") ErrDeletingMenu = errors.New("could not delete menu") )
View Source
var ( ErrCannotGetAllOrder = errors.New("could not get all orders from db") ErrOrderNotFound = errors.New("order not found") ErrGettingOrder = errors.New("could not get order from db") ErrCannotGetAllOrders = errors.New("could not get all orders from db") ErrCannotGetAllOrderItems = errors.New("could not get all order items from db") ErrGettingOrderItemsOrderAndUser = errors.New("could not get order items for order and user") ErrGettingOrderItem = errors.New("error getting order item") ErrOrderItemNotFound = errors.New("order item not found") ErrCreatingOrderItem = errors.New("could not create order item") ErrOrderNotOpen = errors.New("order is not in state open") ErrCreatingOrder = errors.New("could not create order") ErrActiveOrderForMenuAlreadyExists = errors.New("there is already an active order the specified menu") ErrUpdatingOrder = errors.New("could not update order") ErrOrderStateTransitionInvalid = errors.New("invalid order state transition") ErrUpdatingOrderItem = errors.New("could not update order item") ErrOrderUUIDChangeForbidden = errors.New("changing order uuid is forbidden") ErrDeletingOrderItem = errors.New("could not delete order item") ErrPaidChangeForbidden = errors.New("paid status can only be changed by sugar person") ErrMenuItemUUIDMissing = errors.New("menu item uuid missing") ErrMenuItemUUIDChangeForbidden = errors.New("changing menu item uuid is forbidden") ErrUserChangeForbidden = errors.New("changing user is forbidden") ErrSugarPersonNotSet = errors.New("the sugar person has not been set") )
View Source
var ( ErrUserAlreadyExists = errors.New("user already exists") ErrCannotGetAllUsers = errors.New("could not get all users from db") ErrGettingUser = errors.New("failed to get user") ErrUserNotFound = errors.New("user not found") ErrCreatingUser = errors.New("could not create user") ErrUpdatingUser = errors.New("could not update users") ErrDeletingUser = errors.New("could not delete user") ErrSettingPublicKey = errors.New("setting public key for user") )
Functions ¶
This section is empty.
Types ¶
type MenuRepository ¶
func (*MenuRepository) CreateMenu ¶
func (*MenuRepository) CreateMenuItem ¶
func (*MenuRepository) DeleteMenu ¶
func (*MenuRepository) DeleteMenuItem ¶
func (*MenuRepository) GetAllMenus ¶
func (*MenuRepository) GetMenuByName ¶
func (*MenuRepository) GetMenuItem ¶
func (*MenuRepository) GetMenuItemByShortName ¶
type OrderRepository ¶
type OrderRepository struct {
DB *gorm.DB
MenuRepository MenuRepository
}
func (*OrderRepository) CreateOrder ¶
func (*OrderRepository) CreateOrderItem ¶
func (*OrderRepository) DeleteOrder ¶
func (*OrderRepository) DeleteOrderItem ¶
func (*OrderRepository) GetActiveOrderByMenu ¶
func (*OrderRepository) GetActiveOrderByMenuName ¶
func (*OrderRepository) GetAllOrderItems ¶
func (*OrderRepository) GetAllOrderItemsForOrderAndUser ¶
func (*OrderRepository) GetAllOrders ¶
func (*OrderRepository) GetOrderItem ¶
func (*OrderRepository) UpdateOrder ¶
type UserRepository ¶
func (*UserRepository) CreateMatrixUser ¶
func (r *UserRepository) CreateMatrixUser(ctx context.Context, matrixUser *entity.MatrixUser) (*entity.MatrixUser, error)
func (*UserRepository) CreatePasswordUser ¶
func (r *UserRepository) CreatePasswordUser(ctx context.Context, passwordUser *entity.PasswordUser) (*entity.PasswordUser, error)
func (*UserRepository) CreateSSHUser ¶
func (*UserRepository) CreateUser ¶
func (*UserRepository) DeleteMatrixUser ¶
func (*UserRepository) DeletePasswordUser ¶
func (*UserRepository) DeleteSSHUser ¶
func (*UserRepository) DeleteUser ¶
func (*UserRepository) FindPasswordUser ¶
func (r *UserRepository) FindPasswordUser(ctx context.Context, username string) (*entity.PasswordUser, error)
func (*UserRepository) GetAllMatrixUsers ¶
func (r *UserRepository) GetAllMatrixUsers(ctx context.Context) ([]entity.MatrixUser, error)
func (*UserRepository) GetAllPasswordUsers ¶
func (r *UserRepository) GetAllPasswordUsers(ctx context.Context) ([]entity.PasswordUser, error)
func (*UserRepository) GetAllSSHUsers ¶
func (*UserRepository) GetAllUsers ¶
func (*UserRepository) GetMatrixUser ¶
func (r *UserRepository) GetMatrixUser(ctx context.Context, matrixUserUUID *uuid.UUID) (*entity.MatrixUser, error)
func (*UserRepository) GetMatrixUserByUsername ¶
func (r *UserRepository) GetMatrixUserByUsername(ctx context.Context, username string) (*entity.MatrixUser, error)
func (*UserRepository) GetPasswordUser ¶
func (r *UserRepository) GetPasswordUser(ctx context.Context, passwordUserUUID *uuid.UUID) (*entity.PasswordUser, error)
func (*UserRepository) GetSSHUser ¶
func (*UserRepository) GetSSHUserByPublicKey ¶
func (*UserRepository) GetUserByName ¶
func (*UserRepository) RegisterMatrixUser ¶
func (*UserRepository) SetPublicKey ¶
func (*UserRepository) UpdateMatrixUser ¶
func (r *UserRepository) UpdateMatrixUser( ctx context.Context, matrixUserUUID *uuid.UUID, matrixUser *entity.MatrixUser, ) (*entity.MatrixUser, error)
func (*UserRepository) UpdatePasswordUser ¶
func (r *UserRepository) UpdatePasswordUser( ctx context.Context, passwordUserUUID *uuid.UUID, passwordUser *entity.PasswordUser, ) (*entity.PasswordUser, error)
func (*UserRepository) UpdateSSHUser ¶
Click to show internal directories.
Click to hide internal directories.