location

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildingRepoCommand

type BuildingRepoCommand interface {
	CreateBuilding(
		ctx context.Context,
		name,
		owner_id string,
	) error

	CreateMemberBuilding(
		ctx context.Context,
		memberName,
		userID,
		buildingId string,
	) error

	EditMemberBuilding(
		ctx context.Context,
		memberID,
		buildingID string,
	) error

	DeleteBuilding(
		ctx context.Context,
		buildingId,
		memberId string,
	) error
}

type BuildingRepoQuery

type BuildingRepoQuery interface {
	GetBuildingByID(
		ctx context.Context,
		buildingID string,
	) (ent.BuildingQuery, error)

	GetAllBuildings(
		ctx context.Context,
	) ([]ent.BuildingQuery, error)

	GetMemberBuildingExist(
		ctx context.Context,
		userID,
		buildingID string,
	) (bool, error)

	GetInvitationByUserID(
		ctx context.Context,
		userID string,
	) ([]ent.BuildingMemberQuery, error)

	GetListMyOwnedBuilding(
		ctx context.Context,
		userID string,
	) ([]ent.BuildingQuery, error)

	GetListBuildingByUserID(
		ctx context.Context,
		userID string,
	) ([]ent.BuildingMemberQuery, error)

	GetListMemberByBuildingID(
		ctx context.Context,
		buildingID string,
	) ([]ent.MemberQuery, error)

	GetNumberOfBuildingOwned(
		ctx context.Context,
		ownerID string,
	) (int64, error)
}

type BuildingRepository

type BuildingRepository interface {
	BuildingRepoCommand
	BuildingRepoQuery
}

type FriendRepository

type FriendRepository interface {
	GetFriendsByUserId(
		ctx context.Context,
		userId string,
	) ([]ent.MemberQuery, error)
	CreateFriend(
		ctx context.Context,
		member1Id,
		member2Id string,
	) error
}

type MemberRepository

type MemberRepository interface {
	MemberRepositoryCommand
	MemberRepositoryQuery
}

type MemberRepositoryCommand

type MemberRepositoryCommand interface {
	EditMemberName(
		ctx context.Context,
		memberID,
		memberName string,
	) error
}

type MemberRepositoryQuery

type MemberRepositoryQuery interface {
	GetMemberByName(
		ctx context.Context,
		memberName string,
	) (ent.MemberQuery, error)

	GetMemberByID(
		ctx context.Context,
		memberID string,
	) (ent.MemberQuery, error)
}

type MySQLLocationRepository

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

func NewMySQLLocationRepository

func NewMySQLLocationRepository(
	sqlRepo *database.SqlRepository,
) *MySQLLocationRepository

func (*MySQLLocationRepository) CreateMemberBuilding

func (r *MySQLLocationRepository) CreateMemberBuilding(
	ctx context.Context,
	memberId,
	buildingId string,
) error

func (*MySQLLocationRepository) DeleteBuilding

func (r *MySQLLocationRepository) DeleteBuilding(
	ctx context.Context,
	memberId,
	buildingId string,
) error

func (*MySQLLocationRepository) GetAllBuildings

func (r *MySQLLocationRepository) GetAllBuildings(
	ctx context.Context,
) ([]ent.BuildingQuery, error)

func (*MySQLLocationRepository) GetBuildingsByMemberId

func (r *MySQLLocationRepository) GetBuildingsByMemberId(
	ctx context.Context,
	memberId string,
) ([]ent.BuildingQuery, error)

func (*MySQLLocationRepository) GetMembersByRoomId

func (r *MySQLLocationRepository) GetMembersByRoomId(
	ctx context.Context,
	roomId string,
) ([]ent.Member, error)

func (*MySQLLocationRepository) GetRoomsByBuildingId

func (r *MySQLLocationRepository) GetRoomsByBuildingId(
	ctx context.Context,
	buildingId string,
) ([]ent.RoomQuery, error)

func (*MySQLLocationRepository) GetRoomsByMemberId

func (r *MySQLLocationRepository) GetRoomsByMemberId(
	ctx context.Context,
	memberId string,
) ([]ent.RoomQuery, error)

type PostgresLocationRepository

type PostgresLocationRepository struct {
	Postgres *locationpostgres.Queries
	// contains filtered or unexported fields
}

func NewPostgresLocationRepository

func NewPostgresLocationRepository(postgresRepo *database.SqlRepository) *PostgresLocationRepository

func (*PostgresLocationRepository) CreateBuilding

