Documentation
¶
Overview ¶
Package config persists per-customer workspace aliases and favourites to a JSON file on disk. Each customer has a list of Environments where an Environment is an alias (e.g. "DEV", "feature") paired with the Fabric workspace display name that alias resolves to.
Index ¶
- func AddCustomer(path string, name string, customer Customer) error
- func EditCustomer(path string, name string, customer Customer) error
- func GetConfigPath() string
- func RemoveCustomer(path string, name string) error
- func Save(path string, cfg Config) error
- func SetFavorites(path string, name string, favorites []NotebookFavorite) error
- type Config
- type Customer
- type Environment
- type NotebookFavorite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigPath ¶
func GetConfigPath() string
GetConfigPath returns the platform-appropriate config location.
func RemoveCustomer ¶
func SetFavorites ¶
func SetFavorites(path string, name string, favorites []NotebookFavorite) error
Types ¶
type Customer ¶
type Customer struct {
Environments []Environment `json:"environments"`
Favorites []NotebookFavorite `json:"favorites,omitempty"`
}
Customer groups one tenant's environments and notebook favourites. A customer with zero Environments is valid — they just can't run notebooks until they add at least one via `futils edit`.
func (Customer) FavoriteFor ¶
func (c Customer) FavoriteFor(name string) (NotebookFavorite, bool)
FavoriteFor returns the favourite entry for the given notebook name, and a boolean indicating whether it was found.
func (Customer) FavoriteNames ¶
FavoriteNames returns the display names of favourited notebooks in saved order.
func (*Customer) UnmarshalJSON ¶
UnmarshalJSON transparently migrates three legacy shapes onto the current `environments: [{alias, workspaces: []}]` form:
- `workspace_pattern` + `environments: [string]` — earliest shape, a pattern with {env} placeholder substituted per env alias.
- `environments: [{alias, workspace_name: string}]` — intermediate shape, single workspace per alias.
- `environments: [{alias, workspaces: []string}]` — current shape.
Detection peeks at the first env entry: a quote means string (#1), otherwise it's an object — and we look for `workspace_name` (#2) vs `workspaces` (#3) inside it. On next Save the file is rewritten in the current shape and legacy fields disappear.
func (Customer) Workspaces ¶
Workspaces returns the workspace display names mapped to an alias, plus a boolean indicating whether the alias was found. Callers that previously expected a single workspace should now iterate the slice — every flow that resolves items by env is expected to aggregate across all of them.
type Environment ¶
Environment pairs a user-chosen alias (menu label) with one or more Fabric workspaces it resolves to. Multiple workspaces per alias is the common case for real Fabric deployments — e.g. a "DEV" environment often spans both a Config workspace (notebooks) and a SemMod workspace (semantic models). Run / Refresh aggregate items across every workspace under the chosen alias.
type NotebookFavorite ¶
type NotebookFavorite struct {
Name string `json:"name"`
Parameters []string `json:"parameters,omitempty"`
}
NotebookFavorite pins a single notebook (by displayName) and optionally a subset of its parameters. An empty Parameters slice means "no filter — show all parameters the Papermill cell declares".