user

package
v0.0.0-...-03efb0c Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockUserRepo

type MockUserRepo struct {
	User *MockUserRepository
}

func NewMockUserRepo

func NewMockUserRepo() *MockUserRepo

func (*MockUserRepo) CreateUser

func (mur *MockUserRepo) CreateUser(
	ctx context.Context,
	params user.UserCommand,
) (string, error)

func (*MockUserRepo) GetListFeatureByProductID

func (mur *MockUserRepo) GetListFeatureByProductID(
	ctx context.Context,
	productID int32,
) ([]user.FeatureQuery, error)

func (*MockUserRepo) GetListProduct

func (mur *MockUserRepo) GetListProduct(
	ctx context.Context,
) ([]user.ProductQuery, error)

func (*MockUserRepo) GetListUserByUsername

func (mur *MockUserRepo) GetListUserByUsername(
	ctx context.Context,
	username string,
) ([]user.UserQuery, error)

func (*MockUserRepo) GetProductByUserID

func (mur *MockUserRepo) GetProductByUserID(
	ctx context.Context,
	userID string,
) (user.ProductQuery, error)

TODO: Implement this

func (*MockUserRepo) GetUser

func (mur *MockUserRepo) GetUser(
	ctx context.Context,
	params string,
) (user.User, error)

func (*MockUserRepo) GetUserExistance

func (mur *MockUserRepo) GetUserExistance(
	ctx context.Context,
	username string,
) (bool, error)

type MockUserRepository

type MockUserRepository struct {
	BiggestId int64
	Users     map[Username]user.User
}

type MySQLUserRepository

type MySQLUserRepository struct {
	Mysql *mysql.Queries
	// contains filtered or unexported fields
}

func NewMySQLUserRepository

func NewMySQLUserRepository(sqlRepo *database.SqlRepository) *MySQLUserRepository

func (*MySQLUserRepository) CreateUser

func (r *MySQLUserRepository) CreateUser(
	ctx context.Context,
	params user.User,
) error

func (*MySQLUserRepository) GetUser

func (r *MySQLUserRepository) GetUser(
	ctx context.Context,
	params string,
) (user.User, error)

func (*MySQLUserRepository) GetUserExistance

func (r *MySQLUserRepository) GetUserExistance(
	ctx context.Context,
	username string,
) (bool, error)

type PostgresUserRepository

type PostgresUserRepository struct {
	Postgres *userpostgres.Queries
	// contains filtered or unexported fields
}

func NewPostgresUserRepository

func NewPostgresUserRepository(sqlRepo *database.SqlRepository) *PostgresUserRepository

func (*PostgresUserRepository) CreateUser

func (r *PostgresUserRepository) CreateUser(
	ctx context.Context,
	params user.UserCommand,
) (string, error)

func (*PostgresUserRepository) GetListFeatureByProductID

func (r *PostgresUserRepository) GetListFeatureByProductID(
	ctx context.Context,
	productID int32,
) ([]user.FeatureQuery, error)

func (*PostgresUserRepository) GetListProduct

func (r *PostgresUserRepository) GetListProduct(
	ctx context.Context,
) ([]user.ProductQuery, error)

func (*PostgresUserRepository) GetListUserByUsername

func (r *PostgresUserRepository) GetListUserByUsername(
	ctx context.Context,
	username string,
) ([]user.UserQuery, error)

func (*PostgresUserRepository) GetProductByUserID

func (r *PostgresUserRepository) GetProductByUserID(
	ctx context.Context,
	userID string,
) (user.ProductQuery, error)

func (*PostgresUserRepository) GetUser

func (r *PostgresUserRepository) GetUser(
	ctx context.Context,
	params string,
) (user.User, error)

func (*PostgresUserRepository) GetUserExistance

func (r *PostgresUserRepository) GetUserExistance(
	ctx context.Context,
	username string,
) (bool, error)

type ProductRepoQuery

type ProductRepoQuery interface {
	GetProductByUserID(
		ctx context.Context,
		userID string,
	) (user.ProductQuery, error)
	GetListProduct(
		ctx context.Context,
	) ([]user.ProductQuery, error)
	GetListFeatureByProductID(
		ctx context.Context,
		productID int32,
	) ([]user.FeatureQuery, error)
}

type UserRepo

type UserRepo interface {
	UserRepository
	ProductRepoQuery
}

type UserRepository

type UserRepository interface {
	GetUser(
		ctx context.Context,
		params string,
	) (user.User, error)
	GetListUserByUsername(
		ctx context.Context,
		username string,
	) ([]user.UserQuery, error)
	GetUserExistance(
		ctx context.Context,
		username string,
	) (bool, error)
	CreateUser(
		ctx context.Context,
		params user.UserCommand,
	) (string, error)
}

type Username

type Username string

Jump to

Keyboard shortcuts

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