Documentation
¶
Index ¶
- Variables
- type APIKey
- type ShortURL
- type Storage
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(key uint64) error
- func (s *Store) Load(key uint64) (string, error)
- func (s *Store) LoadInfo(key uint64) (*ShortURL, error)
- func (s *Store) Register(obj *APIKey) error
- func (s *Store) Retrieve(clientID string) (*APIKey, error)
- func (s *Store) Save(obj *ShortURL) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("object not found in database") ErrAlreadyExists = errors.New("object already exists in the database") )
Functions ¶
This section is empty.
Types ¶
type APIKey ¶ added in v1.0.0
type APIKey struct {
ClientID string `msgpack:"client_id"`
DerivedKey string `msgpack:"derived_key"`
Created time.Time `msgpack:"created"`
Modified time.Time `msgpack:"modified"`
}
func (*APIKey) MarshalValue ¶ added in v1.0.0
func (*APIKey) UnmarshalValue ¶ added in v1.0.0
type ShortURL ¶
type ShortURL struct {
ID uint64 `msgpack:"id"`
URL string `msgpack:"url"`
Expires time.Time `msgpack:"expires"`
Visits uint64 `msgpack:"visits"`
Created time.Time `msgpack:"created"`
Modified time.Time `msgpack:"modified"`
CreatedBy string `msgpack:"created_by"`
}
func (*ShortURL) MarshalValue ¶
func (*ShortURL) UnmarshalValue ¶
type Storage ¶
Click to show internal directories.
Click to hide internal directories.