Add model for storing albums locally
This commit is contained in:
parent
c102fe9281
commit
564696e0ef
25
pkg/log/debug_print.go
Normal file
25
pkg/log/debug_print.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
"cli-go/pkg/model"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// This file contains functions that are used to print debug information to the console.
|
||||
|
||||
func PrintAlbum(a *model.Album) {
|
||||
fmt.Printf("ID: %d\n", a.ID)
|
||||
fmt.Printf("OwnerID: %d\n", a.OwnerID)
|
||||
fmt.Printf("AlbumName: %s\n", a.AlbumName)
|
||||
fmt.Printf("AlbumKey: %s\n", a.AlbumKey.CipherText)
|
||||
if a.PrivateMeta != nil {
|
||||
fmt.Printf("PrivateMeta: %s\n", *a.PrivateMeta)
|
||||
}
|
||||
if a.PublicMeta != nil {
|
||||
fmt.Printf("PublicMeta: %s\n", *a.PublicMeta)
|
||||
}
|
||||
if a.SharedMeta != nil {
|
||||
fmt.Printf("SharedMeta: %s\n", *a.SharedMeta)
|
||||
}
|
||||
fmt.Printf("LastUpdatedAt: %d\n", a.LastUpdatedAt)
|
||||
}
|
10
pkg/mappers/album_mapper.go
Normal file
10
pkg/mappers/album_mapper.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package mappers
|
||||
|
||||
import (
|
||||
"cli-go/internal/api"
|
||||
"cli-go/pkg/model"
|
||||
)
|
||||
|
||||
func MapCollectionToAlbum(collection *api.Collection, collectionKey, cliKey []byte) (*model.Album, error) {
|
||||
panic("not implemented")
|
||||
}
|
12
pkg/model/album.go
Normal file
12
pkg/model/album.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package model
|
||||
|
||||
type Album struct {
|
||||
ID int64 `json:"id"`
|
||||
OwnerID int64 `json:"ownerID"`
|
||||
AlbumName string `json:"albumName"`
|
||||
AlbumKey EncString `json:"albumKey"`
|
||||
PublicMeta *string `json:"publicMeta"`
|
||||
PrivateMeta *string `json:"privateMeta"`
|
||||
SharedMeta *string `json:"sharedMeta"`
|
||||
LastUpdatedAt int64 `json:"lastUpdatedAt"`
|
||||
}
|
Loading…
Reference in a new issue