Add model for storing albums locally

This commit is contained in:
Neeraj Gupta 2023-09-23 09:33:44 +05:30
parent c102fe9281
commit 564696e0ef
3 changed files with 47 additions and 0 deletions

25
pkg/log/debug_print.go Normal file
View 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)
}

View 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
View 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"`
}