Documentation ¶
Overview ¶
Package json implements a data store using a single JSON file and the memory package.
Index ¶
- type Database
- func (db *Database) CreateUser(ctx context.Context, user models.User) (err error)
- func (db *Database) GetUserByID(ctx context.Context, id uint64) (user models.User, err error)
- func (db *Database) Start(ctx context.Context) (runError <-chan error, err error)
- func (db *Database) Stop() (err error)
- func (db *Database) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is the JSON file implementation of the database store.
func NewDatabase ¶
NewDatabase creates a JSON Database object with the memory database and filepath given. Its `Start` method will either initialize the JSON database file or load existing data from an existing JSON file into the memory database.
func (*Database) CreateUser ¶
func (*Database) GetUserByID ¶
Click to show internal directories.
Click to hide internal directories.