func NewBundle(opts ...BundleOption) *Bundle {
	b := defaultBundle()
	for _, apply := range opts {
		apply(b)
	}
	if b.MetricsEnabled() {
		b.m = b.EnsureMetrics("core", &M{}).(*M)
	}
	return b
}
NewBundle creates a new bundle
package core
import (
	"context"
	"fmt"
	"time"
	context2 "github.com/oneconcern/datamon/pkg/context"
	"github.com/oneconcern/datamon/pkg/metrics"
	"github.com/oneconcern/datamon/pkg/dlogger"
	"go.uber.org/zap"
	"github.com/segmentio/ksuid"
	"github.com/oneconcern/datamon/pkg/core/status"
	"github.com/oneconcern/datamon/pkg/model"
	"github.com/oneconcern/datamon/pkg/storage"
)
type Bundle struct {
	RepoID                      string
	BundleID                    string
	ConsumableStore             storage.Store
	contextStores               context2.Stores
	BundleDescriptor            model.BundleDescriptor
	BundleEntries               []model.BundleEntry
	l                           *zap.Logger
	SkipOnError                 bool  
	Retry                       bool  
	concurrentFileUploads       int
	concurrentFileDownloads     int
	concurrentFilelistDownloads int
	metrics.Enable
	m *M
}
func (b *Bundle) setBundleID(id string) {
	b.BundleID = id
	b.BundleDescriptor.ID = id
}
func (b *Bundle) InitializeBundleID() error {
	id, err := ksuid.NewRandom()
	if err != nil {
		return err
	}
	b.setBundleID(id.String())
	return nil
}
func (b *Bundle) GetBundleEntries() []model.BundleEntry {
	return b.BundleEntries
}
func (b *Bundle) BlobStore() storage.Store {
	return getBlobStore(b.contextStores)
}
func getBlobStore(stores context2.Stores) storage.Store {
	if stores == nil {
		return nil
	}
	return stores.Blob()
}
func (b *Bundle) MetaStore() storage.Store {
	return getMetaStore(b.contextStores)
}
func getMetaStore(stores context2.Stores) storage.Store {
	if stores == nil {
		return nil
	}
	return stores.Metadata()
}
func (b *Bundle) VMetaStore() storage.Store {
	return getVMetaStore(b.contextStores)
}
func getVMetaStore(stores context2.Stores) storage.Store {
	if stores == nil {
		return nil
	}
	return stores.VMetadata()
}
func (b *Bundle) WALStore() storage.Store {
	return getWALStore(b.contextStores)
}
func getWALStore(stores context2.Stores) storage.Store {
	if stores == nil {
		return nil
	}
	return stores.Wal()
}
func (b *Bundle) ReadLogStore() storage.Store {
	return getReadLogStore(b.contextStores)
}
func getReadLogStore(stores context2.Stores) storage.Store {
	if stores == nil {
		return nil
	}
	return stores.ReadLog()
}
func defaultBundle() *Bundle {
	return &Bundle{
		BundleDescriptor:            *model.NewBundleDescriptor(),
		RepoID:                      "",
		BundleID:                    "",
		ConsumableStore:             nil,
		BundleEntries:               make([]model.BundleEntry, 0, 1024),
		concurrentFileUploads:       20,
		concurrentFileDownloads:     10,
		concurrentFilelistDownloads: 10,
		l:                           dlogger.MustGetLogger("info"),
	}
}