Documentation ¶
Index ¶
- Constants
- func NewHandler(store Store, ks *token.VerificationKeyset) http.Handler
- type MemStore
- func (s *MemStore) Delete(ctx context.Context, k string) error
- func (s *MemStore) Get(ctx context.Context, k string) (*pb.LinkEntry, error)
- func (s *MemStore) Put(ctx context.Context, k string, l *pb.Link) (bool, error)
- func (s *MemStore) Visit(ctx context.Context, visit func(string, *pb.LinkEntry)) error
- type PostgresStore
- func (s *PostgresStore) Close()
- func (s *PostgresStore) Delete(ctx context.Context, key string) error
- func (s *PostgresStore) Get(ctx context.Context, key string) (*pb.LinkEntry, error)
- func (s *PostgresStore) Put(ctx context.Context, key string, l *pb.Link) (bool, error)
- func (s *PostgresStore) Visit(ctx context.Context, visit func(string, *pb.LinkEntry)) error
- type Store
Constants ¶
View Source
const Index = ".index"
Index is used for special handling for the root path; it is stored in the database as the "index" key.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(store Store, ks *token.VerificationKeyset) http.Handler
NewHandler sets up routes based on the given key value store.
Types ¶
type MemStore ¶
MemStore is an in-memory store of links.
func NewMemStore ¶
func NewMemStore() *MemStore
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresStore(ctx context.Context, source string) (*PostgresStore, error)
func (*PostgresStore) Close ¶
func (s *PostgresStore) Close()
func (*PostgresStore) Delete ¶
func (s *PostgresStore) Delete(ctx context.Context, key string) error
Click to show internal directories.
Click to hide internal directories.