feat(storage): rpc based implementation
All checks were successful
arcad/edge/pipeline/pr-master This commit looks good
All checks were successful
arcad/edge/pipeline/pr-master This commit looks good
This commit is contained in:
42
pkg/storage/driver/rpc/gob/blob_info.go
Normal file
42
pkg/storage/driver/rpc/gob/blob_info.go
Normal file
@ -0,0 +1,42 @@
|
||||
package gob
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"forge.cadoles.com/arcad/edge/pkg/storage"
|
||||
)
|
||||
|
||||
type BlobInfo struct {
|
||||
Bucket_ string
|
||||
ContentType_ string
|
||||
BlobID_ storage.BlobID
|
||||
ModTime_ time.Time
|
||||
Size_ int64
|
||||
}
|
||||
|
||||
// Bucket implements storage.BlobInfo.
|
||||
func (bi *BlobInfo) Bucket() string {
|
||||
return bi.Bucket_
|
||||
}
|
||||
|
||||
// ContentType implements storage.BlobInfo.
|
||||
func (bi *BlobInfo) ContentType() string {
|
||||
return bi.ContentType_
|
||||
}
|
||||
|
||||
// ID implements storage.BlobInfo.
|
||||
func (bi *BlobInfo) ID() storage.BlobID {
|
||||
return bi.BlobID_
|
||||
}
|
||||
|
||||
// ModTime implements storage.BlobInfo.
|
||||
func (bi *BlobInfo) ModTime() time.Time {
|
||||
return bi.ModTime_
|
||||
}
|
||||
|
||||
// Size implements storage.BlobInfo.
|
||||
func (bi *BlobInfo) Size() int64 {
|
||||
return bi.Size_
|
||||
}
|
||||
|
||||
var _ storage.BlobInfo = &BlobInfo{}
|
18
pkg/storage/driver/rpc/gob/init.go
Normal file
18
pkg/storage/driver/rpc/gob/init.go
Normal file
@ -0,0 +1,18 @@
|
||||
package gob
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"time"
|
||||
|
||||
"forge.cadoles.com/arcad/edge/pkg/storage"
|
||||
)
|
||||
|
||||
func init() {
|
||||
gob.Register(storage.Document{})
|
||||
gob.Register(storage.DocumentID(""))
|
||||
gob.Register(time.Time{})
|
||||
gob.Register(map[string]interface{}{})
|
||||
gob.Register([]interface{}{})
|
||||
gob.Register([]map[string]interface{}{})
|
||||
gob.Register(&BlobInfo{})
|
||||
}
|
Reference in New Issue
Block a user