app

package
v0.0.0-...-2be0f72 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound Item not found
	ErrNotFound = errors.New("not found")

	// ErrInvalid Invalid request
	ErrInvalid = errors.New("invalid")

	// ErrExists Item already exists
	ErrExists = errors.New("exists")

	// ErrNoAccess Access to item not allowed
	ErrNoAccess = errors.New("no access")

	// ErrInternal Internal fatal error
	ErrInternal = errors.New("internal error")
)

Functions

func Is

func Is(err error, what error) bool

Is returns true if the particular error code in an Error is equal to the expected error. This is useful comparing without having to cast and unpack.

Types

type Error

type Error struct {
	Err     error  // Error code
	Message string // Message related to error
}

Error holds the error code and additional messages.

func Errorf

func Errorf(err error, message string, args ...interface{}) *Error

Errorf takes and error, a message string and a set of arguments and produces a new Error.

func (*Error) Error

func (e *Error) Error() string

Implement error interface.

type UserDBService

type UserDBService interface {
	GetByEmail(email string) (schema.User, error)
	GetAll() ([]schema.User, error)
	Insert(email, fullname string) (schema.User, error)
	Update(email, fullname string) (schema.User, error)
}

The UserDBService provides a way for tracking and storing users. It provides no persistence guarantees, though specific implementations might provide persistence.

type UsersService

type UsersService interface {
	CreateUser(email, fullname string) (schema.User, error)
	GetAll() ([]schema.User, error)
	GetUserByEmail(email string) (schema.User, error)
	UpdateUserByEmail(email, fullname string) (schema.User, error)
}

Objects implements the UsersService provide an technology independent way of managing the applications users.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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