joist/interfaces.go
2025-09-06 17:56:59 -04:00

23 lines
568 B
Go

package joist
import (
"context"
"time"
)
type Storer interface {
Close() error
Delete(ctx context.Context, key string) error
Get(ctx context.Context, key string) ([]byte, error)
GetForPrefix(ctx context.Context, prefix string) (map[string][]byte, error)
Put(ctx context.Context, key string, val []byte, ttl time.Duration) error
}
type RouteCacher interface {
Add(name string, path string) error
AddRouteInfo(routeInfo RouteInfo) error
GetPath(name string) (string, error)
GetRouteInfo(name string) (RouteInfo, error)
All() (map[string]string, error)
}