Documentation
¶
Index ¶
- type Car
- type CreateCar
- type CreateUser
- type DbConfig
- type Repository
- func (r *Repository) Close() error
- func (r *Repository) CreateCar(ctx context.Context, car *CreateCar) (*Car, error)
- func (r *Repository) CreateUser(ctx context.Context, u *CreateUser) (*User, error)
- func (r *Repository) DeleteCar(ctx context.Context, id int) error
- func (r *Repository) DeleteUser(ctx context.Context, id int) error
- func (r *Repository) GetCar(ctx context.Context, id int) (*Car, error)
- func (r *Repository) GetCars(ctx context.Context) ([]*Car, error)
- func (r *Repository) GetUser(ctx context.Context, id int) (*User, error)
- func (r *Repository) GetUserAndCars(ctx context.Context, userID int) (*UserAndCars, error)
- func (r *Repository) GetUserCars(ctx context.Context, userID int) ([]*Car, error)
- func (r *Repository) GetUsers(ctx context.Context) ([]*User, error)
- func (r *Repository) Migrate(c context.Context) error
- func (r *Repository) UnlinkUserCars(ctx context.Context, userID int, cars []*Car) ([]*Car, error)
- func (r *Repository) UpdateCar(ctx context.Context, id int, car *CreateCar) (*Car, error)
- func (r *Repository) UpdateUser(ctx context.Context, id int, u *UpdateUser) (*User, error)
- func (r *Repository) UpdateUserCars(ctx context.Context, userID int, cars []*Car) ([]*Car, error)
- type UpdateUser
- type User
- type UserAndCars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUser ¶
type DbConfig ¶
func ConfigFromEnv ¶
func ConfigFromEnv() *DbConfig
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func Connect ¶
func Connect(c *DbConfig) (*Repository, error)
func New ¶
func New(client *ent.Client) *Repository
func (*Repository) Close ¶
func (r *Repository) Close() error
func (*Repository) CreateUser ¶
func (r *Repository) CreateUser(ctx context.Context, u *CreateUser) (*User, error)
func (*Repository) DeleteUser ¶
func (r *Repository) DeleteUser(ctx context.Context, id int) error
func (*Repository) GetUserAndCars ¶
func (r *Repository) GetUserAndCars(ctx context.Context, userID int) (*UserAndCars, error)
func (*Repository) GetUserCars ¶
func (*Repository) UnlinkUserCars ¶
func (*Repository) UpdateUser ¶
func (r *Repository) UpdateUser(ctx context.Context, id int, u *UpdateUser) (*User, error)
func (*Repository) UpdateUserCars ¶
type UpdateUser ¶
type UpdateUser = CreateUser
type UserAndCars ¶
Click to show internal directories.
Click to hide internal directories.