backend.go 473 B

1234567891011121314151617
  1. package backend
  2. import (
  3. "context"
  4. "github.com/kellegous/go/internal"
  5. )
  6. type Backend interface {
  7. Close() error
  8. Get(ctx context.Context, id string) (*internal.Route, error)
  9. Put(ctx context.Context, key string, route *internal.Route) error
  10. Del(ctx context.Context, id string) error
  11. GetAll(ctx context.Context) (map[string]internal.Route, error)
  12. List(ctx context.Context, start string) (internal.RouteIterator, error)
  13. NextID(ctx context.Context) (uint64, error)
  14. }