Skip to content

Commit

Permalink
add gs uri to api
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Dec 5, 2023
1 parent 9454bb7 commit a1eee4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type SnapshotItem struct {
BlockHash string `json:"block_hash"`
BlockHeight int `json:"block_height"`
URL string `json:"url"`
GSURI string `json:"gs_uri"`
Filesize string `json:"filesize"`
SHA256 string `json:"sha256"`
ArtifactType ArtifactType `json:"artifact_type"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/store/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,16 @@ func (s *SnapshotStorage) GetSnapshotItems(ctx context.Context) []snapshot.Snaps
}
}

gsURI := "gs://" + s.bucketName + "/" + obj.Name

item := snapshot.SnapshotItem{
Filename: filename,
Filesize: util.FileSize(size),
FilesizeBytes: size,
ChainName: snapshotHeader.SanitizeChainName(),
Date: date,
BlockTimestamp: snapshotHeader.Timestamp,
GSURI: gsURI,
URL: obj.MediaLink,
BlockHash: snapshotHeader.BlockHash,
BlockHeight: snapshotHeader.Level,
Expand Down

0 comments on commit a1eee4f

Please sign in to comment.