postgres

package
v0.0.0-...-eef0f43 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminRepository

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

func NewAdminRepository

func NewAdminRepository(client *Client) *AdminRepository

func (*AdminRepository) ExistsByNickname

func (r *AdminRepository) ExistsByNickname(ctx context.Context, nickname string) (bool, error)

func (*AdminRepository) FindByNicknameWithUser

func (r *AdminRepository) FindByNicknameWithUser(ctx context.Context, nickname string) (*ent.Admin, error)

func (*AdminRepository) Save

func (r *AdminRepository) Save(ctx context.Context, adm *ent.Admin, userID int) (*ent.Admin, error)

type Client

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

func NewClient

func NewClient(cfg config.PostgresConfig) (*Client, error)

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context) (port.Tx, error)

func (*Client) BeginTxWithOption

func (c *Client) BeginTxWithOption(ctx context.Context, opts *sql.TxOptions) (port.Tx, error)

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

func (*Client) MigrateSchemas

func (c *Client) MigrateSchemas(ctx context.Context) error

func (*Client) WithTx

func (c *Client) WithTx(ctx context.Context, fn func(ctx context.Context) error) error

type MeetingRepository

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

func NewMeetingRepository

func NewMeetingRepository(client *Client) *MeetingRepository

func (*MeetingRepository) AddParticipants

func (r *MeetingRepository) AddParticipants(ctx context.Context, mtgID int, ptcIDs []int) error

func (*MeetingRepository) ExistsByID

func (r *MeetingRepository) ExistsByID(ctx context.Context, mtgID int) (bool, error)

func (*MeetingRepository) FindParticipantsByID

func (r *MeetingRepository) FindParticipantsByID(ctx context.Context, mtgID int) ([]*ent.User, error)

func (*MeetingRepository) FindParticipantsByIDAndParticipantIDs

func (r *MeetingRepository) FindParticipantsByIDAndParticipantIDs(
	ctx context.Context,
	mtgID int,
	ptcIDs []int,
) ([]*ent.User, error)

func (*MeetingRepository) RemoveParticipants

func (r *MeetingRepository) RemoveParticipants(ctx context.Context, mtgID int, ptcIDs []int) error

func (*MeetingRepository) Save

func (r *MeetingRepository) Save(ctx context.Context, mtg *ent.Meeting, orgID int) (*ent.Meeting, error)

type UserRepository

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

func NewUserRepository

func NewUserRepository(client *Client) *UserRepository

func (*UserRepository) ExistsByNickname

func (r *UserRepository) ExistsByNickname(ctx context.Context, nickname string) (bool, error)

func (*UserRepository) FindByNickname

func (r *UserRepository) FindByNickname(ctx context.Context, nickname string) (*ent.User, error)

func (*UserRepository) FindByNicknameIn

func (r *UserRepository) FindByNicknameIn(ctx context.Context, nicknames []string) ([]*ent.User, error)

func (*UserRepository) Save

func (r *UserRepository) Save(ctx context.Context, u *ent.User) (*ent.User, error)

Jump to

Keyboard shortcuts

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