persistence

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package persistence holds view models and repository interfaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User interface {
	GetID() string
	GetEmail() string
	GetFacebookID() string
	GetGoogleID() string
	GetRole() access.Role
}

User persistence model interface

type UserRepository

type UserRepository interface {
	FindAll(ctx context.Context, limit, offset int64) ([]User, error)
	Get(ctx context.Context, id string) (User, error)
	GetByEmail(ctx context.Context, email string) (User, error)
	GetByFacebookID(ctx context.Context, facebookID string) (User, error)
	GetByGoogleID(ctx context.Context, googleID string) (User, error)
	Add(ctx context.Context, user User) error
	Delete(ctx context.Context, id string) error
	Count(ctx context.Context) (int64, error)
	UpdateEmail(ctx context.Context, id, email string) error
	UpdateFacebookID(ctx context.Context, id, facebookID string) error
	UpdateGoogleID(ctx context.Context, id, googleID string) error
}

UserRepository allows to get/save user to mysql storage

Directories

Path Synopsis
Package memory holds view model repositories
Package memory holds view model repositories
Package mysql holds view model repositories Package mysql holds view model repositories
Package mysql holds view model repositories Package mysql holds view model repositories

Jump to

Keyboard shortcuts

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