...

Package cache

import "github.com/gonitro/nitro/util/registry/cache"
Overview
Index

Overview ▾

Package cache provides a registry cache

type Cache

Cache is the registry cache interface

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

func New

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

New returns a new cache

type Option

type Option func(o *Options)

func WithTTL

func WithTTL(t time.Duration) Option

WithTTL sets the cache TTL

type Options

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