go-micro: github.com/micro/go-micro/registry/cache Index | Files

package cache

import "github.com/micro/go-micro/registry/cache"

Package cache provides a registry cache

Index

Package Files

options.go rcache.go

Variables

var (
    DefaultTTL = time.Minute
)

type Cache Uses

type Cache interface {
    // embed the registry interface
    registry.Registry
    // stop the cache watcher
    Stop()
}

Cache is the registry cache interface

func New Uses

func New(r registry.Registry, opts ...Option) Cache

New returns a new cache

type Option Uses

type Option func(o *Options)

func WithTTL Uses

func WithTTL(t time.Duration) Option

WithTTL sets the cache TTL

type Options Uses

type Options struct {
    // TTL is the cache TTL
    TTL time.Duration
}

Package cache imports 6 packages (graph) and is imported by 14 packages. Updated 2019-07-19. Refresh now. Tools for package owners.