user

package
v0.0.0-...-bf66428 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidError

type InvalidError struct {
	// contains filtered or unexported fields
}

func (InvalidError) Error

func (e InvalidError) Error() string

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService() *Service

func (*Service) CreateUser

func (svc *Service) CreateUser(user *User) (*User, error)

func (*Service) DeleteUser

func (svc *Service) DeleteUser(id int64) error

func (*Service) GetUser

func (svc *Service) GetUser(id int64) (*User, error)

func (*Service) ListUsers

func (svc *Service) ListUsers() []User

func (*Service) UpdateUser

func (svc *Service) UpdateUser(id int64, user *User) (*User, error)

type Servicer

type Servicer interface {
	ListUsers() []User
	GetUser(id int64) (*User, error)
	CreateUser(usr *User) (*User, error)
	UpdateUser(id int64, usr *User) (*User, error)
	DeleteUser(id int64) error
}

type User

type User struct {
	ID    int64
	Name  string
	Email string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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