func (r *PostgresLocationRepository) CreateBuilding(
	ctx context.Context,
	name,
	ownerID string,
) error

func (*PostgresLocationRepository) CreateFriend

func (r *PostgresLocationRepository) CreateFriend(
	ctx context.Context,
	member1Id,
	member2Id string,
) error

func (*PostgresLocationRepository) CreateMemberBuilding

func (r *PostgresLocationRepository) CreateMemberBuilding(
	ctx context.Context,
	memberName,
	userID,
	buildingId string,
) error

func (*PostgresLocationRepository) DeleteBuilding

func (r *PostgresLocationRepository) DeleteBuilding(
	ctx context.Context,
	memberId,
	buildingId string,
) error

func (*PostgresLocationRepository) EditMemberBuilding

func (r *PostgresLocationRepository) EditMemberBuilding(
	ctx context.Context,
	memberID,
	buildingID string,
) error

func (*PostgresLocationRepository) EditMemberName

func (r *PostgresLocationRepository) EditMemberName(
	ctx context.Context,
	memberID string,
	memberName string,
) error

func (*PostgresLocationRepository) GetAllBuildings

func (r *PostgresLocationRepository) GetAllBuildings(
	ctx context.Context,
) ([]ent.BuildingQuery, error)

func (*PostgresLocationRepository) GetBuildingByID

func (r *PostgresLocationRepository) GetBuildingByID(
	ctx context.Context,
	buildingID string,
) (ent.BuildingQuery, error)

func (*PostgresLocationRepository) GetFriendsByUserId

func (r *PostgresLocationRepository) GetFriendsByUserId(
	ctx context.Context,
	userId string,
) ([]ent.MemberQuery, error)

func (*PostgresLocationRepository) GetInvitationByUserID

func (r *PostgresLocationRepository) GetInvitationByUserID(
	ctx context.Context,
	userID string,
) ([]ent.BuildingMemberQuery, error)

func (*PostgresLocationRepository) GetListBuildingByUserID

func (r *PostgresLocationRepository) GetListBuildingByUserID(
	ctx context.Context,
	userID string,
) ([]ent.BuildingMemberQuery, error)

func (*PostgresLocationRepository) GetListMemberByBuildingID

func (r *PostgresLocationRepository) GetListMemberByBuildingID(
	ctx context.Context,
	buildingID string,
) ([]ent.MemberQuery, error)

func (*PostgresLocationRepository) GetListMyOwnedBuilding

func (r *PostgresLocationRepository) GetListMyOwnedBuilding(
	ctx context.Context,
	userID string,
) ([]ent.BuildingQuery, error)

func (*PostgresLocationRepository) GetMemberBuildingExist

func (r *PostgresLocationRepository) GetMemberBuildingExist(
	ctx context.Context,
	userID,
	buildingID string,
) (bool, error)

func (*PostgresLocationRepository) GetMemberByID

func (r *PostgresLocationRepository) GetMemberByID(
	ctx context.Context,
	memberID string,
) (ent.MemberQuery, error)

func (*PostgresLocationRepository) GetMemberByName

func (r *PostgresLocationRepository) GetMemberByName(
	ctx context.Context,
	memberName string,
) (ent.MemberQuery, error)

func (*PostgresLocationRepository) GetMembersByRoomId

func (r *PostgresLocationRepository) GetMembersByRoomId(
	ctx context.Context,
	roomId string,
) ([]ent.Member, error)

func (*PostgresLocationRepository) GetNumberOfBuildingOwned

func (r *PostgresLocationRepository) GetNumberOfBuildingOwned(
	ctx context.Context,
	ownerID string,
) (int64, error)

func (*PostgresLocationRepository) GetRoomsByBuildingId

func (r *PostgresLocationRepository) GetRoomsByBuildingId(
	ctx context.Context,
	buildingId string,
) ([]ent.RoomQuery, error)

func (*PostgresLocationRepository) GetRoomsByMemberId

func (r *PostgresLocationRepository) GetRoomsByMemberId(
	ctx context.Context,
	memberId string,
) ([]ent.RoomQuery, error)

type RoomRepository

type RoomRepository interface {
	GetMembersByRoomId(
		ctx context.Context,
		roomId string,
	) ([]ent.Member, error)
	GetRoomsByMemberId(
		ctx context.Context,
		memberId string,
	) ([]ent.RoomQuery, error)
	GetRoomsByBuildingId(
		ctx context.Context,
		buildingId string,
	) ([]ent.RoomQuery, error)
}

Jump to

Keyboard shortcuts

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