loader

package
v0.0.0-...-f2353e5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserLoaderKey loaderKey = "user"
)

Variables

This section is empty.

Functions

func Load

func Load(tk loaderKey, ctx context.Context, key dataloader.Key) (interface{}, error)

func LoadUserNickName

func LoadUserNickName(ctx context.Context, key dataloader.Key) (string, error)

func NewLoaderCache

func NewLoaderCache(c cache.Cache, duration time.Duration) *loaderCache

func NewUserLoader

func NewUserLoader(opts ...dataloader.Option) *dataloader.Loader

Types

type Collection

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

func NewLoaderCollection

func NewLoaderCollection() Collection

func (Collection) Attach

func (c Collection) Attach(ctx *gin.Context) context.Context

func (Collection) GetLoader

func (c Collection) GetLoader(k loaderKey) *dataloader.Loader

type DataKey

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

func NewDataKey

func NewDataKey(key string, raw interface{}) *DataKey

func (*DataKey) Raw

func (d *DataKey) Raw() interface{}

func (*DataKey) String

func (d *DataKey) String() string

type GlobalType

type GlobalType string

需要对应proto文件中的node type

const (
	User GlobalType = "user"
)

type Loader

type Loader struct {
}

type UserLoader

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

Jump to

Keyboard shortcuts

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