test

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitUserCache

func InitUserCache(cache *cache.Cache, db UserDatabase, keyFunc UserKeyObjectFunc)

func RemoveUser

func RemoveUser(key *UserKeyer) error

Types

type User

type User struct {
	Id   int64
	Name string
}

func GetUser

func GetUser(key *UserKeyer) (*User, error)

func UpdateUser

func UpdateUser(key *UserKeyer, oper *User) (*User, error)

type UserDatabase

type UserDatabase interface {
	OnFetch(key *UserKeyer) (*User, error)
	OnUpdate(key *UserKeyer, oper *User) (*User, error)
	OnRemove(key *UserKeyer) error
}

type UserKeyObjectFunc

type UserKeyObjectFunc func(*UserKeyer) interface{}

type UserKeyer

type UserKeyer struct {
	Id int64
}

func (*UserKeyer) String

func (k *UserKeyer) String() string

func (*UserKeyer) Value

func (k *UserKeyer) Value() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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