package Filesystem import ( bolt "go.etcd.io/bbolt" ) func AddFileToBucket(bucket *bolt.Bucket, filePath string) error { var ( fileObject FileObject fileObjectBytes []byte err error ) fileObject, err = CreateFileObject(filePath) if err != nil { return nil } fileObjectBytes, err = fileObject.ToBytes() if err != nil { return err } return bucket.Put([]byte(StripRootDir(filePath)), fileObjectBytes) } func RemoveFileFromBucket(bucket *bolt.Bucket, filePath string) error { return bucket.Delete([]byte(StripRootDir(filePath))) }