crew

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuperPermission = errors.New("user doesn't have super-user permission")
	ErrNoAdminPermission = errors.New("user doesn't have admin permission")
	ErrNoRolePermission  = errors.New("user doesn't have role permission")
)

Functions

func NewStore

func NewStore(db *sqlx.DB) clapper.CrewRepo

NewStore creates our data store

Types

type Store

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

Store encapsulates our dependency

func (*Store) Delete

func (m *Store) Delete(ctx context.Context, crewID int) error

Delete will completely remove the crew position

func (*Store) DeleteUser

func (m *Store) DeleteUser(ctx context.Context, crewID int) error

DeleteUser clears the user ID from the crew ID object

func (*Store) Get

func (m *Store) Get(ctx context.Context, crewID int) (*clapper.CrewPosition, error)

Get returns a crew position object

func (*Store) New

func (m *Store) New(ctx context.Context, signupID, positionID int) error

New creates a new crew position, with default settings

func (*Store) UpdateUser

func (m *Store) UpdateUser(ctx context.Context, crewID, userID int) error

UpdateUser Updates the user field for the specified crew ID to the specified user ID

func (*Store) UpdateUserAndVerify

func (m *Store) UpdateUserAndVerify(ctx context.Context, crewID, userID int) error

UpdateUserAndVerify will update a crew object to the specified user ID, it will also perform additional checks to ensure they have enough permission

Jump to

Keyboard shortcuts

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