navidrome/model/share.go
Yash Jipkate 327c259a3d
Create share table and repository. (#930)
* 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
2021-05-30 11:50:35 -04:00

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)
}