gengouser

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

Overview

Code generated by gotoc_cache. DO NOT EDIT. gotoc version: 0.0.3 source: samples/cache/user.cache.gtc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitUserCache

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

func RemoveUser

func RemoveUser(key *UserKey) error

Types

type User

type User struct {
	//
	Id int64 `json:"id"`
	//
	Name string `json:"name"`
	//
	Phone string `json:"phone"`
	//
	Email string `json:"email"`
}

User

func GetUser

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

func UpdateUser

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

type UserDatabase

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

type UserKey

type UserKey struct {
	//
	Id int64 `json:"id"`
	//
	Name string `json:"name"`
	//
	Email string `json:"email"`
}

UserKey

func (*UserKey) String

func (k *UserKey) String() string

func (*UserKey) Value

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

type UserKeyValueFunc

type UserKeyValueFunc func(*UserKey) interface{}

Jump to

Keyboard shortcuts

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