db

package
v0.0.0-...-23016c8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabaseService

func NewDatabaseService(db *sql.DB) *dbService

NewDatabaseService initialises a DatabaseService given its dependencies.

Types

type DatabaseService

type DatabaseService interface {
	AddUser(username, pwd string) error
	GetUser(username string) (*User, error)
	AddNote(id, username, text string) error
	GetUserNotes(username string) ([]Note, error)
}

type Note

type Note struct {
	ID, Username, Text string
}

type User

type User struct {
	Username, Pwd string
}

Jump to

Keyboard shortcuts

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