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


Package Files

cache.go options.go


var (
    DefaultTTL = time.Minute

type Cache Uses

type Cache interface {
    // embed the registry interface
    // stop the cache watcher

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 8 packages (graph) and is imported by 18 packages. Updated 2021-01-22. Refresh now. Tools for package owners.