db

package
v0.0.0-...-8de2e18 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DBNAME = "hotel-reservation"

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoUserStore

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

func NewMongoUserStore

func NewMongoUserStore(client *mongo.Client) *MongoUserStore

func (*MongoUserStore) GetUserByID

func (s *MongoUserStore) GetUserByID(ctx context.Context, id string) (*types.User, error)

func (*MongoUserStore) GetUsers

func (s *MongoUserStore) GetUsers(ctx context.Context) ([]*types.User, error)

func (*MongoUserStore) InsertUser

func (s *MongoUserStore) InsertUser(ctx context.Context, user *types.User) (*types.User, error)

type UserStore

type UserStore interface {
	GetUserByID(context.Context, string) (*types.User, error)
	GetUsers(context.Context) ([]*types.User, error)
	InsertUser(context.Context, *types.User) (*types.User, error)
}

Jump to

Keyboard shortcuts

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