engine

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username"`
	Email    string `json:"email" valid:"email"`
}

type Engine

type Engine interface {
	GetUser(id string) (*domain.User, error)
	CreateUser(r *CreateUserRequest) (*domain.User, error)
	DeleteUser(id string) error
	ListUsers() []*domain.User
}

type ExampleProviderFactory

type ExampleProviderFactory interface {
	NewUserRepository() UserRepository
}

type Factory

type Factory interface {
	NewEngine() Engine
}

func NewFactory

func NewFactory(e ExampleProviderFactory) Factory

type Invalid

type Invalid struct {
	Obj     interface{}
	Errors  *kensho.ValidationError
	Message string
}

func NewInvalid

func NewInvalid(obj interface{}, errors *kensho.ValidationError) *Invalid

func (*Invalid) Error

func (err *Invalid) Error() string

type NotFound

type NotFound struct {
	ID       string
	TypeName string
}

func NewNotFound

func NewNotFound(id string, typeName string) *NotFound

func (*NotFound) Error

func (err *NotFound) Error() string

type UserRepository

type UserRepository interface {
	Get(id string) *domain.User
	Create(user *domain.User)
	Delete(*domain.User)
	List() []*domain.User
}

Jump to

Keyboard shortcuts

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