users

package
v0.0.0-...-6697815 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type UserRepository

type UserRepository struct {
	Users []User `json:"data"`
	// contains filtered or unexported fields
}

func NewUserRepoistory

func NewUserRepoistory() *UserRepository

func (*UserRepository) DeleteOne

func (u *UserRepository) DeleteOne(id int) error

func (*UserRepository) FindAll

func (u *UserRepository) FindAll() ([]User, error)

func (*UserRepository) FindOne

func (u *UserRepository) FindOne(id int) (*User, error)

func (*UserRepository) Save

func (u *UserRepository) Save(user *User) error

type UserService

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

func NewUserService

func NewUserService(repo *UserRepository) *UserService

func (*UserService) ServeHTTP

func (u *UserService) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UserSet

type UserSet []User

func (UserSet) Len

func (us UserSet) Len() int

Len implements the sort interface, sorting the UserSet by ID

func (UserSet) Less

func (us UserSet) Less(i, j int) bool

Less implements the sort interface, sorting the UserSet by ID

func (UserSet) Swap

func (us UserSet) Swap(i, j int)

Swap implements the sort interface, sorting the UserSet by ID

Jump to

Keyboard shortcuts

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