Documentation
¶
Overview ¶
Package storage provides the implementation of the storage interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage interface {
// Insert adds a new TinyURL record to the storage.
Insert(ctx context.Context, short uint64, longURL []byte) (*TinyURL, error)
// GetByLongURL retrieves a TinyURL record by its original URL.
GetByLongURL(ctx context.Context, long []byte) (*TinyURL, error)
// GetByShortID retrieves a TinyURL record by its short ID.
GetByShortID(ctx context.Context, short uint64) (*TinyURL, error)
// Delete a short link by short id
Delete(ctx context.Context, short uint64) error
// Close closes the storage.
Close() error
}
Storage is an interface that defines the methods that a storage system must implement.
Click to show internal directories.
Click to hide internal directories.