Documentation ¶
Index ¶
- type Service
- func (s *Service) BuildPolicies(en string) error
- func (s *Service) CreateGraphClientFromDefaultAzureCredential() error
- func (s *Service) CreateGraphClientFromEnvironment() error
- func (s *Service) DeletePolicies() error
- func (s *Service) DeployPolicies(en string) error
- func (s *Service) FindConfig(n string) (*environment.Config, error)
- func (s *Service) GetGraphClient() *msgraph.ServiceClient
- func (s *Service) ListPolicies() error
- func (s *Service) MustWithSourceDir(dir string)
- func (s *Service) MustWithTargetDir(dir string)
- func (s *Service) WithEnvironments(environments []environment.Config)
- func (s *Service) WithSourceDir(dir string) error
- func (s *Service) WithTargetDir(dir string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { TenantInformation models.TenantInformationable // contains filtered or unexported fields }
Service represents a service that provides operations related to environments and policies.
func NewServiceFromConfigFile ¶ added in v0.7.0
NewServiceFromConfigFile creates a new instance of Service by loading the environment configuration from the provided file path and initializing the necessary variables. It returns a pointer to the Service instance and an error, if any.
func (*Service) BuildPolicies ¶
BuildPolicies builds policies for a given environment. It reads the configuration file for the specified environment, processes the settings, and writes the policies to the target directory. Parameters:
- en: the name of the environment
Returns:
- error: an error if any occurred during the process
func (*Service) CreateGraphClientFromDefaultAzureCredential ¶ added in v0.7.0
func (*Service) CreateGraphClientFromEnvironment ¶ added in v0.7.0
CreateGraphClientFromEnvironment creates a new instance of the Microsoft Graph service client using environment variable configuration. It returns a pointer to the ServiceClient instance and an error if the creation fails.
func (*Service) DeletePolicies ¶
DeletePolicies deletes policies for a given environment. It finds the configuration file for the specified environment, creates a graph client, and calls the DeletePolicies method on the client. Parameters:
- en: the name of the environment
Returns:
- error: an error if any occurred during the process
func (*Service) DeployPolicies ¶
DeployPolicies deploys policies for a given environment. It finds the configuration file for the specified environment, creates a graph client, and uploads batches of policies.
Parameters:
- en: the name of the environment
Returns:
- error: an error if any occurred during the deployment
func (*Service) FindConfig ¶ added in v0.7.0
func (s *Service) FindConfig(n string) (*environment.Config, error)
FindConfig searches for the environment configuration with the specified name. It returns a pointer to the Config instance and an error, if the environment is not found.
func (*Service) GetGraphClient ¶ added in v0.7.0
func (s *Service) GetGraphClient() *msgraph.ServiceClient
func (*Service) ListPolicies ¶
ListPolicies retrieves a list of policies for a given environment
Parameters: - en: the name of the environment
Returns: - error: an error if any occurred during the process.
func (*Service) MustWithSourceDir ¶ added in v0.8.0
func (*Service) MustWithTargetDir ¶ added in v0.8.0
func (*Service) WithEnvironments ¶ added in v0.7.0
func (s *Service) WithEnvironments(environments []environment.Config)