db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package db implements a service for interacting with the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is a service that interacts with the database.

func (*Service) ChangePassword

func (s *Service) ChangePassword(username, salt, hash string) (err error)

ChangePassword changes the password for a given username.

func (*Service) Close

func (s *Service) Close() (err error)

Close closes the database connection.

func (*Service) Connect

func (s *Service) Connect(dbName string, mode os.FileMode, options *bolt.Options) (err error)

Connect connects to the database.

func (*Service) DeleteUser

func (s *Service) DeleteUser(username string) (err error)

DeleteUser deletes an existing user from the database by username.

func (*Service) GetEmail

func (s *Service) GetEmail(username string) (email string, err error)

GetEmail gets the email address for a given username.

func (*Service) GetSaltAndHash

func (s *Service) GetSaltAndHash(username string) (salt, hash string, err error)

GetSaltAndHash gets the salt and hash for a given username.

func (*Service) InsertUser

func (s *Service) InsertUser(username, salt, hash, email string) (err error)

InsertUser inserts a new user into the database.

func (*Service) SetLogger

func (s *Service) SetLogger(logger *log.Logger)

SetLogger sets the logger.

Jump to

Keyboard shortcuts

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