74 lines
1.5 KiB
Go
74 lines
1.5 KiB
Go
package bootstrap
|
|
|
|
import "context"
|
|
|
|
func (service *Service) GetState(ctx context.Context) (BootstrapState, error) {
|
|
installation, err := service.GetInstallation(ctx)
|
|
if err != nil {
|
|
return BootstrapState{}, err
|
|
}
|
|
|
|
admin, err := service.GetAdmin(ctx)
|
|
if err != nil {
|
|
return BootstrapState{}, err
|
|
}
|
|
|
|
structure, err := service.GetStructure(ctx)
|
|
if err != nil {
|
|
return BootstrapState{}, err
|
|
}
|
|
|
|
return BootstrapState{
|
|
Installation: installation,
|
|
Admin: admin,
|
|
Structure: structure,
|
|
}, nil
|
|
}
|
|
|
|
func (service *Service) GetAppShellState(ctx context.Context) (AppShellState, error) {
|
|
installation, err := service.GetInstallation(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
admin, err := service.GetAdmin(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
organizations, err := service.listOrganizations(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
departments, err := service.listDepartments(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
teams, err := service.listTeams(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
projects, err := service.listProjects(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
workspaces, err := service.listWorkspaces(ctx)
|
|
if err != nil {
|
|
return AppShellState{}, err
|
|
}
|
|
|
|
return AppShellState{
|
|
Installation: installation,
|
|
Admin: admin,
|
|
Organizations: organizations,
|
|
Departments: departments,
|
|
Teams: teams,
|
|
Projects: projects,
|
|
Workspaces: workspaces,
|
|
}, nil
|
|
}
|