services

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package services implements the services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteService

type SQLiteService struct {
	DB    *sql.DB
	Mutex *sync.Mutex
}

SQLiteService represents the Service implemented with SQLite.

func NewSQLiteService

func NewSQLiteService() *SQLiteService

NewSQLiteService creates an SQLite service.

func (*SQLiteService) Register

func (s *SQLiteService) Register(userEmail string) error

func (*SQLiteService) Unregister

func (s *SQLiteService) Unregister(userEmail string) error

func (*SQLiteService) Users

func (s *SQLiteService) Users() ([]models.User, error)

type Service

type Service interface {
	// Register registers a new user to the service.
	Register(userEmail string) error

	// Unregister removes the user's access to the service.
	Unregister(userEmail string) error

	// Users fetches all users in the database.
	Users() ([]models.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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