user

package
v0.0.0-...-f14b2f1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const USER_COLLECTION = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUserByIdParams

type GetUserByIdParams struct {
	ID string `json:"id"`
}

type MongoUserRepository

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

func NewUserRepository

func NewUserRepository() (*MongoUserRepository, error)

func (*MongoUserRepository) Create

func (u *MongoUserRepository) Create(user *User) error

func (*MongoUserRepository) FindAll

func (u *MongoUserRepository) FindAll() ([]*User, error)

func (*MongoUserRepository) FindById

func (u *MongoUserRepository) FindById() (*User, error)

func (*MongoUserRepository) FindByUserName

func (u *MongoUserRepository) FindByUserName(username string) (*User, error)

type User

type User struct {
	ID        primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Username  string             `json:"username" bson:"username"`
	Password  string             `json:"password" bson:"password"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time          `json:"updatedAt" bson:"updated"`
}

type UserRepository

type UserRepository interface {
	FindAll() ([]*User, error)
	Create(*User) (*User, error)
}

Jump to

Keyboard shortcuts

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