2024-04-18 15:13:16 +00:00
|
|
|
package bundle
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/databricks/cli/bundle/config"
|
2024-07-03 10:13:22 +00:00
|
|
|
"github.com/databricks/cli/libs/vfs"
|
2024-04-18 15:13:16 +00:00
|
|
|
"github.com/databricks/databricks-sdk-go"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ReadOnlyBundle struct {
|
|
|
|
b *Bundle
|
|
|
|
}
|
|
|
|
|
|
|
|
func ReadOnly(b *Bundle) ReadOnlyBundle {
|
|
|
|
return ReadOnlyBundle{b: b}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyBundle) Config() config.Root {
|
|
|
|
return r.b.Config
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyBundle) RootPath() string {
|
2024-09-27 10:03:05 +00:00
|
|
|
return r.b.BundleRootPath
|
2024-04-18 15:13:16 +00:00
|
|
|
}
|
|
|
|
|
2024-07-03 10:13:22 +00:00
|
|
|
func (r ReadOnlyBundle) BundleRoot() vfs.Path {
|
|
|
|
return r.b.BundleRoot
|
|
|
|
}
|
|
|
|
|
2024-08-21 15:33:25 +00:00
|
|
|
func (r ReadOnlyBundle) SyncRoot() vfs.Path {
|
|
|
|
return r.b.SyncRoot
|
|
|
|
}
|
|
|
|
|
2024-11-18 15:05:21 +00:00
|
|
|
func (r ReadOnlyBundle) SyncRootPath() string {
|
|
|
|
return r.b.SyncRootPath
|
|
|
|
}
|
|
|
|
|
2024-04-18 15:13:16 +00:00
|
|
|
func (r ReadOnlyBundle) WorkspaceClient() *databricks.WorkspaceClient {
|
|
|
|
return r.b.WorkspaceClient()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyBundle) CacheDir(ctx context.Context, paths ...string) (string, error) {
|
|
|
|
return r.b.CacheDir(ctx, paths...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyBundle) GetSyncIncludePatterns(ctx context.Context) ([]string, error) {
|
|
|
|
return r.b.GetSyncIncludePatterns(ctx)
|
|
|
|
}
|