user

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound means the user name was not found in the repo
	ErrUserNotFound = errors.New("user not found")

	// ErrUserExists is returned if a create is called on an existing user
	ErrUserExists = errors.New("user with that name exists")
)

Functions

This section is empty.

Types

type Repository

type Repository interface {
	GetAllUsers() ([]*model.User, error)
	GetUser(name string) (*model.User, error)
	SaveUser(u *model.User) error
	DeleteUser(name string) error
	DeleteAllUsers() error
}

Repository provides an interface for how to store and retrieve User objects from a persistence engine.

type Service

type Service interface {
	GetAllUsers() ([]*model.User, error)
	GetUser(name string) (*model.User, error)
	SaveUser(u *model.User) error
	DeleteUser(name string) error
	DeleteAllUsers() error
}

Service provides an interface for all business operations on the User model.

Jump to

Keyboard shortcuts

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