Documentation
¶
Index ¶
- Variables
- func Switch(model tea.Model, width, height int) (tea.Model, tea.Cmd)
- type Controller
- func (c *Controller) Done() error
- func (c *Controller) LoadGroups() tea.Cmd
- func (c *Controller) LoadOperations() tea.Cmd
- func (c *Controller) LoadPolicies() tea.Cmd
- func (c *Controller) LoadPolicyOptions() tea.Cmd
- func (c *Controller) LoadResources() tea.Cmd
- func (c *Controller) LoadServices() tea.Cmd
- func (c *Controller) LoadUsers() tea.Cmd
- func (c *Controller) Next() tea.Model
- type CreatePolicy
- type FailedMsg
- type GroupList
- type GroupLoadedMsg
- type OperationList
- type OperationLoadedMsg
- type OperationType
- type PolicyList
- type PolicyLoadedMsg
- type PolicyOptionList
- type PolicyOptionLoadedMsg
- type PolicyOptionType
- type ResourceList
- type ResourceLoadedMsg
- type Result
- type ServiceList
- type ServiceLoadedMsg
- type State
- func (s *State) GetGroup() *models.Group
- func (s *State) GetOperation() *models.Operation
- func (s *State) GetPolicy() *models.Policy
- func (s *State) GetPolicyOption() *models.PolicyOption
- func (s *State) GetResource() *models.Resource
- func (s *State) GetService() *models.Service
- func (s *State) GetUser() *models.User
- func (s *State) SetGroup(group *models.Group)
- func (s *State) SetOperation(operation *models.Operation)
- func (s *State) SetPolicy(policy *models.Policy)
- func (s *State) SetPolicyOption(policyOption *models.PolicyOption)
- func (s *State) SetResource(resource *models.Resource)
- func (s *State) SetService(service *models.Service)
- func (s *State) SetUser(user *models.User)
- type Styles
- type UserList
- type UserLoadedMsg
Constants ¶
This section is empty.
Variables ¶
var ReachableOperations = map[OperationType]models.Operation{ AttachPolicySlug: { Id: AttachPolicySlug.String(), Name: "Attach Policy (attach_policy)", Desc: "Assign a policy to the user.", }, DetachPolicySlug: { Id: DetachPolicySlug.String(), Name: "Detach Policy (detach_policy)", Desc: "Remove a policy from the user.", }, AddToGroupSlug: { Id: AddToGroupSlug.String(), Name: "Add to Group (add_to_group)", Desc: "Include the user in a group.", }, RemoveFromGroupSlug: { Id: RemoveFromGroupSlug.String(), Name: "Remove from Group (remove_from_group)", Desc: "Exclude the user from a group.", }, AttachCustomPolicySlug: { Id: AttachCustomPolicySlug.String(), Name: "Attach Custom Policy (attach_custom_policy)", Desc: "Create and attach a custom policy.", }, }
ReachableOperations Predefined list of actions with their names and descriptions
var ReachablePolicyOptions = map[PolicyOptionType]models.PolicyOption{ WithoutResourceSlug: { Id: WithoutResourceSlug.String(), Name: "Without Resource (without_resource)", Desc: "Applies globally without a resource.", }, WithResourceSlug: { Id: WithResourceSlug.String(), Name: "With Resource (with_resource)", Desc: "Scoped to a specific resource.", }, }
ReachableCustomPolicyOptions Predefined list of custom policy options with their names and descriptions
Functions ¶
Types ¶
type Controller ¶
type Controller struct {
State *State
// contains filtered or unexported fields
}
func NewController ¶
func NewController(api *aws.Api, openaiApiKey string, state *State) *Controller
func (*Controller) Done ¶
func (c *Controller) Done() error
func (*Controller) LoadGroups ¶
func (c *Controller) LoadGroups() tea.Cmd
LoadGroups loads groups from the AWS API.
func (*Controller) LoadOperations ¶
func (c *Controller) LoadOperations() tea.Cmd
LoadOperations loads operations.
func (*Controller) LoadPolicies ¶
func (c *Controller) LoadPolicies() tea.Cmd
LoadPolicies loads policies.
func (*Controller) LoadPolicyOptions ¶
func (c *Controller) LoadPolicyOptions() tea.Cmd
LoadPolicyOptions loads operations.
func (*Controller) LoadResources ¶
func (c *Controller) LoadResources() tea.Cmd
LoadResources loads resources.
func (*Controller) LoadServices ¶
func (c *Controller) LoadServices() tea.Cmd
LoadServices loads services.
func (*Controller) LoadUsers ¶
func (c *Controller) LoadUsers() tea.Cmd
LoadUsers loads users from the AWS API.
func (*Controller) Next ¶
func (c *Controller) Next() tea.Model
Next determines the next step based on the current state.
type CreatePolicy ¶
type CreatePolicy struct {
// contains filtered or unexported fields
}
func NewCreatePolicy ¶
func NewCreatePolicy(controller *Controller) CreatePolicy
func (CreatePolicy) Init ¶
func (m CreatePolicy) Init() tea.Cmd
func (CreatePolicy) View ¶
func (m CreatePolicy) View() string
type GroupList ¶
type GroupList struct {
// contains filtered or unexported fields
}
func NewGroupList ¶
func NewGroupList(controller *Controller) GroupList
type GroupLoadedMsg ¶
type OperationList ¶
type OperationList struct {
// contains filtered or unexported fields
}
func NewOperationList ¶
func NewOperationList(controller *Controller) OperationList
func (OperationList) Init ¶
func (m OperationList) Init() tea.Cmd
func (OperationList) View ¶
func (m OperationList) View() string
type OperationLoadedMsg ¶
type OperationType ¶
type OperationType string
const ( AttachPolicySlug OperationType = "attach_policy" DetachPolicySlug OperationType = "detach_policy" AddToGroupSlug OperationType = "add_to_group" RemoveFromGroupSlug OperationType = "remove_from_group" AttachCustomPolicySlug OperationType = "attach_custom_policy" )
Constants representing user operations and their slugs
func (OperationType) String ¶
func (o OperationType) String() string
type PolicyList ¶
type PolicyList struct {
// contains filtered or unexported fields
}
func NewPolicyList ¶
func NewPolicyList(controller *Controller) PolicyList
func (PolicyList) Init ¶
func (m PolicyList) Init() tea.Cmd
func (PolicyList) View ¶
func (m PolicyList) View() string
type PolicyLoadedMsg ¶
type PolicyOptionList ¶
type PolicyOptionList struct {
// contains filtered or unexported fields
}
func NewPolicyOptionList ¶
func NewPolicyOptionList(controller *Controller) PolicyOptionList
func (PolicyOptionList) Init ¶
func (m PolicyOptionList) Init() tea.Cmd
func (PolicyOptionList) View ¶
func (m PolicyOptionList) View() string
type PolicyOptionLoadedMsg ¶
type PolicyOptionType ¶
type PolicyOptionType string
const ( WithoutResourceSlug PolicyOptionType = "without_resource" WithResourceSlug PolicyOptionType = "with_resource" )
Constants representing custom policy options and their slugs
func (PolicyOptionType) String ¶
func (o PolicyOptionType) String() string
type ResourceList ¶
type ResourceList struct {
// contains filtered or unexported fields
}
func NewResourceList ¶
func NewResourceList(controller *Controller) ResourceList
func (ResourceList) Init ¶
func (m ResourceList) Init() tea.Cmd
func (ResourceList) View ¶
func (m ResourceList) View() string
type ResourceLoadedMsg ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func NewResult ¶
func NewResult(controller *Controller) Result
type ServiceList ¶
type ServiceList struct {
// contains filtered or unexported fields
}
func NewServiceList ¶
func NewServiceList(controller *Controller) ServiceList
func (ServiceList) Init ¶
func (m ServiceList) Init() tea.Cmd
func (ServiceList) View ¶
func (m ServiceList) View() string
type ServiceLoadedMsg ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) GetOperation ¶
GetOperation retrieves the operation from the state.
func (*State) GetPolicyOption ¶
func (s *State) GetPolicyOption() *models.PolicyOption
GetPolicyOption retrieves the policy option from the state.
func (*State) GetResource ¶
GetResource retrieves the resource from the state.
func (*State) GetService ¶
GetService retrieves the service from the state.
func (*State) SetOperation ¶
SetOperation updates the action in the state.
func (*State) SetPolicyOption ¶
func (s *State) SetPolicyOption(policyOption *models.PolicyOption)
SetPolicyOption updates the policy option in the state.
func (*State) SetResource ¶
SetResource updates the resource in the state.
func (*State) SetService ¶
SetService updates the service in the state.
type Styles ¶
type UserList ¶
type UserList struct {
// contains filtered or unexported fields
}
func NewUserList ¶
func NewUserList(controller *Controller) UserList