proxy

package
v0.0.0-...-6e5d4c6 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 1 Imported by: 0

README

Proxy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID int32
}

type UserFinder

type UserFinder interface {
	FindUser(id string) (User, error)
}

type UserList

type UserList []User

func (*UserList) FindUser

func (t *UserList) FindUser(id int32) (User, error)

FindUser will iterate over the list to try to find a user with the same name that the param or return an error if it can't find it

type UserListProxy

type UserListProxy struct {
	MockedDatabase      *UserList
	StackCache          UserList
	StackSize           int
	LastSearchUsedCache bool
}

func (*UserListProxy) FindUser

func (u *UserListProxy) FindUser(id int32) (User, error)

FindUser will search for the specified name in the parameter in the cache list. If it finds it, it will return it. If not, it will search in the heavy list. Finally, if it's not in the heavy list, it will return an error (generated from the heavy list)

Jump to

Keyboard shortcuts

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