users

package
v0.0.0-...-46021d3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	Conn *sql.DB
}

Repository struct for db connection

func (*Repository) GetUser

func (repository *Repository) GetUser(username string) (*User, error)

GetUser is for getting a user by username

func (*Repository) SaveUser

func (repository *Repository) SaveUser(user *User) error

SaveUser is for saving a new user

type User

type User struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

User is a user model

Jump to

Keyboard shortcuts

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