mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 10:47:19 +03:00
* Add share table and repository * Add datastore mock * Try fixing indent * Try fixing indent - 2 * Try fixing indent - 3 * Implement rest.Repository and rest.Persistance * Renew date * Better error handling * Improve field name * Fix json name conventionally
25 lines
637 B
Go
25 lines
637 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Share struct {
|
|
ID string `json:"id" orm:"column(id)"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
ExpiresAt time.Time `json:"expiresAt"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
LastVisitedAt time.Time `json:"lastVisitedAt"`
|
|
ResourceIDs string `json:"resourceIds" orm:"column(resource_ids)"`
|
|
ResourceType string `json:"resourceType"`
|
|
VisitCount string `json:"visitCount"`
|
|
}
|
|
|
|
type Shares []Share
|
|
|
|
type ShareRepository interface {
|
|
Put(s *Share) error
|
|
GetAll(options ...QueryOptions) (Shares, error)
|
|
}
|