cache

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheKeyAll = "_all_"

	DefaultExpiration     = 15 * time.Second
	DefaultExitExpiration = time.Hour
	DefaultCapacity       = 10_000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ListFunc

type ListFunc[I comparable, V any] func(ctx context.Context, ids []I) (results []*Result[I, V], err error)

type ProxyService

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

func NewProxyService

func NewProxyService(next batproxy.ProxyService, opts ProxyServiceOptions) *ProxyService

func (*ProxyService) CreateProxy

func (s *ProxyService) CreateProxy(ctx context.Context, proxy *batproxy.Proxy, opts batproxy.CreateProxyOptions) (err error)

func (*ProxyService) DeleteProxy

func (s *ProxyService) DeleteProxy(ctx context.Context, proxyID string) (err error)

func (*ProxyService) ListProxies

func (s *ProxyService) ListProxies(ctx context.Context, opts batproxy.ListProxiesOptions) (page *batproxy.ListProxiesPage, err error)

type ProxyServiceOptions

type ProxyServiceOptions struct {
	ProxyExpiration time.Duration
}

type Result

type Result[I comparable, V any] struct {
	ID       I
	Val      *V
	ExitTime time.Time
}

Jump to

Keyboard shortcuts

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